XFC_TimeCam 1:

XFC_TimeCam realizes a time cam that activates a digital output depending on the position and switches it off after a certain time.

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).


    FirstOnPosition : LREAL;
    Duration        : LREAL;
    Modulo          : BOOL;
    ModuloFactor    : LREAL := 360;
    OnCompensation  : LREAL; 
    OffCompensation : LREAL;
    Options         : ST_CamSwitchOptions; 


First position from which the cam is switched on.


Switch-on duration of the cam in [s].


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 indicates the length of a modulo cycle in the positioning unit of the axis and is only used if Modulo TRUE.


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


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


Optional parameters



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.



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.


    Output : OUTPUT_REF
    Axis   : AXIS_REF; 


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 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_TimeCam 2: