# Multiple digital ports through MSO API

**URL:** <https://discuss.saleae.com/t/multiple-digital-ports-through-mso-api/3785>\
**Category:** Logic MSO\
**Created:** [July 30, 2026, 2:06pm UTC](https://discuss.saleae.com/t/multiple-digital-ports-through-mso-api/3785 "2026-07-30T14:06:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Philipp.M](https://avatars.discourse-cdn.com/v4/letter/p/b5a626/32.png) [@Philipp.M](https://discuss.saleae.com/u/Philipp.M)\
**Post date:** [July 30, 2026, 2:06pm UTC](https://discuss.saleae.com/t/multiple-digital-ports-through-mso-api/3785/1 "2026-07-30T14:06:36Z")

</div>

I need to capture eight digital channels at once with the “Logic MSO 4x100” through the Python MSO API, so I have to use two ports. For testing purposes, I run the following code with only two digital channels from different ports set up:

```python
scope = mso_api.MSO()
save_dir = Path('SaleaeLogicMSO-Capture')

scope.capture(
    mso_api.CaptureConfig(
        enabled_channels=[
            mso_api.DigitalChannel(port=0, channel=0, threshold_volts=2, name='P0_CH0'),
            mso_api.DigitalChannel(port=1, channel=0, threshold_volts=2, name='P1_CH0')
        ]
    ),
    save_dir=save_dir
)

```

Running this code throws following error:

`[capture_commands.cpp:77] exception during recording: invalid map<K, T> key`

The `capture_stdout.txt` is attached.

The same error occurs trying to capture all eight channels. Individually capturing channels of port 0 or 1 works, so it doesn’t seem to be a hardware error.

[capture\_stdout.txt](https://discuss.saleae.com/uploads/short-url/u3SAulwGfRXapsEIragGNQOJXRM.txt) (15.4 KB)

---

<div class="post-metadata">

**Author:** ![markgarrison](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.saleae.com/markgarrison/32/23_2.png) [@markgarrison](https://discuss.saleae.com/u/markgarrison)\
**Post date:** [July 30, 2026, 9:51pm UTC](https://discuss.saleae.com/t/multiple-digital-ports-through-mso-api/3785/2 "2026-07-30T21:51:12Z")

</div>

Hi @Philipp.M,

Thanks for sending this in! I’m sorry we didn’t catch this ourselves. It turns out this was caused by a race condition in our code, and by adding a sleep statement I was able to reproduce it locally. I have a fix for it and it will be in the next mso-api release. I don’t have a date yet, but I’ll work on that now and let you know once it’s out. Sorry for the trouble with this!

---

<div class="post-metadata">

**Author:** ![markgarrison](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.saleae.com/markgarrison/32/23_2.png) [@markgarrison](https://discuss.saleae.com/u/markgarrison)\
**Post date:** [July 31, 2026, 3:22am UTC](https://discuss.saleae.com/t/multiple-digital-ports-through-mso-api/3785/3 "2026-07-31T03:22:24Z")

</div>

Ok, it’s fixed now. I just released mso-api 0.5.8.

I installed mine with pip, so I upgraded it like so:

```auto
pip install --upgrade saleae-mso-api --extra-index-url https://downloads.saleae.com/pypi/

```

---

<div class="post-metadata">

**Author:** ![Philipp.M](https://avatars.discourse-cdn.com/v4/letter/p/b5a626/32.png) [@Philipp.M](https://discuss.saleae.com/u/Philipp.M)\
**Post date:** [July 31, 2026, 7:14am UTC](https://discuss.saleae.com/t/multiple-digital-ports-through-mso-api/3785/4 "2026-07-31T07:14:19Z")

</div>

Thank you for the quick fix, now it works perfectly!
