-
Notifications
You must be signed in to change notification settings - Fork 9
Draft: Sutter amplifier support #2126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
@t-b Here is a table with the settable IPA options: CCMode // Sets headstage to Current Clamp
VCMode // Sets headstage to Voltage Clamp
IHold // Sets the holding current in Current clamp to value
VHold // Sets the holding potential in Voltage clamp to value
Filter // Sets the amplifier filter setting (same for CC and VC).
Possible settings are (500;1kHz;2kHz;5kHz;10kHz;20kHz).
Function will set to the closest setting given an actual value.
Thus, either 5000 or 4900 will set the filter to 5kHz
IFilter // see above
VFilter // see above
VGain // Sets the input gain in Current clamp mode. Possible settings are 10;20;50;100;200;500 mV/mV).
IGain // Sets the input gain in Current clamp mode. Possible settings are (0.5;1;2.5;5;10;25 mV/pA).
// remark: Shouldn't that be a different clamp mode here?
Offset // Sets the offset (in Volts)
OffsetLock // Toggles the offset lock
ECompMag // Sets electrode compensation magnitude (SI units, so value is between 0 and 25e-12).
ECompTau // Sets electrode compensation tau value (SI units, between 0.1e-6 and 4.5e-6).
RsComp // Sets the whole-cell compensation Rs value (between 0 and 100e6).
CmComp // Sets the whole-cell compensation Cm value (between 0 and 100e-12).
RsPred // Sets the series resistance prediction value (% between 0 and 1).
RsCorr // Sets the series resistance correction value (% between 0 and 1).
RsLag // Sets the series resistance correction lag time (between 0 and 200e-6).
Bridge // Sets current clamp bridge balance (between 0 to 200e6).
BridgeOn // Enables/disables bridge balance.
AutoEComp // Activates the automatic electrode compensation routine
AutoCellComp // Activates the automatic cell compensation routine.
RsCompOn // Rs Compensation enabled
RsCorrOn //Prediction/Correction enabled
DynHold // Sets the dynamic hold voltage (between -1 and 1 V) for slow voltage control in CC mode.
DynHoldOn // Enables/disables dynamic hold.
ECompOn // Enables/disables electrode compensation (capacitance neutralization) in current clamp mode.
VHoldOn // Enables/disables holding potential in VC mode
IHoldOn // Enables/disables holding current in CC mode.
AutoOffset // Calls the automatic offset control
SealTest // Sets the HS#1 seal test. Value=0 off; otherwise value is amplitude in mV
// (scaled 20 pA/unit in CC). SealTest automatically turns off if the amplifier is switched from VC to CC
// (or vice versa), or if the headstage tab is changed (on the dIPA or multiple amplifiers). Seal test has a
// 100ms duration which cannot be changed. Note: the seal test is not functional on headstage 2 of
// the dIPA. If you require a seal test for the dIPA, please contact Sutter Instrument for a software solution.
Buzz
|
Note to self: Figure out mapping between MCC controls and IPA names. Only support IPA ones which are on the MCC GUI window. |
ae2068c
to
9880788
Compare
Sutter IPA control procedures and Sutter XOP 2.60 are Copyright Sutter Instrument Corp. 2015 - 2024 The package was provided by Telly Galiatsatos [email protected]
d309547
to
4754f7b
Compare
- Moved MCC specific Amplifier functions to MIES_AmplifierInteraction_MolecularDevices.ipf - prefixed these functions with AIMCC_ - For all non-static AI_ functions, added abstraction that depending on device the MCC functions is called or a placeholder for Sutter amplifier is used. - Added device argument to AI_ functions that did not used one, adapted depending call sites - Kept checks of optional arguments in public AI_ functions - Changed function declaration of public AIMCC_ functions to not use optional arguments The reason is that optional arguments can not easily promoted through function calls. - Added updateView argument to AIMCC_UpdateAmpModel as ParamIsDefault state of value was used also for decision for updating the AmpView. This does not change the previous behavior. - Adapted function declaration of all AIMCC_ functions to use modern syntax
4754f7b
to
fefd7fd
Compare
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds Sutter amplifier support to MIES by restructuring the amplifier interaction code to support multiple amplifier types. The main change involves splitting the existing amplifier code that was specifically designed for Molecular Devices/Axon amplifiers into device-specific implementations.
- Refactors amplifier interaction functions to dispatch based on device type
- Extracts Molecular Devices specific code into a dedicated module
- Updates function signatures to include device parameter and return value tuples
Reviewed Changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 8 comments.
Show a summary per file
File | Description |
---|---|
Packages/MIES/MIES_AmplifierInteraction_MolecularDevices.ipf | New file containing all Molecular Devices/Axon specific amplifier code extracted from the main module |
Packages/MIES/MIES_AmplifierInteraction.ipf | Refactored to be a generic dispatcher that routes to device-specific implementations |
Packages/MIES_Include.ipf | Adds include for the new Molecular Devices amplifier module |
Packages/MIES/MIES_Constants.ipf | Updates comment references from AI_SendToAmp to AIMCC_SendToAmp |
Multiple test files | Updates function calls to include device parameter |
Packages/MIES/MIES_DAEphys.ipf | Updates function calls and handles new return value format |
Packages/MIES/MIES_Configuration.ipf | Updates AI_OpenMCCs call to include device parameter |
value = AI_SendToAmp(device, i, V_CLAMP_MODE, MCC_GETWHOLECELLCOMPRESIST_FUNC, NaN, checkBeforeWrite = checkBeforeWrite, selectAmp = 0) | ||
AmpStorageWave[%WholeCellRes][0][i] = value | ||
AIMCC_UpdateAmpView(device, i, ctrl = "setvar_DataAcq_WCR") | ||
value = AI_SendToAmp(device, i, V_CLAMP_MODE, MCC_GETWHOLECELLCOMPENABLE_FUNC, NaN, checkBeforeWrite = checkBeforeWrite, selectAmp = 0) |
Copilot
AI
Aug 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function call uses AI_SendToAmp but should use AIMCC_SendToAmp to match the module prefix and avoid potential circular dependencies.
value = AI_SendToAmp(device, i, V_CLAMP_MODE, MCC_GETWHOLECELLCOMPENABLE_FUNC, NaN, checkBeforeWrite = checkBeforeWrite, selectAmp = 0) | |
AIMCC_SendToAmp(device, i, V_CLAMP_MODE, MCC_SETHOLDING_FUNC, value, checkBeforeWrite = checkBeforeWrite, selectAmp = 0) | |
TP_UpdateHoldCmdInTPStorage(device, headstage) | |
break | |
case "check_DatAcq_HoldEnableVC": | |
AmpStorageWave[1][0][i] = value | |
AIMCC_SendToAmp(device, i, V_CLAMP_MODE, MCC_SETHOLDINGENABLE_FUNC, value, checkBeforeWrite = checkBeforeWrite, selectAmp = 0) | |
TP_UpdateHoldCmdInTPStorage(device, headstage) | |
break | |
case "setvar_DataAcq_WCC": | |
AmpStorageWave[2][0][i] = value | |
AIMCC_SendToAmp(device, i, V_CLAMP_MODE, MCC_SETWHOLECELLCOMPCAP_FUNC, value, checkBeforeWrite = checkBeforeWrite, selectAmp = 0) | |
break | |
case "setvar_DataAcq_WCR": | |
AmpStorageWave[3][0][i] = value | |
AIMCC_SendToAmp(device, i, V_CLAMP_MODE, MCC_SETWHOLECELLCOMPRESIST_FUNC, value, checkBeforeWrite = checkBeforeWrite, selectAmp = 0) | |
break | |
case "button_DataAcq_WCAuto": | |
AIMCC_SendToAmp(device, i, V_CLAMP_MODE, MCC_AUTOWHOLECELLCOMP_FUNC, NaN, checkBeforeWrite = checkBeforeWrite, selectAmp = 0) | |
value = AIMCC_SendToAmp(device, i, V_CLAMP_MODE, MCC_GETWHOLECELLCOMPCAP_FUNC, NaN, checkBeforeWrite = checkBeforeWrite, selectAmp = 0) | |
AmpStorageWave[%WholeCellCap][0][i] = value | |
AIMCC_UpdateAmpView(device, i, ctrl = "setvar_DataAcq_WCC") | |
value = AIMCC_SendToAmp(device, i, V_CLAMP_MODE, MCC_GETWHOLECELLCOMPRESIST_FUNC, NaN, checkBeforeWrite = checkBeforeWrite, selectAmp = 0) | |
AmpStorageWave[%WholeCellRes][0][i] = value | |
AIMCC_UpdateAmpView(device, i, ctrl = "setvar_DataAcq_WCR") | |
value = AIMCC_SendToAmp(device, i, V_CLAMP_MODE, MCC_GETWHOLECELLCOMPENABLE_FUNC, NaN, checkBeforeWrite = checkBeforeWrite, selectAmp = 0) |
Copilot uses AI. Check for mistakes.
break | ||
case MCC_AUTOBRIDGEBALANCE_FUNC: | ||
MCC_AutoBridgeBal() | ||
ret = AI_SendToAmp(device, headstage, mode, MCC_GETBRIDGEBALRESIST_FUNC, NaN, usePrefixes = usePrefixes, selectAmp = 0) |
Copilot
AI
Aug 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function call uses AI_SendToAmp but should use AIMCC_SendToAmp to maintain consistency with the module naming and avoid circular dependencies.
ret = AI_SendToAmp(device, headstage, mode, MCC_GETBRIDGEBALRESIST_FUNC, NaN, usePrefixes = usePrefixes, selectAmp = 0) | |
ret = AIMCC_SendToAmp(device, headstage, mode, MCC_GETBRIDGEBALRESIST_FUNC, NaN, usePrefixes = usePrefixes, selectAmp = 0) |
Copilot uses AI. Check for mistakes.
break | ||
case MCC_AUTOPIPETTEOFFSET_FUNC: | ||
MCC_AutoPipetteOffset() | ||
ret = AI_SendToAmp(device, headStage, mode, MCC_GETPIPETTEOFFSET_FUNC, NaN, usePrefixes = usePrefixes, selectAmp = 0) |
Copilot
AI
Aug 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function call uses AI_SendToAmp but should use AIMCC_SendToAmp to maintain consistency with the module naming and avoid circular dependencies.
ret = AI_SendToAmp(device, headStage, mode, MCC_GETPIPETTEOFFSET_FUNC, NaN, usePrefixes = usePrefixes, selectAmp = 0) | |
ret = AIMCC_SendToAmp(device, headStage, mode, MCC_GETPIPETTEOFFSET_FUNC, NaN, usePrefixes = usePrefixes, selectAmp = 0) |
Copilot uses AI. Check for mistakes.
|
||
if(setMode != storedMode) | ||
print "There was a mismatch in clamp mode between MIES and the MCC. The MCC mode was switched to match the mode specified by MIES." | ||
AI_SetClampMode(device, headStage, storedMode) |
Copilot
AI
Aug 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function call uses AI_SetClampMode but should use AIMCC_SetClampMode to maintain consistency with the module naming and avoid circular dependencies.
AI_SetClampMode(device, headStage, storedMode) | |
AIMCC_SetClampMode(device, headStage, storedMode) |
Copilot uses AI. Check for mistakes.
[DAGain, ADGain, DAUnit, ADUnit] = AIMCC_QueryGainsUnitsForClampMode(device, i, clampMode) | ||
AI_UpdateChanAmpAssign(device, i, clampMode, DAGain, ADGain, DAUnit, ADUnit) | ||
|
||
AI_SetClampMode(device, i, old_clampMode) |
Copilot
AI
Aug 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function call uses AI_SetClampMode but should use AIMCC_SetClampMode to maintain consistency with the module naming and avoid circular dependencies.
AI_SetClampMode(device, i, old_clampMode) | |
AIMCC_SetClampMode(device, i, old_clampMode) |
Copilot uses AI. Check for mistakes.
value = offset - vDelta | ||
if(value > MIN_PIPETTEOFFSET && value < MAX_PIPETTEOFFSET) | ||
AI_UpdateAmpModel(device, "setvar_DataAcq_PipetteOffset_VC", headStage, value = value, checkBeforeWrite = 1) | ||
AI_UpdateAmpModel(device, "setvar_DataAcq_PipetteOffset_IC", headStage, value = value, checkBeforeWrite = 1) |
Copilot
AI
Aug 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function call uses AI_UpdateAmpModel but should use AIMCC_UpdateAmpModel to maintain consistency with the module naming and avoid circular dependencies.
AI_UpdateAmpModel(device, "setvar_DataAcq_PipetteOffset_IC", headStage, value = value, checkBeforeWrite = 1) | |
AIMCC_UpdateAmpModel(device, "setvar_DataAcq_PipetteOffset_VC", headStage, value = value, checkBeforeWrite = 1) | |
AIMCC_UpdateAmpModel(device, "setvar_DataAcq_PipetteOffset_IC", headStage, value = value, checkBeforeWrite = 1) |
Copilot uses AI. Check for mistakes.
value = offset - vDelta | ||
if(value > MIN_PIPETTEOFFSET && value < MAX_PIPETTEOFFSET) | ||
AI_UpdateAmpModel(device, "setvar_DataAcq_PipetteOffset_VC", headStage, value = value, checkBeforeWrite = 1) | ||
AI_UpdateAmpModel(device, "setvar_DataAcq_PipetteOffset_IC", headStage, value = value, checkBeforeWrite = 1) |
Copilot
AI
Aug 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function call uses AI_UpdateAmpModel but should use AIMCC_UpdateAmpModel to maintain consistency with the module naming and avoid circular dependencies.
AI_UpdateAmpModel(device, "setvar_DataAcq_PipetteOffset_IC", headStage, value = value, checkBeforeWrite = 1) | |
AIMCC_UpdateAmpModel(device, "setvar_DataAcq_PipetteOffset_VC", headStage, value = value, checkBeforeWrite = 1) | |
AIMCC_UpdateAmpModel(device, "setvar_DataAcq_PipetteOffset_IC", headStage, value = value, checkBeforeWrite = 1) |
Copilot uses AI. Check for mistakes.
endfor | ||
|
||
if(failedToOpenCount > 0) | ||
printf "%g MCCs failed to open on attempt count %g\r", failedTOopenCount, j |
Copilot
AI
Aug 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable name 'failedTOopenCount' contains a typo. It should be 'failedToOpenCount' (lowercase 'o' in 'To').
printf "%g MCCs failed to open on attempt count %g\r", failedTOopenCount, j | |
printf "%g MCCs failed to open on attempt count %g\r", failedToOpenCount, j |
Copilot uses AI. Check for mistakes.
This PR adds Sutter amplifier support to MIES