FB_BACnet_RemoteAnalogOutput

The following function block is used for linking a remote BACnet object of the local BACnet client. The function block for the corresponding BACnet object is linked with the aid of process data. The data exchange with the remote BACnet server takes place via BACnet with the aid of WOC (Write-On-Change) and COV (Changes-On-Value) or via polling (not recommended).

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.

FB_BACnet_RemoteAnalogOutput 1:

Use

The function block "FB_BACnet_RemoteAnalogOutput" can be used for read and write access to a BACnet object of type AnalogOutput (AO) To this end the remote BACnet object was added to a local BACnet client.

FB_BACnet_RemoteAnalogOutput 2:
Fig. 1: Example for a remote BACnet object under a local BACnet client

VAR_INPUT

bEnablePV    : BOOL;
fPV          : REAL;

bEnablePV: Enables the value of input "fPV". When the input is set to TRUE, an entry is made in the Priority_Array of the corresponding BACnet object with the value of input "fPV". This corresponds to a write access to the commandable property Present_Value with the set priority (default: 12 when PLC automapping is used or 16 for manual linking in the System Manager).

fPV: Value to be written to the Priority_Array of the commandable property Present_Value. The priority is based on the process data configuration and mapping of the BACnet object in the System Manager (see also Figs. 2 and 3). Writing is enabled by setting the input "bEnablePV" to TRUE. Writing of the process data to the local client always takes place cyclically. After enabling via bEnablePV the data are sent via BACnet to the remote server either cyclically (Periodic Write) or when changes occur (Write On Change - recommended).

FB_BACnet_RemoteAnalogOutput 3:
Fig. 2: Example of a BACnet object with process data for writing the commandable property Present_Value.
FB_BACnet_RemoteAnalogOutput 4:
Fig. 3: Example for a process data configuration of an BACnet object in the System Manager. Priority 12 is created as a mappable process data (see result in Fig. 2).

VAR_OUTPUT

bReady       : BOOL;
fPresentValue: REAL;
bOverridden  : BOOL;
bOutOfService: BOOL;
bFault       : BOOL;
bInAlarm     : 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_RemoteDevice reports "not operational", the block instances was not linked correctly in the System Manager or the remote server cannot be reached (gateway cannot be reached, no Ethernet link).

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

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

bError: An error is pending.

nErrorId: Error number
0 = no error
1 = function block of the corresponding client (RemoteDevice) is not called or not called regularly enough from the PLC program.
2 = incorrect process data mapping detected (check mapping in the System Manager; if necessary compile complete PLC project and reload)
3 = the corresponding BACnet client is not ready (bOperational = FALSE at instance of the FB_BACnet_RemoteDevice)
The error numbers can be queried as block constants via the FB instance (FB_BACnet_Remote???.nERR_xxx).

VAR_IN_OUT

RemoteDevice     : FB_BACnet_RemoteDevice;

RemoteDevice: Block instance of the corresponding remote BACnet device object. The remote BACnet device object of a remote BACnet server has been added under a local BACnet client. Local client and remote server are linked via BACnet. Any number of clients can be linked via BACnet adapter. See FB_BACnet_Adapter and FB_BACnet_RemoteDevice for further information.