MODBUS RTU query&response
Hi,
I am having almost the same problem of yours. I send a message to a PLC and it doesn't answer. The RX led blinks, but the TX stays quiet. I am suspecting that in my code the initialization of the rs232 driver is wrong. Maybe something related to the mode that is been used.
I am trying to understand what do you mean with the last two bytes of your datagram:
» 7.- error code- 0x83
» 8.- exception code- 0x01
You mean that these are the CRC bytes, right?
There are serveral algorithms to calculate these values on the internet. I have implemented one, according to the definition of the modbus.org site, and a second one, according to the examples that they give in the specification. They have different results ..
» Hi,
»
» i'm beginner in MODBUS, so please help me.
» i have a temperature regulator with MODBUS communication.
» For example:
» If i want to read holding register e.g.: 0042 „Value of temperature“ from
» mentioned device, in my application for MODBUS-RTU communication which i
» was writte in
» Microsoft Visual Studio 2005- VC#,
» i made request -byte array:
» {0x01, 0x03, 0x00, 0x29, 0x00, 0x01, 0x83, 0x01}
»
»
» 1- slave adress (configured in device)- 0x01
» 2.- function code(Read Holding Registers)- 0x03
» 3.- start adress Hi- 0x00
» 4.- start adress Lo- 0x29
» 5.- no. of registers Hi- 0x00
» 6.- no of registers Lo- 0x01
» 7.- error code- 0x83
» 8.- exception code- 0x01
»
» and sent that array to device. Label Rx blinks ,on the front panel of
» device, so device received my request, but i don't get any response, Tx
» doesn't blink!!!
» For example:
» If holding register 0042 „Value of temperature“=555, response message
» from device should be:
»
» {slave adress=0x01, function code= 0x03, byte count= 0x02, register value
» Hi= 0x02,
» register value Lo= 0x2B,... } !!!????
» But i get nothing!!!!
» All other parameters like port name, baud rate, parity, data bits, stop
» bits,ReadTimeout, WriteTimeout and RS485/RS232 converter are O.K.
» Plese, could You help me with some advice to get response from device and
» tell me what i do wrong.
» Is my request -byte array O.K.??? (especialy last two bytes 0x83, 0x01-
» CRC)
»
» Thank You very much.
»
» Best regards!
Complete thread: