Saleae Support
HomeDownloadUser ForumContact Us
  • Saleae Support
  • Orders & Shipping
    • Place an Online Order
    • Place a Purchase Order (PO)
    • Get a Quote
    • Check your Order Status
    • Distributors
    • Pricing and Availability
    • Discounts
    • Tax & VAT Exemption
    • Saleae Business Information
    • Shipping Policy
    • Receiving Invoices
    • Sales FAQ
      • What Is Included with the Product?
      • What Accessories Should I Purchase with My Device?
      • Is the Saleae Software Sold Separately?
      • Does Saleae Have a Trade-In or Upgrade Plan?
      • How Can I Find the Current Status of My Order?
      • Part Numbers, ECCN, HS Codes, and Country of Origin
      • Discontinued Products
      • International Customs and Duty Information
      • Does Saleae Offer Demo Units or Units on Loan?
      • When Is My Card Charged?
      • Unable to Ship to PO Box Error
      • Referred a Friend? Email Us!
      • Does Saleae Provide Drop-Shipping Service?
  • Getting Started
    • Setup
    • Configure
    • Record
    • Navigate
    • Measure
    • Trigger
    • Protocols
  • User Guide
    • Product Summary
    • Safety & Warranty
    • Supported Voltages
    • Device Calibration
    • Using Logic
      • Navigating the Software
      • Connecting the Logic Analyzer
      • Logic Accessories
      • Device Settings
      • Capture Modes
      • Navigating Your Data
      • Time Bar Settings
      • Measurements, Timing Markers & Notes
      • Capture & Preset File Management
      • Exporting Data
      • Delete Part of your Capture
      • Analyzers
      • Data Table & Terminal View
      • Color Themes
      • Demo Mode
      • Software Glitch Filter
      • Keyboard Shortcuts
      • Automatic Updates
      • Message Us Directly
  • Software
    • Supported Operating Systems
    • Download
    • Installation
    • Firmware Updates
    • Driver Install
    • Legacy Software
      • Logic 1.x Download (Deprecated)
      • Logic 1.x Installation (Deprecated)
      • Logic 1.x Changelog (Deprecated)
      • Logic 1.x User Guide (Deprecated)
  • Protocol Analyzers
    • Supported Protocols
    • Analyzer User Guides
      • Async Serial Analyzer - User Guide
        • Decode UART
        • Decode RS-232, RS-485, & RS-422
      • SPI Analyzer - User Guide
      • I2C Analyzer - User Guide
      • CAN Analyzer - User Guide
      • Simple Parallel Analyzer - User Guide
      • I2S / PCM Analyzer - User Guide
      • DMX-512 Analyzer - User Guide
      • SMBus Analyzer - User Guide
      • Decode Differential and High Voltage Data
  • Software Extensions
    • Extension Installation
    • Create and Use Extensions
    • High-Level Analyzer (HLA) Extensions
      • Shared High Level Analyzers (HLAs)
    • Measurement Extensions
      • Analog Measurement Extensions
      • Digital Measurement Extensions
    • Extension File Format
    • About Third-Party Extensions
    • Disabling Marketplace Extensions
    • Publish an Extension
    • HLA - Analyzer Frame Format
      • Async Serial - Frame Format
      • I2C - Frame Format
      • SPI - Frame Format
      • CAN - Frame Format
      • Manchester - Frame Format
      • 1-Wire - Frame Format
      • Async RGB LED - Frame Format
      • Simple Parallel - Frame Format
      • LIN - Frame Format
      • I2S - Frame Format
    • API Documentation
  • Automation & Analyzer SDK
    • Automation API - Logic 2
    • Automation API - Legacy Logic 1.x
    • Protocol Analyzer SDK
      • FrameV2 / HLA Support - Analyzer SDK
      • Rename a Custom Analyzer
    • More Information on our SDKs
      • Can I Access Raw Data in Real Time?
      • Migrate Code to the New Analyzer SDK
      • Sharing Custom Low-Level Analyzer (LLA) Code
      • VB.NET Support for Automation
  • Datasheets & Specifications
    • Datasheets
    • Logic Hardware Revisions
    • Logic Dimensions
    • Compliance Documents
  • Troubleshooting
    • Installation Errors
    • The Software Fails to Launch
    • The Software Crashes
    • Logic is Not Detected
    • Getting your Machine ID
    • Getting your Software Crash Logs
    • Getting the Console Output
    • Location of Your Config File
    • Error Message: ReadTimeout
    • The Captured Data Looks Incorrect
    • The Captured Data is Corrupted
    • A Protocol Analyzer Produces Unexpected Results
    • The 'Waiting for Trigger' Window Never Closes
    • Device USB VID and PID Information
    • Error Message: Out of Memory Exception Was Thrown
    • PC Performance Issues with Logic
    • Data Export Is Not Working
    • Error Message: A device was found, but the software was unable to access it
    • Trouble Downloading the Latest Software
    • Logic Does Not Connect over USB 3.0
    • Why Am I Seeing Spikes in the Digital Capture?
    • Logic Interferes with My Circuit Operation
    • The Add Analyzer Menu Is Not Displaying
    • Other Drivers Interfere with Logic's Operation
    • The Maximum Sample Rate is Not Selectable
    • The Digital and Analog Recording on the Same Channel Appear Different
    • Advanced USB Debugging for USB 3.0 Users with Linux Kernels 3.3 and Older
    • Saving or Loading Anything Crashes the Software
    • Error Message: The application was unable to start correctly (0xc0000005)
    • Memory Usage with Triggered Captures
    • The Cabinet File disk1.cab has an Invalid Digital Signature (Logic 1.x)
    • Software Crashes with Virtual Desktops
    • Pre-Trigger Buffer is Incomplete
    • Linux Shared Memory Crash
    • Missing Files: api-ms-win-crt-runtime-l1-1-0.dll or msvcp140.dll
    • Known Issues on OS X
    • A Measurement Appears Incorrect
    • All Known Issues
    • USB 3.0 Cable Customer Notice (2017)
    • Warning Message: Logic Pro is running as a USB 2.0 device
    • Software Issues with Encryption Products
    • Linux Permission Requirements for Logic Software
    • My Rise Time and Fall Time Measurements Seem Incorrect
    • The Analog Waveform Loads Very Slowly after Capture Is Complete
    • Input Channels are Missing
    • Exported MATLAB File Does Not Open
    • Saleae Logic LED Blinks Red
    • Crashes Caused by macOS Mojave (10.14)
    • Troubleshooting Signal Crosstalk
    • Error Message: DeviceSetupFailure
    • Error Message: Unable to detect WebGL and Other GPU Issues
    • Warning Message: Unsupported Version
    • Error Function: Device2::SetupDevice
    • Warning Message: Possible USB Host Controller Problem Detected
    • Error Message: StartCommandError
    • Logic 2 Error Messages
    • PC Detection Test
    • CentOS Compatibility Issues
    • Error Message: Failed to Load Extension
    • CSV Export is Slow
    • Set an Analyzer Starting Point in your Capture
    • Logic 2 is Consuming Disk Space
    • Connection Conflicts with USB Debuggers
    • PC Restart Causes Logic to Disconnect
    • HLA Fails to Display Special Characters
    • Data Table Shows Incorrect Values
    • Error Message: Failed to Load Custom Analyzer
    • Error Message: Capture Stopped
    • Error Loading Marketplace Extensions
    • Error: Capture stopped because backlog data exceeded 90%
    • This Analyzer's Native Export is Not Supported in Logic 2
    • Mouse Scrolling Issues
    • Error: A device was found, but it was removed before initialization completed
    • Error: An unknown error occurred during device connection
    • Visual Studio Error: Failed to Launch Debug Adapter
    • VS Code Fails to Launch Python Automation API Script
    • Analog Waveforms Do Not Appear on Linux
    • Reinstall USB Host Controller Drivers
  • FAQ
    • Technical FAQ
      • System Requirements for Saleae Products
      • What Is the Normal Behavior of the LED?
      • What Is the Difference between Logic/Logic16 (Gen1) and Logic 8/Pro 8/Pro 16 (Gen2)?
      • Recommended USB 3.0 Host Controller Cards
      • Device Settings Configuration Tips
      • What Is the Worst Case Channel to Channel Skew?
      • What is Asynchronous Sampling?
      • Which Saleae Products Can Decode 4-Bit Parallel LCD Communications?
      • How Can I Compare Two Clock Signals for Synchronization and Drift?
      • Converting I2S/PCM Captures into Audio
      • My Capture Shows an Uneven Duty Cycle
      • Can I Create or Edit .logicdata Files?
      • Can Saleae Logic Run on ARM / Apple Processors?
      • What Annotations Are Supported?
      • Time & Memory Saving Tools
      • How Can I Record Power Consumption?
      • Moving Logic to Its Own Host Controller
      • How Long Does It Take to Save a File?
      • XMonad on Linux Causes Issues
      • What Is the Maximum Bandwidth of Logic?
      • How Long Can I Record Data?
      • Can I Export Protocol Results Between Timing Markers?
      • Can I Generate an Analog Graph from Digital Data?
      • Time Measurement Error
      • Can These Products Replace an Oscilloscope?
      • Can I Use Multiple Logics on a Single PC?
      • Native Windowing Features Are Not Working Such as Snap or Gestures
      • Opening .logicdata Capture Files
      • How to Choose the Right Logic Analyzer for You
      • Saleae Open Source Support
      • How to Trigger the End of a Capture Instead of the Start
      • Using the Hardware with USB Extension Cables, Through Virtual Machines, or Ethernet Extenders
      • Are the Ground Pins Required for Each Input Used?
      • Can Saleae Products Output Data?
      • Resolution of the Analog Inputs
      • What Sampling Rate Should I Use?
      • Can I Share Data Captures with Others?
      • Binary Export Format (Digital) - Logic 1.x
      • MATLAB Data Export Format - Legacy Logic 1.x
      • Recording Multiple Protocols at the Same Time
      • Changing the Display Radix (Base)
      • Which Logic Analyzer Should I Get?
      • How to View and Debug Firmware Variables, State, and Function Calls
      • Using Saleae Logic Devices with Third-Party Pattern Generators
      • Can Logic Operate with a Full-Speed USB Isolator?
      • Which Saleae Devices Support Analog Recording?
      • How to Manage Protocol Analyzers when Using the Socket API
      • How to Export Serial Protocol Results to a Raw Binary File
      • How to Trigger On a Pulse with No Maximum Time Limit - Logic 1.x
      • Finding Your USB 3.0 Host Controller Information
      • Logic Reports Different USB Current Requirements
      • Is It Possible to Adjust the Logic Thresholds for the Digital Inputs?
      • Why Does Channel 0 Use a Black Wire?
      • Software Shows Multiple Logic Analyzers Attached
      • Are the Input Channels Isolated from Each Other?
      • Are There Feature Differences in the Software when Different Logic Analyzers Are Used?
      • Packet Level Decoding Support in the Analyzer SDK
      • What Higher-Level Protocol Analysis Features Are Available?
      • Support for USB 3.0 and USB 3.1
      • How Can I Compare Signals from Different Captures?
      • Do the Saleae Logic Analyzers Support Trigger Out?
      • Why is the Length of my Capture Incorrect?
      • The Options Button is Missing
      • Can I Change the Voltage Range of the Analog Inputs?
      • How Does the ASCII Radix Display Characters?
      • Do I Have a USB 3.0 Port?
      • What Is the Best Way to Compare Similar Sequences of Protocol Data?
      • Which Version of the Software Should I Use?
      • Import Custom Low Level Analyzer
      • OSX Analyzer SDK Xcode Setup
      • Can Custom Analyzers Process Analog Channels?
      • Automating Long Overnight Captures
      • What Options Are There to Export Multiple Protocol Analyzer Results into the Same File?
      • Do the Saleae Devices Support AC Coupling?
      • Suggestions for Capturing Multiple Instances of a Triggered Event Automatically
      • How Many Protocol Analyzers Can Be Used at Once?
      • Is It Possible to Run the Saleae Software on a PC without SSE2 Instructions?
      • Is It Possible to Import Data into the Logic Software?
      • How Do I Convert Exported CSV Analog Data in Voltages?
      • Is There Cross-Platform Support for the SaleaeSocketApi C# Project
      • Why Does Logic Get Warm?
      • Binary Export Format (Analog) - Logic 1.x
      • Electrical Isolation Suggestions
      • FCC and CE Testing Recommendations
      • 'Save Capture' and 'Export Data' is Disabled in the Software
      • File Format Description for Exporting Protocol Analyzer Results
      • Is There a Newer Version of the Software Available?
      • Is There a Way to Change the Window Resolution?
      • How Can I Extract Recorded Data Using Socket API?
      • Does the Software Support Windows 10 Tablets or Windows RT Tablets?
      • Standalone Software Information
      • Does the Saleae Software Support the Original Logic and Logic 16?
      • Timing Markers Disappear When I Start a New Capture
      • What Sample Rate Settings Are Available? Can I Sample at a Slower Rate?
      • How Do I Differentiate Data in the Export File when Duplicate Analyzers Are Used?
      • Running Multiple Versions of the Software
      • Test Clip Differences - Gen 1 & Gen 2
      • USB-C Cable Recommendations
      • Is My Capture Data Private?
      • Ethernet Connectivity Suggestions
      • Binary Export Format - Version 0
      • Binary and CSV Export Formats - 2025 Update
      • Viewing I2C Addresses as 8-bit
      • Can I use Python Packages in my Custom Extension?
      • Are the Inputs Synchronously Sampled or Sweep Sampled?
      • Is Logic Affected by the Log4j Exploit?
      • Connecting Remotely with SSH
      • Is Silent Installation Supported?
      • Is the .sal File Format Documented?
      • Export Data via Socket API
      • Running Logic in a CI Environment on Windows with the SYSTEM Account
    • General FAQ
      • How Do I Get More Help on an Issue That's Outside the Scope of Saleae Support?
      • How to Identify Each Saleae Device
      • License for the Saleae Logic Software, SDKs, and APIs
      • How Do You Pronounce Saleae?
      • How to Create Project Content for Saleae
  • Returns & Warranty
    • Submit a Warranty Claim
  • Community
    • Ideas & Feedback
    • User Forum
    • Community Projects
    • Community Created Accessories
    • Community Shared Analyzers
  • Tutorials
    • Oscilloscope Tutorial
    • Logic Analyzer Tutorial
    • Learning Portal
      • Digital Protocols
        • Learn Asynchronous Serial
        • Learn I2C - Inter-Integrated Circuit
        • Learn SPI - Serial Peripheral Interface
        • Learn CAN – Controller Area Network
        • Digital MultipleX (DMX512)
        • Manchester
        • 1-Wire
        • Learn I2S / PCM
        • Management Data Input/Output (MDIO)
        • BiSS C
        • HDMI Consumer Electronics Control (CEC)
        • PS/2 Keyboard/Mouse
        • Universal Serial Bus (USB) 2.0
        • Single-Wire Interface (SWI)
        • Simple Parallel
        • Local Interconnect Network (LIN)
        • Joint Test Action Group (JTAG)
      • Common Acronyms and Definitions
      • What is a Glitch?
      • What is RAM? Why Does Logic Use it?
      • What is a Display Radix?
      • What is Data Bandwidth? Can I Reduce this in Logic?
    • Example Projects
      • STM32 Nucleo Board - Digital Signals
      • STM32 Nucleo Board - Analog Signals
      • STM32 Nucleo Board - Analyzing UART
      • STM32 Nucleo Board - Analyzing SPI
      • STM32 Nucleo Board - Analyzing I2C
