08-03-2011 03:51 PM
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
Solved! Go to Solution.
08-04-2011 03:34 AM
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
08-04-2011 03:15 PM
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.
08-05-2011 02:16 AM
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
08-05-2011 06:57 AM
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.
08-05-2011 07:05 AM
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
08-05-2011 07:25 AM
Thank you a lot. This worked perfectly for what I wanted. I greatly appreciate it.
Jose
08-10-2011 09:12 AM
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
08-11-2011 11:29 AM
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
08-11-2011 04:17 PM
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