FB_BACnet_NotificationSinkDelEntry

Function block for deleting entries from the "notification sink" via ADS.

FB_BACnet_NotificationSinkDelEntry 1:

Use

The function block instance is created by the PLC program and called cyclically. The input nPort is assigned with the ADS port from the System Manager configuration (see Figure 1). Ports may vary, depending on the configuration.

The function block can be used to delete entries from anywhere in the "Notification Sink". If all entries were removed or the specified index is greater than the number of list entries, then the function block returns bEmpty.

FB_BACnet_NotificationSinkDelEntry 2:
Figure 1: ADS port in the System Manager

The required NetId (AMS NetId) of the BACnet device can be read in the System Manager (see Figure 2).

FB_BACnet_NotificationSinkDelEntry 3:

The NetID does not match the local NetID and always has to be specified - empty strings cannot be used!). Another possibility is to query the NetID from the device function block or adapter function block in the PLC (see Figure 3).

FB_BACnet_NotificationSinkDelEntry 4:
Figure 2: AMS NetID of the BACnet device

For information on the operating principle of the adapter function block see FB_BACnet_Adapter.

FB_BACnet_NotificationSinkDelEntry 5:
Figure 3: AMS NetID of the BACnet device

VAR_INPUT

bExecute     : BOOL;
nIndex       : UDINT;
sNetId       : T_AmsNetId;
nPort        : T_AmsPort;
tTimeout     : TIME := tBACnet_ADSTimeOut;

bExecute: Rising edge at the input starts the read process.

nIndex: Index of the entry to be deleted (0 ... n-1).

sNetId: AMS NetID of the BACnet device (adapter) under which the server or client was configured.

nPort: ADS port under which the "notification sink" was created (see also under Use).

tTimeout: Optional input, monitoring time for ADS access (default: tBACnet_ADSTimeOut).

VAR_OUTPUT

bBusy        : BOOL;
bEmpty       : BOOL;
bError       : BOOL;
nErrorId     : UDINT;

bBusy: the function block is busy.

bEmpty: is set, if an attempt is made to delete a non-existing entry.

FB_BACnet_NotificationSinkDelEntry 6:

Once the last entry (index 0) has been deleted, the bEmpty message is only sent if another attempt is made to delete an entry (index 0) from the empty list.

bError: error during processing.

nErrorId: ADS error code.

Example

FB_BACnet_NotificationSinkDelEntry 7:
Fig. 4: Example for deleting the whole "notification sink" under port 1004.

If the bit "bClearList" is set, deleting of entry "0" is repeated until the block reports bEmpty. The bit "bClearList" is then reset automatically.