> 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.11/vehicle-spy-main-menus/main-menu-scripting-and-automation/c-code-interface/c-code-interface-functions-and-events/functions-and-events-diagnostic-jobs.md).

# Functions and Events: Diagnostic Jobs

The C Code Interface provides functions for interacting with Vehicle Spy [Diagnostic Jobs](/vspy-3-documentation/3.9.11/vehicle-spy-main-menus/main-menu-spy-networks/diagnostics/diagnostics-setup.md). Diagnostic Jobs perform diagnostic operations on ISO14229, GMLAN or Keyword 2000. You can start, stop, save data, and see high level results directly from C.\
\
All diagnostic job related functions begin with the prefix "DG\_". The function then contains the diagnostic job name and finishes with the API name.  For example, if a diagnostic job was named "Test", the function to start it would be "DG\_Test\_Start()".  See the table and picture below for more details.

**Table 1: Diagnostic Job APIs Available**

| API                      | Description                                                                  |
| ------------------------ | ---------------------------------------------------------------------------- |
| IsRunning()              | Returns 1 if the diagnostic job is running.                                  |
| IsSuccessful()           | Returns 1 if the diagnostic job is triggered.                                |
| NumMessagesCollected()   | Returns the number of messages collected by the diagnostic job.              |
| Save()                   | Saves the diagnostic job data.                                               |
| Start()                  | Starts the diagnostic job.                                                   |
| Stop()                   | Stops the diagnostic job.                                                    |
| ECUResponseCount()       | Returns the number of responses from ECUs.                                   |
| TotalTimeAbs()           | The total time it took for the diagnostic job to complete.                   |
| Last7FSubFunctionEx78()  | The last 0x7F (negative response) that wasn't a response pending request.    |
| 7FCountEx78()            | This is the count of 0x7F negative responses excluding the pending requests. |
| 7FCountResponsePending() | This is the count of 0x7F 0x78 response pending requests.                    |

![Figure 1: Diagnostic Job APIs allow you to control your diagnostic Jobs from C.](https://2673726158-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdYdvinhoJh0IN6rV8uo3%2Fuploads%2FA2iV1mqola2VPFQZjFs0%2Fdg_apis.gif?alt=media\&token=a3c96ba8-ad46-42c2-b8f6-5eebfda23650)


---

# 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.11/vehicle-spy-main-menus/main-menu-scripting-and-automation/c-code-interface/c-code-interface-functions-and-events/functions-and-events-diagnostic-jobs.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.
