LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

labview real-time set date is one day off

I'm using a timestamp in a shared variable to transfer the date/time from an XP machine to a LVRT machine. Probing the XP timestamp I see the correct date and time. On the RT machine I use a shared variable's timestamp and Set RT time to PC time.vi to transfer the XP date/time to the RT machine. When I display the date/time the date is one day early. Time is exactly right.

 

Any idea what the problem is?

 

Thanks.

 

Chuck

0 Kudos
Message 1 of 7
(3,776 Views)

Chuck,

 

Could you post a simple example of this?

 

From what I understand, you are creating a timestamp shared variable.  On the XP machine you are writing the current time value to this variable and on the RT side you are reading the value of shared variable and setting it to the time of the RT target using the RT Set Date and Time.vi.

 

Is that correct?  It would help for me to see exactly what you are doing in the code.

 

Thanks,

Chris LS

National Instruments
Applications Engineer

Visit ni.com/gettingstarted for step-by-step help in setting up your system.
0 Kudos
Message 2 of 7
(3,743 Views)

Here are the sections of the vi from the XP and RT machines. As you can see, on the XP machine I use GetDate/Time in Seconds.vi to pass the XP machines time to the TimeStamp shared variable.

 

On the  RT machine, the TimeStamp shared variable is usd to set the date/time. And again, on the RT machine, the time is set accurately to the XP machines time, but the date is one day aff. So tight now, the date is set to June 3 instead of June 4.

 

XP

XP time vi.JPG

RT

RT time vi.JPG

 

0 Kudos
Message 3 of 7
(3,724 Views)

I don't see anything wrong with the code you've shown.    I think there could be something going on in your Set PC Time to RT Time VI.  Could you post this as well?  What version of LabVIEW are you using?

 

Thanks,

Chris LS

National Instruments
Applications Engineer

Visit ni.com/gettingstarted for step-by-step help in setting up your system.
0 Kudos
Message 4 of 7
(3,707 Views)
Set time vi.JPG
0 Kudos
Message 5 of 7
(3,697 Views)

Chuck,

 

If you were to change your shared variable type to a "Time Stamp" data type and avoid the DBL conversion, would you see the same behaviour?  Nothing stands out at me with the code you have at present and the conversion really should not affect these results.  If the timestamp change does not affect your results, add the project to this discussion post and I'll try to reproduce the issue on my end.

 

Best,

Chris LS

National Instruments
Applications Engineer

Visit ni.com/gettingstarted for step-by-step help in setting up your system.
0 Kudos
Message 6 of 7
(3,650 Views)

I'll try that.

 

I can't send the project since it is pretty big and controls fpga's. But I'll see what happens when I change the Shared variable type.

 

Thanks.

 

Chuck

0 Kudos
Message 7 of 7
(3,634 Views)