saleae / SaleaeSocketApi

The Saleae software includes a socket based interface for scripting and automation applications.
73 stars 35 forks source link

Export_Data2 only contains 0&1? #11

Open OOYUKIOO opened 5 years ago

OOYUKIOO commented 5 years ago

Hi,

I'm trying to export only digital channels to a CSV file after capture finishes. I was expecting the exported file to contain actual data captured (i.e hex numbers), but all it has were 0 and 1's. Is this the expected behavior? Or did I miss something in setting up the Saleae client?

Here is my set up:

            //attempt to connect with socket.
            String host = "127.0.0.1";
            String port_str = "10429";
            int port = int.Parse(port_str);
            Console.WriteLine("Connecting...");
            try
            {
                Client = new SaleaeClient(host, port);
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error while connecting: " + ex.Message);
                return;
            }
            StringHelper.WriteLine("Connected");

            // Start capture
            Client.SetCaptureSeconds(12);
            Client.Capture();
            Client.ExportData2(export_setting, true, false);

And here is my export setting:

export_setting = new ExportDataStruct
            {
                FileName = OUTPUT_PATH + getFileName(),
                DataExportMixedExportMode = DataExportMixedModeExportType.DigitalOnly,
                ExportChannelSelection = DataExportChannelSelection.SpecificChannels,
                DigitalChannelsToExport = getAllDigitalChannels(),
                SamplesRangeType = DataExportSampleRangeType.RangeAll,
                DataExportType = DataExportType.ExportCsv,
                CsvIncludeHeaders = CsvHeadersType.CsvIncludesHeaders,
                CsvDelimiterType = CsvDelimiterType.CsvComma,
                CsvOutputMode = CsvOutputMode.CsvOneColumnPerBit,
                CsvDisplayBase = CsvBase.CsvHexadecimal,
                CsvTimestampType = CsvTimestampType.CsvTime,
                CsvDensity = CsvDensity.CsvTransition
            };

Any help would be greatly appreciated, thank you in advance!

jpassmor commented 5 years ago

Unless you're using a protocol analyzer all Digital data is either a 0 or 1 since the channel has no context other than on-off. If you have hex numbers presumably those are being defined by an analyzer that is looking at multiple digital lines to determine a hexadecimal value. Analyzer data can be exported using export_analyzer