Skip to content

Conversation

@MichaelHuth
Copy link
Collaborator

close #2547

this was previously done directly in the GUI event handler
@MichaelHuth MichaelHuth self-assigned this Oct 30, 2025
@MichaelHuth MichaelHuth added FFI Foreign Function Interface PatchLink labels Oct 30, 2025
@t-b
Copy link
Collaborator

t-b commented Oct 30, 2025

Let's do your usual appraoch here where Luke/Tim can test the FFI functions before we write the tests.

@MichaelHuth MichaelHuth force-pushed the feature/2559-mh_add_ffi_clamp_control branch from b0dcd0b to 2f8e923 Compare October 30, 2025 19:19
In MIES the range is limited through the corresponding GUi element.
However, when changed externally through a ZeroMQ function call then
the range was not checked.
Added the following functions:

FFI_GetClampState
returns a wave with the current clamp control values

FFI_SetClampMode

FFI_SetHoldingPotential
- allowed only in VC mode

FFI_SetBiasCurrent
- allowed only in IC mode

FFI_SetAutoBias
- allowed only in IC mode

FFI_SetHeadstageActive
- allowed only when no DAQ is running

FFI_TriggerAutoClampControl
- wraps Pipette, Capacitance and Bridge Balance auto setting in a single call
@MichaelHuth MichaelHuth force-pushed the feature/2559-mh_add_ffi_clamp_control branch from 2f8e923 to d5bf06c Compare October 30, 2025 19:23
@MichaelHuth
Copy link
Collaborator Author

If the current clamp mode for the headstage in MIES is different from the specific calmp mode of an amplifier setting (e.g. auto bridge balance that applies only to IC) then it is ignored by MIES.

@campagnola
Copy link
Member

I gave this a try today:

  • I need a way to get the state of the clamp for any mode, not just the currently active mode. I suggest always returning all fields for both modes regardless of the current clamp mode (much simpler, but is there a cost to assembling these structures?). Alternatively, add a mode argument to FFI_GetClampState that can optionally be -1 to request the current mode.
  • missing GetHeadstageActive (or is there another way to get this?)
  • missing SetHoldingPotentialEnable and SetBiasCurrentEnable

@campagnola
Copy link
Member

If the current clamp mode for the headstage in MIES is different from the specific calmp mode of an amplifier setting (e.g. auto bridge balance that applies only to IC) then it is ignored by MIES.

That makes sense for any of the TriggerAuto* functions, but all other parameters I would expect to be settable even when the mode is not active (for example, I should be able to set the auto bias parameters before switching to IC)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FFI Foreign Function Interface PatchLink

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FFI for clamp control

4 participants