From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

collect data to write in file

Solved!
Go to solution

Hello every one!

 

                      I've got quite depressing problem wich harm my mind... fore some days. I have a VI with while  loop witch is part of bigger project ... my aim is to collect data and write them to file after 1000 while loop activities... be more precise- after while loop makes 1000 moves I want to write in file the move number (in attachment picture "Number") and value ("array") result should be some kind of array (2columns by 1000 lines).... I can not make one more while loop ower all the VI because it enables the other VI's to work... Can you suggest me sommething?

 

 

0 Kudos
Message 1 of 7
(3,000 Views)

Hi ku ku,

you should use more shift registers and less local variables. Is this the while loop which counts the 1000 iterations?

 

Mike

0 Kudos
Message 2 of 7
(2,991 Views)

by while loop activities do you mean iterations?

 

because if that's the case you can wire the while loop iteration icon up to and equals vi and connect that to a case structure...Inside the case structure you can than put your write to spreadsheet and collect the data.

 

 

and stacked sequences are kindof frowned upon here:)

 

Message Edited by Harold Timmis on 07-08-2009 02:54 PM
Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
Message 3 of 7
(2,988 Views)

I don't see why you can't just write as the data is acquired - a single line at a time. Building an array with a shift register would work as well but it depends if you want to have a short delay in the loop to write a single line or a much longer delay every 1000 iterations.

 

p.s. I hope that True constant wired to the loop termination terminal is just something you did for this example. With that constant, your loop can only iterate one time and saying you want to do a save after 1000 runs is silly.

Message 4 of 7
(2,983 Views)

Another idea:

 

Setup two loops - An acquisition loop and a storage loop.  Put the data in a shared queue so that the acquisition loops pushes data onto the queue and the storage loop pops data off the queue as it is saved.  This may not be necessary if the acquisition is slow, but it is scalable if you start running a higher acquisition rates.

 

Here is a very simple example.

 

 

Message Edited by vt92 on 07-08-2009 02:16 PM
>

"There is a God shaped vacuum in the heart of every man which cannot be filled by any created thing, but only by God, the Creator, made known through Jesus." - Blaise Pascal
Message 5 of 7
(2,971 Views)
Solution
Accepted by topic author ku_ku

.........by while loop activities do you mean iterations?.......

 

yes that is wright I couldn't  find the wright expressin in the late night.

 

 

ok I'll try to write to spreadsheet line by line.... i'll check up is it posible to add to an existing spradsheet file a line of data for 1000 times after each loop iteration.... it could be more reliable because each loop iteration is trigered once in a 30min, and if PC loses power I'm loosing all data.

 

Thank you very much for  ideas!!!

0 Kudos
Message 6 of 7
(2,939 Views)

now ewerything works fine ... I used the write to spredsheet VI and wrote line by line in file.... why I couldnt figure it out last night.... khhhhh?

 

thank you everyone for realy operative support!!!

 

 

0 Kudos
Message 7 of 7
(2,922 Views)