A simple OPC UA Machinery client focused on end users.
This client connects to an OPC UA server and automatically discovers machines that follow the OPC UA Machinery model.
It then collects useful information, such as:
- Server health and capability information
- List of available machines
- Machine identification details
- Machine components and component identification
- Monitoring values (process values)
- Machine state and operation mode (if available)
All collected data is written to output.json and refreshed every 10 seconds.
This project is useful when you want a clear, ready-to-use view of machine data without manually browsing an OPC UA address space.
Main benefits:
- Quick onboarding: see machine data in one JSON file
- Easy integration:
output.jsoncan be consumed by scripts, dashboards, or data pipelines - Live updates: values are subscribed and updated continuously
- Better reliability: reconnect and model-change handling are built in
In short, it turns a complex OPC UA server structure into a simple, machine-readable snapshot for operations, diagnostics, and integration work.
- Connects to the OPC UA endpoint.
- Reads server status and limits.
- Finds machine instances in the Machinery folder.
- Discovers metadata, components, and monitoring values.
- Subscribes to value changes.
- Writes and refreshes
output.jsonevery 10 seconds.
- Node.js 18+
- npm
npm install
npm startAfter startup, check output.json in the project root.
Build the image:
docker build -t opcua-machinery-client .Start the container:
docker run --rm -p 3000:3000 opcua-machinery-clientIf you want to persist the generated JSON file on the host, mount the project folder or a dedicated target path:
touch output.json
docker run --rm -p 3000:3000 -v "$PWD/output.json:/app/output.json" opcua-machinery-clientThe application inside the container still connects to the OPC UA endpoint configured in src/main.ts.
The server endpoint is configured in src/main.ts.
Current default endpoint:
opc.tcp://opcua.umati.app:4843
You can replace it with your own OPC UA server endpoint.
The application also starts a small HTTP server.
Default address:
http://localhost:3000
Available endpoints:
GET /serverreturns the current server informationGET /machinesreturns all discovered machinesGET /machines?productInstanceUri=<value>returns only machines with the matchingIdentification.ProductInstanceUri
Example:
http://localhost:3000/machines?productInstanceUri=https://umati.org/UA/instance/ShowCaseMachineTool-20240301-4711
The REST API reads directly from the in-memory OPC UA summary, so it does not need to reload output.json for each request.
Implemented:
- Machine discovery
- Machine and component identification
- Process value monitoring (read)
- Automatic JSON export
- Partial handling of model changes
Not implemented yet:
- Writing setpoints
- Deviation/alarm workflows
- Job management features
Status legend: [x] done, [ ] not yet
Reference: https://reference.opcfoundation.org/Machinery/v103/docs/5
- 5.1 Machine Identification and Nameplate
- 5.2 Finding all Machines in a Server
- 5.3 Component Identification and Nameplate
- 5.4 Finding all Components of a Machine
- 5.5 Machine Monitoring
- 5.6 Preventive Maintenance
Reference: https://reference.opcfoundation.org/Machinery/ProcessValues/v100/docs/5
- Access process values and selected metadata
- Access and set process value setpoints
- Access and set deviation limits relative to setpoints
- Notify when process value exceeds deviation limit or range
- Access percentage value with dynamic ranges
- Zero-point adjustment of process values
- Vendor-specific error codes for process value devices
- Access and set substitution value for connection loss
- Identification information of process value devices
- Health status information of process value devices
Reference: https://reference.opcfoundation.org/Machinery/Jobs/v100/docs/
- Provide job orders to a MachineryItem
- Control job orders (update, start, revoke, pause, resume, abort, stop)
- Retrieve execution state, intermediate results, and final result
- Delete job order results after execution