Powered by GitBook
On this page
  • Binary Export Format (Version 1)
  • Python Parsing Examples
  • Digital Data Parser
  • Analog Data Parser
  • CSV Export Format
Edit on GitHub
Export as PDF
  1. FAQ
  2. Technical FAQ

Binary and CSV Export Formats - 2025 Update

The Logic 2 binary and CSV export file formats are being updated to support new Saleae products.

Existing products, including Logic 8, Logic Pro 8, and Logic Pro 16, still use the original binary export (version 0), however those will be updated to support the new export format soon.

Version 0 of the binary export, still in use for Logic 8, Logic Pro 8, and Logic Pro 16, is documented in the support article here: Binary Export Format - Version 0

Binary Export Format (Version 1)

Logic 2 exports both digital and analog data in binary formats that start with a common header to identify the file type and version.

Key Properties:

  • All multi-byte values are in little-endian byte order

  • Floating point values are IEEE 754 format

  • Current version is 1 (supports gaps and multiple chunks)

  • Version 0 files are still used for non-MSO devices

Common Header

All binary export files start with this header:

byte[8] identifier;   // Always "<SALEAE>"
int32 version;        // Current version is 1
int32 type;           // 0 = Digital, 1 = Analog

Data Types:

  • 0 - Digital data

  • 1 - Analog data

