beckhoff TS6250 — 7.1.11.1 FB_MBUdpReadCoils (Modbus function 1)

PLC libraries After rising edge of "bExecute" and successful execution of the diagnosis command, nReadData contains the read data word. Requirements 7.1.11 UDP 7.1.11.1 FB_MBUdpReadCoils (Modbus function 1) This function is used for reading 1 to 2048 digital outputs (coils). One digital output 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 sIPAddr : Is a string containing the IP address of the target device. nTCPPort : Port number of the target device. nUnitID :

Identification number of a serial sub-network device. If a device is addressed directly via TCP/IP, this value must be 16#FF. nQuantity : Number of digital inputs (data bits) to be read. The value of nQuantity must be > 0. nMBAddr : Start address of the digital inputs to be read (bit offset). cbLength : Contains the max. byte size of the destination buffer into which the data are to be read. The minimum buffer byte size must be: (nQuantity + 7) / 8 . pDestAddr : Contains the address of the destination buffer into which the data are to be read. The buffer can be a single variable, an array or a structure, whose address can be found with the ADR operator. bExecute :

The function block is activated by a rising edge at this input. tTimeout : States the length of the timeout that may not be exceeded by execution of the ADS command. TS6250 37 Version: 1.2 Development environment Target system type PLC libraries to be linked TwinCAT v2.8.0 PC (i386) TcModbusSrv.Lib