Input Description

MC_CamSwitchSimple_c provides the possibility to switch a cam on/off at projected positions. The position is given by a Function Block of type CS_calculateVelocity. This Function Block has to be executed every cycle and by the same task as the MC_CamSwitchSimple_c. MC_CamSwitchSimple_c could be used several times, there are no special hardware requirements.

The switch-on-position and the switch-off-position are individually changeable online. Further more a compensation time in both directions can be added to the switch position. Compensation is applied to both switch-on-position and switch-off-position.

../_images/a8693bb5e38a53050a33139000eba54e

The compensation time makes the switch a “dynamic” switch. The position where to switch on and off is calculated according to the actual velocity, in a way that the output occurs a certain time before (negative compensation) or after (positive compensation) the position has been reached. The time is given at the input compensation, the distance is calculated. The accuracy of time to be reached depends on the stability of velocity, which means just on a constant velocity, the time will be correct.

Distance = velocity * compensation;

The switch will be switched on at “FirstOnPosition + distance” and switched off at “FirstOffPosition + distance”. While switched on, no new calculation of distance will be done.

The actual state of the cam can also be monitored with the output “state”.

../_images/2361c2e7e38a52b70a33139000eba54e

Enable BOOL (enable)

The Function Block is activated with Enable TRUE. With Enable=FALSE, the respective cam will be switched off immediately.

FirstOnPosition WORD (first on position)

The value of FirstOnPosition is automatically truncated to the resolution of the circle without notice. For example, all FirstOnPosition greater than 36000 will be limited to 36000 (given if the default resolution).

FirstOnPosition can be changed at any time. It will be immediately valid after sending to the CI51x-ETHCAT via the POU.

FirstOffPosition WORD (first off position)

The value of FirstOffPosition is automatically truncated to the resolution of the circle without notice. For example, all FirstOffPosition greater than 36000 will be limited to 36000 (given if the default resolution).

FirstOffPosition can be changed at any time. It will be immediately valid after sending to the CI51x-ETHCAT via the POU.

Note

  • If FirstOnPosition is smaller than FirstOffPosition, the cam is switched on between the values of FirstOnPosition and FirstOffPosition of the same turn. 8dd56f39e38a57e50a33139000473a6a_6815a9d6e38a53630a33139000eba54e
  • If FirstOnPosition is greater than FirstOffPosition, the cam is switched on between the values of FirstOnPosition of the actual turn and FirstOffPosition of the next turn. 8dd56f39e38a57e50a33139000473a6a_04d2c890e38a53b10a33139000eba54e
  • If FirstOnPosition is equal to FirstOffPosition, the cam is switched on for one interrupt cycle.

Compensation

Data_Type Default_Value Range Unit
DINT - - µs

The switch action is rescheduled with Compensation:

  • If Compensation is positive, the switch action will be delayed by the value of Compensation.
  • If Compensation is negative, the switch action will be brought forward by the value of Compensation.

fbCalc CS_CalculateVelocity

The 2 elements in_csdc and out_csdc of csdc must be initialized with the beginning address of the input data area and the output data area to facilitate proper function of the cam.