netGetStatisticsAcc (Functionblock) |
|
This returns the accumulated statistics for a network interface. These statistics are persistent across reboots and closing of interfaces. Depending on the kind of interface and the status, some variables may be empty. The variables will wrap around when reaching the max value(2147483647). This means that fast-growing values such as rx_bytes will turn negative when the max value is reached, which the application must handle. One way to handle it is to reset the statistics once a value has reached above a limit and store the previous values somewhere else.
Note that the statistics is updated periodically.
Input: iface : SINT The network interface to query. 1 = Cellular network, 2 = LAN network, etc. (See Network)
reset : BOOL (default FALSE) Set to true to reset the statistics to 0 after reading the current values.
Output: status : SINT; 0 = No valid statistics found for this interface. The other fields have not been updated. This can happen if the interface is not present. 1 = The statistics are valid.
rx_packets : DINT The number of good packets received by the interface.
tx_packets : DINT The number of successfully sent packets.
rx_bytes : DINT The number of good received bytes.
tx_bytes : DINT The number of good transmitted bytes.
rx_dropped : DINT The number of packets received but not processed.
tx_dropped : DINT The number of packets dropped on their way to transmission.
rx_compressed : DINT The number of received compressed frames(Cellular only)
tx_compressed : DINT The number of transmitted compressed frames(Cellular only)
rx_errors : DINT The total number of bad packets received on this network.
tx_errors : DINT The total number of transmit problems.
multicast : DINT The number of multicast packets received.
collisions : DINT The number of collisions during packet transmissions.
Declaration: Example: INCLUDE rtcu.inc |