FB_BACnet_GetDiagInfo

Function block for access to BACnet diagnosis via ADS.

FB_BACnet_GetDiagInfo 1:

Use

The function block instance is created by the PLC program and called cyclically.

The required NetID (AMS NetID) of the BACnet device can be read in the System Manager (see Figure 1: 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 2).

FB_BACnet_GetDiagInfo 2:
Figure 1: AMS NetID of the BACnet device

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

FB_BACnet_GetDiagInfo 3:
Figure 2: AMS NetID of the BACnet device

VAR_INPUT

sNetId       : T_AmsNetId;
bExecute     : BOOL;
tTimeout     : TIME := tBACnet_ADSTimeOut;

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

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

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

VAR_OUTPUT

bBusy        : BOOL;
bError       : BOOL;
nErrID       : UDINT;
stInfo       : ST_BACnet_Diagnosis;

bBusy: The block is busy.

bError: Error during processing.

nErrID: ADS error code.

stInfo: Structure with diagnostic information on BACnet.

Example

FB_BACnet_GetDiagInfo 4:
Fig. 3: Example for cyclic reading of the diagnostic information