FB_WritePositionCorrection

[This is preliminary documentation and subject to change.]

FB_WritePositionCorrection 1:

The function block FB_WritePositionCorrection writes an offset (PositionCorrectionValue) to the nominal position of an axis. Depending on the correction mode the data is written immediately or 'filtered' to the cyclic axis interface.

VAR_INPUT

VAR_INPUT
   Enable                  : BOOL;
   PositionCorrectionValue : LREAL;
   CorrectionMode          : E_PositionCorrectionMode;
   Acceleration            : LREAL;
   CorrectionLenght        : LREAL;
END_VAR

 

Enable: Continuous writing of PositionCorrectionValue is enabled with a rising edge on this input. It must be true as long as new correction values should be accepted.

PositionCorrectionValue: Correction value that should be written to the cyclic axis interface

CorrectionMode: Depending on this mode the PositionCorrectionValue is written immediately or 'filtered' For a detailed description refer E_PosiitonCorrectionMode

Acceleration:  Depending on the CorrectionMode the maximum acceleration to achieve the new correction value is specified here. In case of PositionCorrectionMode_Fast this value has an direct influence to the position delta per PLC-Tick.
max. accepted delta of position correction value = acceleration * (PLC-Cycletime)^2

CorrectionLength: If the CorrectionMode is equal to PositionCorrectionMode_FullLength this parameter becomes active. A change in PosiitonCorrectionValue is split up on this correction length

VAR_IN_OUT

VAR_IN_OUT
   AxisRefIn  : NCTOPLC_AXLESTRUCT;
   AxisRefOut : NCTOPLC_AXLESTRUCT;
END_VAR

 

AxisRefIn : Axis structure from NC.

AxisRefOut : Axis structure from PLC.

 

VAR_OUTPUT

VAR_OUTPUT
   Busy     : LREAL;
   Error    :   BOOL;
   ErrorId  : UDINT;
   Limiting :  BOOL;
ND_VAR

 

Busy: Becomes TRUE as soon as the function block is active, and becomes FALSE when it has returned to its initial state.

Error : Becomes TRUE, as soon as an error occurs.

ErrorId : If the error output is set, this parameter supplies the error number.

Limiting: Becomes TRUE, if the requested PositionCorrectionValue is not yet full accepted.

 

Hint:

To use this function block successfully, Actual Position Correction in the System Manager must be enabled.

Requirements

Development environment

Target system type

PLC libraries to be linked

from TwinCAT v2.10 Build 1330

PC (i386)

TcNc.Lib (version >= 1.0.42)