BNC 1201 - 6 1/2 Digit Digital Multimeter User Manual

Page 169

Advertising
background image

170

MsgBox "System command error.", vbExclamation, "1201 multimeter
device test"
stat = viClose(fList)
Exit Sub
End If
Rem send command -- Trigger source is IMMediate
stat = viWrite(sesn, "TRIG:SOUR IMM", 13, ret)
If (stat < VI_SUCCESS) Then
MsgBox "System command error.", vbExclamation, "1201 multimeter
device test"
stat = viClose(fList)
Exit Sub
End If
Rem send command -- Select dBm function
stat = viWrite(sesn, "CALC:FUNC DBM", 13, ret)
If (stat < VI_SUCCESS) Then
MsgBox "System command error.", vbExclamation, "1201 multimeter
device test"
stat = viClose(fList)
Exit Sub
End If

Rem send command -- Enable math
stat = viWrite(sesn, "CALC:STAT ON", 12, ret)
If (stat < VI_SUCCESS) Then
MsgBox "System command error.", vbExclamation, "1201 multimeter
device test"
stat = viClose(fList)
Exit Sub
End If

Rem send command -- Take readings
stat = viWrite(sesn, "READ?" & vbLf, 6, ret)
If (stat < VI_SUCCESS) Then
MsgBox "System command error.", vbExclamation, "1201 multimeter
device test"
stat = viClose(fList)
Exit Sub
End If

Sleep (3000) ' wait for math processing

Rem fetch the measure data
stat = viRead(sesn, readin, 128, ret)
If (stat < VI_SUCCESS) Then
MsgBox "Read in data error.", vbExclamation, "1201 multimeter device test"
stat = viClose(fList)
Exit Sub
End If

Rem set to local mode
stat = viWrite(sesn, "system:local", 12, ret)
If (stat < VI_SUCCESS) Then
MsgBox "System command error. (system:local)", vbExclamation, "1201
multimeter device test"
stat = viClose(fList)
Exit Sub
End If

stat = viClose(sesn)
stat = viClose(fList)

Advertising