# Import an example project

> Import a downloaded eaxScada and eaxPLC example project in the Studio (Import example...) - the preview and its checks, the new project it creates, what arrives switched off and the settings the result lists to switch on, the two commands that install and run the example PLC, accepting its simulated values, the SIM marking, the parts that wait for the PLC, and making the example active and deploying it to see it running.

Product: eaxScada · Type: How-to guide · Editions: Starter, Pro, Enterprise
Source: https://eaxware.com/docs/eaxscada/how-to/import-an-example-project/
Verified against commit e5f1f76.

## Goal

Import a downloaded example project into eaxScada and run its simulated PLC, to evaluate the product on a complete plant. The import adds a **new project** with the example's screens, alarms, trends and more, all under the example's own tag root `Examples/`. Nothing you have is replaced, and the active project is not changed.

For what an example holds and the examples available, see [Example projects](/docs/platform/explanation/example-projects/).

:::note[Use an evaluation or training server]
An example is checked so that it cannot reach your equipment or your own tags (see [What the import checks](#what-the-import-checks)). It still adds a project, styles, languages and a PLC identity to the server. Import it on a server you use to evaluate or train, not on a production server.
:::

## Before you start

- **Your edition:** any, Free included. The parts of the example your edition does not include are skipped and listed; the other parts are added (see [What arrives, and how](#what-arrives-and-how)).
- **Your role:** **Lead_Engineer** or **Administrator**, in a signed-in Studio session. An API token, the AI co-pilot and an eaxCloud remote session cannot import an example.
- **Accepting the example PLC's values** (step 4) needs an **Administrator**.
- **The example zip**, `eaxware-example-<id>-<version>.zip`. Do not unpack it.
- **eaxPLC live123 or later** (`plc-server`) on the same computer as eaxScada, to run the example's PLC. The import never writes in the PLC's folder.
- Optional: check the zip first with [`eaxscada example check`](/docs/eaxscada/reference/example-import-checks/). It runs the same checks without a server and writes nothing.

## 1. Open Import example

1. In the Studio, open **Displays**, then **New > From template...** (or **Templates** on an empty display list).
2. In **Starter templates**, click **Import example...**.

The **Import example** dialog opens. It says: "An example project adds a new project with its screens, alarms and more, all under its own tag root, and a simulated PLC you run with two commands. Nothing is replaced and the active project is not changed."

## 2. Preview the example

1. Under **Example file (.zip)**, choose the zip.
2. Click **Preview**.

The server checks the whole example and writes nothing ("Checking the example..."). The dialog then shows:

- **A summary:** **Example**, **Version**, **Needs** (the eaxScada and eaxPLC versions, and "everything on eaxScada *edition*"), **New project** (`Example: <name>`), **Tag root**, **Example PLC** (`ex-<short>`) and **Simulated PLC values** (**refused until an Administrator accepts this PLC (below, or later)**, or **accepted, marked Simulated**).
- **What the import adds**, a grid with one row per item: **Status**, **Part**, **Kind**, **Id**, **Bundle id** and **Reason**.

| Status | Meaning |
|---|---|
| **Will be added** | Added as it is. |
| **Will be added under a new id** | A screen or component whose id is taken. It gets a new id, and the references to it follow. |
| **Skipped** | An item with this id exists (kept as it is), or a part your edition does not include. The reason says which. |
| **Waiting for the example PLC** | Added once the PLC's values arrive (see [step 6](#6-add-the-parts-waiting-for-the-plc)). |
| **Refuses the import** | A check failed. The row's warning marker opens the reason. |

**One refused row refuses the whole example:** "This example is refused: see the rows marked. Nothing can be imported." See [What the import checks](#what-the-import-checks).

## 3. Import

1. Type a **Reason**. It is recorded with the import. **Imported by** shows you, read-only.
2. Administrators only: tick **Accept its simulated values now** to accept the example PLC in the same step (see [step 4](#4-accept-the-example-plcs-simulated-values)).
3. Click **Import**.

The server checks the example again, and imports only the file you previewed: a different file (another SHA-256) is answered `409` and nothing is written. On a server with an audit trail (Starter and up), the import is recorded first as `EXAMPLE_IMPORT` with the zip's SHA-256 and your reason; without that record nothing is imported (`503 AUDIT_NOT_WRITTEN`). Then each item is saved through the server's own save path, as you: the same rights, edition checks and records as if you had made it by hand. The outcome is recorded as `EXAMPLE_IMPORT_DONE` (or `EXAMPLE_IMPORT_FAILED`) with every item. eaxScada Free has no audit trail: there the import goes ahead with its other checks and nothing is recorded.

### What arrives, and how

| Part | Arrives |
|---|---|
| Screens, components, dashboards, alarms, local tags, historian configurations | Added to the new project. A taken screen or component id is renamed; any other existing item is kept and listed as skipped. Alarms on the PLC's tags wait for its values (see [step 6](#6-add-the-parts-waiting-for-the-plc)). |
| 3D scenes | Saved on every edition, to view and run. Editing a 3D scene still needs the 3D design of Pro. |
| Recipes | As **drafts**: approve a recipe before you use it. |
| Scripts | **Switched off**, once the PLC's values arrive: review a script, then switch it on. |
| Report schedules | **Switched off, with no delivery.** |
| Translations | Into the new project. |
| Styles and languages | The example's missing theme tokens, text and state styles, shape classes and languages are added to the server's shared styles. A name the server already has keeps your definition and is listed in the result. Nothing is removed; the default language and the fonts are never changed. |
| Parts your edition does not include | **Skipped**, never refused: Analytics and Reports (datasets, report designs, schedules; references to a skipped report are removed), OEE and downtime, genealogy, and the alarm handshake fields below Starter. |

### What the result lists to switch on

An import never changes a server-wide setting. When a part of the example needs one, the result says so, with **Open the setting**:

- **OEE and downtime are off on this server**: an administrator sets `production.enabled: true` in `config.yaml` and restarts eaxScada; then **Add the parts waiting for the PLC** adds the example's machines.
- **A shift calendar the example's OEE machines use is not defined**: an administrator adds it under `reports.shifts` in `config.yaml`. Until then those machines keep waiting.
- **Genealogy is not running on this server**: the example's lot and unit tracing is not imported.

## 4. Accept the example PLC's simulated values

eaxScada refuses the values of a simulated PLC by default. An Administrator accepts this example's PLC on its own, with a reason: tick **Accept its simulated values now** before **Import**, or later in the result, under **Accept its simulated values (Administrator): reason**, then **Accept**.

- The acceptance is recorded first as `PLC_SIM_ACCEPT_EXAMPLE`, then written to `config.yaml` in `plc.accept_simulated_ids` and read back.
- It covers **this example PLC, for its tag root only**. A value of that PLC outside `Examples/` is still refused, and every other simulated PLC stays refused. The global **Accept simulated PLCs** switch is not changed.
- Every accepted value is marked simulated: the **SIM** badge on screens, a SIM band on trends, simulated history samples and alarm events. A screen whose values are all simulated shows the **SIMULATED** chip in its header.

See [Accept or refuse simulated PLCs](/docs/eaxscada/how-to/accept-simulated-plcs/#accept-one-example-plc-plcaccept_simulated_ids).

## 5. Install and run the example PLC

The result says "Imported into the new project *ex_...*. Now run its PLC with these two commands (in the folder of plc-server):" and shows them, each with **Copy**:

```sh
plc-server example install "eaxware-example-bottling-line-1.0.0.zip"
plc-server example run bottling-line --nats nats://127.0.0.1:4222 --nats-nkey "<eaxScada data>\security\nkeys\ex-bottling.nk" --scada-url http://127.0.0.1:8080
```

The second command carries this server's broker address, the key file the import made for the example PLC, and this server's address. Run both in a terminal, in the folder that holds `plc-server`. The first installs the PLC into a new folder; the second starts it, simulated. See [Run a simulated PLC and the PLC of an example project](/docs/eaxplc/how-to/run-a-simulated-plc/#6-example-projects-example-install-example-check-and-example-run).

The lamp under the commands follows the PLC:

| Lamp | Meaning |
|---|---|
| **Waiting for the PLC** | The PLC has not connected yet. |
| **PLC connected** | The PLC is connected and accepted; its values have not arrived yet. |
| **PLC connected: its simulated values are refused until an Administrator accepts them** | Accept the example PLC (step 4). |
| **Values flowing (simulated)** | The values arrive, marked simulated. |

:::note[The example PLC trusts the first eaxScada it works with]
It keeps that eaxScada's sign-in key in its own folder. If the example PLC was installed before, for another eaxScada or before this server was reset, install it into a new folder (`plc-server example install <zip> --dir <new folder>`, then `plc-server example run <id> --dir <new folder>`) or remove its old folder first.
:::

## 6. Add the parts waiting for the PLC

Some parts wait until the PLC's values arrive:

- **Alarms on the PLC's tags** (a tag under the example's tag root that is not one of the example's own local tags). Created before the PLC runs, each of them would raise a "Signal unreadable" alarm. Each one is added once its tag reads Good, Overridden or Uncertain; one whose tag has no value yet or reads Bad keeps waiting, with the reason in its row.
- **Alarms with a controller handshake**, scripts, OEE machines and the downtime reason tree, which check the PLC's tags when they are saved.

Once the lamp shows values, click **Add the parts waiting for the PLC**. The result says "The parts that waited for the PLC are added." When some parts still wait, it says "Some parts still wait for the PLC's values (*n*): add them again in a moment." The grid updates the rows. Scripts arrive switched off.

**Handshake alarms of the example.** An example alarm's handshake tags (shown, acknowledged, controller acknowledge) are values of the example PLC under its tag root. The alarm manager writes them to that PLC, under that root only, and needs its `Alarm_Manager` grant on those tags as for any PLC: see [Let the alarm manager write the tags](/docs/eaxscada/how-to/alarm-controller-handshake/#one-time-setup-let-the-alarm-manager-write-the-tags).
## 7. See it running

**Open example** opens the screen the example names as its start screen (its overview) in the Studio, under its new id if it was renamed.

To see the example in the operator runtime, the dialog's last step, **To see it running**, has two actions, in this order:

1. **Make this project active**: the example's project becomes the one the Studio edits and deploys. This is the usual project switch, recorded as such. Your own project is kept, and you can make it active again at any time. The Studio follows: the project switcher, the screens and the project tree show the example. The button then reads **Active**.
2. **Deploy...**: opens the Studio's own Deploy dialog, with its preview of what changes, the reason, and the e-signature when this server requires one. Nothing is deployed until you confirm there; nothing is ever deployed from the import dialog. **Deploy...** is offered only once the example's project is active ("Make this project active first").

**The example keeps your plant e-stop signal.** The example's project takes the safety signal in force on this server when you add it, never a tag of the example. Making the example active, and your own project again, therefore never moves the signal, and your real signal stays watched while the example is active. See [Project settings](/docs/eaxscada/reference/project-settings/#safety-plant-emergency-stop-signal-tag).

## What the import checks

Everything is checked before anything is written, on **Preview** and again on **Import**. One problem refuses the whole example (`422`, nothing written):

- **The zip:** at most 16 MB, 64 MB unpacked, 1000 entries, 8 MB per entry, a compression ratio of 100:1 and 4 path levels; only the entries of the example layout; no `..`, absolute path, backslash, symlink, directory entry or duplicate; every entry listed in `example.json` with its SHA-256, and nothing else.
- **The tag fence:** every tag a screen, alarm, script, recipe or dashboard names is under the example's tag root `Examples/`. Reading `System/Health/` is allowed.
- **The write fence:** every write target is under the tag root: buttons, faceplates, scripts, recipe parameters, alarm handshake tags and dashboard commands. A target computed at run time is still checked at run time; one whose fixed start leaves the root is refused.
- **No equipment and no server-wide setting:** no plant emergency-stop command, no address of another host, no driver channel, no fieldbus that opens a port, no component the example does not carry, no server-wide setting, no script that writes outside the root or reaches files or the network.
- **Free names:** the example PLC id is not known to this server (a PLC, an edge PLC, a key file, a PLC heard on the bus), no tag lives under the tag root yet, and no project has the example's name.

Each check, with its rule name, is listed in [eaxscada example check and the rules an example must pass](/docs/eaxscada/reference/example-import-checks/).

An example never takes over your safety signal: its project keeps the one in force on this server, and a signal named in the example's `pages.json` is ignored (see [step 7](#7-see-it-running)).

## Verify

1. The preview grid has no **Refuses the import** row.
2. After the import, the projects list shows `Example: <name>`, and your active project is unchanged.
3. After `plc-server example run`, the lamp shows **Values flowing (simulated)**.
4. **Open example**: the screen is live, with the **SIMULATED** chip in its header.
5. **Make this project active**, then **Deploy...** and confirm: the operator runtime shows the example's screens. Making your own project active again is accepted, and the safety signal has not moved.
6. Stop the PLC (Ctrl+C in its terminal): within about 10 s the example's tags show Bad, and `System/PLC/<plc id>/Fault` goes Bad. Before the PLC was first started, that fault signal does not go Bad: an example PLC is watched once it has announced itself.

## Troubleshooting

| Symptom | Fix |
|---|---|
| "importing an example is for Lead_Engineer or Administrator" | Sign in with one of these roles. |
| "an example is imported by a person in a signed-in session" | Use the Studio, not an API token or the AI co-pilot. |
| A `plc_identity` row: the PLC "is already known to this server" | The example was imported before, or another PLC has this id. An example never takes over a PLC. |
| A `tag_root` row: tags "already live under" the root | Something else uses `Examples/`. The tag root must be free. |
| A `project` row | A project with this name exists. An import never changes another project. |
| The lamp stays at **Waiting for the PLC** | The PLC is not running or cannot reach this server's broker: check the `plc-server example run` terminal and the `--nats` and `--nats-nkey` values. |
| The lamp says the values are refused | Accept the example PLC (step 4). |
| **Deploy...** is greyed out, "Make this project active first" | Click **Make this project active** first. |
| A project switch is refused `409` (`safety.plant_estop_tag`) after making an example active | The example was imported with eaxScada live131, whose example projects named a safety signal under the example's tag root. Set the example project's signal to your plant's in [Project settings](/docs/eaxscada/reference/project-settings/#safety-plant-emergency-stop-signal-tag), or import the example again, before you make it active. |
| An alarm stays **Waiting for the example PLC** after **Add the parts waiting for the PLC** | Its tag has no value yet or reads Bad (the row gives the reason). Check that the PLC runs and its values are accepted, then add the parts again. |

## Related

- [Example projects](/docs/platform/explanation/example-projects/)
- [eaxscada example check and the rules an example must pass](/docs/eaxscada/reference/example-import-checks/)
- [An example project's PLC](/docs/eaxscada/explanation/connections-and-stations/#an-example-projects-plc): its identity, its inbox and its values.
- [Accept or refuse simulated PLCs](/docs/eaxscada/how-to/accept-simulated-plcs/)
- [Run a simulated PLC and the PLC of an example project](/docs/eaxplc/how-to/run-a-simulated-plc/)
