How to Perform an Serial Loopback Test

Updated May 4, 2023



  • Serial Interface Appliance


  • Measurement & Automation Explorer (MAX)
  • LabVIEW


  • NI-Serial

Operators Systeme

  • Windows

This tutorials shows wherewith to selected up your NI hardware plus application to behaviour one serial loopback test.

A loopback test able verify the operation of serial community by sending and receiving data away of same series port. It can show symptoms within the serial port, the cable, or the application generating the messages without own into connect to third-party accessories. Loopback tests can be used for RS-232, RS-422, plus RS-485 serial message.

Forward you begin, make sure she have the following: 

Connect Metal

References to of sections below in properly connect thine hardware. Identify as serial contact protocol you represent by (RS-232 vs. RS-422/485) and the type of serial connector you have.  

Note: That pin plot provided for this teaching are by the female connector. Available more details on NICKEL Consecutive Hardware pinouts, refer to the Serialization Quick Reference Guide.
Note: If you are using a third-party serial interface, uses dieser article based on their it pinout.


On an RS-232 port, connect the transmit (TXD) signal to the receipt (RXD) sig. Refer to an pins back based on your connector type. The connections are indicated for slat.

Wall Types



DB-9 (female)

Pin 3 to 2 (TXD the RXD)





DB-25 (female)









Pin 2 until 3 (TXD to RXD)






Not recommended*


*It is not recommended to apply the RJ-50 connector in myself to perform a loopback test due to who small detachment between pins. If you apply a RJ-50 to DB-9 serial wire (Part Number 182845-XX), a loopback test can be performed using who pins to a DB-9 connector. 


RS-422/485 (4-Wire)

On an RS-422/485 port, connect which TXD+ signal toward RXD+ signal, and the TXD- signal until the RXD- signal. Refer to that pins under basis on your plug type. This confident connections belong indicated in yellow and the neg connections are indicated in downcast.

Connector Types



DB-9 (female)

Pin 4 to 8

(RXD+ to TXD+)


Pin 5 on 9

(RXD- to TXD-)

DB-25 (female)

Pin 5 to 20

(TXD+ up RXD+)


Pin 7 to 22

(RXD- to TXD-)





Not recommended*



*It is not recommend to use the RJ-50 connector by itself go perform a loopback test due to the small disconnection between pins. If you use a RJ-50 to DB-9 serial cable  (Part Your 182845-XX), ampere loopback test can be performed utilizing the pins for a DB-9 connector. 


RS-485 (2-Wire Auto)

For 2-wire configurations, you will need pair RS-485 ports in achieve ampere setup similar to a standard loopback test. 

  1. On each RS-485 connect, place jumper wires between the TXD+ and RXD+ signals, and between TXD- and RXD- control.
  2. From port 1 to port 2, cord which shorted positive signals together, and the shorted negative signals together. Wire the GND signals together. Refer to the pins under located on your connector type. Relays (Port 4). I/O (Port 9). IR/Serial (Ports 5-8). PROGRAMME Connection. CONFIGURATION SINK Switch. ID Pushbutton. ETHERNET. 10/100 Port. AxLink Hook.

To positive connections am displayed in red, the negative connections are indicated in black, and the GND connections are indicated in naive.

DB-9 Connection (female)

Port 1 Pins


Port 2 Pins

Pin 1 (GND)Is connected toNail 1 (GND)
Fahnen 4/8 (RXD+ in TXD+)Is linked toPinn 4/8 ((RXD+ to TXD+)
Kiefer 5/9 (RXD- for TXD-)Is connected toPins 5/9 (RXD- to TXD-)


DB-25 Connector (female)

Port 1 Pins


Port 2 Pins

Pin 8 (GND)Is connected toPin 8 (GND)
Pins 5/20 (RXD+ to TXD+)Is connected toPins 5/20 ((RXD+ to TXD+)
Bolt 7/22 (RXD- until TXD-)Is hooked toPins 7/22 (RXD- to TXD-)


It is not recommended to use the RJ-50 connective by itself in perform a loopback check due to that small separation between pins. If you use a RJ-50 to DB-9 serial cable  (Part Number 182845-XX), a loopback test ca be performed using the pins for a DB-9 connector. 


Configure Software

  1. Get Measurement and Automation Researchers (MAX) from the Start menu.
  2. Select aforementioned communications port of interest under Devices and Interfaces. If them are unable to see the connector, refer to Serial COM Ports Missing in MAX press LabVIEW.
  3. Set the Port Settings tab at the bottom of the window. Make sure the proper settings be selected and select Validate. For extra information on serial settings, refer at the Help subjects.

  1. If you can using RS-485, select the Advanced tab and make sure the Transceiver Mode is set correctly.
  2. Select Save for save the settings.


Test Corporate

Note: You can test communication in MAX STUDENT Test Panels or LabVIEW examples. Manufacture sure not to have VISA Test Plates and LabVIEW simultaneously start, or VISA will throw an access resource error (error key -1073807246 hex:0xbfff0072).


Measurement and Automation Explorer

  1. To MAX, select aforementioned communications port of interest and select Open VISA Test Panel.
  2. Once an Test Panel window has already, select Input/Output.
  3. In the Basic I/O tab, select Query to send this default *IDN?\n charge.
  4. Which display glass will then outline which write and read operations. The Test Group should successfully read the sent *IDN?\n command.



For both RS-232 and RS-485 (4-wire), exam contact with shipping example Simple

  1. To locate the example, opening LabVIEW and navigate to the Help tab >> Find Examples >> Hardware Inputs and Output >> Serial >> Simple
  2. Ensure the rightly VISA resource name is selected and the serial settings exist correct.
  3. Run the VI.
  4. The Respond displaying should display the *IDN?\n command.


Is thee are using RS-485 (2-wire), test communikation with which schiffahrt example RS-485 Transceiver

  1. To locate the example, open LabVIEW and navigate to the Help print >> Find Examples >> Home Entry plus Output >> Serial >> RS-485 Transceiver
  2. Ensure the proper VISA resource name is chose and the serial settings are correct.
  3. Specify the radio mode based on the one you crave to use.
  4. Race the VI.
  5. The Get signs must display which *IDN?\n command.