Digital Binary Format (Version 1)

The current digital format supports gaps in data and multiple sampling configurations:

byte[8] identifier;       // "<SALEAE>"
int32 version;            // 1
int32 type;               // 0 (Digital)

uint64 chunk_count;       // Number of data chunks
for each chunk in chunk_count:
    uint32 initial_state;     // 0 = Low, 1 = High
    double sample_rate;       // Samples per second
    double begin_time;        // Start time in seconds
    double end_time;          // End time in seconds
    uint64 num_transitions;   // Number of state changes
    
    for each transition in num_transitions:
        double transition_time;   // Time of state change in seconds

Notes:

  • Each chunk represents a continuous segment of data

  • Gaps between chunks indicate missing data, usually due to channels being turned off, but can also occur if USB bandwidth is saturated

  • State alternates with each transition (initial_state → !initial_state → initial_state...)

Analog Binary Format (Version 1)

The current analog format supports multiple waveforms with trigger information:

byte[8] identifier;       // "<SALEAE>"
int32 version;            // 1
int32 type;               // 1 (Analog)

uint64 waveform_count;    // Number of waveforms
for each waveform in waveform_count:
    double begin_time;       // Start time in seconds
    double trigger_time;     // Trigger time in seconds
    double sample_rate;      // Samples per second
    int64 downsample;        // Downsample factor
    uint64 num_samples;      // Number of voltage samples
    
    for each sample in num_samples:
        float voltage;       // Voltage value in volts

