Leanpub Header

Skip to main content

P4NR OPC UA for NodeJS (English)

Understanding and Using OPC UA, node-opcua, and Companion Specs with Node.js 24

This book is 90% completeLast updated on 2026-07-25

OPC UA is the open language of modern automation, and node-opcua is the leading open-source TypeScript stack for it. This book explains the architecture, the SDK, and Companion Specs like Machinery, Robotics, and LADS in plain language - with a learning path, runnable Node.js 24 examples, and clear references to the OPC Foundation reference.

Minimum price

$89.99

$139.99

You pay

Author earns

$

Also available for 4 book credits with a Reader Membership

PDF
EPUB
WEB
APP
About

About

About the Book

OPC UA is the open, vendor-neutral language of modern automation - and node-opcua is the leading open-source TypeScript/Node.js stack for it. This handbook takes you from the fundamentals of OPC UA architecture, through the core features of node-opcua (client, server, subscriptions, security, history, alarms), to a hands-on learning path with runnable Node.js 24 examples.

It closes with an in-depth part on OPC UA NodeSets and Companion Specifications: Machinery, Robotics, Machine Tool, LADS, IJT/Tightening, and many more industry models are explained, put into context, and shown with node-opcua code, each with a clean reference to the official OPC Foundation source. That way you build on years of industry knowledge instead of reinventing architecture and data models yourself.

Examples: https://github.com/PLUS-for-Node-RED/node-opcua/tree/support/v2/book

Author

About the Author

Klaus Landsdorf

Hybrid-Expert for OT/IT - IIoT - IoT - Industrie 4.0

Contents

Table of Contents

node-opcua: The Handbook

  1. Mastering OPC UA with TypeScript and Node.js

Preface

  1. Who is this book for?
  2. How to read this book
  3. Conventions
  4. Acknowledgments
  5. Part I: The OPC UA Specification

History, Goals, and Architecture

  1. The story: why a whole new protocol?
  2. What is OPC UA?
  3. Why OPC UA?
  4. Client/server and Pub/Sub
  5. Logical architecture
  6. Transport
  7. Stacks and certification

The Information Model

  1. Node classes
  2. NodeId
  3. BrowseName, DisplayName, attributes
  4. References and hierarchy
  5. DataValue, Variant, StatusCode
  6. Data Access (DA)
  7. Events, Alarms & Conditions
  8. Methods
  9. Historizing
  10. NodeSets and Companion Specs

Services and Transport

  1. Discovery Service Set
  2. Secure Channel Service Set
  3. Session Service Set
  4. View Service Set
  5. Attribute Service Set
  6. Method Service Set
  7. MonitoredItem and Subscription Service Set
  8. Not supported, or commercial only
  9. Encoding and chunking

Security in OPC UA

  1. Three layers
  2. Message security mode
  3. Security policies (selection)
  4. Certificates and trust lists
  5. User identities
  6. Authorization and roles (Part 18)
  7. A practical checklist
  8. Part II: The node-opcua SDK

SDK Overview

  1. Why an SDK instead of implementing the spec directly?
  2. What is node-opcua?
  3. Installation
  4. Node.js version
  5. A typical import
  6. Monorepo architecture
  7. Strengths
  8. Limits (open source)

Client Features

  1. OPCUAClient
  2. Session capabilities
  3. Subscriptions and monitored items
  4. User identity
  5. Discovery from the client
  6. Other client packages

Server and Address Space

  1. OPCUAServer
  2. ServerEngine and Address Space
  3. Modeling API
  4. Loading NodeSets
  5. Diagnostics
  6. Lifecycle

Subscriptions, Events, and Data Access

  1. DataChange subscriptions
  2. Event subscriptions
  3. Data Access in the SDK
  4. Extension objects and complex types

Security, Certificates, and Configuration

  1. OPCUACertificateManager
  2. Security on client and server
  3. Server configuration / push certificates
  4. UserManager

History, Alarms, and Methods

  1. Methods
  2. Historizing
  3. Alarms & Conditions
  4. File Transfer

Discovery, File Transfer, and Role-Based Security

  1. Discovery and the LDS
  2. Role-based security (OPC 10000-18)
  3. Pseudo session

Packages, Samples, and Extensions

  1. Important packages (short list)
  2. Samples in the repository
  3. Commercial / membership modules
  4. Feature matrix
  5. Part III: A Learning Path with Node.js 24

