Programming via LAN. Agilent Technologies E2094S


Add to my manuals
146 Pages

advertisement

Programming via LAN. Agilent Technologies E2094S | Manualzz

Agilent IO Libraries Suite

Agilent VISA User’s Guide

N O T E

5

Programming via LAN

This chapter provides guidelines for programming via a LAN (Local

Area Network). A LAN allows you to extend the control of instrumentation beyond the limits of typical instrument interfaces.

The chapter contents are:

LAN Interfaces Overview

Communicating with LAN-Connected Devices

This chapter describes programming using the VISA TCPIP interface type to communicate directly with a LAN-connected device, as well as using a remote interface (also known as a LAN client) to emulate a

GPIB, serial (ASRL), or USB interface on the local machine to communicate with a LAN-connected device.

See the Agilent IO Libraries Suite Online Help for information on how to start and stop the Remote IO Server software, and on how to create and configure LAN interfaces and remote GPIB/USB/serial interfaces.

See the Connectivity Guide for detailed information on connecting instruments to a LAN, and for a discussion of network protocols.

Agilent Technologies

117

5

Programming via LAN

LAN and Remote Interfaces Overview

This section provides an overview of LAN (Local Area Network) interfaces. A LAN is a way to extend the control of instrumentation beyond the limits of typical instrument interfaces. To communicate with instruments over the LAN, you must first configure a LAN interface or a remote GPIB, USB, or serial interface, using the Agilent Connection

Expert.

Direct LAN Connection versus Remote IO Server/Client

Connection

Some instruments support direct connection to the LAN. These instruments include an RJ-45 or other standard LAN connector and software support for operating as an independent device on the network.

Some of these instruments are Web-enabled, meaning that they host a

Web page which you can access over the LAN.

With the Agilent IO Libraries Suite, you can connect to instruments across the LAN even if they do not have direct LAN capability, if they are connected to gateways (such as the Agilent E5810A) or to another

PC running the Remote IO Server software.

Refer to the IO Libraries Suite and the Connectivity Guide for information on connecting and configuring different types of LAN instrument connections.

Remote IO Server/Client Architecture

The Remote IO Server and Client software provided with Agilent IO

Libraries Suite allows instrumentation to be controlled over a LAN.

Using standard LAN connections, instruments can be controlled from computers that do not have special interfaces for instrument control.

Client/Server Model

The IO Libraries Suite software uses the client/server model of computing. Client/server computing refers to a model in which an application (the client) does not perform all necessary tasks of the application itself. Instead, the client makes requests of another computing device (the remote I/O server) for certain services.

118 Agilent VISA User’s Guide

Programming via LAN

5

As shown in the following figure, a remote I/O client (a Windows PC) makes VISA requests over the network to a remote I/O server (such as a

Windows PC, an E5810 LAN/GPIB Gateway, or a Series 700 HP-UX workstation).

Gateway Operation

The remote I/O server is connected to the instrumentation or devices to be controlled. Once the remote I/O server has completed the requested operation on the instrument or device, the remote I/O server sends a reply to the client. This reply contains the requested data and status information that indicates whether or not the operation was successful.

The remote I/O server acts as a gateway between the LAN software that the client system supports and the instrument-specific interface that the device supports.

Agilent VISA User’s Guide 119

5

Programming via LAN

Client

Windows PCs

LAN

Remote

I/O

Server

Series 700 workstation or

Windows PC

GPIB bus

(or other)

E5810

LAN/GPIB

Gateway

GPIB

Instrument

LAN Instruments

(VXI-11.2 GPIB Emulation

or

VXI-11.3 LAN Instruments)

GPIB

Instruments

GPIB bus

120 Agilent VISA User’s Guide

Programming via LAN

5

Addressing LAN-Connected Devices

VISA can communicate with LAN-connected devices in one of two ways:

TCPIP interface type

Remote interface type (available only with Agilent IO Libraries

Suite)

Using the TCPIP Interface Type for LAN Access

VISA provides the TCPIP interface type to communicate with

LAN-connected devices. These can be devices connected directly to the

LAN, or they can be connected to the LAN through a LAN gateway such as the Agilent E5810 LAN/GPIB gateway or through Remote IO

Server software running on a remote computer with instruments connected to it.

The format of a TCPIP VISA resource string is:

TCPIP[<board>]::<hostname>[::<LAN device name>][::INSTR] where:

<board> = board number (default is 0)

<hostname> = the hostname or IP address of the LAN device or server

<LAN device name> = the remote device name (case sensitive with default name of inst0)

Using Connection Expert, you can configure a LAN interface to use either the VXI-11 protocol or the SICL-LAN protocol. The protocol(s) you will use depends upon the devices you are using and the protocol(s) that they support.

The VXI-11 protocol constrains the LAN device name to be of the form

inst0, inst1, … for VXI-11.3 devices and gpib0,n, gpib1,n, … for

VXI-11.2 (GPIB Emulation) devices.

The SICL-LAN protocol allows any valid SICL name for the LAN device name. A valid SICL name must be a unique string of alphanumeric characters, starting with a letter.

Agilent VISA User’s Guide 121

5

Programming via LAN

Some examples of TCPIP resource strings follow.

Table 28 Example TCPIP Resource Strings

String

TCPIP0::[email protected]::gpib0,2::INST

R

TCPIP0::123.456.0.21::gpib0,2::INSTR

TCPIP0::myMachine::inst0::INSTR

TCPIP::myMachine

TCPIP0::testMachine1::COM1,488::INSTR

TCPIP0::myMachine::gpib0,2::INSTR

TCPIP0::myMachine::UsbDevice1::INSTR

Description

A VXI-11.2 GPIB device at hostname

[email protected].

A VXI-11.2 GPIB device at a machine whose IP address is

123.456.0.21.

A VXI-11.3 LAN instrument at hostname myMachine.

A VXI-11.3 LAN instrument at hostname myMachine. Note that default values for board = 0, LAN device name = inst0, and the

::INSTR resource class are used.

An RS-232 device connected to a LAN server or gateway at hostname testMachine1. This device must use SICL-LAN protocol since RS-232 devices are not supported by the VXI-11 protocol.

A GPIB device at hostname myMachine. This device must use

SICL-LAN protocol since gpib0,2 is not a valid remote name with the VXI-11 protocol.

A USB device with a SICL alias of UsbDevice1 connected to a

LAN server at hostname myMachine. Note that the SICL alias is defined on the remote machine, not on the local machine.

Although the SICL and VISA alias names are normally the same, if they are not, you must be sure to use the SICL alias and not the

VISA alias.

This device must use the SICL-LAN protocol since USB devices are not supported by the VXI-11 protocol.

122 Agilent VISA User’s Guide

Programming via LAN

5

Table 28 Example TCPIP Resource Strings

String

TCPIP0::myMachine::usb0[2391::1031::SN_00123

::0]::INSTR

Description

A USB device with:

Manufacture ID = 2391

Model Code = 1031

Serial Number = 'SN_00123'

USBTMC Intfc # = 0 connected to a LAN server at hostname myMachine.

This device must use SICL-LAN protocol since USB devices are not supported by the VXI-11 protocol.

N O T E

Agilent VISA User’s Guide

A LAN session to a remote interface provides the same VISA function support as if the interface were local, except that VXI-specific functions are not supported over LAN.

Addressing a Session Using the TCPIP Interface Type

This sample shows one way to open a device session with a GPIB device at primary address 23 on a remote PC that is running a LAN

server. The hostname of the remote PC is myMachine. See Chapter 3,

“Programming with VISA”, for more information on addressing device

sessions.

ViSession defaultRM, vi;.

.

viOpenDefaultRM(&defaultRM); viOpen(defaultRM,

"TCPIP0::myMachine::gpib0,23::INSTR", VI_NULL,

VI_NULL, &vi);

.

.

viClose(vi);

123

5

Programming via LAN

124 viClose(defaultRM);

Using a Remote Interface for LAN Access

Agilent VISA provides three types of VISA LAN Client interfaces, implemented in Agilent IO Libraries Suite as remote interfaces:

Remote serial interface (ASRL VISA LAN Client)

Remote GPIB interface (GPIB VISA LAN Client)

Remote USB interface (USB VISA LAN Client)

Remote interfaces are configured using Connection Expert; they provide virtual GPIB, serial, or USB interfaces. They make it possible to remotely access a LAN-connected device as if it were connected to a local interface. If, for example, the GPIB2 interface is configured as a remote GPIB interface, a program controlling the devices

GPIB2::5::INSTR and GPIB2::7::INSTR would not be aware of the fact that these devices are actually connected via LAN and not to a

GPIB interface connected to the local machine.

See the Agilent IO Libraries Suite Online Help for specific information on configuring remote interfaces.

Remote Serial Interface (ASRL VISA LAN Client)

A remote serial interface can use only the SICL-LAN protocol. A remote serial interface can be configured to use the serial port on the

Agilent E5810 LAN/GPIB gateway or the serial ports on a PC running the Remote IO Server software.

Remote GPIB Interface (GPIB VISA LAN Client)

A remote GPIB interface can use both the VXI-11 and SICL-LAN protocols. Typical uses for remote GPIB interfaces are with LAN/GPIB gateways (e.g. Agilent E5810), PCs with GPIB interfaces that are running a LAN server, and VXI-11.2 LAN-based instruments.

A remote GPIB interface can only be used to communicate with

VXI-11.2 (GPIB Emulation) devices. This is because the VISA GPIB interface type requires a primary and (optionally) a secondary address when communicating with a device. VXI-11.3 devices do not support the concept of a primary address, so they cannot be accessed with a remote GPIB interface.

Agilent VISA User’s Guide

Agilent VISA User’s Guide

Programming via LAN

5

Remote USB Interface (USB VISA LAN Client)

A remote USB interface can use only the SICL-LAN protocol. It can communicate with USB devices attached to a remote PC running the

Remote IO Server software.

Note that if you have defined a VISA alias for a USB device on the remote I/O server, you must either define the same (or another) alias for the remote USB device on the client PC, or use the full USB resource string. Alias definitions are not shared between the remote I/O server and the client.

Addressing a Session Using a Remote Interface

In general, the rules to address a remote session are the same as to address a local session. The only difference for a remote session is that you use the VISA interface ID (provided during I/O configuration via

Connection Expert) that relates to the remote interface.

The following sample shows one way to open a device session with a

GPIB device at primary address 23 on a remote PC that is running

Remote IO Server software. A remote GPIB interface has been

configured at GPIB2 to communicate with that machine. See Chapter 3,

“Programming with VISA”, for more information on addressing device

sessions.

ViSession defaultRM, vi;.

.

viOpenDefaultRM(&defaultRM); viOpen(defaultRM, "GPIB2::23::INSTR", VI_NULL,

VI_NULL, &vi);

.

.

viClose(vi); viClose(defaultRM);

125

5

Programming via LAN

126 Agilent VISA User’s Guide

advertisement

Was this manual useful for you? Yes No
Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Related manuals

Download PDF

advertisement

Table of contents