FB_ReceiveVisionData - General Information

Overview

Type:

Function block

Available as of:

V1.0.0.0

Inherits from:

-

Implements:

-

This chapter provides information on:

NOTE: This function block has been superseded by the function block FB_ReceiveVisionDataServer.

Task

Collect the data for a vision protocol and analyze the data.

Description

The function block FB_ReceiceVisionData collects the data for a vision protocol and analyzes the data. You can read out the content of the protocol.

You must call the method ClearVisionData before sending (trigger) a new protocol; otherwise the function block generates an exception.

Interface

Input

Data type

Description

i_xEnable

BOOL

A rising edge FALSE -> TRUE activates the POU, a falling edge TRUE -> FALSE deactivates the POU.

A deactivated POU does not execute any action.

i_xDiagQuit

BOOL

A rising edge FALSE -> TRUE cancels an active exception of the POU.

Output

Data type

Description

q_xActive

BOOL

TRUE: The POU is active. If the output is TRUE while the i_xEnable is deactivated, the POU must first terminate its ongoing processing before transitioning this output to FALSE.

FALSE: The POU is inactive

q_xReady

BOOL

TRUE: The POU is ready to operate and can accept user commands.

FALSE: The function block is not ready to accept user commands.

q_etDiagExt

ET_DiagExt

POU-specific output on the diagnostic.

q_etDiag = ET_Diag.Ok -> Status message

q_etDiag <> ET_Diag.Ok -> Diagnostic message

q_etDiagExt

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_sMsg

STRING[80]

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

q_xClientConnected

BOOL

Indicates if there is a connected client.

Diagnostic Messages

q_etDiag

q_etDiagExt

Enumeration value of q_etDiagExt

Description

Ok

Ok

0

Ok.

Disabled

11

Disabled.

WaitUntilDisabled

10

Disabling.

Working

8

Working.

ConfigurationFailed

ConfigurationInvalid

16

Configuration invalid.

ExecutionAborted

AddressInUse

18

Address is in use.

AnotherProtocolAlreadyExecuting

20

Another protocol is already executing.

EndSignalOfDataInvalid

21

End signal of data invalid.

ProtocolHeaderInvalid

5

The header of protocol is invalid.

StartOfProductDataInvalid

6

The start of the product data is invalid.

VisionDataHasNotBeenCleared

24

Vision data has not been cleared.

LimitReached

AdditionalStringLengthExceeded

33

Length of the additional string was exceeded.

ProductsPerProtocolExceeded

19

Number of products per protocol was exceeded.

ProtocolLengthExceeded

15

Protocol length has been exceeded.

UserDataLengthExceeded

32

Length of the user data was exceeded.

UnexpectedProgramBehavior

UnexpectedFeedback

4

A feedback value is indeterminable.

AdditionalStringLengthExceeded

Enumeration name:

AdditionalStringLengthExceeded

Enumeration value:

33

Description:

Additional string length exceeded.

Issue

Cause

Solution

Length of the additional string was exceeded.

The length of the additional string exceeds the maximum length of 80 characters.

Adapt the length of the additional string.

AddressInUse

Enumeration name:

AddressInUse

Enumeration value:

18

Description:

Duplicate address.

Issue

Cause

Solution

The address/port is already used.

The IP address / port combination is not unique.

Verify that the combination of IP address and port is unique and not used by another client.

AnotherProtocolAlreadyExecuting

Enumeration name:

AnotherProtocolAlreadyExecuting

Enumeration value:

20

Description:

Another protocol is already executing.

Issue

Cause

Solution

Another protocol is already executing.

A protocol is not completely analyzed while a new protocol is sent.

Verify that no new protocol is triggered before the current protocol is completely analyzed.

ConfigurationInvalid

Enumeration name:

ConfigurationInvalid

Enumeration value:

16

Description:

The configuration is invalid.

Issue

Cause

Solution

The configuration is invalid.

The method Configuration(...) was not called successfully.

Verify that the method Configuration(...) was called successfully before enabling the function block FB_SendVisionData.

Disabled

Enumeration name:

Disabled

Enumeration value:

11

Description:

Disabled.

Issue

Cause

Solution

The function block is deactivated, no actions are executed.

FB_ReceiveVisionData.xEnable and FB_ReceiveVisionData.xActive are set to FALSE.

