AB80-11 VXI-11a Tutorial
5 pages
English

AB80-11 VXI-11a Tutorial

Le téléchargement nécessite un accès à la bibliothèque YouScribe
Tout savoir sur nos offres
5 pages
English
Le téléchargement nécessite un accès à la bibliothèque YouScribe
Tout savoir sur nos offres

Description

AB80-11ICSICS ELECTRONIC Sdivision of Systems West Inc.APPLICATIONBULLETINVXI-11 TUTORIALand RPC Programming GuideINTRODUCTION VXI-11.2 deals with connecting GPIB instruments to a network though a Gateway like ICS's 8065 or Agilent's E5810A Ether-Mention the VXI-11 Specifi cation and you will get a lot of blank looks net-to-GPIB Controller. since the VXI-11 Specifi cation is not as well known as IEEE-488 VXI-11.3 deals with connecting IEEE-488.2 instruments with Eth-Standard or SCPI. A lot of engineers think that the VXI-11 Speci- ernet interfaces directly to a network. A couple of examples are fi cation deals exclusively with VXIbus Systems which is not true. ICS's 8064 Relay Interface or 8099 Modbus RTU Controller.Because of the increasing use of instruments with LAN (Ethernet) interfaces, knowledge about the VXI-11 Communication Protocol The VXI-11.2 and VXI-11.3 sub-sections are the primary focus of is becoming more important. This Application Note describes the this Application Note.specifi cation and shows the user how to use the VXI-11 protocol to control instruments. NETWORK INSTRUMENT PROTOCOLTHE VXI-11 SPECIFICATION In order to allow ASCII messages and IEEE-488.1 instrument control messages to pass over a TCP Network, the VXI-11 Specifi cation The VXI-11 Specifi cation was part of a suite of specifi cations de- created the Instrument Messages listed below in Table 1. These mes-veloped in the early 1990s when the VXIbus concept was ...

Informations

Publié par
Nombre de lectures 47
Langue English

Extrait

ICS ICS ELECTRONICS division o.
VXI-11 TUTORIAL ogramming Guid
Mention the VXI-11 Specification andou will get a lot of blank looks the VXI-11 Scation is not as well known as IEEE-488 or SCPI.A lot of engineers think that the VXI-11 Speci-cation deals exclusivelwith VXIbus Swhich is not true.of the increasinuse of instruments with LAN (Ethernet) interfaces, knowledge about the VXI-11 Communication Protocol is becoming more important.This Application Note describes the cation and shows the user how to use the VXI-11 t
THE VXI-11
TI
VXI-11 Specification was part of a suite of specifications de-when the VXIbus concecreated.VXI-11 describes hw instrumentsr therdevices can be cnnected to industrTCP/IP networks. The communications and su bthe VXI-11 scation are similar in nature to the techniques supported bIEEE-488.1 and IEEE 488.2. The protocol described allows ASCII-based com-to takebetween a controller and a device over a computer network.
VXI-11 Scation has the followin 1. Toallow ASCII messages, including IEEE 488.2 messages, and 488.1 instrument control messages to be passed between a controller and a device over a TCP/IP network. 2. Todefine an instrument protocol which can be used for this TCP/IP network. 3. Toenable the interconnection of inde apparatus into a single functional s 4. Toprovide a mechanism to extend the protocol. To define an instrumentwhich can sudiverse application interfaces. 6. Toallow for other networking protocols as the functionalitof
VXI-11 Specification has three sub-sections: VXI-11.1 which deals with connectinVXIbus devices to a network and is not considered anApplication Note.
APPLICATION BULLETIN
VXI-11.2 deals with connectinGPIB instruments to a network though a Gatewalike ICS's 8065 or Agilent's E5810A Ether-. VXI-11.3 deals with connectinIEEE-488.2 instruments with Eth-interfaces directlto a network. A couple of examples are TU Controller.
VXI-11.2 and VXI-11.3 sub-sections are the primarfocus of this Application Note.
PROTOCOL
n order to allowASCII messaes and IEEE-488.1 instrument control to pass over a TCP Network, the VXI-11 Specification reated the Instrument Messages listed below in Table 1.These mes-are based on the ONC Remote Procedure Call (RPC) model.model allows an application (tcalled the client) to call in a remote application or device ( the server) as if the were beinexecuted locall. TheInstrument Messages will be familiar to anwho has worked with GPIB instruments. (SeeICS Application Bulletin AB48-11)
Table VX Messa ChannelDescription create_link coreopens a link to a device device_write coredevice receives a message device coredevice returns a result device_readstb coredevice returns its status b device_trigger coredevice executes a trigger device coredevice clears itself device_remote coredevice disables its front panel device_local coredevice enables its front panel device coredevice is locked device coredevice is unlocked create_intr_chan coredevice creates interrupt channel destro coredevice destro device_enable_srq coredevice enables/disables sending of  servicerequests device coredevice executes a command destro corecloses a link to a device device_abort abortdevice aborts an in-progress call device_intr_srq interruptused b
CHANNEL ANDLINK
Figure 1 shows the basic channel connection concept.A channel is a connection from an instrument controllerto an instrument The Core channel is the main channel for commu-with a VXI-11.2 Gatewaor a VXI-11.3 Instrument.The

