Getting Started GuideYour Guide to Getting Started with IVI DriversRevision 1.0
10 Chapter 1 • • • •••Starting in the 1970s, programmers used device-dependent commands for computer control of instruments. But lack of standardiza
100 Chapter 10 • • • •••
101 • • • ••• Chapter 11• • • • • • Advanced TopicsNow that you’ve seen how to create a short program to perform a measurement in popular programming
102 Chapter 11 • • • •••Driver developers also provide wrapper interfaces optimized for specific development environments. The wrapper functions as a
Advanced Topics 103 • • • •••Now that we’ve defined the capabilities, we can look at each driver in terms of those it supports. Custom Specific Driver
104 Chapter 11 • • • •••capabilities, it is called an IVI-COM custom driver. If the driver includes the class capabilities, it is called an IVI-COM C
Advanced Topics 105 • • • ••••The instruments must provide the same behavior, at least with respect to the calling program.Meeting these requirements
106 Chapter 11 • • • •••IVI Configuration StoreThe IVI Configuration Store holds information about the IVI drivers installed on your computer and con
Advanced Topics 107 • • • •••and contains the commands and functions necessary to communicate with the instrument. You can use the software module ent
108 Chapter 11 • • • •••In the illustration below, we replace the Vendor X DMM with a Vendor Y DMM. All we need to do is change the LogicalName so th
Advanced Topics 109 • • • •••IVI-COMThis C# example shows interchangeability using IIviDriver, which references all of IVI’s inherent capabilities.IIv
Introduction 11 • • • •••vendor’s instrument and not need to relearn the commands. Also commands that are common to all drivers, such as Initialize an
110 Chapter 11 • • • •••a reference to the instance of the driver. This line of code then casts the reference returned to type IIviDriver, from whic
Advanced Topics 111 • • • •••The rest of the code follows that used for the examples, but note that it is written to the class-compliant interfaces, n
112 Chapter 11 • • • •••IviDMM_ConfigureTrigger (session, IVIDMM_VAL_IMMEDIATE, 0.01);IviDMM_Read (session, 1000, &reading);printf ("%f&quo
Advanced Topics 113 • • • •••2 Several vendors include examples as part of driver installation. For the Agilent 34401A driver (from Agilent Technologi
114 Chapter 11 • • • •••
12 Chapter 1 • • • •••IVI drivers conform to and are documented according to the IVI specifications and usually display the standard IVI logo. Note:
Introduction 13 • • • •••Flavors of IVI DriversTo support all popular programming languages and development environments, IVI drivers provide either a
14 Chapter 1 • • • •••To see the list of drivers registered with the IVI Foundation, go to http://www.ivifoundation.org.Familiarizing Yourself with
Introduction 15 • • • ••••Access an instrument property – We set the trigger delay to 0.01 seconds.•Set the reading timeout – We set the reading timeo
16 Chapter 1 • • • •••
17 • • • ••• Chapter 2• • • • • • Using IVI with Visual C++The EnvironmentMicrosoft Visual C++ is a software development environment for the C++ progr
18 Chapter 2 • • • •••Create a New Project and Import the Driver Type LibrariesTo use an IVI Driver in a Visual C++ program, you must provide the pa
Using IVI with Visual C++ 19 • • • •••“$(VXIPNPPATH)VisaCom”Note: These steps need only be done once for each computer you use. All subsequent Visual
20 Chapter 2 • • • •••Initialize the InstrumentYou can now write the main constructs for your program. Below the smart pointer statement, type dmm-&
Using IVI with Visual C++ 21 • • • •••Set the Reading Timeout/Display the ReadingCreate a variable to represent the reading and make a reading with a
22 Chapter 2 • • • •••exit(1);{IAgilent34401Ptr dmm(__uuidof(Agilent34401));try{dmm->Initialize("GPIB::23",false,true,"simulate=tr
Using IVI with Visual C++ 23 • • • •••2 From the Tools menu select Options.3 Expand “Projects and Solutions”, then click on “VC++ Directories”4 Click
24 Chapter 2 • • • •••10 Expand “Configuration Properties”11 Expand “Linker”12 Select Input. In the Additional Dependencies field, type“hp34401a.lib
Using IVI with Visual C++ 25 • • • •••Define Error Checking1 Next define error checking for your program. First you will define a macro to catch the e
26 Chapter 2 • • • •••• Simulate=1 in the Options parameter sets the driver to simulation mode• &session assigns the Instrument Handle to the va
Using IVI with Visual C++ 27 • • • •••#endifint main(int argc, _TCHAR* argv[]){ViSession session;ViStatus error = VI_SUCCESS;ViReal64 reading;checkE
28 Chapter 2 • • • •••1 From the Start Menu, select Build, and click Build IVI Demo.2 From the Start Menu, select Debug, and run the application.Fur
29 • • • ••• Chapter 3 Using IVI with Visual C# and • • • • • • Visual Basic .NETThe EnvironmentC# and Visual Basic are object-oriented pro
Contents 3 • • • •••• • • • • • ContentsChapter 1 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
30 Chapter 3 • • • •••Create a New Project and Reference the DriverTo use an IVI Driver in a Visual C# program, you must first add a reference to it
Using IVI with Visual C# and Visual Basic 31 • • • •••Create an Instance of the DriverTo allow your program to access the driver without specifying th
32 Chapter 3 • • • •••Initialize the InstrumentYou can now write the main constructs for your program. Create a variable to represent your instrumen
Using IVI with Visual C# and Visual Basic 33 • • • •••Configure the InstrumentTo set the range to 1.5 volts and the resolution to 1 millivolt, typedmm
34 Chapter 3 • • • •••Your final program should contain the code below:using System;using System.Collections.Generic;using System.Text;using Agilent
Using IVI with Visual C# and Visual Basic 35 • • • •••Imports Agilent.Agilent34401.InteropModule Module1Sub Main()Dim dmm As New Agilent34401 d
36 Chapter 3 • • • •••
37 • • • ••• Chapter 4• • • • • • Using IVI with LabVIEWTMThe EnvironmentNational Instruments LabVIEW is a graphical development environment for signa
38 Chapter 4 • • • •••functions, making it easier to use in LabVIEW. If your IVI-C driver does not have a LabVIEW wrapper, you can create one using
Using IVI with LabVIEWTM 39 • • • •••Initialize the Instrument1 Select Initialize With Options VI from the hp34401a palette and place it on the Block
4Contents• • • •••Create a New Project and Import the Driver Type Libraries. . . . . . . . . . 22Declare Variables. . . . . . . . . . . . . . . . . .
40 Chapter 4 • • • •••Configure the Instrument1 From the Configuration subpalette, select Configure Measurement VI and place it on the Block Diagram
Using IVI with LabVIEWTM 41 • • • •••3 Connect resource name and error information from Configure Trigger to Read VI.Display the ReadingCreate an indi
42 Chapter 4 • • • •••Setting a Property in an IVI-C DriverProperties such as Trigger Delay can also be set (and read) with a property node. This is
Using IVI with LabVIEWTM 43 • • • •••2 From the File menu, select New VI. The Front Panel and Block Diagram appear.3 Right-click in the Block Diagram.
44 Chapter 4 • • • •••7 From the Type Library drop-down, select the IVI Agilent 34401A (Agilent Technologies) 1.1 Type Library Version 1.1, and then
Using IVI with LabVIEWTM 45 • • • •••4 Back in the Class Browser, under Properties and Methods, scroll down and select Initialize. Click Create and dr
46 Chapter 4 • • • •••3 Connect the automation refnum and error terminals from Initialize Invoke Node to DCVoltage.Configure Invoke Node.4 In the Cl
Using IVI with LabVIEWTM 47 • • • •••Run the ApplicationYour final VI Block Diagram should contain the elements shown below. To run your VI:1 Switch t
48 Chapter 4 • • • •••
49 • • • ••• Chapter 5• • • • • • Using IVI with LabWindowsTM/CVITMThe EnvironmentNational Instruments LabWindows/CVI is an ANSI-C integrated developm
Contents 5 • • • •••Create a Project and Access the Driver . . . . . . . . . . . . . . . . . . . . . . . . . 38Initialize the Instrument . . . . . .
50 Chapter 5 • • • •••Note: Any of the three files listed above will work. Adding one of the HP 34401A instrument driver files loads that instrument
Using IVI with LabWindowsTM/CVITM 51 • • • •••4 Select the Instrument Handle parameter. From the Code Menu, click Declare Variable to set the Instrume
52 Chapter 5 • • • •••Configure the Instrument1 From the library tree, select Configuration and click ConfigureMeasurement. The ConfigureMeasurement
Using IVI with LabWindowsTM/CVITM 53 • • • •••3 Select the Code menu and click Insert Function Call to insert the function and values into your progra
54 Chapter 5 • • • ••••session in the Instrument Handle fieldDisplay the Reading1 Select the Reading parameter. 2 Select Code and click Declare Vari
Using IVI with LabWindowsTM/CVITM 55 • • • •••printf (“%f”, reading);Note: Including error checking in your programs is good practice. Use the CheckEr
56 Chapter 5 • • • •••
57 • • • ••• Chapter 6• • • • • • Using IVI with MATLAB®The Development EnvironmentMATLAB from The MathWorks is an interactive software environment fo
58 Chapter 6 • • • •••Configure the IVI DriverThe Instrument Control Toolbox provides a graphical Test & Measurement Tool that enables you to in
Using IVI with MATLAB® 59 • • • •••Next, you must define your Driver Session to link the Software Module with the Hardware Asset and indicate whether
6Contents• • • •••Further Information. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55Chapter 6 Using IVI with MATL
60 Chapter 6 • • • •••10 Select the Logical Names tab. In the Logical Names dialog, select Add and enter the following:•DMM in the Name field•This l
Using IVI with MATLAB® 61 • • • •••11 Select File and Save IVI Configuration Store. Saving to the store may take several moments. 12 Close the Test &a
62 Chapter 6 • • • •••Set the Trigger DelayTo set the trigger delay to 0.01 seconds, typemyDmm.Trigger.Delay = 0.01;Set Reading TimeoutTo take a rea
Using IVI with MATLAB® 63 • • • •••Further InformationTo learn more about using MATLAB with IVI instrument drivers, visit: http://www.mathworks.com/iv
64 Chapter 6 • • • •••
65 • • • ••• Chapter 7• • • • • • Using IVI with Measure Foundry®The EnvironmentMeasure Foundry is a visual software environment for creating test and
66 Chapter 7 • • • •••Data SourceThe property pages contain all the information necessary to create an instance of the driver, initialize and config
Using IVI with Measure Foundry® 67 • • • ••••Agilent34401 in the device type field•GPIB and 23 in the VISA connect string field•DCV in the measurement
68 Chapter 7 • • • •••9 Click Next.10 Configure the trigger delay. In the Properties dialog, enter 0.01 in the trigger delay field and Immediate in
Using IVI with Measure Foundry® 69 • • • •••
Contents 7 • • • •••Prepare the PAWS Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74Add the WCEM Interface Functions. . . .
70 Chapter 7 • • • •••Data SinkThe property pages contain all the information necessary to display the output.1 In the Foundry window, select Displa
Using IVI with Measure Foundry® 71 • • • •••DT Measure Foundry® is a registered trademark of Data Translation® in the United States and/or other count
72 Chapter 7 • • • •••
73 • • • ••• Chapter 8• • • • • • Using IVI with PAWSThe EnvironmentPAWS Developer's Studio gives you the capability to edit, compile, modify, de
74 Chapter 8 • • • •••download and install a driver, you do not need to exit PAWS Studio. Install the driver and continue with your program. Prepare
Using IVI with PAWS 75 • • • •••C$ 001110 DECLARE, VARIABLE, 'MEASURED' IS DECIMAL $C$E02000 OUTPUT, C'\LF\ATLAS PROGRAM STA
76 Chapter 8 • • • ••• { voltage range -300 v to 300 v continuous; } end; ** DC Voltage Measurement end; *end dmmNote: To und
Using IVI with PAWS 77 • • • •••9 To add a new *.h file called DMM.h to include the code necessary to reference the driver header files and librairies
78 Chapter 8 • • • •••#import "IviDmmTypeLib.dll" named_guids, raw_interfaces_only, raw_native_types no_namespace#import "Agilent3440
Using IVI with PAWS 79 • • • •••5 In the doOpen() interface function, insert the following code below the line Please insert your CEM driver code here
8Contents• • • •••Set the Trigger Delay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97Set the Reading Timeout . . .
80 Chapter 8 • • • •••if (FAILED(hr)){Display("\033[30;41m Bad return from get_DCVoltage(&pDMMDCVolt) method\033[m\n"); }hr
Using IVI with PAWS 81 • • • •••hr = pDMMData->Initiate();if (FAILED(hr)){Display("\033[30;41m Bad return from Initiate() method\033[m\n"
82 Chapter 8 • • • •••}driver.Release();pDMMData.Release();pDMMTrig.Release();pDMMDCVolt.Release();Note: The function doUnload gets called only once
Using IVI with PAWS 83 • • • •••Load and Run the Project1 From the Main Menu, select Build and click on Execute Wrts.Note: The message below may appea
84 Chapter 8 • • • •••
85 • • • ••• Chapter 9• • • • • • Using IVI with Visual Basic 6.0The EnvironmentVisual Basic 6.0 is a programming environment derived from Basic and d
86 Chapter 9 • • • •••2 From the Start Menu, select Project, and click References. The References dialog appears.3 Select the IVI Agilent34401 1.1 T
Using IVI with Visual Basic 6.0 87 • • • •••Create an Instance of the Driver1 Double-click Test. The Project1 – Form1(Code) screen appears. Note that
88 Chapter 9 • • • •••Configure the InstrumentSet the function to DC Voltage, range to 1.5 volts, and resolution to 1 millivolt.1 Type dmm.Function
Using IVI with Visual Basic 6.0 89 • • • •••Set the Trigger DelaySet the trigger delay to 0.01 seconds.Type: dmm.Trigger.Delay = 0.01Display the Readi
9 • • • ••• Chapter 1• • • • • • IntroductionPurpose Welcome to IVI Getting Started Guide. This guide introduces key concepts about IVI drivers and sh
90 Chapter 9 • • • •••TipsThe Agilent 34401 driver conforms to the IviDmm class, so you can easily write your program to use the class-compliant int
Using IVI with Visual Basic 6.0 91 • • • •••Further InformationLearn more about Visual Basic at http://msdn.microsoft.com/library/default.asp?url=/lib
92 Chapter 9 • • • •••
93 • • • ••• Chapter 10• • • • • • Using IVI with Agilent VEE ProThe Development EnvironmentAgilent Visual Engineering Environment Pro is a graphical
94 Chapter 10 • • • •••3 Click Add under instrument in the list at the right to add a simulated instrument. The Instrument Properties dialog box ap
Using IVI with Agilent VEE Pro 95 • • • •••7 Click the IVI-COM Driver tab. Select Agilent 34401 from the drop-down list.Note: The VISA address that yo
96 Chapter 10 • • • •••3 Double-click <Double-Click to Add Operation> in the To/From myDMM object. The Select an Operation dialog box appears.
Using IVI with Agilent VEE Pro 97 • • • •••3 In the Edit Initialize dialog box, GPIB0::23::INSTR has already been entered in the ResourceName field. E
98 Chapter 10 • • • •••Close the SessionNow that you have completed all of the driver operations, you should close the driver session to free resour
Using IVI with Agilent VEE Pro 99 • • • •••Further InformationLearn more about VEE Pro at www.agilent.com/find/vee.
Komentarze do niniejszej Instrukcji