Converter for your Rigol Oscilloscope .CSV files to LtSpice

Related tags

Utility rigol2spice
Overview

rigol2spice

A program to convert Rigol oscilloscope's .CSV files to a format readable by LTspice.

Your Rigol oscilloscope can output .CSV files that capture a waveform, this program reads the .CSV file and converts it to a PWL (piecewise linear) format.

YouTube video

YouTube demo/instructions

How to use (simple)

  1. Acquires waveform on your machine, after you have acquired a waveform, use the Storage key to save it to CSV file format and store it on a pen drive. Note that you can have more than one channel in a CSV file, but a PWL file can only have one signal. Also, large captures will take a long time to be processed both this program and LTSpice.

  2. Download or compile the program from the releases (binaries provided only for Windows x64 at the moment) and decompress the files to a folder in your computer (e.g. C:\rigol2spice), make sure you remember the folder you decompressed the files to.

  3. To Run, insert the pen-drive on your PC, open Windows's command prompt and execute the program with the argument being the path to the .CSV file, e.g. if your pen-drive is the D: drive and the file-name is NewFile1.csv:

    C:\rigol2spice\rigol2spice.exe D:\NewFile1.csv

    The program will run and will output the PWL data points to the standard output (screen). If you want to save to a file, use the > operator and specify the name of the file, e.g.:

    C:\rigol2spice\rigol2spice.exe D:\NewFile1.csv > D:\PWLFile.txt

    To see how long your capture lasts, open the generated file in a text editor and check the last line.

  4. Load the file in LTSpice. Insert a voltage or current source in your design, right click on the component and click the Advanced button, in the dialog that appears. Select PWL FILE option and click the Browse button to select your PWL file. LTSpice should parse the file and use your waveform in the simulation.

How to use (multiple channels)

First, note that a Rigol .CSV file can have information of multiple channels, but a LTspice PWL file can have only one channel.

By default, the program reads only the CH1 channel. To see what channels a .CSV contains, run the program with the -a flag:

C:\rigol2spice\rigol2spice.exe -a D:\NewFile2.csv

The output:

Channels:
    CH1 (unit: Volt)
    CH2 (unit: Volt)
Time step: 0.00000000005

Now if you want to use the CH2, run the program with the --channel option, then a space, then the channel name, note that channel names are CaSe-SeNsItIvE for this program:

C:\rigol2spice\rigol2spice.exe --channel CH2 D:\NewFile2.csv > D:\CH2.txt

Usage reference

USAGE: rigol2spice <filename> [--channel <channel>] [--analyse]

ARGUMENTS:
<filename>              The filename of the .csv file from your oscilloscope

OPTIONS:
-c, --channel <channel> The label of the channel to be processed (case
                        sensitive) (default: CH1)
-a, --analyse           Analyse the file's header and quit
-h, --help              Show help information.

Building

To build this program, it's just a simple Swift package, you should be able to build it with a simple on macOS, Windows or Linux:

swift build

Legal

I'm not affiliated with Rigol and this is not a project related to Rigol Technologies, Inc.

You might also like...
Monitor changes to files and directories using kernel event notifications (kqueue) in Swift

SKQueue SKQueue is a Swift libary used to monitor changes to the filesystem. It wraps the part of the kernel event notification interface of libc, kqu

HxSTLParser is a basic STL parser capable of loading STL files into an SCNNode

HxSTLParser HxSTLParser is a basic STL parser capable of loading STL files into an SCNNode. Installing Via Carthage Just add it to your Cartfile githu

Creates SpriteKit game maps from TMX Map files.
Creates SpriteKit game maps from TMX Map files.

PEMTileMap is a Swift package that generates SpriteKit game maps from TMX Map files. Maps, layers, tiles and objects are automatically rendered as SKN

Automatically set your keyboard's backlight based on your Mac's ambient light sensor.
Automatically set your keyboard's backlight based on your Mac's ambient light sensor.

