Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

M241 RTU modbus slave address

sarunasz
2022-04-28
2022-05-04
  • sarunasz - 2022-04-28

    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?

     
  • sarunasz - 2022-04-29

    What values need to write to ObjType and FirstObj of function block "Read_var" in order to I will read modbus address 1296

     
  • tvm - 2022-05-04

    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.

     

Log in to post a comment.