LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

isolate event strucutre

Solved!
Go to solution

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

0 Kudos
Message 1 of 6
(3,712 Views)
Solution
Accepted by topic author AVMaine

Try this. I just put your code inside the timeout event. You had it set to never timeout.

 

 

Message 2 of 6
(3,703 Views)

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

0 Kudos
Message 3 of 6
(3,696 Views)
Sorry for the duplicate reply, Dennis beat me to the punch.
0 Kudos
Message 4 of 6
(3,693 Views)

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.

0 Kudos
Message 5 of 6
(3,688 Views)

Awesome! Thats just what I was trying to do.

 

Thank you.

0 Kudos
Message 6 of 6
(3,670 Views)