Setup for Node.js 24

  1. Goal of this part
  2. Setting up a project
  3. Downloading the examples
  4. Learning order

Example: A Mini Server

  1. Learning goal
  2. Run it
  3. What happens?
  4. The full code

Example: Client - Browse and Read

  1. Learning goal
  2. Run it
  3. What happens
  4. The full code
  5. Common pitfalls

Example: Subscription

  1. Learning goal
  2. Run it
  3. Concept
  4. The full code
  5. Parameters to experiment with

Example: Methods

  1. Learning goal
  2. Run it
  3. Server side
  4. Client side

Example: Data Access

  1. Learning goal
  2. Run it
  3. SDK helpers
  4. The full code

Example: Alarms

  1. Learning goal
  2. Run it
  3. The full code
  4. Going further

Example: History

  1. Learning goal
  2. Run it
  3. Client

Example: Secure Access (UserName)

  1. Learning goal
  2. Run it
  3. Server
  4. Client
  5. Next steps toward production
  6. Part IV: OPC UA NodeSets and Companion Specs

NodeSets and Companion Specs - Introduction

  1. What is this part for?
  2. What is a NodeSet?
  3. What is a Companion Spec?
  4. Why teaching vs. licensing - a clarification
  5. The catalog in node-opcua
  6. Reading order
  7. Citation style in the sub-chapters

The OPC UA Standard NodeSet (UA)

  1. The story
  2. What is it used for?
  3. Core concepts
  4. node-opcua
  5. Sources

Device Integration (DI) - OPC 10000-100

  1. The story
  2. What is it used for?
  3. Core concepts (selection)
  4. Dependencies
  5. Using node-opcua
  6. A teaching point: a typical mistake
  7. Sources

Analyzer Device Integration (ADI)

  1. The story
  2. What is it used for?
  3. Core concepts
  4. Dependencies
  5. node-opcua
  6. A teaching point: a domain spec is not a replacement for DI
  7. Sources

AutoID - OPC 30010

  1. The story
  2. What is it used for?
  3. Core concepts
  4. Dependencies
  5. node-opcua
  6. A teaching point: scan events, not polling
  7. Sources

Machine Vision - OPC 40100

  1. The story
  2. What is it used for?
  3. Core concepts
  4. Dependencies
  5. node-opcua
  6. A teaching point: keep recipe and result thinking separate
  7. Sources

Commercial Kitchen Equipment - OPC 30200

  1. The story
  2. What is it used for?
  3. Core concepts
  4. Dependencies
  5. node-opcua
  6. A teaching point: reuse energy and health fields from DI
  7. Sources

Asset Management Basics (AMB) - OPC 10000-110

  1. The story
  2. What is it used for?
  3. Core concepts
  4. Dependencies
  5. node-opcua
  6. A teaching point: AMB is rarely loaded on its own
  7. Sources

The GDS Information Model - Part 12 / GDS NodeSet

  1. The story
  2. What is it used for?
  3. Core concepts
  4. Dependencies
  5. node-opcua
  6. A teaching point: NodeSet != operations
  7. Sources

Industrial Automation (IA) - OPC 10000-200

  1. The story
  2. What is it used for?
  3. Core concepts
  4. Dependencies
  5. node-opcua
  6. A teaching point: IA is invisible glue
  7. Sources

Machinery - OPC 40001-1

  1. The story
  2. What is it used for?
  3. Core concepts
  4. Dependencies
  5. node-opcua in practice
  6. A teaching point: AddIns
  7. Sources

Machinery Jobs - OPC 40001-3

  1. The story
  2. What is it used for?
  3. Core concepts
  4. Dependencies
  5. node-opcua
  6. A teaching point: a formal dependency vs. a sensible overall architecture
  7. Sources

Machinery Result - OPC 40001-101

  1. The story
  2. What is it used for?
  3. Core concepts
  4. Dependencies
  5. node-opcua
  6. A teaching point: recognize and reuse the generic pattern
  7. Sources

Machinery Process Values - OPC 40001-2

  1. The story
  2. What is it used for?
  3. Core concepts
  4. Dependencies
  5. node-opcua
  6. A teaching point: semantics is not a nice-to-have
  7. Sources

