# OPC UA

Stream and write nodes on OPC UA servers

- Category: Industrial
- Capabilities: Streams, Assets, Commands, Operations, Entities
- Runs on: Linux x64, Linux ARM64, macOS Apple silicon, macOS Intel, Windows x64

Stream and write nodes on **OPC UA** servers, the industrial standard used by
PLCs, SCADA systems and factory equipment.

## What you get

- **Live nodes** — each node you list is a channel, named by its alias.
- **The server's own timestamps** — when the server reports when a value was
  sampled, Phloem uses that time, not the time it was read.
- **Setpoints** — only on nodes you declare writable, with their type. A typo
  cannot write the wrong node, and a value of the wrong type is refused. Each
  write is read back.
- **One server per input**, named by its **Device name**. Channels read
  `/opcua/opc1/…`.

## Setup

1. Note the server's endpoint URL, usually `opc.tcp://host:4840`. Only
   anonymous endpoints with no security are supported, the usual lab default.
2. In **Inputs**, add **OPC UA** and fill in:
   - **Device name** — a short label, e.g. `opc1`
   - **Endpoint URL** — `opc.tcp://192.168.1.70:4840`
   - **Nodes** — `temp=ns=2;s=Temperature, pres=ns=2;s=Pressure`
     (an alias, then the server's NodeId)
   - **Writable nodes** — `setpoint=ns=2;s=Setpoint:double, run=ns=2;s=Run:bool`
     (alias=NodeId:type — `bool`, `sbyte`, `byte`, `int16`, `uint16`, `int32`,
     `uint32`, `int64`, `uint64`, `float`, or `double`, matching the node's
     type on the server)
   - **Poll rate** — e.g. `1`
3. Press **Test connection**. It reads the first node you listed.
4. Nodes appear on **Live**. In the **Channels** table, give each a name and
   unit, such as `temp` → `reactor temperature`, `degC`.

## Notes

- A bad NodeId or unreachable endpoint is reported at startup.
- Every write is recorded.
- Endpoints secured with certificates are not supported yet.

## Supports

- Any OPC UA server (anonymous endpoints; monitored nodes by NodeId)
- Node writes on declared write_nodes (alias=NodeId:type), read back after every write

## Connection fields

| Field | Type | Required | Notes |
|---|---|---|---|
| Device name | Text | Yes |  |
| Endpoint URL | Text | Yes |  |
| Nodes (alias=NodeId) | Text | Yes |  |
| Writable nodes (alias=NodeId:type) | Text | No |  |
| Poll rate (Hz) | Number | No |  |
