06-29-2007 10:46 AM - edited 06-29-2007 10:46 AM
Message Edited by Erik_1 on 06-29-2007 08:46 AM
06-29-2007 12:30 PM
Local variables aren't inherently bad, and in some situations you must use them. You definitely need to use the stop local variable to be sure all the loops stop. And I see nothing wrong with the way the other variables being used.
It all comes down to "race conditions" and there are a lot of messages on the subject in the forums worth looking at. It involves problems with timing, are you trying to read a variable before a value of interest gets written to it? Not usually a problem with static type of data, but if you have rapidly changing data like from an acquisition, you could wind up reading the same piece of data twice or completely missing a piece of data if a new value gets written before the previous value gets read. Buffers and queues are the structures that help with these issues.
Also, if you have multiple readers and writers. Do you have 2 places in the program trying to write different values to a variable at the same time? For example, a boolean where one spot of the program writes True and another spot writes False and they are both executing and constantly overwriting each other.
If you don't have these 2 kinds of problems, then local variables aren't going to cause problems. There may be some other situations I'm not thinking of right now that could be a problem, but I'm sure others will chime in if I missed something.
06-29-2007 12:38 PM
06-29-2007 12:46 PM
06-29-2007 06:24 PM
A couple additional questions...
Why did you remove all the error wires? Should I not worry about notifier errors?
I can't seem to get the Auto control sub-loop working properly - any suggestions? What I want to happen is for the user to select auto control, then select a component to test - the VI should then run through that test sequence. It actually seems to do that part properly but when I try to select another component I get some sort of notifier error. I don't want the user to have to select auto control a second time in order to select an additional component - I want it to wait in the auto control sub-loop until the user either changes out of auto control (to manual for example) or selects another component to test. Attached is the code. Even if I select auto control a second time before selecting a component I still get an error....
Thanks!
-Erik
06-30-2007 03:14 PM