Phase 3 PR 59 -- MelsecAddress helper with family selector (hex vs octal X/Y) #58
Reference in New Issue
Block a user
Delete Branch "phase-3-pr59-melsec-address-helper"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Adds
MelsecAddressstatic helper +MelsecFamilyenum{Q_L_iQR, F_iQF}.The headline MELSEC trap:
X20on a Q-series PLC means DI 32 (hex0x20), but on an FX3U it means DI 16 (octal0o20). Same string, different value — the #1 MELSEC driver bug source. The helper forces the caller to name the family per tag; no sensible default.Helpers:
XInputToDiscrete(x, family, xBankBase=0)— hex on Q/L/iQ-R, octal on FX/iQ-FYOutputToCoil(y, family, yBankBase=0)— same ruleMRelayToCoil(m, mBankBase=0)— decimal on all familiesDRegisterToHolding(d, dBankBase=0)— decimal on all familiesBank-base argument handles per-site Modbus Device Assignment offsets (QJ71MT91 default places X at DI 8192+, etc.).
Validation
X20→ 32 vs 16), non-hex/non-octal rejection, bank-base adjustment, overflow guards