Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
6 ratings:
 2.33 out of 5     Rate this Document

Loop Back Test with a RS-485 Port in Two Wire Mode

Hardware: PXI/CompactPCI>>Controllers

Problem:
How do I do a loop back test with a RS-485 port in two wire mode (Auto or non-Auto mode)?

Solution:
Two-wire Auto Mode:
In RS-485 two wire mode you cannot do a traditional loop back test. A loop back test allows for simple testing of a port by sending and receiving data from the same serial port. To put a 485 port in two wire auto mode, connect pin four with pin eight and pin nine with pin five on the same port. You can connect the send and receive line on the port (4/8 with 5/9) and see the echo but this will not allow you to send and receive data to the same port as with other loop back tests. To achieve a test setup similar to traditional loopback test you need to have two 485 ports in two wire auto mode. Connect:
  • pin 1 (port 1) to pin 1 (port 2)
  • pin 4/8 (port1) to pin 4/8 (port 2)
  • pin 5/9 (port 1) to pin 5/9 (port 2)
You can now send data to one port in two wire mode and receive it on the other port in two wire auto mode with the attached example (485 Loopback Test 2 Wire Auto.vi).

Two-wire Echo (non-Auto) Mode:
In RS-485 two wire mode, if you are using auto mode, you cannot see your serial port's reflection by running a basic loopback test. In this case, use echo mode to send and receive data on the same port. Echo mode can be implemented with a serial property nodethe Wire Mode property. Property nodes can be obtained by right-clicking on the block diagram and navigating to Programming»Application Control»Property Node. Once you have wired in the VISA resource name, click on Property and navigate to Serial Settings»Wire Mode. Right-click on Wire Mode and select Change All to Write. Right-click on the input terminal and Create»Constant and choose RS485/Wire2-EchoDTR.

This property node is implemented in the second VI attached to this KnowledgeBase (485 Loopback Test 2 Wire Echo.vi).  In order for this VI to work properly, you must have the serial port wired in the following manner.

Note: For programs that is able to do a loopback test, refer to the Attachments section.

Related Links:
Developer Zone Tutorial: How to Do a Serial Loopback Test
KnowledgeBase 48NB9TBH: Pinout For Serial Ports

Attachments:
485 Loopback Test 2 Wire Echo.vi
485 Loopback Test 2 Wire Echo.vi
Wire Mode Property Node.jpg
RS485 female connections.jpg




Report Date: 04/28/2003
Last Updated: 03/20/2009
Document ID: 2WR9LNHW

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit