Skip to main content

Digital Switch Points

CODESYS SoftMotion provides various options for creating digital switch points. This section provides an overview of the respective advantages and disadvantages.

Application example

Digital switch points are required, for example, to switch on a glue gun depending on the axis position. In the following example, the glue gun should apply adhesive to a product from position 90 to position 120.

_sm_img_digital_switches_1.png

A glue gun has a delay between switching on and applying glue. The same applies to switching off. An on/off compensation is therefore required so that the glue gun is switched on 50 ms before position 90 and switched off 50 ms before position 120.

_sm_img_digital_switches_2.png

Overview of function blocks

Function Block

Multiple switch points

On/Off Compensation

Forecast

High Precision (time resolution higher than cycle time)

Data Basis

Note

SMC_DigitalCamSwitch_HighPrecision

icon_lic_ok.png

icon_lic_ok.png 1

icon_lic_ok.png 2

icon_lic_ok.png

Set position or actual position

Useful when higher time precision is required. In addition to this function block, a high-precision digital output card is required for high-precision operation. This combination makes it possible to switch outputs with high time precision even at higher cycle times.

For more information about using the function block, see the following: example Using MC_DigitalCamSwitch_HighPrecision.

SMC_GetTravelTime

icon_lic_missing.png

icon_lic_missing.png

icon_lic_ok.png 2

icon_lic_ok.png

Set position or actual position

Useful if a separate version of the DigitalCamSwitch function block should to be implemented (for example, because additional functions are required).

MC_DigitalCamSwitch

icon_lic_ok.png

icon_lic_ok.png 3

icon_lic_missing.png

icon_lic_missing.png

Set position or actual position

Useful if a cycle-precise time resolution is sufficient.

SMC_GetTappetValue

icon_lic_ok.png

icon_lic_missing.png

icon_lic_missing.png

icon_lic_missing.png

Set position or actual position

These function blocks are retained for reasons of compatibility only. For current and future projects, the other more advanced function blocks should be used.

SMC_CamRegister

icon_lic_ok.png

icon_lic_missing.png

icon_lic_missing.png

icon_lic_missing.png

Set position or actual position

1 Exact. The data from the forecast is used.

2 The forecast must be set by means of the SMC_SetForecast function block. For more information about the forecast, see the following: Forecast.

3 Only by extrapolation