06-22-2010 12:53 PM
Hello all,
I am utilizing quite a few sensors that are supported by the LabVIEW Robotics module (GPS, IMU, compass and probably a LIDAR pretty soon.) However, I would really like to be able to use the NI 9870 RS-232 serial module in a CompactRIO to interface with these devices (currently they are connected directly to a PC.) Unfortunately, I am not sure if there is a way to do this without rewriting the drivers for the FPGA. Has anyone encountered this before or perhaps knows a way I can do this without reinventing the wheel? Thank you!
Brandon
Solved! Go to Solution.
06-22-2010 01:34 PM
Hi, Brandon. I know it's frustrating that the 9870 module doesn't use VISA, so your sensor drivers require some work to switch them to the 9870 serial VIs.
I'm hoping that someday, VISA will work with this module natively.
We also have the same situation with the RS-232 IP on IPNet, which use DIO lines for transmit and receive. http://zone.ni.com/devzone/cda/tut/p/id/9595
The VIs for this approach are a simple initialize, read, write, and close. Easy to use, but they aren't VISA.
One of the things we've tried to do with some of the sensor drivers is to put bottleneck VIs in place, where all of the VISA calls are in a few specific VIs. This makes it much easier to replace the VISA functions with something else.
The best example we have of this is the Hokuyo LIDAR driver, where most of the I/O is done with a single Query Instrument VI that calls VISA Write and VISA Read. (I'll mention that this driver also works with USB LIDARs on the CompactRIO.)
It's an imperfect solution, but it's a lot easier to update this driver to use the 9870 or RS-232 IP than with the previous version of the driver, where VISA Writes and Reads were scattered in several different VIs.
Hopefully, the sensor drivers you want to use will be easy enough to modify. We'd welcome feedback to update any drivers that turn out to be difficult to modify.
Good luck.
Brian
08-21-2010 07:04 PM
I am currently rewriting the drivers for the devices I am using with sub VIs for write/read to replace the VISA write/read VIs. I used the serial loopback example in the example finder as a starting point and built from there. I am now running into another problem though. The serial loopback example uses 2 DMA channels, one for writes to the serial port and one for reads from it. I rewrote the Microstrain 3DM-GX1 driver using this and it works great. Now I want to add 3 other devices and use all 4 serial ports, but my cRIO 9024 only has 3 DMA channels as I understand it. I figured to use all 4 ports I would need to add 2 DMA channels for each port. I am not sure how to approach this now, but it seems like I may have to multiplex the data from all 4 serial devices together (which are at different rates.)
Anyone have a better idea?
08-23-2010 07:18 AM
BrandonGT,
Been working on a similar problem. Take a look at this example . Note how the Join Numbers function is used to add an identifier to the data before it is put into a common FIFO.
12-10-2010 04:11 PM
Wayne,
Thanks for pointing me to that. I have worked through this on and off for a while, and have something tentatively working. It creates some interesting timing bugs with existing drivers for the devices I am using, but with a little adjusting it can be dealt with. Thank you very much for your help!
Brandon
12-20-2010 08:47 AM
02-15-2011 02:03 PM
That is a great example. I wish I had found it sooner. It's a slightly more elegant solution than what I did. I will probably end up using it and just making small changes to it. I think those serial VIs should come with the NI 9870! Thank you!
03-11-2011 08:05 PM
For anyone finding this forum posting, NI has since added support for the cRIO to use the NI 9870 and NI 9871 modules with the existing VISA framework using the Scan Interface Mode (at least it is available in LabVIEW 2010 SP1 that I am using now.)
03-14-2011 06:41 AM
BrandonGT,
That is very good news. Especially since I'm getting ready to start a new project that will use the 9870. ![]()
03-14-2011 08:17 AM
I was able to verify that NI-Serial for LabVIEW Real-Time 3.7 was the first version that included Scan Interface support for 987x modules. This was released 11-16-2010 and shipped with the LV2010 SP1 update. It will work with NI-RIO 3.5.x ( NI warns of some warnings ) but NI-RIO 3.6 and higher is recomended.