FB_SegmentedCam - Prepare (Method)

Overview

Type:

Method

Available as of:

V1.0.0.0

Task

Generation of a segmented cam

Description

Based on the array i_astCamSegments, this method generates a segmented cam with i_diNumberOfSegments segments. Ensure that the values ST_Cam.lrXEnd and ST_Cam.lrYEnd of a segment correspond to the values ST_Cam.lrXStart and ST_Cam.lrYStart of the following segment.

Interface

Input

Data type

Description

i_diNumberOfSegments

DINT

Number of segments

i_astCamSegment

ARRAY[1..Gc_diMaxNumberOfCamSegments] OF

Structure for parameterization of the individual segments.

Output

Data type

Description

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

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 which gives more detailed information on the diagnostic state.

Diagnostic Messages

q_etDiag

q_etDiagExt

Enumeration value

Description

OK

Ok

0

Ok

InputParameterInvalid

JobTypeUnknown

67

JobType is indeterminable.

InputParameterInvalid

NumberOfSegmentsRange

66

NumberOfSegments is routside the valid range.

InputParameterInvalid

XendMustBeEqualXstart

68

Xend and Xstart must be equal.

InputParameterInvalid

XstartGreaterXend

65

XStart is greater than XEnd.

InputParameterInvalid

YendMustBeEqualYstart

69

Yend and Ystart must be equal.

JobTypeUnknown

Enumeration name:

JobTypeUnknown

Enumeration value:

67

Description:

JobType is indeterminable.

Issue

Cause

Solution

-

A segment of the segmented cam contains no valid cam entry.

The q_sMsg output shows which cam is faulty.

NumberOfSegmentsRange

Enumeration name:

NumberOfSegmentsRange

Enumeration value:

66

Description:

NumberOfSegments is routside the valid range.

Issue

Cause

Solution

-

The number of segments of the segmented cam is invalid.

The number of segments must be <= Gc_diMaxNumberOfCamSegments.

Ok

Enumeration name:

Ok

Enumeration value:

0

Description:

Ok

The generation of a segmented cam was successful.

XendMustBeEqualXstart

Enumeration name:

XendMustBeEqualXstart

Enumeration value:

68

Description:

Xend and Xstart must be equal.

Issue

Cause

Solution

-

In the case of two consecutive segments of a segmented cam lrXend <> lrXStart.

Set lrXend of the previous segment equal to lrXStart of the subsequent segment.

The q_sMsg output shows which segments are incorrect.

XstartGreaterXend

Enumeration name:

XstartGreaterXend

Enumeration value:

65

Description:

XStart is greater than XEnd.

Issue

Cause

Solution

-

The assigned value of the lrXStart variable of a segment is too high.

The value of the lrXStart variable must be less than the value of the lrXEnd variable of a segment.

YendMustBeEqualYstart

Enumeration name:

YendMustBeEqualYstart

Enumeration value:

69

Description:

Yend and Ystart must be equal.

Issue

Cause

Solution

-

In the case of two consecutive segments of a segmented cam lrYend <> lrYStart.

Set lrYend of the previous segment equal to lrYStart of the subsequent segment.

The q_sMsg output shows which segments are incorrect.