LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to collect exact time per sample using ARDUINO+LABVIEW

Hi,
I am using Labview & Arduino to collect some data from a rig. The sensors connections and reading are just fine, but there is something that I just cant achieve.
I am using the Write to Measurement file to save the data collected but I am not getting a time column. I do not want an exact time column, like : 8:51:62,145,
no, what I want is column that starts with 0 ms from the first data collected, like this:

                                                                              

Data

Time  (ms)

Data 1

0

Data 2

200

Data 3

400

Data 4

600

 

 

I need to plot a graph data X time, so please help me

0 Kudos
Message 1 of 5
(2,937 Views)

Subtract the current timestamp from the starting timestamp - this will give you the relative time in seconds.


LabVIEW Champion, CLA, CLED, CTD
(blog)
Message 2 of 5
(2,927 Views)

Also I don't think LIFA or LINX supports reading the hardware timing when samples were taken, so what you'll be doing is assigning a time that is when the sample was received on the Windows side, not when the sample was taken from the DAQ.  This imprecise is usually no big deal but you won't be able to do precise waveform analysis for things like frequency measurement.  Both LIFA and LINX has the firmware source available so it is possible to modify the code to send over the hardware timer of when the samples were taken.

Message 3 of 5
(2,920 Views)

How could I modify the firmware code to obtain the sample timing?


void loop()
{
// Check for commands from LabVIEW and process them.

checkForCommand();
// Place your custom loop code here (this may slow down communication with LabVIEW)


if(acqMode==1)
{
sampleContinously();
}

}

 

0 Kudos
Message 4 of 5
(2,909 Views)

Would be something like this???


0 Kudos
Message 5 of 5
(2,900 Views)