FB_TelnetCommunication - General Information

Overview

Type:

Function block

Available as of:

V1.6.0.0

Inherits from:

-

This chapter provides information on:

Task

Establish the communication via Telnet, for example to a Cognex Vision System.

Description

The function block FB_TelnetCommunication establishes the communication via Telnet, for example to a Cognex Vision System, and provides functionality to send command and receive data.

For more information, refer to Using FB_TelnetCommunication.

Interface

Input

Data type

Description

i_xEnable

BOOL

TRUE: Enable the function block and connect to the Cognex Vision System.

i_xExecute

BOOL

With the rising edge, the command selected on the input i_sNativeCmd is sent to the Cognex Vision System. The input is ignored as long as q_xBusy is TRUE.

i_xErrorQuit

BOOL

The function block acknowledges a detected error indicated by q_xError upon a rising edge of this input.

i_sIPAddress

STRING[20]

IP address of the vision system.

i_uiPort

UINT

Port of the Telnet communication (default port is 23).

i_sUser

STRING[255]

User for login to the Cognex Vision System (default: admin).

i_sPassword

STRING[255]

Password for login to the Cognex Vision System (default is an empty string).

i_sNativeCmd

STRING[255]

Command to send to the Cognex Vision System.

Output

Data type

Description

q_xActive

BOOL

TRUE: Function block is active.

FALSE: Function block is not active, inputs are ignored.

q_xReady

BOOL

TRUE: Connection to Cognex Vision System is active.

q_xBusy

BOOL

TRUE: A command is sent to the Cognex Vision System. Is TRUE when the input i_xExecute is TRUE.

q_xDone

BOOL

TRUE: Data from Cognex Vision System received

q_xError

BOOL

TRUE: An error occurred during last command. For more information refer also to q_etResult and q_sResultMsg.

q_etResult

SERT.ET_DiagExt

POU-specific output on the diagnostic.

  • q_etDiag = GD.ET_Diag.Ok -> Status message

  • q_etDiag <>GD.ET_Diag.Ok -> Diagnostic message

q_sResultMsg

STRING[255]

Event-triggered message that gives additional information on the diagnostic state.

q_xLoggedIn

BOOL

TRUE: Connected to the Cognex Vision System.

q_sResponse

STRING[255]

Single line of response from Cognex Vision System, is overwritten as soon as new data is received. Is cleared if i_xExecute is set to TRUE or i_xEnable is set to FALSE.

q_asMessage

ARRAY[1...Gc_uiNumberOfTelnetMessages] OF STRING(255)

Complete response from Cognex Vision System as array is overwritten as soon as new data is received. Is cleared if i_xExecute is set to TRUE or i_xEnable is set to FALSE.

Methods

Name

Description

RegisterLoggerPoint

Register the FB_TelnetCommunication to the Application Logger.

Diagnostic Messages

q_xError

q_etResult

Enumeration value of q_etResult

Description

FALSE

Ok

0

Success.

FALSE

Disabled

1

Function block is disabled.

TRUE

ConnectionRefused

3

The connection has been refused.

TRUE

ConnectionTimedOut

4

The connection has a time out.

TRUE

ConnectionLost

5

The connection has been lost.

TRUE

IPAddressInvalid

6

The IP address is invalid.

Ok

Enumeration name:

Ok

Enumeration value:

0

Description:

Success

Status message: Reading the data was successful.

Disabled

Enumeration name:

Disabled

Enumeration value:

1

Description:

Function block is disabled.

ConnectionRefused

Enumeration name:

ConnectionRefused

Enumeration value:

3

Description:

The connection has been refused.

Issue

Cause

Solution

No connection to Cognex Vision System possible.

Invalid configuration and connection to the Cognex Vision System.

Ensure that the IP address of the Cognex Vision System is correct. Verify the connection to the Cognex Vision System.

ConnectionTimedOut

Enumeration name:

ConnectionTimedOut

Enumeration value:

4

Description:

The connection has a time out.

Issue

Cause

Solution

Connection to Cognex Vision System is not possible.

The connection to the Cognex Vision System timed out.

Verify the connection to the Cognex Vision System.

ConnectionLost

Enumeration name:

ConnectionLost

Enumeration value:

5

Description:

The connection has been lost.

Issue

Cause

Solution

The connection to Cognex Vision System is lost.

The connection to Cognex Vision System is lost.

Reconnect by setting i_xErrorQuit or disable and enable the function block.

IPAddressInvalid

Enumeration name:

IPAddressInvalid

Enumeration value:

6

Description:

The IP address is invalid.

Issue

Cause

Solution

The IP address is invalid.

The given string i_sIPAdress is not a valid IPv4 address.

Ensure that i_sIPAddress contains a valid IPv4 address.