Logic 2 Automation API analysing multiple captures - intermittent missing column

Hi folks, first time posting, hopefully this is in the correct place.

Firstly, let me say the new automation API is really good. Thank you dev team for making this happen :+1:

I think however I may have spotted a bug. I wrote a python script to iterate over several capture .sal files in a folder.

The script is supposed to perform the following;

  1. Open the first file
  2. Add 4 async serial analyzers
  3. Export the hex table data to a CSV
  4. Close the file
  5. Open the next file
  6. Repeat steps 2-5 until all have been processed

The code can be found here: Pastebin.com - Saleae Logic 2 Automation Multiple Files

This works fine for the most part, however the “data” column is often missing from the export of the second exported data table CSV onwards.

I say often because once or twice it’s worked but usually it does not. I don’t know why it occasionally works but usually doesn’t.

I’m still researching this but I thought I’d at least flag this up as I know this automation feature is new and likely to potentially have issues.

Kind regards,
Jason

Hi @bagjason - thanks for reporting this!

I’ll take a look at this for the next release. When this happens, are any of the rows missing, or just the column? I’ll attempt to reproduce this on my end as well - I have an idea of what is going on.

Ryan

Hi @huffman :slight_smile:

As far as I can tell there’s no missing rows, just the data column. Here’s a screenshot of the first and second files generated. All of the files after this are like “TCL-02.sal” missing the data column.

Further update here.

I decided to try reworking the Python script so that it completely shuts down Logic 2 and restarts it every time it opens a log file.

Here’s the source code: Logic 2 Automation Process Multiple Captures - Pastebin.com

Oddly the behavior persists even when restarting Logic 2, leading me to believe it’s a problem with the Python module rather than Logic 2 itself.

@bagjason I’m trying to reproduce this now, but I haven’t had any luck yet. I haven’t tried your latest example that starts/stops the application each time. If you are able to share your captures (not always possible, so I understand if not), that may help as well.

Also, are you seeing the data column in the data table itself when you see the export fail to include the data column?

image

Hi @huffman,

The data column is definitely there for all of the files in Logic 2 but as of the 2nd CSV exports the data column is missing from the CSV…

Here are the test capture files:

Test captures.zip (2.8 MB)

Thanks! I am able to reproduce it over here now. Some notes:

  • I see missing columns regardless of the order in which captures are exported. I think the issue is partly related to the length of the capture (the first capture is ~5 seconds, the rest seem to be over 10s)
  • The issue does not seem to occur if the sidebar is open
  • Also - the serial analyzer settings in the script look incorrect - I am seeing framing errors, but I can adjust them to match your results - maybe you have local changes that weren’t in there? Not a huge deal as I can still reproduce the issue

Can you try opening the analyzer sidebar before running your script to see if the issue persists? I will be looking into the root cause of that so we can get this fixed for the next release.

@huffman Ahh sorry, the baud rate should 15,625. I sanitised the example Python script to a more common value because it was an odd baud rate. Please change it to the above.

I can indeed confirm if the analyzer tab is open that it exports perfectly. That’s definitely an odd one :joy:

I can indeed confirm if the analyzer tab is open that it exports perfectly. That’s definitely an odd one :joy:

@bagjason Excellent! And yes, it’s a weird one, and fortunately I know what the issue is now - specifically there are 2 locations where we track the column list, one of which is tied to the UI, and is what the export is based on. That list is only updated when the UI is open. I will be working on getting that fixed for the next release.

Thanks for the help in tracking this down!

Ryan

1 Like