boardGetStatistics (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

All

Firmware version:

2.70 / 1.00.00


boardGetStatistics is used to query the system statistics available in the RTCU device.

The device statistics contains lifetime information initialized during the production of the device and cannot be reset.

It has the same effect as reading the statistics via Device: Information: Statistics.

 

 

Input:

index : INT (0..17)

This identifies which parameter are being requested.

Possible values are:

0

- Number of indexes present in statistics (currently 17).

1

- Number of times the device has rebooted.

2

- Highest temperature measured in the device - represented in 0.01 deg Celsius. 22.50 degrees will be returned as 2250, and -17.00 degrees will be returned as -1700.

3

- Average temperature measured in the device - represented in 0.01 deg Celsius.

4

- Lowest temperature measured in the device - represented in 0.01 deg Celsius.

5

- Number of minutes the device has been operating.

6

- Number of minutes the device has been operating from backup battery.

7

- Number of minutes the device has been charging the backup battery.

8

- Number of times the device has tried to connect to RTCU Communication Hub.

9

- Number of incoming transactions from the RTCU Communication Hub.

10

- Number of outgoing transactions to the RTCU Communication Hub.

11

- Number of keep-alive transactions the device has sent to the RTCU Communication Hub.

12

- Number of times the device successfully connected to a mobile network.

13

- Number of bytes sent through the mobile network connection.

14

- Number of bytes received from the mobile network connection.

15

- Number of times the GPS module has reported "No fix".

16

- Number of times the GPS module has reported "2D fix".

17

- Number of times the GPS module has reported "3D fix".

 

Returns: DINT

The requested parameter.

 

 

Declaration:

FUNCTION boardGetStatistics : DINT;
VAR_INPUT
  index : INT;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
VAR
  reboots : DINT;
END_VAR;
 
BEGIN
  ...
  // Ask how many times the device have rebooted
  reboots := boardGetStatistics(index := 1);
  ...
END;
 
END_PROGRAM;