While writing the Owon OWH9811 definition (SCPIx driver) I found a timing issue when a multi-query #scpiCmd is used inside #askValues.
Setup:
#scpiCmd readHarmList :HARM:LIST:VAL? VOLT;:HARM:LIST:VAL? CURR
#askValues [mode:Harmonic_List]readHarmList;[mode:Harmonic,Harmonic_List]:MEAS:VOLT:THD?;[mode:Harmonic,Harmonic_List]:MEAS:CURR:THD?
Expected: 32 values (2 x 15 list values + 2 THD).
Actual: the result of each item is handed over one step late. The log shows:
- after the VOLT:THD? query: Rx <list values> (result of readHarmList)
- after the CURR:THD? query: Rx <2.897> (the VOLT:THD result)
- then "Rx as numbers" with only 31 values
- the CURR:THD reply (2.529) appears after the read is finished and is lost.
When the #scpiCmd is the last item in #askValues, the result is "Rx as numbers <No data (timeout?)>", although the replies are complete in the log.
Workaround: putting the queries directly in #askValues instead of a #scpiCmd works correctly, all 32 values in the right columns.
TC version: 3.56
29404.67ms OWH9811: Tx <readHarmList>
29405.20ms OWH9811: Tx <:HARM:LIST:VAL? VOLT;:HARM:LIST:VAL? CURR>
29406.79ms COM8: Tx: <:HARM:LIST:VAL? VOLT.>
29447.45ms COM8: Rx: <13.011, 0.001, 0.177, 0.004, 0.104, 0.001, 0.260, 0.001, 0.126, 0.003, 0.046, 0.004, 0.081, 0.004, 0.035, >
29451.71ms COM8: Tx: <:HARM:LIST:VAL? CURR.>
29476.42ms COM8: Rx: <0.086, 0.000, 0.001, 0.000, 0.001, 0.000, 0.002, 0.000, 0.001, 0.000, 0.000, 0.000, 0.001, 0.000, 0.000, >
29477.42ms OWH9811: Tx <:MEAS:VOLT:THD?>
29479.62ms COM8: Tx: <:MEAS:VOLT:THD?.>
29508.22ms COM8: Rx: <2.897>
29508.62ms OWH9811: Rx <13.011 0.001 0.177 0.004 0.104 0.001 0.260 0.001 0.126 0.003 0.046 0.004 0.081 0.004 0.035 0.086 0.000 0.001 0.000 0.001 0.000 0.002 0.000 0.001 0.000 0.000 0.000 0.001 0.000 0.000 >
29509.13ms OWH9811: Tx <:MEAS:CURR:THD?>
29512.25ms COM8: Tx: <:MEAS:CURR:THD?.>
29524.17ms COM8: Rx: <2.529>
29524.65ms OWH9811: Rx <2.897>
29525.46ms OWH9811: Rx as numbers <13.011 0.001 0.177 0.004 0.104 0.001 0.26 0.001 0.126 0.003 0.046 0.004 0.081 0.004 0.035 0.086 0.0 0.001 0.0 0.001 0.0 0.002 0.0 0.001 0.0 0.0 0.0 0.001 0.0 0.0 2.897>
2.529