LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Cleanest way to add a second to date/time?

Lee_Jay,
 
You are creating a timestamp (Time/Date to Seconds.vi), which you are then breaking back into individual components (Seconds to Time/Date.vi).  In crement by one between these steps.  I think this should give you the behavior you are looking for.
 
Hope this helps,
Dan
0 Kudos
Message 11 of 17
(1,369 Views)
It does.  I can put the +1 where I did or in-between the two convert to/from seconds VIs with no change in behavior.
 
It just seems wasteful to have to bundle them all up, convert them, then un-convert them and unbundle them.
 
Lee Jay
0 Kudos
Message 12 of 17
(1,366 Views)
It is wasteful but then you're not leaving yourself any choice because of your imposed interface requirement of individual controls, and this becomes a discussion with little point. If you can tolerate creating a cluster control you would still have the individual controls, but you would at least be eliminating the bundling and unbundling. I doubt the individual controls are all wired to terminals, so if this is being used as a subVI you would be using a cluster in the first place. If these controls are on the main VI, what difference does it make whether you have individual controls or a cluster?
0 Kudos
Message 13 of 17
(1,343 Views)
I can understand that feeling.  However to not do that would require you to code all of the functionality that the timestamp type gives you for free.  Date handling gets pretty ugly, and I'd rather go through the work of bundling/unbundling rather than try to implement date handling logic myself.
 
My $.02,
Dan
0 Kudos
Message 14 of 17
(1,343 Views)
Yeah, that's pretty much my conclusion.  I was hoping there were VIs for handling the individual components but there seem not to be so I'll just live with this approach.
 
As to why I'm doing it this way, I have a GPS board that puts each component of time as a single onto each of 7 channels in a larger data system (248 channels).  That data system is read by an FPGA and the data is passed as a large array to an RT target.  The array is passed around on the RT and to a HOST computer to do the needed processing.  My controls are actually individual elements in that array.  The entire array is processed in several ways and used for many things in many VIs, one of which saves parts of it to disk as a continuous string of singles.  Perhaps this explains why I have the components broken out - I have no choice as that's how they come from the data system and that's how they need to get saved to disk.
 
Lee Jay
0 Kudos
Message 15 of 17
(1,335 Views)
If the elements of the array are in the same order as required for a date/time record you can save yourself a little bit of wiring by using the Array to Cluster function.
0 Kudos
Message 16 of 17
(1,330 Views)

Thanks.  I hadn't thought of that one.  Unfortunately, they're not.

Lee Jay

0 Kudos
Message 17 of 17
(1,326 Views)