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

How do you change the 'read offset' of a Modbus channel on the fly?

blewl
2018-11-14
2021-04-14
  • blewl - 2018-11-14

    Hi

    I am setting up a test rig to test Modbus TCP. The user can enter in one of 250 parameters to either read or write. I don't want to make 500 channels for reading and writing the parameters, when I can make 2 and change the offset value. How do I do this, do I need some sort of pointer or global variable?

    Currently the offset is 0 for both, see attached.

    Thanks

    IMG: Untitled.png

     
  • dFx

    dFx - 2018-11-14

    Hi Blewl,

    as far as I know, you can't use your scanner. Instead use a ModbusTCPSlave FB, or build it from CAA.NetBaseServices.
    For schneider PLC, they provide SE_Communication lib with include a TCPSlave FB.

    Best regards,
    dFx

     
  • dengsberg - 2021-04-14

    Hi Blewl,
    Did you end up with a workable solution? I am using the Modbus_TCP_Slave by adding it to the device tree under the Modbus_TCP_Master. I need to allow the user to change the slave device Offset setting through the HMI. It seems that value is not accessible in runtime.

    I'm not really sure I understand the response from dFx in using a ModbusTCP Slave FB. I'm still a beginner, and also mostly just familiar structured text. Any more info on that would be very helpful.
    Thanks.

     

Log in to post a comment.