BR1 User Manual
22
M-BR1-001-01
Public
Overrides
Function
GetAllAddresses
()
As
String
()
Try
Dim
nameList
As
New
List
(
Of
String
)
nameList
=
GlobalResourceManager.Find
(
“USB
?*
INSTR”
)
Return
nameList.ToArray
()
Catch
ex
As
Exception
Return
Nothing
End
Try
End
Function
5.
Open an
IMessageBasedSession
to the desired device using an address from the
nameList
in the
previous step:
Private
visa
As
IMessageBasedSession
visa
=
GlobalResourceManager.Open
(
addr
)
6.
Use the
Write
method to send SCPI commands and the
Read
method to retrieve results:
Public
Overrides
Function
Read
(
ByVal
readableOnly
As
Boolean
)
As
String
Dim
response
As
String
=
String.Empty
response
=
visa.RawIO.ReadString
()
If
response
=
String.Empty
Then
Throw
New
Exception
(
"Read from device failed"
)
End
If
Return
response
End
Function
Public
Overrides
Sub
Write
(
ByVal
strCommand
As
String
)
visa.RawIO.Write
(
strCommand
)
End
Sub
Write
commands require termination with the linefeed character
\n
.
Notes
1.
Some commands can take several seconds to return. The
Read
timeout should be increased to at
least 5000ms using
visa.TimeoutMilliseconds
2.
The BR1 runs SCPI commands synchronously. An
*OPC?
command can be sent and a
1
will be
returned when all operations have been completed:
Query
(
"LAS:ENAB "
+
iWavelength.ToString
()
+
";OPC?"
+
vbLf
)
Commands Lists
See Table 5 and Table 6 for SCPI required commands and BR1 commands respectively.