Agilent Technologies FS2010 User's Guide

Browse online or download User's Guide for Software Agilent Technologies FS2010. Agilent Technologies FS2010 User`s guide User Manual

  • Download
  • Add to my manuals
  • Print
  • Page
    / 160
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews

Summary of Contents

Page 1 - Agilent VISA User’s Guide

Agilent TechnologiesAgilent IO Libraries SuiteE2094PAgilent VISA User’s Guide

Page 2

10 Agilent VISA User’s Guide1 IntroductionVISA SupportThis 32- bit version of VISA is supported on Microsoft Windows 2000 and Windows XP. (For informa

Page 3

100 Agilent VISA User’s Guide4 Programming via GPIB and VXIExample: GPIB-VXI (E1406A) InterfaceThe GPIB- VXI interface system in the following figure

Page 4 - 4 Agilent VISA User’s Guide

Programming via GPIB and VXI 4Agilent VISA User’s Guide 101The Connection Expert utility has been used to assign the GPIB-VXI driver a VISA name of GP

Page 5 - Agilent VISA User’s Guide 5

102 Agilent VISA User’s Guide4 Programming via GPIB and VXIUsing High-Level Memory FunctionsHigh- level memory functions allow you to access memory on

Page 6 - 6 Agilent VISA User’s Guide

Programming via GPIB and VXI 4Agilent VISA User’s Guide 103Using viIn and viOutWhen using the viIn and viOut high- level memory functions to program t

Page 7 - Introduction

104 Agilent VISA User’s Guide4 Programming via GPIB and VXIThe val32 parameter is a pointer to where the data read will be stored. If instead you writ

Page 8 - What’s in This Guide?

Programming via GPIB and VXI 4Agilent VISA User’s Guide 105High-Level Memory Functions: Sample ProgramsTwo sample programs follow that use the high- l

Page 9 - VISA Overview

106 Agilent VISA User’s Guide4 Programming via GPIB and VXISample: Using GPIB-VXI Interface (High-Level) Memory FunctionsThis program uses high- level

Page 10 - VISA Documentation

Programming via GPIB and VXI 4Agilent VISA User’s Guide 107 /* Read instrument id register contents */ viIn16(dmm, VI_A16_SPACE, 0x00, &id_r

Page 11 - Agilent VISA User’s Guide 11

108 Agilent VISA User’s Guide4 Programming via GPIB and VXIUsing Low-Level Memory Functions Low- level memory functions allow direct access to memory

Page 12 - Contacting Agilent

Programming via GPIB and VXI 4Agilent VISA User’s Guide 109Mapping Memory SpaceWhen using VISA to access the device's registers, you must map mem

Page 13 - Agilent Technologies

Introduction 1Agilent VISA User’s Guide 11VXIbus Consortium specifications (when using VISA over LAN)TCP/IP Instrument Protocol Specification - VXI-11

Page 14 - Linking to VISA Libraries

110 Agilent VISA User’s Guide4 Programming via GPIB and VXIA pointer to the address space where the memory was mapped is returned in the address param

Page 15 - Sample VISA Program (C/C++)

Programming via GPIB and VXI 4Agilent VISA User’s Guide 111VI_FALSE, VI_NULL, &address); viPeek16(vi, addr, &value)Unmapping Memory SpaceM

Page 16

112 Agilent VISA User’s Guide4 Programming via GPIB and VXI /* Open session to VXI device at address 24 */ viOpenDefaultRM(&defaultRM);

Page 17 - C/C++ Sample Program Contents

Programming via GPIB and VXI 4Agilent VISA User’s Guide 113registers of the device at GPIB-VXI0::24. Change this address if necessary. Register conten

Page 18

114 Agilent VISA User’s Guide4 Programming via GPIB and VXI /* Close sessions */ viClose(dmm); viClose(defaultRM); }

Page 19

Programming via GPIB and VXI 4Agilent VISA User’s Guide 115Using Low/High-Level Memory I/O MethodsVISA supports three different memory I/O methods for

Page 20 - Numeric Arrays

116 Agilent VISA User’s Guide4 Programming via GPIB and VXI• viPeek/viPoke calls do not return status codes. • Only one active viMapAddress is allowed

Page 21 - Steps to Running the Program

