03-22-2010 08:17 PM
My General overall question is which of the below patterns is more efficient / readable / not frowned upon.
The use case here is tripping an alarm. The alarm is a simple boolean single process global that can be set on a number of conditions. In the attached example I've created 3 condition VIs. I get staticly typed VI references to each, and then iterate over them at a set interval to see if any of their conditions trip the alarm. They have standard connector panes.
Would it not be better to just run each of these in it's own timed loop or SubVI containing a timed loop? Which is more efficient?
- Ken
03-22-2010 08:18 PM
03-23-2010 02:10 PM
Ken-
Timed Loops operate a little differently than a While Loop. With a While Loop, the execution can be broken down into different threads on the processor. With a Timed Loop, it only uses one thread and tries to get that one thread done in the time specified. The best is to have multiple Timed Loops, but be sure that they aren't all top priority, that can cause resource problems. The only warning I would give is to reprogram it so that you don't have three copies of the "Reason" shared variable. You don't want a race condition with that. I would merge the outputs of the timed loops and throw the data into one shard variable.
03-23-2010 05:11 PM
03-23-2010 05:24 PM