PLC libraries nQuantity : WORD := 10; nMBAddr : WORD := 5; arrData : ARRAY [1..2] OF BYTE; END_VAR After a rising edge of "bExecute" and successful execution of the ReadCoils command, the content of digital outputs 6 - 15 is written into the arrData array: Requirements 7.1.2 FB_MBReadInputs (Modbus function 2) This function is used for reading 1 to 2048 digital inputs. One digital input corresponds to one bit of the read data bytes. VAR_INPUT VAR_INPUT sIPAddr : STRING(15); nTCPPort : UINT:= MODBUS_TCP_PORT; TS6250 20 Version:
1.2 Digital outputs Array offset Status 6-13 1 0x54 The status of output 13 is the MSB of this byte (left) The status of output 6 is the LSB of this byte (right) 14-15 2 0x02 Since only 10 outputs are to be read, the remaining bits (3-8) are set to 0. Development environment Target system type PLC libraries to be linked TwinCAT v2.8.0 PC (i386) TcModbusSrv.Lib