0% found this document useful (0 votes)
306 views7 pages

Manual Hantek DSO-2090 USB

This document provides details about an SDK for a USB oscilloscope, including struct definitions for saving instrument settings and data, functions for hardware control and data retrieval, and functions for displaying waveforms and data on screen. It describes structs for instrument settings like voltage, timebase and trigger parameters. It also describes functions for configuring the hardware, capturing and retrieving data, processing waveforms, and drawing the display. The SDK allows controlling the USB oscilloscope and retrieving captured data for display on a computer.

Uploaded by

bugmenomore
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
306 views7 pages

Manual Hantek DSO-2090 USB

This document provides details about an SDK for a USB oscilloscope, including struct definitions for saving instrument settings and data, functions for hardware control and data retrieval, and functions for displaying waveforms and data on screen. It describes structs for instrument settings like voltage, timebase and trigger parameters. It also describes functions for configuring the hardware, capturing and retrieving data, processing waveforms, and drawing the display. The SDK allows controlling the USB oscilloscope and retrieving captured data for display on a computer.

Uploaded by

bugmenomore
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 7

DSO-XXXX USB SDK Manual

SDKXXXX.dll (VC++ 6.0)

Define struct
struct PictureRange{ // Be used for draw grid
WORD width; // the width of display range
WORD height; // the height of display range
WORD left; //the left of display range
WORD right; //the right of display range
WORD top; //the top of display range
WORD bottom; //the bottom of display range
};
struct ControlStruct{ //save the control data
WORD TriggerSource; //the trigger source
WORD SelectedChannel; // the display channel
WORD Timebase; // timebase
WORD TriggerPosition; // the trigger vertical position “0%,25%,50%,75%,100%”
WORD DataLengh; // its value is 1 or 2, if BufferSize = 10, Datalengh = 1, else Datalengh =2
WORD BufferSize ; //Its value is 10,32 or 64
WORD isAlt; //If ALT trigger, its value is 1, else 0.
};
struct LeversStruct{ //save position
WORD Ch1Position; // the ch1 waveform horizontal position
WORD Ch2 Position; // the ch2 waveform horizontal position
WORD Ch1TriggerPosition; // the ch1 trigger position
WORD Ch2TriggerPosition; // the ch2 trigger position
WORD EXTTriggerPosition; // the EXT trigger position
};
struct StateStruct{
WORD Ch1Filt; // ch1 filter
WORD Ch2Filt; //ch2 filter
WORD TriggerFilt; // trigger filter
WORD TriggerMode; //trigger mode (AUTO, NORMAL, SINGLE)
WORD TriggerSlope; //trigger slope (rising edge, failing edge)
};
struct LineColor{ // the waveform color
WORD R;
WORD G;
WORD B;
};
struct AutosetStruct{ //save the autoset data
WORD WhichChannel; //which channel will autoset
WORD Ch1Voltage; //Ch1 autoset voltage
WORD Ch2Voltage; //Ch2 autoset voltage
WORD Ch1Timebase; //Ch1 autoset timebase
WORD Ch2Timebase; //Ch2 autoset timebase
WORD Ch1InGND; //Ch1 is in GND or not
WORD Ch2InGND; //Ch2 is in GND or not
WORD Ch1Enabled; //Ch1 enabled
WORD Ch2Enabled; //Ch2 enabled
};
struct TimeStruct{ //Save the time
double Timer; // the number of seconds elapsed since midnight
double Time; //the time of Timebase
double ScrollTime;
double ScrollStart;
};

Functions:

1. Functions for hardware:

WORD __stdcall sdSearchDevice (WORD DeviceIndex)


Variables introduction:
DeviceIndex: index of the device.
Note: This function is used for finding device.
If successful return 1, else return 0.

WORD __stdcall sdSetVoltageAndCoupling(WORD DeviceIndex,


WORD Ch1Voltage
WORD Ch2Voltage,
WORD Ch1_ACDC,
WORD Ch2_ACDC,
WORD TriggerSource)
Variables introduction:
Ch1Voltage: index of the CH1 voltage
Ch2Voltage: Index of the CH2 voltage
Ch1_ACDC: index of the CH1 Coupling ( AC is 1, DC is 0, GND is 0 )
Ch2_ACDC: index of the CH2 Coupling
TriggerSource: index of the trigger source (CH1 trigger is 0, CH2 trigger is 1, ALT trigger is 2, EXT
trigger is 3)
Note: This function is used for setting voltage and Coupling. If successful return 1, else return 0.

