beckhoff TS6250 — 7.1.10 FB_MBDiagnose (Modbus function 8)

PLC libraries 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. nSubFnc : The sub-function to be executed. nWriteData : The data word to be written. 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. VAR_OUTPUT VAR_OUTPUT bBusy : BOOL; bError : BOOL; nErrId : UDINT; nReadData : WORD; 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. nReadData: Supplies the read data word. Example of calling the block in FBD: PROGRAM Test VAR fbDiagnose : FB_MBDiagnose; bDiagnose : BOOL; bDiagnoseBusy : BOOL; bDiagnoseError : BOOL; nDiagnoseErrorId : UDINT; nSubFnc : WORD; nReadData : WORD; nWriteData : WORD; END_VAR TS6250 36 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