LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to extract data from Chart History?

Dear all, I have read a lot of posts, but still don't understand how to extract data from Chart history.
Suppose you acquired 1024 points of data every time, then use "build array" to build an array, then send to intensity chart to show, then save the history into a .txt file,  but how to extact data from the file?

How Labview store the data in the 2D history buffer?

Anybody has any examples?
0 Kudos
Message 1 of 7
(4,980 Views)
It all depends how you write the history file. There are many possibilities. Please attach a simplified version of your code.
0 Kudos
Message 2 of 7
(4,967 Views)
The simplest would be to save the 2D array as a spreadsheet file, the read it back the same way.
 
Maybe the attached simple example can give you some ideas (LabVIEW 7.1). Just run it. At any time, press "write to file". At any later time, you can read the save data into the second history chart.
 
If you are worried about performance, it might be better to use binary files, but it will be a little more complicated. See how far you get. 🙂
0 Kudos
Message 3 of 7
(4,968 Views)
Hi, altenbach,

Thank you so much! Could you tell me how to extract a whole screen data from the "history.txt" file?

In your example, If I want to extract the whole left screen data (it is 100 lines * 50 points in your example), how should I do?

I tried to used Matlab to read "history.txt", but don't get any right data, they are all integer.

Is there any rules how Labview store the data? If I want to extract the whole screen data in a waveform chart,  how can I get from the  history?

Thanks a lot!

0 Kudos
Message 4 of 7
(4,964 Views)
Hi, altenbach,

After I used Matlab reading and dealing with 'history.txt', I think I got it.

In your example, the whole left screen  is actually 100 lines * 128 points,  not 50 points as shown in your y-axis.
The whole history is 128 (buffle length)*128 points. So it is a total of 16384 data in "history.txt"
 
I am so glad, thank you very much:).

Message Edited by hbin on 02-18-2006 12:17 AM

0 Kudos
Message 5 of 7
(4,960 Views)

I don't quite understand what you mean by "whole screen data". In my example, the entire history buffer is saved. If you want more data, you can change the lenght of the history buffer. If you only want part of the data from the file, read it all and use the "array subset" function.

If you want to save more than the history data, you could append the new data continuously to the txt file instead of only on demand.

By default, the data is saved with three decimal digit resolution, but you can wire any suitable format to the "write to spreadsheet file" node. You can look at it in notepad to see how it looks.

0 Kudos
Message 6 of 7
(4,956 Views)
Now I understand more, before I did not know how many points per line in an intensity chart, and I did not know how to input parameters in the "array subset" to extact the part I want.

The "whole screen data"means  all the data displayed in the screen of a intensity chart.

Thanks

Message Edited by hbin on 02-18-2006 01:07 AM

0 Kudos
Message 7 of 7
(4,955 Views)