# Accept or refuse simulated PLCs

> An eaxPLC run by the eaxsim emulator (virtual commissioning) says it is simulated. eaxScada refuses its values by default; Tools > Simulated PLCs lets an Administrator accept them for commissioning, and then every value, alarm, trend and history sample from it is marked SIM.

Product: eaxScada · Type: How-to guide · Editions: Starter, Pro, Enterprise
Source: https://eaxware.com/docs/eaxscada/how-to/accept-simulated-plcs/
Verified against commit 387eebf.

## Goal

Decide whether this server takes in the values of PLCs run by an emulator. An eaxPLC run by eaxsim (virtual commissioning) says it is simulated (`"simulated": true` in its birth, heartbeat, death and `GET /api/stats`). By default eaxScada refuses its values, so a simulated plant is never shown, recorded or acted on as the real one.

## Before you start

- Reading the setting: **Lead_Engineer** or **Administrator**.
- Changing it: a signed-in **Administrator**, with a typed reason. Not an API token, not the AI co-pilot account.

## 1. Open the setting

Choose **Tools > Simulated PLCs**.
[Image: Tools > Simulated PLCs: Accept simulated PLCs off, with the explanation that their values are refused, and the list of simulated PLCs heard of, empty.]
[Image: Tools > Simulated PLCs: Accept simulated PLCs off, with the explanation that their values are refused, and the list of simulated PLCs heard of, empty.]

The default: simulated PLCs are refused. No simulated PLC has announced itself yet.
**Simulated PLCs heard of** lists every simulated PLC that announced itself since the server started, as **Refused**, **Accepted, marked SIM** or **Simulated, shut down**.

## 2. Change the setting

1. Switch **Accept simulated PLCs** on (or off).
2. Click **Save...**.
3. Enter a **Reason**. The dialog shows who it is **Recorded as** (you, read-only).
4. Confirm with **Accept simulated PLCs** (or **Refuse simulated PLCs**).

The setting is `plc.accept_simulated` in `config.yaml` (default `false`; an unreadable value counts as `false`). It is written, read back, and recorded as `PLC_SIM_ACCEPT_CHANGED` with the old and new value. Routes: `GET /api/plc-sim/status`, `PUT /api/plc-sim/accept {accept, reason}`.

## What each setting does

**Diagram: What happens to the values of a simulated PLC** (data flow)

Values come in through the NATS channel of a PLC's UNS telemetry or an edge eaxTags script. The tag engine waits up to 5 seconds for a value whose PLC is not known yet. A value from a real PLC is taken in as a plant value. A value from a simulated PLC is refused while plc.accept_simulated is off: its tag reads Bad (source refused) and the value goes nowhere. With the setting on it is taken in and marked SIM everywhere, and it still never clears an interlock unless that interlock is allowed in commissioning.

**Parts**

- **NATS channel** (service or process): the PLC's UNS telemetry
- **Edge eaxTags script** (service or process): or its fault signal
- **Tag engine** (service or process): a value whose PLC is not known yet waits up to 5 s
- **From a simulated PLC?** (check or decision)
- **Taken in** (outcome): a plant value
- **plc.accept_simulated** (check or decision): Off by default
- **Refused** (outcome): Bad (source refused); never on a screen, in the historian, an alarm, a script; PLC_SIM_REFUSED once
- **Taken in, marked SIM** (outcome): on screens, tags, alarms, history; never clears an interlock unless allowed in commissioning

**Connections**

- **NATS channel → Tag engine** (data or telemetry)
- **Edge eaxTags script → Tag engine** (data or telemetry)
- **Tag engine → From a simulated PLC?** (next step)
- **From a simulated PLC? → Taken in** (next step): no
- **From a simulated PLC? → plc.accept_simulated** (next step): yes
- **plc.accept_simulated → Refused** (refusal): Off. The tag engine refuses every write to the tags of that PLC; their snapshots read Bad (source refused, 0x0004) with the reason. A refused tag keeps any interlock that reads it active.
- **plc.accept_simulated → Taken in, marked SIM** (next step): On. Alarms are evaluated as before. An interlock reading a simulated value stays active, unless it is ticked "Allowed in commissioning"; the plant e-stop signal is never read from a simulated value.

The default refuses simulated values in the tag engine itself; accepting them is for commissioning, and even then a simulation does not release a plant interlock.

### Off (default): refused

