LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Adding Hours

Hi everyone

I try to find a way of subtracting two hours. I have a starting hour and an
ending one and I would like to take out the delta hours
I get hours from the Get Date/Time String vi and wonder if it's possible to
convert a string data to a number data and then find the difference.

Thanks to all

Gérard



--
Gérard Férini
Switzerland
0 Kudos
Message 1 of 6
(3,131 Views)
You should use "get time/date in seconds" from the String and Dialog Palette. Have an initial one outside the loop and one inside, then subtract the the two after you stop the loop. This will give you the difference in secs which you can convert to hours.
0 Kudos
Message 2 of 6
(3,131 Views)
Bonjour Gérard,

I've made a little vi that could interest you. Here's a picture of it as long as I don't know which version of LabView you have.

Hope this helps !
Julien
0 Kudos
Message 3 of 6
(3,131 Views)
Hi Gérard,

you can convert a String into a number using the
"Decimal String To Number.VI".
I have written a small progam which should explain the
function of this VI.(Just hoping you are using LabVIEW 7...)


Regards

Peter Weber
NI Germany
0 Kudos
Message 4 of 6
(3,131 Views)
Thanks David for your reply but how to substract the two strings, has you
mentionned? that 's where I can't find the answer.
I can't use the "normal substract vi "it gives me error and I don't find the
right vi to convert string should this be necessary

Thanks again

Gerard


--
Gérard Férini
Switzerland
http://home.tiscalinet.ch/gferini/Main_Photos.html
"DavidT" wrote in message
news:506500000005000000327A0100-1079395200000@exchange.ni.com...
> You should use "get time/date in seconds" from the String and Dialog
> Palette. Have an initial one outside the loop and one inside, then
> subtract the the two after you stop the loop. This will give you the
> difference in secs which you can convert to hours.
0 Kudos
Message 5 of 6
(3,131 Views)
David,

Here I am at last, I tried to get a time difference from a string value
namely a Get Date/Time String rather than a time stamp value. And from a Get
date/time in seconds, I can effectively have the result I wanted.

Thanks again for your reply

Gerard


--
Gérard Férini
Switzerland
http://home.tiscalinet.ch/gferini/Main_Photos.html
"DavidT" wrote in message
news:506500000005000000327A0100-1079395200000@exchange.ni.com...
> You should use "get time/date in seconds" from the String and Dialog
> Palette. Have an initial one outside the loop and one inside, then
> subtract the the two after you stop the loop. This will give you the
> difference in secs which you can convert to hours.
0 Kudos
Message 6 of 6
(3,131 Views)