OwonBinfileReader 1.0.0

dotnet add package OwonBinfileReader --version 1.0.0
                    
NuGet\Install-Package OwonBinfileReader -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="OwonBinfileReader" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="OwonBinfileReader" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="OwonBinfileReader" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add OwonBinfileReader --version 1.0.0
                    
#r "nuget: OwonBinfileReader, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=OwonBinfileReader&version=1.0.0
                    
Install OwonBinfileReader as a Cake Addin
#tool nuget:?package=OwonBinfileReader&version=1.0.0
                    
Install OwonBinfileReader as a Cake Tool

logo OWON Binfile Reader

This is a simple library to read OWON oscilloscope binfiles. Most of the code is based on reverse engineering and guestimating so don't use this to build a nuclear powerplant or send people into space with!

Usage

using OwonBinfileReader;

var bfr = new BinfileReader();
var bf = await bfr.ReadAsync(@"/path/to/file.bin");

This will read the binfile and return a Binfile object. This object contains the following properties:

  • MetaData: contains information about the oscilloscope settings and binfile.
  • Measurements: this is an ReadOnlyDictionary<int, double[]>) and contains the measurements per ('displayed') channel.

Tested oscilloscopes

For now this library has only been tested with the Hanmatek DSO1102 which is a rebranded version of the OWON SDS1102 as far as I know and a OWON XDS3104AE. I have found some other .bin files online which worked as well, but you'll have to see for yourself if this library works for you.

File format

Offset Bytes Value Meaning
0 6 SPBXDS Magic header (might be SPBX + DS where DS has some meaning)
6 4 JSON length DWORD Signed integer length of following JSON data
10 Json Length JSON data Contains metadata about the file
10 + Json Length 4 Data Length DWORD Signed integer length of data segment
14 + Json Length Data length Data WORD Signed integer values repeated Data Length / 2 times (because each value is 2 bytes)

This Data Length + Data repeats for each channel where DISPLAY is ON. Then finally an optional segment may follow after the data (End Of Data):

Offset Bytes Value Meaning
EOD 4 INFO Additional information
EOD + 4 4 Unknown DWORD Unknown value
EOD + 8 4 Unknown DWORD Unknown value
EOD + 12 19 Date ISO8601 Date (YYYY-MM-DD HH:MM:SS)
EOD + 31 11 Unknown Unknown / all zeroes

The above segment is not read by this library.

An example of the JSON contained in this file might be:

{
  "TIMEBASE": {
    "SCALE": "200ms",
    "HOFFSET": 120
  },
  "SAMPLE": {
    "FULLSCREEN": 1520,
    "SLOWMOVE": 2000,
    "DATALEN": 1520,
    "SAMPLERATE": "(2.5MS/s)",
    "TYPE": "SAMPle",
    "DEPMEM": "10M"
  },
  "CHANNEL": [
    {
      "NAME": "CH1",
      "DISPLAY": "ON",
      "Current_Rate": 10000,
      "Current_Ratio": 0.78125,
      "Measure_Current_Switch": "OFF",
      "COUPLING": "DC",
      "PROBE": "10X",
      "SCALE": "50.0mV",
      "OFFSET": -201,
      "FREQUENCE": 210.14742,
      "INVERSE": "OFF"
    },
    {
      "NAME": "CH2",
      "DISPLAY": "OFF",
      "Current_Rate": 10000,
      "Current_Ratio": 0.015625,
      "Measure_Current_Switch": "OFF",
      "COUPLING": "DC",
      "PROBE": "10X",
      "SCALE": "1.00mV",
      "OFFSET": 0,
      "FREQUENCE": 210.14742,
      "INVERSE": "OFF"
    },
    {
      "NAME": "CH3",
      "DISPLAY": "OFF",
      "Current_Rate": 10000,
      "Current_Ratio": 0.015625,
      "Measure_Current_Switch": "OFF",
      "COUPLING": "DC",
      "PROBE": "10X",
      "SCALE": "1.00mV",
      "OFFSET": 0,
      "FREQUENCE": 210.14742,
      "INVERSE": "OFF"
    },
    {
      "NAME": "CH4",
      "DISPLAY": "OFF",
      "Current_Rate": 10000,
      "Current_Ratio": 0.015625,
      "Measure_Current_Switch": "OFF",
      "COUPLING": "DC",
      "PROBE": "10X",
      "SCALE": "1.00mV",
      "OFFSET": 0,
      "FREQUENCE": 210.14742,
      "INVERSE": "OFF"
    }
  ],
  "DATATYPE": "SCREEN",
  "RUNSTATUS": "SCAN",
  "IDN": "OWON,XDS3104AE,2308149,V4.0.0",
  "MODEL": "310401101",
  "Trig": {
    "Mode": "SINGle",
    "Type": "EDGE",
    "Items": {
      "Channel": "CH1",
      "Level": "2.50V",
      "Edge": "RISE",
      "Coupling": "DC",
      "HoldOff": "100ns"
    },
    "Sweep": "AUTO"
  },
  "IsSkipIfClosed": true
}

The actual measurement is each 16 bit value � (CurrentRatio / CurrentRate).

Normalization

This library will normalize values to the base unit. So values in mV will be converted to V, values in �s will be converted to s, etc. Where possible values are parsed to enums (e.g. Coupling or Triggermode), bools for ON / OFF values, timespans etc. Values are represented in the double datatype.

Attribution

The logo is composed of the following images:

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 145 3/18/2025