The tag engine itself refuses the values, whoever brings them in (the NATS channel of the PLC's UNS telemetry, an edge eaxTags script, its fault signal). They never reach a screen, the historian, an alarm, a script or an interlock.

- Its tags read **Bad (source refused)** (OPC quality `0x0004`) with the reason `simulated PLC <id> refused: accept simulated PLCs is off`. The same line is logged, and `PLC_SIM_REFUSED` is recorded once per PLC per run.
- System Health shows the PLC as **simulated: refused** and says so in its banner.
- The historian's periodic sampling skips a refused value.

### On (commissioning only): accepted and marked

The values are taken in unchanged and marked everywhere they are shown or stored:

- **Screens:** every runtime object bound to such a tag shows a **SIM** badge, whatever the quality style; no project or screen setting hides it. The phone cards show a SIM chip.
- **Tags:** `/api/tags`, the live data socket's snapshots and updates, and every tag snapshot carry `"simulated": true`.
- **Alarms:** alarm events carry `"simulated": true` in the alarm journal, the alarm grids, the alarm CSV export and the Studio's active alarms, and alarm objects show a SIM marker. Alarms are evaluated exactly as before: an alarm cleared by a plant value is not marked.
- **History:** historian samples carry the mark (stored, in aggregates, in exports and in `/api/history`); every trend shows simulated samples with a SIM band, in the legend and the tooltip; the trend's **Values** table has a **Source** column (plant or simulated).
- **Alarms treat the values as values; interlocks do not.** A screen interlock that reads a simulated value stays active, whatever the value, unless the interlock is ticked **Allowed in commissioning**; the plant emergency-stop signal is never read from a simulated value. Settings and System Health say so in an amber warning while a simulated PLC is attached.

The values of a driver channel in simulated mode (`"simulated": true` in its settings) and of an eaxTag defined `"simulated": true` are marked the same way, whatever this setting says: SIM on screens and trends, simulated history samples and alarm events, an interlock that stays active unless it is **Allowed in commissioning**, a limit that refuses the write, and an e-stop signal that reads as unknown. When you switch the setting on, the `PLC_SIM_ACCEPT_CHANGED` record states the effect: "the values of simulated PLCs are now taken in, each marked Simulated on screens, in the tag lists and the history; alarms are raised from them, their events marked simulated; an interlock reading one stays active unless it is allowed in commissioning, and a limit or the e-stop signal never accepts one".

## How a PLC is told simulated

- **Sticky:** once a PLC id says it is simulated it stays simulated, until its death message and a later message without the field (a new, real instance). A value written while its source was simulated keeps its mark until a real value replaces it.
- **Values of an unknown source wait:** a UNS value whose PLC has not announced itself yet (for example after eaxScada restarts while the emulator runs) is held until the PLC's first heartbeat, at most 5 s, then applied in order with the PLC's verdict. After a restart, a real eaxPLC's first UNS values can appear up to one heartbeat (2 s) later than before. A source that says nothing within 5 s is taken as real from then on (logged once), until it says it is simulated. UNS publishers that are not an eaxPLC (no `device_id`) are not held.
- **This server's own driver devices are not PLCs.** The driver manager publishes what its own channels read (Modbus, S7, EtherNet/IP and the other drivers) on the UNS, with the driver device's id in `device_id` (for example `DEV-LINE1-PLC`). Such a value is tied to no PLC: it is taken in at once and never held, whatever the device is called. Before this release such an id was taken for an eaxPLC that had not announced itself: values read back from the UNS waited up to 5 s, and the log said "PLC sent values but said nothing about itself within the wait". Values a NATS or MQTT channel takes in from the bus are handled as before.
- **A PLC that announces itself with a local device's id takes those paths.** From its first announcement, the paths that device publishes are that PLC's: a simulated one is refused (setting off) or marked SIM (setting on), as any other simulated PLC. Before that first announcement its values are not held, since the id is a local device's.
- **Avoid giving an eaxPLC the id of a local driver device**, above all a simulated one: until it announces itself, nothing tells its values from the device's. Give each eaxPLC (real or simulated) an id that no driver device of this server uses.
- **A NATS bridge to another eaxScada** still sees that server's driver device ids as unknown PLCs: their values wait up to 5 s at start, as before.
- **Remote PLC Studio:** the live values of a simulated PLC are marked simulated; those of a simulated PLC the site refuses are not served (`403 plc_sim_refused`).

## Result

With the setting off, a simulated PLC can never pass for the plant. With it on, everything it sends is visibly marked SIM. Switch it off again when commissioning ends: its tags then read Bad until a real PLC sends values.

## Related

- [Historian](/docs/eaxscada/explanation/historian/)
- [Show bad and stale values](/docs/eaxscada/how-to/show-bad-and-stale-values/)
- [eaxsim scenario checks](/docs/platform/reference/eaxsim-scenario-checks/)
- [Connect an eaxsim host to eaxScada's broker](/docs/eaxscada/how-to/connect-an-eaxsim-host/)
