Anyway... shouldn't TC see the secondary modes in #askMode and cause the other #askModeCheck checkboxes to clear? I.e. the ones that don't have [localMode]?
That is correct, TC do not in any way control the checkboxes, that may not be ideal and I probably have to fix it in a future version. There is one issue with two way control: It can get into a loop
The reason is that not all devices changes immediately, but may take up to a few seconds.
When you say "two way control" do you mean the ability to set both primary and secondary measures? Or something else?
It seems this potential issue is there for any device that has multiple channels or simultaneous modes (ie multiple values read.)
Having a secondary set of modes seems pretty common, both in bench meters and multi channel devices.
To make this practical, here's a table of what's allowed for the 8808A. I've also included the (primary mode) modifiers. These of course are common in many bench meters.
Primary Modes
(A simple mutually-exclusive set of modes. I.e. these are the 'radio buttons'
)
VDC, VAC, ADC, AAC, FREQ, OHMS-2wire, OHMS-4wire, DIODE, CONT
(Primary) Modifiers
Three sets: each can have one selected, or none. All have certain exclusions.
REL -- work with all primary except DIODE and CONT
MIN, MAX, MNMX -- work with all primary except DIODE and CONT
DB, DBPOWER -- work with VDC and VAC (DBPOWER is DBm
)
Secondary Modes
(A simple mutually-exclusive set of six modes. I.e. these are the 'radio buttons'
... but some are not available depending on the primary mode.)
VDC2, VAC2, ADC2, AAC2 -- selectable with any primary Volts or Amps
FREQ2 -- selectable with VAC or FREQ
OHMS2 -- selectable with OHMS-2wire and OHMS-4wire
Further info for understanding:
- #AskValues is simply "MEAS?" which returns one or two values
- #AskMode is a little trickier, but not hard: I pass through the primary mode, and append "2" to the secondary mode if it exists.
- Modifiers and (Fixed vs Auto) ranging apply only to the Primary mode; Secondary does something appropriate
FWIW, I am noodling over what it would take to treat the secondary modes as a second channel. The hard part there (maybe) is that there are interactions in terms of what is allowed. Plus, I don't actually see any examples of #askMode being applied in a multi-channel sense.
- Could I format a second incoming mode as "VDC2:2" and have the ":2" treated as channel 2???
- How would channels be defined in mode definitions? Maybe #cmdMode secVDC VDC2:2 (ie on channel 2 (":2"), send string "VDC2" to set this mode)
I'm probably being creatively stupid here LOL