VAL_ComputeFrame

VAL_ComputeFrame 1:

FUNCTION_BLOCK VAL_ComputeFrame

This functions blocks computes the coordinates of a the user frame associated to a bank of cartesian point in the plc database.
A user frame is computed with 3 cartesian positions that shall be taught as shown below.
To achieve maximal accuracy, it is recommend to teach Ox vector along the longest side of the object for which a user frame will be defined.

VAL_ComputeFrame 2:
Frame definition with 3 points

Syntax

Definition:

FUNCTION_BLOCK VAL_ComputeFrame
VAR_INPUT
    Execute      : BOOL := FALSE;
    CoordSystem  : INT := -1;
    Origin       : T_CartesianPos;
    Xdirection   : T_CartesianPos;
    Ydirection   : T_CartesianPos;
END_VAR
VAR_OUTPUT
    Busy        : BOOL := FALSE;
    Done        : BOOL := FALSE;
    Error       : BOOL := FALSE;
    ErrorID     : UDINT := 0;
    UframeData  : T_Trsf;
END_VAR
VAR_IN_OUT
    AxesGroup  : T_StaeubliRobot;
END_VAR

VAL_ComputeFrame 3: Inputs

Name

Type

Description

Execute

BOOL

Rising edge triggers function execution

CoordSystem

INT

Number of the user frame to compute. The user frame is stored in the plc database located on robot side.

Origin

T_CartesianPos

Coordinates of the origin of the user frame

Xdirection

T_CartesianPos

Coordinates of the point defining Ox direction

Ydirection

T_CartesianPos

Coordinates of the point defining Oxy plane of the user frame.

VAL_ComputeFrame 4: Outputs

Name

Type

Description

Busy

BOOL

Set when function block is executing. Reset when Done or Error is set

Done

BOOL

This output is set when function block has terminated with success

Error

BOOL

This output is set when function block has terminated with error

ErrorID

UDINT

Error code

UframeData

T_Trsf

Coordinates of the computed user frame

VAL_ComputeFrame 5:/VAL_ComputeFrame 6: Inputs/Outputs

Name

Type

Description

AxesGroup

T_StaeubliRobot

Data block for a robot