> 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/vehicle-spy-main-menus/main-menu-spy-networks/message-editor/message-signals/message-signal-type-state-encoded.md).

# Message Signal Type State Encoded

Setup a state encoded signal by setting the [Signal Type](https://cdn.intrepidcs.net/support/VehicleSpy/spyInValType.htm) pulldown to **State Encoded** in the Edit Signal dialog (Figure 1).

![Figure 1: Use the Edit Signal dialog to equate states with signal values.](https://3170208387-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL6lcovCpkhoS9uTOFtEp%2Fuploads%2Fgit-blob-e18707a6e4fecd14aa2c43cd59fd16a89eccd4b9%2Fspyindecodestates.gif?alt=media)

Specifying the Raw Value is the same as the analog signal setup. Please see the [analog signal](https://cdn.intrepidcs.net/support/VehicleSpy/spyInDecodeAnalog.htm) help topic for an explanation of how to do this.

Use the state table area to enter a State Description and the decimal Raw Value it represents. Click the **Add** button to add the state definition to the States list. Additional state definitions can be entered quickly by just typing new State Descriptions and tapping the keyboard Enter key. Vehicle Spy will automatically increment the Raw Value field by 1 to help speed things up. Edit the Raw Value field at any time if some values need to be skipped.

To delete a state definition from the list, click the state name then click the **Remove** button.

Any raw values without state definitions are considered to be unused states. Vehicle Spy normally shows unused states with the text **Invalid State**. To show unused states as numerical values, click the **Treat unused states as analog data** checkbox. This will activate the Scaling tab and the Format, Min, Max, and Units fields just like the setup for analog signals. These settings will be applied to any unused values and displayed accordingly.

***

![Figure 2: Use the Add Linear Formula to recalculate the range values.](https://3170208387-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL6lcovCpkhoS9uTOFtEp%2Fuploads%2Fgit-blob-53df1f6b8d8b25803a779dd3bbcd78a1497515d1%2Faddlinearformula.gif?alt=media)

By clicking the "Equation" button, you can open the Add Linear Formula menu. In this window, it is also possible to define a range and set the calculation to be performed using the equation applied to that range.

For example, you can map the signal value of 0 \~ 200 to 1.0 \~ 5.0 by setting (a) Start Raw Value 0, (b) End Raw Value, (c) m (scaling factor) 0.02, (d) b (scaling offset) 1.0. When the data is received, it is calculated as `"Raw Value" * m + b`.\
As in the example above, when applied with m = 0.02 and d = 1.0, signal data values of 0, 10, 50, and 100 are translated into 1, 1.2, 2, and 3, respectively.


---

# 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/vehicle-spy-main-menus/main-menu-spy-networks/message-editor/message-signals/message-signal-type-state-encoded.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.
