10-22-2008 12:51 PM
Can anyone tell me why this for loop won't execute in "Security System". Basically I was practicing for the CLD exam by writing the "Security System" practice exam. I wanted to try the Event-Driven State Machine with a queue. My problem is that in the "Check Alarm", "Check Bypass", and "Check Tamper" states, I have a for loop which is indexed with 4 - 6 element arrays. The for loop will not execute 6 times. It won't even execute once. It just skips over the for loop and outputs all boolean falses and zeros for the numeric values. Is this a Labview glitch of some sort?
Thanks for any replies.
Matt Koebel
10-22-2008 12:59 PM
Without looking at the code, my guess would be that one of the indexing inputs into the loop is 0. A for loop will only loop based on the smallest indexing input (an auto-indexing array or the N terminal), so if you have an empty auto-indexing array, the loop will run 0 times.
10-22-2008 01:48 PM - edited 10-22-2008 01:55 PM
tst wrote:Without looking at the code, my guess would be that one of the indexing inputs into the loop is 0.
More precisely ".. is an array of size zero.
(1) Go to yout three boolean arrays and click on the 6th element to make the arrays size=6 with all FALSE. now make current values default and save the VI.
(2) You also need to wire the boolean arrays across all event cases to ensure the current values are kept in the shift register. RIght now a change in one array resets the others to an empty array again.
(3) now initialize a boolean array containing six FALSE and initialize the shift registers with it.
10-22-2008 02:26 PM
altenbach wrote:
tst wrote:Without looking at the code, my guess would be that one of the indexing inputs into the loop is 0.
More precisely ".. is an array of size zero.
The off-the-top-of-my-head term I used was "indexing input", which I wanted to refer to both indexing arrays and the N terminal, which is why I used the terminology I used, although there's probably a better way of phrasing it.
10-23-2008 02:29 AM
Hi,
Well looking into the VI there were no booleans shifting in any of the events, Hence the for loop is not executing check out how your are shifting the booleans, once this is fixed your problem is solved.