08-15-2011 06:25 PM - last edited on 08-16-2011 08:40 AM by Laura F.
I was suprised to learm that this lead to a race condition.
The clear command is processed AFTER the Initialize command.
It took me a while to find the problem, and it was easy to fix. But is this code really a candidate for a race condition?
08-15-2011 06:43 PM
There is no data dependency between the case structure and the Clear action, so LabVIEW can execute them in whatever order is convenient. The placement on the screen may make it easy to be misled, but picture that you could just as easily place the clear action on the right side of the case structure - would that change your assumption about the order in which they would execute?
08-15-2011 09:52 PM
This is why it's always good, and convenient to use error clusters, not only for error handling but to maintain proper data flow for lack of outputs or some other mechanism to pass data on. I no of one technician that doesn't bother to wire up functions and initialization code if it was to the left. LabView will typically flow from left to right and it does as long as things are wired, but if not, there is no guarantee that it will happen.