Showing results 1 to 10 of 16

Thread: access to variable adress in Runtime

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    anahita Gast

    Unglücklich access to variable adress in Runtime

    hello
    i really need to access to the variable address in run time
    with this code i finde error


    Public Sub LeftClickDown_Default(obElem As Element)
    
    Dim var1 As Variable
    Dim myVal
     
    Set var1 = thisProject.Variables.Item("Feeder 404 Current")
    
    myVal = var1.Driver.DynProperties("IEC870_IOA1")
       
     
    
    
    MsgBox myVal
    
    End Sub


    if fhis DynProperty doesn't exist in the zenon RT, plz tell me an other way to access address variable in runtime
    Thanks a lot

  2. #2
    Join Date
    30.05.2007
    Location
    Salzburg
    Posts
    879

    Default Re: access to variable adress in Runtime

    Take a look here: http://www.copadata.com/forums/showthread.php?t=1190

    Those variable addressing information (IOA and COA) are only available in the editor - not in the runtime

    A possible workaround would be:
    - a textfile with the needed addressing parameter generated out from the editor
    - in the runtime this file is accessed

    Regards,
    Herbert

  3. #3
    anahita Gast

    Default Re: access to variable adress in Runtime

    thanks for your guidance
    an other question in this case, i need a way to execute macros that i wrote in editor,in runtime environment.
    for exapmle i place a button in runtime project that with click execute editor macros.
    i mean i really need a way to synchronize editor macros with runtime.

  4. #4

    Default Re: access to variable adress in Runtime

    When you compile your runtime files in the editor, and you have created VBA macros in the zenon editor, these VBA macros are available in the runtime after a reload (or a restart) with the compiled runtime files.

    One way to execute a VBA macro in the runtime that is defined in the zenon editor, is to create a zenon function in the editor "execute VBA macro", select the desired macro, and link the function to a button.

    Another way is to create a zenon function "show VBA macro dialog" and link this function with a button.

    A third way, is to create VBA event macros, and link such a macro to a certain button in a screen. For example a LeftClickUp macro can be linked at a button in the editor, which will be executed on this event in the runtime.

  5. #5
    anahita Gast

    Default Re: access to variable adress in Runtime

    the problem is this,i wrote my editor macros in vsta
    when i try to do the first way that you said i see none of my macros to select, whereas i see them in Drop-down list macros

  6. #6

    Default Re: access to variable adress in Runtime

    OK, with VSTA macros, you need to use the function "Execute VSTA Macro".

    Please note, that the VSTA macros for the runtime, are in a different VSTA IDE. (ProjectAddin) The VSTA Macros you see in the dropdownbox in the zenon editor are for the editor only (WorkspaceAddin), and are not available in the runtime.

    Right click on the "Programming interface" project tree node, to open the VSTA IDE for the ProjectAddin (the Alt+F10 notice is incorrect, this opens the WorkspaceAddin), create your VSTA Macros for the runtime here, compile the ProjectAddin, and after that you should be able to select the runtime VSTA macros in the zenon function "Execute VSTA macro"


    The macros must:
    - be public
    - begin with "Macro"
    - not have parameters

Similar Threads

  1. Replies: 1
    Last Post: 19th May 2011, 07:51
  2. Variable Unreadable in runtime
    By whitetaru in forum Drivers
    Replies: 6
    Last Post: 12th May 2011, 03:23
  3. Access to Excel from SCADA Runtime
    By olga in forum VBA
    Replies: 1
    Last Post: 20th November 2010, 02:27
  4. How to access to IEC 60870 IOA adress in Runtime
    By softart2 in forum zenon Energy Edition
    Replies: 1
    Last Post: 16th September 2010, 23:39
  5. Access array variable from VBA
    By mvj in forum VBA
    Replies: 4
    Last Post: 10th March 2010, 15:04

Posting Rules

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