> For the complete documentation index, see [llms.txt](https://docs.intrepidcs.com/vspy-3-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.intrepidcs.com/vspy-3-documentation/3.9.12/vehicle-spy-main-menus/main-menu-scripting-and-automation/c-code-interface/c-code-interface-functions-and-events/functions-and-events-network-indexes-and-statistics.md).

# Functions and Events: Network Indexes and Statistics

For each [Network](/vspy-3-documentation/3.9.12/vehicle-spy-main-menus/main-menu-spy-networks/networks.md) in Vehicle Spy there is an int variable. This variable is the number you use to reference a network. For example, the GenericMessage structure includes an iNetwork property. This indicates what network the message is from or will be transmitted to. All network indexes begin with the prefix NET\_.\
\
Each network has statistics that you can access. You can access the statistics for a network with the GetStats function. You can reset the statistics with the ClearStats function.

**Table 1: Statistics Available for a Network**

| Statistic Name | Data Type    | Description                                                                                                                                                       |
| -------------- | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| iCount         | unsigned int | Count of messages on network.                                                                                                                                     |
| iRate          | unsigned int | Messages per second.                                                                                                                                              |
| dPercentUse    | double       | Current bus utilization.                                                                                                                                          |
| iMaxRate       | unsigned int | Maximum messages per second.                                                                                                                                      |
| dMaxPercentUse | double       | Maximum bus utilization.                                                                                                                                          |
| iErrorCount    | unsigned int | Number of errors on a network.                                                                                                                                    |
| iTxCount       | unsigned int | Number of messages transmitted on a network.                                                                                                                      |
| iErrorRate     | unsigned int | Errors per second.                                                                                                                                                |
| iTxRate        | unsigned int | Transmissions per second.                                                                                                                                         |
| iTxBufferFill  | unsigned int | Current network transmit buffer fill level.  This level indicates how many bytes are in the transmit buffer.  You can use this value to prevent buffer overflows. |
| iCANTxErrCount | unsigned int | Number of Transmit CAN errors.                                                                                                                                    |
| iCANRxErrCount | unsigned int | Number of Receive CAN errors.                                                                                                                                     |

![Figure 1: The network index variables allow you to define what network you are transmitting to or receiving from.](https://2280262322-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3KyOmcYmM6ZVd3OQDa1%2Fuploads%2Fojsb3m6QYodbR65vffiL%2FNetIndexes.gif?alt=media\&token=7fd1d500-9135-4bb2-98c9-bc38189fbbda)

![Figure 2: The GetStats and ClearStats API allows you to access the statistics for a network.](https://2280262322-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3KyOmcYmM6ZVd3OQDa1%2Fuploads%2Fidc6Cwuve6UUNVq9ELfx%2Fnetwork_clearstats.gif?alt=media\&token=5e39df67-e2f4-43dc-92f7-2d002efaa7d6)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.intrepidcs.com/vspy-3-documentation/3.9.12/vehicle-spy-main-menus/main-menu-scripting-and-automation/c-code-interface/c-code-interface-functions-and-events/functions-and-events-network-indexes-and-statistics.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
