# Diagnostics and Commands

In addition to the diagnostic variables described in "Devices" [<mark style="color:blue;">section</mark>](/tags-and-devices/devices/diagnostics.md), the IEC 60870-5-104 device also has the following diagnostic variables:

* **RecvCounter**: received messages counter.
* **SentCounter**: sent messages counter.

Variables with the *Run* prefix allow you to manually start the execution of application commands of the IEC 60870-5-5 standard. To do this, you need to write any value to the corresponding variable. The following variables are defined in the device:

* **RunGeneralInterrogation:** initializes general interrogation of the station. The command is executed with the qualifier specified by the user, for example QOI = 20 (station interrogation).
* **RunCounterInterrogation:** initializes counter interrogation. The command is executed with the qualifier of QCC = 5 (general group of counters).
* **RunFreezeCounters:** initializes the counter freeze command. The command is executed with the qualifier of QCC = 69 (freeze for general group of counters).
* **RunFreezeResetCounters:** initializes the counter freeze and reset command. The command is executed with the qualifier of QCC = 133 (freeze and reset for general group of counters).
* **RunResetCounters:** initializes the counter reset command. The command is executed with the qualifier of QCC = 197 (reset for the general group of counters).
* **RunTestProcedure**: initializes the testing command (TEST-FR).
* **RunTimeSync**: initializes the time synchronization command.

For application commands to be initialized by the OPC UA client, the following conditions must be met:

* the user must have the *Run Command* rights from the *Devices* category. You can read more about this [<mark style="color:blue;">here</mark>](/basics/users-and-roles.md).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.monokot.io/tags-and-devices/iec-60870-5-104-connectivity/diagnostics-and-commands.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
