FB_BACnet_MultiStateInput_RAW
Application
The function block FB_BACnet_MultiStateInput_RAW can be used for reading and write access to a BACnet object of type MultiStateInput.
In contrast to the standard and _EX versions of the block, the raw value, and the state of the property Reliablitity are provided by function block inputs, not directly by the IO hardware. For example, a multi-stage state can be mapped from a sub-bus system in PLC code to a BACnet object (signal conversion from sub-bus systems or virtual data points to BACnet, see Example).
VAR_INPUT
nRawIn : DWORD;
bNoSensor : BOOL;
bOverRange : BOOL;
bUnderRange : BOOL;
bOpenLoop : BOOL;
bShortedLoop : BOOL;
bCommFailure : BOOL;
bOtherFault : BOOL;
nRawIn: Raw value input of the object in the range 1 to Number_Of_States. The input is linked to the process record "PresentValue" of the BACnet object. The value of nRawIn is written directly to the property Present_Value (provided the object state is not out_of_service).
bNoSensor, bOverRange, bUnderRange, 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 (bNoSensor has highest priority, bOtherFault lowest). See BACnet specification DIN EN ISO 16484-5 for BACnet object MultiStateInput 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;
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 MultiStateInput and property Present_value).
bOverridden, bOutOfService, bFault, bInAlarm: See BACnet specification DIN EN ISO 16484-5 for BACnet object MultiStateInput 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 MultiStateInput 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.
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
Example
The following example shows the implementation of an integer value from EIB in the property Present_Value of an MultiStateInput object:
This example assumes the library "TcEIB.lib" is available. For further information on EIB please refer to the manual for the KL6301 terminal.