PLC libraries Example of calling the block in FBD: PROGRAM Test VAR fbWriteSingleReg : FB_MBWriteSingleReg; bWriteReg : BOOL; bWriteRegBusy : BOOL; bWriteRegError : BOOL; nWriteRegErrorId : UDINT; nMBAddr : WORD := 4; nValue : WORD := 16#1234; END_VAR After a rising edge of "bExecute" and successful execution of the WriteSingleReg command, the value 16#1234 is written into register 5. Requirements 7.1.7 FB_MBWriteCoils (Modbus function 15) This function is used for writing 1 to 2048 digital outputs (coils). One digital output corresponds to one bit of the write data bytes. TS6250 29 Version:
1.2 Function specific ADS error code Possible reason 0x8002 Invalid address or length 0x8003 Invalid parameters: - wrong number of registers 0x8004 Modbus server error Development environment Target system type PLC libraries to be linked TwinCAT v2.8.0 PC (i386) TcModbusSrv.Lib