FB_BACnet_NSinkRemoveEvent

FB_BACnet_NSinkRemoveEvent 1:

Application

The function block can be used to delete any entry from the BACnet Notification Sink. The Example shows a possible configuration.

The input to be deleted is selected at input nIndex. The numbering matches the order in the buffer of the Notification Sink. In a ring buffer the numbering of incoming events starts at 0, in the event of a buffer overflow.

The block instance is created by the PLC program and called cyclically. The input/output stAdsConn must be linked to the output stBACnetAds of the corresponding NotificationSink function block (FB_BACnet_NotificationSink).

FB_BACnet_NSinkRemoveEvent 2:
Figure 1: Online view of the BACnet Notification Sink.

VAR_INPUT

bRemove    : BOOL;
nIndex     : UDINT;

 

bRemove: FALSETRUE = event entry is deleted.

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

 

VAR_OUPUT

bDone      : BOOL;
bNoEntry   : BOOL;
bBusy      : BOOL;
bError     : BOOL;
nErrorId   : UINT;

bDone: Read of the data completed successfully. bDone remains set until bRemove  is reset. If bRemove is reset before bDone is active, bDone is set for one cycle.

bNoEntry: No entry for deletion exists - event entry under nIndex is empty. bNoEntry remains set until a new delete operation starts. The output is used to detect the end of the event list.

bBusy: The block is busy.

bError: Error during processing.

nErrorId: Error code, see BACnet_Globals for an overview.

VAR_IN_OUT

stAdsConn      : ST_BACnet_AdsConnection;

 

stAdsConn: Linking to the output stBACnetAds of the corresponding NotificationSink function block.

Example: Function block call

FB_BACnet_NSinkRemoveEvent 3:
Figure 7: Application example. Deleting of an event entry of a BACnet Notification Sink with AMS port 1001.
FB_BACnet_NSinkRemoveEvent 4:

The AMS port depends on the TwinCAT System Manager configuration of the corresponding BACnet device (see FB_BACnet_NotificationSink).