Agilent Technologies FS2010 Uživatelská příručka

Procházejte online nebo si stáhněte Uživatelská příručka pro Software Agilent Technologies FS2010. Agilent Technologies FS2010 User`s guide Uživatelská příručka

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 160
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků

Shrnutí obsahu

Strany 1 - Agilent VISA User’s Guide

Agilent TechnologiesAgilent IO Libraries SuiteE2094PAgilent VISA User’s Guide

Strany 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

Strany 3

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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 13 - Agilent Technologies

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

Strany 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

Strany 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

Strany 16

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

Strany 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

Strany 18

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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 23

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

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

Strany 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

Strany 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

Strany 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

Strany 28 - 28 Agilent VISA User’s Guide

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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 35

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

Strany 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

Strany 37

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

Strany 38

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

Strany 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

Strany 40 - Searching for Resources

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

Strany 41

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

Strany 42

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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 47

140 Agilent VISA User’s Guide5 Programming via LAN

Strany 48

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

Strany 49

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

Strany 50

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

Strany 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

Strany 52

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

Strany 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

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

Strany 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

Strany 56

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

Strany 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

Strany 58

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

Strany 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

Strany 60

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

Strany 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

Strany 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

Strany 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

Strany 64

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

Strany 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

Strany 66

158 Agilent VISA User’s Guide

Strany 67

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

Strany 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

Strany 69 - Sample: Trigger Callback

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

Strany 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

Strany 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

Strany 72

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

Strany 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

Strany 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

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

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

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

Strany 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

Strany 79

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

Strany 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

Strany 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

Strany 82 - Exception Events

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

Strany 83

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

Strany 84

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

Strany 85

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

Strany 86

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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 91

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

Strany 92

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

Strany 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

Strany 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

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

Strany 96 - 82350 GPIB Card #2

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

Strany 97

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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 107

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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 113

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

Strany 114

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

Strany 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

Strany 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

Strany 117 - Sample: Using VXI Memory I/O

6 Agilent VISA User’s Guide

Strany 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

Strany 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

Strany 120

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

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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 127

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

Strany 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

Strany 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

Strany 130

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

Strany 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

Strany 132 - 5 Programming via LAN

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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 137

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

Strany 138

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

Strany 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

Strany 140

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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 145

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

Strany 146

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

Strany 147

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

Strany 148

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

Strany 149

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

Strany 150

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

Strany 151

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

Strany 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

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

Strany 154

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

Strany 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

Strany 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

Strany 157

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

Strany 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

Strany 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

Strany 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

Komentáře k této Příručce

Žádné komentáře