3 shows an example of a controller having links to multiple logical devices in a single instrument.This could be an Ethernet with three addressable sub-sections.If the single instru-ment was a GPIB instrument it might have a single primaraddress multiple secondaraddresses. MostVXI-11 devices use the logical device name.In Figure 3, the logical device names anin
4 shows an example of an instrument controller linked to two GPIB instruments through a GPIB Gatewa. GPIBGatewa rec-ognize asthe interface name fthe first IEEE-488.1 interface the Gatewa. GPIBdevices attached to the Gatewaare referred
link1 can be to- the Gatewa e 1 link2 can be t- a GPIB device with a primar  address Abort channel is a secondarcontrol channel that is used to link3 can be to- a GPIB device with a primar tell the Device to abort the current Core channel operation.The  addressof 6 and a secondar1. channel is used bthe Device to send Service Requests to the AHowever, in the case of the Interruchannel, the PR VXI-11DEVI acts as the client and sends the request to a server process in the Controller. are two mawa toprogram VXI-11 Devices: make calls a VXI-11 compliant VISA libraror install the VXI-11's RPCL Links represent an instance of a communication pathwabetween computer and writeprogram with RPC calls.Windows a controller and a device. Angiven network instrument connec-users will find it easier to use a VISA librarwhich has a VXI-11tion (channel) macarr multilinks created with the create_link output and program with graphical programs like National RPC. Also note that more than one controller mahave a link open Instruments' LabVIEW or Agilent's VEE or make VISA calls from to a single device at the same time.If this is a possibilit, then programming languages such as C/C++ or Visual Basic.use a device lock to block other controllers from accessinthe LINUX and similar operating susers (Sun, Apple etc.) find it easier to install the VXI-11 RPCL on the computer and to write the application program in C/C++.VISA libraries are Fi available for some UNIX like operating sbut theoften
k Host Networ InstrumentHost Networ VXI-11 compliant VISA libraries are available from National and ANational Instruments claims their VISA is VXI-11 compliant but it onlsupports VXI-11.3 RPCs it can onlbe used with VXI-11.3 instruments.It cannot be used to control GPIB bus functions or to comcontrol Fi e2 Basic VXI-11.2 GPIB Gatewasuch as Agilent's E5810A or ICS's 8065. TheNI Enet/100 is not a VXI-11 Gatewa. Agilent's VISA suVXI-11.2 and 11.3 RPCs so it can be used with k H k Network Instrument Host NetworVXI-11.3 instruments.
e 3Multiple Link Example
link2 link3
ilent includes their VISAand SICLlibraries asart of their IO Libraries Suite.SICL is the workhorse librarinside Agilent's VISA. Itis fullVXI-11.2 and 11.3 capable and has been table for manears.has numerousAA ilentlication Notes how to program withtheir VISA and SICL librar.see ICS Application Bulletin AB80-2 for an interactive ke VisualBasic.
Interface Devic Instrument Figure 5 shows how easit is for Windows programmers to N k In VXI-11 instruments throua VISA la. Fi5A how to control GPIB Instruments through a GPIB Gate-wa likethe ICS 8065.A C/C++, Visual Basic or LabVIEW Devic onl hasto set the resource strinto a TCPIP F e4 CS Electronics7034 Commerce Circle, Pleasanton, CA 94588Phone: 925 416-1000Fax: 925 416-010
 �   
F e5
oll
 
