LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help for Seconds to Duration (hh:mm:ss) conversion

I have this SubVI that is to convert Seconds to Duration (hh:mm:ss). This SubVI works fine for converting Seconds below 54000 (15:00:00) but the subsequent Seconds, for instance (57600 seconds), it returns Duration -8:00:00 instead of 16:00:00.
My SubVI is attached below. Would any kind souls please help ??.... 🙂 thanks...

Note : - I've included the ConvertDurationToSeconds.vi to allow you to convert Duration to Seconds
Download All
0 Kudos
Message 1 of 6
(3,778 Views)
Judging by you code and the results you reported I guess you are the other side of the world from me.

I just happened to have worked with a driver that was provided by Cincinati Sub-Zero as part of the LabVIEW driver that supports one of their temperature chambers.
As part of the driver they include a VI that does exactly what you want. CSZ does not support this driver, so do not call them for help. The sub-VI is included below.


The issues that are hitting you here are patially addressed in a memo posted to Info-LabVIEW by Rolf.

I include the same below.

Ben

"

"LewisDrake" wrote:

>Another annoyance related to time changes is that the LabVIEW XY graphs,
>formatted to show Time & Date on the X axis, generate major tic marks that
>aren't synched to midnight local time. Instead, they place major tics at
>7:00pm (in the US Eastern time zone). Before the time shift, they showed
>major tics at 8:00 pm. Of course, they have always been off by the offset
>between GMT and the computer's location.

LabVIEWs internal time (seconds since January 1, 1904, midnight UTC) are UTC
based. All times displayed on a frontpanel however are in local time which is
dependant on the time zone set in the OS.

>I believe that the major tic locations are determined from midnight GMT
>rather than from midnight local time. To display properly, one must
>configure Windows to use GMT instead of local time and turn off automatic
>time adjustments.

If you want to have a graph set to Time & Data and display only the time to get
a nice 24 hours display for instance (relative time format has unfortunately
not the same formating features as the absolute time) you can easily get that
by setting the X axis offset to the appropriate offset of (24 * 3600 -
(timezone offset)). This is a one time thing when opening the graph window
and then the graph displays fine with 00:00 ......

There are utilities on the Info-LabVIEW site, I believe developed by Stepan
Riha, to get the actual UTC offset correctly calculated. It isn't really
difficult just a little bit diff calculation and proper 24 hours overflow
handling.

>I WISH NI WOULD FIX THIS.

Not so simple without causing many more problems for existing applications.
Also using UTC as internal time format is a good choice, it really is! And
displaying local time for absolute times is also what 99% of the users expect
to see, so a good choice too.

The only workable approach I see is either improve the formating capabilities
of the relative time display to allow similar display formats as in the
absolute time format and/or add an option to the absolute time format to
display UTC instead of local time. But above fix can solve the problem nicely.

Rolf Kalbermatter
CIT Engineering Nederland BV tel: +31 (070) 415 9190
Treubstraat 7H fax: +31 (070) 415 9191
2288 EG Rijswijk http://www.citengineering.com
Netherlands mailto:rolf.kalbermatter@citeng.com
"
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 6
(3,778 Views)
Wow, Thanks Ben. You should be rewarded some day.

Zeus bless you with health and wealth.... 🙂
0 Kudos
Message 3 of 6
(3,778 Views)
It looks to me like you are trying too hard.

Try this simple conversion instead.

Good luck.
0 Kudos
Message 4 of 6
(3,780 Views)

Hi Alvin,

SInce the time of this Post I came to understand that the CSZ chamber uses Modbus.

NI has Modbus drivers available (somehwere).

Does that help?

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 5 of 6
(3,506 Views)

VI Guy wrote: Try this simple conversion instead.
VI guy,
There is something wrong with your code, because you can easily get minutes>60. For example an input of 64000 gives you 12:77:28 😞
 
Here's something that works a little better 🙂
 
 
Just a tweak! 😄
 
(adapted from my old post here.)

Message Edited by altenbach on 06-25-2007 09:59 AM

0 Kudos
Message 6 of 6
(3,498 Views)