LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Trigger Events programmatically

I am writing a program that controls 8 pumps. Each pump has individual controls, such as a start, pause, and stop button, but I would like to add "Master" buttons that can start, pause, and stop all of the pumps with one push of the button. My program is built around an event structure, with one event for each control that can be pushed (based on the Value Change event). Normally I would add the Master Start as a condition for each of the Start events, but I need to wait 100 ms between each instruction to ensure the proper data is communicated to the pumps (they are connected in a daisy-chain via serial ports). Ideally I would have a Master Start event, and from there I could trigger each of the Start commands to True in sequence. However, as far as I can tell I cannot trigger these events programmatically - it requires user input. I have tried wiring True values to local variables referencing these controls to see if that would trigger the Value Change event, but this does not work. Any help would be appreciated. Thanks.
0 Kudos
Message 1 of 5
(15,049 Views)
You can trigger the event programmatically by writing to the "Value (signaling)" property.

You didn't indicate if you have a simple event structure or if you have a producer-consumer setup. If you have a simple event structure you would write to the "Value (Signaling)" event for the first pump and then in that control's "Value Change" event write to the "Value (Signaling)" property for the second pump, and so on to create your daisy chain.

If you have a producer-consumer it's easier to manage as you can just queue up your actions (Activate Pump1, Wait, Activate Pump 2, Wait, etc.) in the "Value Change" event for the "Master" button, and let the consumer loop process each state.
Message 2 of 5
(15,040 Views)
Thanks! I had no idea that Value (Signaling) property existed.
0 Kudos
Message 3 of 5
(15,017 Views)

@smercurio_fc wrote:
You can trigger the event programmatically by writing to the "Value (signaling)" property.

Just a little "heads up":

This does not work if  the  mechanical action of the boolean control is configured as LatchThe call to property node "Value (signaling)" returns error code 1193 in that case - but often this teminal is not wired so the error is not seen.

 

So - make sure the boolean control is set with mechanical action Switch or use another type of control. 

Message 4 of 5
(9,067 Views)

Thanks.  I found this useful too

0 Kudos
Message 5 of 5
(6,902 Views)