Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading GPS data from a cRIO

Solved!
Go to solution
Highlighted

Hi Andrew,

 

Thanks for your help. It help me a lot, thanks very much! Just one thing, what kind of wire should I use in order to connect the output of GPS receivers to the SMB connector. I have tried wires some but failed. what kind of lead should I use? Can you tell me a little bit more about how to connect the SMB port?

 

Thanks very much!

 

Regards,

Henry

0 Kudos
Message 41 of 52
(830 Views)
Highlighted

Hey Henry,

 

I just want to add my two cents here and add to what Andrew already mentioned.

 

If your goal is to just have proper, synchronized timestamps on your measurements, then you may be able to implement 1588 into your system. Please see this forum post for some more information.

 

Also, keep in mind that the SMB connector is only readable on the RT target, not through FPGA, so if you want to do triggering for your FPGA measurements, this will not be very accurate as the RT has to read the value and then pass it down to the FPGA. You would be better off using a digital module and directly reading the PPS.

 

As for cables, we use standard SMB cables that can be found on Amazon for pretty cheap.

Rob K
Measurements Mechanical Engineer (C-Series, USB X-Series)
National Instruments
CompactRIO Developers Guide
CompactRIO Out of the Box Video
0 Kudos
Message 42 of 52
(824 Views)
Highlighted

Hello Andrew,

 

Thanks for your help. Just now I want to use 2 GPS receivers to correct for 2 CRIO clock drift. You have mentioned to set the time for CRIO. So I just wonder how to set the 2 CRIO so that the time in them are setted exactly the same? Since I think I can only set the time for one CRIO at one time, and I don't know how to set the time in them at the same time. Thanks very much!

 

Regards,

Henry

0 Kudos
Message 43 of 52
(814 Views)
Highlighted

Hello Henry,

 

An avenue to persue to match the time on the two cRIOs is to synchronize their system times to SNTP servers. This method is presented in Configuring CompactRIO Real-Time Controllers to Synchronize to SNTP Servers

 

As a variation of the method presented in How Do I Set the Date and Time on My Real-Time Controller, you could use shared variables to set the system time on the two controllers. This would give more accuracy than inputting a static time constant into the "RT Set Date and Time" VI. The only restriction with this method is that both cRIOs cannot read from the same shared variable at the exact same time, so you would want two "time" shared variables with the same value. An example application of this method is shown in Synchronizing Real-Time Target Time with Host Computer Time.

 

 

Regards,

 

Andrew Brown

Software Engineer
National Instruments
0 Kudos
Message 44 of 52
(802 Views)
Highlighted

Hi Rob,

 

Sorry to disturb you. Just wonder what specific type of SMB connector is used to connect to the SMB pin in the CRIO 9074? Coz I have seen many types of SMB connector and not sure which one to use. Can you tell me some details about the SMB connector?

 

Thanks very much for your help!

 

Regards,

Henry

0 Kudos
Message 45 of 52
(796 Views)
Highlighted

Hello Henry,

 

The best resource I have found that addresses your questions is What types of SMB connectors are used on NI hardware?. Based off this resource, I would recommend 50 Ohm SMB connectors for use with the cRIO 9074.

 

Regards,

 

Andrew Brown

Software Engineer
National Instruments
0 Kudos
Message 46 of 52
(778 Views)
Highlighted

Hi Andrew,

 

Thanks for your help. Now I have another question, if the cRIO is triggered by the PPS signal, how can I set in the FPGA code so that when the cRIO is triggered, it will start to acquire the signal for,say 800 milliseconds and then stop. When the next rising edge of the PPS signal approaches, it will start to acquire the signal also for 800milliseconds and then stop, so on and so forth. Do you know how can I achieve that?

 

Best regards,

 

Henry 

0 Kudos
Message 47 of 52
(755 Views)
Highlighted

Hello Henry,

 

Two major concepts make up the application you have described: triggering and timing. In both cases, good examples are packaged with the FPGA module that demonstrate this functionality. If you open the NI Example Finder (Help » Find Examples) and navigate within the file structure to Toolkits and Modules » FPGA » CompactRIO » FPGA Fundamentals, good examples are located at:

 

Triggering: within the Triggers and Watchdog folder, Trigger Detection - Software - cRIO.lvproj

 

Timing: within the Loops folder,  Internal CLoop - SW Gate - cRIO.lvproj

 

Regards,

 

Andrew Brown

Software Engineer
National Instruments
0 Kudos
Message 48 of 52
(744 Views)
Highlighted

Hi Andrew,

 

Thanks for your reply. I have had a look at the Internal CLoop - SW Gate - cRIO.lvproj example for the timing issue. Just I noticed that in this example, it only set a period for the cRIO to sample signal. I mean, in using this method, after the cRIO finishes sampling, it will wait for a specific time to do another sampling. the cRIO is sampling discontinuously in this way. What I am tring to do is, after the cRIO is triggered to start sample the signal, it will sample say 800ms and then come to a stop and wait for another trigger signal to start acquiring the signal. In that 800ms, the cRIO is sampling continuously. Can you give me some help on that?

 

Best regards,

 

Henry

0 Kudos
Message 49 of 52
(739 Views)
Highlighted

Hello Henry,

 

An overall architecture that should work well for your program is a state machine. Two basic states for your program could be:

 

Wait: If a trigger occurs, go to Acquire. Otherwise, stay in Wait.

Acquire: Acquire data for 800ms, then return to Wait

 

Other useful information for your application are the fundamental pieces of state machines and a complex example that demonstrates retriggerable and pre-acquisition functionality. 

 

Regards, 

 

Andrew Brown

Software Engineer
National Instruments
0 Kudos
Message 50 of 52
(726 Views)