Hantek DSO1060 SDK Programmer's Guide

Programmer’s Guide
DSO1060
Content
1 What’s the DSO1060DLL.DLL?.................................................................1
2.1 Data Types.......................................................................................2
2.1.1 BOOLEAN ..............................................................................2
2.1.2 INT8U .....................................................................................2
2.1.3 INT8S......................................................................................2
2.1.4 INT16U ...................................................................................2
2.1.5 INT16S....................................................................................2
2.1.6 INT32U ...................................................................................2
2.1.7 INT32S....................................................................................2
2.1.8 FP32.......................................................................................2
2.1.9 FP64.......................................................................................2
2.1.10 HTST ATUS .............................................................................2
2.1.11 HT_DEVICE_ID......................................................................3
2.2 Struct................................................................................................3
2.2.1 HT_DEVICE_INFO.................................................................3
2.2.2 TRIGGER ...............................................................................3
2.2.3 MATH......................................................................................4
2.2.4 CHANNEL...............................................................................5
2.2.5 SCREEN_DISPLAY................................................................6
2.2.6 HOLDOFF...............................................................................7
2.2.7 STOPSTATUS......................................................................... 7
2.2.8 UPLOAD_DATA......................................................................7
2.2.9 DMM_VALUE.......................................................................... 9
2.2.10 DMM_INFO.............................................................................9
3 Function Call Reference..........................................................................11
3.1 Machine Control Function ..............................................................11
3.1.1 HTGetUSBDeviceList ...........................................................11
3.1.2 HTGetDeviceInfo ..................................................................11
3.1.3 HTScreenShoot ....................................................................12
3.1.4 HTShutDown ........................................................................12
3.1.5 HTGetFunction......................................................................12
3.1.6 HTChangeFunction...............................................................13
3.1.7 HTShowMenu.......................................................................13
3.1.8 HTUSBCheckConnect..........................................................13
3.2 Digital Scope Function ...................................................................14
3.2.1 DSOSetStatus.......................................................................14
3.2.2 DSOAutoSetup .....................................................................14
3.2.3 DSOFactorySetup.................................................................14
3.2.4 DSOSetTimeBase.................................................................15
3.2.5 DSOSetHoriFormat...............................................................15
3.2.6 DSOSetHTriggerPos.............................................................16
3.2.7 DSOSetCHEnable ................................................................16
3.2.8 DSOSetVOLTDIV..................................................................17
3.2.9 DSOSetCoupling...................................................................17
3.2.10 DSOSetProbe.......................................................................17
3.2.11 DSOSetBWLimit ...................................................................18
3.2.12 DSOSetCoarseOrFine..........................................................18
3.2.13 DSOSetInvert........................................................................19
3.2.14 DSOResetChannel ...............................................................19
3.2.15 DSOSetChannelLeverPos ....................................................19
3.2.16 DSOSetMathOperator...........................................................20
3.2.17 DSOSetMathSource .............................................................20
3.2.18 DSOSetFFTWindow .............................................................21
3.2.19 DSOSetFFTScale.................................................................21
3.2.20 DSOSetV oltDIVChange........................................................21
3.2.21 DSOSetTriggerMode.............................................................22
3.2.22 DSOSetTriggerHFReject.......................................................22
3.2.23 DSOSetTriggerSource..........................................................23
3.2.24 DSOSetTriggerSweep...........................................................23
3.2.25 DSOSetVTriggerLeverPos....................................................23
3.2.26 DSOSetTriggerSlope............................................................24
3.2.27 DSOSetPulseTriggerCondition .............................................24
3.2.28 DSOSetPulseTriggerTime..................................................... 25
3.2.29 DSOSetAL TTrigType.............................................................25
3.2.30 DSOGetAllSetting.................................................................25
3.2.31 DSOGetCh12Data................................................................26
3.2.32 DSOGetChREFData.............................................................27
3.3 Digital Meter Measure Function......................................................27
3.3.1 DMMGetInfo .........................................................................27
3.3.2 DMMSetMeasureMode.........................................................28
3.3.3 DMMSetVoltACDC................................................................28
3.3.4 DMMSetVoltRel.....................................................................28
3.3.5 DMMSetVoltMode.................................................................29
3.3.6 DMMSetVoltRange...............................................................29
3.3.7 DMMSetCurrentACDC..........................................................29
3.3.8 DMMSetCurrentRel...............................................................30
3.3.9 DMMSetCurrentMode...........................................................30
3.3.10 DMMSetCurrentRange .........................................................30
3.3.11 DMMSetCurrentAmA............................................................31
3.3.12 DMMSetOHMRel..................................................................31
3.3.13 DMMSetOHMRange.............................................................31
3.3.14 DMMSetOHMMode...............................................................32
3.3.15 DMMSetCapRel....................................................................32
Programmer’s Guide

11 What’s the DSO1060DLL.DLL?

The DSO1060DLL.DLL is a dynamic-link library for Windows OS. It provides several function calls to control the DSO1060. You may use some language that support DLL link function, such as Visual C++, Visual Basic or Labview to control DSO1060 with DSO1060DLL.DLL library. Here, we illustrate some examples using Visual C++, Visual Basic and Labview. The other languages please refer to their description about DLL link application.
What’s the DSO1060DLL.DLL?
11
Programmer’s Guide

22 Defination

Defination

2.1 Data Types

2.1.1 BOOLEAN

Boolean variable (1: TRUE, 0:FALSE).

2.1.2 INT8U

8-bit unsigned integer

2.1.3 INT8S

8-bit signed integer

2.1.4 INT16U

16-bit unsigned integer

2.1.5 INT16S

16-bit signed integer

2.1.6 INT32U

32-bit unsigned integer

2.1.7 INT32S

32-bit signed integer

2.1.8 FP32

Single float point variable, 4 bits

2.1.9 FP64

Double float point variable, 8 bits

2.1.10 HTSTATUS

32-bit unsigned integer
22
Programmer’s Guide
Function return status. 0: Success, 1:Error:

2.1.11 HT_DEVICE_ID

32-bit unsigned integer 0~15: the index of machine. The machine which connected to PC first will be set as 0, the second is 1, and so on. 16~31: the communiate mode. 0: USB, 1:COM, 2:LAN.

2.2 Struct

2.2.1 HT_DEVICE_INFO

The device Information typedef struct _HT_DEVICE_INFO { char szName[20]; char szSerial[20]; INT16U iFirmVersion; INT16U iHardVersion[4]; INT32U iDate; } HT_DEVICE_INFO,*PHT_DEVICE_INFO; szName[20] The name of the machine, always it is “DSO1060” szSerial[20] The serial number of machine, which match the number behined the machine. iFirmVersion The firmware's version
iHardVersion[4]
the hardware verison, HardVersion[0]-PCB version HardVersion[1]-mcu 1# version HardVersion[2]-mcu 2# version HardVersion[3]-Lan version.
iDate
Factory data, 0~7 bits: day, 8~15 bits: month, 16~31 bits: year. For example: 0x07D90102 must be 2009 year 1 month 2 day.

2.2.2 TRIGGER

The trigger system typedef struct _TRIGGER { INT16U Mode;
33
Programmer’s Guide
INT16U Source; INT16U Sweep; INT16U Slope; INT16U HFReject; INT16U PWCondition; INT32U pluseValue; }TRIGGER;
Mode
Trigger mode: 0:Edge trigger, 1:pulse trigger
Source
Trigger source: 0:CH1, 1: CH2
Sweep
Trigger sweep: 0: Auto, 1:Normal, 2:Single
Slope
Trigger Slope: 0: Rising, 1:Falling
HFReject
HF Reject: 0: OFF, 1: ON
PWCondition
Pulse when condition: 0: +Less, 1: +Equal, 2: +More, 3: -Less, 4: -Equal, 5:
-More
pluseValue
Pulse setting value: the unit is ns/5, for example: if the value is 1000, the pulse setting is 5ms.

2.2.3 MATH

The math parameters typedef struct _MATH { INT16U MathOperate; INT16U MathSource[2]; INT16U fftWindow; INT16U fftSource; INT16U fftScale; INT16U fftSplite; INT16U fftDB; }MATH;
MathOperate
Math operator: 0: +, 1: -, 2: *, 3: /, 4: FFT
MathSource[2]
The two sources of the math, 0:CH1, 1:CH2
fftWindow
FFT Window, 0:Rectangle, 1:Hanning, 2:Hamming, 3:Blackman
fftSource
FFT Source, 0: CH1, 1:CH2
44
Programmer’s Guide
fftScale
FFT Scale, 0:Vrms, 1:dBVrms
fftSplite
FFT Splite, 0:normal, 1:splite window
fftDB
db index in the array, {1, 2, 5, 10, 20, 50, 100} (dB/div)

2.2.4 CHANNEL

