LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

temperature log including time

I am trying to log the temperatures of 4 different sensors into log.lvm.
The problem I have is that the time stamp for each entry is not recorded.
I am using DAQ assistant to aquire the data from the sensors. I have tried to bundle the data to include the time of each read but when I try to send this data to a xls or txt file it complains that dynamic data cannot be sent to this type of file. Then I tried to use the "write to measurement file.vi" with the appended time but i cannot do that either.
Is there a way to make a register of the 4 sensors including the time stamp?
Any help will be appreciated
Thanks
Eduardo
0 Kudos
Message 1 of 7
(2,481 Views)
Hi Eduardo,

Could you attach the code your working on?
Sarah

Applications Engineer | National Instruments | UK & Ireland
0 Kudos
Message 2 of 7
(2,461 Views)
Hi Eduardo,

If you use the DAQmx Read VI you can specify to the data type to be a waveform and that will include the timestamp information of the data. You can then wire the output from the DAQmx Read VI directly to the Write to Measurement File Express VI.

If you open the NI Example finder (Help >> Find Examples... ) and look at the Cont Acq Thermocouple Samples - SW Timed VI (browse to Hardware Input and Output >> DAQmx >> Analog Measurements >> Temperature) that describes how to generate the waveform data type.

Regards
Sarah

Applications Engineer | National Instruments | UK & Ireland
0 Kudos
Message 3 of 7
(2,462 Views)

Thanks very much for your help Sarah, I include here the code you asked for in your firs reply.

I tried to work out the instructions in the second post but could not make it work.

I also include the file with the output of what I'm getting with this code. I need to stamp the time of the sample taken as the first column followed by four more columns with the data read from the 4 voltage sensors, and that is what I don't know how to achieve.

Thanks again, your help is most appreciated

Eduardo

Download All
0 Kudos
Message 4 of 7
(2,448 Views)
Hi Eduardo,

That was actually trickier then I expected it to be!

I've come up with a possible solution but it may depend on what you want to use the file for.

The attached example creates a text file that you can open in Excel with 5 columns, one with the time stamp data and the other four with the channel data. Open it, have a look through it and run it a few times and let me know if it's suitable.

Regards,
Sarah

Applications Engineer | National Instruments | UK & Ireland
0 Kudos
Message 5 of 7
(2,439 Views)
You are my heroine!!
That is exactly what I wanted to achieve. The problem I had with the dynamic data is that I didn't know how to separate the channels to put them on a text file.
I did some small modifications to your example, like Put a header, changed the date to be displayed only once at the top of the report and added the seconds to the time stamp.
Now it looks very nice indeed.
Thanks very much for your help.
Eduardo
0 Kudos
Message 6 of 7
(2,435 Views)
Glad to be of assistance!


Sarah

Applications Engineer | National Instruments | UK & Ireland
0 Kudos
Message 7 of 7
(2,431 Views)