FB_BACnet_AnalogOutput_RAW

FB_BACnet_AnalogOutput_RAW 1:

Application

The function block FB_BACnet_AnalogOutput_RAW can be used for reading and write access to a BACnet object of type AnalogOutput.

In contrast to the standard or _EX version of the block, the flag of the property Status_Flags is overridden, and the value of the property Reliablitity is provided by function block inputs and mapped from the PLC program to the BACnet object. The PLC program maps the state of the property Present_Value to the hardware and the sub-bus system. Otherwise, this is dealt with directly by the IO hardware. In this way it is possible, for example, for a BACnet object to map the output value to a sub-bus system in PLC code (signal conversion to sub-bus systems or virtual points from BACnet, see Example).

VAR_INPUT

bEnablePV        : BOOL;
bNullPV          : BOOL;
fPV              : REAL;
bRawOverridden   : BOOL;
bNoOutput        : BOOL;
bOpenLoop        : BOOL;
bShortedLoop     : BOOL;
bCommFailure     : BOOL;
bOtherFault      : BOOL;

bEnablePV: TRUE = write enable of the property value; FALSE = do not change the entry in the BACnet object (bNullPV and fPV have no effect).

bNullPV: TRUE = delete the property entry (NULL); instead of the value of fPV; FALSE = write value of fPV as property value.

fPV: Value to be written to the property Present_Value, if bEnablePV = TRUE and bNullPV = FALSE. The process data are written when there is a change.

bRawOverridden: TRUE sets the flag overridden of the property Status_Flags. This indicates to BACnet that the value of the property Present_Value was decoupled from the hardware output (e.g. through manual local operation). See BACnet specification DIN EN ISO 16484-5 for BACnet object AnalogOutput and property Status_Flags.

bNoOutput, bOpenLoop, bShortedLoop, bCommFailure, bOtherFault: TRUE at the input sets the appropriate state of the property Reliability. The priority decreases with the order of the inputs (bNoOutput has highest priority, bOtherFault lowest). See BACnet specification DIN EN ISO 16484-5 for BACnet object AnalogOutput and property Reliability.

VAR_OUPUT

bReady                   : BOOL;
fPresentValue            : REAL;
bOverridden              : BOOL;
bOutOfService            : BOOL;
bFault                   : BOOL;
bInAlarm                 : BOOL;
bAckedTrans_ToOffNormal  : BOOL;
bAckedTrans_ToFault      : BOOL;
bAckedTrans_ToNormal     : BOOL;
bError                   : BOOL;
nErrorId                 : UINT;
nRawOut                  : INT;

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.

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

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

bAckedTrans_ToOffNormal, bAckedTrans_ToFault, bAckedTrans_ToNormal: Flags of property Acked_Transitions (see BACnet specification DIN EN ISO 16484-5 for BACnet object AnalogOutput and property Acked_Transitions).

bError: An error is pending.

nErrorId: see global constants BACnet_Globals.

nRawOut: Raw value output of the object in the range -32768 to 32767. The output is linked to the process data "RawIoAnalogSignedValue" of the BACnet object. The value of nRawOut results from the property Present_Value, taking account of the property Resolution.

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.

Example

The following example illustrates the implementation of the property Present_Value of an AnalogOutput object in EIB:

FB_BACnet_AnalogOutput_RAW 2:
Fig. 1: Example for the implementation of property Present_Value in EIB in the PLC program.

This example assumes the library "TcEIB.lib" is available. For further information on EIB please refer to the manual for the KL6301 terminal.

The implementation of local operation by means of a selector switch (digital input) and a control potentiometer (analog input) is also illustrated.