FB_BACnet_MultiStateOutput_ADS
Application
The function block FB_BACnet_MultiStateOutput_ADS can be used for read and write access to a BACnet object of type MultiStateOutput.
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;
nPV : UDINT;
bManual : BOOL;
ePriority : E_BACNETPRIORITY:=BACNETPRIORITY_12;
bEnablePV: enables the value of input nPV. As soon as the input is set to TRUE, write access to the commandable property Present_Value takes place with the value from nPV 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 nPV is ignored, as long as bNullPV is set to TRUE.
nPV: 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).
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: a distinction is made between the following options for the input:
- FALSE: writing when the value changes
- Edge change FALSE → TRUE: writing the property Present_Value on edge change.
- TRUE: writing when the value changes and the associated BACnet server changes to "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;
nPresentValue : UDINT;
bOverridden : BOOL;
bOutOfService : BOOL;
bFault : BOOL;
bInAlarm : BOOL;
nNbrOfStates : UDINT;
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.
nPresentValue: Current value of the BACnet object (see also BACnet specification DIN EN ISO 16484-5 for BACnet object MultiStateOutput and property Present_value).
bOverridden, bOutOfService, bFault, bInAlarm: See BACnet specification DIN EN ISO 16484-5 for BACnet object MultiStateOutput 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.