Lookout

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I use both a GUI switch and a timer to control an output?

Hi, I have no trouble setting up either a gui switch or a timer to switch a hardware output. However, now I am trying to use both to control the same output. That is, the latest change of either the timer or gui switch changes the output. I can do this by setting the gui switch output and the timer output into a software latch and connecting the latch to the hardware. The problem is that now the gui switch does not reflect the state of the hardware output (if the timer changed the state). One solution I can see is that there is both a push button 'change state' as well as an indicator at the gui but I would rather have all the functionality in the 1 switch. Any suggestions welcome!
0 Kudos
Message 1 of 4
(3,052 Views)
I would connect your timer to the value data member of your switch. The only problem I can see with that is, if your timer goes true while your switch is true, then your timer goes false, your switch will follow.

You may also be able to create and expression, (Switch1 or Timer1), then connect the expression to your output.
0 Kudos
Message 2 of 4
(3,052 Views)
It looks like you should be using a flip-flop object. This object changes state each time your input transitions from false to true. Also you would probably be better off using a push button rather tham a switch.

You can tie "your timer OR your pushbutton" to the input of your flip-flop. Then if you display the flip-flop on top of the push button you can easily see which state you are in. Then of course just tie your flip-flop to your output.

**This will work fine as long as you are NOT running multiple client applications. If you are running multiple clients, then it has to be done completely different. If this is the case please let me know and I will explain.

Hope this helps
Message 3 of 4
(3,052 Views)
Yep thanks it helps and I am running multiple clients. It works well and is a simpler solution than the latches and what not.
The timer resides on the server process. The clients can use the toggle button to manually change the output or use a text box to change the timeouts. A client pushbutton GUI which links to the server side process button works fine so I don't understand your comment about a completely different design for multiple clients...
0 Kudos
Message 4 of 4
(3,052 Views)