Hello,
Somebody have suggest how need read data from slave using modbus RTU. I am using M241 PLC and read_var function. The picture you can see my PLC program. The data of slave is placed 3394 address. Then I try to read, always "READ_VAR" function get "CommError" which number is 254 that means "The detected operation error contains protocol- specific code" and "OpenError" which number is 3 that means I don't know. How need read from slave data, which modbuss adress is 3394 using Read_var function?
When the communication error code is FE hex, the OperationErrorCodes enumerated type contains the protocol-specific error detection code. (Refer to your specific protocolβs error detection codes.)
So, the OperError code 3 is a Modbus exception code 3, "Illegal Data Value". Which is strange, because you're reading a value, not writing, so the only value that could be incorrect is the Quantity. I have seen devices that only allow you to read multiple registers at the same time.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Probably Object Type MW, and address 1296. But Modbus is a bit of a free for all when it comes to addressing and implementation, so you might have to try some different things. It could be Object Type IW, or the address could be 1295 if it's zero based. Or it could be 41295 or 31295 if they implemented it that way. Assign a variable to the inputs so you can experiment with the addressing when you're online until you get the result you're expecting.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The object datatype for the addressing is MW and then direct use 1296 for the register address. You could also use a Modbus_ioscanner and read direct from configurator like this:
Hello,
Somebody have suggest how need read data from slave using modbus RTU. I am using M241 PLC and read_var function. The picture you can see my PLC program. The data of slave is placed 3394 address. Then I try to read, always "READ_VAR" function get "CommError" which number is 254 that means "The detected operation error contains protocol- specific code" and "OpenError" which number is 3 that means I don't know. How need read from slave data, which modbuss adress is 3394 using Read_var function?
https://product-help.schneider-electric.com/Machine%20Expert/V1.1/en/m2xxcom/m2xxcom/Communication_Functions_on_Controllers/Communication_Functions_on_Controllers-3.htm#XREF_D_RU_0004860_1
When the communication error code is FE hex, the OperationErrorCodes enumerated type contains the protocol-specific error detection code. (Refer to your specific protocolβs error detection codes.)
So, the OperError code 3 is a Modbus exception code 3, "Illegal Data Value". Which is strange, because you're reading a value, not writing, so the only value that could be incorrect is the Quantity. I have seen devices that only allow you to read multiple registers at the same time.
What values need to write to ObjType and FirstObj of function block "Read_var" in order to I will read modbus address 1296
Probably Object Type MW, and address 1296. But Modbus is a bit of a free for all when it comes to addressing and implementation, so you might have to try some different things. It could be Object Type IW, or the address could be 1295 if it's zero based. Or it could be 41295 or 31295 if they implemented it that way. Assign a variable to the inputs so you can experiment with the addressing when you're online until you get the result you're expecting.
https://product-help.schneider-electric.com/Machine%20Expert/V2.0/en/m2xxcom/m2xxcom/Function_Block_Descriptions/Function_Block_Descriptions-3.htm#IX_READ_VAR
The object datatype for the addressing is MW and then direct use 1296 for the register address. You could also use a Modbus_ioscanner and read direct from configurator like this: