ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Nested For Loop skipping case structure

The Case Structure inside the inner For Loop is skipped when running the code in normal speed, but when I run it in Highlight Mode it works. Anyone has any idea why this is happening? Appreciate any insight.

 

Nested For Loop code.png

 

 

 

0 Kudos
Message 1 of 13
(4,307 Views)

why do you belive it is skipped?  What version of LabVIEW?

 

Side note: Why is the DBL wired into the case structure?  It is just passed through in both cases...


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 13
(4,283 Views)

Run some probes in the data. Especially on the error lines and the feed to the number of iterations. See what is happening. It could be a timing issue while running at full speed.

 

The subVIs did not come across with the code snippet, so I can not test the code.

 

Rob

0 Kudos
Message 3 of 13
(4,281 Views)
In addition to jeff's questions: What is the value going into N (maybe the earlier subvis need to be paced more slowly and you get a zero otherwise due to errors).
0 Kudos
Message 4 of 13
(4,276 Views)

Looking a bit deeper

 

~~~Oh Magic 8-ball~~~~ did the OP intend to use CASE select = 0 (mod (i, 20))  so that every 20th iteration fired the true case?

 

 

[Maybe-- you seem to be on to something]

 

use Quotient and Remainder.


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 13
(4,273 Views)

Jeff,

 

The code in the CASE does not run when the loop gets to 20 while program runs at "normal" speed.

 

I wired the DBL for data flow purpose only to keep consistent with LV best practice, I think.

0 Kudos
Message 6 of 13
(4,267 Views)

Robert,

 

I did run the probes in the data, and they give the results I want for data. The subVIs just sets my instrumentation.

 

I know the snippit didn't come thru and I'm not sure why. I'll try to figure that one out.

0 Kudos
Message 7 of 13
(4,264 Views)

altenbach,

 

the value going into the second loop is 36 which is the size of a test array. whould running earlier subvi's matter even though all VI's are in series meaning that next one will not run until the previous one is done performing its tasks?

0 Kudos
Message 8 of 13
(4,260 Views)

Just zip the project and set normal default data as default in the controls and indicators. attach the zip

What is the hardware?


"Should be" isn't "Is" -Jay
0 Kudos
Message 9 of 13
(4,260 Views)

Jeff,

 

Sorry for the dumb question but what is OP?

 

Don't integers compare cleanly in labview? You're right I want the CASE to fire every 20th iteration.

 

Thank you all so far for shedding light in this problem.

0 Kudos
Message 10 of 13
(4,256 Views)