Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

cRIO GPS serial port interfacing

Hi all,

I've had a look around but can't seem to find a definate answer.

Could you tell me if it's possible to acquire data through the serial port of a cRIO controller from a GPS module such as this and map this against data being acquired through various modules in the chassis?

Thanks

0 Kudos
Message 1 of 16
(5,454 Views)

Hi cjones

 

I have been looking into the question you asked, can the serial port on a cRIO be used to acquire data?

 

Yes, the serial port can be used for data acquisition devices, but the USB cannot, so you will need to use the serial ports for your device. The specification page for your controller will be available online, on page 14 of this manual for the NI 9025 controller, is the specifications for the serial port, but be sure to check this for your exact device.

 

To manipulate your acquired data I recommend looking at the examples available in LabVIEW, if you navigate to help>>find examples>>hardware input and output>>compactRIO If you look through some of these examples they will give you some assistance with architecture and configuring your device, the FPGA section will probably prove the most helpful.

 

If you have any further questions please feel free to ask me, and if you would like any examples on specific tasks, let me know and I will find some for you.

 

Thanks

Stephanie L
Applications Engineer
National Instruments UK and Ireland
Message 2 of 16
(5,428 Views)

Many thanks for the very useful reply.

 

I've found the following code example: http://zone.ni.com/devzone/cda/epd/p/id/2197

I'm assuming that with a little modification this could be used on the cRIO?

 

Thanks,

Chris

0 Kudos
Message 3 of 16
(5,414 Views)

Hi cjones

 

I had a look at the example you found and yes this should be adaptable for your cRIO, it depends on how your application needs to be run, but you may want to split the tasks so that the cRIO is acquiring the data and any manipulation happens on the PC.

 

I have also found another GPS example which was part of the example code contest this year, looking at this will give you another reference while building your own system.

 

If you have any further questions regarding the GPS application please do not hesitate to ask.

 

Thanks

Stephanie L
Applications Engineer
National Instruments UK and Ireland
0 Kudos
Message 4 of 16
(5,402 Views)

I tried using the example for the cRIO (selecting VISA resource name RIO0::INSTR) and I just get Error Code -1073807331 with message Property Node (arg 2) in VISA Configure Serial Port (Instr).vi->Read NMEA GPS SubVI.vi->Untitled 4.vi.

I've tried looking around for a solution but can't make much sense of it. Any help would be appreciated.

Thanks

Message 5 of 16
(5,294 Views)

To add to my last post:

I'm using a BR-355 GPS receiver and I also get a dialog box witht he message: Communication Error Occured

0 Kudos
Message 6 of 16
(5,291 Views)

Firstly is there a way of deleting/edition posts?

Secondly, I've installed NI-Serial RT on the cRIO and now have a second VISA option (ASRL1::INSTR). This no longer gives the error message, but still gives the dialog box message and then stops running.

If I run the code on the PC with the GPS connected to the PC Serial port it works fine.

Thanks,

Chris

Message 7 of 16
(5,272 Views)

Hi cjones

 

I have been looking into serial ports and the cRIO for you and looked at the error you recieved, which you solved correctly by installing the NI serial RT, another check for you to carry out would be to ensure that you have the latest versions of all software and drivers, this will ensure full compatibility as well. There are some articles available online which discuss the serial connection, they may assist you in finding a setup error.

 

If you are still recieving errors let me know and I will look further into your issue.

 

Thank you

Stephanie L
Applications Engineer
National Instruments UK and Ireland
0 Kudos
Message 8 of 16
(5,266 Views)

Sorry about the dealy in replying. The GPS module is working well when connected directly to the serial port on the PC using the code I've linked to, but doesn't seem to work on the cRIO.

I've performed a loop-back test to ensure the cRIO serial port works correctly and it works fine, however, when I try to move the gps code onto the cRIO I get no data at all at the correct baud rate (4800).

Should I need to modify the code in anyway to make it work on the cRIO? As far as I can see it should work but simply using the same code.

Thanks,

Chris

0 Kudos
Message 9 of 16
(4,912 Views)

Hi Chris

 

No worries about the delayed reply, I have been looking further into examples for serial communication and I have also been looking into solutions that other people have suggested when using the serial port.

1) Ensure any references are opened and close outside of any loops.

2) NI 9870 - Continuous Serial Read - On-Demand Write - http://zone.ni.com/devzone/cda/epd/p/id/6366

3) Modbus Communication Reference Example for cRIO - http://decibel.ni.com/content/docs/DOC-8063

4) Serial Communication General Concepts - http://zone.ni.com/devzone/cda/tut/p/id/11390

 

Above are some examples and an article which explains serial communication, these may help you with the programming side.

 

Would it be possible for you to post your code ao I can investigate what might be causing the cRIO not to work with the code?

 

Thank you

Stephanie L
Applications Engineer
National Instruments UK and Ireland
0 Kudos
Message 10 of 16
(4,904 Views)