12-07-2009 10:55 AM
I try to use the existing vi to record the resistance data measured. It seems to me that the vi only can display the data but cannot store the data to a file (EXCEL or TXT). I tried to use "write to spreedsheet vi", but it does not work. Could anyone give me some help? Thanks!! Both vi and picture are attached. I am very new to labview.
Thanks in advance
Solved! Go to Solution.
12-07-2009 11:20 AM
While you have a very old version of LabVIEW, I would recomend you check out the free tutorials.
You've made a couple of fundamental errors. First, what is exiting the while loop is only the result from the very last iteration. You can right clcik on the exit terminal and select 'Enable Indexing'. This will create a 1D array that you can pass to the Write to Spreadsheet. Second error is that the Write to Spreadsheet in 7.1 is only capable of accepting 1D or 2D DBL arrays. You will have a string array. Either convert the string result to a numeric or change the Write to Spreadsheet to accept string arrays. Directions are on the block diagram. Third, your VI can only be stopped by pressing the Abort button. That is bad design. Use a front panel Boolean wired to the termination terminal. You don't need that invert function. Just right click on the termination terminal and select 'Stop if True'
12-07-2009 11:58 AM - edited 12-07-2009 12:00 PM
Thanks to Dennis for providing a precise & detailed description.
Since I did some changes before reading his post, I'll post the image of the code changes below.
You can use the Context Help (Help menu > Context Help, or the large Question Mark at the top rightof block diagram) to show you how to connect your data (array) to the Write To Spreadsheet File.vi.
12-07-2009 01:35 PM
An observation:
I noticed that your block diagram has a red contour which indicates that you have set a breakpoint when the VI is run.
This will pause the execution everytime you run it. You should (probably) remove the breakpoint.
12-09-2009 09:05 AM
Thank you so much for your kind help. I can save the data into a spreadsheet now. The only problem is that the data is saved in a row but not in a column.
12-09-2009 09:25 AM
Can you post your code and some sample data?
It may need a simple ajustment. 😉
12-09-2009 12:29 PM
The code is attached and the data is saved in a row like the attached picture. I do not know how to save it in a column. I also try to make the program to display the average, stand deviation of the data and display each data point in the plot in term of index number. So far I only can figure out how to display the min and max of data.
Thanks a lot
Booo
12-09-2009 02:25 PM
12-09-2009 02:33 PM
12-10-2009 10:30 AM
Dennis,
Thank you so much for your help!! Now the program seems to work well. I want to save some text information regarding the sample with the resistance data into the same file. Could you suggest a way to do that? The Vi is attached.
Best,
Booo