LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I want to communicate a RS485/2-wire device through COM1. I tried Instrument I/O Assistance to write to COM1(hex string with or without end bye:0D0A), something happened on the bus, but is not defirrential signal, and device didn't recognised them.

I am new to LabView, so please bear with me...
 
I tried to communicate with an RS485/2-wire device through COM1.  I used Instrument I/O Assistant (and Advanced/Basic Serial Write and Read examples) to write command (HEX string) to COM1,  
tried writing HEX strings with and withour end bye (is 0D0A the correct end signal for HEX string?).  Both didn't get device's responce.  Looks like the device didn't recognize the command.
I monitored the transmitted signals on the bus, they were not differential as supposed to be.....
What is the possible reason to cause this? Please help...
 
The hardware connection is OK, because I am able to communicate with the device through COM1 (with the same command) using different software application.
0 Kudos
Message 1 of 5
(3,471 Views)

How are you sending the hex? Is your string control set for hex display or normal? If it's set for normal, then if you send something like 'AD', then you aer sending the ASCII characters 'A' and 'D' and that's not the same thing. I don't believe the I/O assistant can send hex but you can modify the basic serial write and read to do so. Just right click on the string control and select 'Hex Display'. You can also enter the data in a numeric control (set for dex display) and use a type cast or an array of U8's and use the Byte Array to String function. Hex data usually doesn't use any kind of termination characters such as CR/LF.

If communication is working with another app, then as you said, the hardware is okay and it's not a problem with differential signaling.

0 Kudos
Message 2 of 5
(3,462 Views)

Thanks for the reply.  I did tried the basic serial write and read modules and used HEX DISPLAY to write to COM1.  The result was the same.

Is RS485 (modbus) protocal used by the device made all theses difficulties?

DOes VISA serial module support RS485?

Thanks for the help in advance.

0 Kudos
Message 3 of 5
(3,453 Views)
If you need to communicate through Modbus, you need additional code: see this thread http://forums.ni.com/ni/board/message?board.id=170&message.id=86164 for a rather complete answer (thanks to Khalid).
Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 4 of 5
(3,436 Views)