LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to figure out the time stamp of different operations ?

Hi All,

 

We are basically trying to synchronize two devices with the help of labview. We have combined the VIs for both the device. Further, we are trying to make the clocks same for both of them. So to make sure if the code is functioning right, we want to know timestamp after operations of different sub VIs in  the code. How do I go about doing this ? Will timestamp indicator solve my purpose ?

 

Thanks,

Kanu

0 Kudos
Message 1 of 7
(2,873 Views)

That depends on what kind of resolution you need. If both clocks are synched to NTSC and you only need a few seconds of resolution you might be ok. One possibility is to use a network shared variable that one writes to and both read from. Someone else probably has better ideas Smiley Happy

=====================
LabVIEW 2012


0 Kudos
Message 2 of 7
(2,864 Views)

Thanks Steve. I tried using elapsed time express VI; just trying to figure out how to use it. I guess even if I don't know the exact time it should be fine; if I am able to figure out the relative time from start of the execution.

 

Regards,

Kanu

0 Kudos
Message 3 of 7
(2,860 Views)

I am from the old school of thought. Convert the timestamp to double and subtract it. This will give you the difference in seconds.

 

Depending the accuracy requirements, you can make one of the machines an nttp server and have the second machine be a nttp client. This should synchronize the two machines within a second. If you need higher accuracy, I suggest a gps system. It should allow you to synch within couple of microseconds.

0 Kudos
Message 4 of 7
(2,846 Views)

Thanks Joseph. I figured out the relative time using tick count. I appreciate all help.

 

Regards,

Kanu

0 Kudos
Message 5 of 7
(2,832 Views)

Wach out for the tick count. It will roll over on you. The nice thing about get date/time in seconds is that it will not roll over. Well not for a while I think.

=====================
LabVIEW 2012


Message 6 of 7
(2,818 Views)

Be aware that, unless you are using RT or FPGA, the time returned by the VIs in the timing palette will only be accurate, to, at best, 20ms, and could be quite a bit worse.  This is due to the multitasking nature of modern operating systems.  The resolution of the timestamp is limited by your processor and your operating system (Windows variants are particularly poor).

 

Most National Instruments hardware includes VIs which return timestamps with the data.  These timestamps are usually relative to some arbitrary reference point, such as when you reset or powered on the board.  They will give you much better relative accuracy than depending on the operating system timestamp functions.  Absolute accuracy is harder to do, although there are solutions available to sync to GPS or NTP data (which I have not done, so have no idea how to do them).  In general, you are much better off using your hardware for timing information that your operating system.

 

As a side note, you do not need or want to change a timestamp to a double before subtracting to get the difference.  Doing so loses a LOT of resolution.  Of course, if you are using the operating system timestamps, the resolution is not being used, anyway, so it will make no difference.

0 Kudos
Message 7 of 7
(2,793 Views)