QMK Ambient Backlight Automatically set your keyboard's backlight based on your Mac's ambient light sensor. Compatibility macOS Big Sur or later, a Ma

LibAuthentication will simplify your code when if you want to use FaceID/TouchID in your tweaks.

LibAuthentication will simplify your code when if you want to use FaceID/TouchID in your tweaks.

RNH Tracker is a GPS logger for iOS (iPhone, iPad, iPod) Track your location and send your logs to RNH Regatta :-)

RNH Tracker for iOS + WatchOS RNH Tracker is a GPS logger for iOS (iPhone, iPad, iPod) with offline map cache support. Track your location, add waypoi

Record your position and export your trip in GPX with GPS Stone on iOS.

GPS Stone Register your trips and export them as GPX files. Notes We currently have included a UIRequiredDeviceCapabilities with a location-services v

Add “Launch at Login” functionality to your macOS app in seconds
Add “Launch at Login” functionality to your macOS app in seconds

LaunchAtLogin Add “Launch at Login” functionality to your macOS app in seconds It's usually quite a convoluted and error-prone process to add this. No

LifetimeTracker can surface retain cycle / memory issues right as you develop your application
LifetimeTracker can surface retain cycle / memory issues right as you develop your application

LifetimeTracker Bar style Circular style LifetimeTracker can surface retain cycle / memory issues right as you develop your application, and it will s

Releases(2.2.1)
Owner
Rui Carneiro
Rui Carneiro
A simple, but efficient CSV Parser, written in Swift.

CSV CSV.swift is a powerful swift library for parsing CSV files that supports reading as [String], [String: String] and Decodable, without sacrificing

Ben Koska 4 Nov 28, 2022
Taking a string containing a csv file and split it into records (aka lines) containing fields of data (aka Array of SubStrings)

Swift .csv parser Taking a string containing a csv file and split it into records (aka lines) containing fields of data (aka Array of SubStrings). Par

Matthias 0 Dec 29, 2021
Unit converter in Swift

Scale ❤️ Support my app ❤️ Push Hero - pure Swift native macOS application to test push notifications PastePal - Pasteboard, note and shortcut manager

Khoa 324 Dec 10, 2022
Unit converter in Swift

Unit converter in Swift

Khoa 324 Jun 29, 2022
Zip - A Swift framework for zipping and unzipping files. Simple and quick to use. Built on top of minizip.

Zip A Swift framework for zipping and unzipping files. Simple and quick to use. Built on top of minizip. Usage Import Zip at the top of the Swift file

Roy Marmelstein 2.3k Jan 3, 2023
ZIP Foundation is a library to create, read and modify ZIP archive files.

ZIP Foundation is a library to create, read and modify ZIP archive files. It is written in Swift and based on Apple's libcompression for high performa

Thomas Zoechling 1.9k Dec 27, 2022
Merges a given number of PDF files into one file using the PDFKit framework

Titanium iOS PDF Merge Merges a given number of PDF files into one file using the PDFKit framework Requirements iOS 11+ Titanium SDK 9+ API's Methods

Hans Knöchel 6 Jan 26, 2022
Validate iOS, Android, and Mac localizations. Find errors in .strings, .stringsdict, and strings.xml files.

Locheck An Xcode and Android localization file validator. Make sure your .strings, .stringsdict, and strings.xml files do not have any errors! What do

Asana 73 Dec 13, 2022
Steps and files needed to reproduce a CSP bug in Safari Web Extensions

CSP Safari bug repro There appears to be a discrepancy between how Safari handles CSP policies for extension pages compared to how other browsers do s

Brian Birtles 0 Nov 6, 2021
Parse iOS mobile provisioning files into Swift models

SwiftyProvisioningProfile This library provides a way to decode a .mobileprovision file into a Swift model. Installation The recommended installation

James Sherlock 60 Nov 25, 2022