Agilent Technologies FS2010 Podręcznik Użytkownika Strona 1

Przeglądaj online lub pobierz Podręcznik Użytkownika dla Oprogramowanie Agilent Technologies FS2010. Agilent Technologies FS2010 User`s guide Instrukcja obsługi

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 160
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów

Podsumowanie treści

Strona 1 - Agilent VISA User’s Guide

Agilent TechnologiesAgilent IO Libraries SuiteE2094PAgilent VISA User’s Guide

Strona 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

Strona 3

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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 13 - Agilent Technologies

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

Strona 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

Strona 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

Strona 16

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

Strona 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

Strona 18

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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 23

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

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

Strona 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

Strona 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

Strona 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

Strona 28 - 28 Agilent VISA User’s Guide

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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 35

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

Strona 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

Strona 37

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

Strona 38

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

Strona 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

Strona 40 - Searching for Resources

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

Strona 41

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

Strona 42

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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 47

140 Agilent VISA User’s Guide5 Programming via LAN

Strona 48

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

Strona 49

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

Strona 50

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

Strona 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

Strona 52

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

Strona 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

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

Strona 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

Strona 56

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

Strona 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

Strona 58

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

Strona 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

Strona 60

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

Strona 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

Strona 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

Strona 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

Strona 64

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

Strona 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

Strona 66

158 Agilent VISA User’s Guide

Strona 67

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

Strona 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

Strona 69 - Sample: Trigger Callback

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

Strona 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

Strona 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

Strona 72

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

Strona 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

Strona 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

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

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

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

Strona 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

Strona 79

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

Strona 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

Strona 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

Strona 82 - Exception Events

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

Strona 83

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

Strona 84

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

Strona 85

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

Strona 86

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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 91

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

Strona 92

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

Strona 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

Strona 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

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

Strona 96 - 82350 GPIB Card #2

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

Strona 97

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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 107

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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 113

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

Strona 114

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

Strona 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

Strona 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

Strona 117 - Sample: Using VXI Memory I/O

6 Agilent VISA User’s Guide

Strona 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

Strona 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

Strona 120

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

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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 127

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

Strona 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

Strona 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

Strona 130

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

Strona 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

Strona 132 - 5 Programming via LAN

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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 137

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

Strona 138

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

Strona 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

Strona 140

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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 145

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

Strona 146

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

Strona 147

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

Strona 148

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

Strona 149

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

Strona 150

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

Strona 151

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

Strona 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

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

Strona 154

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

Strona 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

Strona 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

Strona 157

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

Strona 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

Strona 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

Strona 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

Komentarze do niniejszej Instrukcji

Brak uwag