Variable Declaration
The default values of the BACnet properties should be specified in the variable declaration and should only be written conditionally at runtime (so that write access by BACnet is still possible). In the following example, the Description property is modified at runtime.
To use the BACnet EngineeringUnit (unit of measurement) the library Tc3_BA2_Common must be included.
Variables
fbAv : FB_BACnet_AV := (
sObjectName := 'X51LU01xAMH_-SW31',
sDescription := 'SetpointVariable Ventilator',
eUnit := E_BA_Unit.ePressure_Pascals,
fRelinquishDefault := 250
);
bDescriptionChanged : BOOL;
Code
if bDescriptionChanged then
fbAV.sDescription := 'TEST';
bDescriptionChanged := FALSE;
END_IF
fbAv();