SystCommunicate

M9370A / M9371A / M9372A / M9374A / M9375A

SYSTem: COMMunicate Commands


Controls and queries settings that affect the PNA system.

SYSTem:COMMunicate:

GPIB

    | PMETer

           | ADDRess

    | RDEVice

           | CLOSe

           | OPEN

           | READ?

           | RESet

           | WBINary

           | WBLock

           | WRITe

LAN:HOSTname

PSENsor

TCPip:CONTrol?

USB:PMETer:CAT?

VISA

    | RDEVice

           | FIND?

           | TIMeout

Click on a keyword to view the command details.

See Also


SYSTem:COMMunicate:GPIB:PMETer[:ADDRess] <num>  Superseded

Note: This command is replaced with SYST:COMM:PSENsor

(Read-Write) Specifies the GPIB address of the power meter to be used in a source power calibration. When performing a source power cal, the PNA will search VISA interfaces that are configured in the Keysight IO LIbraries on the PNA.

Parameters

 

<num>

GPIB address of the power meter. Choose any integer between 0 and 30.

Examples

SYST:COMM:GPIB:PMET 13

system:communicate:gpib:pmeter:address 14

Query Syntax

SYSTem:COMMunicate:GPIB:PMETer[:ADDRess]?

Return Type

Numeric

Default

13


SYSTem:COMMunicate:GPIB:RDEVice:CLOSe <ID>

(Write only) Closes the remote GPIB session. This command should be sent when ending every successful OPEN session.

Parameters

 

<ID>

Session identification number that was returned with the OPEN? command.

Examples

See an example program

Query Syntax

Not Applicable

Default

Not Applicable


SYSTem:COMMunicate:GPIB:RDEVice:OPEN <bus>, <addr>, <timeout>

(Read-Write) Initiates a GPIB pass-through session. First send this OPEN command, then send the OPEN query to read the session ID number. An existing GPIB pass-through session remains open after an instrument preset.

To learn more about GPIB pass-through capability, see the example program.

Parameters

 

<bus>

Bus ID number.

You can find the USB-GPIB adapter bus number by looking at the dialog that appears when the USB-GPIB device is connected. Error 1073 indicates the bus or address number is incorrect.

Use 0 (zero) when connected using a GPIB cable to the PNA controller port.

<addr>

GPIB Address of the device to be controlled

<timeout>

The amount of time (in milliseconds) to wait for a response from the remote device after sending a command.  A "timeout" error is displayed after this time has passed without a response.

Examples

See an example program

Query Syntax

SYSTem:COMMunicate:GPIB:RDEVice:OPEN?

Returns the session identification number that is used when communicating with this device.

Return Type

Numeric

Default

Not Applicable


SYSTem:COMMunicate:GPIB:RDEVice:READ? <ID>

(Read-only) Returns data from the GPIB pass-through device.

Parameters

 

<ID>

Session identification number that was returned with the OPEN? command.

Examples

See an example program

Return Type

String

Default

Not Applicable


SYSTem:COMMunicate:GPIB:RDEVice:RESet

(Write-only)   Performs the same function as SYST:COMM:GPIB:RDEV:CLOS except that ALL pass-through sessions are closed.

Examples

SYST:COMM:GPIB:RDEV:RES

Query Syntax

Not Applicable

Default

Not Applicable


SYSTem:COMMunicate:GPIB:RDEVice:WBINary <ID>,<data>

(Write-only)  Sends data to a GPIB pass-through device. This command requires a header that specifies the size of the data to be written. The header (described below) is not passed along to the device.

Use this command if too many embedded quotes prevent you from using SYST:COMM:GPIB:RDEV:WRIT.

Use SYST:COMM:GPIB:RDEV:OPEN to open the pass through session.

Parameters

 

<ID>

Session identification number that was returned with the OPEN? command.

<data>

Data to be sent to the GPIB pass-through device. Use the following syntax:

#<num digits><byte count><data bytes><NL><END>

<num_digits> specifies how many digits are contained in <byte_count>

<byte_count> specifies how many data bytes will follow in <data bytes>

Examples

SYSTem:COMMunicate:GPIB:RDEVice:WBINary 101,#17ABC+XYZ<nl><end>

# - always sent before data.

1 - specifies that the byte count is one digit (7).

7 - specifies the number of data bytes that will follow, not counting <NL><END>.

ABC+XYZ - Data block

<nl><end> - always sent at the end of block data.

 

The following example sends a line feed at the end.

SYST:COMM:GPIB:RDEV:WBIN 1,#210SYST:PRES<EOL>

The <EOL> represents your linefeed character.

Query Syntax

Not Applicable

Default

Not Applicable


SYSTem:COMMunicate:GPIB:RDEVice:WBLock <ID>,<data>

(Write-only)  Same as SYSTem:COMM:GPIB:RDEV:WBIN (above) but the header IS passed along to the device.

Use this command if too many embedded quotes prevent you from using SYST:COMM:GPIB:RDEV:WRIT.

Parameters

 

<ID>

Session identification number that was returned with the OPEN? command.

<data>

Data to be sent to the GPIB pass-through device. See previous command.

Examples

See previous example.

Query Syntax

Not Applicable

Default

Not Applicable


SYSTem:COMMunicate:GPIB:RDEVice:WRITe <ID>,<string>

(Write-only) Sends ASCII string data to the GPIB pass-through device.

A line feed is NOT appended to the string data. To send a line feed, see the example in SYST:COMM:GPIB:RDEV:WBIN.

Parameters

 

<ID>

Session identification number that was returned with the OPEN? command.

<string>

Commands to be sent to the GPIB pass-through device.

Examples

See an example program

Query Syntax

Not Applicable

Default

Not Applicable


