10-02-2013 07:58 AM
Hello,
I have an NI cRIO-9076 chassis with an NI-9467 GPS module and an NI-9234 module.
I've downloaded the FPGA Timekeeper application which synchronises the FPGA clock to the 1PPS GPS, this works well. What I want to do is create a trigger that at a pre-defined HH:MM:SS the system will start to acquire and log data from the Accelerometers connected to the NI-9234 module.
I have added the controls for the entry of the HH:MM:SS and calculated the time in seconds. I would like to compare the system clock once it is locked to the entered timestamp and then trigger.
As I only have a value that represents seconds in the day I need to calculate the offset from EPOCH to compare against the GPS time reference. I have read that the NI system clock runs from 01/01/1904 instead of the EPOCH 01/01/1970.
The question is how do I get the current system time so that I can compare it against the entered time? I only need seconds in the day = (HH * 3600) + (MM * 60) + (SS)
Thank you,
Kind Regards,
Simon
10-02-2013 04:02 PM
Have you tried using the "Get Date/Time in Seconds" VI?
http://zone.ni.com/reference/en-XX/help/371361K-01/glang/get_date_time_in_seconds/
It works the same on RT targets as it does in Windows.
10-02-2013 04:16 PM
You should use the Get Date/Time in Seconds VI which will return a timestamp. You can then format this timestamp using the Format Date/Time String to give you exactly the time format that you need. Then you can extract the numbers you need and do your math.
10-03-2013 02:12 AM - edited 10-03-2013 02:19 AM
Thank you, I've tried using the code but I'm getting errors:
Target Specific Errors and Warnings:
Decimal String To Number: Function not supported for current target
Match Pattern: Functiron not supported for current target
Diagram Constant: Type not supported in current target
Wire: Type not supported in current target
Get Date//Time in Seconds: Function not supported for current target
Front Panel Terminal 'date/time string': Type not supported in current target
These errors only occur once I paste the logic from the "Get Seconds in Day.vi" into the project.
10-03-2013 09:58 AM
Just to recap, we have a cRIO-9076, with a NI-9467 and a NI-9234. I've been talking to NI support and I am told that the string handling functions and time conversion functions are not supported by the FPGA target, which would explain the error messages. Is it possible to do what I want with the hardware we have?
What we are trying to do is synchronise the chassis using the GPS 1PPS clock, then trigger an activity based on a user configurable time.
10-03-2013 11:48 AM
You did not mention that you were trying to accomplish this on the FPGA target. The solution I posted will work on the RT target.
10-04-2013 01:41 AM
The first line of my original post specifies the hardware, sorry if I missed something, I thought I had been specific.
I'm very new to cRIO and still finding my way.
10-04-2013 06:09 AM
Solved !
Have created a VI on the Chassis, I have accessed the FPGA global variables "FPGA Timekeeper time(ns)" and "FPGA Timerkeeper locked".