Set FB_ReceiveVisionData.xEnable to TRUE to enable the function block.

EndSignalOfDataInvalid

Enumeration name:

EndSignalOfDataInvalid

Enumeration value:

21

Description:

End signal of data invalid.

Issue

Cause

Solution

End signal of data is invalid

The end signal (CarriageReturn) of the vision data was not detected.

Verify that the data is terminated with a last signal CarriageReturn.

Ok

Enumeration name:

Ok

Enumeration value:

0

Description:

Success

Status message: Reading the data was successful.

ProductsPerProtocolExceeded

Enumeration name:

ProductsPerProtocolExceeded

Enumeration value:

19

Description:

Maximum number of products per protocol exceeded.

Issue

Cause

Solution

Number of products per protocol is exceeded.

The number of products in one vision protocol exceeds the maximum number (Gc_uiMaxNumberOfProductsPerProtocol).

Adapt the parameter Gc_uiMaxNumberOfProductsPerProtocol.

Send the product data in several protocols.

Refer to GPL.

ProtocolHeaderInvalid

Enumeration name:

ProtocolHeaderInvalid

Enumeration value:

5

Description:

The header of the protocol is invalid.

Issue

Cause

Solution

The header of the protocol is invalid.

The protocol length in the header is 0 (uiProtocolLength).

Verify that the header provides the correct length of the protocol.

Header of the protocol does not contain the string Vision (sHeaderId).

Verify that the protocol starts with the string Vision.

Header contains invalid characters after the string Vision.

Verify that the header only contains the string Vision followed by 16 numbers.

Another client sends data.

Verify that the combination of IP address and port is unique and not used by another client.

Refer to ST_VisionDataHeader.

ProtocolLengthExceeded

Enumeration name:

ProtocolLengthExceeded

Enumeration value:

15

Description:

The length of the protocol has been exceeded.

Issue

Cause

Solution

Protocol length is exceeded.

The length of the vision protocol exceeds the maximum length (Gc_uiMaxLengthProtocol).

Adapt the parameter Gc_uiMaxLengthProtocol.

Send the product data in several protocols.

Refer to GPL.

StartOfProductDataInvalid

Enumeration name:

StartOfProductDataInvalid

Enumeration value:

6

Description:

The start of a product data is invalid.

Issue

Cause

Solution

The start of a product data is invalid.

Product data does not start with object index O.

Verify that the product data start with O (for example, O1I1X10…).

First characters after the header must be P, A, or CarriageReturn.

Verify that the product data after the header starts with P, A, or CarriageReturn.

UnexpectedFeedback

Enumeration name:

UnexpectedFeedback

Enumeration value:

4

Description:

Internal error detected.

Issue

Cause

Solution

Feedback was invalid.

Receiving data was not successful, the server was shut down.

Restart the server.

UserDataLengthExceeded

Enumeration name:

UserDataLengthExceeded

Enumeration value:

32

Description:

User data length exceeded.

Issue

Cause

Solution

User data length is exceeded.

The length of the user data exceeds the maximum length of 80.

Adapt the length of the user data.

VisionDataHasNotBeenCleared

Enumeration name:

VisionDataHasNotBeenCleared

Enumeration value:

24

Description:

Vision data has not been cleared.

Issue

Cause

Solution

Vision data was not cleared.

Vision data was not been cleared before new data has been received.

Verify that method ClearVisionData was called before receiving new data.

WaitUntilDisabled

Enumeration name:

WaitUntilDisabled

Enumeration value:

10

Description:

Wait until disabled.

Status message: The function block is going to be disabled.

Working

Enumeration name:

Working

Enumeration value:

8

Description:

Working.

Status message: The data is being read.

Methods

Name

Description

ClearVisionData

Clear vision data and prepare the function block to receive new data.

Configuration

Configure the IP address and port the server monitors.

GetAdditionalString

Read out the additional string of the vision protocol.

GetHeader

Read out the header data of the vision protocol.

GetProducts

Read out the product data of the vision protocol.

GetVisionString

Read the vision string.

RegisterLoggerPoint

Register the function block FB_ReceiveVisionData to the Application Logger.

Properties

Name

Data type

Accessing

Description

xVisionDataReceived

BOOL

Get

Signal that new vision data has been received and can be read out.