FB_BACnet_BinaryInput_RAW

FB_BACnet_BinaryInput_RAW 1:

Application

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

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, the state of a binary value 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

bRawIn               : BOOL;
bNoSensor            : BOOL;
bOpenLoop            : BOOL;
bShortedLoop         : BOOL;
bCommFailure         : BOOL;
bOtherFault          : BOOL;

bRawIn: Raw value input of the object. The input is linked to the process data "RawIoBinaryBoolValue" of the BACnet object. The value from bRawIn is offset with the property Polarity to calculate the value of the property Present_Value (provided the object state is not out_of_service).

bNoSensor, 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 BinaryInput and property Reliability.

VAR_OUPUT

bReady                   : BOOL;
bPresentValue            : BOOL;
bOverridden              : BOOL;
bOutOfService            : BOOL;
bFault                   : BOOL;
bInAlarm                 : BOOL;
bAckedTrans_ToOffNormal  : BOOL;
bAckedTrans_ToFault      : BOOL;
bAckedTrans_ToNormal     : BOOL;
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.

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

bOverridden, bOutOfService, bFault, bInAlarm: See BACnet specification DIN EN ISO 16484-5 for BACnet object BinaryInput 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 BinaryInput and property Acked_Transitions).

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 a bit value from EIB in the property Present_Value of a BinaryInput object:

FB_BACnet_BinaryInput_RAW 2:
Fig. 1: Example for the implementation of a bit value from EIB in the property Present_Value 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.