Notes:

  • trigger_time indicates when the trigger occurred

  • downsample factor indicates if data was decimated during export

Python Parsing Examples

Digital Data Parser

import struct
import sys
from dataclasses import dataclass
from typing import List, BinaryIO, Optional

# Constants
TYPE_DIGITAL = 0
TYPE_ANALOG = 1

@dataclass
class DigitalChunk:
    """Represents a continuous segment of digital data"""
    initial_state: int  # 0 = Low, 1 = High
    sample_rate: Optional[float]  # Samples per second (None for version 0)
    begin_time: float  # Start time in seconds
    end_time: float  # End time in seconds
    num_transitions: int  # Number of state changes
    transition_times: List[float]  # Times when state changes occur

@dataclass
class DigitalData:
    """Complete digital data export containing one or more chunks"""
    chunks: List[DigitalChunk]

def parse_digital_v1(f: BinaryIO) -> DigitalData:
    """Parse Logic 2 digital binary format version 1"""
    
    # Parse header
    identifier = f.read(8)
    if identifier != b"<SALEAE>":
        raise ValueError("Not a Saleae file")
    
    version, datatype = struct.unpack('<ii', f.read(8))
    
    if datatype != TYPE_DIGITAL:
        raise ValueError(f"Expected digital data, got type {datatype}")
    
    if version not in [0, 1]:
        raise ValueError(f"Unsupported version: {version}")
    
    chunks = []
    
    if version == 0:
        # Version 1 format - single chunk without chunk count
        chunk_count = 1
    else:
        # Version 1 format
        chunk_count, = struct.unpack('<Q', f.read(8))
    
    for _ in range(chunk_count):
        # Parse chunk header
        initial_state, = struct.unpack('<I', f.read(4))
        
        if version >= 1:
            sample_rate, = struct.unpack('<d', f.read(8))
        else:
            sample_rate = None
            
        begin_time, end_time, num_transitions = struct.unpack('<ddQ', f.read(24))
        
        # Parse transition times
        transition_times = []
        for _ in range(num_transitions):
            time, = struct.unpack('<d', f.read(8))
            transition_times.append(time)
        
        chunks.append(DigitalChunk(
            initial_state=initial_state,
            sample_rate=sample_rate,
            begin_time=begin_time,
            end_time=end_time,
            num_transitions=num_transitions,
            transition_times=transition_times
        ))
    
    return DigitalData(chunks=chunks)