Programming via GPIB and VXI 4Agilent VISA User’s Guide 117• They provide the best performance when transferring large blocks of data. • They support

Page 22 - Sample Program Source Code

118 Agilent VISA User’s Guide4 Programming via GPIB and VXI*/ /* Map into memory space */ viMapAddress (vi, VI_A16_SPACE, 0x00, 0x10, VI_FALSE,V

Page 23

Programming via GPIB and VXI 4Agilent VISA User’s Guide 119 /* Print results */ printf ("dereference: ID Register = 0x%4X\n&quo

Page 24 - Sample Program Contents

12 Agilent VISA User’s Guide1 IntroductionContacting Agilent• In the USA, you can reach Agilent Technologies by telephone at:USA: 1- 800- 829- 4444 •

Page 25 - Agilent VISA User’s Guide 25

120 Agilent VISA User’s Guide4 Programming via GPIB and VXIIf the value of VI_ATTR_DEST_INCREMENT is 1 (the default),viMoveOut does a block write. If

Page 26 - Logging Error Messages

Programming via GPIB and VXI 4Agilent VISA User’s Guide 121Using the Memory Access ResourceFor VISA 1.1 and later, the Memory Access (MEMACC) resource

Page 27

122 Agilent VISA User’s Guide4 Programming via GPIB and VXIAlthough the resource handles the allocation and operation of the window, the programmer mu

Page 28 - 28 Agilent VISA User’s Guide

Programming via GPIB and VXI 4Agilent VISA User’s Guide 123 ViUInt16*addr16; ViStatusstatus; ViUInt16offset; status = viOpenDefaultRM ( &

Page 29 - Programming with VISA

124 Agilent VISA User’s Guide4 Programming via GPIB and VXI /* Print the results. */ printf( "inData16 : 0x%04hx\n", inData16 ); pri

Page 30 - VISA Resources and Attributes

Programming via GPIB and VXI 4Agilent VISA User’s Guide 125VXI and GPIB-VXI Specific MEMACC AttributesThe following attributes, most of which are read

Page 31 - VISA Attributes

126 Agilent VISA User’s Guide4 Programming via GPIB and VXIGPIB-VXI Specific MEMACC AttributesThe following read- only attributes provide specific add

Page 32 - 3 Programming with VISA

Programming via GPIB and VXI 4Agilent VISA User’s Guide 127MEMACC Resource Event AttributeThe following read- only events provide notification that an

Page 33 - Using Sessions

128 Agilent VISA User’s Guide4 Programming via GPIB and VXIUsing VXI-Specific Attributes VXI- specific attributes can be useful to determine the state

Page 34 - Opening a Session

Programming via GPIB and VXI 4Agilent VISA User’s Guide 129Sample: Determining Window MappingViAddr address; Vi UInt16 access; ViUInt16 value; . . .vi

Page 35

13Agilent IO Libraries SuiteAgilent VISA User’s GuideAgilent Technologies2Building a VISA Application in WindowsThis chapter provides guidelines for b

Page 36 - Addressing a Session

130 Agilent VISA User’s Guide4 Programming via GPIB and VXIThe above function sets the VXI trigger line to TTL trigger line 0 (VI_TRIG_TTL0). The foll

Page 37

131Agilent IO Libraries SuiteAgilent VISA User’s GuideAgilent Technologies5Programming via LANThis chapter provides guidelines for programming via a L

Page 38

132 Agilent VISA User’s Guide5 Programming via LANLAN and Remote Interfaces OverviewThis section provides an overview of LAN (Local Area Network) inte

Page 39 - Sample: Opening a Session

Programming via LAN 5Agilent VISA User’s Guide 133Client/Server ModelThe IO Libraries Suite software uses the client/server model of computing. Client

Page 40 - Searching for Resources

134 Agilent VISA User’s Guide5 Programming via LAN Windows PCsClientLANRemoteI/OServerSeries 700workstation orWindows PCGPIBbusGPIBInstrumentGPIBInst

Page 41

Programming via LAN 5Agilent VISA User’s Guide 135Addressing LAN-Connected DevicesVISA can communicate with LAN- connected devices in one of two ways:

Page 42

136 Agilent VISA User’s Guide5 Programming via LANstring of alphanumeric characters, starting with a letter. Some examples of TCPIP resource strings f

Page 43 - Sending I/O Commands

Programming via LAN 5Agilent VISA User’s Guide 137Addressing a Session Using the TCPIP Interface TypeThis sample shows one way to open a device sessio

Page 44

138 Agilent VISA User’s Guide5 Programming via LANas if it were connected to a local interface. If, for example, the GPIB2 interface is configured as

Page 45 - Formatted I/O Conversion

Programming via LAN 5Agilent VISA User’s Guide 139Note that if you have defined a VISA alias for a USB device on the remote I/O server, you must eithe

Page 46

14 Agilent VISA User’s Guide2 Building a VISA Application in WindowsBuilding a VISA Program (C/C++)This section provides guidelines for building VISA

Page 47

140 Agilent VISA User’s Guide5 Programming via LAN

Page 48

141Agilent IO Libraries SuiteAgilent VISA User’s GuideAgilent Technologies6Programming via USBThis chapter provides guidelines for VISA programming of

Page 49

142 Agilent VISA User’s Guide6 Programming via USBUSB Interfaces OverviewUSBTMC/USBTMC- USB488 instruments are detected and automatically configured b

Page 50

Programming via USB 6Agilent VISA User’s Guide 143Communicating with a USB Instrument Using VISATo establish communications with a USB device using VI

Page 51

144 Agilent VISA User’s Guide6 Programming via USBAlthough the case of a VISA alias is preserved, case is ignored when the alias is used in place of t

Page 52

145Agilent IO Libraries SuiteAgilent VISA User’s GuideAgilent Technologiesaccess boardThe GPIB interface to which a particular device is connected.Act

Page 53

146 Agilent VISA User’s GuideattributeIn VISA and SICL, a value that indicates the operational state of a resource. Some attributes can be changed; ot

Page 54 - Using Non-Formatted I/O

Agilent VISA User’s Guide 147command bytesGPIB commands encoded as individual bytes. Also called GPIB commands or interface messages.commanderIn test-

Page 55

148 Agilent VISA User’s GuideController in ChargeThe device currently in control of the GPIB.deviceA unit that receives commands from a Controller. A

Page 56

Agilent VISA User’s Guide 149direct I/OProgrammatic communication with instruments not involving an instrument driver. Direct I/O may be accomplished

Page 57 - Using Events and Handlers

Building a VISA Application in Windows 2Agilent VISA User’s Guide 15• Select Tools > Options from the menu.• Click the Directories tab to set the

Page 58

150 Agilent VISA User’s GuideinterfaceA connection and medium of communication between devices and controllers. Interfaces include mechanical, electri

Page 59 - Agilent VISA User’s Guide 59

Agilent VISA User’s Guide 151IO LibrariesApplication programming interfaces (APIs) for direct I/O communication between applications and devices. Ther

Page 60

152 Agilent VISA User’s GuideoperationA defined action that can be performed on a resource.primary VISAThe VISA installation that controls the visa32.

Page 61 - Agilent VISA User’s Guide 61

Agilent VISA User’s Guide 153resource (or resource instance)In VISA, an implementation of a resource class (in object- oriented terms, an instance of

Page 62

154 Agilent VISA User’s GuideSICLStandard Instrument Control Library. SICL is an Agilent- defined API for instrument I/O. Agilent SICL is one of the I

Page 63 - Agilent VISA User’s Guide 63

Agilent VISA User’s Guide 155System ControllerOne Controller on a GPIB is the System Controller. This is a master Controller; it has the ability to de

Page 64

156 Agilent VISA User’s GuideViFind32A console application that uses the viFindRsrc and viFindNext VISA functions to enumerate all resources visible t

Page 65 - Using the Callback Method

Agilent VISA User’s Guide 157VISA COMThe VXIplug&play specification for a COM- compliant VISA I/O library and its implementation. Agilent VISA CO

Page 66

158 Agilent VISA User’s Guide

Page 67

Agilent VISA User’s Guide 159IndexAaddressingaddressing device sessions, 36devices, 36Agilent 488, 145Agilent web site, 12attributessetting VXI tr

Page 68

16 Agilent VISA User’s Guide2 Building a VISA Application in WindowsSample C/C++ Program Source CodeThe source file idn.c follows. An explanation of t

Page 69 - Sample: Trigger Callback

160 Agilent VISA User’s GuideIndexLLANhardware architecture, 132interfaces overview, 132locking, 35, 87locksusing, 87low-level memory functions,

Page 70

Building a VISA Application in Windows 2Agilent VISA User’s Guide 17%s\n", buf);/* Close session */ viClose(vi); viClose(defaultRM);}C/C++ Sample

Page 71 - Sample: SRQ Callback

18 Agilent VISA User’s Guide2 Building a VISA Application in WindowsviPrintf and viScanfThese are the VISA formatted I/O functions that are patterned

Page 72

Building a VISA Application in Windows 2Agilent VISA User’s Guide 19Building a VISA Program (Visual Basic)This section provides guidelines for buildin

Page 73

2 Agilent VISA User’s GuideNotices© Agilent Technologies, Inc. 1995-1996, 1998, 2000-2005No part of this manual may be reproduced in any form or by an

Page 74 - Using the Queuing Method

20 Agilent VISA User’s Guide2 Building a VISA Application in WindowsVISA cannot call back to a VB function. Thus, you can only use the VI_QUEUE mechan

Page 75 - Enabling Events

Building a VISA Application in Windows 2Agilent VISA User’s Guide 21Dim flt_array(50) As Double status = viVPrintf(id, "%,50f", dbl_array(0)

Page 76

22 Agilent VISA User’s Guide2 Building a VISA Application in Windows3 Start a new Visual Basic Standard .exe project. VB 6.0 will open a new project,

Page 77 - Sample: Trigger Event Queuing

Building a VISA Application in Windows 2Agilent VISA User’s Guide 23If the program does not run, see the Event Viewer for a list of run- time errors.

Page 78

24 Agilent VISA User’s Guide2 Building a VISA Application in Windows Sample Program ContentsA summary of the VISA function calls used in the preceding

Page 79

Building a VISA Application in Windows 2Agilent VISA User’s Guide 25viOpen This function establishes a communication channel with the device specified

Page 80 - Trapping Errors

26 Agilent VISA User’s Guide2 Building a VISA Application in WindowsLogging Error MessagesWhen developing or debugging your VISA application, you may

Page 81 - Sample: Printing Error Code

Building a VISA Application in Windows 2Agilent VISA User’s Guide 27such as Microsoft Visual Studio. In this case, VISA messages will appear in the Vi

Page 82 - Exception Events

28 Agilent VISA User’s Guide2 Building a VISA Application in Windows

Page 83

29Agilent IO Libraries SuiteAgilent VISA User’s GuideAgilent Technologies3Programming with VISAThis chapter describes how to program with VISA. The ba

Page 84

Agilent VISA User’s Guide 3Agilent VISA User’s Guide1 IntroductionWhat’s in This Guide? 8VISA Overview 9Using VISA, VISA COM, and SICL

Page 85

30 Agilent VISA User’s Guide3 Programming with VISAVISA Resources and AttributesThis section introduces VISA resources and attributes, including:• VIS

Page 86

Programming with VISA 3Agilent VISA User’s Guide 31VISA AttributesAttributes are associated with resources or sessions. You can use attributes to dete

Page 87 - Using Locks

32 Agilent VISA User’s Guide3 Programming with VISASample: Reading a VISA AttributeThis code sample reads the state of the VI_ATTR_TERMCHAR_EN attribu

Page 88 - VISA Lock Types

Programming with VISA 3Agilent VISA User’s Guide 33Using SessionsThis section shows how to use VISA sessions, including:• Including the VISA Declarati

Page 89 - Sample: Exclusive Lock

34 Agilent VISA User’s Guide3 Programming with VISAOpening a SessionA session is a channel of communication. Sessions must first be opened on the defa

Page 90

Programming with VISA 3Agilent VISA User’s Guide 35The session returned from viOpenDefaultRM must be used in the sesn parameter of the viOpen function

Page 91

36 Agilent VISA User’s Guide3 Programming with VISASample: Opening a Resource SessionThis code sample shows one way of opening resource sessions with

Page 92

Programming with VISA 3Agilent VISA User’s Guide 37The following table illustrates the format of the rsrcName for different VISA interface types. INST

Page 93 - Programming via GPIB and VXI

38 Agilent VISA User’s Guide3 Programming with VISAThe following table describes the parameters used above.Some examples of valid VISA addresses follo

Page 94 - General Interface Information

Programming with VISA 3Agilent VISA User’s Guide 39Sample: Opening a SessionThis sample shows one way to open a VISA session with the GPIB device at p

Page 95 - GPIB Interfaces Overview

4 Agilent VISA User’s GuideClosing a Session 40Searching for Resources 40Sending I/O Commands 43Types of I/O 43Using Formatted I/

Page 96 - 82350 GPIB Card #2

40 Agilent VISA User’s Guide3 Programming with VISAviOpenDefaultRM(&defaultRM); viOpen(defaultRM, "GPIB0::23::INSTR", VI_NULL, VI_NUL

Page 97

Programming with VISA 3Agilent VISA User’s Guide 41. viFindNext(findList, instrDesc); . . viClose (findList);The parameters are defined as follows.The

Page 98 - VXI Interfaces Overview

42 Agilent VISA User’s Guide3 Programming with VISASample: Searching the VXI Interface for ResourcesThis code sample searches the VXI interface for re

Page 99 - GPIB-VXI Interfaces Overview

Programming with VISA 3Agilent VISA User’s Guide 43Sending I/O CommandsThis section provides guidelines for sending I/O commands, including:• Types of

Page 100 - GPIB-VXI (E1406A) Interfaces

44 Agilent VISA User’s Guide3 Programming with VISAThese are raw I/O functions and do not intermix with the formatted I/O functions. See “Using Non- F

Page 101

Programming with VISA 3Agilent VISA User’s Guide 45Formatted I/O Conversion The formatted I/O functions convert data under the control of the format s

Page 102 - Programming the Registers

46 Agilent VISA User’s Guide3 Programming with VISASample: Using Field Width ModifierThe following sample pads numb to six characters and sends it to

Page 103 - Using viIn and viOut

Programming with VISA 3Agilent VISA User’s Guide 47Argument Length Modifier The meaning of the optional argument length modifier h, l, L, z, or Z is

Page 104 - Using viMoveIn and viMoveOut

48 Agilent VISA User’s Guide3 Programming with VISAFor viPrintf or viQueryf (writeFmt), you can use an asterisk (*) in place of the integer to indica

Page 105

Programming with VISA 3Agilent VISA User’s Guide 49grouping operator, and the or operator | in a regular expression has the lowest precedence. The fol

Page 106 - Functions

Agilent VISA User’s Guide 5Using Low/High-Level Memory I/O Methods 115Using Low-Level viPeek/viPoke 115Using High-Level viIn/viOut 116U

Page 107

50 Agilent VISA User’s Guide3 Programming with VISA\" Sends the ASCII double quote character.\\ Sends a backslash character.Table 14 Examples of

Page 108

Programming with VISA 3Agilent VISA User’s Guide 51Format Codes. This table summarizes the format codes for sending and receiving formatted I/O.Sample

Page 109 - Mapping Memory Space

52 Agilent VISA User’s Guide3 Programming with VISAchar data[180]; viScanf(vi, "%t", data);Formatted I/O BuffersThe VISA software maintains

Page 110 - Sample: Using viPeek16

Programming with VISA 3Agilent VISA User’s Guide 53You can manually flush the read and write buffers using the viFlush function. Flushing the read buf

Page 111 - Unmapping Memory Space

54 Agilent VISA User’s Guide3 Programming with VISA /* Initialize device */ viPrintf(vi, "*RST\n"); /* Set up device and send a comma-se

Page 112

Programming with VISA 3Agilent VISA User’s Guide 55viWrite. The viWrite function synchronously sends the data pointed to by buf to the device specifie

Page 113

56 Agilent VISA User’s Guide3 Programming with VISA#include <visa.h> #include <stdio.h>void main () { ViSession defaultRM, vi; char str

Page 114

Programming with VISA 3Agilent VISA User’s Guide 57Using Events and Handlers This section provides guidelines to using events and handlers, including:

Page 115 - Using Low-Level viPeek/viPoke

58 Agilent VISA User’s Guide3 Programming with VISA• Enable one or several events with viEnableEvent and call the viWaitOnEvent function. The viWaitOn

Page 116 - Using High-Level viIn/viOut

Programming with VISA 3Agilent VISA User’s Guide 59.Table 16 Instrument Control (INSTR) Resource EventsVI_EVENT_SERVICE_REQUESTNotification that a ser

Page 117 - Sample: Using VXI Memory I/O

6 Agilent VISA User’s Guide

Page 118

60 Agilent VISA User’s Guide3 Programming with VISAVI_ATTR_STATUS Return code of the asynchronous I/O operation that has completed.RO ViStatus N/AVI_A

Page 119

Programming with VISA 3Agilent VISA User’s Guide 61VI_ATTR_STATUS Specifies the status of the read operation from the USB interrupt-IN pipe. If the de

Page 120

62 Agilent VISA User’s Guide3 Programming with VISATable 18 GPIB Bus Interface (INTFC) Resource EventsVI_EVENT_GPIB_CICNotification that the GPIB cont

Page 121 - Memory I/O Services

Programming with VISA 3Agilent VISA User’s Guide 63VI_ATTR_EVENT_TYPE Unique logical identifier of the event.RO ViEventType VI_EVENT_TRIGVI_ATTR_RECV_

Page 122

64 Agilent VISA User’s Guide3 Programming with VISAVI_ATTR_RECV_TRIG_ID The identifier of the triggering mechanism on which the specified trigger even

Page 123

Programming with VISA 3Agilent VISA User’s Guide 65Sample: Reading Event AttributesOnce you have decided which attribute to check, you can read the at

Page 124 - MEMACC Attribute Descriptions

66 Agilent VISA User’s Guide3 Programming with VISAViStatus _VI_FUNCH my_handler (ViSession vi, ViEventType eventType, ViEvent context, ViAddr usr

Page 125 - Agilent VISA User’s Guide 125

Programming with VISA 3Agilent VISA User’s Guide 67viInstallHandler(vi, eventType, handler, userHandle);These parameters are defined as follows.The

Page 126

68 Agilent VISA User’s Guide3 Programming with VISAUse the viUninstallHandler function to uninstall a specific handler, or you can use wildcards (VI_A

Page 127

Programming with VISA 3Agilent VISA User’s Guide 69Sample: Enabling a Hardware Trigger EventThis sample illustrates enabling a hardware trigger event.

Page 128 - VI_ATTR_WIN_ACCESS Settings

7Agilent IO Libraries SuiteAgilent VISA User’s GuideAgilent Technologies1IntroductionThis Agilent VISA User’s Guide describes the Agilent Virtual Ins

Page 129 - Setting the VXI Trigger Line

70 Agilent VISA User’s Guide3 Programming with VISAThis sample program is installed on your system in the ProgrammingSamples subdirectory. See the IO

Page 130

Programming with VISA 3Agilent VISA User’s Guide 71return VI_SUCCESS; }void main(){ ViSession defaultRM,vi;/* open session to VXI device */ viOpenDef

Page 131 - Programming via LAN

72 Agilent VISA User’s Guide3 Programming with VISAThis program is installed on your system in the ProgrammingSamples subdirectory. See the IO Librari

Page 132 - 5 Programming via LAN

Programming with VISA 3Agilent VISA User’s Guide 73 /* print the event information */ printf("\nSRQ Event Occurred!\n"); printf(".

Page 133 - Gateway Operation

74 Agilent VISA User’s Guide3 Programming with VISA /* Wait a while for the SRQ to be generated and for the handler to be called. Print something

Page 134

Programming with VISA 3Agilent VISA User’s Guide 75If the specified event has occurred, the event information is retrieved and the program returns imm

Page 135

76 Agilent VISA User’s Guide3 Programming with VISAWhen you use VI_QUEUE in the mechanism parameter, you are specifying that the events will be put in

Page 136

Programming with VISA 3Agilent VISA User’s Guide 77The event must have previously been enabled with VI_QUEUE specified as the mechanism parameter. Sam

Page 137

78 Agilent VISA User’s Guide3 Programming with VISA/* evntqueu.c This sample program illustrates enabling an event queue using viWaitOnEvent. Note tha

Page 138

Programming with VISA 3Agilent VISA User’s Guide 79 /* print the event information */ printf("Trigger Event Occurred!\n"); printf("

Page 139

8 Agilent VISA User’s Guide1 IntroductionWhat’s in This Guide?This guide shows VISA programming techniques using C/C++ and Visual Basic. This chapter

Page 140

80 Agilent VISA User’s Guide3 Programming with VISATrapping ErrorsThis section provides guidelines for trapping errors, including:• Trapping Errors• E

Page 141 - Programming via USB

Programming with VISA 3Agilent VISA User’s Guide 81Sample: Printing Error CodeThe following error handler prints a user- readable string describing th

Page 142 - USB Interfaces Overview

82 Agilent VISA User’s Guide3 Programming with VISAException EventsAn alternative to trapping VISA errors by checking the return status after each VIS

Page 143 - Value Description Data Type

Programming with VISA 3Agilent VISA User’s Guide 83For example, the C++ try/catch block can be used in an application in conjunction with the C++ thro

Page 144 - 6 Programming via USB

84 Agilent VISA User’s Guide3 Programming with VISAUsing the VI_EVENT_EXCEPTION EventYou can use the VI_EVENT_EXCEPTION event as notification that an

Page 145

Programming with VISA 3Agilent VISA User’s Guide 85/* Get the function name from the exception context */ viGetAttribute( context, VI_ATTR_OPER_

Page 146

86 Agilent VISA User’s Guide3 Programming with VISA printf( "ERROR: viEnableEvent failed with error 0x%lx\n", status ); }/* Generate

Page 147

Programming with VISA 3Agilent VISA User’s Guide 87Using Locks In VISA, applications can open multiple sessions to a VISA resource simultaneously. App

Page 148

88 Agilent VISA User’s Guide3 Programming with VISAviLock(vi, lockType, timeout, requestedKey, accessKey);The VI_ATTR_RSRC_LOCK_STATE attribute spec

Page 149

Programming with VISA 3Agilent VISA User’s Guide 89a lock on that resource. Thus, locking a resource prevents other, subsequent sessions from acquirin

Page 150

Introduction 1Agilent VISA User’s Guide 9VISA OverviewVISA is an application programming interface (API) for instrument control. It allows you to prog

Page 151

90 Agilent VISA User’s Guide3 Programming with VISA /* Open session to GPIB device at address 22 */ viOpenDefaultRM (&defaultRM); viOpen (def

Page 152

Programming with VISA 3Agilent VISA User’s Guide 91When the session holding the exclusive lock unlocks the resource via the viUnlock function, all the

Page 153

92 Agilent VISA User’s Guide3 Programming with VISA /* Make sure no other process or thread does anything to this resource between the viPrintf()

Page 154

93Agilent IO Libraries SuiteAgilent VISA User’s GuideAgilent Technologies4Programming via GPIB and VXIVISA supports three interfaces you can use to ac

Page 155

94 Agilent VISA User’s Guide4 Programming via GPIB and VXIGPIB and VXI Interfaces OverviewThis section provides an overview of the GPIB, GPIB- VXI, an

Page 156 - VISA alias

Programming via GPIB and VXI 4Agilent VISA User’s Guide 95using VISA, you can place the SCPI command within your VISA output function call. Then, the

Page 157

96 Agilent VISA User’s Guide4 Programming via GPIB and VXIExample: GPIB (82350) InterfaceThe GPIB interface system in the following figure consists of

Page 158 - 158 Agilent VISA User’s Guide

Programming via GPIB and VXI 4Agilent VISA User’s Guide 97582350 GPIB Card #1Windows PC33GPIB InstrumentsGPIB CableInterface VISA Names82350 GPIB Card

Page 159 - Agilent VISA User’s Guide 159

98 Agilent VISA User’s Guide4 Programming via GPIB and VXIVXI Interfaces OverviewAs shown in the following figure, a typical VXI (E8491) interface con

Page 160 - 160 Agilent VISA User’s Guide

Programming via GPIB and VXI 4Agilent VISA User’s Guide 99GPIB-VXI Interfaces OverviewAs shown in the following figure, a typical GPIB- VXI interface

Comments to this Manuals

No comments