Codesys Modbus RTU - when are values read?

If most of your Modbus settings are left to default, the Modbus Channel is getting scanned cyclically. You can change that in the channel settings to “Application” so that you get programmatic control.

image

This lets you use a function block from the auto-added IoDrvModbus library. This ModbusChannel function block is used to select the desired Modbus_Slave, pick the Channel to operate, and then Execute the assigned Modbus function code.

I hope this helps!

–Adam

2 Likes