Machine Tool - OPC 40501

  1. The story
  2. What is it used for?
  3. Core concepts
  4. Dependencies (catalog)
  5. node-opcua
  6. Sources

CNC - OPC 40502

  1. The story
  2. What is it used for?
  3. Core concepts
  4. Dependencies
  5. node-opcua
  6. A teaching point: deliberately connect the CNC and Machine Tool views
  7. Sources

Robotics - OPC 40010

  1. The story
  2. What is it used for?
  3. Core concepts
  4. Dependencies
  5. node-opcua
  6. Sources

Woodworking - OPC 40550

  1. The story
  2. What is it used for?
  3. Core concepts
  4. Dependencies
  5. node-opcua
  6. A teaching point: a domain model inherits from Machinery, not the other way around
  7. Sources

Flat Glass - OPC 40301

  1. The story
  2. What is it used for?
  3. Core concepts
  4. Dependencies
  5. node-opcua
  6. A teaching point: line integration, not just a single machine
  7. Sources

PackML - OPC 30050

  1. The story
  2. What is it used for?
  3. Core concepts
  4. Dependencies
  5. node-opcua
  6. A teaching point: the state names are already agreed on - use them
  7. Sources

IO-Link and IO-Link IODD - OPC 30120

  1. The story
  2. What is it used for?
  3. Core concepts
  4. Dependencies
  5. node-opcua
  6. A teaching point: keep process data and service data cleanly separated
  7. Sources

PADIM and IRDI - Semantics for Process Values

  1. The story
  2. What is it used for?
  3. Core concepts
  4. Dependencies
  5. node-opcua
  6. A teaching point: IRDI is infrastructure, not an end in itself
  7. Sources

ISA-95 Job Control - OPC 10031-4

  1. The story
  2. What is it used for?
  3. Core concepts
  4. Dependencies
  5. node-opcua
  6. A teaching point: base vocabulary, not a ready-made MES integration
  7. Sources

IJT Base and Tightening - OPC 40450 / 40451

  1. The story
  2. What is it used for?
  3. Core concepts
  4. Dependencies
  5. node-opcua
  6. A teaching point: the longest dependency chain in the catalog is worth tracing
  7. Sources

LADS - OPC 30500

  1. The story
  2. What is it used for?
  3. Core concepts
  4. Dependencies
  5. node-opcua
  6. A teaching point: recognize manufacturing patterns in the lab
  7. Sources

Metal Forming - OPC 40503

  1. The story
  2. What is it used for?
  3. Core concepts
  4. Dependencies
  5. node-opcua
  6. A teaching point: the dependency graph is the real lesson here
  7. Sources

Scales / Weighing - OPC 40200

  1. The story
  2. What is it used for?
  3. Core concepts
  4. Dependencies
  5. node-opcua
  6. A teaching point: handle legally-regulated weight values separately
  7. Sources

I4AAS - OPC UA and the Asset Administration Shell

  1. The story
  2. What is it used for?
  3. Core concepts
  4. Dependencies
  5. node-opcua
  6. A teaching point: two communities, one model
  7. Sources

Weihenstephan - OPC 40600

  1. The story
  2. What is it used for?
  3. Core concepts
  4. Dependencies
  5. node-opcua
  6. A teaching point: migration, not a rebuild
  7. Sources

Using NodeSets in node-opcua in Practice

  1. Learning goal
  2. The nodesets map
  3. A loading recipe (checklist)
  4. Pattern A - find a type and subtype it
  5. Pattern B - an instance in DeviceSet / Machines
  6. Pattern C - TypeScript bindings
  7. Pattern D - a client against a Companion Spec server
  8. Dependency graph (simplified)
  9. Example script in this book
  10. Conformance and reality
  11. Sources

Appendix A: Leanpub and Markua Notes

  1. Folder structure of this manuscript
  2. Markua conventions used in this book
  3. Publishing
  4. Release texts for the Leanpub book page

Appendix B: Glossary

Appendix C: Resources

  1. node-opcua
  2. OPC Foundation
  3. Leanpub / Markua
  4. A companion book

Appendix D: Bibliography of Companion Specs

  1. node-opcua primary sources
  2. Legal note (on teaching)

Get the free sample chapters

Click the buttons to get the free sample in PDF or EPUB, or read the sample online here

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $15 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub