Automatization launch crashing


When using automation.Manager.launch() , Salea Logic2 opens for less than a second, and crashes with “Process finished with exit code -1073740791 (0xC0000409)”.

Any idea what could be the issue?


@albert.caba The automation.Manager.launch() command will close the Logic2 app when it reaches the end of the function.

To double check this, can you send me your .py file?

Including it for the provided example makes it crash for me:

from saleae import automation
import os
import os.path
from datetime import datetime

# Connect to the running Logic 2 Application on port `10430`.
# Alternatively you can use automation.Manager.launch() to launch a new Logic 2 process - see
# the API documentation for more details.
# Using the `with` statement will automatically call manager.close() when exiting the scope. If you
# want to use `automation.Manager` outside of a `with` block, you will need to call `manager.close()` manually.
with automation.Manager.connect(port=10430) as manager:

    # Configure the capturing device to record on digital channels 0, 1, 2, and 3,
    # with a sampling rate of 10 MSa/s, and a logic level of 3.3V.
    # The settings chosen here will depend on your device's capabilities and what
    # you can configure in the Logic 2 UI.
    device_configuration = automation.LogicDeviceConfiguration(
        enabled_digital_channels=[0, 1, 2, 3],

    # Record 5 seconds of data before stopping the capture
    capture_configuration = automation.CaptureConfiguration(

    # Start a capture - the capture will be automatically closed when leaving the `with` block
    # Note: The serial number 'F4241' is for the Logic Pro 16 demo device.
    #       To use a real device, you can:
    #         1. Omit the `device_id` argument. Logic 2 will choose the first real (non-simulated) device.
    #         2. Use the serial number for your device. See the "Finding the Serial Number
    #            of a Device" section for information on finding your device's serial number.
    with manager.start_capture(
            capture_configuration=capture_configuration) as capture:

        # Wait until the capture has finished
        # This will take about 5 seconds because we are using a timed capture mode

        # Add an analyzer to the capture
        # Note: The simulator output is not actual SPI data
        spi_analyzer = capture.add_analyzer('SPI', label=f'Test Analyzer', settings={
            'MISO': 0,
            'Clock': 1,
            'Enable': 2,
            'Bits per Transfer': '8 Bits per Transfer (Standard)'

        # Store output in a timestamped directory
        output_dir = os.path.join(os.getcwd(), f'output-{"%Y-%m-%d_%H-%M-%S")}')

        # Export analyzer data to a CSV file
        analyzer_export_filepath = os.path.join(output_dir, 'spi_export.csv')

        # Export raw digital data to a CSV file
        capture.export_raw_data_csv(directory=output_dir, digital_channels=[0, 1, 2, 3])

        # Finally, save the capture to a file
        capture_filepath = os.path.join(output_dir, 'example_capture.sal')

@albert.caba Ah, I think I see what’s happening here. As mentioned earlier, the automation.Manager.launch() command will close the Logic2 app when it reaches the end of the function.

In your Python script, the application will immediately close after the launch() call, and the rest of your script will not execute.

Can you try removing:

and replace the next line with:
with automation.Manager.launch() as manager:

I actually had this issue as well. It ended-up being that I forgot to enable automation on the GUI. Might be worth double-checking.