Example Program Drafts

Showing results for 
Search instead for 
Did you mean: 

RS-485 Loopback (Port to Port) Test 2 Wire AUTO MODE ONLY

by Member mr-vizsla ‎04-03-2009 08:39 AM - edited ‎01-30-2017 10:12 AM


Programmatically configure loopback test.

Functional Description

In order to perform a RS-485 two wire loopback in AUTO mode, you need to have two separate ports to communicate between.  In this example, the two wire AUTO mode is programmatically set on both ports.  The important part is the connection made between the two ports.  Make sure to tie pins 4 and 8 (RXD+ and TXD+) together then wire this connection to pins 5 and 9 (RXD- and TXD-), which should also be tied together.  This is refelected in the next two images.


Requires LabVIEW 8.0 or higher and the NI-VISA drivers.

db9.jpgRS485 2 Wire AUTO connection.jpg

485 Loopback Test 2 Wire Auto_LV8.0_FP.jpg

485 Loopback Test 2 Wire Auto_LV86.jpg

Member mr-vizsla

I know there is another RS-485 auto mode VI on this community, but I was unable to get it to work without using two separate ports, which that examples does not include.  I have tested this, and it worked for me.


Active Participant Todd S.
Active Participant

Good stuff here, thanks for posting!

Member kinnikinnick

This is a great, simple summary.  Perfect for troubleshooting of RS485 2-wire connections.

Member RWG111

Great, tried NI examples with no joy. Your example worked first time! My card is working fine - all I wanted to know. Much appreciated.

Member Median9

Sorry if it sounds silly but can anyone please confirm if this example runs on a plain pair of RS-232 COM ports on a commercial PC? Or do we need to have hardware with RS-485 ports? Because i am getting an error when i run this vi using a pair of RS-232 COM ports on my PC.