LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Time match

Hi, guys.  If I'm sampling data from three different channels and only writing these data to a plain txt file....Is there anyway to make sure that the three sampling activities occur at exactly the same time, so I know there aren't errors when I export the plain txt file to Excel? Thanks. Included is a sample of the program if I wasn't clear.

0 Kudos
Message 1 of 2
(2,334 Views)
Since you didn't include your custom subVIs (Express maybe?), we can't see exactly what's going on, but a quick look shows a bit of a problem if you are expecting to sample the three channels at teh same time.

First, you need to realize (maybe you already know this) that unless you have a DAQ board capable of simultaneous sampling, you'll not be able to sample different channels at exactly the same time. The "E" series and "M" series baords cannot do this simultaneous sampling. They only have a single ADC (analog to digital converter) chip and can only read a single channel at a time, so all the channels that are to be sampled are multiplexed through this one ADC chip. So they are sampled one at a time (although very quickly) through this ADC. How fast it is between channels depends on the card and the different channel settings. It's usually in the micro second range.

For true
simultaneous sampling, you need either an S Series card, an FPGA board or some of the new USB cRIO modules.

To get as close as possible to
simultaneous sampling with a normal board, you need to rebuild your application so all three channels are sampled from a single DAQ call. This will return a 2D array of your data with each channel in a row of the array. You split the data out by channel from there and process it as needed.

The attached sample VI shows how to setup a VI to sample 3 channels using both an Express VI and using regular DAQmx and programatically configuring the channels and taks (I recommend this method).

As for writing the data to a file, you could just use the Write LabVIEW Measurments File Express VI. This writes an ASCII format Excel compatible file and does it pretty efficiently.

Have a look at the attached and let us know if this helps.

Ed


Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 2 of 2
(2,327 Views)