From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, 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: 

save to spreasheet with loop

Dear All,

I have created a loop that will generate information. However, I would like to write this information to a spreadsheet file. However, the characters generated are a string, and I don't understand how to create a loop while writing to spreadsheet.

If I put the "write to spreadsheet" inside the loop, it will try to create a new file each time, instead of subsequently adding itself on to the existing data.

If I put it outside the loop, the data will only record once the loop has ended...

please help!

Ps. Please note that i'm using labview 6.1 thanks.
Aquaphire

---USING LABVIEW 6.1---
0 Kudos
Message 1 of 6
(2,446 Views)


Aquaphire wrote:...If I put the "write to spreadsheet" inside the loop, it will try to create a new file each time, instead of subsequently adding itself on to the existing data

There is a boolean input to tell the spreadsheet vi to append data at the end of the file.

The only remaining problem is that annoying dialog that pops up asking for a file name ? Just add a shift register and wire it to the file name inputs and outputs of the vi.
Chilly Charly    (aka CC)

         E-List Master - Kudos glutton - Press the yellow button on the left...
        
Message 2 of 6
(2,440 Views)
Hey! thanks for the speedy answer.

I managed to do teh "append file" part, but I don't understand how to do:

" Just add a shift register and wire it to the file name inputs and outputs of the vi. "

What is a shift register? and in wh at format do I write the file name inputs and outputs.

Thanks
Aquaphire

---USING LABVIEW 6.1---
0 Kudos
Message 3 of 6
(2,435 Views)
this is written in 7.1 but applies to 6.1 as well. This VI opens the file outside the loop in the mode (open or create) use (create) if you do not want to overwrite your appended logfile. convert all of your data to strings and build an array inside the loop. now use the convert array to spreadsheet vi and use %s for format. Now use the write file with the pos (end) to append data to the already opened file. then close the file at the end of the loop.

Hope this helps

-James
- James

Using LV 2012 on Windows 7 64 bit
0 Kudos
Message 4 of 6
(2,425 Views)
Nevermind! i figured it out 😄

right click on the loop and click : "add shift register" then connect the 2 ends of input/output (for anyone that might have the same question)
Aquaphire

---USING LABVIEW 6.1---
Message 5 of 6
(2,425 Views)
Congratulations, you did it !
The fantastic thing with LabVIEW is that you can do experimental programming.
Not sure that this could work with conventionnal text-based programming languages. Try to type random words as commands in VB, and see what happens...
Chilly Charly    (aka CC)

         E-List Master - Kudos glutton - Press the yellow button on the left...
        
0 Kudos
Message 6 of 6
(2,412 Views)