# Logic2 Automation Script

**URL:** <https://discuss.saleae.com/t/logic2-automation-script/2947>\
**Category:** Support\
**Created:** [July 2, 2024, 12:17am UTC](https://discuss.saleae.com/t/logic2-automation-script/2947 "2024-07-02T00:17:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ethan\_abraham639](https://avatars.discourse-cdn.com/v4/letter/e/e19adc/32.png) [@ethan\_abraham639](https://discuss.saleae.com/u/ethan_abraham639)\
**Post date:** [July 2, 2024, 12:17am UTC](https://discuss.saleae.com/t/logic2-automation-script/2947/1 "2024-07-02T00:17:32Z")

</div>

Hello,

I am trying to write a Python script that achieves the following:

1. Connects to the Logic 8 plugged into my computer
2. Sets the active analog/digital channels and names the titles
3. Starts a capture, then stops the capture after a certain delay
4. Measure the time between channels at a certain voltage level (ex. The time in ms from Channel 1 to reach 1V to Channel 2 reaching 1V)
5. Save the capture and export it.

Would this be possible? Currently using the Logic2 Automation API I can start/stop a capture and export it by following the guide in this: [Getting Started — Saleae 1.0.6 documentation](https://saleae.github.io/logic2-automation/getting_started.html#installing-the-python-automation-api-package)

Can I automatically label my channels and get timing measurements as well?

Thanks!

Ethan

---

<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 2, 2024, 11:20pm UTC](https://discuss.saleae.com/t/logic2-automation-script/2947/2 "2024-07-02T23:20:59Z")

</div>

@ethan_abraham639 Thanks for writing in. Unfortunately, labelling channels and adding measurements are currently not supported by our Automation API.

We’re currently tracking these 2 feature requests in the links below, and I’ve added a comment for you in both of them to track your need for these features to be implemented as well.

> **[Automation API - Edit Channel Names / Labels - Logic 2 - Ideas and Feature...](https://ideas.saleae.com/b/feature-requests/automation-api-edit-channel-names-labels/)**
>
> This is a request to allow our Automation API to edit channel names
> 
> Original post was somehow deleted. We will continue tracking this request in a new post here.

> **[Read Measurement (and Extensions) via Automation API - Logic 2 - Ideas and...](https://ideas.saleae.com/b/feature-requests/read-measurement-and-extensions-via-socket-api/)**
>
> It would be very useful to be able to access common measurement (1.x) and measurement extension (2.x) parameters via the socket API. File I/O is a bottleneck and it would be great to avoid writing then reading and post-processing data for simple...

---

<div class="post-metadata">

**Author:** ![ethan\_abraham639](https://avatars.discourse-cdn.com/v4/letter/e/e19adc/32.png) [@ethan\_abraham639](https://discuss.saleae.com/u/ethan_abraham639)\
**Post date:** [July 8, 2024, 11:55pm UTC](https://discuss.saleae.com/t/logic2-automation-script/2947/3 "2024-07-08T23:55:50Z")

</div>

I see, thank you Tim. Would it be possible to have the measurement aspect implemented as a script running inside the application that isn’t automated? I’m not sure if this could be done through a HighLevelAnalyzer. Where I could start/stop the capture with the automation API and then then analyzer could keep track of when channels 1 and 2 each reach 1V and subtract the difference. From my understanding high level analyzers implement other lower level analyzers both those seem to only be used for specific protocols and decoding data. Can I make a HLA for analog timings?

---

<div class="post-metadata">

**Author:** ![BitBob](https://avatars.discourse-cdn.com/v4/letter/b/ecb155/32.png) [@BitBob](https://discuss.saleae.com/u/BitBob)\
**Post date:** [July 9, 2024, 12:55am UTC](https://discuss.saleae.com/t/logic2-automation-script/2947/4 "2024-07-09T00:55:29Z")

</div>

As far as I know, there is minimal support for analog channels in the low-level analyzer SDK. Probably the best option currently available would be to save a capture and export the analog data to CSV file for external processing outside of the tool. The triggering, capturing, and saving/exporting could be done via the [automation API](https://www.saleae.com/pages/automation/) – but the CSV analysis would likely need to be done with another tool/script (e.g., Excel and/or python).
