Reading and writing modbus registers - how to

Hi everyone.

I have created the following modbus code. I just wanted to find out if it is correct as this is the first time i am using modbus.

I am trying to read values and write to certain registers.

Thanks

Hello Hashmith,

I recommend that you use the Modbus Master example provided with Automation Studio (Examples). No equivalent example is available in Ladder Logic.

You should invoke the FUB MBMopen within the initialization subroutine of your task, as failure to do so may result in a cycle time violation.

Additionally, ensure that the Enable inputs of the function blocks are continuously set to TRUE, as these blocks require more than one cycle to complete their operations.

Best regards,

Stephan