Error setting LaserLockBox settings in Multi-Intstument mode

Single instrument works as expected

from moku.instruments import LaserLockBox
LLB = LaserLockBox('moku.pro2.lab', force_connect=True, platform_id=4)
LLB.set_scan_oscillator(shape = 'NegativeRamp')
{'Output channel': 64,
 'Scan shape': 2,
 'amplitude': 0.5,
 'enabled': True,
 'frequency': 10.0,
 'output': 'AnalogOutput1',
 'shape': 'NegativeRamp'}

same request fails in multi instrument mode

from moku.instruments import LaserLockBox, MultiInstrument
MIM = MultiInstrument('moku.pro2.lab', force_connect=True, platform_id=4)
LLB = MIM.set_instrument(1, LaserLockBox)
LLB.set_scan_oscillator(shape = 'NegativeRamp')
---------------------------------------------------------------------------
InvalidParameterException                 Traceback (most recent call last)
Cell In[37], line 4
      2 MIM = MultiInstrument('moku.pro2.lab', force_connect=True, platform_id=4)
      3 LLB = MIM.set_instrument(1, LaserLockBox)
----> 4 LLB.set_scan_oscillator(shape = 'NegativeRamp')

File /opt/conda/envs/lab/lib/python3.13/site-packages/moku/instruments/_laserlockbox.py:242, in LaserLockBox.set_scan_oscillator(self, enable, shape, frequency, amplitude, output, strict)
    233 operation = "set_scan_oscillator"
    234 params = dict(
    235     strict=strict,
    236     enable=enable,
   (...)    240     output=output,
    241 )
--> 242 return self.session.post(
    243     f"slot{self.slot}/{self.operation_group}", operation, params
    244 )

File /opt/conda/envs/lab/lib/python3.13/site-packages/moku/session.py:23, in handle_response.<locals>.func_wrapper(self, *args, **kwargs)
     20 @wraps(func)
     21 def func_wrapper(self, *args, **kwargs):
     22     response = func(self, *args, **kwargs)
---> 23     return self.resolve(response)

File /opt/conda/envs/lab/lib/python3.13/site-packages/moku/session.py:204, in RequestSession.resolve(self, response)
    202         return data.data
    203     elif data.success is False:
--> 204         self._handle_error(data.code, data.messages)
    205 else:
    206     # Log the full response details for debugging
    207     logger.debug(f"HTTP error response: {response.__dict__}")

File /opt/conda/envs/lab/lib/python3.13/site-packages/moku/session.py:158, in RequestSession._handle_error(code, messages)
    156     raise exceptions.NoInstrumentBitstream(messages)
    157 elif code == "INVALID_PARAM":
--> 158     raise exceptions.InvalidParameterException(messages)
    159 elif code == "INVALID_REQUEST":
    160     raise exceptions.InvalidRequestException(messages)

InvalidParameterException: ['AnalogOutput1 is not a valid value for Output channel']

Hello @jephwack ,

Thank you for reaching out to Liquid Instruments! This error is because set_scan_oscillator() has a parameter output that is by default Output1. In Multi-Instrument mode, the syntax changes to Output A/B which will have to be explicitly set (see documentation here). Changing the line to LLB.set_scan_oscillator(shape='NegativeRamp', output='OutputA') should fix the error.

-Dylan

Thanks, you suggestion works

from moku.instruments import LaserLockBox, MultiInstrument
MIM = MultiInstrument('moku.pro2.lab', force_connect=True, platform_id=4)
LLB = MIM.set_instrument(1, LaserLockBox)
LLB.set_scan_oscillator(output = 'OutputA' , shape = 'NegativeRamp')
{'Output channel': 96,
 'Scan shape': 2,
 'amplitude': 0.5,
 'enabled': True,
 'frequency': 10.0,
 'output': 'GenericOutputA',
 'shape': 'NegativeRamp'}

Passing invalid parameters as defaults should be considered a bug.

The documentation does not cover all the values we have seen, what is Analog vs Generic?

Hello @jephwack ,

In Multi-Instrument mode, the output can be routed to an analog output, or to another instrument; that is why it is referred to as ‘GenericOutputA/B’ vs in single instrument mode, the output is assigned to an analog output and referred to as ‘AnalogOutput1/2’. As far as the default parameters being invalid, I will discuss with my team how we can update the documentation to make this more clear. I hope this helps!

-Dylan