05-16-2018 05:38 PM
Hello,
I'm trying to create 4 cursors each with different spacing. I came up with this idea (refer to the attachment), but when I executed, the program just bypassed the for loop. Nothing got computed. Can someone take a look at it and give me some hints?
Thank you in advance!
MV
Solved! Go to Solution.
05-16-2018 08:31 PM
Your loop runs zero iterations because one of the auto-indexing inputs into the loop has a zero array length...
05-16-2018 08:38 PM
Attach your VI. We cannot debug images.
05-17-2018 11:42 AM
Thank you for the quick response. I just figured out that my array of cursor list cluster has zero length, but I don't know how to fix it. Should I initialize the cursor list array of 4 elements and then feed it into the for loop? Or is there other way to do it more efficiently?
This is a VI snippet of a portion of my code, the other half is irrelevant to this problem.
05-17-2018 12:21 PM
@dmvpdx wrote:
Thank you for the quick response. I just figured out that my array of cursor list cluster has zero length, but I don't know how to fix it. Should I initialize the cursor list array of 4 elements and then feed it into the for loop? Or is there other way to do it more efficiently?
This is a VI snippet of a portion of my code, the other half is irrelevant to this problem.
No, you only need to initialize the array if you are going to be modifying it. In this case, just put the cluster on the block diagram (no array) and auto-index output will create the array for you.
05-17-2018 12:27 PM
It worked. Thank you so much!!