05-31-2012 07:31 AM
05-31-2012 07:51 AM
Of course you can do that. In the File palette the Read VIs are usually adjacent to the Write VIs. You did not say whether you used the Write to Spreadsheet File.vi or one of the other file write VIs.
After your read the data you may need to convert the strings back to a 2D array of numbers. Use the XY Graph for your plot.
Lynn
05-31-2012 07:53 AM
I tried to read it with the read file function but i think i am making some mistakes. here is the VI. maybe you could give me some specific hints.
thanks for your quick response!
05-31-2012 08:14 AM
I was surprised that that worked at all. You have an empty format string on the Array to Spreadsheet String function. I would have expected that to produce an error or an empty output string but apparently produces a default result similar to "%.6f". The detailed help documentation does not describe what the function does with an empty string or an invalid specification.
You should be able to read your files directly using Read fromSpreadsheet File.vi. You might need to transpose the data. You will get a blank row (or column) corresponding to your header. Notice that there is a "transpose?" input to the VI so that you do not need to transpose the array externally.
Lynn
05-31-2012 08:28 AM
You are right about the %.6f being default. well, i did try to read the file with the read from spreadsheet file function but my problem is that the moment the sequence finishes, I want to read the file and put it in a graph. I don't know if i can get the file info to the read spreadsheet function right after the loop/sequence ends.
once again thank you for your kind help. 🙂
05-31-2012 08:39 AM
If you look at the attached VI, I have tried to use the read from spreadsheet vi where empty file path invokes a dialogbox to choose file but then my header is read as 0. At the same time when I try to use the XY plot then it give me the connection error and then waveform graph just plots both the columns. huh!! I feel stupid 😞
I wanted to automate it after the sequence but even manual could be a solution if the automated process is not possible.
06-01-2012 04:00 AM
Bump...
06-01-2012 07:49 AM
XY plot take a very different data format than waveform plots. Please look at the LabVIEW help on the subject, since there are several variants. In your case, you can probably fix the issue with the following change:
That is an index array followed by a bundler. If there is a transpose issue, switch which input index is disabled on the index array primitive.
06-01-2012 08:40 AM - edited 06-01-2012 08:43 AM
1. aha the indexing is a problem and i didn't understand your suggestiong completely. could you please elaborate a little.
Attached is a sample data file where first column is the time and the second column is the mean values. i wanted to plot it on xy plot as y = mean and x = time.
2. As you might notice in the data file that the time which is starting time-t0 is not equidistant. any idea why that is happening? I am using NI DAQ 6009.
Thanks for your kind help.
06-01-2012 09:07 AM - edited 06-01-2012 09:07 AM
Ok after you suggested and surfing around our lovely forum i found the solution. Here is the link for other users who are confused about this:
http://forums.ni.com/ni/attachments/ni/170/356460/1/graph%20columns.PNG
The question remains how to read the created data file after the sequence ends automatically. I am trying to do it this way but it doesn't work.
regarding the equdistant time values, I still have no clue. 😞
Thanks!
Here is the modified VI