def print_digital_data(data: DigitalData):
    """Print digital data in human readable format"""
    print(f"Digital data with {len(data.chunks)} chunk(s)")
    
    for i, chunk in enumerate(data.chunks):
        print(f"\n--- Chunk {i} ---")
        initial_state_str = 'Low' if chunk.initial_state == 0 else 'High'
        print(f"Initial state: {initial_state_str}")
        if chunk.sample_rate:
            print(f"Sample rate: {chunk.sample_rate} Hz")
        print(f"Time range: {chunk.begin_time:.6f}s to {chunk.end_time:.6f}s")
        print(f"Transitions: {chunk.num_transitions}")
        
        # Show state changes
        current_state = chunk.initial_state
        print(f"  {chunk.begin_time:>15.6f}s: {'Low' if current_state == 0 else 'High'}")
        
        for trans_time in chunk.transition_times:
            current_state = 1 - current_state  # Toggle state
            print(f"  {trans_time:>15.6f}s: {'Low' if current_state == 0 else 'High'}")

# Usage example
if __name__ == '__main__':
    if len(sys.argv) != 2:
        print("Usage: python parse_digital.py <digital_file.bin>")
        sys.exit(1)
    
    filename = sys.argv[1]
    with open(filename, 'rb') as f:
        data = parse_digital_v1(f)
    
    print_digital_data(data)

