SR_<Camera Name> - General Information

Overview

Type:

Program

Available as of:

V1.0.0.0

Inherits from:

-

Implements:

-

This chapter provides information on:

oFunctional Description

oInterface

oDiagnostic Messages

oMethods

oProperties

Functional Description

SR_<Camera Name> provides a vision server to receive data from a camera.

If a camera is connected to this server (q_xClientConnected = TRUE), SR_<Camera Name> can receive data.

SR_<Camera Name>.xVisionDataReceived signals that data has been received. The data can be read with the methods GetHeader, GetProducts, and GetAdditionalString.

If data is already received, the method ClearVisionData must be called before new data can be received.

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_etDiag

GD.ET_Diag

General library-independent statement on the diagnostic. A value unequal to GD.ET_Diag.Ok corresponds to a diagnostic message.

q_etDiagExt

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_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

Plain text

Ok

Ok

0

Ok.

Working

8

Working.

WaitUntilDisabled

10

Disabling.

Disabled

11

Disabled.

ConfigurationFailed

ConfigurationInvalid

16

Configuration invalid.

UnexpectedProgramBehavior

UnexpectedFeedback

4

Internal error detected.

ExecutionAborted

ProtocolHeaderInvalid

5

The header of protocol is invalid.

StartOfProductDataInvalid

6

The start of the product data is invalid.

AnotherProtocolAlreadyExecuting

20

Another protocol is already executing.

VisionDataHasNotBeenCleared

24

Vision data has not been cleared.

EndSignalOfDataInvalid

21

End signal of data invalid.

AddressInUse

18

Address is in use.

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.

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 configuration values set in Basic Configurations are invalid.

Verify that valid values have been set in Basic Configurations.

Disabled

Enumeration name:

Disabled

Enumeration value:

11

Description:

Disabled.

Issue

Cause

Solution

The function block is deactivated, no actions are executed.

SR_<CameraName>.xEnable and SR_<CameraName>.xActive are set to FALSE.

Set SR_<CameraName>.xEnable to TRUE.

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:

Ok

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 letters 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 letters 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.

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.

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.

xTrigger

BOOL

Set

Calls the method Trigger and triggers the target generation, if active.