LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

getting data out of while loop after each iteration

hiii

i want the data out of while loop after each iteration..

it means that as we know while loop gives the data out only when it is stopped ..

but i want the data out of while loop even if it is not stopped that is after each iteration..

 

somebody please help me ..

thanks..

thanks

do not hesitate to give kudosSmiley Happy
0 Kudos
Message 1 of 11
(7,406 Views)

Hi sahil,

 

You should post your code. Newaz you can refer this vi.

 

Best of luckSmiley Happy

Gaurav k
CLD Certified !!!!!
Do not forget to Mark solution and to give Kudo if problem is solved.
Message 2 of 11
(7,404 Views)

hii Gaurav

you are right ..it works..

but for me it does not work..

i want to use only one while loop..

that is getting data after each iteration out of while loop without another while loop..

 

thanks for getting into the matter..

thanks

do not hesitate to give kudosSmiley Happy
0 Kudos
Message 3 of 11
(7,394 Views)

Hi sahil,

Can you explain why do you want value after each iteration? What is your application?  Do you want them to process on the data after execution of while loop gets over?

Can you post your vi as well?

Gaurav k
CLD Certified !!!!!
Do not forget to Mark solution and to give Kudo if problem is solved.
0 Kudos
Message 4 of 11
(7,389 Views)

hii Gaurav..

i am working on cDAQ..

actually i am to get the data from while loop..

i m attaching here with the vi in which i am facing the problem..

 

and i want my data to be out of the loop....also so that i may process further..

thanks.

thanks

do not hesitate to give kudosSmiley Happy
0 Kudos
Message 5 of 11
(7,384 Views)

Hi sahil,

It is not clear from your vi what you want to do.I did not see DAQ vi in your code. Can you explain a bit more on what exactly should happen outside while loop.

Where are you using ur DAQ vi, inside or outside while loop?

If you want to send or get data from your hardware why not to do it in while loop?

And say if you are getting data from hardware and after execution,you want to plot or print data in report you shoud "ENABLE AUTOINDEXING" on while loop.This will give you all data outside of your while loop. See this example.

Gaurav k
CLD Certified !!!!!
Do not forget to Mark solution and to give Kudo if problem is solved.
0 Kudos
Message 6 of 11
(7,378 Views)
I think there must be a condition under which you get the data of the current iteration. Using an event structure out of the while loop works for that idea.
0 Kudos
Message 7 of 11
(7,370 Views)

Hi Yarmouth,

 

If you place your event structure outside while loop ,it will not work... Smiley Wink

Gaurav k
CLD Certified !!!!!
Do not forget to Mark solution and to give Kudo if problem is solved.
0 Kudos
Message 8 of 11
(7,364 Views)

hii Gaurav 

all is well with ENABLE AUTOINDEXING..

but still now i hav the problem 

 

i am attaching the vi ....

in this vi, i am after conversion to numeric data i am getting only one value (the very first one only)...

i am not getting all the values stored in spreadsheet string one by one....

 

thanks.. now i think it is just a matter of some only...

thanks

do not hesitate to give kudosSmiley Happy
0 Kudos
Message 9 of 11
(7,344 Views)

Hi sahil,

 

why do you convert to string and then back to number? Why not wire that array directly?

 

Well, "string to number" just converts the firsat found number. That's how it works. Point.

When you need all numbers you either have to use a loop or "spreadsheet string to array" to reverse your number to string conversion before...

 

Has nobody told you before NOT to compare floats for equality? You also don't use LabVIEW primitives like "+1" or "=0". And you don't initialize your feedback node, so your vi will only run correctly for the first execution...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 11
(7,340 Views)