# Persistence of Instrument Configuration when Switching from API to GUI

**URL:** <https://forum.liquidinstruments.com/t/persistence-of-instrument-configuration-when-switching-from-api-to-gui/900>\
**Category:** Software & APIs\
**Created:** [February 20, 2024, 1:06am UTC](https://forum.liquidinstruments.com/t/persistence-of-instrument-configuration-when-switching-from-api-to-gui/900 "2024-02-20T01:06:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jephwack](https://avatars.discourse-cdn.com/v4/letter/j/47e85d/32.png) [@jephwack](https://forum.liquidinstruments.com/u/jephwack)\
**Post date:** [February 20, 2024, 1:06am UTC](https://forum.liquidinstruments.com/t/persistence-of-instrument-configuration-when-switching-from-api-to-gui/900/1 "2024-02-20T01:06:32Z")

</div>

Here is a script which configures a PIDController in MultiInstrument mode

> from moku.instruments import MultiInstrument, PIDController  
> MIM = MultiInstrument(‘XXX.XXX.XXX.XXX’, force\_connect=True, platform\_id=4)  
> PID = MIM.set\_instrument(1, PIDController)  
> connections = [dict(source=“Input1”, destination=“Slot1InA”),  
> dict(source=“Slot1OutA”, destination=“Output1”)]  
> MIM.set\_connections(connections=connections)  
> PID.set\_by\_frequency(channel=1, prop\_gain=-10, int\_crossover=1e2,  
> diff\_crossover=1e4, int\_saturation=10,  
> diff\_saturation=10)  
> PID.relinquish\_ownership()  
> MIM.relinquish\_ownership()

After the script is run, I connect to the Moku Pro using the iPad app. It tells me that Multi-Instrument is running, and when I open it shows me the PIDController instrument in slot 1 with the input and output configured as specified in the script.  
However, when I look at the channel 1 controller it is set to the default, not the controller specified by the set\_by\_frequency() call. Is the filter changed when the iPad connects? When relinquish\_ownership() is called? Is it possible to configure an instrument with the API in such a way that the settings persist when an iPad is connected?

I am interested in the reverse as well. Is it possible to configure an instrument with the iPad and then communicate with the instrument via API?

---

<div class="post-metadata">

**Author:** ![hanklong](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.liquidinstruments.com/hanklong/32/288_2.png) [@hanklong](https://forum.liquidinstruments.com/u/hanklong)\
**Post date:** [February 20, 2024, 5:17pm UTC](https://forum.liquidinstruments.com/t/persistence-of-instrument-configuration-when-switching-from-api-to-gui/900/2 "2024-02-20T17:17:05Z")

</div>

Hi Jeffrey @jephwack ,

Thank you very much for pointing this out!

Yes, the client software (iPad and Desktop Moku software) will reset the PID controller after you connected on fw587. However, we are aware of that this feature is useful for our API users.

We are working on this functionality, and we will let you know when it is available. Thank you very much for your understanding and patience!

Best regards,  
Hank
