Files
wwtools/CLAUDE.md
T
Joseph Doherty ab202a1fa1 mxaccesscli: read/write/subscribe System Platform tags via MxAccess
New tool wrapping ArchestrA.MxAccess.LMXProxyServerClass (the same COM
proxy aaObjectViewer / WindowViewer use) as a CliFx CLI for LLM-driven
debugging.

Commands:
- mxa info      — loaded MxAccess assembly identity, supported value
                   types, MxStatusCategory enum.
- mxa read      — fetch one or more tag values; subscribes briefly,
                   captures first OnDataChange per tag, tears down.
- mxa write     — write a value with optional --type coercion; advises
                   first to resolve the attribute type, then waits for
                   OnWriteComplete with a per-call timeout.
- mxa subscribe — stream OnDataChange events for --seconds; JSON Lines
                   under --llm-json for piped agent consumption.
- mxa diag      — minimal smoke test on a private STA thread; bypasses
                   the CliFx pipeline for diagnosing apartment / pump
                   issues.

Implementation notes documented in docs/api-notes.md (reverse-engineered
because AVEVA does not publish a single canonical MxAccess reference):

- Net48 / x86 / [STAThread] are non-negotiable. The CLI runs the entire
  CliFx pipeline on a dedicated STA thread.
- COM events are dispatched as Win32 messages; AutoResetEvent.WaitOne
  alone does not pump them on this configuration. MxSession.WaitForUpdate
  loops Application.DoEvents() + drain + Sleep(20ms) instead.
- Write requires the target attribute's type to be resolved first.
  WriteCommand advises and waits for the initial OnDataChange before
  calling LMXProxyServerClass.Write to avoid ArgumentException
  "Value does not fall within the expected range".
- Errors carry the full MXSTATUS_PROXY[] from MxAccess (Success,
  Category, DetectedBy, Detail) so an agent can tell exactly which
  layer rejected a request.

Verified against the live ZB galaxy with a writeable tag identified
via grdb (TestChildObject.TestInt, mx_attribute_category=10):
  read:      99 (q=192, MxCategoryOk)
  write 7:   round-tripped — read returned 7 — written back to 99
  write str: TestChildObject.TestString round-tripped a timestamp
  subscribe: captured initial value plus subsequent change from a
             separate process

The vendored ArchestrA.MxAccess.dll is gitignored — it is copied from
C:\Program Files (x86)\ArchestrA\Framework\Bin\ on any System Platform
install per the README.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 20:02:51 -04:00

3.8 KiB

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

What this repo is

A personal collection of reference material and tools for working with AVEVA / Wonderware System Platform (formerly Invensys / Wonderware): vendor documentation, sample projects, an active CLI codebase, and a SQL exploration of the Galaxy Repository — pulled together for offline reference and for grounding LLM-assisted work on Wonderware integrations.

How docs are organized

This repo is consumed primarily by LLM coding agents. Documentation follows the rules in DOCS-GUIDE.md — read it before adding or restructuring documentation. The short version:

  • This CLAUDE.md is a thin index: it points to tools, not into them.
  • Each tool has its own README.md at its folder root that introduces the tool and routes into its deep docs.
  • Deep documentation (API references, workflows, incident notes) lives inside each tool folder.

When in doubt about where content belongs, default to pushing it deeper. DOCS-GUIDE.md has the full doctrine and the maintenance rules.

Layout

  • aalogcli/.NET Framework 4.8 / x86 CliFx-based CLI that reads System Platform binary logs (*.aaLGX) for LLM-driven debugging, built on the aaOpenSource/aaLog reader library.
  • aot/ — ArchestrA Object Toolkit 2014 v4.0 reference material (dev guide, API reference, sample VS solutions).
  • graccesscli/.NET Framework 4.8 / x86 CliFx-based CLI for automating Galaxy configuration through the ArchestrA GRAccess COM interop.
  • grdb/ — SQL/DDL exploration of the Galaxy Repository SQL database (queries, schema, hierarchy/tag-name translation).
  • histdb/ — LLM-oriented reference for AVEVA Historian retrieval (extension tables, wwXxx time-domain extensions, retrieval modes/options, alarm-event SQL, REST API). Distilled from the official Historian Retrieval Guide.
  • mxaccesscli/.NET Framework 4.8 / x86 CliFx-based CLI for reading, writing, and subscribing to System Platform tags via the MxAccess COM proxy (LMXProxyServerClass).

Tool / resource index

Task Go to
Read System Platform logs (last N records, last N minutes, ranges, incremental) — for LLM debugging aalogcli/README.md
Anything AOT — object/primitive design, attributes, building, debugging, samples, API reference aot/README.md
Automate Galaxy configuration via GRAccess COM (CLI usage, session daemon, mutations, LLM integration) graccesscli/README.md
Galaxy Repository SQL — connect, schema, hierarchy queries, contained-name ↔ tag-name translation grdb/README.md
AVEVA Historian retrieval — SQL via INSQL, wwXxx extensions, retrieval modes/options, alarm/event SQL, REST API histdb/README.md
Read / write / subscribe to System Platform tags via MxAccess (timeouts, error categories, JSON envelope) mxaccesscli/README.md

Maintaining this index

Authoritative rules: DOCS-GUIDE.md. The short version that applies here:

  • A new top-level tool requires a new <tool>/README.md first, then one row in the index above pointing to that README. Do not fan out per-file links at the root.
  • A removed tool deletes its row in the same change.
  • When a tool's internals change, update the tool's own README/deep docs — touch this file only if the task → tool mapping changed.
  • If this file grows past ~150 lines or starts repeating tool-internal facts, refactor downward per DOCS-GUIDE.md.