Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Using NI 9870 with Robotics Module Drivers

Solved!
Go to solution

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

0 Kudos
Message 1 of 10
(6,039 Views)

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

 

0 Kudos
Message 2 of 10
(6,037 Views)

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?

0 Kudos
Message 3 of 10
(5,843 Views)
Solution
Accepted by topic author BrandonGT

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.

Message 4 of 10
(5,823 Views)

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

0 Kudos
Message 5 of 10
(5,495 Views)

BrandonGT,

 

Glad to hear you are making progress.  I ended up using ideas from this example as well.

Message 6 of 10
(5,395 Views)

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!

0 Kudos
Message 7 of 10
(5,103 Views)

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.)

Message 8 of 10
(4,934 Views)

BrandonGT,

 

That is very good news.  Especially since I'm getting ready to start a new project that will use the 9870.  Smiley Very Happy

0 Kudos
Message 9 of 10
(4,902 Views)

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.

0 Kudos
Message 10 of 10
(4,899 Views)