BOOL1,BOOL2 : BOOL;
TIME1 : TIME;
FB(IN:= REAL1, ENABLED:= BOOL1,T:=T#10S,MIN:=0,MAX:=100,OUT=>BOOL2,TRES=>TIME1);
The block generates PWM (pulse width modulation) signal with variable duty time according to the input signal.
|ENABLE||BOOL||Generator enable (true = running)||True|
|MIN||REAL||Value for duty time = 0 %||0|
|MAX||REAL||Value for duty time = 100 %||100|
|OUTN||BOOL||PWM output negated|
|TRES||TIME||Remaining time to the end of the period|
he block generates PWM (pulse width modulation) signal. The analogue input In is converted to binary pulsing signal with period of t. The input signal value is proportionally converted (for min <= In <= max). If In <= min then out = false, if In >= max then out=true permanently.
The output outn is a negated value of out. The block also provides remaining time to the end of the current period tres.
The input enable sets out=false and tres=0, if set to False.
If in is hidden or min > max or min <= 0 then out= false.
The block is used as a signal generator for thermic valve actuators or electric heating bodies controlled by solid state relays. It is preferred to use dedicated I/O modules (Domat M312, M313). Do not use mechanical relays to control the power circuits as the number of switching cycles may be too high for mechanical relays.