Internal error codes of the TwinCAT TCP/IP Connection Server

Code (hex)

Code (dec)

Symbolic constant

Description

0x00008001

32769

TCPADSERROR_NOMOREENTRIES

No new sockets can be created (for FB_SocketListen and FB_SocketConnect).

0x00008002

32770

TCPADSERROR_NOTFOUND

Socket handle is invalid (for FB_SocketReceive, FB_SocketAccept, FB_SocketSend etc.).

0x00008003

32771

TCPADSERROR_ALREADYEXISTS

Is returned when FB_SocketListen is called, if the TcpIp port listener already exists.

0x00008004

32772

TCPADSERROR_NOTCONNECTED

Is returned when FB_SocketReceive is called, if the client socket is no longer connected with the server.

0x00008005

32773

TCPADSERROR_NOTLISTENING

Is returned when FB_SocketAccept is called, if an error was registered in the listener socket.

0x00008006

32774

TCPADSERROR_HOST_NOT_FOUND

Returned if the target system is not reachable.

0x00008080

32896

TCPADSERROR_TLS_INVALID_STATE

Returned if FB_TlsSocketAddCa, FB_TlsSocketAddCrl , FB_TlsSocketSetCert or FB_TlsSocketSetPsk are called and a Connect has already been called.

0x00008081

32897

TCPADSERROR_TLS_CA_NOTFOUND

Returned if the specified CA certificate was not found.

0x00008082

32898

TCPADSERROR_TLS_CERT_NOTFOUND

Returned if the specified certificate file was not found.

0x00008083

32899

TCPADSERROR_TLS_KEY_NOTFOUND

Returned if the specified file with the private key was not found.

0x00008084

32900

TCPADSERROR_TLS_CA_INVALID

Returned if the specified CA certificate could not be read or is invalid.

0x00008085

32901

TCPADSERROR_TLS_CERT_INVALID

Returned if the specified certificate file could not be read or is invalid.

0x00008086

32902

TCPADSERROR_TLS_KEY_INVALID

Returned if the specified private key could not be read or is invalid.

0x00008087

32903

TCPADSERROR_TLS_VERIFY_FAIL

Returned if the remote terminal could not be verified during the TLS handshake.

0x00008088

32904

TCPADSERROR_TLS_SETUP

Returned if a general error occurred while setting up the TLS connection.

0x00008089

32905

TCPADSERROR_TLS_HANDSHAKE_FAIL

Returned if an error occurred during the TLS handshake. Usually the handshake always works. However, if there are connection problems during the handshake, it may fail.

0x0000808A

32906

TCPADSERROR_TLS_CIPHER_INVALID

Returned if an invalid cipher suite was specified.

0x0000808B

32907

TCPADSERROR_TLS_VERSION_INVALID

Returned if an invalid TLS version was specified.

0x0000808C

32908

TCPADSERROR_TLS_CRL_INVALID

Returned if the specified Certificate Revocation List (CRL) is invalid.

0x0000808D

32909

TCPADSERROR_TLS_INTERNAL_ERROR

Returned if an internal error occurred while setting up the TLS connection.

0x0000808E

32910

TCPADSERROR_TLS_PSK_SETUP_ERROR

Returned if an error occurred when using a PreSharedKey (PSK) for TLS.

0x0000808F

32911

TCPADSERROR_TLS_CN_MISMATCH

Returned if the CommonName in the certificate of the remote terminal does not match the host name or IP address used.

0x00008090

32912

TCPADSERROR_TLS_CERT_EXPIRED

Returned when the certificate of the remote terminal has expired.

0x00008091

32913

TCPADSERROR_TLS_CERT_REVOKED

Returned when the certificate of the remote terminal has been revoked.

0x00008092

32914

TCPADSERROR_TLS_CERT_MISSING

Returned when the remote terminal did not submit a certificate.

Requirements

Development environment

Target system type

PLC libraries to include

TwinCAT v3.1

PC, CX (x86) or CX (ARM)

Tc2_TcpIp