FB_BACnet_AnalogInput_RAW

FB_BACnet_AnalogInput_RAW 1:

Application

The function block FB_BACnet_AnalogInput_RAW can be used for read and write access to a BACnet object of type AnalogInput.

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 an analog 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

nRawIn               : INT;
bNoSensor            : BOOL;
bOverRange           : BOOL;
bUnderRange          : BOOL;
bOpenLoop            : BOOL;
bShortedLoop         : BOOL;
bCommFailure         : BOOL;
bOtherFault          : BOOL;

nRawIn: Raw value input of the object in the range -32768 to 32767. The input is linked to the process data "RawIoAnalogSignedValue" of the BACnet object. The value from nRawIn is offset with the property Resolution to calculate the value of 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 AnalogInput 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;

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 AnalogInput and property Present_Value).

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

bOverRange, bUnderRange, bNoSensor, bOpenLoop, bShortedLoop, bOtherFault: See BACnet specification DIN EN ISO 16484-5 for BACnet object AnalogInput and property Reliability.

eEventState: See BACnet specification DIN EN ISO 16484-5 for BACnet object AnalogInput and property Event_State.

bAckedTrans_ToOffNormal, bAckedTrans_ToFault, bAckedTrans_ToNormal: Flags of property Acked_Transitions (see BACnet specification DIN EN ISO 16484-5 for BACnet object AnalogInput 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 an integer value from EIB in the property Present_Value of an AnalogInput object:

FB_BACnet_AnalogInput_RAW 2:
Fig. 1: Example for the implementation of an integer 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.