Agilent Technologies FS2010 Guía de usuario

Busca en linea o descarga Guía de usuario para Software Agilent Technologies FS2010. Agilent Technologies FS2010 User`s guide Manual de usuario

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 160
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente

Indice de contenidos

Pagina 1 - Agilent VISA User’s Guide

Agilent TechnologiesAgilent IO Libraries SuiteE2094PAgilent VISA User’s Guide

Pagina 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

Pagina 3

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

Pagina 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

Pagina 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

Pagina 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

Pagina 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

Pagina 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

Pagina 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

Pagina 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

Pagina 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

Pagina 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

Pagina 13 - Agilent Technologies

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

Pagina 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

Pagina 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

Pagina 16

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

Pagina 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

Pagina 18

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

Pagina 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

Pagina 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

Pagina 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

Pagina 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

Pagina 23

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

Pagina 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 •

Pagina 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

Pagina 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

Pagina 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

Pagina 28 - 28 Agilent VISA User’s Guide

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

Pagina 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

Pagina 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

Pagina 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

Pagina 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

Pagina 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

Pagina 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

Pagina 35

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

Pagina 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

Pagina 37

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

Pagina 38

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

Pagina 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

Pagina 40 - Searching for Resources

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

Pagina 41

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

Pagina 42

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

Pagina 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

Pagina 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

Pagina 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

Pagina 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

Pagina 47

140 Agilent VISA User’s Guide5 Programming via LAN

Pagina 48

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

Pagina 49

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

Pagina 50

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

Pagina 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

Pagina 52

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

Pagina 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

Pagina 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-

Pagina 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

Pagina 56

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

Pagina 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

Pagina 58

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

Pagina 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

Pagina 60

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

Pagina 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

Pagina 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

Pagina 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

Pagina 64

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

Pagina 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

Pagina 66

158 Agilent VISA User’s Guide

Pagina 67

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

Pagina 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

Pagina 69 - Sample: Trigger Callback

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

Pagina 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

Pagina 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

Pagina 72

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

Pagina 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

Pagina 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

Pagina 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)

Pagina 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,

Pagina 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.

Pagina 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

Pagina 79

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

Pagina 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

Pagina 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

Pagina 82 - Exception Events

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

Pagina 83

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

Pagina 84

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

Pagina 85

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

Pagina 86

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

Pagina 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

Pagina 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

Pagina 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

Pagina 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

Pagina 91

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

Pagina 92

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

Pagina 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

Pagina 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

Pagina 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/

Pagina 96 - 82350 GPIB Card #2

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

Pagina 97

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

Pagina 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

Pagina 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

Pagina 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

Pagina 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

Pagina 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

Pagina 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

Pagina 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

Pagina 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

Pagina 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

Pagina 107

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

Pagina 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

Pagina 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

Pagina 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

Pagina 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

Pagina 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

Pagina 113

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

Pagina 114

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

Pagina 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

Pagina 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

Pagina 117 - Sample: Using VXI Memory I/O

6 Agilent VISA User’s Guide

Pagina 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

Pagina 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

Pagina 120

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

Pagina 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_

Pagina 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

Pagina 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

Pagina 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

Pagina 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

Pagina 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

Pagina 127

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

Pagina 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

Pagina 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

Pagina 130

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

Pagina 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

Pagina 132 - 5 Programming via LAN

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

Pagina 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

Pagina 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

Pagina 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

Pagina 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

Pagina 137

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

Pagina 138

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

Pagina 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

Pagina 140

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

Pagina 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

Pagina 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

Pagina 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

Pagina 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

Pagina 145

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

Pagina 146

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

Pagina 147

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

Pagina 148

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

Pagina 149

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

Pagina 150

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

Pagina 151

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

Pagina 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

Pagina 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()

Pagina 154

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

Pagina 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

Pagina 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

Pagina 157

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

Pagina 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

Pagina 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

Pagina 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

Comentarios a estos manuales

Sin comentarios