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: 

For loop & waveform

Hi,

 

I have a question about process waveform using for loop.

 

I get a 6-channel, 36-sample data from DAQmx read vi, and pass these data to a for loop(N=1). With the highlight run, 1*36 was passed into the for loop. But when I use probe, I found all the data were passed into for loop.

 

My confusion:

 

If I use for loop(N=1) to get 6*36 array data, I can only get the first row(1*36).

 

Anyone correct me, please.

 

Have a nice holiday!

 

3.png

0 Kudos
Message 1 of 8
(3,930 Views)

You are missing the concept of Auto Indexing. You should never have an array wired into the For Loop with Auto Indexing on, AND have the N (loop iterations) wired.

 

For one loop: Right Click where the array enters the loop and turn off Indexing.

For six loops: Delete the 1 wired to N.

 

 

Richard






Message 2 of 8
(3,922 Views)

you auto indexed the array, thus the loop runs through the single entries of the array (and stopps after the 1st one (N=1) ). Right klick the connection to change the behaviour.

 

If you want to process all the entries one after another, just remove the N=1.

Message 3 of 8
(3,922 Views)

aww too slow 😞

0 Kudos
Message 4 of 8
(3,921 Views)

@Questionmarker wrote:

aww too slow 😞


prob'ly 31 seconds late Smiley Wink

Richard






0 Kudos
Message 5 of 8
(3,919 Views)

Thank you all!

0 Kudos
Message 6 of 8
(3,916 Views)

@Ivymerciqq wrote:

Thank you all!


Thank you for saying "Thank you".

 

Oh, and please click the Diagam Cleanup button.

Richard






0 Kudos
Message 7 of 8
(3,913 Views)

@broken Arrow wrote:

Oh, and please click the Diagam Cleanup button.



NOOOO, this button cost me dozens of gray hairs!

 

Actually a colleague of mine always locks his computer now that I threatened him with using this button for his VIs when he is not looking...

 

Use it with great care.Smiley Wink

0 Kudos
Message 8 of 8
(3,911 Views)