FC_CommonPointsOfParallelogramAndLine

 

FC_CommonPointsOfParallelogramAndLine - General Information

Overview

Type:

Function

Available as of:

V1.0.3.0

Versions:

Current version

Task

Calculates the intersections of a straight line and a parallelogram in the 2-dimensional space.

Description

Calculates the intersections of the straight line i_stLine and the parallelogram i_stParal­lelogram. If a straight line coincides with one of the parallelogram's edges, the number of common points is 99. If the straight line does not intersect with the parallelogram at all, the number of common points is 0.

Interface

Input

Data type

Description

i_stParallelogram

ST_Parallelogram

Parallelogram

i_stLine

ST_Line2D

Straight

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_diNumberOfCommonPoints

DINT

Number of intersections of i_stParallelogram and i_stLine. Possible values: 0, 1, 2 and 99 (an infinite number of intersections, i_stLine coincides with one edge of i_stParallelogram).

q_astCommonPoints

 ARRAY[1..2] OF ST_Vector2D

Array which contains the intersections of i_stParallelogram and i_stLine (only the first iq_diNumberOfCommonPoints entries are valid).

Diagnostic Messages

q_etDiag

q_etDiagExt

Enumeration value

Description

OK

Ok

0

Ok

InputParameterInvalid

DefinitionLine

31

The definition of Line is not correct.

InputParameterInvalid

DefinitionParallelogram

37

The definition of Parallelogram is not correct.

UnexpectedProgramBehavior

UnexpectedFeedback

1

An unintended detected error occurred during execution.

DefinitionLine

Enumeration name:

DefinitionLine

Enumeration value:

31

Description:

The definition of Line is not correct.

Issue

Cause

Solution

-

At the inputs i_stLine.stPoint1 and i_stLine.stPoint2, the same point has been transferred.

The distance between the points stPoint1 and stPoint2 which define the straight line i_stLine must be at least Gc_lrZeroTolerance.

DefinitionParallelogram

Enumeration name:

DefinitionParallelogram

Enumeration value:

37

Description:

The definition of Parallelogram is not correct.

Issue

Cause

Solution

-

At the inputs i_stParallelogram.stSpanPoint1 and i_stParallelogram.stBasePoint, the same point has been transferred.

The distance between i_stParallelogram.stSpanPoint1 and i_stParallelogram.stBasePoint must be at least Gc_lrZeroTolerance.

-

At the inputs i_stParallelogram.stSpanPoint2 and i_stParallelogram.stBasePoint, the same point has been transferred.

The distance between i_stParallelogram.stSpanPoint2 and i_stParallelogram.stBasePoint must be at least Gc_lrZeroTolerance.

Ok

Enumeration name:

Ok

Enumeration value:

0

Description:

Ok

The intersections have been calculated successfully.

UnexpectedFeedback

Enumeration name:

UnexpectedFeedback

Enumeration value:

1

Description:

An unintended detected error occurred during execution.

Issue

Cause

Solution

-

An error occurred in the internal execution.

Please inform the support team about this error.