I feel like this is a dumb problem and know the solution if probably obvious, but I can't seem to find it 🙂
I have a for loop with several inputs and outputs in a subvi. When the subvi is run all the inputs are read, the for loop is skipped over, and the outputs are sent out. Does anyone have any idea of why the for loop is being skipped? Everything seems to be wired corretly??..
The vi is attached.
Solved! Go to Solution.
I cannot open your code due to my having LabVIEW 2009, however here is one thing to check: Do you have auto-indexing on at all? Perhaps it is not executing the expected amount of times due to an array being wired as "auto-index" to your for-loop?
Another thing to check is try placing an indicator on the output of the "N" and "i" variables of the for-loop (the blue box letters that automatically appear). This should tell you the "N"umber of times it will iterate and the value of the current 'i'teration.
When you use Highlight Execution, do you see it execute any of the code inside the loop? If so, how many times? And how many were you expecting?
Hi, Thanks for the reply.
The loop is running 0 times. About half of the inputs are auto indexed, and I checked to be sure they were initialized before I ran. I saved the vi as version 8, so hopefully it will open for you.
I think HappyAsthma has it right here.
Check the sizes on each of the arrays in outputcluster3 and LastState.
Number of iterations of your for loop will be set by the smallest indexing array size which is likely zero in your case.
The VI you posted has empty arrays and will index 0 times.
If you're actually passing data in all of your indexing arrays, the loop will work as expected.
If there is data that you want to show, do a Set Value to Default on your relevant controls before posting your vi.
Please run the calling VI with the front panel of this subVI open. unitl the problem occurs. Stop everything and go to the subVI front panel, and do a "edit...make current values the default". save the subVI under a new name and attach it here.