LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial Port on SBRIO

How do I  connect two components (A LCD Display and a Battery Charger) to a single serial port on a SBRIO 9642?
0 Kudos
Message 1 of 4
(5,080 Views)

Depending on the nature of your two serial devices, you may be able to use a serial port combiner or switch like these devices from B&B electronics:

 

Serial Port Combiners:  Good for intermittent data sources, but Tx data from the host is broadcast to both devices, which may cause undesired behavior in your device if the devices share any common or similar commands.

 

Serial Port Switches:  More flexible for communicating with multiple devices because the Tx data is sent only to the desired device.  The downside is any LabVIEW instrument driver you may be using will have to be modified to account for the extra "addressing" commands the switch uses to determine which device you want to talk to.

 

This is the only way I know to communicate with two devices using only one serial port.  One downside of both approaches is they limit the bandwidth available because only one device can communicate with the Single-Board RIO at any time.  If one device communicates often or continuously and the other is an intermittent device, you may have trouble getting the intermittent data through the switch or combiner because the first device to communicate gains access and blocks the other port until the communication is complete.

 

If you need a dedicated serial port for each device, you have a few of options for adding ports to Single-Board RIO, depending on your needs for ease of integration, size, and cost.

 

Easiest option, use an Ethernet based RS-232 device.  Downside, extra cost of an ethernet hub and ENET-232 device, but it does offer native VISA support from Single-Board RIO.

 

RS-232 C series module:  The NI 9870E module adds 4 RS232 ports to Single-Board RIO.  Downside, added cost and size of Single-Board RIO system, and the serial ports are not supported through VISA, so an RT interface layer and driver must be written in LabVIEW FPGA.  

 

Most difficult work, but lowest cost option, Emulate RS232 port in LabVIEW FPGA: Depending on your devices, you may need to add an RS232 transceiver to the front end of your FPGA DIO lines to make this option work, but many devices can work with an "RS232 TTL" level signals.  This would be very low cost, but again this option does not provide VISA API support, so any instrument drivers you may have would need to be ported to your custom FPGA-232 driver API.

 

Hopefully this clearly lays out your options and tradeoffs for adding serial ports to Single-Board RIO.

 

Cheers,

 

 

Spex
National Instruments

To the pessimist, the glass is half empty; to the optimist, the glass is half full; to the engineer, the glass is twice as big as it needs to be has a 2x safety factor...
0 Kudos
Message 2 of 4
(5,059 Views)

I'm reviving this thread because I'd like to inquire about "Emulate RS232 port in LabVIEW FPGA". I was redirected to a dead link but I can imagine that it contained a sample VI on using one of the digital IO to be an RS232 tx or rx port which I plan to do. I was wondering if a RS232 VI is already available to be used as RS232. Can someone direct me to a sample code. I am using an NI sbRio 9636. 

0 Kudos
Message 3 of 4
(4,158 Views)

Greetings;

 

I do not know what the link contained, but if you are attempting to create an RS232 interface, you might want to look at the following link:

https://forums.ni.com/t5/Example-Code/RS-232-Interface-Reference-Example-for-LabVIEW-FPGA/ta-p/39960...

 

It contains a few iterations of an example that seems to be doing this; I have not given it a whirl myself, however.

 

Anyhow, have a great day!

 

Cordially;

Simon P.

National Instruments
Applications Engineer
0 Kudos
Message 4 of 4
(4,135 Views)