WORD __stdcall sdSetTriggerAndSampleRate(WORD DeviceIndex,


WORD TriggerSlope,
Struct ControlData *Controlstate)
Variables introduction:
TriggerSlope: the trigger type (Rising edge is 0, Failing edge is 1)
Note: This function is used for setting trigger and timebase.
If successful return 1, else return 0.

bool __stdcall sdSetOffset(WORD DeviceIndex,


struct LeversData * Levers,
WORD Ch1_Att,
WORD Ch2_Att,
WORD TriggerSource,
WORD * level)
Variables introduction:
level: array of the channel position adjust data, read from hardware.
Note: This if used for adjusting the position of the channel. If successful return true, else return false.

WORD __stdcall sdSetFilt (WORD DeviceIndex,


struct StateStruct *FiltAndTrigger)
Note: This function is used for setting channel and trigger filter. If successful return 1, else return 0.

WORD __stdcall sdCaptureStart(WORD DeviceIndex)


Note: This function is starting to capture data. If successful return 1, else return 0.

long __stdcall sdTriggerEnabled(WORD DeviceIndex)


Note: This function is used for setting the trigger. If successful return 1, else return 0.

WORD __stdcall sdGetLevel(WORD DeviceIndex,WORD * level)


Note: This function is used for reading the waveform position adjust data from hardware. If successful
return 1, else return 0.

WORD __stdcall sdGetData(WORD DeviceIndex,


WORD Ch1_Att,
WORD Ch2_Att,
WORD * Ch1HardwareData,
WORD * Ch2HardwareData,
struct ControlData *Controlstate,
struct StateStruct *FiltAndTrigger,
struct LeversData *levers,
WORD *level,
int StartCapture
)
Variables introduction:
Ch1HardwareData: save ch1 data from hardware
Ch2HardwareData: save ch2 data form hardware
StartCapture: capture data flag. If start to capture is 1, else is 0.
Note: This function is used for reading data from the hardware. If successful return 1, else return 0.

2. Functions for software:


WORD __stdcall sdMainPanelDrawGrid (HDC hdc,
struct PictureRange * view_data)
Variables introduction:
Hdc: // handle to the display picture
Note: This function is used for drawing grid on panel. If successful return 1, else return 0.

WORD __stdcall sdDisplayDataXYMode(HDC hdc,


struct PictureRange * view_data,
WORD isLine,
WORD * ch1_data,
WORD * ch2_data)
Variables introduction:
isLine: //point or line display.
Note: This function is used for displaying data with X-Y Mode. If successful return 1, else return 0.

WORD __stdcall sdGetDisplayData(struct ControlData *Controlstate,


WORD * ChDispalyData,
WORD * ChBufferData
)
Variables introduction:
ChDisplayData: //save Channel display data
ChBufferData: //save Channel data
Note: This function is used for getting display data. If successful return 1, else return 0.

WORD __stdcall sdDisplayData (HDC hdc,


struct PictureRange * DisPicture,
WORD PointOrLine,
WORD * ChDisplayData,
struct LineColor * ch_color)
Note: This function is used for displaying data on screen.

WORD __stdcall sdChannelDataBuffer (struct ControlData *Controlstate,


WORD InterpolationLineMode,
WORD * chx_data,
WORD * ch_data)
Variables introduction:
InterpolationLineMode: //its value is 1, 0, or 2
Note: This function is used for processing data and copying data to “chx_data” from “ch_data”. If
successful return 1, else return 0.

WORD __stdcall sdChannelInGND (WORD Ch1Position,


WORD *chdata)
Note: This function is used for processing data when channel is in GND. If successful return 1, else
return 0.

WORD __stdcall sdAutoset (WORD DeviceIndex,


struct ControlData *Controlstate,
struct AutosetStruct *AutosetData,
struct StateStruct *FiltAndTrigger,
struct LeversData * levers,
WORD *level
)
Note: This function is used for automatically setting. If successful return 1, else return 0.

WORD __stdcall sdGetScrollData(WORD DeviceIndex,


struct ControlData *Control_Data1,
struct LeversData *levers,
struct TimeStruct *TimeState,
WORD Ch1Voltage,
WORD Ch2Voltage,
WORD *Ch1ScrollData,
WORD *Ch2ScrollData,
WORD *Ch1DisplayData,
WORD *Ch2DisplayData,
WORD TriggerPosition,
bool Ch1InGND,
bool Ch2InGND
)
Note: This function is used for getting and processing data when channel is in scroll mode. If successful
return 1, else return 0.

double __stdcall sdDisplaySampling (bool Ch1Enabled,


bool Ch2Enabled,
WORD TriggerSource,
WORD Timebase,
WORD BufferSize)

Note: This function is use for Display Sampling on main panel status bar.
3. Flow Chat:

You might also like