FB_BACnet_AnalogInput_RAW

The following function block is used for linking a BACnet object of the local BACnet server. The function block for the corresponding BACnet object is linked with the aid of process data.

The process data can be created manually in the BACnet object, linked manually, or they can be generated automatically via PLC automapping. The comments required for PLC automapping ( (* ~ (BACnet... | ??? | ??? ) *) ) are already included in the declaration of the function block.

Contrary to the standard variant of the function block, the raw value is provided by a function block input and not by the terminal hardware. This allows e.g. Analog input information that are generated in the PLC code displayed as an analog input object to BACnet (signal mapping for sub bus systems or virtual data points, etc.).

FB_BACnet_AnalogInput_RAW 1:

Use

The function block "FB_BACnet_AnalogInput_RAW" can be used for read access to a BACnet object of type AnalogInput (AI). To this end the BACnet object was created under a local BACnet server.

FB_BACnet_AnalogInput_RAW 2:
BACnetObject_SysMan


Fig. 1: Example of a BACnet object under a local BACnet server.

VAR_INPUT

nRawIn       : INT; (* ~(BACnet_RawIoAnalogSignedValue : : ) *)

nRawIn: Raw value input of the object in the range -32768 ... 32767. The input is linked to the process data "RawIoAnalogSignedValue" of the BACnet object. The value of "nRawIn" results to property Present_Value according to property Resolution (assuming the object state is not out_of_service).

VAR_OUTPUT

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

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

bError: An error is pending.

nErrorId: Error number
0 = no error
2 = incorrect process data mapping detected (check mapping in the System Manager; if necessary compile complete PLC project and reload)
3 = the corresponding BACnet server is not ready (bOperational = FALSE at instance of the FB_BACnet_Device)
The error numbers can be queried as block constants via the FB instance (FB_BACnet_???.nERR_xxx).

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 shows the mapping of an EIB integer value into the Property Present_Value of an analog input object:

FB_BACnet_AnalogInput_RAW 3:
Fig. 2: Example for the mapping from EIB to the Property Present_Value in PLC code.

This example requires the library "TcKL6301.lib". Refer to the manual of terminal KL6301 for more information about EIB.