Retrieving diagnosis information
To retrieve BACnet diagnosis information the FB_BACnet_Adapter provides this method: GetDiagnosis.
GetDiagnosis provides access to the built-in diagnosis in the TwinCAT System Manager, which can be viewed under the "Diagnosis" tab of a BACnet device. In addition, each FB_BACnet_Client provides additional diagnosis information (m_stDiag) for each client and thus offers two further options for monitoring client connections:
Roundtrip measurement: It is possible to determine the time of a complete cyclic request.
Diagnosis of the different request types, this is displayed per client connection in the diagnosis.
Sample to retrieve diagnosis information:
VAR
fbDevice : FB_BACnet_Device;
stDiagnosis : ST_BACnet_Diagnosis;
bSuccess : BOOL;
bGetDiagnosis : BOOL;
END_VAR
------------------------------------------------------------------
fbDevice();
IF bGetDiagnosis THEN
bGetDiagnosis := FALSE;
bSuccess := BACnet_Globals.DefaultAdapter.GetDiagnosis( ADR( stDiagnosis ) );
END_IF