Summary
Core's idea of which analog channels are enabled is purely what Core itself commanded. It never reads the device's own answer — protobuf field 22, analog_in_port_enabled — so the two can drift, and anything derived from the enabled set is then wrong.
This is scope item 7 of #390, split out because #390 is now closed by #404 and item 7 was deliberately left out of that PR.
Trace (current main, verified after #404 merged)
- No reference to
analog_in_port_enabled / AnalogInPortEnabled anywhere outside the generated protobuf class.
- Channels are always constructed disabled —
DaqifiDevice.cs:1905 and :1988 both set IsEnabled = false.
- So
IsEnabled only ever becomes true because Core set it.
Why it matters
#404 landed the capability document, whose current_max_rate_hz is computed by the device from the device's enabled set. Core caches that value. If Core's enabled view and the device's disagree — a channel enabled by another session, state surviving a reconnect, a partially-applied command — the cached cap is wrong, and Core will either refuse a rate the device would accept or accept one it will reject with SCPI -222.
The drift window is real now in a way it was not before #404: previously the enabled set was only used for Core's own bookkeeping; now a device-computed number depends on it.
Suggested direction
Either:
- Parse field 22 from the status message and use it as the source of truth for
IsEnabled, the way part numbers already drive DeviceCapabilities; or
- Re-read the capability document at every point the enabled set changes, so the cap is never stale relative to the enabled set.
(1) is the cheaper and more direct answer — the data is already arriving in every status frame and is simply being dropped. (2) costs a SCPI round-trip per change.
Worth confirming on the bench that field 22 is actually populated by firmware ≥ v3.5.0 before building on it.
Refs: #390 (scope item 7), #404, #256, ADR 0001, daqifi-desktop#118.
Summary
Core's idea of which analog channels are enabled is purely what Core itself commanded. It never reads the device's own answer — protobuf field 22,
analog_in_port_enabled— so the two can drift, and anything derived from the enabled set is then wrong.This is scope item 7 of #390, split out because #390 is now closed by #404 and item 7 was deliberately left out of that PR.
Trace (current
main, verified after #404 merged)analog_in_port_enabled/AnalogInPortEnabledanywhere outside the generated protobuf class.DaqifiDevice.cs:1905and:1988both setIsEnabled = false.IsEnabledonly ever becomes true because Core set it.Why it matters
#404 landed the capability document, whose
current_max_rate_hzis computed by the device from the device's enabled set. Core caches that value. If Core's enabled view and the device's disagree — a channel enabled by another session, state surviving a reconnect, a partially-applied command — the cached cap is wrong, and Core will either refuse a rate the device would accept or accept one it will reject with SCPI-222.The drift window is real now in a way it was not before #404: previously the enabled set was only used for Core's own bookkeeping; now a device-computed number depends on it.
Suggested direction
Either:
IsEnabled, the way part numbers already driveDeviceCapabilities; or(1) is the cheaper and more direct answer — the data is already arriving in every status frame and is simply being dropped. (2) costs a SCPI round-trip per change.
Worth confirming on the bench that field 22 is actually populated by firmware ≥ v3.5.0 before building on it.
Refs: #390 (scope item 7), #404, #256, ADR 0001, daqifi-desktop#118.