FB_HVACPWM

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;
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 variables of the function block (0%..100%).
bReset: Acknowledge input in the event of a fault.
VAR_OUTPUT
bOut : BOOL;
rYOut : REAL;
bInvalidParameter : BOOL;
bOut: PWM signal.
rYOut: Output of the input variable of the function block (0%..100%).
bInvalidParameter: Indicates that there is an incorrect input parameter. 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.

Figure: 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 variable during a running period is only taken into account in the next period. See also sections 2, 3 and 4.
Requirements
Development environment | required library | required function |
---|---|---|
TwinCAT 3.1 build 4022.16 or higher | Tc2_HVAC V3.3.1.0 | TF8000 | TC3 HVAC V1.0.0.0 |