ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Save waveform data to .TXT

Hi all,

 

I'm acquiring data from one machine. I show all data from each channel on graph, which works OK, for different sample rate. What I want is to save this data to .TXT file.

 

Please take a look at my picture. What I need into .TXT file is value for each channel at each iteration. I tried to save  "value" Y from each "build waveform", but what I get is data on picture. It's always saving previous data(see picture at bottom), but I need just:

 

17:49:16 28,192885
17:49:16 28,193563
17:49:16

28,193902

 

 

 

PICTURE:

 

 

Untitled.png

 

 

 

_________________________
Rookie; LV 2011 on WIN 7
0 Kudos
Message 1 of 27
(4,857 Views)

Well, if you are saving the Y array then obviously you would be saving multiple points. You do not show how the actual saving is being done and I have no idea what the clfn is returning as far as different channels. If the 1D array is single reads of multiple channels than you simply index that array.

Message 2 of 27
(4,848 Views)

I'm saving like this (I know I must put "open and close" block outside of while loop, but this is not my problem right now). How can I index then to save just value of each itteration...

 

 

 

Untitled.png

_________________________
Rookie; LV 2011 on WIN 7
0 Kudos
Message 3 of 27
(4,845 Views)

You could actually explain what the clrn is returning. I said what to do if the 1D array was single samples of multiple channels. Apparently you did not read that part?

Message 4 of 27
(4,840 Views)

clfn (ReceiveMPData) return:

 

value(Y) which is output data for all channels:

 

Untitled.png

 

 

_________________________
Rookie; LV 2011 on WIN 7
0 Kudos
Message 5 of 27
(4,836 Views)

So, I already answered your question it would appear. You could also wire the 1D array to Array to Spreadsheet and wire that to the write file with the timestamp.

Message 6 of 27
(4,832 Views)

So if I understand you, I use "index array" block and how can I just index last value; because I need just last value of each iteration, which is "current" value.

_________________________
Rookie; LV 2011 on WIN 7
0 Kudos
Message 7 of 27
(4,826 Views)

Well I tried to add "index array" and add to "index" value "-1", but then it's saving all zeros to .txt file;

 

What I actually need is to get last element of array. With block "decimate 1D array" I just decimate array because channel samples are interleaved.

 

I hope someone actually understand what I want.

_________________________
Rookie; LV 2011 on WIN 7
0 Kudos
Message 8 of 27
(4,817 Views)

That does not make any sense. If, as you say, the 1D array is a single sample from each channel, then index 0 would be channel 1, index 1 would be channel 2, etc. Why do you just want the last element when you originally said you wanted all channels? I also said that you could wire the 1D array directly to the Array to Spreadsheet String. That would give you a list of channels with a separator between them. Your decimate array, etc is not relevant since you only want to record the current acquisition - not your entire plot.

0 Kudos
Message 9 of 27
(4,810 Views)

I have 5 channels (array that I received from clfn). With decimate to 1D array I received 5 Y values for each channel separate. I need to save for each channel data into .txt file (logging data).

_________________________
Rookie; LV 2011 on WIN 7
0 Kudos
Message 10 of 27
(4,806 Views)