PLC libraries VAR_OUTPUT VAR_OUTPUT bBUSY : BOOL; bError : BOOL; nErrId : UDINT; cbRead : UDINT; END_VAR bBusy : When the function block is activated this output is set. It remains set until an acknowledgement is received. bError : If an ADS error should occur during the transfer of the command, then this output is set once the bBusy output is reset. nErrId : Supplies the ADS error number when the bError output is set. cbRead: Contains the number of bytes currently read. Requirements 7.1.11.2 FB_MBUdpReadInputs (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; nUnitID : BYTE:=16#FF; nQuantity : WORD; nMBAddr : WORD; cbLength : UDINT; pDestAddr : UDINT; bExecute : BOOL; tTimeout : TIME; END_VAR TS6250 38 Version: 1.2 Function specific ADS error code Possible reason 0x8001 Modbus function not implemented 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