SYSTem:COMMunicate:LAN:HOSTname?

(Read-only) Returns the LAN hostname that is visible in the Help, About Network Analyzer dialog box. Learn more. This is the same information that is visible on the LXI compliance dialog.

Parameters

None

Example

SYST:CONF:LAN:HOSTname?

Return Type

String

Default

Not applicable


SYSTem:COMMunicate:PSENsor <char>, <string>

This command replaces SYST:COMM:GPIB:PMET:ADDR.

(Read-Write) Specifies the type and location of the power meter to be used in a source power calibration.

Parameters

 

<char>

Type of power meter/ sensor. Choose from:

  • GPIB  GPIB power meter

  • USB  USB power sensor or USB power sensor

  • LAN  LAN enabled power meter

  • ANY  Any VISA resource string or a visa alias

<string>

For GPIB, address of the power meter. Choose any integer between 0 and 30.

For USB, the ID string of the power meter or power sensor. Use SYST:COMM:USB:PMET:CAT? to see a list of ID strings of connected power meters and sensors.

For LAN, the hostname or IP address of the power meter.

For ANY,  any VISA resource string or a visa alias.

Examples

SYST:COMM:PSEN gpib, "14"

system:communicate:psensor usb, "Keysight Technologies,U2000A,MY12345678"

syst:comm:psen lan, "mymeter.Keysight.com"

syst:comm:psen any, "TCPIP0::mymeter.Keysight.com::5025::SOCKET"

Query Syntax

SYSTem:COMMunicate:PSENsor?

Return Type

Character / String

Default

GPIB


SYSTem:COMMunicate:USB:PMETer:CATalog?

(Read-only) Returns the ID string of power meters / sensors that are connected to the PNA USB. Use the list to select a power sensor for a source power cal.

These meter/sensor ID strings can NOT be used as the resource string for configuring a USB-based PMAR (SYST:CONF:EDEV:IOConfig).

Parameters

 

Examples

SYST:COMM:USB:PMET:CAT?

system:communicate:usb:pmeter:catalog?

Return Type

Comma-delimited strings. Two power sensor strings are separate by a semicolon.

Default

Not applicable


SYSTem:COMMunicate:TCPip:CONTrol?

(Read-only) Queries the TCP/IP port number to use for opening a TCP/IP socket control connection to the PNA.  The control connection is used for two purposes:

  1. To perform a Device Clear operation on the PNA

  2. To detect when a Service Request (SRQ) event occurs on the PNA.

The port number can range from 5000 to 5099. The PNA will skip over 5025 as it is being used for the primary socket connection.

To detect an SRQ, your program sends the appropriate commands via the regular socket connection to set up for a SRQ event to occur the same sequence of commands as if you were sending them via GPIB.  You write your program so that while your program is doing SCPI transactions on the standard socket connection, a second thread of execution in your program detects the SRQ on the control connection and responds to the event.  When the SRQ event occurs, the PNA sends a SRQ +xxx/n message on the control connection (where /n is linefeed character, ASCII value 10 decimal).  The xxx value in the SRQ +xxx/n string is the IEEE 488.2 status byte at the time the SRQ was generated.  So listening for that on the control connection is how your program detects the event.  If for your socket communication youre using a software API that provides for asynchronous communication via a callback mechanism (for example, if youre using Microsofts winsock API, or their .NET Socket class as in the example program below), in that case your listener execution thread is created implicitly for you so your program doesnt have to create one explicitly.

Note: If this SCPI query is sent to the PNA via a SCPI parser other than a TCP/IP socket connection (for example, if sent via GPIB), the query is not applicable in that case and will return value of 0.

Parameters

None

Example

See example program

Return Type

Integer

Default

Not applicable


SYSTem:COMMunicate:VISA:RDEVice:FIND? <VISA regex> [,<ADDRess|ALIas>]

(Read-only) Returns a comma separated list of either VISA address strings or aliases.

Parameters

 

<VISA regex>

(String) VISA regular expressions are expressions defined by the user to find devices that have been set up on the VISA interface. The following are examples of VISA regular expressions:

Interface

Expression

GPIB

GPIB[0-9]*::?*INSTR

PXI

PXI?*INSTR

VXI

VXI?*INSTR

GPIB-VXI

GPIB-VXI?*INSTR

GPIB and GPIB-VXI

GPIB?*INSTR

All VXI

?*VXI[0-9]*::?*INSTR

ASRL

ASRL[0-9]*::?*INSTR

All

?*INSTR  or  ?*

Note that using "INSTR" in the VISA regular expression finds "instruments." To search all interfaces, use "?*".

<ADDRess|ALIas>

Optional. Determines whether addresses or aliases are returned.

Note: The list of aliases may have less‒or more‒entries than the list of addresses because not all addresses will have aliases, and one address can have more than one alias.

Examples

SYST:COMM:VISA:RDEV:FIND? "?*",ADDR

system:communicate:visa:rdevice:find? '?*INSTR',alias

Return Type

Variant

Default

Addresses returned if no return-type specified


SYSTem:COMMunicate:VISA:RDEVice:TIMeout <ID>, <timeout>

(Read-Write) Sets or returns the timeout value (in milliseconds) for VISA pass-through commands for the specified VISA session ID.

Parameters

 

<ID>

VISA session number that was returned with the OPEN? command.

<timeout>

The amount of time (in milliseconds) to wait for a response from the remote device after sending a command. A "timeout" error is displayed after this time has passed without a response.

Examples

SYST:COMM:VISA:RDEV:TIM 1,6000

system:communicate:visa:rdevice:timeout 3,6000

Query Syntax

SYSTem:COMMunicate:VISA:RDEVice:TIMeout? <ID>

Returns the timeout value for the specified session ID.

Return Type

Numeric

Default

2000