@wago/plcprog-ipc-client
v0.1.4
Published
Direct shared-memory IPC client for PLCProg managed Node.js scripts
Keywords
Readme
PLCProg IPC Client for Node.js
Direct Linux shared-memory IPC client for PLCProg-managed Node.js scripts. The
controller supplies PLCPROG_IPC_DIRECTORY, PLCPROG_INSTANCE_UUID, and
PLCPROG_IPC_ROUTES_FILE automatically.
The client opens the versioned file-backed ring directly, coordinates access
with POSIX flock, and uses Unix datagrams only as wake notifications. It does
not connect through REST or WebSocket. Controller, data, and workspace targets
are discovered from routes.json. IPC transport v2 stores messages larger than
one ring slot in the bounded <ringPath>.blobs arena.
npm install @wago/plcprog-ipc-clientimport {PlcprogIpcClient} from "@wago/plcprog-ipc-client";
const client = await new PlcprogIpcClient().connect();
console.log(await client.dataGetValue("Virtual.store.light"));
client.close();Run npm install && npm test for contract tests. The examples/ tree contains
one managed-script example for every one of the 32 request, error, and pushed
message scenarios; python3 examples/check_manifest.py verifies that coverage.
Linux flock and Unix datagram support are provided by the fs-ext and
unix-dgram dependencies.
After npm install, run a focused package-import example with
node examples/base/ping.js.
Inside a PLCProg-managed process, the following examples establish a real IPC
subscription and log the initial response and every incoming update
continuously. Stop them with Ctrl+C:
A DataUpdate may contain payload.error instead of payload.body while its
adapter is offline. PLCProg retains and automatically renews the subscription.
node examples/instances/instance-subscribe.js
node examples/data/data-register-value.jsTrigger an instance state change for InstanceUpdate, or write
PLCPROG_DATA_PATH for DataUpdate.
