I am having trouble coming up with a way to write a subVI so that when a Boolean control in the main program is switched, it executes some code once, but not again when the main programs while loop executes again.
Basically, the real world problem I have is that I am attempting to control a latching solenoid valve. What this means is that I don't have to send the valve a constant + or - 12 V, just a short pulse of + or - 12 V to switch it. I am having trouble because I can't seem to write a subVI that will execute this behaviour. I can't use a latching Boolean as I need to be able to make local variables of the switch.
Basically I am looking for how to have the behaviour where I hit the button, and the subVI pulses the valve the correct way once, and then doesn't do anything until I hit the Boolean again. This Boolean button is inside a while loop that is executing indefinetly.
I have tried an event structure with value change on the Boolean being the event detected, but this does not work as a subVI, only if it is in the main VI.
Conor