DSA800 series programming guide - Page 235

For DSA815.

Loading ...
Loading ...
Loading ...
Chapter 3 Programming Demos RIGOL
DSA800 Programming Guide 3-13
Visual Basic 6.0 Programming Demo
Enter the Visual Basic 6.0 programming environment and follow the steps below.
1. Build a standard application program project (Standard EXE) and name it as DemoForDSA.
2. Open Project Add File… . Search for the visa32.bas file under the include folder under the
installation path of NI-VISA and add the file which contains all VISA functions and constant statements
to the project.
Then add the Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) statement
into the visa32.bas, or create a new module to declare the Sleep function.
3. Add the Label, Text and Button controls as shown in the figure below.
4. Encapsulate the write and read operations of VISA.
1) Encapsulate the write operation of VISA for easier operation.
'-----------------------------------------------------------
'Function Name:InstrWrite
'Function:Send command to the instrument
'Input:rsrcName,instrument(resource) name
strCmd,Command
'-----------------------------------------------------------
Public Sub InstrWrite(rsrcName As String, strCmd As String)
Loading ...
Loading ...
Loading ...