Hantek DSO3064A SDK manual HTHardDLL

SDK - HTHardDll.dll Manual
VC++6.0 IDE
Note:
HTHardDll.dll was compiled under VC++6.0. WORD: unsigned short BOOL: bool ULONG: unsigned long
#ifndef DLL_API #define DLL_API extern "C" __declspec(dllimport) #endif
Define __stdcall:
#define WIN_API __stdcall
Defines the struct for the application.
_HT_RELAY_CONTROL contains the relay control information.
typedef struct _HT_RELAY_CONTROL
{ BOOL bCHEnable[4]; WORD nCHVoltDIV[4]; WORD nCHCoupling[4]; BOOL bCHBWLimit[4]; WORD nTrigSource; BOOL bTrigFilt; WORD nALT; }RELAYCONTROL,*PRELAYCONTROL;
Parameters Remarks: bCHEnable[4]: The channel is enable/disable.Value: 1 is enable; 0 is disable. nCHVoltDIV[4]: The VOLT/DIV index of the channel. nCHCoupling[4]: The coupling index of the channel .
ValueDC is 0AC is 1GND is 2
bCHBWLimit[4]The bandwidth of the channel.
Value: be enable is 1: be disable is 0. nTrigSourceThe index of the trigger source. If the channel has 4 channels, the value is : CH1 is 0, CH2 is 1, CH3 is 2 , …… bTrigFiltThe High Frequency Rejection. Be enable is 1, disable is 0. nALTIf the trigger is alternate trigger, the value is 1, otherwise is 0.
Example:
Declare a variable: RELAYCONTROL myRelayControl; Declare a pointer: PRELAYCONTROL pRelayControl;
_HT_CONTROL_DATA contains some controls.
typedef struct _HT_CONTROL_DATA
{ WORD nCHSet;//Channel Enable/Disable
//The 0 bit: 0 is enable, 1 is disable. // The 1 bit: 0 is enable, 1 is disable. // The 2 bit: 0 is enable, 1 is disable. // The 3 bit: 0 is enable, 1 is disable. WORD nTimeDIV; //The index of time Base WORD nTriggerSource; // The index of the trigger source WORD nHTriggerPos; //The Horizontal Trigger Pos (Value: 0 ~ 100) WORD nVTriggerPos; //The Vertical Trigger Pos (Value: 0 ~ 255) WORD nTriggerSlope; //The Edge trigger Slope (Rise slope is 0,Fall slope is 1) ULONG nBufferLen; //The buffer Length ULONG nReadDataLen; //The Data Length of have be read. WORD nALT; // Is alternate trigger or not
}CONTROLDATA,*PCONTROLDATA;
Example:
Declare a variable: CONTROLDATA myControlData; Declare a pointer: PCONTROLDATA pControlData;
Functions:
1. DLL_API WORD WINAPI dsoHTSearchDevice(short* pDevInfo)
Return Value:
The number of have connected devices.
Parameters: pDevInfo
pointer to devices information that have connected to PC. Remarks: You should call this function to know how many devices that have connected to PC. One PC supports 32 devices to be connected. Example:
short DevInfo[32];
WORD nConnectedDevNum = 0; //DevInfo Initial. // //Call this function nConnectedDevNum = dsoHTSearchDevice(DevInfo); if (nConnectedDevNum > 0) { For(int i=0 ;i<32 i++)
{
if (DevInfo[i] = = 0) { // has device. The device is not used. } else if (DevInfo[i] = = 1) { // has device. The device is used. } else { //No device was found. }
}
}
2. DLL_API WORD WINAPI dsoHTDeviceConnect(WORD nDeviceIndex)
Return value:
If the device was connected is 1, otherwise is 0. Parameters: nDeviceIndex The device index. Remarks: Whether the device was connected.
Example: WORD nDeviceIndex = 0: WORD nRe = 0;
//Call the function nRe = dsoHTDeviceConnect(nDeviceIndex); if (nRe = = 1)
;//Connected
else
;//Not Connected
3. DLL_API WORD WINAPI dsoHTSetCHPos(
WORD nDeviceIndex, WORD* pLevel, WORD nVoltDIV, WORD nPos, WORD nCH )
Return Value: If the function succeeds, the return value is zero. If the function fails, the return value is zero.
Parameters: nDeviceIndex index of the device pLevel pointer to calibration level. nVoltDIV index of channel nPos the position of channel, range: 0 ~ 255 (8bit) nCH the target channel (CH1 is 0, CH2 is 1, CH3 is 2. ………….) Remarks: Set channel level (Zero Level)
Example:
WORD nDeviceIndex = 0; WORD CHLevel[256]; // the calibration level, see dsoHTReadCalibrationData function WORD nVoltDIV = 6; // WORD nPos = 128; // WORD nCH = 0; //
// if ( 0 = = dsoHTSetCHPos(nDeviceIndex,CHLevel,nVoltDIV,nPos,nCH) ) ; //Fail else ; //Succeed
Loading...
+ 9 hidden pages