LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to continue recording on a new excel sheet?

Solved!
Go to solution

Hello,

 

I have a program that records data ever 0.2 seconds to an excel spreadsheet, but it should be able to record non stop for up to 48 hours. Since excel has a limit of 65,535 rows I would need to open a new sheet every 3.6 hours, in order to continue the overall process. I attached the program here, is quite simple and easy to follow.

 

This program will be used to record mass/energy flow from a Fuel Cell power system. But right now I'm working with this demo in order to get everything ready before recording the actual data. If anyone can help me understand how to do this, I would appreciate it very much.

 

Thanks in advance for your time.

 

Jose 

0 Kudos
Message 1 of 28
(3,647 Views)

Hello,

 

A good example of changing excel worksheets pragmatically from LabVIEW you can find here. However I recommend changing the arhitecture of you program if you want it to run for such a long period of time to write more often to the excel file. This way you won't run into memory problems and will still recover some data if the program or computer crashes.

 

Regards,

Toader Mihai

0 Kudos
Message 2 of 28
(3,626 Views)

Thanks, I've managed to open different sheets, but not continuously. Now the data is being recorded on a different sheet. I'm also running into the memory issues that you mentioned, is there an example or design that I can use as reference to avoid this? If you're interested I attached the updated version of the program.

0 Kudos
Message 3 of 28
(3,605 Views)

Hello,

 

Try to avoid using the flat sequence if you can wire the error terminal as such the data flow is correct also try to avoid using multiple stop buttons. If one part of your program is stopped the other might receive invalid or no data and give out an error.

I have attached a version of the VI that I think should work, if you run into any more problems feel free to ask. I added a control on the front panel to set the number of rows to be written on every sheet.

 

Regards,

Toader Mihai

Message 4 of 28
(3,597 Views)

Oh, I forgot to mention that I'm using version 8.6. Can you save that VI so that I can open it in LB ver. 8.6?

 

And thank you a lot for all your help so far.

0 Kudos
Message 5 of 28
(3,587 Views)
Solution
Accepted by topic author Jose_Perez

Hello,

 

Not a problem. Here is the VI. I've also attached a screenshot of my VI in case the Save for previous version one doesn't work.

 

Regards,

Toader Mihai

Download All
0 Kudos
Message 6 of 28
(3,583 Views)

Thank you a lot. This worked perfectly for what I wanted. I greatly appreciate it.

 

Jose  

0 Kudos
Message 7 of 28
(3,574 Views)

Hello,

 

The excel program is working fine now. Thanks for all the help. However, I applied this to a new VI that displays data acquired in the front panel. I added a Boolean control to initialize data recording in excel, but when I run the program and chose to record the data in excel the indicators in the front panel freeze and when I finish recording I get error

-41003 and the program starts displaying the data in the front panel again (the indicators unfreeze when I stop recording the data to excel). Is there a way I can avoid this?

 

I attached a picture of the block diagram just in case.

 

Jose

0 Kudos
Message 8 of 28
(3,511 Views)

Hello Jose,

 

For some reason it seems your image was not attached to your post.  Just from what you've described I have a few suggestions.

 

Error 41003 is usually thrown when you try to create a file in a place that does not exist.  Either the folder you are trying to put it in doesn't exist, or you are using invalid filename characters in the file name.  Such invalid characters

include \ / : * ? " < > |.  If you are using the time and date in your file name you need to create a custom string instead of using the default.

 

Your front panel is most likely freezing because your excel recording vi is blocking program execution.  The best way to fix this would be to run your file writing in a separate loop from your main acquisition code.  I would suggest using a producer consumer loop.  Follow this link to learn more about the Producer/Consumer design pattern.  Application Design Patterns: Producer/Consumer

 

Regards,

Matt

Applications Engineer
National Instruments
0 Kudos
Message 9 of 28
(3,499 Views)

Hello,

 

Yes, apparently the image could not be uploaded. Well instead I'm attaching the data display and record VI and the subVI for that one. I will be checking the Producer/Consumer information you send me, but are there example of this as well?

 

Thanks in advance,

 

Jose

Download All
0 Kudos
Message 10 of 28
(3,485 Views)