FB_BACnet_BinaryValue_ADS

FB_BACnet_BinaryValue_ADS 1:

Application

The function block FB_BACnet_BinaryValue_ADS can be used for read and write access to a BACnet object of type BinaryValue.

In contrast to the standard and _EX versions, writing of the property Present_Value is realized with ADS-WRITE (acyclic).

VAR_INPUT

bEnablePV      : BOOL;
bNullPV        : BOOL;
bPV            : BOOL;
bManual        : BOOL;
ePriority      : E_BACNETPRIORITY:=BACNETPRIORITY_12;

bEnablePV: enables the value of input bPV. As soon as the input is set to TRUE, write access to the commandable property Present_Value takes place with the value from bPV and the priority from ePriority (default: 12, if the input ePriority is not connected). If the input is set to FALSE, no further write access takes place (no change).

bNullPV: overwrites the entry of the commandable property Present_Values in priority ePriority with the value NULL, if bEnablePV is set to TRUE. The input bPV is ignored, as long as bNullPV is set to TRUE.

bPV: value to be written to the corresponding location of the property Priority_Array of the commandable property Present_Value if bEnablePV is set to TRUE and bNullPV is set to FALSE. The priority is determined with the input ePriority (default: 12, if the input ePriority is not connected). If the value changes, writing takes place acyclically (ADS WRITE).

FB_BACnet_BinaryValue_ADS 2:

Since writing of the property Present_Value takes place acyclically, and only when the value changes, it is potentially possible that the property Present_Value is also overwritten with the same priority by other BACnet devices. In this case (i.e. same priority) the last write access always "wins".

bManual: the following evaluations are distinguished for the input:
- FALSE: write on value change
- Edge change FALSETRUE: write the property Present_Value on edge change.
- TRUE: write on value change and when the associated BACnet server changes to the "Operational" state (see FB_BACnet_Device).

ePriority: specification of the priority for write access to the property Present_Value (default: 12, see also E_BACNETPRIORITY).

VAR_OUPUT

bReady         : BOOL;
bPvDone        : BOOL;
bPresentValue  : BOOL;
bOverridden    : BOOL;
bOutOfService  : BOOL;
bFault         : BOOL;
bInAlarm       : BOOL;
tObjectID      : T_BACnet_ObjectIdentifier:=16#FFFFFFFF;
bError         : BOOL;
nErrorId       : UINT;
nAdsErrorId    : UDINT;

bReady: Notification of general readiness. If this output is set, the other status outputs are valid (PresentValue, Overridden ...). If the output is FALSE, the corresponding function block FB_BACnet_Device does not report "Operational", or the block instance was not linked correctly in the TwinCAT System Manager.

bPvDone: Positive edge if writing of property Present_Value via ADS was successful.

bPresentValue: Current value of the BACnet object (see also BACnet specification DIN EN ISO 16484-5 for BACnet object BinaryValue and property Present_Value).

bOverridden, bOutOfService, bFault, bInAlarm: See BACnet specification DIN EN ISO 16484-5 for BACnet object BinaryValue and property Status_Flags.

tObjectID: Object ID of the BACnet object (object type and object instance).

bError: An error is pending.

nErrorId: see global constants BACnet_Globals.

nAdsErrorId: ADS error code.

VAR_IN_OUT

Device         : FB_BACnet_Device;

Device: Specification of the instance of the local corresponding BACnet server block. For each BACnet adapter one BACnet server is possible. See FB_BACnet_Adapter and FB_BACnet_Device for further information.