Analog Data Parser

import struct
import sys
from dataclasses import dataclass
from typing import List, BinaryIO

# Constants
TYPE_DIGITAL = 0
TYPE_ANALOG = 1

@dataclass
class AnalogWaveform:
    """Represents a single analog waveform with samples"""
    begin_time: float  # Start time in seconds
    trigger_time: float  # Trigger time in seconds
    sample_rate: float  # Samples per second
    downsample: int  # Downsample factor
    num_samples: int  # Number of voltage samples
    samples: List[float]  # Voltage values in volts

@dataclass
class AnalogData:
    """Complete analog data export containing one or more waveforms"""
    waveforms: List[AnalogWaveform]

def parse_analog_v1(f: BinaryIO) -> AnalogData:
    """Parse Logic 2 analog binary format version 1"""
    
    # Parse header
    identifier = f.read(8)
    if identifier != b"<SALEAE>":
        raise ValueError("Not a Saleae file")
    
    version, datatype = struct.unpack('<ii', f.read(8))
    
    if datatype != TYPE_ANALOG:
        raise ValueError(f"Expected analog data, got type {datatype}")
    
    if version not in [0, 1]:
        raise ValueError(f"Unsupported version: {version}")
    
    waveforms = []
    
    if version == 0:
        # Version 0 format - single waveform
        begin_time, sample_rate, downsample, num_samples = struct.unpack('<dQQQ', f.read(32))
        trigger_time = begin_time  # No separate trigger time in v0
        
        # Read samples
        samples = []
        for _ in range(num_samples):
            voltage, = struct.unpack('<f', f.read(4))
            samples.append(voltage)
        
        waveforms.append(AnalogWaveform(
            begin_time=begin_time,
            trigger_time=trigger_time,
            sample_rate=float(sample_rate),
            downsample=downsample,
            num_samples=num_samples,
            samples=samples
        ))
    else:
        # Version 1 format
        waveform_count, = struct.unpack('<Q', f.read(8))
        
        for _ in range(waveform_count):
            begin_time, trigger_time, sample_rate, downsample, num_samples = struct.unpack('<dddqQ', f.read(40))
            
            # Read samples
            samples = []
            for _ in range(num_samples):
                voltage, = struct.unpack('<f', f.read(4))
                samples.append(voltage)
            
            waveforms.append(AnalogWaveform(
                begin_time=begin_time,
                trigger_time=trigger_time,
                sample_rate=sample_rate,
                downsample=downsample,
                num_samples=num_samples,
                samples=samples
            ))
    
    return AnalogData(waveforms=waveforms)

