06-05-2015 06:57 AM
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
06-05-2015 07:19 AM
Subtract the current timestamp from the starting timestamp - this will give you the relative time in seconds.
06-05-2015 07:22 AM
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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
06-05-2015 07:43 AM
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();
}
}
06-05-2015 07:51 AM
Would be something like this???