Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I log the time in hours, minutes and seconds to a table

Hi

I'm a relatively new user of Labview. I am currently writing a program that logs the temperature of an oven and the current time to a table and graph. I am using a GPIB card to communicate with the oven. I have used the Get Date/Time string to get the time and the Decimal String to Number to convert the time to a number which I have then put into an array which goes to a table and graph. My problem at the moment is that the time is being logged in hours only. I need to log the time in hours, minutes and seconds. Can you tell me how I can do this?
0 Kudos
Message 1 of 6
(4,058 Views)
Hi,
I'm not entirely following your description, but I've made a couple of assumptions and have posted an example back in LabVIEW 7.1 of splitting up the details. When you say logging the time, where to? Are you just splitting out the hours with the decimal string to number?

Sacha Emery
National Instruments (UK)
// it takes almost no time to rate an answer Smiley Wink
0 Kudos
Message 2 of 6
(4,050 Views)
Hi

Thanks for the reply. I am working from Labview 7.0. Could you send me the vi in this version?

I am plotting temperature and time to a table and graph and yes at the moment I am just splitting out the hours with string to number functions. At the moment, I am using Get/Date Time String and Fract/Exp string to number. The problem I am having it that the Fract/Exp string to number function is only logging the hour to the graph and table. For example, if the temperature is logged at 16h.25m.47m, only 16h (16.00) is being logged to the table. I would like it to log time in hours, mins and seconds or just mins and seconds.

Maeve
0 Kudos
Message 3 of 6
(4,038 Views)
Hi,
here's the example saved in 7.0.
If this doesn't make sense, or I'm chasing the wrong thing, can you send me the cut down version of what you're trying to do - i.e. the vi(s).

Thanks

Sacha Emery
National Instruments (UK)
// it takes almost no time to rate an answer Smiley Wink
0 Kudos
Message 4 of 6
(4,035 Views)
Hi Sacha

Here's the VI I am working with.

Thanks,
Maeve
0 Kudos
Message 5 of 6
(4,032 Views)
Hi,
I can see the setup now. The decimal string to number will only ever give the hours, since the ':' character is not part of a number, so won't translate. Use the code I attached previously to get the time as a timestamp, and then go from there.

I've made some modifications, although you'll need to alter the file save to take into account the double precision number
for the timestamp is now 3E+9 (since it's seconds since 1904!!), but since you're writing to a comma separated values (or tab deliminated) style file, this shouldn't be a problem. You could always do a textual save from the table instead.

Thanks

Sacha Emery
National Instruments (UK)
// it takes almost no time to rate an answer Smiley Wink
0 Kudos
Message 6 of 6
(4,015 Views)