beautypg.com

Visual basic programming demo, Visual basic programming demo -11 – RIGOL DP832A User Manual

Page 199

background image

Chapter 4 Programming Demos

RIGOL

DP800 Programming Guide

4-11

Visual Basic Programming Demo

The program used in this demo: Visual Basic 6.0

The function realized in this demo: enable the three channels of the power supply and show the colors

of the channels by taking DP831A as an example.

1

Build a standard application program project (Standard EXE) and name it as DP800_Demo_VB.

2

Click the Existing tab of ProjectAdd Module. Search for the visa32.bas file in the include folder

under the NI-VISA installation path and add the file.

3

Add three CommandButton controls to represent CH1, CH2 and CH3 respectively. Add three Text

controls (Label1(0), Label1(1) and Label1(2)) to represent the status of the three channels

respectively (by default, the Text control is gray; when the channel is enabled, it displays the color of

the channel). The layout of the controls is as shown in the figure below.

4

Open the General tab in ProjectProject1 Properties and select Form1 in the Startup Object
dropdown box.

5

Double-click CH1 to enter the programming environment. Add the following codes to control CH1, CH2

and CH3. The codes of CH1 are as shown below; the codes of CH2 and CH3 are similar.

Dim defrm As Long

Dim vi As Long

Dim strRes As String * 200

Dim list As Long

This manual is related to the following products: