Skip to content

Revision-aware catalog resolution + Rockwell-mined catalog data - #59

Closed
colinlove wants to merge 2 commits into
hutcheb:mainfrom
colinlove:feat/rockwell-catalog-revision-aware
Closed

colinlove wants to merge 2 commits into
hutcheb:mainfrom
colinlove:feat/rockwell-catalog-revision-aware

Conversation

@colinlove

Copy link
Copy Markdown
Contributor

Problem

catalog_number_for_identity() resolves a module's catalog number purely from its (vendor, product_type, product_code) CIP identity triple. That triple does not encode the hardware "series" letter (/A, /B, ...) — Rockwell doesn't allocate a new product code for a new series, it ties the series to a firmware-major-revision breakpoint instead, and that breakpoint differs per catalog family.

This means the current one-triple-to-one-name table is provably wrong whenever a single triple has shipped as more than one series. Confirmed against a fleet of 3,092 real ACD files with L5X ground truth: 5069-OB16/A vs /B, 1734-IB8S/A vs /B, 1734-OB8S/A vs /B, 1769-SDN/A vs /B, and 1734-AENTR/A vs /C all collide on their triple.

Fix

  • catalog_number_for_identity() gains an optional major_rev= parameter. When given, it's tried as a (v, t, c, major_rev) key before falling back to the plain (v, t, c) key, then the CIP-... placeholder. Omitting it reproduces the exact old behavior — fully backward compatible.
  • load_external_catalog() / merge_catalog() now accept a 4th colon/array key component (the major revision) alongside the existing 3-part form.
  • ModuleBuilder.build() passes major_rev=major — the firmware major byte it already parses from the extended module record — through to the resolver, so every module benefits automatically with no other call-site changes (ProcessorType derivation downstream just reuses Module.catalog_number).

Data

resources/external_catalog.rockwell_logix_designer.json: 1,665 base + 1,054 revision-specific entries, mined directly from a locally-installed Logix Designer's own catalog data — not reverse-engineered from customer L5X files:

  • modern per-catalog-number AOP XML (RSLogix 5000\Module Profiles\**\*.xml)
  • legacy monolithic "Classic" XML (RSLogix 5000\ENU\v20\Bin\*.xml), kept by the installer for opening pre-v21 projects, which also covers some controller/older identities the modern tree no longer lists separately

Cross-checked against 136 tuples verified from real ACD/L5X ground-truth pairs with no disagreements once series-suffix placement is normalized (Designer's own <CatalogNumber> tag is the bare name; the series lives in a separate <Variant MajorRev="N"><Series> block, which is exactly what the *:major_rev entries capture).

Testing

Added pure-function unit tests to test_catalog_numbers.py (major_rev resolution order, fallback when the specific revision is unknown, zero-identity unaffected) and test_catalog_external.py (4-part key loading, and a test that loads the bundled Rockwell resource file and resolves the worked 5069-OB16/A vs /B example end-to-end). Full suite: 137 passed, 2 skipped (path-relative, expected outside test/), 7 pre-existing errors in test_database.py/test_unzip.py confirmed unrelated (they fail identically on unmodified main).

🤖 Generated with Claude Code

colinlove and others added 2 commits September 18, 2026 10:27
The (vendor, product_type, product_code) CIP identity triple does not
encode a module's hardware "series" letter (/A, /B, ...) -- Rockwell
ties the series to a firmware-major-revision breakpoint instead, and
that breakpoint differs per catalog family. catalog_number_for_identity()
could therefore only ever resolve one name per triple, which is wrong
whenever the same triple has shipped as more than one series (verified
fleet-wide: 5069-OB16/A vs /B, 1734-IB8S/A vs /B, 1734-OB8S/A vs /B,
1769-SDN/A vs /B, 1734-AENTR/A vs /C all collide on their triple).

- catalog_number_for_identity() gains an optional major_rev= parameter;
  when given, it is tried as a (v, t, c, major_rev) key before falling
  back to the plain (v, t, c) key, so a revision-aware table resolves
  the exact series while an old plain table keeps working unchanged.
- load_external_catalog()/merge_catalog() now accept a 4th colon/array
  key component (the major revision) alongside the existing 3-part form.
- ModuleBuilder.build() passes major_rev=major (the firmware major byte
  it already parses from the extended module record) through to
  catalog_number_for_identity(), so every module benefits automatically.
- resources/external_catalog.rockwell_logix_designer.json: 1,665 base
  + 1,054 revision-specific CIP-identity -> catalog-number entries,
  mined directly from a locally-installed Logix Designer's own catalog
  data (RSLogix 5000\Module Profiles\**\*.xml, the modern per-catalog
  AOP format, merged with RSLogix 5000\ENU\v20\Bin\*.xml, the legacy
  monolithic "Classic" format kept for pre-v21 project compatibility) --
  not reverse-engineered from customer L5X files. Cross-checked against
  136 tuples verified from real ACD/L5X ground-truth pairs with no
  disagreements once series-suffix placement is normalized.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The ModuleBuilder.build() change is a one-line pass-through
(major_rev=major); the resolution logic it depends on is already
exhaustively covered by the pure-function tests in test_catalog_numbers.py
and test_catalog_external.py. Building a synthetic binary module record
just to re-prove that same logic through a real ModuleBuilder added
more test-maintenance weight than the one-line change warranted.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@hutcheb

hutcheb commented Sep 28, 2026

Copy link
Copy Markdown
Owner

@colinlove, Thanks for the PR, however, I don't think that I will be able to merge it as it has used copyrighted material to produce it.

I will get through the rest of the PRs when I have time.

@hutcheb hutcheb closed this Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants