Modbus communication error

More
6 years 9 months ago #155241 by cmorley
Replied by cmorley on topic Modbus communication error
Looks from your setup software that the function should be 3 (read hold registers)not 4 ....

Please Log in or Create an account to join the conversation.

More
6 years 9 months ago #155244 by jsskangas
I did try 3 (read hold registers) and it did not make any difference:

Serial reading...
5 chars found
INFO CLASSICLADDER- Modbus I/O module received: Lgt=5 -> (Slave address-1 - Function code-83 ) 2 C0 F1
ERROR CLASSICLADDER- MODBUS-EXCEPTION RECEIVED:83 (Excep=2)
ERROR CLASSICLADDER- MODBUS-INCORRECT RESPONSE RECEIVED FROM SLAVE!!!
Serial flush all!
INFO CLASSICLADDER- Modbus I/O module to send: Lgt=8 <- Slave address-1 Function code-3 Data-8 34 0 1 C7 A4
INFO CLASSICLADDER- MODBUS Length we should receive=4 (+3)
Serial config...
Serial writing...
Writing done!
select() for serial reading...
Serial reading...
5 chars found
INFO CLASSICLADDER- Modbus I/O module received: Lgt=5 -> (Slave address-1 - Function code-83 ) 2 C0 F1
ERROR CLASSICLADDER- MODBUS-EXCEPTION RECEIVED:83 (Excep=2)
ERROR CLASSICLADDER- MODBUS-INCORRECT RESPONSE RECEIVED FROM SLAVE!!!
Serial flush all!
INFO CLASSICLADDER- Modbus I/O module to send: Lgt=8 <- Slave address-1 Function code-3 Data-8 34 0 1 C7 A4
INFO CLASSICLADDER- MODBUS Length we should receive=4 (+3)
Serial config...
Serial writing...
Writing done!
select() for serial reading...
Serial reading...
5 chars found
INFO CLASSICLADDER- Modbus I/O module received: Lgt=5 -> (Slave address-1 - Function code-83 ) 2 C0 F1
ERROR CLASSICLADDER- MODBUS-EXCEPTION RECEIVED:83 (Excep=2)
ERROR CLASSICLADDER- MODBUS-INCORRECT RESPONSE RECEIVED FROM SLAVE!!!
Serial flush all!
INFO CLASSICLADDER- Modbus I/O module to send: Lgt=8 <- Slave address-1 Function code-3 Data-8 34 0 1 C7 A4
INFO CLASSICLADDER- MODBUS Length we should receive=4 (+3)
Serial config...
Serial writing...
Writing done!
select() for serial reading...
Serial reading...
5 chars found
INFO CLASSICLADDER- Modbus I/O module received: Lgt=5 -> (Slave address-1 - Function code-83 ) 2 C0 F1
ERROR CLASSICLADDER- MODBUS-EXCEPTION RECEIVED:83 (Excep=2)
ERROR CLASSICLADDER- MODBUS-INCORRECT RESPONSE RECEIVED FROM SLAVE!!!
Serial flush all!

Please Log in or Create an account to join the conversation.

More
6 years 9 months ago #155245 by cmorley
Replied by cmorley on topic Modbus communication error
It did make a difference - the exception code is now 2 - illegal data address

So the function (3) is corrected but seems the address is wrong
is address 2101 legal? in your test you used 2100

Please Log in or Create an account to join the conversation.

More
6 years 9 months ago #155246 by cmorley
Replied by cmorley on topic Modbus communication error
ahh I bet you did set 2100 in classicladder - try setting 'modbus element offset' to 0

Chris

Please Log in or Create an account to join the conversation.

More
6 years 9 months ago #155247 by cmorley
Replied by cmorley on topic Modbus communication error
Sorry I meant set offset to 1

Please Log in or Create an account to join the conversation.

More
6 years 9 months ago - 6 years 9 months ago #155248 by jsskangas
Hello

2100 and 2101 are correct. i tried them both, in hex value and in decimal.
I also tried different offsets 0-9. none made difference.




Last edit: 6 years 9 months ago by jsskangas.

Please Log in or Create an account to join the conversation.

Time to create page: 0.140 seconds
Powered by Kunena Forum