SX1 User Manual
17
M-SX1-001-01
7
Programming Guide
General Information
The SX1 follows the
SCPI
(Standard Commands for Programmable Instruments) message-based
programming standard. It conforms to the
USBTMC
(USB Test and Measurement) standard.
The TCP/IP libraries provided by most operating systems are sufficient. JGR Optics can provide a
communications library upon request.
Note: any
VISA
implementation is capable of controlling the SX1 via TCP/IP.
See the
section on page 10 for more information.
Step-by-step Guide
This section will provide a step-by-step programming guide in a
.NET
programming environment such as
C#
or
VB.NET
. Steps 3-
5 below can be skipped if using JGR’s
CommunicationsLib.dll
(available upon
request).
1.
Install
VISA
drivers on the development system
2.
Connect the SX1 via its USB B port to the development system
3.
Add a reference to
Ivi.Visa.dll
in your project:
C:\Program Files (x86)\IVI Foundation\VISA\Microsoft.NET\Framework32\v2.0.50727\VISA.NET Shared
Components 5.11.0\Ivi.Visa.dll
4.
Use the
IVI.Visa.GlobalResourceManager
to find all USB instruments on your system:
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: