ModTcpInfo (FB)

FUNCTION_BLOCK ModTcpInfo EXTENDS AbbLConA

Function Block serves to read Modbus TCP/IP information

InOut:

Scope

Name

Type

Initial

Comment

Inherited from

Input

Enable

BOOL

FALSE

A rising edge (Enable = TRUE) starts the operation, the output Busy goes to TRUE. All other inputs are read and considered continuously. A falling edge (Enable = FALSE) aborts the operation. During Aborting the Busy is still TRUE. Afterward all outputs are reset.

AbbLConA

Output

Done

BOOL

FALSE

Operation is completed without error (while outputs Busy and Error are FALSE). This output is TRUE for at least one cycle or until Enable is set to FALSE.

AbbLConA

Busy

BOOL

FALSE

Operation is running (while outputs Done and Error are FALSE)

AbbLConA

Error

BOOL

FALSE

Operation is stopped with error (while outputs Busy and Done are FALSE). This output is TRUE for at least one cycle or until Enable is set to FALSE. The output ErrorID gives more details about the error.

AbbLConA

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