Tr
r
r r Code for serv
Fi e6 RPCGenOutput Files  .h file is a C header file.It contains readC declara-of the numbers and data tin the VXI-11 RPCL function list. The_svc.c file can be iunless areim a  . Notethat a server implementation is onlrequired if �   � _clint.c file contains the stub functions forapplication  e 5BControllin VXI-11.3Instruments throuVI THE BA Figure 5B shows a similar path through VISA to a VXI-11.3 compat-ible instrument.In Figure 5A, the VISA resource string specifies Table 2VXI-11 Program Steps a essto select a GPIB instrument.In Figure 5B, the VISA resource string specifiesinstto select an instrument.In both Descr VISA librarVXI-11 RPC protocol.Creates RPC client and opens a channel to the1 clnt_create()  RPCserver on a VXI-11 2 create_link()Establishes a link to a logical device 1 PA3 device_write()Sends a message or command to the logical 4 device_read()Reads a response message from a logical device. VXI-11 was designed to function over RPC.RPC stands for Remote 5 destroCloses the link to the device. Call and is a protocol designed bSun Micros 6 clnt_destro Destro ago (See Reference 8).The VXI-11 messages listed in able 1 are encapsulated within RPC messages.An RPC message able 2 lists the basic steps needed to program a VXI-11 device.It the function number and all of the arguments required b with using the clnt_create() function to create a RPC client the RPC service such as VXI-11.Each RPC message from the client the cchannel tthe device.Next create a link tthe device is acknowledged b the create_linkfunction. Thereturned data structure includes link ID number that is used for subsequent calls RPC calls to the Tes the size of thedevice. Italso includes athat s device's input buffer.Repeat steps 1 and 2 for each remaining logi-noted earlier, the VXI-11 protocol is based on Remote Procedurecal device until channels and links have been created to all of the (RPC). TheVXI-11 Specification includes a listing of theVXI-11 instruments that the RPCL function prototIf RPC Capabilithas been installed on computer, thenhave utilitcalled rpcgen that can be usedNext, the device_write function is used to send commands to the to install the RPC stub functions indevice. BecauseVXI-11 devices are IEEE-488.2 devices, all of the IEEE 488.2 protocol and format rules applto the commands sent rpcgen utilitconverts the RPCL function prototfound aVXI-11 device.This means thatprogram them the same in the VXI-11 Specification into the four files shown in Figure 6.would amodern GPIB instrument.The res files are tailored specificallfor operatings anddata is not a response to a querbut rather an acknowledgement s bthe rpcgen utilit. Ifchange computers orthe message was received bthe device.An transmissionor update the operating sonl needto run the rpcgen utilitcommand errors will be indicated in the res to get a set of updated files. CS Electronics7034 Commerce Circle, Pleasanton, CA 94588Phone: 925 416-1000Fax: 925 416-010
the device_read() function to read data or querresponses fromLAN device element is KeepAlive.KeepAlive is a TCP/IPthe device.The termChar parameter defines the character used bthat enables the device’s socket lato send the client a the device to terminate its response message.test message once ever120 minutes.If the client fails to , the device will close the socket, release all locks and reclaim device_write() and device_read () functions are used as requiredassociated instrument links.If donot use KeepAlive or in the program to control the devices.COMM_timeout mechanism, then the device can run out of and be inaccessible if it does not have a wato recover the end of the program, use the destrofunction to releaseunused resource.Do not enable Keep Alive if the network or the the link to each device linked to at the beginning of the program.client does not support Keep Alive messages. use the clnt_destrofunction to close the channel and release all AB T VXI-11 program examples show steps 2, 3, 4 and 5 together which implies that all four steps are all required to communicateAbort channel is used to send the device_abortRPC to the with a VXI-11 instrument. The result is that some programmerslogical device to terminate the current operation.The Abort chan-unnecessar create_link()and destrofunctions in theirrequires its own clnt_create() and create_link() function calls to each time thecommunicate with a VXI-11 instrument.When setting up the Abort channel, note that itthe channel up. Onl opena link to a logical device at the beginning of the programdoes not register itself with the port mapper service.The TCP port and keep it open until done with the instrument.This is good pro-used bthe RPC server needs to be explicitlstated when gramming practise and will makeprograms run faster.Note callingthe clnt_create() function.The Abort TCP port number was that some vendors' instruments will 'abort' the channel if the linkas part of the Core channel returned data structure.Onl goes to zero.This is another good reason to maintain the linkAbort channel. until the end of the program. Likewise do not repeatedlopen and close channels.Create theVICE REQUE to the device(s) at the beginning of the program and leave them open until the end of the program.Channel opening is a timeRequests in a VXI-11 device are setupas thewould be n a similar GPIB instrument.In the VXI-11 world, Service Requests passed back to the host through a reverse Interrupt channel.Here Note that if locks are being used to keep an instrument from beingdevice acts as a client and sends the device_intr_srq() RPC to accessed banother client, theshould be released as soon as theserver application running in the host.The ofthe server ap-instrument can be shared.If the phconnection to the instru-is to receive the request and inform the client application is accidentallbroken, the instrument will remain locked untila device needs service.T thisis done bsetting a flag it can determine the link is broken or until it is reset or power cd.the original client tries to relink to the device, it will be blocked because the lock is still active and belongs to the broken link.the functions in the _svc.c file to setup the server application.server application truns as a separate thread. Use a call to start the RPC server.Note that this call does not TIME VXI-11 devices include an internal COMM_timeout whichIt should be mentioned that a reverse Interrupt channel has problems is the period of time the device will go without a message frombecause there are no periodic messages sent over it.It is possible the client before terminating anlock and destrothe link.Set thereverse channel to die without annotification. If this occurs, OMM_timeout to 2-5 minutes when debugging a new program andapplication is left without a wato get a Service Request at a the program is likelto be abruptlterminated without closing thecrucial time.A better approach is to periodicalltest the device's and channel.This waa devices limited resources are released . Afterthe program has been debugged, the COMM_timeout can be set to a longer time. If the phlink is subto it is best to make the COMM_timeout period shorter soVX 1 the device's resources will be available sooner.Wire based s are fairldependable so the COMM_timeout period can be hoursVXI-11 is a protocol defining specification whose goal is to control It is a good idea to add a background function to applicationIEEE-488.2 compliant instruments over a TCP/IP network.LXI is that periodicallperforms some non-invasive VXI-11recent specification for Ethernet instruments that stresses timing, on each device that the program is linked to if the programand uniformitof the user experience.Unfortunatel the not sent that device a message in a certain amount of time.The Specificationdoes not specifa communication protocol but time should be less than each device's COMM_timeout period.This requiresthat LXI instruments use the undefined 'VXI Discover will prevent unintentional channel closures when the application is
CS Electronics7034 Commerce Circle, Pleasanton, CA 94588Phone: 925 416-1000Fax: 925 416-010 4
Method'. Itis also does not require that LXI instruments be IEEE-488.2 compliant but onlthat themust respond to an "*IDN?" quer.of LXI instruments need to be aware of these shortcomings in the LXI Specification and, when bua LXI instrument, should the proposed instrument's specifications to be sure that it is VXI-11.3 and IEEE-488.2 compliant.Else, the user mabe re-to controlling the instrument through the vendor supplied drivers and another supplied programming methods.Refer to Application Bulletin AB80-10 for more information about the ferences between the VXI-11 and LXI Specifications. Y application note has described the VXI-11 Specification, its set, the use of Remote Procedure Callsand how the client application links to devices.Guidelines are also included on when to use a VISA librarand when to use the rpcgen utilitto repare files tailored toour computer.Some information is included about RPC programing but the user shouldrefer to ICS's other AB80 Application Bulletins for a more detailed description about using RPC.Man additionalRPC programming references are also available on the Internet if
VXI-11 Protocol provides a rugged means of connecting a client application to a set of instruments over a TCP/IP network.Other methods mahave improved performance but the not offer the same ease of portabilitamong different operating or the error free performance of the VXI-11 protocol.The also require special drivers that limits their application to a specific operating s
following references are reprinted from the VXI-11 Specifica-
IEEE Std 488.1-1987, IEEE Standard Digital Interface for
IEEE Std 488.2-1992, IEEE Standard Codes, Formats, Protocols, Common Commands For Use With IEEE Std 488.1-1987, IEEE Standard Digital Interface for Programmable Instrumenta-
Internet Protocol, Request for Comments 791, Jon B. Postel, DDN Network Information Center, SRI International, Septem-ber, 1981, See also MIL-STD 1777. Transmission Control Protocol, Request for Comments 793, Jon B. Postel, DDN Network Information Center, SRI International, , 1981, See also MIL-STD 1777. A Standard for the Transmission of IP Datagrams over Ethernet Networks, Request for Comments 894, C. Hornig, DDN Network Information Center, SRI International, April 1984. XDR: External Data Representation Standard, Request for Comments 1014, Sun MicrosDDN Network Informa-, SRI International, June, 1987. A Standard for the Transmission of IP Datagrams over IEEE 802 Networks, Request for Comments 1042, J. Postel and J. e nolds,DDN Network Information Center, SRI International,
RPC: Remote Procedure Call Protocol Specification, Request fo Comments 1057, SunMicros DDNNetwork Informa-, SRI International, June, 1988. Requirements for Internet Hosts -- Communication La for Comments 1122, R. Braden, DDN Network Infor-mation Center, SRI International, October, 1989. 10] ISO 8802-2:1989[ANSI/IEEE 802.2-1989] Information echnolog -Local and Metropolitan Area Networks - Part 2:
1] ISO/IEC8802-3:1993 [ANSI/IEEE 802.3-1993] Information echnolog -Local and Metropolitan Area Networks - Part 3: Carrier Sense MultipleAccess with Collision Detection (CSMA/ CD) Access Method and Phcations. The Ethernet, Phand Data Link LaSpecifications, Version 2.0, Digital Equipment Corporation, Intel Corporation,
CS Electronics7034 Commerce Circle, Pleasanton, CA 94588Phone: 925 416-1000Fax: 925 416-010
  • Univers Univers
  • Ebooks Ebooks
  • Livres audio Livres audio
  • Presse Presse
  • Podcasts Podcasts
  • BD BD
  • Documents Documents