Showing results 1 to 5 of 5

Thread: Switch with more than 2 states

  1. #1
    Join Date
    10.06.2021
    Posts
    3

    Default Switch with more than 2 states

    Hello Everyone,

    I have some difficulties to make what I wanted. I wanted to create a switch with more than 2 possible states and to change the state of the switch when I click on it on RunTime.
    But, I succeeded to create a switch with more than 2 states, but the way to change the value is to set the value with a box. I wanted to know if what I want is possible and how I can do it ?

    Thanks for the help.




  2. #
    Join Date
    01.07.2008
    Location
    Salzburg, AT
    Posts
    1,039
    Best Answer

    Default Re: Switch with more than 2 states

    The look of a symbol can only change if the linked variable changes the value. Thus, also if you link symbol with an internal, not process, variable, this variable must change value by your click on the symbol.

    As if you take just the same variable as command and response, you are doing unusual things, so there is no direct 'Editor: one click' solution.

    I can only repeat my proposal: for demonstration purpose you can use just one and internal variable. Cover your switch symbol with 2 invisible buttons. One button link with zenon function 'write set value' 0 to the variable linked with the symbol and another to set value 1 (both functions with option 'directly to HW'). Depending the switch position you configure - via 'visibility' of the buttons - that only one button is visible: by value 0 (is open) - this to set 1 (close), by other switch positions (1 - close, 2 - intermediate, 3 - error) - this to set value 0 (open).

  3. #2
    Join Date
    01.07.2008
    Location
    Salzburg, AT
    Posts
    1,039

    Default Re: Switch with more than 2 states

    it looks that you want to send a command via the same variables which represent the position of the switch. What communication protocol you plan to use in your system? In professional energy protocol - like IEC 61850, DNP3, IEC 60870 - the commands (outputs) and responses (inputs) are different data points. In this model the commands can only have value 0 or 1 (it is not allowed to force position 'intermediate' or 'error' on the switch). And this control and monitoring directions are split as the mechanics of the switch needs time to move the switch (and sometimes the final result is different as the command -> intermediate /error). 

    For demonstration purpose on only one variable you can cover your switch symbol with 2 invisible buttons. One button link with zenon function 'write set value' 0 and another to set value 1 (both functions with option 'directly to HW'). Depending the switch position you configure - via 'visibility' of the buttons - that only one button is visible: by value 0 (is open) - this to set 1 (close), by other switch positions (1 - close, 2 - intermediate, 3 - error) - this to set value 0 (open).  

  4. #3
    Join Date
    10.06.2021
    Posts
    3

    Default Re: Switch with more than 2 states

    Quote Originally Posted by ursulak View Post
    it looks that you want to send a command via the same variables which represent the position of the switch. What communication protocol you plan to use in your system? In professional energy protocol - like IEC 61850, DNP3, IEC 60870 - the commands (outputs) and responses (inputs) are different data points. In this model the commands can only have value 0 or 1 (it is not allowed to force position 'intermediate' or 'error' on the switch). And this control and monitoring directions are split as the mechanics of the switch needs time to move the switch (and sometimes the final result is different as the command -> intermediate /error). 

    For demonstration purpose on only one variable you can cover your switch symbol with 2 invisible buttons. One button link with zenon function 'write set value' 0 and another to set value 1 (both functions with option 'directly to HW'). Depending the switch position you configure - via 'visibility' of the buttons - that only one button is visible: by value 0 (is open) - this to set 1 (close), by other switch positions (1 - close, 2 - intermediate, 3 - error) - this to set value 0 (open).  


    Thanks for your answer. I will give you more details to understand my issue. This switch is not link to a input or output variable, it's link to an internal variable. What I want to make is to decide the position of my switch on my RunTime, it will not affect the position of the switch in real. I want to make a commutable switch with more than 2 positions and to change the position by clicking on the switch on the RunTime, not by setting a value.

    Thanks for your help.

  5. #4
    Join Date
    01.07.2008
    Location
    Salzburg, AT
    Posts
    1,039
    Best Answer

    Default Re: Switch with more than 2 states

    The look of a symbol can only change if the linked variable changes the value. Thus, also if you link symbol with an internal, not process, variable, this variable must change value by your click on the symbol.

    As if you take just the same variable as command and response, you are doing unusual things, so there is no direct 'Editor: one click' solution.

    I can only repeat my proposal: for demonstration purpose you can use just one and internal variable. Cover your switch symbol with 2 invisible buttons. One button link with zenon function 'write set value' 0 to the variable linked with the symbol and another to set value 1 (both functions with option 'directly to HW'). Depending the switch position you configure - via 'visibility' of the buttons - that only one button is visible: by value 0 (is open) - this to set 1 (close), by other switch positions (1 - close, 2 - intermediate, 3 - error) - this to set value 0 (open).

  6. #5
    Join Date
    10.06.2021
    Posts
    3

    Default Re: Switch with more than 2 states

    Quote Originally Posted by ursulak View Post
    The look of a symbol can only change if the linked variable changes the value. Thus, also if you link symbol with an internal, not process, variable, this variable must change value by your click on the symbol.

    As if you take just the same variable as command and response, you are doing unusual things, so there is no direct 'Editor: one click' solution.

    I can only repeat my proposal: for demonstration purpose you can use just one and internal variable. Cover your switch symbol with 2 invisible buttons. One button link with zenon function 'write set value' 0 to the variable linked with the symbol and another to set value 1 (both functions with option 'directly to HW'). Depending the switch position you configure - via 'visibility' of the buttons - that only one button is visible: by value 0 (is open) - this to set 1 (close), by other switch positions (1 - close, 2 - intermediate, 3 - error) - this to set value 0 (open).

    Hello, thank you for your answer. I tried your solution and it's working well now.
    Have a good day!

Similar Threads

  1. Manipulation 'Screen switch'-Rt-Function via C#
    By michael.winter in forum VSTA
    Replies: 4
    Last Post: 19th November 2014, 14:46
  2. Screen Switch in VBA
    By paruvathakumar in forum VBA
    Replies: 12
    Last Post: 28th August 2012, 01:26
  3. Function switch picture
    By yara in forum Engineering Studio & Service Engine (former zenon Editor & Runtime)
    Replies: 2
    Last Post: 8th December 2010, 06:40
  4. Replies: 2
    Last Post: 22nd April 2010, 14:51
  5. switch to the alternate value
    By westbaaam in forum VBA
    Replies: 1
    Last Post: 29th November 2009, 23: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
  •