メインコンテンツまでスキップ
バージョン:23.5

Connecting to a Device

In SenseTalk , Virtual Instrument Software Architecture (VISA) functions allow you to:

VisaDevice Function

Calling this function is the essential first step in any SCPI script.

Behavior: Opens a connection to a known test and measurement device and returns a VisaDevice object that represents the device.

Parameters: The VISA address of a device, such as one returned by the visaAddresses function. You can use an alias instead of an address. You can assign an alias from within the Keysight Connection Expert program.

Syntax:
visaDevice( deviceAddr )
the visaDevice of deviceAddr

Example:

set deviceAddr to “USB0::)x2A8D::0x0F02::MY56004754::0::INSTR” // Stores the VISA address of a device into the variable 'deviceAddr'
set powerAnalyzer to visaDevice (deviceAddr) // Opens a connection to the VISA device and assigns the VISA device object to the variable 'powerAnalyzer'

Example:

put the visaDevice of “UsbInstrument1” into myInstrument // Opens a connection to the VISA device with the alias "UsbInstrument1" and assigns the VISA device object to the variable 'myInstrument'
ノート

The examples use the variables powerAnalyzer and myInstrument. Always use a descriptive variable name for your device.

VisaAddresses Function

Behavior: Obtains a list of the VISA addresses of known test and measurement devices that are configured in the Keysight Connection Expert program. You can then open a connection to one of these devices using the visaDevice function.

Syntax:
the VisaAddresses

Example:

put the VisaAddresses into visaDevices // Stores the list of returned VISA addresses in variable 'visaDevices'.

ST\_VISA\_Version Function

SenseTalk features that support VISA and SCPI are in an external module (Xmodule) called ST_VISA. To use these features, both the ST_VISA Xmodule and [Keysight IO Libraries] must be present on your machine.

Behavior: Verifies that the Xmodule and Keysight IO Libraries are installed on the test system, and returns the version number of the Xmodule.

Syntax:
the ST_VISA_Version

Returns: The current version number of the VISA and SCPI functionality, or an informative message if the module isn’t present or could not be loaded.

Example:

put the ST_VISA_Version // Returns the current version number of the VISA and SCPI functionality