Export CAN data table with the actual data?

Hello!

I am attempting to automate some CAN based scenario tests.

This code snippet generates a csv without any data present (the data fields are empty):

        can_analyzer_1 = capture.add_analyzer(
            'CAN',
            label=f'CAN1',
            settings =
            {
                'CAN': 0,
                'Bit Rate (Bits/s)': 125000
            }
        )
        automation.DataTableExportConfiguration(can_analyzer_1, automation.RadixType.HEXADECIMAL)

.
. # Capture data
.
        # Export CAN1 analyzer data to a CSV file
        can1_analyzer_export_filepath = os.path.join(saleae_output_dir, 'can1_data_analyzer_sample.csv')
        capture.export_data_table(
            filepath=can1_analyzer_export_filepath,
            analyzers=[can_analyzer_1],
            iso8601_timestamp=True
        )
        print(f"{can1_analyzer_export_filepath = }")

However when doing the export data table feature manually (see: Exporting Data | Saleae Support) I manage to get the data available in the csv file.

After some investigation I noticed that the manual export produces better/more correct data (also using hex values instead of int).

Any ideas how to make the automatic export produce the same content?

@henrikfritzonsund A race condition is likely occurring, and I suspect your capture might be long enough such that data is being exported before all data has been processed for decoding. In other words, the data table is likely not yet ready to be exported. This is likely our fault (we should provide a means to block execution until analyzer processing has been completed).

Can you try adding a short delay before exporting your data to see if that helps?

For an example, the user below ran into the same issue and a 250 ms delay before exporting helped.