LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Daylight Saving UK VI

Hello all!

 

I have developed a VI that adjusts the time depending on whether the time is in a DST period or not.

 

I just wanted to get some opinions on it and see whether there are any suggested improvements.

 

Cheers

 

Chris

0 Kudos
Message 1 of 8
(2,792 Views)

It looks like you are trying to solve a problem here that doesn't really exist. While the underlaying timestamp value is always in "seconds since Jan 1, 1904 GMT" the default display time of a timestamp control (and also the string format as well) is already formatted as local time, which includes DST if that applies for the timestamp in question. So all you are really doing here is to adjust the already adjusted timestamp again.

 

So what are you really trying to fix here?

Rolf Kalbermatter
My Blog
Message 2 of 8
(2,762 Views)
Hi Rolf, I should have mentioned the requirement in my original post. The hardware on which this will be implemented is a cRIO 9074, which doesn't allow for daylight saving. Unfortunately, there is no scope for changing the hardware, so this is my attempt at adjusting the time stamp in code. The time stamp is written to a file on the cRIO along with the data. I hope this makes it a bit clearer. Cheers Chris
0 Kudos
Message 3 of 8
(2,723 Views)

You could simplify that vi just a bit.

!1-1.png


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 8
(2,710 Views)

Jeff,

 

Unfortunately the older cRIO (most likely the NI Linux one would be different) don't really have DST handling so I doubt that the DST value is actually valid. It could even be -1 which has a special meaning when used as input to the Data/Time To Seconds, telling the LabVIEW system to determine the DST status for the timestamp based on its date, but because of the limitations on older sRIO's that likely won't work either.

Rolf Kalbermatter
My Blog
0 Kudos
Message 5 of 8
(2,685 Views)

Thanks for the responses.

 

Rolf,

 

Presumably, based on the additional detail that i gave, your opinion is that the solution i propose is suitable?

 

Cheers

 

Chris

0 Kudos
Message 6 of 8
(2,621 Views)

personally I would hesitate to follow that approach. This kind of thing is difficult to fully test, likely to fall apart over a few years when the next change to DST is decided by your goverment or your company decides to sell a copy of the product to another country and generally a big hackaround anyways. But if you are happy to live with these limitations, I'm not ging to stop you to do it this way. Smiley LOL

Rolf Kalbermatter
My Blog
0 Kudos
Message 7 of 8
(2,612 Views)

Thanks Rolf, appreciate the feedback. I appreciate the limitations you have raised and agree they could cause a headache.

 

Have you got any suggestions to improve it/ideas to start from scratch!?

 

Cheers

 

Chris

0 Kudos
Message 8 of 8
(2,567 Views)