当前位置:网站首页>LabVIEW performs a serial loopback test

LabVIEW performs a serial loopback test

2022-06-10 23:47:00 LabVIEW development

LabVIEW Perform the serial loopback test

Loopback test can verify the operation of serial communication by sending and receiving data from the same serial port . It can display the serial port , A problem with the cable or the software that generates the message , Without connecting to third-party hardware . Loopback testing can be used for RS-232,RS-422 and RS-485 serial communication .

Connect hardware

Refer to the following sections to properly connect the hardware . Determine which serial communication protocol is used (RS-232 And RS-422 / 485) And the type of serial connector used .

RS-232

stay RS-232 On port , Will send (TXD) The signal is connected to the receiver (RXD) The signal . Depending on the connector type , Please refer to the following pins . Connections are shown in gray .

edit

Add picture comments , No more than 140 word ( Optional )

* Because the distance between the pins is very small , Therefore, it is not recommended to use alone RJ-50 Loop back test the connector .

RS-422 / 485(4 Line )

stay RS-422 / 485 On port , take TXD + Signal connected to RXD + The signal , take TXD- Signal connected to RXD- The signal . Depending on the connector type , Please refer to the following pins . The positive connection is indicated in red , The negative connection is shown in blue .

edit

Add picture comments , No more than 140 word ( Optional )

* Because the distance between the pins is very small , Therefore, it is not recommended to use alone RJ-50 Loop back test the connector .

RS-422 / 485(2 Line automatic )

about 2 Line configuration , Two... Will be required RS-485 Port to achieve settings similar to traditional loopback testing .

  1. At every RS-485 On port , stay TXD + and RXD + Between signals and TXD- and RXD- Place jumpers between signals .

  2. From port 1 To port 2, Connect the short-circuit positive signals together , And connect the short-circuit negative signal together . take GND The signals are connected together . Depending on the connector type , Please refer to the following pins .

Positive connections are shown in red , Negative connections are shown in blue ,GND Connections are shown in green .

Edit switch to center

Add picture comments , No more than 140 word ( Optional )

Because the spacing between pins is very small , Therefore, it is not recommended to use alone RJ-50 Loop back test the connector .

Configuration software

  1. from “ Start ” Open in menu Measurement and Automation Explorer(MAX).

  2. stay “ Equipment and interfaces ” Select the communication port of interest under . If you can't see the port , see also MAX or LabVIEW Serial in COM Port lost .

  3. Select... At the bottom of the window “ Port settings ” tab . Make sure the correct settings are selected , And then choose “ verification ”.

edit

Add picture comments , No more than 140 word ( Optional )

  1. If you are using RS-485, Please select “ senior ” tab , And make sure that... Is set correctly Transceiver mode .

  2. Select Save to save the settings .

Test communication

Be careful : Can be in MAX VISA Test panel or LabVIEW In the example, the communication is tested . Make sure not to open at the same time VISA Test panels and LabVIEW, otherwise VISA Will throw the error of accessing resources ( Error code -1073807246 hex:0xbfff0072).

Measurement and Automation Explorer

  1. stay MAX in , Select the desired communication port , And then choose “ open VISA Test panel ” .

  2. open “ Test panel ” After window , choice “ Input / Output ” .

  3. stay “ basic I / O” Tab , choice “ Inquire about ” To send the default * IDN?\ n command .

  4. then , The display window will outline the write and read operations . The test panel shall successfully read the sent * IDN?\ n command .

edit

Add picture comments , No more than 140 word ( Optional )

LabVIEW

about RS-232 and RS-485(4 Line ), Please use the factory sample Simple Serial.vi Test communication .

  1. To find examples , Please open the LabVIEW And navigate to the help tab >> Find examples >> Hardware input and output >> Serial >> Simple Serial.vi .

  2. Make sure you choose the right VISA Resource name , And the serial setting is correct .

  3. function VI.

  4. The response indicator shall show * IDN?\ n command .

If you are using RS-485(2 Line system ), Please use the factory sample RS-485 Transceiver Control.vi Test communication .

  1. To find examples , Please open the LabVIEW And navigate to the help tab >> Find examples >> Hardware input and output >> Serial >> RS-485 Transceiver Control.vi .

  2. Make sure you choose the right VISA Resource name , And the serial setting is correct .

  3. According to the Pattern Appoint Transceiver mode .

  4. function VI.

  5. The response indicator shall show * IDN?\ n command .

More details , Participate in the introduction of the following annex .

LabVIEW、LabVIEW Development 、LabVIEW Programming 、LabVIEW Program

Examples and information mentioned above , Both in word In the attachment in , Click to download . Learn more , Can you contact us .

LabVIEW Perform the serial loopback test - Beijing Hanwen Wangxing Technology Co., Ltd (bjcyck.com)

原网站

版权声明
本文为[LabVIEW development]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/161/202206102229543189.html