# \[Python API\] Channel naming

**URL:** <https://discuss.saleae.com/t/python-api-channel-naming/1926>\
**Category:** Support\
**Created:** [November 17, 2022, 7:21pm UTC](https://discuss.saleae.com/t/python-api-channel-naming/1926 "2022-11-17T19:21:17Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![itay.work94](https://avatars.discourse-cdn.com/v4/letter/i/a587f6/32.png) [@itay.work94](https://discuss.saleae.com/u/itay.work94)\
**Post date:** [November 17, 2022, 7:21pm UTC](https://discuss.saleae.com/t/python-api-channel-naming/1926/1 "2022-11-17T19:21:17Z")

</div>

Hey again (🙂  
Is there an option to re-name channels for the captured recording ?  
(even better if it would be possible to set it before starting the capture).

if not, are there any plans for future versions ?

---

<div class="post-metadata">

**Author:** ![timreyes](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.saleae.com/timreyes/32/108_2.png) [@timreyes](https://discuss.saleae.com/u/timreyes)\
**Post date:** [November 18, 2022, 11:33pm UTC](https://discuss.saleae.com/t/python-api-channel-naming/1926/2 "2022-11-18T23:33:34Z")

</div>

@itay.work94 Great question. Unfortunately, it doesn’t look like channel naming is available via our Automation API.  
[https://saleae.github.io/logic2-automation/automation.html](https://saleae.github.io/logic2-automation/automation.html)

I’ll bring this idea up directly with our software team here. I think this is great. Right now, you’ll have to manually edit the channel names before running your automation script.

Out of curiousity, were you mostly looking to take advantage of channel naming for raw data exports, or for something else?

---

<div class="post-metadata">

**Author:** ![pawel](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@pawel](https://discuss.saleae.com/u/pawel)\
**Post date:** [July 17, 2023, 11:08am UTC](https://discuss.saleae.com/t/python-api-channel-naming/1926/4 "2023-07-17T11:08:21Z")

</div>

Hello 🙂

Is there an update for channel naming using API 2 ?

Thanks!

---

<div class="post-metadata">

**Author:** ![timreyes](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.saleae.com/timreyes/32/108_2.png) [@timreyes](https://discuss.saleae.com/u/timreyes)\
**Post date:** [July 17, 2023, 7:19pm UTC](https://discuss.saleae.com/t/python-api-channel-naming/1926/5 "2023-07-17T19:19:38Z")

</div>

@pawel Thanks for following up on this. Unfortunately, we don’t have any updates to share. We did however log this idea internally, as well as publicly below:

> **[Automation API - Edit Channel Names / Labels - Logic 2 - Ideas and Feature...](https://ideas.saleae.com/b/feature-requests/automation-api-edit-channel-names-labels/)**
>
> Original request here:
> discuss.saleae.com/t/python-api-channel-naming/1926
> "Hey again
> Is there an option to re-name channels for the captured recording ?
> (even better if it would be possible to set it before starting the capture). if not, are ther

Can you help describe your particular use case for this feature? We’d love to know more about your automated testing requirements surrounding this feature request. At the very least, I’d like to make sure that information is logged in the feature request post above so we can keep it in mind, and to help with prioritization.

---

<div class="post-metadata">

**Author:** ![pawel](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@pawel](https://discuss.saleae.com/u/pawel)\
**Post date:** [July 17, 2023, 8:05pm UTC](https://discuss.saleae.com/t/python-api-channel-naming/1926/6 "2023-07-17T20:05:53Z")

</div>

Thanks Tim for quick reply!

The first thing which I do when I use Logic 2 app is to name channels inside app to match net names of connected signals as they are used in schematic - for readability purposes.  
For example if I have 16 signals connected to Logic 16, when I analyze signals, “RTC\_INT” name is much more informative than “Channel 0”. API 2 prevents me to provide my own names and I’m little surprised that such basic feature is not implemented to be honest.

What’s more - is there a way to set analyzers (e.g. Async Serial) BEFORE capture starts? So that during capture, all analyzers will do their job of decoding data during capture and not after capture ends and is saved.  
My scenario is that I have to capture really long (days) of data which is impossible to do without having hundreds of GBs of RAM using regular app (I omit the fact that analyzing such long capture would be a nightmare). Currently I’m capturing 5h of data, when it stops, I apply analyzers (16 of them) and because decoding takes some time - it delays unnecessarily starting new capture (so for longer period of time data is not being captured). I’m basing on this example - [Getting Started — Saleae 1.0.6 documentation](https://saleae.github.io/logic2-automation/getting_started.html#using-the-python-automation-api)

Also: is it possible to set order of channels using API 2? In app I can move for example D15 channel to be the first which is displayed (just below "File/Edit/Capture/Measure/View/Help bar). Use case is pretty simple - sometimes where 16 signals are connected it’s easier to manipulate channels using their order in app/API than to physically change their connections.

Thanks!

---

<div class="post-metadata">

**Author:** ![timreyes](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.saleae.com/timreyes/32/108_2.png) [@timreyes](https://discuss.saleae.com/u/timreyes)\
**Post date:** [July 19, 2023, 12:15am UTC](https://discuss.saleae.com/t/python-api-channel-naming/1926/7 "2023-07-19T00:15:29Z")

</div>

@pawel Thanks for the added details! Your use case makes a lot of sense. I’ve added some more notes about it in the feature request post I linked previously.

> [@pawel](#):
>
> Currently I’m capturing 5h of data, when it stops, I apply analyzers (16 of them) and because decoding takes some time - it delays unnecessarily starting new capture (so for longer period of time data is not being captured).

This is unfortunately not possible at the moment. The analyzer must be added before the capture to use that functionality. I’ll check with the team here to see if there might be a workaround for your particular case below.

> [@pawel](#):
>
> Also: is it possible to set order of channels using API 2?

This is unfortunately not possible right now either. I’ve added a note about your request in the feature request post below.

> **[Automation API - Control Channel Order - Logic 2 - Ideas and Feature Requests...](https://ideas.saleae.com/b/feature-requests/logic-2-automation-additions/)**
>
> Along with being able to change the signal name labels through the automation API and accepting API commands from a remote computer, could you make it where the signals appear in a different order through the automation API instead of manually...

---

<div class="post-metadata">

**Author:** ![timreyes](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.saleae.com/timreyes/32/108_2.png) [@timreyes](https://discuss.saleae.com/u/timreyes)\
**Post date:** [July 19, 2023, 11:14pm UTC](https://discuss.saleae.com/t/python-api-channel-naming/1926/8 "2023-07-19T23:14:21Z")

</div>

@pawel Sorry you hadn’t heard back from me yet on the below.

> [@pawel](#):
>
> Currently I’m capturing 5h of data, when it stops, I apply analyzers (16 of them) and because decoding takes some time - it delays unnecessarily starting new capture (so for longer period of time data is not being captured).

The workaround for now might be to not add the analyzer during automation to minimize the delay between captures. You’ll need to add the analyzer at the time of reviewing your capture file however, though I could see how this isn’t ideal. I still have the action of checking with the software team if there is a workaround which will stil allow you to add analyzers during your automation script, while also minimizing downtime between captures.

---

<div class="post-metadata">

**Author:** ![pawel](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@pawel](https://discuss.saleae.com/u/pawel)\
**Post date:** [July 20, 2023, 6:04am UTC](https://discuss.saleae.com/t/python-api-channel-naming/1926/9 "2023-07-20T06:04:04Z")

</div>

Thank you Tim for update - applying analyzers after capture is an option but it would be perfect to have possibility to apply them before starting new capture.

Another thing - is it possible to apply analyzer using API 2 and set how data should be displayed (I mean “Binary” or “Decimal” or Hexadecimal" or “Ascii”)? It seems that it defaults to “Ascii”.

Do you know Tim what is possible timeframe for Saleae to update API to have features (at least some) which we discussed in this topic? Original question was posted ~9 months ago…

---

<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 20, 2023, 4:47pm UTC](https://discuss.saleae.com/t/python-api-channel-naming/1926/10 "2023-07-20T16:47:19Z")

</div>

Hi @pawel , thanks for the feedback and I’m sorry we can’t ship this sooner. The Saleae team is tiny (3 SW developers, including myself), so we generally can only focus on one area of the application at a time. I don’t have an estimate on when we will get back to working on the API at the moment.

We do want to open up the API to more or less allow you to control all areas of the application, in the same way you can manually.

In the meantime, for your analyzer needs, the API does support calls from multiple threads. You can for example add analyzers, save, export, and close a capture while the next capture is recording. This should keep the inter-capture gaps very short. Details here:

> [@Automating long recordings? Using multiprocessing for the saves?](https://discuss.saleae.com/t/automating-long-recordings-using-multiprocessing-for-the-saves/2254/3):
>
> Hi @bu5, Good news, we did test that this can be done with Logic 2. We recommend using the python main thread to perform the captures, and use threads to take care of saving and closing finished captures. Here is an example I tested a while ago which allows you to export, save, and close captures in the background while the next capture is running. Let me know if you have any trouble with it! from saleae import automation import os import os.path from datetime import datetime import threading …

---

<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 20, 2023, 4:50pm UTC](https://discuss.saleae.com/t/python-api-channel-naming/1926/11 "2023-07-20T16:50:00Z")

</div>

> [@pawel](#):
>
> Another thing - is it possible to apply analyzer using API 2 and set how data should be displayed (I mean “Binary” or “Decimal” or Hexadecimal" or “Ascii”)? It seems that it defaults to “Ascii”.

With the current API this is only possible when exporting analyzer results. The functions `export_data_table` and `legacy_export_analyzer` support it. Details here:  
[https://saleae.github.io/logic2-automation/automation.html#datatableexportconfiguration](https://saleae.github.io/logic2-automation/automation.html#datatableexportconfiguration)

---

<div class="post-metadata">

**Author:** ![pawel](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@pawel](https://discuss.saleae.com/u/pawel)\
**Post date:** [July 31, 2023, 12:32pm UTC](https://discuss.saleae.com/t/python-api-channel-naming/1926/12 "2023-07-31T12:32:21Z")

</div>

Sorry Mark for my late response and thank you for clean explanation for current API/development status.  
It’s a pity that currently you don’t have enough resources to develop more API 2 features - but I hope that this will improve in near future 🙂

I’ve checked link which you provided and it works excellent - the gap between ending old capture and starting new one is \<1s 😄

---

<div class="post-metadata">

**Author:** ![albert.caba](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@albert.caba](https://discuss.saleae.com/u/albert.caba)\
**Post date:** [October 19, 2023, 5:03am UTC](https://discuss.saleae.com/t/python-api-channel-naming/1926/13 "2023-10-19T05:03:12Z")

</div>

Hi @timreyes Tim, is it still not possible to change the labels?

---

<div class="post-metadata">

**Author:** ![timreyes](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.saleae.com/timreyes/32/108_2.png) [@timreyes](https://discuss.saleae.com/u/timreyes)\
**Post date:** [October 23, 2023, 8:32pm UTC](https://discuss.saleae.com/t/python-api-channel-naming/1926/14 "2023-10-23T20:32:05Z")

</div>

@albert.caba That’s correct. This is currently not possible yet.

---

<div class="post-metadata">

**Author:** ![gautam.nbhat](https://avatars.discourse-cdn.com/v4/letter/g/839c29/32.png) [@gautam.nbhat](https://discuss.saleae.com/u/gautam.nbhat)\
**Post date:** [August 20, 2024, 4:09am UTC](https://discuss.saleae.com/t/python-api-channel-naming/1926/15 "2024-08-20T04:09:17Z")

</div>

@timreyes : I really need to set channel names for capture instead of “Digital 0” as this does not convey any meaning when I send the capture for analysis. Is there some kind of a workaround that I can use to get this feature? This is a very basic feature that should have been provided.

---

<div class="post-metadata">

**Author:** ![albert.caba](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@albert.caba](https://discuss.saleae.com/u/albert.caba)\
**Post date:** [August 20, 2024, 4:22am UTC](https://discuss.saleae.com/t/python-api-channel-naming/1926/16 "2024-08-20T04:22:12Z")

</div>

I agree, it’s been more than two years for this simple feature to be implemented and nothing, so makes me wonder what a mess of code there is, so even easy features like this cannot be implemented. Nothing is ever implemented on the automation side , I don’t get it

---

<div class="post-metadata">

**Author:** ![gautam.nbhat](https://avatars.discourse-cdn.com/v4/letter/g/839c29/32.png) [@gautam.nbhat](https://discuss.saleae.com/u/gautam.nbhat)\
**Post date:** [August 20, 2024, 7:19am UTC](https://discuss.saleae.com/t/python-api-channel-naming/1926/17 "2024-08-20T07:19:02Z")

</div>

What is irritating is that this so called “feature” is supposed to be the most basic and should be included in the first iteration itself. I am even surprised by the fact that a “usecase” for the feature is asked. I mean WTF!

Every reply for such requests comes with a “we have only 2 people working”. I don’t understand how that is my problem. The LA is definitely not cheap and looks more on the overpriced side and the expectation is the SW coming with the HW is decent. If the software is a mess open up the HW so that it can be used with 3rd party analysis software like Sigrok or something instead of the hacks.

I wasted my time trying to get this Automation API working only to find that there is no channel naming. Sigh!

---

<div class="post-metadata">

**Author:** ![timreyes](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.saleae.com/timreyes/32/108_2.png) [@timreyes](https://discuss.saleae.com/u/timreyes)\
**Post date:** [August 21, 2024, 8:46pm UTC](https://discuss.saleae.com/t/python-api-channel-naming/1926/18 "2024-08-21T20:46:34Z")

</div>

@gautam.nbhat @albert.caba -

> [@gautam.nbhat](#):
>
> Is there some kind of a workaround that I can use to get this feature?

It looks like a suggestion was made by a community member on your forum post below.

> [@Applying a preset to Logic2 Automation API Capture](https://discuss.saleae.com/t/applying-a-preset-to-logic2-automation-api-capture/3022):
>
> Hi, I am using Automation API to capture all digital lines. After that I want to analyze by loading it in Logic 2. Unfortunately I cannot load my preset to this capture. This is becoming a big problem as I have named the ports based on pins that I am capturing and now I just see Channel 0, Channel 1 …, Channel 15. Am I missing something or is this feature not present? If this feature is not present could you please provide some support for this feature? Thanks.

Our end goal as Mark mentioned previously is to open up our Automation API to allow for controlling all aspects of the software available in the GUI. As you’ve brought up, we’re unfortunately not there yet, and I completely understand your frustration regarding not having an update on this topic since then. We’ve been heads down on some high priority projects for quite some time and the short answer is that we simply haven’t been able to prioritize working towards this goal because of it.

---

<div class="post-metadata">

**Author:** ![henrikfritzonsund](https://avatars.discourse-cdn.com/v4/letter/h/ecb155/32.png) [@henrikfritzonsund](https://discuss.saleae.com/u/henrikfritzonsund)\
**Post date:** [September 6, 2024, 1:47pm UTC](https://discuss.saleae.com/t/python-api-channel-naming/1926/19 "2024-09-06T13:47:19Z")

</div>

Hello!

I have just spent longer than necessary looking for an API (official and/or unofficial) for renaming the channels prior to an automatic data capture + csv export job.

Is there really no such API? It seems like a rather trivial thing to implement since it already is possible to rename the channels via the GUI (my current workaround - but it is hard to ensure that everyone names the channels correctly for additional postprocessing down the line).

Any idea to when/if this will be implemented? Are we talking weeks/months or years into the future?

Best regards,  
Henrik Fritzon

---

<div class="post-metadata">

**Author:** ![timreyes](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.saleae.com/timreyes/32/108_2.png) [@timreyes](https://discuss.saleae.com/u/timreyes)\
**Post date:** [September 6, 2024, 9:42pm UTC](https://discuss.saleae.com/t/python-api-channel-naming/1926/20 "2024-09-06T21:42:17Z")

</div>

@henrikfritzonsund Thanks for letting us know your need for that. We unfortunately don’t have a timeline as to when we would be able to get to this, however, you’re certainly right that we’re long overdue on getting this implemented.

We’re currently in the middle of a big project and, as such, we don’t have a good estimate as to when we would be able to implement this just yet.

---

<div class="post-metadata">

**Author:** ![BitBob](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.saleae.com/bitbob/32/2292_2.png) [@BitBob](https://discuss.saleae.com/u/BitBob)\
**Post date:** [September 29, 2024, 8:44pm UTC](https://discuss.saleae.com/t/python-api-channel-naming/1926/21 "2024-09-29T20:44:19Z")

</div>

Hi @itay.work94, @pawel, @gautam.nbhat, @albert.caba and anyone else interested –

Try out this python script:

> **[GitHub - b1tb0b/saleae-rename-channels: Python script to rename channels in a Saleae...](https://github.com/b1tb0b/saleae-rename-channels)**
>
> Python script to rename channels in a Saleae Logic2 capture file (\*.sal)

You could embed the function `sal_rename_channels()` within your Automation API python script, or call this script separately as a standalone program.

Note: I’m still quite new to python, so any feedback is quite welcome 🙂

PS: This is based on a concept discussed in another thread:

> [@Applying a preset to Logic2 Automation API Capture](https://discuss.saleae.com/t/applying-a-preset-to-logic2-automation-api-capture/3022/3):
>
> For what its worth, I did a quick experimental hack – given that the \*.sal file is really just a ZIP archive with a set of \*.bin analog and/or digital files and a meta.json file describing everything stored. If you want to rename the channels manually, you can just: open the \*.sal file in the Logic 2 software manually rename the channels save the changes back to a \*.sal file Likewise, you can also rename the channels by the following steps: unzip the \*.sal file modify the label/strings in …

… and as I wanted to explore python a bit more, I finally tried it out myself.

[Next page](https://discuss.saleae.com/t/python-api-channel-naming/1926.md?page=2)
