12-08-2009 11:28 AM
I am controlling a valve using my serial port which sends a signal to turh clockwise or counterclockwise. To cut down on CPU usage I put this in an event structure so that the signal is sent only once as opposed to every iteration, that now works. However this seems to have paused everything. The only time my program advances is when I function the switch for the valve to turn.
How do isolate the action of the event structure so the switch will work, but everything else will work as well. E.g. My elapsed time will display once I activate the switch, but then it wont change until I press the switch again. It's exactly like pressing the lap button on a stopwatch instead of watching the elapsed time progress forward. See attached file to see what I am talking about.
I have tried putting the two parts in their own while loops, but that was met with little success. I am new to labview, so whatever help you can give is welcome, any ideas?
Thanks for your help in advance.
-adam
Solved! Go to Solution.
12-08-2009 11:42 AM
Try this. I just put your code inside the timeout event. You had it set to never timeout.
12-08-2009 11:46 AM
Adam,
To simply get your program working properly, you will need to add a timeout to the event structure (the Event Timeout terminal in the top left corner of the event structure). The way your code is currently, the timeout is set to its default value of -1, so the code will only execute when an event is registered (the behavior you were describing).
Hope this helps.
-RW
12-08-2009 11:47 AM
12-08-2009 11:50 AM
Or just make an other parallel loop.
The problem is, if you mix event-structure with e.g. data acquisition, than e.g. a dialog opens from the event-structure - it will block your other code.
12-08-2009 12:12 PM
Awesome! Thats just what I was trying to do.
Thank you.