[go: up one dir, main page]

0% found this document useful (0 votes)
115 views8 pages

SDK2250DLL

This document summarizes an SDK manual for a DSO-2250 USB oscilloscope. It includes 1) definitions for data types and structures used to control the device and save settings and data, 2) functions for hardware control like setting triggers and reading data, and 3) functions for software display like drawing grids and scrolling waveforms. The functions provide an interface for configuring the device, capturing and retrieving signals, and displaying the results on a host computer.

Uploaded by

Arda Akberk
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)
115 views8 pages

SDK2250DLL

This document summarizes an SDK manual for a DSO-2250 USB oscilloscope. It includes 1) definitions for data types and structures used to control the device and save settings and data, 2) functions for hardware control like setting triggers and reading data, and 3) functions for software display like drawing grids and scrolling waveforms. The functions provide an interface for configuring the device, capturing and retrieving signals, and displaying the results on a host computer.

Uploaded by

Arda Akberk
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/ 8

DSO-2250 USB SDK Manual

SDK2250DLL.dll (VC++ 6.0)

Define Macro
#define SDK2250DLL_HEADFILE_H //avoid “SDK2250DLL.h” file redefinition
#define DLL_API extern "C" __declspec(dllimport)
#define WINAPI __stdcall

Date Type
WORD: unsigned short int

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 BufferSize ; //Its value is 10,512 or 1024
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:

1.1 DLL_API WORD WINAPI 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.

1.2 DLL_API WORD WINAPI sdGetChannelLevel(WORD DeviceIndex,


WORD * pZeroLevel,
WORD nLen)
Variables introduction:
DeviceIndex: index of the device.
pZeroLevel: array about the channel adjust Data at Zero Level position.
nLen: Length of pZeroLevel array.
Note:
This function is used for reading the waveform position adjust data from hardware. If
successful return 1, else return 0.

1.3 DLL_API WORD WINAPI sdSetTriggerAndSampleRate(


WORD DeviceIndex,
WORD Trigger_Slope,
struct ControlStruct *Control_Data1,
WORD TrigFilt)
Variables introduction:
DeviceIndex: index of the device.
TriggerSlope: the trigger type (Rising edge is 0, Failing edge is 1).
Control_Data1: point to variable of structure ControlStruct.
TrigFilt: trigger filter.
Note:
This function is used for setting trigger and timebase.If successful return 1, else return 0.

1.4 DLL_API WORD WINAPI sdSetVoltageAndCoupling(


WORD DeviceIndex,
WORD Ch1Voltage
WORD Ch2Voltage,
WORD Ch1_ACDC,
WORD Ch2_ACDC,
WORD TriggerSource)
Variables introduction:
DeviceIndex: index of the device.
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.

1.5 DLL_API WORD WINAPI sdSetFilt (WORD DeviceIndex,


struct StateStruct *FiltAndTrigger)
Variables introduction:
DeviceIndex: index of the device.
FiltAndTrigger: point to variable of structure StateStruct
Note:
This function is used for setting channel and trigger filter. If successful return 1, else return 0.

1.6 DLL_API WORD WINAPI sdSetOffset(WORD DeviceIndex,


struct LeversStruct * Levers,
WORD Ch1_Att,
WORD Ch2_Att,
WORD TriggerSource,
WORD * level)
Variables introduction:
DeviceIndex: index of the device.
Levers: point to arriable of the structure LeversStruct.
Ch1_Att : Ch1 filter.
Ch2_Att : Ch2 filter.
TriggerSource: index of the trigger source.
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.

1.7 DLL_API WORD WINAPI sdCaptureStart(WORD DeviceIndex)


Variables introduction:
DeviceIndex: index of the device.
Note:
This function is starting to capture data. If successful return 1, else return 0.

1.8 DLL_API WORD WINAPI sdTriggerEnabled(WORD DeviceIndex)


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

1.9 DLL_API WORD WINAPI sdGetData(WORD DeviceIndex,


WORD Ch1_Att,
WORD Ch2_Att,
WORD * Ch1HardwareData,
WORD * Ch2HardwareData,
struct ControlStruct *Control_Data1,
struct StateStruct *FiltAndTrigger,
struct LeversStruct *levers,
WORD *level,
int StartCapture)
Variables introduction:
DeviceIndex: index of the device.
Ch1_Att : Ch1 filter.
Ch2_Att : Ch2 filter.
Ch1HardwareData : save ch1 data from hardware.
Ch2HardwareData : save ch2 data from hardware.
Control_Data1: point to variable of structure ControlStruct.
FiltAndTrigger: point to variable of structure StateStruct
Levers: point to arriable of the structure LeversStruct.
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:

2.1 DLL_API WORD WINAPI sdGetDataSleep(struct ControlStruct *Control_Data1)


Variables introduction:
Control_Data1: point to variable of structure ControlStruct.
Note:
This function is used for Get necessary Delay time. If successful return 1, else return 0.

2.2 DLL_API WORD WINAPI sdMainPanelDrawGrid (HDC hdc,


struct PictureRange * view_data)
Variables introduction:
Hdc: resource Handle // handle to the display picture.
view_data: Information about drawing grid.
Note:
This function is used for drawing grid on panel. If successful return 1, else return 0.

2.3 DLL_API WORD WINAPI sdGetScrollData(WORD DeviceIndex,


struct ControlStruct *Control_Data1,
struct LeversStruct *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.

2.4 DLL_API double WINAPI sdDisplaySampling (bool Ch1Enabled,


bool Ch2Enabled,
WORD TriggerSource,
WORD Timebase,
WORD BufferSize)
Note:
This function is use for Display Sampling on main panel status bar.

2.5 DLL_API WORD WINAPI sdChannelDataBuffer (struct ControlStruct


*Control_Data1,
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.

2.6 DLL_API WORD WINAPI sdGetDisplayData(struct ControlStruct *Control_Data1,


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.

2.7 DLL_API WORD WINAPI sdDisplayData (HDC hdc,


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

2.8 DLL_API WORD WINAPI 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.

2.9 DLL_API WORD WINAPI sdAutoset (WORD DeviceIndex,


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

2.10 DLL_API WORD WINAPI sdSoftFindTriggerPoint(WORD nHTriggerPosition,


WORD TIMEBASE,
WORD TriggerLever,
WORD TriggerSlope,
WORD * ChBufferData)
Note:
This function is used for finding trigger position by software and getting needed channel data.
If successful return trigger position finded by software.

2.11 LL_API WORD WINAPI sdSoftFindTriggerPointCopy(


WORD nHTriggerPosition,
WORD TriggerPoint,
WORD *ChBufferData)
Note:
This function is used for getting needed channel data according to the value TriggerPosition.
If successful return 1.

3. Flow Chat:

You might also like