FC_GetCoordinates2D

 

FC_GetCoordinates2D - General Information

Overview

Type:

Function

Available as of:

V1.0.3.0

Versions:

Current version

Task

Calculates the coordinates of a point in a 2-dimensional coordinate system that is spanned by two linearly independent vectors:

i_stP = q_lrC1 * i_stV1 + q_lrC2 * i_stV2

Description

The coordinates of the point i_stP are converted to the coordinates of the coordinate system which is spanned by the vectors i_stV1 and i_stV2. The vectors i_stV1 and i_stV2 must be linearly independent, i.e. they must not be parallel.

Interface

Input

Data type

Description

i_stP

ST_Vector2D

Point whose coordinates are to be converted.

i_stV1

ST_Vector2D

Vector 1 which spans the new coordinate system

i_stV2

ST_Vector2D

Vector 2 which spans the new coordinate system

Output

Data type

Description

q_etDiag

GD.ET_Diag

General library-independent statement on the diagnostic.

A value not equal to ET_Diag.Ok corresponds to an diagnostic message.

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_lrC1

LREAL

Coordinate of the point i_stP on the axis i_stV1

q_lrC2

LREAL

Coordinate of the point i_stP on the axis i_stV2

Diagnostic Messages

q_etDiag

q_etDiagExt

Enumeration value

Description

OK

Ok

0

Ok

InputParameterInvalid

DefinitionCoordinateSystem

95

The definition of the coordinate system is invalid.

DefinitionCoordinateSystem

Enumeration name:

DefinitionCoordinateSystem

Enumeration value:

95

Description:

The definition of the coordinate system is invalid.

Issue

Cause

Solution

-

The vectors i_stV1 and i_stV2 are parallel, they do not span a 2-dimensional coordinate system.

The vectors i_stV1 and i_stV2 must be linearly independent, i.e. they must not be parallel.

Ok

Enumeration name:

Ok

Enumeration value:

0

Description:

Ok

The coordinates have been calculated successfully.