Showing results for 
Search instead for 
Did you mean: 

Get Date/Time in seconds not returning same results each time


I'm using a vi that writes Date and Time to the selected Target (see attachments). (I have the problem on an RT target and on different host machines i'm using).

To reproduce :

Date changes
Month = 4, Day = 4 and Year = 2005, Time = 0:18:39, run the VI = OK
Month = 4, Day = 3 and Year = 2005, Time = 0:18:39,
run the VI : M=4, D= 2, Y=2005, time is ok
run the vi again : M=4, D=3, Y = 2005.

Another example:

Time changes
Month = 4, Day = 3 and Year = 2005, Time = 1:0:0, run the VI = OK
Month = 4, Day = 4 and Year = 2005, Time = 1:0:0,
run the VI : date is ok, time is 2:0:0
run the vi again : date is ok, time is 1:0:0

I red the posted notes about Time Zone but i think this one is not related to that.

Thank you

0 Kudos
Message 1 of 4

I don't have the Set Date & Time subVIs so I can review the code.
However, at a glance I noticed the error cluster is not connected between the two.
Try connecting the cluster to force the operation to occur in the same order each time.

Just curious to see if this eliminates the random nature of the results.

LabVIEW 5.0 seems so long ago...
0 Kudos
Message 2 of 4
I've actually seen this as well a while back, and even putting a wait between them didn't help (I tried a short one, I think [about a second] but it should have been enough for the network). I didn't have any use for it, so I didn't look any further. I just ran the VI twice.

Try to take over the world!
0 Kudos
Message 3 of 4
Linking the two RT vi with error in/error out doesn't change the result.

I am running the vi twice (for loop) to eliminate the problem, but there is still a bad result from that call.

Thank you

0 Kudos
Message 4 of 4