09-12-2011 11:35 PM
Hi everyone,
I am using LabVIEW 2010 and there is a probelm I need to ask regarding to Export the data from LabView to an Excel. Basically, I have been able to transfer the data "once" a time to a new or selected Excel spreadsheet, but only can be "ONCE" when I run the VI, So my problem is, I need the data to be inserted to a same Excel sheet everytime I press run and the new data will not replace the old one, instead it should go to the next new row or column. I really need all answer regarding to my problems, any suggestions and ideas are welcome.
I Attached My Current VI and an image describe the result I needed
Thanks for Answering
Solved! Go to Solution.
09-13-2011 08:01 PM
Any Suggestions are still welcome ^^
09-14-2011 04:59 AM - edited 09-14-2011 05:00 AM
A common technique is to open the file (any resource) on the first call and store the reference to it in a Shift Register in a While Loop that'll run only once. The False case increments the row value, so every time you call this (as a sub VI) you'll write to the next row.
09-14-2011 09:41 PM
Hi Jim, thanks for the solution, I will try to combine this system with my I/O assistant, anyway, is that possible for you to attached the VI for me?
Thanks
Ery
09-15-2011 04:56 AM
That image is a VI Snippet. Just drag it onto a block diagram and you'll have it. Besides, I only slightly modified the VI you provided.
09-15-2011 05:58 AM
Thanks Jim, I try drag and drop to Block diagram, but it's not working, I just not too sure what to put when the false case.
Ery
09-15-2011 06:11 AM
No problem, ery.
This is something you might also do when working with DAQ, a data file or any resource that you need to open once and use repeatedly. The True case opens the file only on the First Call. The False case simply passes the value from the Shift Register to be used again without the overhead, or wasted memory, of reopening the reference. I could have passed the Row wire around the Case Structure as the uninitialized Shift Register would have started with zero anyway.
Good luck.
jcarmody wrote:
A common technique is to open the file (any resource) on the first call and store the reference to it in a Shift Register in a While Loop that'll run only once. The False case increments the row value, so every time you call this (as a sub VI) you'll write to the next row.
09-15-2011 06:46 AM
Hi Jim, thanks, It is working perfectly, ^^
But I just wonder how do you set up the time delay on each run? I have put 5 second delay on the while loop, but the result is the system run from 0 and increasing 1 second everytime it loops, how do I set to 5 second constant delay?
Thanks , I include my VI
09-15-2011 07:31 AM
You weren't getting five seconds between writes because your VI was using the loop iteration counter to set the value to the Time Delay Express VI. This would have given you the five seconds you wanted:
What I had in mind was that you'd use your VI as a sub-VI like this:
Leave the Loop Condition in your VI like this : and control timing in the calling VI.
09-15-2011 07:47 AM
Great!! Tha's exactly what I need, Thanks a million Jim ^^
There is another issue is when running this system, how do I make it open an Excel so it will not create a new sheet? for example I put something on sheet1 excel, but when running this VI, it will create a new sheet2, what I want is this system open and input the data to sheet1 not creating a new sheet2
Thanks ^^
Ery