6-50
TOS
6200/6210
S
ample program 3
This p
rogra
m
ru
ns
A
UTO exec
ut
i
o
n
o
f
t
he
10t
h p
rogra
m c
r
e
at
ed in s
a
mple p
rogra
m
2
a
nd displ
a
ys
t
he
r
es
u
l
t
s in
t
he mess
ag
e b
o
x
.
Option Explicit
Private Sub Command1_Click()
'Writing style is based on VISA 1.20 or 2.01
'-------------------------------------------
Dim vi As Long, tos As Long
Dim vs As Long
'Initialize VISA library
'Initializes the VISA library.
vs = viOpenDefaultRM(vi)
'Open GPIB or COM1 port for tos
'Opens the port.
vs = viOpen(vi, "GPIB::3", vbNull, 10, tos)
'Opens the GPIB port. Address 3
'vs = viOpen(vi, "ASRL1", vbNull, 10, tos)
'Opens the COM1 port. When
'using the RS-232C interface,
'remove the comment from this
'line and add it to the line of
'GPIB.
'Sets attributes if RS232
'Enter communication settings
Dim lIntfType As Long
'for the RS-232C interface.
vs = viGetAttribute(tos, VI_ATTR_INTF_TYPE, lIntfType)
If lIntfType = VI_INTF_ASRL Then
vs = viSetAttribute(tos, VI_ATTR_ASRL_BAUD, 9600)
vs = viSetAttribute(tos, VI_ATTR_ASRL_PARITY, VI_ASRL_PAR_NONE)
vs = viSetAttribute(tos, VI_ATTR_ASRL_DATA_BITS, 8)
vs = viSetAttribute(tos, VI_ATTR_ASRL_STOP_BITS, VI_ASRL_STOP_TWO)
vs = viSetAttribute(tos, VI_ATTR_ASRL_FLOW_CNTRL, VI_ASRL_FLOW_XON_XOFF)
End If
Const DSR_READY = 1: Const DSR_INVSET = 2: Const DSR_TEST = 4: Const DSR_TESTON = 8
'Definition of the device
'status register.
Const DSR_PASS = 16: Const DSR_FAIL = 32: Const DSR_STOP = 64: Const DSR_PROTECTION = 128
Const LOWER_FAIL = 2: Const UPPER_FAIL = 4
'Definition of the fail
'register.
Const OHP = 1: Const OHTP = 2: Const OVLD = 4: Const VL = 8
'Definition of the protection
Const REN = 16
'register.
Dim r As Long, c As Long
Dim strCommand As String, strRdBack As String, DSR As Integer, Result As String
strRdBack = Space(255)
'Device Clear
'Device clear.
vs = viClear&(tos)
'Device clear performed when
'using GPIB.
'strCommand = "SILENT 1" + vbCrLf: vs = viWrite(tos, strCommand, Len(strCommand), r)
'RS-232C command.
'strCommand = "CLR" + vbCrLf: vs = viWrite(tos, strCommand, Len(strCommand), r)
'The RS-232C interface uses
'the CLR command.
strCommand = "FUNCTION 1" & vbCrLf: vs = viWrite(tos, strCommand, Len(strCommand), r)
'Switches to AUTO screen.
strCommand = "PRGTEST 10" & vbCrLf: vs = viWrite(tos, strCommand, Len(strCommand), r)
'Recalls the 10th program.
strCommand = "PASSHOLD HOLD" + vbCrLf: vs = viWrite(tos, strCommand, Len(strCommand), r)
'Sets PASS HOLD time to HOLD.
strCommand = "DSE #HFF" + vbCrLf: vs = viWrite(tos, strCommand, Len(strCommand), r)
'Sets the device status enable
'register to FFH.
Do
'Checks the device status
strCommand = "DSR?" + vbCrLf: vs = viWrite(tos, strCommand, Len(strCommand), r)
'register and awaits a "Ready"
vs = viRead(tos, strRdBack, 255, c)
'setting.
Summary of Contents for tos6200
Page 1: ...Part No Z1 003 302 IB008755 Aug 2011 OPERATION MANUAL EARTH CONTINUITY TESTER TOS6200 TOS6210...
Page 36: ...3 8 TOS6200 6210...
Page 130: ...6 52 TOS6200 6210...
Page 136: ...7 6 TOS6200 6210...
Page 154: ...A 10 TOS6200 6210...