Skip to content

Set Parameter

SUMMARY

Set Parameter updates a named camera parameter — for example exposure time, acquisition frame rate, or device link throughput limit. Pair it with get_parameter to verify that the write took effect.

Available on: IDS.

The Skill

python
camera.set_parameter("ExposureTime", 35000.0)

The parameter name must exist in parameter_name_to_type_map in medulla/cameras/ids.py — passing an unknown name raises a KeyError. Common names: AcquisitionFrameRate, ExposureTime, DeviceLinkThroughputLimit.

The Code

python
"""
Tune exposure and frame rate on an IDS camera before capturing or streaming.

Run from a terminal to avoid issues with Rerun's spawn mode.
"""
from loguru import logger

from telekinesis.medulla.cameras import ids


def main():
    camera = ids.IDS(
        name="my_ids_camera",
        serial_number="4108909352",
        load_factory_defaults=False,
    )
    try:
        camera.connect()

        logger.info(f"ExposureTime (before): {camera.get_parameter('ExposureTime')}")
        camera.set_parameter('ExposureTime', 35000.0)
        camera.set_parameter('AcquisitionFrameRate', 14.0)
        logger.info(f"ExposureTime (after): {camera.get_parameter('ExposureTime')}")
    finally:
        camera.disconnect()


if __name__ == "__main__":
    main()

The Explanation of the Code

After connect has opened the device, set_parameter writes a new value to the named parameter through the IDS Peak SDK. The most common use is tuning exposure (in microseconds) and acquisition frame rate before capturing or streaming.

python
camera.set_parameter('ExposureTime', 35000.0)        # 35 ms
camera.set_parameter('AcquisitionFrameRate', 14.0)

TIP

With load_factory_defaults=False, parameters previously configured in IDS Peak Cockpit are preserved across connect calls. Set True to reset the camera to factory defaults instead.

The parameter name must exist in parameter_name_to_type_map in medulla/cameras/ids.py. Passing an unknown name raises a KeyError immediately. Pair the write with a get_parameter call to verify the new value took effect.

Where to Use the Skill

  • Tuning exposure for the lighting in your cell — adjust ExposureTime to avoid blown-out highlights or underexposed regions.
  • Throttling frame rate — set AcquisitionFrameRate to limit bandwidth or sync with downstream consumers.
  • Bandwidth control — adjust DeviceLinkThroughputLimit when streaming over USB3 to multiple cameras at once.
  • Remote tuning over BabyROS — see Publish Video with BabyROS for the client-side pattern that wraps set_parameter in a BabyROS request.