Skip to content

Skip Amplifier Calls During Auto TP Amplitude Update #2692

@timjarsky

Description

@timjarsky

Background

Currently, when Auto TP adjusts the IC amplitude in MIES, it triggers a GUI update path that ultimately causes amplifier interaction calls (via MIES_AmplifierInteraction), even though amplifier reconfiguration is not required for what is essentially a DAC waveform scaling change. This happens because DAP_TPSettingsToGUI invokes control action procedures that lead to a full TP restart, invoking DC_Configure and thus AI_ (amplifier) calls.

Problem

During Auto TP-driven amplitude updates, unnecessary amplifier calls can cause performance overhead or lead to undesired side-effects (e.g. MCC comms load, risk of amplifier glitches). Users may want the option to update the amplitude without re-touching the amplifier config when only the DAC value needs scaling.

Suggestions

Below are three solution approaches, from quick fix to a robust long-term option:

Option 1 — Bypass GUI Action Procedure Chain

At the end of TP_AutoAmplitudeAndBaseline, instead of calling DAP_TPSettingsToGUI, manually:

  • Stop TP (TP_StopTestPulse)
  • Directly set the GUI variable control (e.g. SetVariable SetVar_DataAcq_TPAmplitudeIC, win=$device, value=_NUM:TPSettings[%amplitudeIC][headstage])
  • Call DAG_Update to sync the value
  • Restart TP with fast=1 (TP_RestartTestPulse(device, TPState, fast = 1)).

Option 2 — Add fast Optional Parameter to DAP_TPSettingsToGUI

  • Add [variable fast] to DAP_TPSettingsToGUI
  • Thread through to TP_RestartTestPulse
  • Use this option during Auto TP amplitude updates, so DC_Configure and amplifier calls are bypassed.
  • Must ensure intermediate GUI value updates do not retrigger restarts for each headstage; may require special handling.

Option 3 — Dedicated Internal Helper (Recommended)

  • Implement a small function, e.g. TP_ApplyAutoTPAmplitudeUpdate, that does:
    • Fast TP stop/restart (using fast=1, as above)
    • Directly updates the relevant GUI variable(s) WITHOUT triggering the full action chain
    • No DC_Configure/amplifier/AI_ calls
  • Use this helper from TP_AutoAmplitudeAndBaseline when amplitude is updated due to Auto TP.
  • Keeps the contract clear and the workaround isolated, minimizing future maintenance risk.

Recommendation

Implement Option 3 to keep this logic isolated, clear, and robust. Option 1 is fine for prototypes. Option 2 is sensible if a broader, controlled fast-path API is desired.


Related investigation traced the need for this through the following call chain:

  • Auto TP amplitude update triggers DAP_TPSettingsToGUI (from TP_AutoAmplitudeAndBaseline)
  • Which calls GUI action procedures → DAP_TPGUISettingToWaveTP_RestartTestPulseTPS_StartTestPulseSingleDeviceTP_Setup (fast=0) → DC_ConfigureAI_ (amplifier) interaction
  • Using fast=1 in TP_RestartTestPulse and related setup functions will skip unnecessary amplifier interactions and avoid delays or amplifier disturbances.

References:

CC: @timjarsky

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions