Skip to main content
Version: Next

Try it before it is live

This page is for the engineer who is about to point a gateway at a real plant. A plant does not need to be running for most of what can go wrong: a wrong node id, a type that resolves to the wrong tag, a screen that names a tag that is not there, a script that makes things twice. Those are found on a copy.

A stand-in for the PLC​

Test against something that speaks the PLC's protocol and holds the PLC's data, so that the same driver, connection settings and node ids are used as in production.

  • Scadex's own tests use virtual PLCs: a program in Structured Text or Siemens SCL, run as a PLC, that serves Modbus TCP or OPC UA. Its OPC UA server publishes data blocks the way an S7-1500 does (ns=3;s="DB"."Field"), so a tag bound to the real PLC's node id can be pointed at the stand-in unchanged. A variable marked not accessible is not a node, and a read-only one refuses writes, as on the CPU.
  • Any OPC UA server you control will do for the driver's sake. What matters is that node ids, data types and structures look like the real ones. Structures are the part to take care over: decoding a structured value has not been checked against a real server (see OPC UA).
  • A stand-in cannot tell you about the PLC's own limits: its session count, its OPC UA licence, its access settings. Plan one short test on the real controller.

A throwaway gateway​

Run the setup against a gateway that exists for the test and is removed after it.

  1. Start a gateway from the same image as production, with an empty data folder, on its own port (see Installation).
  2. Create the first account and an API key with the engineer role.
  3. Run the setup (see Set it up by script) against it, with the stand-in PLC reachable by name from the gateway's network.
  4. Check, then delete the container and its volume.

Nothing live is touched, a failed run costs a minute, and you may run it as often as you like. The roundtrip proof of the virtual PLCs does exactly this: a throwaway gateway and a PLC service on one network, a real gateway driver reading and writing real values over Modbus and OPC UA.

Write the checks down​

A check that is written once runs on every change. These are the ones the NIRO and AllWaves tests and importers contain:

CheckWhat it catches
No tag path and no code appears twiceA generator that made two things the same name
Every tag a screen names existsA renamed instance, a typo, a device left out of a conversion
Every screen, list and popup a screen refers to existsA broken navigation
Every script compilesA syntax error that would show only when an operator pressed the button
A second run changes nothingA setup that is not safe to repeat
Counts before and after match (alarms, tags, screens)A conversion that dropped something
A tag path resolves to exactly one tag, never to a guessA page that would show another device's value

The NIRO page checks the generated plant list and the generated screens this way, and does not test the generated values themselves, so the generator can change them. The AllWaves page resolves a path as written, or in the default provider, or as the one tag that ends with it, and two candidates resolve to nothing, so moving tags into folders needs no change in the page.

Check live data last​

Once a connection is enabled against the plant:

  1. Open the connection and read Tags with a problem now. Everything there is a node the server refused or a name that does not exist.
  2. Run verify of your setup script, if it has one, which reads every OPC UA tag once and lists the ones whose quality is not good.
  3. Compare three or four values with the PLC's own display. A value that is plausible and wrong is what a wrong scale or a wrong byte order looks like.
  4. Write a value to a tag meant for it, read it back, and look for it in the audit log. Writes need the operator role.
  5. Trend a status tag of the connection (connected, tags) for a day before you trust an alarm on it.

Keep a record​

Keep the plan file, the checks and the README of what the script owns with the project. They are the documentation of how the gateway got its shape, and the next engineer's way to rebuild it on a throwaway gateway.