LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Continuous logging of 1D array of waveform data to file??

Hi All,
 
I have a continuous buffered daq loop running where I acquire 32 channels in waveform data type.  Sample rate of 10 Hz, grabbing 10 samples once per second.  I dump the waveforms to my waveform chart and looks/runs spiff.
 
Now I want to log this data to a file of my choosing.  Getting totally lost on the TDM thing.  The express VI to write seems to be working but the read measurement is not.  I know I'm doing something wrong but canna figure it out.  I'm a little concerned about using the express vi anyway inside my daq loop because of the potential performance hit.  I'm reading 32 channels now but am designing for up to 128.
 
Can anyone point me in the right direction on how to get this data logged to a file and how to retrieve it?  I've got a block going here and canna get my brain around it.
 
Running LV 8.0 on WinXP.
 
Cheers,
Greg Cole
“It is not the ship so much as the skillful sailing that ensures the prosperous voyage.”
0 Kudos
Message 1 of 6
(4,211 Views)
Hi, Greg.

Can you tell me a little more about the problems you're encountering with the Read from Measurement File Express VI? You're certainly correct that you could encounter a performance hit with the express VIs if you're using them frequently in a loop. There are some really nice resources in the LabVIEW Help for using TDM's with the non-Express VIs, however, which I recommend checking out. You can find them here:

1. Select Help>>Search the LabVIEW Help.
2. Go to the Contents tab.
3. Expand Fundamentals>>File I/O>>How-To>>Choosing a File Format

Then you'll see a series of help files. Among them are "Reading Waveform Data from a File Using Storage VIs" and "Writing Waveform Data from a File Using Storage VIs ". I recommend checking them both out. (There's a similar section on using the express VI's, of course, but it sounds like that might not be the best choice for your application.) Note specifically that some of these files have a link at the bottom allowing you to browse for related examples that come with LabVIEW.

Good luck! If you're still having problems, let me know.

Message Edited by sarahk on 06-14-2006 11:34 PM

Sarah K.
Search PME
National Instruments
0 Kudos
Message 2 of 6
(4,193 Views)

Howdy,

My problem is this.  In a continuous buffered daq loop, sample rate 10 hz & grabbing 10 pts. every second, I use the express VI "Write to Measurement File" to save my data to disk.  When I use the LVM format, I am able to write data and read it back it.  When I switch to TDM format and run the same vi, it appears to write the data correctly; one TDM and one TDX file are generated.

However, in my reader VI when I try to read that TDM file, my chart appears to get corrupted and no data is displayed.  The effects on my reader VI chart are:

   - The chart grid disappears
   -  The x axis switched from absolute time format to some bizzarro real # range
   -  If I right click the chart (after the vi has run) no menus appear.

An additonal note.  I checked out the examples you suggested.  They've been some help.  I've been able to read and write TDM data by running them.  In addition, the TDM reader vi I wrote that acts odd above works fine on the TDM files generated by these examples.  Which now makes me wonder if I have my wrtie-to-measurement express VI configured correctly...

Cheers,

 

Greg Cole
“It is not the ship so much as the skillful sailing that ensures the prosperous voyage.”
0 Kudos
Message 3 of 6
(4,184 Views)

Just for additional info, here is a screenshot of how I am trying to write the TDM data.

Cheers,

Greg Cole
“It is not the ship so much as the skillful sailing that ensures the prosperous voyage.”
0 Kudos
Message 4 of 6
(4,182 Views)
Hi, Greg.

It always brightens my day when I see a post containing the word "bizarro." 😃

That sounds like strange behavior; without taking a look I think this will be difficult to troubleshoot. Can you reproduce the weird TDM behavior if you generate your signal with a Simulate Signal VI? If so, could you please remove the hardware-related VIs and then post your code? I'd like to see if I can reproduce it here on my computer.

Thanks! Have a nice afternoon.
Sarah K.
Search PME
National Instruments
0 Kudos
Message 5 of 6
(4,172 Views)
Sorry for the delay in following up on this.  I think I have found out what was going on.

I was unable to reproduce what I was getting without using daqmx data.  However, I did notice that when I ran the duplcate scenario using generated waveforms, that the data being written wasn't what I expected.

I used generated wavform data and wrote 3 waveforms to TDM using the express VI "Write to measurement file".  When I used "read from measurement file" I was getting 4 waveforms back.  The first was the time data for the next three.  On my plot it came out as an upward sloping line along with my three other waveforms.

I think when I was using acquired data the same thing was happening but with absolute time data in that first plot, which being the number of seconds since 1-1-1904 was the thing sending my x axis into fits.

I've since moved on to using the "Write data" storage VI with plans to get best performance using "write to binary file" in conjunction with the TDM Header writer vi's once I figure them out.
Greg Cole
“It is not the ship so much as the skillful sailing that ensures the prosperous voyage.”
0 Kudos
Message 6 of 6
(4,135 Views)