Files
Joseph Doherty 32f26272ae Initial commit: Wonderware / System Platform tools and reference
Five tools under one repo, all docs organized per DOCS-GUIDE.md:

- aalogcli: .NET 4.8 / x86 CliFx CLI for reading System Platform binary
  logs (*.aaLGX) for LLM debugging, built on aaOpenSource/aaLog. Commands:
  last, tail, range, unread, fields. Stable JSON envelope under --llm-json.
  Build template under lib/build/ for rebuilding aaLogReader.dll.

- aot: ArchestrA Object Toolkit 2014 v4.0 reference material. Dev guide
  (Markdown converted from CHM), API reference for the ArchestrA.Toolkit
  namespace, and the Monitor / Watchdog VS sample solutions.

- graccesscli: .NET 4.8 / x86 CliFx CLI that automates Galaxy
  configuration via the ArchestrA GRAccess COM interop. Includes session
  daemon, IPC protocol, and llm-json envelope contract.

- grdb: SQL/DDL exploration of the Galaxy Repository database. DDL
  captures, reusable queries, hierarchy / contained-name <-> tag-name
  translation notes.

- histdb: LLM-oriented reference for AVEVA Historian retrieval. INSQL
  linked-server, extension tables, every wwXxx time-domain extension,
  every retrieval mode, alarm/event SQL recipes, REST API. Distilled
  from the 243-page Historian Retrieval Guide.

Root contains:
- CLAUDE.md: thin index pointing into each tool's README.
- DOCS-GUIDE.md: doctrine for organizing docs for LLM consumption.

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

53 lines
3.4 KiB
Markdown

# grdb
SQL exploration of the AVEVA / Wonderware System Platform **Galaxy Repository** database, used to extract the Galaxy area / object hierarchy and translate contained-names ↔ tag-names for an OPC UA server.
## Hard constraints
- Requires SQL Server access to the Galaxy Repository DB (default: `localhost`, database `ZB`, Windows Auth). See [`connectioninfo.md`](connectioninfo.md) for the `sqlcmd` invocation.
- **Development verification / debugging only.** Production read/write paths must go through GRAccess COM via [`../graccesscli/`](../graccesscli/README.md), not direct SQL against this DB.
- The `contained_name``tag_name` distinction is critical and asymmetric:
- Hierarchy browsing uses `contained_name` (e.g. `TestMachine_001.DelmiaReceiver`).
- Runtime read/write uses the system-assigned `tag_name` (e.g. `DelmiaReceiver_001`).
- Translation is mandatory when going from a hierarchy path to a tag reference. See [`layout.md`](layout.md).
## Layout
```text
grdb/
CLAUDE.md # agent guide: purpose, key tables, conventions
connectioninfo.md # DB connection details and sqlcmd usage
schema.md # full schema reference for ZB tables and views
data_type_mapping.md # mx_data_type → OPC UA DataType, ValueRank, ArrayDimensions
layout.md # hierarchy model, contained_name vs tag_name, target OPC UA shape
build_layout_plan.md # step-by-step plan: hierarchy → attributes → change detection
queries/ # reusable SQL (hierarchy, attributes, change detection)
ddl/ # captured CREATE TABLE / view definitions (tables/, views/)
parse_tables.py # Python helper for parsing captured table definitions
hierarchy.jpeg # visual reference: Galaxy area/object hierarchy
tags.JPG # visual reference: tag-name view
```
## Resource index
| Task | Go to |
| --- | --- |
| Agent guide: purpose, key tables, conventions | [`CLAUDE.md`](CLAUDE.md) |
| Connect to the Galaxy DB / `sqlcmd` usage | [`connectioninfo.md`](connectioninfo.md) |
| Full table / view schema reference | [`schema.md`](schema.md) |
| `mx_data_type` → OPC UA DataType, array handling | [`data_type_mapping.md`](data_type_mapping.md) |
| Hierarchy model + contained-name ↔ tag-name translation | [`layout.md`](layout.md) |
| Step-by-step extraction plan (hierarchy → attributes → polling) | [`build_layout_plan.md`](build_layout_plan.md) |
| Deployed object hierarchy with browse names and parents | [`queries/hierarchy.sql`](queries/hierarchy.sql) |
| User-defined (dynamic) attributes with types / array dims | [`queries/attributes.sql`](queries/attributes.sql) |
| All attributes (system + user-defined) with types / array dims | [`queries/attributes_extended.sql`](queries/attributes_extended.sql) |
| Detect deployment changes via `galaxy.time_of_last_deploy` | [`queries/change_detection.sql`](queries/change_detection.sql) |
| Captured DDL — tables | [`ddl/tables/`](ddl/tables) |
| Captured DDL — views | [`ddl/views/`](ddl/views) |
| Parse captured table DDL programmatically | [`parse_tables.py`](parse_tables.py) |
| Hierarchy / tag visual references | [`hierarchy.jpeg`](hierarchy.jpeg), [`tags.JPG`](tags.JPG) |
## Maintenance
Documentation rules live in [`../DOCS-GUIDE.md`](../DOCS-GUIDE.md); the root task → tool index lives in [`../CLAUDE.md`](../CLAUDE.md). When adding, renaming, or removing any doc, query, or DDL file in this folder, update the resource index above in the same change.