LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

absolute time record in RT target

I need to record time information im my real time target. I use get time vi but it does not work properly. How can ı get time information in RT
0 Kudos
Message 1 of 5
(3,423 Views)

If your RT box has an onboard clock, then it should return the proper time after you set the time.

You can do this by using LabVIEW\vi.lib\addons\rt\RTUtility.llb\RT Set Date and Time.vi or by setting a time server for your target in MAX.


___________________
Try to take over the world!
0 Kudos
Message 2 of 5
(3,421 Views)
Hello, my problem is to get time info, not to set it.
I read a message about my problem:
 
Hi,
I was able to investigate this further. As it turns out, LabVIEW RT's "Get Date/Time in Seconds" function does not keep real-time in the RTOS - it falls behind. Format Date/Time String, and Get Date/Time String are also affected. The problem is that when the real-time OS runs code, it gives higher priority to this code, and the real-time OS prioritizes its bookkeeping routines lower. One of the bookkeeping tasks of the real-time OS (or any OS for that matter) is to keep system time. In LabVIEW RT, this is done with interrupt service requests, which get ignored when the real-time OS is busy running real-time code. However, note that when a system is rebooted, the system time is reset to be correct again.

The Tick Count function however does not display this behavior. This is because it gets its value directly from the hardware register and not via a service request. So one solution for your case it to use the Get Date/Time function to get the initial timestamp. Then use the Tick Count function to get subsequent timestamps by using the initial time as an offset.

Another solution is to use the timestamp VIs that use values directly from the hardware register, as the Tick Count function does. These VIs use low register-level functions to ensure the most accurate timing. In LabVIEW, go to File » New... » VI from Template » RT » NI Timestamp Code Timer.vit and open that template. This template uses the timestamp VIs I'm talking about. They are locate in C:\Program Files\National Instruments\LabVIEW 7.1\vi.lib\addons\rt\_RTUtility.llb if you want to access them directly. But the template will show you a good use-case.

So you can either use the Tick Count function as I described above, or you can use the timestamp VIs. Both will provide you with a valid work around. Please let me know if you need more help with this.

Have a great day!

Anu Saha
Academic Product Marketing Engineer
I trie first solution mentioned above but it does not work. I can not find the template vi which is stated in second solution. (Perhapse because of the ver of LabView) Can you support another solution for me?
0 Kudos
Message 3 of 5
(3,390 Views)

I don't know about the existing VIs, but using the first method is relatively easy. See the attached example.

To learn more about LabVIEW, I suggest you try searching this site and google for LabVIEW tutorials. Here, here, here, here and here are a few you can start with and here are some tutorial videos. You can also contact your local NI office and join one of their courses.
In addition, I suggest you read the LabVIEW style guide and the LabVIEW user manual (Help>>Search the LabVIEW Bookshelf).


___________________
Try to take over the world!
0 Kudos
Message 4 of 5
(3,385 Views)
If you are using LabVIEW Real-Time 8.20 you could also use Functions » Real-Time » Real-Time Utilities » RT Get Timestamp to get an accurate timestamp.

Note that your VI needs to be targeted to a RT target for this VI to appear in the palette.

Regards,

Simon H
Applications Engineer
National Instruments
http://www.ni.com/support/

Message Edited by Simon H on 01-29-2007 05:10 PM

0 Kudos
Message 5 of 5
(3,366 Views)