There are four RJ50 ports on NI 9871 which can be converted to DB-9 ports by the cables included with your kit. You can use a cable with an RJ50 or DB-9 terminal and a flying-lead terminal to get raw leads of a serial port.
The following steps would help you connect these serial ports with flying leads:
- Check the pin definitions of your device. For serial communication without flow control as a simple example, your 2-wire RS485 device may have 3 pins to wire (one GND pin and a pair of differential signal pin, Data+/- or A/B), while your 4-wire RS482 device and RS422 devices may have 5 pins (one GND pin and two pairs of differential signal pin, RX+/- and TX+/-).
- Check the pin definitions of RJ50 and DB-9 serial ports on NI 9871 in Getting Started Guide .
- Wire pins pair base on these tables.
- RS485 2-wire mode
| NI 9871 | Device |
|---|
| RX+ and TX+ | A (Data+) |
| RX- and TX- | B (Data -) |
| GND | GND |
- RS422 (or RS485 4-wire mode)
| NI 9871 | Device |
|---|
| RX+ | TX+ |
| RX- | TX- |
| TX+ | RX+ |
| TX- | RX- |
| GND | GND |
- You should check or change the serial port configuration before testing the communication. The Getting Started Guide and Discover, Configure, and Communicate with NI 987x Modules in Scan Mode article will be helpful.
Additional Information
When working in RS485 2-wire mode, NI 9871 module will not automatically short the RX and TX lines inside, so you must manually short them with leads.
RS422 and 4-wire RS485 protocols are almost same in physical layer, so the wiring is same.
If flow control (or handshaking) is needed, you should wire the RTS+/- and CTS+/- pins as well. The table following shows the pin pairing.
| NI 9871 | Device |
|---|
| RTS+ | CTS+ |
| RTS- | CTS- |
| CTS+ | RTS+ |
| CTS- | RTS- |