Program in visual basic 6.0, Program in visual basic 6.0 -7 – RIGOL DS1000D User Manual

Page 111

Advertising
background image

Programming Guide for DS1000E, DS1000D Series

3-7

Program in Visual Basic 6.0


Example 1: Query and set the channel status


This example shows you how to create a Demo to query or set the channel status.
Open Visual Basic 6.0, take the following steps:

1. Create a Standard EXE project and copy the Dynamic Link Library

RigolTMCUsb_UI.dll from Demo files into the new project for later use.

2. Named Form1 “Demo”. Then add three CommandButtons (CH1, CH2 and

MATH) and three Labels for showing the status of these buttons respectively
(the label colour varies with the channel status, that is, when the channel is on,
the label shows relative colour; on the contrary, if the channel is off, the colour
of label will be gray), see the figure below:

3. Enter into the programming environment, then, quote the functions

(ReadUSB,WriteUSB,GetTMCDeviceNum) in the Dynamic Link Library
RigolTMCUsb_UI.dll
and add the following codes in the area of project code:

Private Declare Function ReadUSB Lib "RigolTMCUsb_UI.dll" (ByVal Index As
Long, ByVal lpszLength As Long, ByVal lpszBuffer As Long) As Boolean

Private Declare Function WriteUSB Lib "RigolTMCUsb_UI.dll" (ByVal Index As
Long, ByVal msgid As Long, ByVal tag As Long, ByVal length As Long, ByVal
lpszBuffer As Long) As Boolean

Private Declare Function GetDeviceNum Lib "RigolTMCUsb_UI.dll" () As Long

Advertising
This manual is related to the following products: