FB_BACnet_MultiStateOutput_RAW

FB_BACnet_MultiStateOutput_RAW 1:

Application

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

In contrast to the standard or _EX version of the block, the flag of the property Status_Flags is overridden, the property Feedback_Value 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;
nPV                  : UDINT;
nFeedback            : DWORD;
bNoOutput            : BOOL;
bOpenLoop            : BOOL;
bShortedLoop         : BOOL;
bCommFailure         : BOOL;
bOtherFault          : BOOL;

bEnable: TRUE = The process data is enabled; the value resulting from bNull or nState is written to the corresponding BACnet object, FALSE = process data is disabled

bNull: TRUE = zero writing of the BACnet object (e.g., for deleting a priority), FALSE = write value from nState

nPV: Value that is written to the BACnet object, if bEnable = TRUE and bNull = FALSE. Multi-State in the range [1 .. Number_Of_States].

nFeedback: Signal feedback to the BACnet object. See BACnet specification DIN EN ISO 16484-5 for BACnet object MultiStateOutput and property Feedback_Value.

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 MultiStateOutput and property Reliability.

VAR_OUPUT

bReady                   : BOOL;
nPresentValue            : UDINT;
bOverridden              : BOOL;
bOutOfService            : BOOL;
bFault                   : BOOL;
bInAlarm                 : BOOL;
bAckedTrans_ToOffNormal  : BOOL;
bAckedTrans_ToFault      : BOOL;
bAckedTrans_ToNormal     : BOOL;
nNbrOfStates             : UDINT;
bError                   : BOOL;
nErrorId                 : UINT;
nRawOut                  : DWORD;

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.

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.

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

nNbrOfStates: Reports the available number of values, which the Present_Value of the MultiStateInput object can assume (1...nNbrOfStates). If nNbrOfStates is 0, then there is no valid "state" which the object can assume (Present_Value is 0).

bError: An error is pending.

nErrorId: see global constants BACnet_Globals.

nRawOut: Raw value output of the object. The output is linked to the process data "PresentValue" of the BACnet object.

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 MultiStateOutput object in EIB:

FB_BACnet_MultiStateOutput_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.