> For the complete documentation index, see [llms.txt](https://stage-precision.gitbook.io/grid/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://stage-precision.gitbook.io/grid/touch-designer-integration/parameter-control/generic-dat.md).

# Generic DAT

Inspect named SPNet values as a table and configure data types, name filters, value retention, timeouts, and network reception.

The SPNet Generic DAT receives named values from Grid Studio and presents them as a table.

It supports numeric values, vectors, colors, strings, and point lists sent through Workflow Actions or Modifier nodes.

Each matching name occupies one row containing its latest received value.

The operator receives SPNet directly over the network and requires no wired input.

### Data page

| Parameter   | Default     | Description                                                                                 |
| ----------- | ----------- | ------------------------------------------------------------------------------------------- |
| Output Mode | `Live Data` | Selects received values or receiver diagnostics.                                            |
| Data Type   | `All`       | Filters values by their received type.                                                      |
| Name Filter | `*`         | Selects values by their original SPNet names.                                               |
| Timeout ms  | `0`         | Defines how long each value remains available without another update. Zero disables expiry. |

#### Output Mode

**Live Data**

Shows the latest matching values, with one row per name.

Updating a name replaces its previous value. Other names retain their values and continue to age independently.

The table includes a header row. If nothing matches the filters and timeout, only the header remains.

**Diagnostics**

Shows receiver and cache information as a two-column name/value table.

Data Type, Name Filter, and Timeout contribute to the diagnostic selection counts described below.

#### Data Type

| Option     | Included values                   | Text in the type column |
| ---------- | --------------------------------- | ----------------------- |
| All        | All supported types.              | Depends on each row.    |
| Integer    | Integer values.                   | `integer`               |
| Float      | Floating-point values.            | `real`                  |
| Vector3    | Three-component vectors.          | `vector3`               |
| Vector4    | Four-component vectors.           | `vector4`               |
| Color      | RGBA colors.                      | `color`                 |
| String     | Text values.                      | `string`                |
| Point List | Lists of point positions and IDs. | `point_list`            |

{% hint style="info" %}
The menu option Float corresponds to real in the table's type column.
{% endhint %}

#### Name Filter

Matches the original name sent by Grid Studio.

Matching is case-sensitive.

| Filter     | Matches                                                               |
| ---------- | --------------------------------------------------------------------- |
| `*`        | Every name.                                                           |
| Empty      | Every name.                                                           |
| `title`    | Exactly `title`.                                                      |
| `light*`   | Names beginning with `light`.                                         |
| `*speed`   | Names ending with `speed`.                                            |
| `control?` | `control` followed by one byte, such as `control1` for an ASCII name. |

Spaces are literal. A filter containing spaces matches a name containing those spaces.

The DAT preserves original names, including underscores and other characters.

#### Timeout ms

Timeout is measured separately for each name, starting when that value was last received.

| Value  | Behavior                                                         |
| ------ | ---------------------------------------------------------------- |
| `0`    | Keeps the latest value available until replaced.                 |
| `1000` | Hides the row after one second without an update to that name.   |
| `5000` | Hides the row after five seconds without an update to that name. |

The supported range is `0` to `60000` milliseconds.

Other values and unrelated SPNet packets do not refresh a value's age.

{% hint style="info" %}
Use Timeout = 0 for values sent only when a Workflow Action executes, such as a title or a selected setting.
{% endhint %}

Expiry hides the row while its value remains in the receiver cache. Changing Timeout back to zero can make an older cached value available again.

### Connection page

| Parameter         | Default        | Description                                                                                                             |
| ----------------- | -------------- | ----------------------------------------------------------------------------------------------------------------------- |
| Port              | `37373`        | UDP destination port used by the sender.                                                                                |
| Bind Address      | `0.0.0.0`      | Local address to listen on. The default listens on all local interfaces.                                                |
| Multicast Group   | `237.37.37.37` | Multicast group to join. Leave empty for a unicast-only connection.                                                     |
| Interface Address | `0.0.0.0`      | Local network adapter address used for multicast reception. The default uses the operating system's selected interface. |

For multicast, use the same group and port in Grid Studio and TouchDesigner.

For unicast, configure the sender to target the TouchDesigner computer's IPv4 address and clear Multicast Group.

Interface Address refers to the receiving computer's local adapter address.

SPNet operators with identical Connection settings share one receiver. Generic values are retained in its shared cache, while each operator applies its own filters and timeout.

### Live Data columns

| Column   | Description                                                     |
| -------- | --------------------------------------------------------------- |
| `name`   | Original SPNet value name.                                      |
| `type`   | Received value type.                                            |
| `value`  | Scalar value, String content, or Point List JSON.               |
| `x`      | First vector component or red color component.                  |
| `y`      | Second vector component or green color component.               |
| `z`      | Third vector component or blue color component.                 |
| `w`      | Fourth vector component or alpha color component.               |
| `age_ms` | Time since this named value was last received, in milliseconds. |

Rows are sorted by name. Use the name to identify a value when rows appear or disappear.

#### Scalars and Strings

Integer, Float, and String values use the `value` column.

For example:

| name       | type    | value   | x | y | z | w | age\_ms |
| ---------- | ------- | ------- | - | - | - | - | ------- |
| brightness | real    | 0.5     |   |   |   |   | 25      |
| enabled    | integer | 1       |   |   |   |   | 40      |
| title      | string  | Welcome |   |   |   |   | 100     |

A received empty String still has a row with an empty value cell.

#### Vectors

Vectors use the component columns.

| Type    | Populated columns  |
| ------- | ------------------ |
| Vector3 | `x`, `y`, `z`      |
| Vector4 | `x`, `y`, `z`, `w` |

Their `value` cells remain empty.

#### Colors

Colors also use `x`, `y`, `z`, and `w`.

| Column | Color component |
| ------ | --------------- |
| `x`    | Red             |
| `y`    | Green           |
| `z`    | Blue            |
| `w`    | Alpha           |

For example, an RGBA color of `0.25, 0.5, 0.75, 1` appears in those four columns in that order.

#### Point Lists

A Point List occupies one row. Its `value` cell contains a JSON array.

For example:

```json
[
  {"id": 7, "x": 1, "y": 0, "z": 2},
  {"id": 8, "x": -1, "y": 0, "z": 3}
]
```

Each entry contains a point ID and XYZ coordinates.

An empty list is represented as `[]`. Non-finite coordinates are represented as JSON `null`.

### Values and units

Generic values retain their received meaning and coordinate convention.

Vectors and Point List coordinates are passed through without the position conversion used by the tracking operators. Apply any required coordinate or unit conversion in your receiving network.

All table cells are written as text. Integer values preserve their integer representation. Floating-point values may show additional decimal digits representing the received floating-point number.

### Value retention

The receiver keeps the latest value for each exact name.

* Updating one name replaces its previous value.
* Other names retain their values and receive times.
* A new value can replace an older value of a different type with the same name.
* Changing filters leaves the cached values available to other selections.

Names are shared within the receiver connection. If multiple senders update the same name on that connection, the latest received value wins.

The cache is held in memory by the receiver.

### Reading a value

Use a name and column to access a specific cell.

For example, with a Generic DAT named `spnet_text`, this expression reads the title and returns an empty string when its row is unavailable:

```python
op('spnet_text')['title', 'value'].val if op('spnet_text')['title', 'value'] is not None else ''
```

The `.val` property returns the cell's text. Convert numeric text to the required numeric type when using it in calculations.

### Diagnostics

Diagnostics mode uses the columns `name` and `value`.

| Name             | Description                                                             |
| ---------------- | ----------------------------------------------------------------------- |
| `state`          | Shared receiver state.                                                  |
| `source`         | Address and source port of the last sender.                             |
| `cached_values`  | Number of named values retained by the receiver.                        |
| `active_values`  | Number of cached values passing this node's timeout setting.            |
| `matched_values` | Number of active values matching Data Type and Name Filter.             |
| `packets`        | Shared receiver packet counter.                                         |
| `packet_age_ms`  | Time since the shared receiver last received a packet, in milliseconds. |
| `decode_errors`  | Shared receiver decode-error counter.                                   |
| `last_error`     | Most recent receiver error message, when available.                     |

Counts refer to named values. A vector or Point List counts as one value.

{% hint style="info" %}
packet\_age\_ms describes the shared connection. Each Live Data row's age\_ms describes that particular value, which is the age used for timeout filtering.
{% endhint %}
