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
I wonder if someone already managed to create a FB that emulates the Modbus Slave COM Port that is normally added to the Device Tree.
I need to do that via a FB, because I do not know how many slaves will be added. That information will be provided on site during the installation of the equipment, e.g via the visualization - 2 slaves, 3 slaves, .. 30 slaves.
I have created a FB that EXTENDS ModbusSlaveComPort, which is the same type of object that is added to the device tree. However, I do not know what to do next regarding how to create the channels and link the Slave(s) to the Master.
Dear Members,
I wonder if someone already managed to create a FB that emulates the Modbus Slave COM Port that is normally added to the Device Tree.
I need to do that via a FB, because I do not know how many slaves will be added. That information will be provided on site during the installation of the equipment, e.g via the visualization - 2 slaves, 3 slaves, .. 30 slaves.
I have created a FB that EXTENDS ModbusSlaveComPort, which is the same type of object that is added to the device tree. However, I do not know what to do next regarding how to create the channels and link the Slave(s) to the Master.
Any help is appreciated.
You could use the FB ModbusRequest2, so you don't have to create devices in the device tree:
https://help.codesys.com/webapp/Qc2MKyULLzzWS3JELTbsDHGWaRw%2FModbusRequest2;product=IoDrvModbus;version=3.5.17.0
See also:
https://forge.codesys.com/forge/talk/Engineering/thread/60b62c103f/
To open the COM port, see:
https://help.codesys.com/webapp/RJFsL1rVvIWPJ9jLGcMefN90Huo%2FOpen;product=CAA%20SerialCom;version=3.5.17.0
Thank you for your suggestions Tim, (timvh)! The software is now working.