ModTcpInfo (FB)

FUNCTION_BLOCK ModTcpInfo EXTENDS AbbLCon3

Function Block serves to read Modbus TCP/IP information

InOut:

Scope

Name

Type

Initial

Comment

Input

Eth

BYTE

ETH1

Index number of the assigned Ethernet interface - input is ignored, existing for compatibility reasons only

Output

ErrorID

ERROR_ID

ERROR_ID.NO_ERROR

Code of error occured during execution
NO_ERROR - Execution successfully completed
ERR_NOT_CONFIGURED - Modbus TCP not configured
ERR_INTERNAL_ILLEGAL_ARGUMENT - Stack reports illegal argument (internal error)
ERR_UNKNOWN - Undefined error

NumSrv

BYTE

0

Maximum number of supported Server connections (PLC as Modbus TCP Server)

Rdy

BOOL

FALSE

OpenModbus on TCP/IP processing ready

Stat

WORD

0

Status of OpenModbus on TCP/IP processing. Set to 0 in any case, output left for compatibility reasons only

NumErrs

DWORD

0

Number of errors occured. Does not cover TCP/IP issues like ‘failed to connect’, Modbus errors on established connections only

LastErr

WORD

0

Code of last error occured. Set to 0 in any case, output left for compatibility reasons only