BNC 645 User Manual
Page 186

186
' Put the address from the communication dialog in text box
txtAddress.Text = Model 645.Address
End Sub
Private Sub cmdStartReading_Click()
' Command Button 3
' Call the routine that sets up the meter
cmdStartReading.Enabled = False
startReadings
cmdStartReading.Enabled = True
End Sub
Private Sub Form_Load()
' Form1
' Load the forms address text box with persistant
' instrument address from BERKELEY NUCLEONICS CORPORATION.IOUtils object
txtAddress.Text = Model 645.Address
End Sub
Private Sub startReadings()
Dim Average As Double
Dim MinReading As Double
Dim MaxReading As Double
Dim Value As Integer
Dim Mask As Integer
Dim Task As Integer
Continued on next page
On Error GoTo StartReadingsError
' Clear out text box for the data so we can see
' when new data arrives
txtData.Text = ""
txtData.Refresh
'""""""""""""""""""""""""""""""""""""""""""""""""""
' Setup dmm to return an SRQ event when readings are complete
With Model 645
' Set the address from users text box
.Output = "*RST" ' Reset dmm
.Output = "*CLS" ' Clear dmm status registers
.Output = "*ESE 1" ' Enable 'operation complete bit to
' set 'standard event' bit in status byte
.Output = "*SRE 32" ' Enable 'standard event' bit in status
' byte to pull the IEEE-488 SRQ line
.Output = "*OPC?" ' Assure syncronization
Value = .Input
End With
'""""""""""""""""""""""""""""""""""""""""""""""""""
' Enable the SRQ polling so we can poll for SRQ
Model 645.EnableSRQ = True
txtData.Refresh
'"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
' Configure the meter to take readings
' and initiate the readings (source is set to immediate by default)
numberReadings = 10
With Model 645
.Output = "Configure:Voltage:dc 10" ' set dmm to 10 volt dc range"
.Output = "Voltage:DC:NPLC 10" ' set integration time to 10 Power line cycles
(PLC)"
.Output = "Trigger:count" & Str$(numberReadings) ' set dmm to accept multiple