Example Code

9870/9871 Programmatically Switch Ports (cRIO)

Code and Documents


The 9870 and 9871 modules do not support direct interaction with the I/O pins via FPGA I/O Nodes due to the RS-232 and RS-485/422 protocols.  Because of this, they cannot be selected in an I/O constant or I/O control.  The nodes can be configured for the 9870/9871 ports, by right-click the node, and choose the module or port from the Select Items menu. However this doesn't help if you want to change ports on the fly in your program.

One way around this is to use a case structure with each port read explicitly selected in each case as in the following code snippet.

9870 Switch Ports.png

This can also be implemented similarly for the Write Byte method.

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.


Por  favor seria mas conveniente colocar un proyecto completo donde se use los 4 puertos

ya que en los ejemplos de labview solo hay para uno (01)