beckhoff TS6250 — 7.1.8 FB_MBWriteRegs(Modbus function 16)

PLC libraries nMBAddr : WORD := 14; arrData : ARRAY [1..2] OF BYTE := 16#75,16#03; END_VAR After a rising edge of "bExecute" and successful execution of the ReadCoils command, the content of the arrData array is written to digital outputs 15 - 24: Requirements 7.1.8 FB_MBWriteRegs(Modbus function 16) This function is used for writing 1 to 128 output registers (16 bit). VAR_INPUT VAR_INPUT sIPAddr : STRING(15); nTCPPort : UINT:= MODBUS_TCP_PORT; nUnitID : BYTE:=16#FF; nQuantity : WORD; nMBAddr : WORD; cbLength : UDINT; pSrcAddr : UDINT; bExecute : BOOL; tTimeout : TIME; END_VAR sIPAddr: Is a string containing the IP address of the target device. TS6250 31 Version:

1.2 Bit 0 1 1 1 0 1 0 1 0 0 0 0 0 0 1 1 Outp ut 22 21 20 19 18 17 16 15 X X X X X X 24 23 Development environment Target system type PLC libraries to be linked TwinCAT v2.8.0 PC (i386) TcModbusSrv.Lib