# Signal Test Generator

{% hint style="info" %}
This feature was added in realvirtual **6.3**.
{% endhint %}

## Overview

The Signal Test Generator automatically generates cyclic test values for all PLCInput signals on its parent interface. It discovers Bool, Float, and Int input signals and applies test patterns: **sine waves** for floats, **on/off toggling** for bools, and **incrementing counters** for ints.

Attach it to any interface GameObject to simulate signal activity without a real PLC connection. This is useful for testing interface communication, verifying signal routing, and demonstrating data exchange in demo scenes.

## Setup

1. Select the interface GameObject that contains your PLC signals as children
2. Add the **Signal Test Generator** component (`Tools > realvirtual > Interfaces > Signal Test Generator`)
3. Press Play — all PLCInput signals will start generating test values automatically

The component discovers signals at startup. If you add or remove signals at runtime, click **Refresh Signals** to re-scan.

## Properties

### Test Settings

| Property            | Description                                         |
| ------------------- | --------------------------------------------------- |
| **Enable Testing**  | Enable or disable test signal generation            |
| **Update Interval** | Time in seconds between signal value updates        |
| **Sine Amplitude**  | Amplitude of the sine wave for float signals        |
| **Sine Offset**     | Center offset of the sine wave for float signals    |
| **Sine Frequency**  | Frequency of the sine wave in Hz                    |
| **Toggle Interval** | Time in seconds between bool signal toggles         |
| **Int Increment**   | Increment value per update cycle for int signals    |
| **Int Max**         | Maximum value before the int counter resets to zero |

### Status

| Property        | Description                                          |
| --------------- | ---------------------------------------------------- |
| **Cycle Count** | Number of update cycles completed since play started |

## Test Patterns

### Float Signals (Sine Wave)

Each PLCInputFloat signal follows a sine wave: `Offset + Amplitude * sin(2pi * Frequency * time + phase)`. Multiple float signals get different phase offsets so they don't move in sync.

### Bool Signals (Toggle)

PLCInputBool signals toggle between `true` and `false` at the configured toggle interval. Even-indexed and odd-indexed signals toggle on opposite phases for visual variety.

### Int Signals (Counter)

PLCInputInt signals increment by the configured step each update cycle and wrap around at the maximum value. Multiple int signals get different offsets.

## Common Use Cases

* **Interface demo scenes** — Show live signal exchange without requiring a PLC
* **WebSocket testing** — Verify server/client signal transmission with changing values
* **UI development** — Generate varying signals for testing HMI displays and dashboards
* **Integration testing** — Simulate signal activity for automated test scenarios

## See Also

* [Interfaces Overview](/components-and-scripts/interfaces.md) — All available interfaces
* [WebSocket Realtime Interface (Pro)](/components-and-scripts/interfaces/websocket-pro.md) — WebSocket-based signal exchange
* [Custom Interfaces](/components-and-scripts/interfaces/custom-interfaces.md) — Building your own interfaces


---

# Agent Instructions: 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:

```
GET https://doc.realvirtual.io/components-and-scripts/interfaces/interface-tools/signal-test-generator.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
