FB_PositionCompensation

[This is preliminary documentation and subject to change.]

FB_PositionCompensation 1:

The function block FB_PositionCompensation returns the compensation value for e.g. pitch- and cross-compensation. If the FB is enabled, the compensation value is calculated by the position of the reference axis and a look-up in the correction table (pTable). In case of pitch-compensation the reference axis and compensated axis are the same. If this FB is used for cross-compensation they are different.

The compensation value that is returned by this FB is written to the axis by using FB_WritePositionCompensation.

VAR_INPUT

VAR_INPUT
   Enable: BOOL;
   pTable: POINTER TO ST_CompensationElement;
   cbSize: UDINT;
ND_VAR

 

Enable: Continuous calculation of the compensation value is enabled with a rising edge on this input. It must be true as long as compensation data should be calculated.

pTable: Pointer to the compensation table. This table is an array of type ST_CompensationElement

cbSize: Size in bytes of the compensation table

VAR_IN_OUT

VAR_IN_OUT
   ReferenceAxis : NCTOPLC_AXLESTRUCT;
   Desc          : ST_CompensationDesc;
END_VAR

 

ReferenceAxis: Axis structure from NC. This axis can be different to that axis that should be compensated. E.g. in case of a cross-compensation this will not be the compensated axis.

Desc: Description structure for the compensation.

VAR_OUTPUT

VAR_OUTPUT
   Compensation : LREAL;
   Error        : BOOL;
   ErrorId      : UDINT;
   Active       : BOOL;
ND_VAR

 

Compensation: Calculated compensation value. Compensation will be 0.0 if Enable or Active is FALSE.

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

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

Active: Becomes TRUE, if compensation is active. If the working direction does not match to the current direction, it will be false.

 

Hint

For a sample refer 'Example Pitch Compensation'

 

Requirements

Development environment

Target system type

PLC libraries to be linked

from TwinCAT v2.10 Build 1314

PC (i386)

TcNc.Lib