XFC_PositionCam

XFC_PositionCam 1:

XFC_PositionCam realizes a position cam that switches a digital output on or off, depending on the position.

In contrast to the digital cam controller MC_DigitalCamSwitch, the function block switches precisely one cam on a digital output track. This facilitates parameterization of the block, although it cannot be used if several cams are required on an output track.

In addition to the switching state of the digital output the output data structure contains precise time information for the next switching operations. This information is used for the actual output at an XFC output terminal with a downstream function block (XFC_EL2252 or XFC_EL2262).

Inputs

VAR_INPUT
    FirstOnPosition : LREAL;
    LastOnPosition  : LREAL;
    Modulo          : BOOL;
    ModuloFactor    : LREAL := 360;
    OnCompensation  : LREAL; 
    OffCompensation : LREAL;
    Options         : ST_CamSwitchOptions;
END_VAR

FirstOnPosition

First position from which the cam is switched on.

LastOnPosition

Last position up to which the cam is switched on. The cam function is inverted, if LastOnPosition < FirstOnPosition

Modulo

If Modulo TRUE, all positions are interpreted as modulo. The cam function is repeated cyclically. The parameter ModuloFactor is used for calculating the modulo cycle.

ModuloFactor

ModuloFactor indicates the length of a modulo cycle in the positioning unit of the axis and is only used if Modulo TRUE.

OnCompensation

Compensation time for the rising edge of the cam in [s]. For negative values of OnCompensation the switching time is brought forward, otherwise it is delayed.
The value OnCompensation parameterized here has priority over TRACK_REF

OffCompensation

Compensation time for the falling edge of the cam in [s]. For negative values of OnCompensation the switching time is brought forward, otherwise it is delayed.
The value OffCompensation parameterized here has priority over TRACK_REF.

Options

Optional parameters

Options.

EncoderIndex

If more than one encoder is connected to the axis, the encoder index [0 – 9] can be defined here. The first encoder has the index 0.

Options.

UseAcceleration

UseAcceleration can be set to TRUE in order to incorporate the acceleration of the axis into the position calculation. UseAcceleration can be advantageous if the setpoint values of the acceleration can be used. UseAcceleration may be disadvantageous with encoder axes that supply a noisy position signal, because the acceleration is also erroneous.

Inputs/outputs

VAR_IN_OUT
    Output : OUTPUT_REF
    Axis   : AXIS_REF; 
END_VAR

Output

The data structure Output contains the calculated state of the digital output and the associated time stamp for the output at a digital XFC output terminal

Axis

Axis data structure

The axis data structure of type AXIS_REF addresses an axis uniquely within the system. Among other parameters it contains the current axis status, including position, velocity or error status.

Method of function of the time compensation

XFC_PositionCam 2: