capture.Export_data_table not working

with automation.Manager.connect(address=“IP”,port=10430) as manager:
device_configuration = automation.LogicDeviceConfiguration(
enabled_digital_channels=[0, 1],
enabled_analog_channels=[0, 1,2,3],
digital_sample_rate=100000000,
analog_sample_rate=1250000
# digital_threshold_volts=1.0,
)

# Record 5 seconds of data before stopping the capture
capture_configuration = automation.CaptureConfiguration(
    capture_mode=automation.TimedCaptureMode(duration_seconds=args.capture_duration)
)

with manager.start_capture(
        device_id='<Device_ID>',
        device_configuration=device_configuration,
        capture_configuration=capture_configuration) as capture:
    analyzer = capture.add_analyzer("USB LS and FS", settings={"D+": 0 , "D-": 1})
    # Table_Configuration = automation.DataTableExportConfiguration(analyzer=analyzer, radix=bin)
    file_name = 'Logic_Table_Export.csv'
    if args.export_data is None:
        capture.wait()
    else:
        capture.wait()
        save_path = os.path.join(args.export_data, file_name)
        capture.export_data_table(filepath= save_path, analyzers=[analyzer], columns=["Type", "Start", "Duration", "value"])

Error:

File “/home/user/.local/lib/python3.11/site-packages/saleae/automation/errors.py”, line 121, in _error_handler
raise grpc_error_to_exception(exc) from None
saleae.automation.errors.ExportError: Export failed: ios_base::clear: unspecified iostream_category error

Getting this error. Need help.

Note: The path is correct and accessible with proper permissions. Only this specific export function is not working.

@mstharunreddy Sorry for the trouble with that. If the path is correct and accessible with proper permissions, then I’m not immediately sure what is causing the issue.

To help isolate the issue, I’d like to first make sure the export_data_table function works on your end. As such, can you run our saleae_example.py script available in the link below? Please run this script without a Logic device connected (it will simulate a connected device).
https://saleae.github.io/logic2-automation/getting_started.html

As a first step, I want to see if exporting the data table via our example script will work. If that works properly, we can tackle looking into the differences between our example script and your script to try and isolate the source of the error you are seeing.

1 Like

Hello timreyes,

Yes the script you have provided is working perfectly. I can see the data.

Thank you.

But when i tried USB LS and FS decoder, I am getting the following error.

@mstharunreddy I’m glad to hear our example script works. Something specific with your automation script might be at play.

Could you send me a .py file attachment of your Python script that:

  • can run without any external file dependencies
  • can reproduce the data table export error

I’d like to try and quickly reproduce the error you are seeing as a starting point, and I may be able to help debug it from there.