Input Description

../_images/f3bbaaa5e389d4930a33139000eba54e1

Note

The inputs marked with a triangle 5bed03fee389cc980a33139000473a6a_78f228175b765b440a33139001315693 are of the class VAR_IN_OUT (input and output variable). These inputs must be connected to a variable.

SLOT

Data_Type Default_Value Range Unit
BYTE - - -

This input is used to select the slot (module number) of the DC541.

The slots are numbered consecutively from right to left. Slot 1 is the first slot on the left of the CPU.

CH (channel)

Data_Type Default_Value Range Unit
BYTE - 0 for input C0 only -

This input is used to select the input for the counter. The device occupies the inputs C0…C3. If an invalid value is entered at input CH or if the selected channel is not configured as a 32 bit counter (32BIT_CNT), the function block is aborted.

EN_VISU (enable \ input in visualization)

Data_Type Default_Value Range Unit
BOOL - - -

If this input is TRUE, it is possible to control the function block inputs (except SLOT, CH and EN_VISU) via the integrated visualization of the function block. If input EN_VISU = FALSE, control via the visualization is disabled and the labelling of the corresponding control elements is displayed in gray. The actual values are always displayed.

EN (enable)

Data_Type Default_Value Range Unit
BOOL - - -

In order to enable pulse counting for input CH, input EN has to be continuously TRUE. The Function Block is not processed if input EN = FALSE.

When the function block is called for the first time, the inputs are checked for validity and plausibility and the corresponding device is checked for correct configuration in the operating mode “counting mode”. If this is not the case, processing is aborted.

SET

Data_Type Default_Value Range Unit
BOOL - - -

At a rising edge at this input, the counter is set to the value of input CNT_SET. Counting is enabled after reset process though SET = TRUE.

EN_REF (enable \ reference)

Data_Type Default_Value Range Unit
BOOL - - -

A rising edge at this input enables the reference point approach. If EN_REF = TRUE, a rising edge at input C2 or C3 causes the actual value of the counter CNT_ACT to be set to the value of input CNT_SET.

The next measurement is again initiated by a rising edge at input EN_REF.

Only one function may be enabled at a time, either the reference point approach or the touch trigger measurement. If both functions are enabled simultaneously or if the execution of one function is not yet completed when enabling the other function, the function block is aborted.

EN_TOUCH (enable \ touch trigger)

Data_Type Default_Value Range Unit
BOOL - - -

A rising edge at this input enables a touch trigger measurement. If input EN_TOUCH = TRUE, a rising edge at input C2 or C3 causes the function block to store the actual counter value and to display this value at output CNT_TOUCH.

The next measurement is again initiated by a rising edge at input EN_TOUCH.

Only one function may be enabled at a time, either the reference point approach or the touch trigger measurement. If both functions are enabled simultaneously or if the execution of one function is not yet completed when enabling the other function, the function block is aborted.

EN_UD (enable \ up/down)

Data_Type Default_Value Range Unit
BOOL - - -

This input EN_UD is used to select the counting mode of the 32 bit counter.

EN_UD = FALSE: Connection of an incremental transmitter. Track A/B offset by 90°.

EN_UD = TRUE: Up/down counter. C1: count up, C0: count down.

EN_LIM (enable \ limit)

Data_Type Default_Value Range Unit
BOOL - - -

Input EN_LIM is used to set the operating mode for the counter:

EN_LIM = FALSE: Infinite counter (endless mode).

EN_LIM = TRUE: Limiting counter (limit mode).

Switching between the operating modes can be done during running operation. And it is possible to change the upper limit value LIM_MAX and the lower limit value LIM_MIN during running operation. LIM_MAX has to be higher than LIM_MIN. If LIM_MIN is higher than LIM_MAX, an error is displayed.

In case of a rising edge at input EN_LIM (transition from endless mode to limit mode), the present counter value can change depending on the values of LIM_MIN and LIM_MAX.

Present counter value Changed counter value
ACT_CNT < LIM_MIN ACT_CNT := LIM_MIN
LIM_MIN <= ACT_CNT <= LIM_MAX ACT_CNT := ACT_CNT (no change)
ACT_CNT > LIM_MAX ACT_CNT := LIM_MIN

LIM_MAX (limit \ maximum)

Data_Type Default_Value Range Unit
DWORD - - -

LIM_MAX is used to set the upper limit value for the counter. LIM_MAX has to be higher than the lower limit value LIM_MIN. If LIM_MIN is higher than LIM_MAX, an error is displayed.

LIM_MIN (limit \ minimum)

Data_Type Default_Value Range Unit
DWORD - - -

LIM_MIN is used to set the lower limit value for the counter. The upper limit value LIM_MAX has to be higher than LIM_MIN. If LIM_MIN is higher than LIM_MAX, an error is displayed.

CNT_SET (counter set)

Data_Type Default_Value Range Unit
DWORD - - -

CNT_SET is used to adjust the counter set value.

If input SET = TRUE, the counter is set to the value of input CNT_SET and remains at this value as long as input SET = TRUE. Counting is enabled again with the occurrence of the falling edge at input SET.

In case of a reference point approch (EN_REF = TRUE), the rising edge on channel C2 causes the actual value of the counter (ACT_CNT) to be adjusted to the set value CNT_SET.

A FALSE -> TRUE edge at input EN activates the status polling. If the value at input SLOT is not valid, processing is aborted and an error is displayed. The function block outputs are updated as long as input EN = TRUE. The function block processing has been completed successfully, if output DONE changes to TRUE. During the processing of a request, state changes at input EN are recognized but not evaluated.