XFC_TimeCam
The function block 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 function 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_V2 or XFC_EL2262).
Inputs
VAR_INPUT
FirstOnPosition : LREAL;
Duration : LREAL;
Modulo : BOOL;
ModuloFactor : LREAL := 360;
OnCompensation : LREAL;
OffCompensation : LREAL;
Options : ST_CamSwitchOptions;
END_VAR
Name | Type | Description |
---|---|---|
FirstOnPosition | LREAL | First position from which the cam is switched on. |
Duration | LREAL | Switch-on duration of the cam in [s]. |
Modulo | BOOL | 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 | LREAL | ModuloFactor indicates the length of a modulo cycle in the positioning unit of the axis and is only used if Modulo TRUE. |
OnCompensation | LREAL | 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. |
OffCompensation | LREAL | 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. |
Options | Optional parameters |
/ Inputs/Outputs
VAR_IN_OUT
Output : OUTPUT_REF;
Axis : AXIS_REF;
END_VAR
Name | Type | Description |
---|---|---|
Output | The data structure Output contains the calculated state of the digital output and the associated timestamp for the output at a digital XFC output terminal | |
Axis | The axis data structure of type AXIS_REF addresses an axis unambiguously within the system. Among other parameters, it contains the current axis status, including position, velocity or error state. |
Outputs
VAR_OUTPUT
Error : BOOL;
ErrorID : UDINT;
END_VAR
Name | Type | Description |
---|---|---|
Error | BOOL | Becomes TRUE if an error occurs. |
ErrorID | UDINT | Returns a error number when the error output is set. |