### 6 Statistical Data

### 6.2 OPC UA ObjectTypes

## 6.2.1 IStatisticsType

## 6.2.1.1 Overview

The *IStatisticsType* is an *Interface* to manage statistical data of any kind, and provides general information about those statistical data.

The concrete statistical data are managed in *DataVariables* referenced from the *Object* or *ObjectType* implementing the *Interface* with a *HasStatisticComponent* *Reference*, either directly or indirectly. Those *Variables* are not predefined by the *Interface*, but added by the concrete *Objects* or *ObjectTypes* implementing the *Interface*. In Figure 9, an example is given. The MyStatisticsType is implementing *IStatisticsType* and provides the statistical Variables StatVar_A and its sub-variable StatVar_A1, as well as StatX and StatY, groups by the *Object* StatGroup. The *Property* *StartTime* applies to all of them, as well as the *Method* *ResetStatistics*.

**Figure 9** **Example of the usage of the IStatisticsType Interface**

*IStatisticsType* is formally defined in Table 35.

**Table 35** **– IStatisticsType Definition**

Attribute |
Value |
||||
---|---|---|---|---|---|

BrowseName | IStatisticsType | ||||

IsAbstract | True | ||||

Description | Base interface for managing statistical data. | ||||

References |
Node Class |
BrowseName |
DataType |
TypeDefinition |
Other |

Subtype of the BaseInterfaceType defined in OPC 10000-5 i.e. inheriting the InstanceDeclarations of that Node. | |||||

0:HasProperty | Variable | StartTime | 0:DateTime | 0:PropertyType | O |

0:HasComponent | Method | ResetStatistics | O |

*StartTime* provides the information, at what point in time all statistical data, provided by the *Object* implementing the *Interface*, have been started to be collected. The *StartTime* changes when the collection of the statistical data is reset.

Note that the *StartTime* does not indicate, if the statistical data is aggregated from the start time, or rolled over after some specific condition. This is defined by subtypes of the IStatisticsType. Therefore, it is recommended not to use the IStatisticsType directly, but only subtypes of it.

The *InstanceDeclarations* of the *IStatisticsType* have the *Attribute* values defined in Table 36.

**Table 36** **– IStatisticsType Attribute values for child Nodes**

Source Path |
Value |
Description |
---|---|---|

StartTime | - | Indicates the point in time at which the collection of the statistical data has been started. |

ResetStatistics | - | Restarts all statistical data, including a reset of the StartTime to the current time. |

## 6.2.1.2 ResetStatistics Method

The *ResetStatistics* *Method* resets all statistical data provided by the *Object* implementing the *Interface*. That includes, that the *StartTime* is reset to the current time.

The signature of this *Method* is specified below. The *Method* does not have *Input*- or *OutputArguments*.

**Signature**

```
ResetStatistics (
);
```

**Method Result Codes (defined in Call Service)**

Result Code |
Description |
---|---|

Bad_UserAccessDenied | See OPC 10000-4 for a general description. |

Its formal representation in the *AddressSpace* is defined in Table 37.

**Table 37** **– ResetStatistics Method Definition**

Attribute |
Value |
---|---|

BrowseName | ResetStatistics |

References |
NodeClass |
BrowseName |
DataType |
TypeDefinition |
ModellingRule |
---|---|---|---|---|---|