0

Three States Button

Ghita Laurentiu 1 month ago updated 4 weeks ago 5

Hello,

Does anybody knows if is possible to make a button with 3 states? For example OPEN, CLOSE and INTERMEDIATE and to have the possibility to define the back colors for each state. I've tried already to do this with double or integer but I need them to send commands: 

a. when is OPEN and I'm pushing it to send CLOSE command.

b. when is CLOSE and I'm pushing it to send OPEN command.

c. when is INTERMEDIATE to block any commands.

Thanks,

Laurentiu

Hello,

Have you tried with a "Mode" variable. In the visualization you can set colours acording to the value of the variable.


Best regards.

Hello,

Thank you for your answer. 

I have used the "mode" variable for controlling the air condition mode. The problem is that this is automatically opening a window for selecting the modes. So, in other words, this is more a select mode window. What I need is actually a symbol which can be controlled by a double point variable and the symbol to have 4 different status depending on the variable state: 00, 01, 10, 11.

Best Regards

Hi,

So in practice you need a state symbol, with 3 different values depending on the input, right?

Probably I would try to use:

A double/integer/whatever you are using;

A mode variable;

Edit the values, by selecting the mode node, press F3, and on the Unit, create the 3 different states, from 0 to 2;

Add the node to the visualization;

Change the node to read only;

On the visualization, on the Status Values collection of the mode node, change the icon and color as desired;

Add a program, with the double/integer/whatever as input (value on change, allow retrigger)

And on the program:

If double/integer/whatever = a then Mode.value = 0

If double/integer/whatever = b then Mode.value = 1

If double/integer/whatever = c then Mode.value = 2

Something like that...

Depending on the specific use, you might need to fiddle around. But probably I would solve the problem this way.

Assuming that you only need a 4 button state as you refered (that's why I changed the mode node to read only).

Otherwise, you need to be more specific so we can try to help. Like what's you're variable input, etc.

Best regards

By the way, you're asking for a 3 state symbol, but on on your first post you're saying that you want to send values...

So you need to be very specific, so we can try to replicate what you need to do.

Best regards

Hi Ricardo,

First of all thank you for your detailed reply. I'll give it a try immediately.

I think you are right that I was not very specific with my first explanation so I will just try again.

I need a symbol which is capable to give me more info of the actual status of the device which I control but also to give me the possibility to operate the device. As an example, I would like that the symbol can show me the following status: intermediate, open, close and obsolete. I would also like to have the possibility to operate the device with that symbol only if I have a clear position: open or close. 


Thanks again,

Laurentiu