Instantiate a large number of ModbusTCPSlave CODESYS

valeria
2021-07-20
2021-07-21
  • valeria - 2021-07-20

    I'm new in Codesys. I have to communicate with a large number of remote Modbus slave. For this I would like to create an "object" (FB or others... whatever) MBslave and instantiate it several times. I can realize this graphically (in the device tree in codesys) by creating under "Ethernet" a "Modbus_Master" module and then under that create all the Modbus_Slave modules. But for reasons of maintenance I want to realize this "by hand". Is this possible? I have already declared variables of type "ModbusTCPSlave" inserts ports, IP addresses, etc. But I am suck on mapping I/O?
    Any information is very welcome! ;) Thanks.

     

    Last edit: valeria 2021-07-20
  • valeria - 2021-07-20

    Wow! Sound good :) I have a look. Thanks

     
  • valeria - 2021-07-21

    Again, thanks for the link.
    I had a look at this example, understood the global idea and made a super very simple test : instance one object "clientTcp: ModbusFB.ClientTcp;"
    The library ModbusFB was download "automatically" via Library Manager.

    When I instance the object "clientTcp: ModbusFB.ClientTcp;" , I have no red underlined and when I compile the code get a bunch of errors relative to the ModbusFB library. For example "Unknown type: SysComSettings" and when I look through the ModbusFB library I just cannot find this method.
    It looks to me that the ModbusFB library seems to be the wrong one or some dependencies are missing.
    Any suggestion?

     

    Last edit: valeria 2021-07-21

Log in to post a comment.