Showing results 1 to 10 of 22

Thread: How change the state of variable in AddIn Runtime service

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    22.11.2017
    Posts
    14

    Default How change the state of variable in AddIn Runtime service

    Hi copa-data, 
    (working with zenon 8.0, AddIn Runtime service)

    i am trying to change the state of variable, specifically the status bit 9 REVISION. 
    I found in documentation one method of IVariable to set a value with lowerState (http://onlinehelp.copadata.com/help/760/addin/html/Variable-IVariable.htm)

    variable.lowerState // 4333568
     variable.SetValue(variable.GetValue(0), statusInt, DateTime.Now.Minute, (Int16)DateTime.Now.Millisecond); // statusInt = 4325376
    variable.lowerState // still 4333568

    Do i something wrong ?? Is there other way how to change a variable state?? 

    Best regards
    and thank you for your time.

  2. #2
    Join Date
    01.07.2008
    Location
    Salzburg, AT
    Posts
    799

    Default Re: How change the state of variable in AddIn Runtime service

    Is it an Internal variable?

  3. #3
    Join Date
    22.11.2017
    Posts
    14

    Default Re: How change the state of variable in AddIn Runtime service

    Thank you, for fast response. 

    Yes, some of them are Internal Variable, but some are not. 
    For internal variables is not possible to set a lowerState/value ? 


    Maybe i have to check the box with "Write set value" or is enough "Write set value via VBA" though i use AddIn?

    Thank you
    Attached Thumbnails Attached Thumbnails Snímek obrazovky 2019-07-10 v*9.40.01.png  

  4. #4
    Join Date
    28.02.2013
    Posts
    146

    Default Re: How change the state of variable in AddIn Runtime service

    Please activate the setting "Status/Timestamp for Variables of internal Driver" in the general project settings in the section "runtime settings".

  5. #5
    Join Date
    22.11.2017
    Posts
    14

    Default Re: How change the state of variable in AddIn Runtime service

    Hello, 

    thank you a lot. Now i am able to set value vor internal variables, but how is it with non-internal variables with custom driver? 

    Once again thank you for fast responses. 

    Best regrads. 

  6. #6
    Join Date
    01.07.2008
    Location
    Salzburg, AT
    Posts
    799

    Default Re: How change the state of variable in AddIn Runtime service

    the value, status bits (e.g. quality) and time stamps by process variables are always like the PLC sends to zenon in telegrams, not simply like the user wish to have. When user set value to the variable then the driver sends this write request to the PLC and then in the variable you see the result from PLC.
    Last edited by ursulak : 10th July 2019 at 14:50

Similar Threads

  1. Change BOOL state with PopUp window
    By xxxd0nixxx in forum zenon Supervisor
    Replies: 4
    Last Post: 27th September 2018, 08:26
  2. Accessing variables in Runtime wizard and service
    By emrocon in forum Add-In Framework
    Replies: 3
    Last Post: 17th October 2017, 17:12
  3. Replies: 2
    Last Post: 25th August 2017, 11:10
  4. Replies: 3
    Last Post: 23rd October 2013, 17:10

Posting Rules

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