05-15-2007 04:09 PM
05-15-2007 04:32 PM
05-15-2007 06:54 PM
@Ramteke wrote:
I am trying to monitor 3 boolean controls within loop. Currently I am using references to monitor the state change.
It is a bit ambiguous what you possibly mean by "monitor".
To detect state changes, put the value in a shift register, which you compare with the control value in the next iteration using e.g. "not equal". You'll get a TRUE whenever the value has just changed.
If the booleans are just controls waiting for user input, use an event structure.
05-16-2007 09:07 AM
05-16-2007 09:09 AM
05-16-2007 09:16 AM
05-16-2007 10:18 AM - edited 05-16-2007 10:18 AM
Ramteke wrote:I understand that event structures are the best way of doing this but would it be a problem if I used event structures every where I monitor the boolean controls?
It would really help if you could attach a small example VI to show what you are doing.
Suddenly you "monitor" controls in many different places? Why? What do you need to do when the state changes, and in how many independent places do you need to do it?
Does the loop spin always or is it sufficient if it spins only when one of the values change?
I often have several parallel loops containing event structures, some of them even listening to the same events (e.g. "stop": see Stopevent.vi). There is no problem with that. It gets a bit more tricky if you place more than one event structure in the same loop. Thypcally a bad idea because they tend to block each other. But even here, you could make all event structures in the same loop "transparent" with near zero timeouts and set the loop pacing elsewhere.
Still, I do not recommend overuse of event structures. One or two are often enough. Please also read the recommendations in the online help.
Message Edited by altenbach on 05-16-2007 08:19 AM
05-16-2007 10:33 AM