Data Sheet

19
Note
If DO is switched on, PWM value is ignored. On the contrary if PWM value is different than 0 and DO
is switched from 1 to 0, PWM function is activated.
Cycle length T
c
is set with PWM
prescale
and PWM
cycle
. Its value can be calculated using the following
formula:


 



Example
When PWM_prescale is set to 4799 and PWM_cycle is set to 100, T
c
equals 10ms (100Hz).
Furthermore, setting of PWM value to 50 duty cycle will equal 50% on frequency 100Hz.
3.4.3 Analog input / output functions
Setting of analog input/output type (current/voltage) is done with the AO_sw (or AI_sw) variable. Default
value of this variable is set to False. Meaning of the possible values demonstrates the following table.
Value
Type
False
Voltage
True
Current
3.4.4 Other setting and informative functions
3.4.4.1 ULED
Some models feature freely programmable LED diodes marked as X1 4. Diode control is done
through ULED variables for each diode separately.
3.4.4.2 Serial buses
If product (controller) features serial bus, there are available variables UART_TXQ and UART_config.
UART_TXQ contains the number of bytes waiting to be sent off through the serial bus. If the buffer
capacity overflows, overflowing data will be ignored.
Variable UART_config serves for serial bus parameters setting. Meaning of each bit of this variable
describes the following table.
Bits
Description
0 .. 12
Communication speed
13
Parity on / off
14
0 = even/1 = odd parity
15
Modbus RTU
Bit for Modbus RTU servers for setting of HW support for Modbus protocol to serial bus, where setting
bit to 1 it is generated interruption until the Modbus RTU frame receival is finished. In OS, Serial bus is
accessible through virtual serial port pty. By opening the pty it is also possible to set the communication
speed. Nevertheless parity is necessary to set through above described bits of UART_config variable.
Speed of communication in UART_config demonstrates the following table.
Value
Speed [bps]
11
2 400
12
4 800
13
9 600
14
19 200
15
38 400
4097
57 600
4098
115 200