def print_analog_data(data: AnalogData, max_samples: int = 10):
    """Print analog data in human readable format"""
    print(f"Analog data with {len(data.waveforms)} waveform(s)")
    
    for i, waveform in enumerate(data.waveforms):
        print(f"\n--- Waveform {i} ---")
        print(f"Begin time: {waveform.begin_time:.6f}s")
        print(f"Trigger time: {waveform.trigger_time:.6f}s")
        print(f"Sample rate: {waveform.sample_rate} Hz")
        print(f"Downsample factor: {waveform.downsample}")
        print(f"Number of samples: {waveform.num_samples}")
        
        # Calculate actual sample period
        actual_sample_period = waveform.downsample / waveform.sample_rate
        
        print(f"\nFirst {min(max_samples, len(waveform.samples))} samples:")
        print(f"{'Time (s)':>15} {'Voltage (V)':>12}")
        
        for j, voltage in enumerate(waveform.samples[:max_samples]):
            sample_time = waveform.begin_time + (j * actual_sample_period)
            print(f"{sample_time:>15.9f} {voltage:>12.6f}")
        
        if len(waveform.samples) > max_samples:
            print(f"... and {len(waveform.samples) - max_samples} more samples")

# Usage example
if __name__ == '__main__':
    if len(sys.argv) != 2:
        print("Usage: python parse_analog.py <analog_file.bin>")
        sys.exit(1)
    
    filename = sys.argv[1]
    with open(filename, 'rb') as f:
        data = parse_analog_v1(f)
    
    print_analog_data(data)

CSV Export Format

Digital CSV Format

Digital data is exported as a multi-channel time-series showing state changes across all channels:

Time [s],Channel 0 :),Channel 1 :),Ch2
0.000000000,0,1,X
0.125000000,0,0,X
0.250000000,1,1,X
0.500000000,0,0,1
0.625000000,1,1,0
0.750000000,0,1,0
0.875000000,1,0,1
1.000000000,X,X,X

Format:

  • Header: Time [s],Channel Name 1,Channel Name 2,...

  • Time Column: Timestamp in seconds (floating point)

  • Channel Columns: Digital state values

Values:

  • 0 = Low state

  • 1 = High state

  • X = No data (channel disabled or gap in capture)

Notes:

  • Each row represents a time point where at least one channel changes state

  • Only state transition times are included (not every sample)

  • X indicates missing data due to gaps or disabled channels

  • Time values are relative to the current base time in Logic 2 (usually the start of the capture)

Waveform CSV Format

Waveform data includes trigger timing information along with voltage measurements:

Trigger [s],Time [s],Ch0,Ch1
0.000000000000,0.000000000000,1200.000000,-200.000000
0.062500000000,0.062500000000,1400.000000,300.000000
0.125000000000,0.125000000000,-200.000000,-100.000000
0.187500000000,0.187500000000,300.000000,400.000000
0.000000000000,0.200000000000,,-200.000000
0.062500000000,0.262500000000,,300.000000
0.125000000000,0.325000000000,,-100.000000
0.187500000000,0.387500000000,,400.000000

Format:

  • Header: Trigger [s],Time [s],Channel Name 1,Channel Name 2,...

  • Trigger Column: Time relative to trigger event (floating point seconds)

  • Time Column: Time relative to current base time in Logic 2, usually the start of the capture (floating point seconds)

  • Channel Columns: Voltage measurements

Notes:

  • Each row represents a voltage sample across all channels

  • If there is no voltage data for a channel, the voltage value will be empty

    • This is shown on the second waveform for Ch0 in the example above

PreviousBinary Export Format - Version 0NextViewing I2C Addresses as 8-bit

Last updated 2 days ago