Showing results 1 to 4 of 4

Thread: Change a variable at the function in the editor

  1. #1
    Join Date
    06.02.2013
    Posts
    14

    Default Change a variable at the function in the editor

    Hi,
    i guess i have almost the same question, therefore i wrote into this thread.

    i want to change the linked variable of a function (value change function) with VSTA. i export the xml code to get the correct property name. (bold marked)

    Code:
    - 
      setInitValues 
       
      TRUE 
      FALSE 
      FALSE 
      FALSE 
    - 
          1.000000 
             
            0.000000 
            1.000000 
            0 
            TRUE 
            FALSE 
            FALSE 
            0 
            VarName 
             
            FALSE 
      
      
    Isnīt it possible to change "just" the Variable?

    I tried something like
    "myZenWork.ActiveDocument.RtFunctions().Item("setInitValues").set_DynProperties("Variable", "otherVariableName");

    Regards,

    Sven
    Last edited by s.jonigk : 22nd October 2013 at 13:07

  2. #2
    Join Date
    06.02.2013
    Posts
    14

    Default Re: change linked variable of an element during runtime

    Hi,
    Perhaps there is a way to edit or create a new Subitem (SetValue).

    I attached a picture with all the properties, but i donīt know, how do edit them in VSTA

    ProbsMain = get_PropertiesEnum("") of the Function
    probs = get_PropertiesEnum("SetValue") of the Function

    i hope someone got an idea to change the variable of the function...

    Regards,

    Sven
    Attached Thumbnails Attached Thumbnails FunktionENUM.jpg  

  3. #3

    Default Re: Change a variable at the function in the editor

    Hi Sven,

    I created a new thread for your posts, as this actually is quite a different topic

    See the example below:

            public void MacroConfigFunction()
            {
                zenOn.IRtFunction svFunction;
                zenOn.IVariable vVariable;
                svFunction = this.ActiveDocument.RtFunctions().Item("trip");
                
                vVariable = (zenOn.IVariable)svFunction.get_DynProperties("SetValue.Variable");
                this.Application.DebugPrint(vVariable.Name, zenOn.tpDebugPrintStyle.tpMsg);
    
                vVariable = this.ActiveDocument.Variables().Item("S21_Outstation21_G10_1_usint");
                svFunction.set_DynProperties("SetValue.Variable", vVariable);
                vVariable = (zenOn.IVariable)svFunction.get_DynProperties("SetValue.Variable");
                this.Application.DebugPrint(vVariable.Name, zenOn.tpDebugPrintStyle.tpMsg);
            }

    Best regards,
    Mark

  4. #4
    Join Date
    06.02.2013
    Posts
    14

    Default Re: Change a variable at the function in the editor

    Hi markclemens,

    thank you for your advise. I tried it, and it works fine (even in Runtime with ProjectAddin)!!

    Regards,

    Sven

Similar Threads

  1. Replies: 3
    Last Post: 23rd October 2013, 17:10
  2. Minimal external variable change interval to be hooked in zenOn
    By stolyarov_as in forum zenon Supervisor
    Replies: 1
    Last Post: 24th September 2013, 18:38
  3. How to trigger a function when a variable changed?
    By denver in forum zenon Supervisor
    Replies: 1
    Last Post: 16th May 2012, 10:12
  4. Store variable data to file on change event
    By matholton in forum Drivers
    Replies: 1
    Last Post: 1st December 2008, 10:40
  5. Change variable status
    By brada in forum VBA
    Replies: 5
    Last Post: 13th February 2008, 17:55

Posting Rules

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