FC_SaveAxisPosition

 

FC_SaveAxisPosition - General Information

Overview

Type:

Function

Available as of:

V1.0.3.0

Versions:

Current version

Task

Saving the axis position and the encoder position (EncoderPosition) in remanent variable in the NVRam

Description

FC_SaveAxisPosition() cyclically saves the axis position and the encoder position (EncoderPosition) in a remanent variable in the NVRam. By means of the function FC_RestoreAx­isPosition, the remanent variables are re-read and the axis position is calculated and set.

Saving the positions is only possible in SERCOS Phase 4.

FC_SaveAxisPosition() should only be called up in a homed system. Either according to FC_RestoreAxisPosition() or using another type of homing.

Interface

Input

Data type

Description

i_etPosType

ET_PosType

Position type

i_ifDrive

IF_Drive

Input for the axis that shall be controlled.

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_sMsg

STRING[80]

Event-triggered message which gives more detailed information on the diagnostic state.

Input/Output

Data type

Description

iq_stRestorePosition

ST_AxisRestorePosition

Remanent data

Diagnostic Messages

q_etDiag

q_etDiagExt

Enumeration value

Description

OK

Ok

0

Ok

InputParameterInvalid

DriveInvalid

3

The connected drive is invalid.

SercosConditionInvalid

SercosNotInPhaseFour

19

The Sercos bus is not in phase 4.

DriveInvalid

Enumeration name:

DriveInvalid

Enumeration value:

3

Description:

The connected drive is invalid.

Issue

Cause

Solution

-

At the input i_ifDrive, no drive was applied.

At the input i_ifDrive, a valid drive must be transferred.

-

The connected drive does not support all required functionalities.

Establish which functionalities are not supported by the drive by means of output q_sMsg.

Use a drive which supports all required functionalities.

Ok

Enumeration name:

Ok

Enumeration value:

0

Description:

Ok

The axis position has been saved successfully.

SercosNotInPhaseFour

Enumeration name:

SercosNotInPhaseFour

Enumeration value:

19

Description:

The Sercos bus is not in phase 4.

Issue

Cause

Solution

-

The parameter State of the SERCOS bus is not 4.

Set the SERCOS bus parameter PhaseSet to 4.

Verify the SERCOS bus for errors.