Showing results 1 to 1 of 1

Thread: Sample writing project information in zenon output window

  1. #1
    Join Date
    28.07.2008
    Posts
    64

    Default Sample writing project information in zenon output window

    In this example, it is demonstrated how the output window of the zenon editors can be accessed using VSTA. The method named Macro1 reads out the process screens created in the project for this, identifies the respective frame and identifies all drivers available as well as their labels.

    using System;
    
    namespace WorkspaceAddin
    
    {
    
    [System.AddIn.AddIn("MyWorkspace", Version = "1.0", Publisher = "", Description = "")]
    
    public partial class MyWorkspace
    
    {
    
    private void MyWorkspace_Startup(object sender, EventArgs e)
    
    {
    
    }
    
    private void MyWorkspace_Shutdown(object sender, EventArgs e)
    
    {
    
    }
    
    public void Macro1()
    
    {
    
    string strPicName = string.Empty;
    
    string strCorTemp = string.Empty;
    
    string strDriverName = string.Empty;
    
    string strDrvDesc = string.Empty;
    
    //print start string into output window
    
    this.Application.DebugPrint(" --------------START--------------", zenOn.tpDebugPrintStyle.tpMsg);
    
    //go through all screens and print name and used template into output window
    
    for (int i = 0; i < this.ActiveDocument.DynScreens().Count; i++)
    
    {
    
    strPicName = this.ActiveDocument.DynScreens().Item(i).Name;
    
    strCorTemp = this.ActiveDocument.DynScreens().Item(i).get_DynProperties("Template").ToString();
    
    this.Application.DebugPrint(" Screen '" + strPicName + "' uses Template '" + strCorTemp + "'",zenOn.tpDebugPrintStyle.tpMsg);
    
    }
    
    //print separator string into output window
    
    this.Application.DebugPrint(" ------------------------------",zenOn.tpDebugPrintStyle.tpMsg);
    
    //go through all drivers and print name and description into output window
    
    for (int i = 0; i < this.ActiveDocument.Drivers().Count; i++)
    
    {
    
    strDriverName = this.ActiveDocument.Drivers().Item(i).Name;
    
    strDrvDesc = this.ActiveDocument.Drivers().Item(i).Identification;
    
    this.Application.DebugPrint(" Driver '" + strDriverName + "' has description '" + strDrvDesc + "'", zenOn.tpDebugPrintStyle.tpMsg);
    
    }
    
    //print end string into output window
    
    this.Application.DebugPrint(" ---------------END---------------", zenOn.tpDebugPrintStyle.tpMsg);
    
    }
    
    #region VSTA generated code
    
    private void InternalStartup()
    
    {
    
    this.Startup += new System.EventHandler(MyWorkspace_Startup);
    
    this.Shutdown += new System.EventHandler(MyWorkspace_Shutdown);
    
    }
    
    #endregion
    
    }
    
    }
    Last edited by tulon : 31st March 2010 at 10:48

Similar Threads

  1. Replies: 1
    Last Post: 25th July 2013, 11:07
  2. CEL log - writing to Windows CE Compact Flash Card
    By mattsd in forum zenon Operator
    Replies: 4
    Last Post: 1st June 2010, 07:30
  3. Replies: 0
    Last Post: 11th March 2010, 15:59
  4. Information Unlimited 16 - Sample
    By robertf in forum VBA
    Replies: 0
    Last Post: 28th November 2008, 13:34
  5. We need further information about web server on zenOn...
    By nuno_duarte in forum zenon Network
    Replies: 4
    Last Post: 18th March 2008, 18:05

Posting Rules

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •