Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Writing and Reading waveform data to/from Datalog files

Hi!,

I am using PCI-6023 with LVPDS6.1 and DAQ 6.9.2 on Win2000

I am acquiring waveform data from multiple channels and wish to write them to a datalog file which I can replay later.

I am aware of the waveform write/read vi but am looking for a slightly more configurable solution.

Also, with the "Read waveform from File.vi" how do I get it to read ALL the records? It says I need to read until EOF is reached but how can I do that?

Your help is appreciated. Thanks!

- Gurdas
gurdas@qagetech.com
Gurdas Sandhu, Ph.D.
ORISE Research Fellow at US EPA
0 Kudos
Message 1 of 4
(2,530 Views)
Gurdas,

I'm not sure what you mean by "slightly more configurable" solution. What features are you looking for? In addition to the Waveform Read/Write VIs there also exist Write File/Read File VIs. You may even try opening the Waveform Read/Write VIs since they are high-level and contain a number of subVIs. If you want to customize Waveform Read/Write you may need to explicitly call the subVIs (WDT Array Dlog VIs) instead of using the high-level calls.

The Read Waveform from File VI reads one record at a time. It will return the first record, as well as an array of all waveforms in the record. Depending on the file you wrote, it may contain more than one record. If more than one record exists you will need to call Read Waveform From File in a loo
p. The EOF (End of File) terminator already exists in the file. You may try a while loop and read until an error exists from the read VI. The read VI will output an EOF reached error code when the end of file is detected. Use this to stop the loop. Or simply use a for loop if you know how many records your file contains.

Regards,
Justin Britten

Applications Engineer
National Instruments
0 Kudos
Message 2 of 4
(2,530 Views)
Justine,

You described exactly what I would like to do with the Waveform Read/Write VI. Unfortunately, we do not know how many records are in the file and when "reading" the waveform file with the Read Waveform VI, it does not seem to generate an error condition when it reaches EOF! As a result, when we are reading in the data, we end up reading the final record repeatedly until we hit the default record limit. For example, if we generate 10 records and ask for "999", we get the ten records with the last record repeated 46 times until hitting the default limit of "56" as entered in the configuration page for the VI.

How about a simple example of how to read a waveform file with multiple records using EOF as the termintor condition?

Thanks,

Mi
ke
0 Kudos
Message 3 of 4
(2,531 Views)
Check out the post "Reading entire waveform from file?" I think it will help.
The attached vi is from that post.
0 Kudos
Message 4 of 4
(2,519 Views)