Using configure with a math operation – BNC 645 User Manual

Page 182

Advertising
background image

182

To change the startup object
1. With a project selected in Solution Explorer, on the Project menu

click Properties.

2. Select the Application pane.
3. Select a Startup object from the Startup object drop-down list.


To set the startup object for a Windows Application to Sub Main
1.

With a project selected in Solution Explorer, on the Project menu click

Properties.

2.

Select the Application pane.

3.

Check the Startup with custom Sub Main checkbox.

4.

Select Sub Main from the Startup object drop-down list.


LISTING D.1.

MEASure.bas--THE Sub Main FUNCTION IS WHERE

YOU NEED TO ADD INITIALIZATION CODE.

Sub Main()

Dim Model 645 As Object

Dim Rdg as Double

' To assign an object reference using CreateObject

Set Model 645 = CreateObject("Berkeley Nucleonics Corporation.IOUtils")

' Address String Grammar for ResourceName Parameter

' USB[board]::manufacturer ID::model code::serial number[::USB interface

' number][::INSTR]

' or

' GPIB0::22

Model 645.Connect = "USB::5710::

4002::tw00000001"

Model 645.Output = "*RST" ' Reset Model 645

Model 645.Output = "*CLS" ' Clear Model 645 status registers

Model 645.Output = "MEASURE:CURRENT:AC? 1A,0.001MA" ' Set to 1 amp ac range

Rdg = Model 645.Input

Debug.Print Rdg

' Unload Object

Model 645.Close

Set Model 645 = Nothing

End Sub

Using CONFigure with a Math Operation

Advertising