The channel’s parameters typedef struct _CHANNEL { INT16U enable; INT16U voltDivIndex; INT16U couple; INT16U probe; INT16U invert; INT16U BWLimit; INT32U voltDivValue; INT16S vertPos; INT16S vTrigPos; INT16U nData; INT16S horiPos; INT16U hTriggerPos; INT16U timebase; INT16S voltDivType; INT16U bHasEmpty; INT16S emptyPos[2]; }CHANNEL;
enable
Show/hide the channel on the screen, 0:hide, 1:show
voltDivIndex
0: 5.00mV, 1: 10.0mV,2: 20.0mV, 3: 50.0mV, 4: 100mV, 5: 200mV, 6: 500mV, 7: 1V, 8: 2V, 9: 5V
couple
Channel’s couple: 0: AC, 1: DC, 2: GND
probe
Channel’s probe: 0: 1X, 1: 10X, 2: 100X, 3: 1000X
invert
Channel’s Invert: 0: OFF, 1: ON
BWLimit
Band Width limit: 0: OFF, 1: ON
voltDivValue
the 100 times of the voltage. For example: if the voltDiv is 123, the display string will be "1.23mV"
55
Programmer’s Guide
vertPos
The channel’s position displayed on the screen, the top is 0, and bottom is 199
vTrigPos
The channel's trigger postion displayed on the screen, the top is 0, and the bottom is 199.
nData
The number of data acquired from the hardware
horiPos
The channel's horizontal trigger position displayed on the screen, the left is 0, and the right is 299
hTriggerPos
The channel's horizontal trigger position in the hardware, 0 ~ 18383(16K).
timebase
The channel's timebase, 0: 5.000ns, 1: 10.00ns,2: 20.00ns, 3: 50.00ns, 4:
100.0ns, 5: 200.0ns, 6: 500.0ns, 7: 1.000us, 8: 2.000us, 9: 5.000us, 10:
10.00us, 11: 20.00us, 12: 50.00us, 13: 100.0us, 14: 200.0us, 15: 500.0us, 16:
1.000ms, 17: 2.000ms, 18: 5.000ms, 19: 10.00ms, 20: 20.00ms, 21: 50.00ms, 22: 100.0ms, 23: 200.0ms, 24: 500.0ms, 25: 1.000s, 26: 2.000s, 27: 5.000s, 28: 10.00s, 29: 20.00s, 30: 50.00s, 31: 100.0s, 32: 200.0s, 33: 500.0s, 34: 1000s.
voltDivType
Corase or fine, 0: Corase, 1: fine
bHasEmpty
Be avilible when the DSO work in ROLL or scan mode. You should draw the points in the empty area. The area is defined by the next parameter -­emptyPos. 0: Don't have empty area, 1: From emptyPos[0] to emptyPos[1] points are empty area
emptyPos[2]
See the parameter bHasEmpty

2.2.5 SCREEN_DISPLAY

The screen display’s parameter typedef struct _SCREEN_DISPLAY { INT32U xDotSpace; INT32U xDisLeft; INT32U nDisData; INT16U bDrawType; }SCREEN_DISPLAY ;
xDotSpace
The 1000 times of the distance between the each point display on the LCD screen. If is 250, it means the point space is 2.5 pixel on the LCD screen. The space is between 0 to 300.
66
Programmer’s Guide
xDisLeft
The 1000 times of the left position, If is 13000, it means the left position is 13 on the LCD screen.The position is between 0 to 300.
nDisData
The number of the points display on the screen, (0 ~ 1200)
bDrawType
Draw Type, 1: Normal, : Only draw Dot

2.2.6 HOLDOFF

The holdoff’s parameters typedef struct _HOLDOFF { INT16U time; INT16S bOn; }HOLDOFF;
bOn
Turn on/off the holdoff, 0: OFF, 1: ON
Time
Channge the holdoff time.

2.2.7 STOPSTATUS

The status when stop the machine. typedef struct _STOPSTATUS { INT16S horiLevel; CHANNEL ch[4]; INT16U timebase; }STOPSTATUS;
horiLevel
The horizontal trigger position displayed on the screen, the left is 0, and the right is 299
ch[4]
The four channel’s parameters, 0:CH1, 1:CH2, 2:MATH, 3:REF
Timebase
The timebase index

2.2.8 UPLOAD_DATA

All of the parameters of the hardware. typedef struct _UPLOAD_DATA { CHANNEL ch[4]; STOPSTATUS stopStatus;
77
Programmer’s Guide
MATH math; TRIGGER trigger[3]; SCREEN_DISPLAY display[4]; INT16U timebase; INT16U function; INT16U status; INT16S horiPos; INT16U triggerMode; INT16U chSel; INT16U horiFormat; INT16U SamplingMode; INT16U hTriggerPos; HOLDOFF holdOff; }UPLOAD_DATA;
ch[4]
The four channels' parameters, 0:CH1, 1:CH2, 2:MATH, 3:REF, See the struct “CHANNEL”
stopStatus
The status when pressing 'stop', See the sturct “STOPSTATUS”
Math
Math parameters see the struct “MATH”
trigger[3]
Trigger’s system, When the trigger is edge or pulse, 0 is available, When the trigger is ALT, trigger[1] is Ch1’s trigger and trigger[2] is Ch2’s trigger.
display[4]
Draw parameters of the four channels.
timebase
The timebase of the device. It is avaible when the trigger is not ALT.
function
The current type, 0: Digital scope, 1: Digital Meter measure
status
the status of the device, 0: Stop, 1: Run, 2: Auto, 3: Tri'd, 4: Wait
horiPos
The horizontal trigger position displayed on the screen, the left is 0, and the right is 299. It ‘s available when the trigger is not ALT.
triggerMode
Trigger type, 0: Edge Trigger, 1: Pulse Triger, 2: ALT Trigger
chSel
The current selected channel, 0:CH1, 1:CH2, 2:MATH, 3:REF
horiFormat
0: Y-T Mode, 1: X-Y Mode, 2: ROLL Mode
SamplingMode
0: Real Sample, 1: ETS
hTriggerPos
88
Loading...
+ 24 hidden pages