Data Sheet
18
Note
If letter R is in the register description it stands for the read-only variable. If letter W is in the register
description it stands for write variable. If letters RW are in the register description it stands for variable
possible to read and write into at the same time (i.e. its values can change not depending on the program
– e.g. CNT).
3.4 Function description
3.4.1 Digital input functions
Correct behavior of digital inputs depends on configuration of Debounce variable depending on
connected switch and on the environment in which the device is installed.
3.4.1.1 Debounce
Function Debounce serves for input bounce repression, its value is presented in hundreds of µs (i.e.
value 100 equals 10 ms). Impulse (positive edge) is processed as valid only in case it equals logical 1
for the whole configured duration.
3.4.1.2 Counter
This function serves as a pulse counter (counter of positive edges) on digital inputs. With each valid
pulse its value is incremented by one and written into the variable. While exceeding the maximum value,
the counter is set to zero. The value can be programmatically changed by writing into the variable
CNT_set.
3.4.1.3 Direct switch
This function allows mapping of event or state of digital input to digital output within the group (moreover
the number of DI and DO/RO within the group must be the same). Enabling of the function is done by
writing True value into DS_enable of the desired digital input. If DS_enable variable is equal to False,
settings of DS_toggle and DS_polarity is ignored.
Note
Each input which allows DS has corresponding DS_enable, DS_polarity and DS_toggle variables. Thus,
it is possible to configure different behavior for each input.
DS_polarity
With this function, it is possible to achieve two states of behavior. If DS_polarity is set True the output
switches to the state opposite to of the input. Otherwise if set False the output value equals the input
value. Exact description of the behavior demonstrates the following table.
DS_polarity
Input
Output
True
False
True
True
True
False
False
False
False
False
True
True
DS_toggle
If this value is set True, after positive edge is detected on input, the output value of corresponding
output is negated(toggled).
3.4.2 Digital output functions
3.4.2.1 PWM
Pulse width modulation (PWM) serves for analog signal transmission with binary signal. PWM can be
activated for each digital output separately, but frequency (prescale and duty cycle) settings is only one
for each group. After enabling of PWM function it is first necessary to set DO variable of chosen output
to 0 and then change the PWM variable value. PWM variable value states the period length of logical 1
in the number of cycles on the given output.