Executing Modbus TCP Write Function When a Variable Becomes TRUE

Hello,

I want to use Modbus TCP to write 0 to a remote device using Function Code 6. In the map view, I can set it to execute automatically or at a set cycle time. However, what I want is to execute the write when a variable becomes TRUE. Is there a good way to do this?

Thank you.

Hello David,

You can use the AsMbTCP library function mbWriteSingleRegister to execute a one-shot FC 6 command to a known ModubsTCP station.

AS Help link: B&R Online Help (br-automation.com)