Diagnosis
This section explains how BACnet configurations can be analyzed at runtime. Device status in the form of process data, and for BACnet clients the client status, are available for this purposes (see section Process data). Further details can be analyzed via the "Diagnosis" tab of the BACnet device. This section describes the diagnosis via the "Diagnosis" tab and other troubleshooting strategies.
The diagnosis of the BACnet device is subdivided into several categories. These are described in detail in the following sections. Various options can be activated via a context menu:
"Auto Update" updates the diagnosis display in 1-second intervals. The category "Last Update" always shows the time at which the diagnosis was last read. The option "Enable Time Measurement" enables the category "ExecutionTime", through which the runtimes of the BACnet stack can be determined. For some values the option "Show Changes/s" activates an additional display showing the changes per second. It is formed over the last 10 read diagnostics and only works if "Auto Update" is activated. The option "Reset Values" resets all diagnostic values.
Diagnostic data in the PLC The diagnostic data presented in this section can also be accessed from the PLC via an ADS interface. The function block FB_BACnet_GetDiagInfo offers convenient access. |
EthernetDevice category
The EthernetDevice category enables the number of sent and received messages (frames) and any receive and send errors to be determined. These data are read directly from the network driver, which means that they are not reset when a BACnet configuration is reloaded, although the option "Reset Values" deletes these values. This category counts all frames that are processed via the network driver, including non-BACnet frames.
The counter "sendFrames" indicates how many frames were used, "recvFrames" indicates the number of received frames. "txCnt" and "rxCnt" indicate the number of faulty received and sent frames. Unexpectedly high numbers may indicate network faults or overload (e.g. CRC errors, dropped frames).
ExecutionTime category
The option "Enable Time Measurement" enables runtime information for TwinCAT BACnet/IP to be determined. For each runtime a minimum (Min), maximum (Max) and current (Cur) value is determined. All runtimes are determined with a resolution of 100 ns. The following values are available as runtimes:
- IoInXXXExecutionTime: determines the runtime of the function InputUpdate of the BACnet device, which also executes the InputUpdate functions of all BACnet objects. This is where process data are copied from BACnet to the PLC/IO, among other tasks. In addition, the IoBusStatus is checked in the BACnet server and updated in the BACnet objects. For BACnet remote objects ReadProperty requests und CovSubscriptions for activated property process data are sent from this context.
- IoOutXXXExecutionTime: determines the runtime of the function OutputUpdate of the BACnet device, which also executes the OutputUpdate functions of all BACnet objects. In objects process data are copied from the PLC/IO and compared for changes. If a change has occurred, EventState machines can be executed and COV and event messages may be sent, depending on the BACnet property. For BACnet remote objects, write property requests are sent for activated property process data and detected in case of "WriteOnChange" modification of relevant properties (comparison).
- CycleXXXExecutionTime: determines the runtime of the function CycleUpdate of the BACnet device, which also executes the CycleUpdate functions of all BACnet objects. In the CycleUpdate context:
- device, client, server state machines are executed,
- received frames are processed,
- Object EventState machines may be executed (in the event of property modifications),
- COV and event messages are sent,
- ADS requests are processed,
- segmented frames are processed,
- and persistent data are written.
- InputXXXDistanceTime: indicates the interval between two calls of function InputUpdate of the BACnet device. In the event of "Exceeds" of the BACnet task this can be used to determine at which maximum interval the BACnet stack is executed.
In the top row of the category Execution Time the values IoIn, IoOut and cycle XXXExecution time are consolidated in the form of minimum, maximum and current values (in microseconds).
ConfirmedServices category
This category can be used to determine statistics for sent and received (acknowledged) BACnet messages. Acknowledged services operate in BACnet based on the client-server principle. A client sends a request, the server receives the request, processes it and sends a response (acknowledgement). The client receives the response and can process it further accordingly. Depending on the services a TwinCAT BACnet/IP device can act as a client or a server. The following figure shows the procedure for acknowledged services.
In the ConfirmedServices category, a list with the number of sent and received requests and sent and received responses is maintained for each supported service. The list shows how many requests/responses were processed successful and how many errors occurred. The 8 values for each BACnet service shown in the screenshot below are derived from these combinations. The top row of each service shows the total number of successful requests and responses and errors.
In the classification of BACnet services a distinction is made between so-called A-services and B-services, depending on which role (client or server) a device assumes for a service. If a device acts as a client, i.e. if it uses a request and receives a response (Ack), it uses an A-service. If a device receives a request, processes it and sends a response (Ack), it provides the B-service. If, for example, a client reads the value of a property of another device, the service ReadProperty-A is used. The remote terminal, the server, implements the ReadProperty-B service in this case. For diagnostics it is important to distinguish between A and B services. The following table is therefore subdivided into these service categories.
For acknowledged services an A-service is always associated with the counters ReqSend and AckRecv, a B-service always with ReqRecv and AckSend. The table indicates for the potential errors in which cases the error counter was incremented (e.g. ReqSendFail>0). In A-services an important error indicator may be a mismatch between the number of sent requests and received responses (Ack). Thus error type is referred to as (Req<>Ack).
Service diagnosis With BACnet it should be noted that increased error counters in the diagnosis not necessarily indicate a misconfiguration. In BACnet networks short load peaks and lost messages are not uncommon. Suitable repetition mechanisms have been implemented to deal with this (ApduRetries and ApduTimeout). However, if the error rate is excessive it is advisable to find the cause. |
The following table provides an overview of relevant BACnet services and their diagnosis. The section explains which function the services perform, where the services are used in TwinCAT BACnet/IP, which possible causes of errors can be diagnosed and possible solutions.
AcknowledgeAlarm-B (ReqRecv, AckSend) | Use: Acknowledging pending alarms Possible errors: Error handling: |
ConfirmedCOVNotification-A (ReqSend, AckRecv) | Use: Remote terminal has subscribed to change of value. Service sends message in the event of change. Possible errors: Error handling: |
ConfirmedCOVNotification-B (ReqRecv, AckSend) | Use: Receipt of a change of value Possible errors: Error handling: |
ConfirmedEventNotification-A (ReqSend, AckRecv) | Use: Message for change in event state (Instrinsic Reporting) Possible errors: Error handling: |
ConfirmedEventNotification-B (ReqRecv, AckSend) Not covered by certification | Use: Receipt of event messages in the notification sink Possible errors: Error handling: |
GetAlarmSummary-B | Use: Call up summary of all objects in alarm state Possible errors: |
GetEnrollmentSummary-B | Use: Call up a summary of event-specific information (with comprehensive filter options) Possible errors: |
SubscribeCOV-A (ReqSend, AckRecv) | Use: Service for subscribing to a change of value (COV) of properties "PresentValue" and "StatusFlags" for analog*, binary* and MultiState* objects. With remote objects for process data in COV mode. TrendLog for remote objects with LogInterval=0. COV subscriptions configured in NotificationSink. Possible errors: Error handling: |
SubscribeCOV-B (ReqRecv, AckSend) | Use: Receipt of a subscription to a change of value (COV) of properties "PresentValue" and "StatusFlags" for analog*, binary* and MultiState* objects. Possible errors: Error handling: |
AtomicReadFile-B (ReqRecv, AckSend) | Use: Reading a file Possible errors: Error handling: |
AtomicWriteFile-B (ReqRecv, AckSend) | Use: Writing a file Possible errors: Error handling: |
AddListElement-B (ReqRecv, AckSend) | Use: Adding a list element Possible errors: Error handling: |
RemoveListElement-B (ReqRecv, AckSend) | Use: Removing a list element Possible errors: |
ServiceCreateObject-B (ReqRecv, AckSend) | Use: Generating a dynamic object Possible errors: Error handling: |
ServiceDeleteObject-B (ReqRecv, AckSend) | Use: Unloading a dynamic object Possible errors: |
ReadProperty-A (ReqSend, AckRecv) | Use: Reading a property of a remote device Possible errors: Error handling: |
ReadProperty-B (ReqRecv, AckSend) | Use: Reading a local property Possible errors: |
ReadPropertyMultiple-B (ReqRecv, AckSend) | Use: Reading several local objects and properties with one access Possible errors: Error handling: |
WriteProperty-A (ReqSend, AckRecv) | Use: Writing a property of a remote device Possible errors: Error handling: |
WriteProperty-B (ReqRecv, AckSend) | Use: Writing a local property Possible errors: Error handling: |
WritePropertyMultiple-B (ReqRecv, AckSend) | Use: Writing several local objects and properties with one access Possible errors: Error handling: |
DeviceCommunicationControl-B (ReqRecv, AckSend) | Use: Communication control of a device (switching off message processing) Possible errors: Error handling: |
ReinitializeDevice-B (ReqRecv, AckSend) | Use: Initiates a device restart or changes the device status to backup or restore mode. Possible errors: Error handling: |
ReadRange-B (ReqRecv, AckSend) | Use: Reading of lists (in particular the property LogBuffer) Possible errors: |
SubscribeCOVP-A (ReqSend, AckRecv) | Use: Service for subscribing to a change of value (COV-P) with any objects and properties. With remote objects for process data in COV mode. For TrendLog for remote objects with LogInterval=0. COV subscriptions configured in NotificationSink. Possible errors: Error handling: |
SubscribeCOVP-B (ReqRecv, AckSend) | Use: Receiving of a subscription for a change of value (COV-P) with any objects and properties. Possible errors: Error handling: |
GetEventInformation-B (ReqRecv, AckSend) | Use: Call up summary of all objects in event state Possible errors: |
UnconfirmedServices category
Unlike confirmed services, unconfirmed services are unidirectional. A client will therefore send request, and a server receives it. The following table provides a detailed description of the unconfirmed services of the BACnet diagnosis.
IAm-A (ReqSend) | Use: Announcing the server in the network Possible errors: |
IAm-B (ReqRecv) | Use: Announcing a device from the network Possible errors: Error handling: |
IHave-A (ReqSend) | Use: Reports an object that was searched in the network Possible errors: |
UnconfirmedCOVNotification-A (ReqSend) | Use: Remote terminal has subscribed to change of value. Service sends unconfirmed message in the event of change. Possible errors: Error handling: |
UnconfirmedCOVNotification-B (ReqRecv) | Use: Unconfirmed receipt of a change of value Possible errors: |
UnconfirmedEventNotification-A (ReqSend) | Use: Unconfirmed message for change in event stage (Instrinsic Reporting) Possible errors: Error handling: |
UnconfirmedEventNotification-B (ReqRecv) | Use: Unconfirmed receipt of event notifications in the notification sink Possible errors: |
TimeSynchronisation-B (ReqRecv) | Use: Receipt of a timestamp for time synchronization Possible errors: Error handling: |
WhoHas-B (ReqRecv) | Use: Search for certain objects in a network Possible errors: |
WhoIs-A (ReqSend) | Use: Scanning of a network for devices and querying of the device communication parameters Possible errors: |
WhoIs-B (ReqRecv) | Use: Querying the server for device communication parameters Possible errors: |
UTCTimeSynchronisation-A (ReqSend) | Use: Sending a UTC timestamp for time synchronization Possible errors: |
UTCTimeSynchronisation-B (ReqRecv) | Use: Receipt of a UTC timestamp for time synchronization Possible errors: Error handling: |
FrameStatistic category
This category consolidates counters of sent and received BACnet messages. In addition the system can detect how often during operation the physical link of the network adapter was lost.
The individual counters are described in more detail below, and possible problem indicators are listed.
nSegmSendTimeouts | Purpose: Indicates how often timeouts occurred during waiting for confirmation of a segment. Problem indicator: |
nFrameAllocFailCnt | Purpose: Indicates how often no memory for sending of BACnet messages could be allocated. Problem indicator: |
nFrameSendCnt | Purpose: |
nFrameSendFailCnt | Purpose: Indicates how many BACnet messages could not be sent. Problem indicator: |
nFrameRecvCnt | Purpose: Indicates how many BACnet messages were received without error. |
nFrameRecvFailCnt | Purpose: Indicates how many BACnet messages were received with error. This counter indicates the total of the AckRecvFail and ReqRecvFail counters for all services. Problem indicator: |
nLinkStatusChangedCnt | Purpose: Indicates how often the LinkStatus of the network adapter has changed. Problem indicator: |
MemoryInfo category
The MemoryInfo category consolidates memory-specific information. In the top row of Windows CE devices the available main and flash memory is indicated. The individual counters are explained in the following table.
nAmsAlloc nAmsAllocCntMax | Purpose: These counters represent the allocation behavior of the BACnet stack for the router. nAmsAlloc indicates the current number of allocations. nAmsAllocCntMax indicates the maximum number of activated allocations at one time. nAmsAllocFailCnt indicates how often it was not possible to allocate memory. These counters do not provide information about the size of the allocated memory. Problem indicator: |
nCeAvailPhysMemBytes nCeAvailFlashMemBytes | Purpose: These counters are only implemented for Windows CE. They indicate how many RAM and flash memory is available. Problem indicator: |
nRecvFrameFifoSize nEmptyFrameFifoSize | Purpose: If network adapter queues are used, these counters indicate the available list memory for received (nRecvFrameFifoSize) and to be sent messages (nEmptyFrameFifoSize). Problem indicator: |
nRecvSegmUDPFramesListSize | Purpose: These counters provide information about the messages segments currently stored intermediately. A distinction is made between IP segmentation (UDP) and BACnet NPDU segmentation, and between segments that are earmarked for delivery (Send) and received segments (Recv). Problem indicator: |
nClientScanListSize | Purpose: Indicates the size of the list of found devices in the network. |
nAdsRequestListSize | Purpose: ADS requests to the BACnet stack are stored intermediately in a list and processed in the context of the BACnet task. This counter indicates the current number of pending ADS requests. |
ServerInfo category
A detailed description of the category ServerInfo can be found in section Persistent data.
ClientInfo category
In this category information on the current communication state for each configured BACnet client is displayed.
instanceNumber | Purpose: |
ipAddr udpPort networkNumber | Purpose: Contains information on communication addresses. BACnet only uses the device ID to identify devices. The IP address can be allocated dynamically. The current IP address can be determined via this diagnostic field. In addition, the UDP port and the network number (for communication via BACnet router, e.g. MS/TP devices) can be read here. |
isReachable clientState | Purpose: Problem indicator:
|
nOpenRequests nFreeOpenRequestData nRequestRetries nRequestTimeOuts | Purpose: Problem indicator: |
nCyclicCovRequests | Purpose: |
nCyclicReadPollingRequests nFailedReadRequests | Purpose: |
nCyclicWriteRequestsnFailedWriteRequests | Purpose: |