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;
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
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)
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.
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
Programmer’s Guide
Trigger Position in the hardware. It ‘s available when the trigger is not ALT.
holdOff
Holdoff parameter, see the struct “HOLDOFF”.
2.2.9 DMM_VALUE
The parameters of the digital meter measure’s value
typedef struct _DMM_VALUE
{
INT8U value[4];
float flValue;
INT8U iDotPos;
INT8U iUnit;
INT8U iUnitType;
INT8U iSign;
}DMM_VALUE;
value[4]
The char value displayed on the screen. For example,if the value is {1,2,3,4}
and the iDotPos is 0, the string "1234" will display on the screen.
If the iDotPos is 1, the string is “1.234”,
If the iDotPos is 2, the string is “12.34”.
If the iDotPos is 3, the string is “123.4”
flValue
the value format float displayed on the screen
iDotPos
see the parameter value[4]
iUnit
The unit of the value, 0:p, 1:n, 2:u, 3:m, 4: K, 5:M, 6:G, 7:NULL.
iUnitType
The unit type of the value, 0: V, 1: A, 2:Ω, 3: F
For example: if the iUnit is 3 and the iUnitType is 1 and the value is 1.234, the
string display on the screen will be “1.234mA”
iSign
the sign of the value, 0: Postive, 1: Negtive
2.2.10 DMM_INFO
The digit
al meter measure’s parameter.
typedef struct _DMM_INFO
{
INT8U iType;
BOOLEAN bOverflow;
INT8U iDCAC;
INT8U iMode;
BOOLEAN bRel;
the range index in the range array
Voltage: {60.00mV, 600.0mV, 6.000V, 60.00V, 600.0V, 6000V}
Crrent: {60.00mA, 600.0mA}
Resistance: {600.0, 6.000K, 60.00K, 600.0K, 6.000M, 60.00M}
bAma
Only available when the type is Current, 0: A, 1: mA
iBar
Bar value, from 0 to 60
iBarSign
Bar sign: 0: Positive, 1: Negative
Value
The current value acquired
relValue
The rel value when press rel.
1100
Programmer’s Guide
33 Function Call Reference
The DSO1060DLL.DLL function call reference is in C language.
Function Call Reference
3.1 Machine Control Function
3.1.1 HTGetUSBDeviceList
Initialize the hardware and get the current usb device list connecting to the PC
INT32U HTGetUSBDeviceList(INT8U* usbList);
Parameters
INT8U* usbList: the array of the usb device.
Return values
the number of equipments connecting to the PC.
Remarks
The size of the usb list array is 16. The parameter in the array show the device
status. 0 means the usb index was never connecting to PC, 1 means one
deivce is connecting, 2 means a device was connecting but is disconnect now.
for example: if the array return as {1, 2, 1, 0, 0, 0, 0...}, it means there are 2
equipments connecting to the PC, and the index of the there is 0 , 2. The index
2 is disconnect.
You must call this function first to initial the machine.
HT_DEVICE_ID iDeivceID:
the id of the device which is made by CREATE_DEVID. (This parameter won’t
be introduced again)
PHT_DEVICE_INFO pHTDeviceInfo:
the pointer to the device information struct.
Return values
0: Success, 1:Fail.
1111
Programmer’s Guide
Remarks
Get the device’s information from hardware. The information struct is defined
in the struct HT_DEVICE_INFO..
INT8U iChannel
the channel to set timebase.
0: If the trigger mode is ALT, set ch1’s timebase, otherwise set public timebase.
1: If the trigger mode is ALT, set Ch2’s timebase, otherwise set public
timebase.
2: If the trigger mode is ALT, nothing to do, otherwise set public timebase.
3: Set REF’s timebase.
INT8U iTimeBase
The time/div index, see the struct CHANNEL.
Return values
0: Success, 1: Fail
Remarks
If the trigger mode is ALT, each channel’s timebase is independent
If the trigger mode is not ALT, ch1 and ch2’s timebase is the public timebase.
INT8U iChannel
0: If the trigger mode is ALT, set CH1; Otherwise,set public
1:If the trigger mode is ALT, set CH2; Otherwise, set public..
2:Set public
3:Set REF.
INT16U iHTriggerPos:
Horizontal trigger position
Return values
0: Success, 1: Fail
Remarks
If the trigger mode is ALT, each channel’s horizontal trigger position is
independent
If the trigger mode is not ALT, the horizontal trigger position is public.
INT8U iChannel
When the trigger is ALT, 0 is CH1 and 1 is CH2; otherwise, the parameter
is ingored.
INT16U iCondition
0: +Less, 1: +Equal, 2: +More, 3: -Less, 4: -Equal, 5: -More
Return values
0: Success, 1: Fail
Remarks
2244
Programmer’s Guide
This function is validate when the trigger isn’t edge.
INT8U iChannel
When the trigger is ALT, 0 is CH1 and 1 is CH2; otherwise, the parameter
is ingored.
INT16U iTime
the unit is ns/5, for example: if the value is 1000, the pulse setting is 5ms
Return values
0: Success, 1: Fail
Remarks
This function is validate when the trigger isn’t edge.
see the 'pluseValue' parameter in the TRIGGER struct
UPLOAD_DATA* upData
See the sturct UPLOAD_DATA;
USHORT* pCh1DisData
Ch1’s data to display, the size of which is 1200.
USHORT* pCh2DisData
Ch2’s data to display, the size of which is 1200.
USHORT* pMathDisData
Math’s data to display, the size of which is 1200.
USHORT* pRefDisData
Ref’s data to display, the size of which is 1200.
Return values
0: Success, 1: Fail
Remarks
Before draw the waveform, you should get all of the waveform data and the
setup from the machine.
INT8U* pCh1Data
CH1 data
INT8U* pCh2Data
CH2 data
ULONG nCh1Datalen
the length of the CH1 data which specified by nData in the struct
CHANNEL.
ULONG nCh2Datalen
the length of the CH2 data which specified by nData in the struct
CHANNEL.
2266
Programmer’s Guide
Return values
0: Success, 1: Fail
Remarks
The data in the struct UPLOAD_DATA is the display data, the max size of
which is 1200.
Use this function, you can get all of the memory data from the hardware, the
size of which is 16K or 32K.
The length of the data is specified in by nData in the struct CHANNEL