FB_HVACPWM
Application
This function block generates a pulse width modulated signal from the analog input signal rYIn. Furthermore, a minimum switch-on time can be parameterized.
VAR_INPUT
eDataSecurityType: E_HVACDataSecurityType;
bSetDefault : BOOL;
bEnable : BOOL;
rYIn : REAL; 0 .. 100 %
bReset : BOOL;
eDataSecurityType:if eDataSecurityType:= eHVACDataSecurityType_Persistent, the persistent VAR_IN_OUT variables of the function block are stored in the flash of the computer if a value changes. For this to work, the function block FB_HVACPersistentDataHandling must be instanced once in the main program, which is called cyclically. Otherwise the instanced FB is not released internally.
A change of value can be initiated by the building management system, a local operating device or via a write access from TwinCAT. When the computer is restarted, the saved data are automatically read back from the flash into the RAM.
Application example: Example_PERSISTENT.zip
If eDataSecurityType:= eHVACDataSecurityType_Idle the persistently declared variables are not saved in a fail-safe manner.
Notice | |
A cyclically changing variable must never be linked with the IN_OUT variable of a function block, if eDataSecurityType:= eHVACDataSecurityType_Persistent. It would lead to early wear of the flash memory. |
bSetDefault: If the variable is TRUE, the default values of the VAR_IN_OUT variables are adopted.
bEnable: the function block is enabled if bEnable = TRUE.
rYIn: analog input value of the function block.
bReset: acknowledge input in the event of a fault.
VAR_OUTPUT
bOut : BOOL;
rYOut : REAL; 0 .. 100 %
bInvalidParameter: BOOL;
bOut: PWM signal.
rYOut: output of the input value of the function block.
bInvalidParameter: Indicates that an incorrect input parameter is present. bInvalidParameter must be acknowledged with bReset.
VAR_IN_OUT
tPWMPeriod : TIME;
tMINPowerOnTime : TIME;
tPWMPeriod: period of the PWM signal. The variable is saved persistently. Preset to 30 min.
tMINPowerOnTime: minimum switch-on time of the pulsed output bOut. The variable is saved persistently. Preset to 0 s.
Fig.1: Scope2 recording for additional explanation of the mode of operation of the function block. The output (bOut = TRUE) is set on enabling the function block (bEnable = TRUE). See also sections 1 and 5.
A change in the input value during a running period is only taken into account in the next period. See also sections 2, 3 and 4.