# Logic 2 API / automation feature request

**URL:** <https://discuss.saleae.com/t/logic-2-api-automation-feature-request/2653>\
**Category:** Logic 2 Software\
**Created:** [January 11, 2024, 11:48am UTC](https://discuss.saleae.com/t/logic-2-api-automation-feature-request/2653 "2024-01-11T11:48:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![wgoebel](https://avatars.discourse-cdn.com/v4/letter/w/e9a140/32.png) [@wgoebel](https://discuss.saleae.com/u/wgoebel)\
**Post date:** [January 11, 2024, 11:48am UTC](https://discuss.saleae.com/t/logic-2-api-automation-feature-request/2653/1 "2024-01-11T11:48:22Z")

</div>

I just started recently using the automation API functions, using Python scripts; as I am new to Python I was astonished how easy it was to get started.  
I use the automation for long time data recording (SMBus communication for 2 systems in parallel), starting a timed recording for e.g. 5 minutes, then saving the data to a .sal file and immediatly starting a new recording; this way I am only loosing ~3seconds of data.  
With a second automation script (normally done on a different PC) I am analysing the data, opening the session (in a loop, processing all .sal files in a directory), using the standard SMBus analyzer and exporting the data to csv files which I later process in a third step using Excel VBA scripts.

What would be helpful for me related to the automation would be the following:

- cannot find a way to extract metadata (like time stamp start / end of capture, number of samples per channel, etc) from a stored session. (currently I am using python functions to extract the windows timestamp of the .sal file, then subtracting the recording time)
- there seems to be no possibility to set the x zoom for the live display during capture; if it would be possible to have a fixed zoom this would make it easier to see irregularities
- after the easy first steps with automation it was pretty hard to find good examples for certain automation functions; would be nice to have a page giving examples (would contribute my examples as well)

---

<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:** [January 11, 2024, 11:03pm UTC](https://discuss.saleae.com/t/logic-2-api-automation-feature-request/2653/2 "2024-01-11T23:03:19Z")

</div>

@wgoebel I’m glad to hear you’ve got an automation flow working so far. My replies are below.

- We’ve documented some notes about our .sal file format in the forum post below. In short, we provide a meta.json file which you can extract from the .sal capture file that might contain the data you need.  
[Logic 2 Capture Format (.sal)](https://discuss.saleae.com/t/logic-2-capture-format-sal/1858)
- Via automation, you are correct. Our idea with our Automation API was that it would primarily be used in situations where the user would not be actively interacting with the software. We’re tracking a feature request below for making our Automation API more applicable towards users who would still be actively debugging / using the software. Setting a zoom level via this method seems to fit within this use case.  
[Automation API - Execute automation script on pre-existing session - Logic 2 - Ideas and Feature Requests - Saleae](https://ideas.saleae.com/b/feature-requests/automation-api-start-capture-on-pre-existing-session/)
- We’ve documented some test cases below. Hopefully these examples help!  
[logic2-automation/python/tests at develop · saleae/logic2-automation · GitHub](https://github.com/saleae/logic2-automation/tree/develop/python/tests)

---

<div class="post-metadata">

**Author:** ![wgoebel](https://avatars.discourse-cdn.com/v4/letter/w/e9a140/32.png) [@wgoebel](https://discuss.saleae.com/u/wgoebel)\
**Post date:** [January 12, 2024, 8:54am UTC](https://discuss.saleae.com/t/logic-2-api-automation-feature-request/2653/3 "2024-01-12T08:54:43Z")

</div>

Hi Tim,

Thanks for your quick response, was helpful. Remarks see below

Good work, best regards

Werner

![~WRD0000.jpg](https://canada1.discourse-cdn.com/flex030/uploads/saleae/original/2X/5/52d5f1c08649212fe6768d2cacdcf8df711810d9.jpeg)

 ![ansmann_logo_blue-rgb_11fe7ec8-3ddf-46b4-a4b9-68aa20ae4897.png](https://canada1.discourse-cdn.com/flex030/uploads/saleae/original/2X/2/28d7fadbcd82d4ff57c66937700e7d846867c22a.png)

![top-100-2023_79f172e9-5a97-4558-abe7-06399aba3a32.jpg](https://canada1.discourse-cdn.com/flex030/uploads/saleae/original/2X/3/3b09ed301500e996d5014de2edf4d656b61360a0.jpeg)
