Agilent Technologies E2094S User Manual Download Page 13

13

Agilent IO Libraries Suite
Agilent VISA User’s Guide

Agilent Technologies

2
Building a VISA Application in 
Windows

This chapter provides guidelines for building a VISA application in a 
Windows environment.

The chapter contains the following sections:

Building a VISA Program (C/C++)

Building a VISA Program (Visual Basic)

Logging Error Messages

For information on building a VISA application in Visual Studio .NET, 
see the 

VISA Online Help

.

Summary of Contents for E2094S

Page 1: ...Agilent Technologies Agilent IO Libraries Suite E2094S Agilent VISA User s Guide for IO Libraries Suite 15 5 ...

Page 2: ...ave a separate written agreement with warranty terms covering the mate rial in this document that conflict with these terms the warranty terms in the separate agreement shall control Technology Licenses The hardware and or software described in this document are furnished under a license and may be used or copied only in accordance with the terms of such license Restricted Rights Legend If softwar...

Page 3: ...ng VISA Programs C C 14 Sample VISA Program C C 15 Building a VISA Program Visual Basic 18 Visual Basic Programming Considerations 18 Sample VISA Program Visual Basic 20 Logging Error Messages 25 Using the Event Viewer 25 Using the Debug Window 25 3 Programming with VISA VISA Resources and Attributes 28 VISA Resources 28 VISA Attributes 29 Using Sessions 30 Including the VISA Declarations File C C...

Page 4: ...ks 74 Lock Functions 74 viLock viUnlock Functions 74 VISA Lock Types 75 4 Programming via GPIB and VXI GPIB and VXI Interfaces Overview 80 General Interface Information 80 GPIB Interfaces Overview 81 VXI Interfaces Overview 84 GPIB VXI Interfaces Overview 85 Using High Level Memory Functions 88 Programming the Registers 88 High Level Memory Functions Sample Programs 90 Using Low Level Memory Funct...

Page 5: ... Map Address as a Pointer 113 Setting the VXI Trigger Line 114 5 Programming via LAN LAN and Remote Interfaces Overview 118 Direct LAN Connection versus Remote IO Server Client Connection 118 Remote IO Server Client Architecture 118 Addressing LAN Connected Devices 121 Using the TCPIP Interface Type for LAN Access 121 Using a Remote Interface for LAN Access 124 6 Programming via USB USB Interfaces...

Page 6: ...6 Agilent VISA User s Guide ...

Page 7: ...develop I O applications and instrument drivers on Windows PCs This chapter includes What s In This Guide VISA Overview Contacting Agilent NOTE Before you can use VISA you must install and configure VISA on your computer See the Agilent IO Libraries Suite Connectivity Guide with Getting Started for installation on Windows systems Note that using VISA functions and SICL functions in the same I O ap...

Page 8: ...ith VISA describes the basics of VISA and lists some sample programs The chapter also includes information on creating sessions using formatted I O events etc Chapter 4 Programming via GPIB and VXI provides guidelines for using VISA to communicate over the GPIB GPIB VXI and VXI interfaces to instruments Chapter 5 Programming via LAN provides guidelines for using VISA to communicate over a LAN Loca...

Page 9: ...the Agilent SICL User s Guide for Windows For information on Agilent IO Libraries Suite see the Agilent IO Libraries Suite Connectivity Guide with Getting Started and the Agilent IO Libraries Suite Online Help Using VISA VISA COM and SICL Agilent Virtual Instrument Software Architecture VISA is an I O library designed according to the VXIplug play System Alliance that allows software developed fro...

Page 10: ...interface can be accessed remotely over a computer network Agilent VISA provides support for version 3 0 of the VISA specifica tion VISA Documentation This table shows associated documentation you can use when programming with Agilent VISA Table 1 Agilent VISA Documentation Document Description Agilent IO Libraries Suite Connectivity Guide with Getting Started Shows how to install configure and ma...

Page 11: ... VISA over LAN TCP IP Instrument Protocol Specification VXI 11 Rev 1 0 TCP IP VXIbus Interface Specification VXI 11 1 Rev 1 0 TCP IP IEEE 488 1 Interface Specification VXI 11 2 Rev 1 0 TCP IP IEEE 488 2 Instrument Interface Specification VXI 11 3 Rev 1 0 Table 1 Agilent VISA Documentation ...

Page 12: ...act your country s Agilent support organization A list of contact information for other countries is available on the Agilent Web site http www agilent com find assist The Agilent Developer Network ADN http www agilent com find adn is a one stop web resource that supports your connectivity needs with software downloads sample code technical notes and white papers ...

Page 13: ...ws This chapter provides guidelines for building a VISA application in a Windows environment The chapter contains the following sections Building a VISA Program C C Building a VISA Program Visual Basic Logging Error Messages For information on building a VISA application in Visual Studio NET see the VISA Online Help ...

Page 14: ...r development environment Microsoft Visual C Version 6 0 Development Environment 1 Use the File menu to create a new project or open an existing project 2 Select Project Settings from the menu and click the C C tab 3 Select Code Generation from the Category list box and select Multi Threaded using DLL from the Use Run Time Libraries list box VISA requires these definitions for Win32 Click OK to cl...

Page 15: ...A idn c 7 Click Build Rebuild All to build the VISA program Microsoft Visual Studio NET For information on building a VISA application in Visual Studio NET see the VISA Online Help Sample VISA Program C C This section lists a sample program called idn that queries a GPIB instrument for its identification string This sample assumes a Win32 console application using Microsoft Visual Studio on Window...

Page 16: ... prints the results Note that you must change the address include visa h include stdio h void main ViSession defaultRM vi char buf 256 0 Open session to GPIB device at address 22 viOpenDefaultRM defaultRM viOpen defaultRM GPIB0 22 INSTR VI_NULL VI_NULL vi Initialize device viPrintf vi RST n Send an IDN string to the device viPrintf vi IDN n Read results viScanf vi t buf Print results printf Instru...

Page 17: ... viOpenDefaultRM function This function will initialize the default resource manager and return a pointer to that resource manager session viOpen This function establishes a communication channel with the device specified A session identifier that can be used with other VISA functions is returned This call must be made for each device you will be using viPrintf and viScanf These are the VISA forma...

Page 18: ...you can use VISA specific functions your application must add the visa32 bas VISA Visual Basic module found in C VXIPNP WinNT include assuming default installation directories Adding the visa32 bas File to Your Project To install visa32 bas 1 Select Project Add Module from the Visual Basic 6 0 menu 2 Select the Existing tab 3 Browse and select the visa32 bas file from the applicable directory by d...

Page 19: ...can be called from VB but there are restrictions on the format conversions that can be used Only one format conversion command can be specified in a format string a format conversion command begins with the character For example the following is invalid status viVPrintf vi lf d Chr 10 Instead you must make one call for each format conversion command as shown in the following example status viVPrin...

Page 20: ...ation directories the idn sample files are in C Program Files Agilent IO Libraries Suite ProgrammingSamples VB6 VISA IDN Steps to Running the Program The steps to building and running the idn sample program follow 1 Connect an instrument to a GPIB interface that is compatible with IEEE 488 2 2 Start the Visual Basic 6 0 application This example assumes you are building a new project no vbp file ex...

Page 21: ... your project in VB 6 0 from the menu select Project Add Module select the Existing tab browse to the directory containing the VB declaration file by default this is C VXIPNP WinNT include select visa32 bas and click Open 7 At this point you can run and debug the Visual Basic project You may need to change the VISA interface name and address in the code to match your device s configuration 8 If yo...

Page 22: ... device from GPIB0 and 22 respectively Sub Main Dim defrm As Long Session to Default Resource Manager Dim vi As Long Session to instrument Dim strRes As String 200 Fixed length string to hold results Open the default resource manager session Call viOpenDefaultRM defrm Open the session to the resource The GPIB0 parameter is the VISA Interface name to a GPIB instrument as defined in Connection Exper...

Page 23: ...ll viVPrintf vi RST Chr 10 0 Ask for the device s IDN string Call viVPrintf vi IDN Chr 10 0 Read the results as a string Call viVScanf vi t strRes Display the results MsgBox Result is strRes vbOKOnly IDN Result Close the vi session and the resource manager session Call viClose vi Call viClose defrm End Sub Table 3 Summary of VISA Function Calls in Visual Basic Sample Function s Description viOpenD...

Page 24: ...ST command to the instrument plus a linefeed character and puts it in a known state The viVPrintf call is used again to query for the device identification IDN The viVScanf call is then used to read the results strRes that are displayed in a Message Box viClose This function must be used to close each session When you close a device session all data structures that had been allocated for the sessi...

Page 25: ...se internal messages do not represent programming errors they indicate events which are being handled internally by VISA The process for using the Event Viewer is Enable VISA logging from the Agilent IO Control by clicking the blue IO icon on the taskbar and then clicking Agilent VISA Options VISA Logging Event Viewer Run your VISA program View VISA error messages by running the Event Viewer From ...

Page 26: ...Visual Studio output window The process for using the Debug Window is 1 Enable VISA logging from the Agilent IO Control by clicking the blue IO icon on the taskbar and then clicking Agilent VISA Options VISA Logging Debug Window 2 Run your VISA program from Microsoft Visual Studio or equivalent application 3 View error messages in the Visual Studio or equivalent output window ...

Page 27: ...d can be found in the ProgrammingSamples subdirectory C Program Files Agilent IO Libraries Suite ProgrammingSamples in a default installation Click the IO Control and select Installation Information to see the specific installation directories used on your PC For specific details on VISA functions see the VISA Online Help This chapter contains the following sections VISA Resources and Attributes U...

Page 28: ...can be used for the resource class Table 4describes each resource class supported by Agilent VISA See VISA Resource Classes in the VISA Online Help for a description of the attributes events and operations for each resource class NOTE Although the Servant Device Side SERVANT resource is defined by the VISA specification the SERVANT resource is not supported by Agilent VISA The SERVANT Resource is ...

Page 29: ...attribute state that returns a ViUInt16 declare a variable of that type and use it for the returned data If ViString is returned allocate an array and pass a pointer to that array for returned data Example Reading a VISA Attribute This example reads the state of the VI_ATTR_TERMCHAR_EN attribute and changes it if it is false ViBoolean state newstate newstate VI_TRUE viGetAttribute vi VI_ATTR_TERMC...

Page 30: ...all VISA constants and error codes The visa h header file also includes the visatype h header file The visatype h header file defines most of the VISA types The VISA types are used throughout VISA to specify data types used in the functions For example the viOpenDefaultRM function requires a pointer to a parameter of type ViSession If you find ViSession in the visatype h header file you will find ...

Page 31: ...fic resource First you must open a session to the default resource manager with the viOpenDefaultRM function The first call to this function initializes the default resource manager and returns a session to that resource manager session You only need to open the default manager session once However subsequent calls to viOpenDefaultRM return a unique session to the same default resource manager res...

Page 32: ...es the resource manager session rsrcName A unique symbolic name of the resource resource address accessMode Specifies the modes by which the resource is to be accessed The value VI_EXCLUSIVE_LOCK is used to acquire an exclusive lock immediately upon opening a session If a lock cannot be acquired the session is closed and an error is returned The VI_LOAD_CONFIG value is used to configure attributes...

Page 33: ...lose defaultRM Addressing a Session As shown in the previous section the rsrcName parameter in the viOpen function is used to identify a specific resource This parameter consists of the VISA interface ID and the resource address The interface ID is determined when you run the Agilent Connection Expert utility The interface ID is usually the VISA interface type followed by a number The following ta...

Page 34: ...me INSTR TCPIP TCPIP board host address port SOCKET USB USB board manufacturer ID model code serial number USB interface number INSTR VXI VXI board VXI logical address INSTR VXI VXI board MEMACC VXI VXI board VXI logical address BACKPLANE Table 7 Description of Parameters Parameter Description board This optional parameter is used if you have more than one interface of the same type The default va...

Page 35: ...r of a USB device USB interface number Interface number of a USB device VXI logical address Logical address of a VXI instrument within a mainframe Table 8 Examples of Valid VISA Addresses Address String Description VXI0 1 INSTR A VXI device at logical address 1 in VXI interface VXI0 GPIB VXI 9 INSTR A VXI device at logical address 9 in a GPIB VXI controlled VXI system GPIB 1 0 INSTR A GPIB device ...

Page 36: ... Mainframe resource for default chassis on GPIB VXI interface 2 GPIB1 SERVANT Servant device side resource for GPIB interface 1 VXI0 SERVANT Servant device side resource for VXI interface 0 TCPIP0 1 2 3 4 999 SOCK ET Raw TCPIP access to port 999 at the specified address TCPIP devicename compa ny com INSTR TCPIP device using VXI 11 located at the specified address This uses the default LAN Device N...

Page 37: ...hing for Resources When you open the default resource manager you are opening a parent session that knows about all the other resources in the system Since the resource manager session knows about all resources it has the ability to search for specific resources and open sessions to these resources You can for example search an interface for devices and open a session with one of the devices found...

Page 38: ...esource manager session expr The expression that identifies what to search Table 10 findList A handle that identifies this search This handle will then be used as an input to the viFindNext function when finding the next match retcnt A pointer to the number of matches found instrDesc A pointer to a string identifying the location of the match Note that you must allocate storage for this string NOT...

Page 39: ...n nmatches and matches points to the string that contains the matches found The first call returns the first match found the second call returns the second match found etc VI_FIND_BUFLEN is defined in the visa h declarations file ViChar buffer VI_FIND_BUFLEN ViRsrc matches buffer ViUInt32 nmatches ViFindList list viFindRsrc defaultRM VXI INSTR list nmatches matches viFindNext list matches viClose ...

Page 40: ...ust be done by the user You can choose between VISA s formatted and non formatted I O routines However you should not mix formatted I O and non formatted I O in the same session See the following sections for descriptions and code examples using formatted I O and non formatted I O in VISA The VISA formatted I O mechanism is similar to the C stdio mechanism The VISA formatted I O functions are viPr...

Page 41: ...rmats and sends data to a device and then immediately receives and converts the response data Hence viQueryf is a combination of both viPrintf and viScanf functions Similarly viVQueryf is a combination of viVPrintf and viVScanf viQueryf sends and receives separate arg parameters while the viVQueryf function sends and receives a list of parameters in params viQueryf vi writeFmt readFmt arg1 arg2 vi...

Page 42: ...CESS the write buffer will also be flushed every time a viPrintf or viQueryf operation completes See VISA Attributes in this chapter for information on setting VISA attributes The read buffer is maintained by the viScanf and viQueryf readFmt functions It queues the data received from a device until it is needed by the format string Flushing the read buffer destroys the data in the buffer and guara...

Page 43: ...formatio c This example program makes a dmm measurement with a comma separated list passed with formatted I O and prints the results You may need to change the device address include visa h include stdio h void main ViSession defaultRM vi double res double list 2 1 0 001 Open session to GPIB device at address 22 viOpenDefaultRM efaultRM viOpen defaultRM GPIB0 22 INSTR VI_NULL VI_NULL vi Initialize...

Page 44: ...d stores the results in the location where buf is pointing Only one synchronous read operation can occur at any one time viRead vi buf count retCount viWrite The viWrite function synchronously sends the data pointed to by buf to the device specified by vi Only one synchronous write operation can occur at any one time viWrite vi buf count retCount Refer to the Agilent VISA help file for specific in...

Page 45: ...tual Open session to GPIB device at address 22 viOpenDefaultRM defaultRM viOpen defaultRM GPIB0 22 INSTR VI_NULL VI_NULL vi Initialize device viWrite vi ViBuf RST n 5 actual Set up device and take measurement viWrite vi ViBuf CALC DBM REF 50 n 16 actual viWrite vi ViBuf MEAS VOLT AC 1 0 001 n 23 actual Read results viRead vi ViBuf strres 20 actual NULL terminate the string strres actual 0 Print re...

Page 46: ...r and enable one or several events with viEnableEvent If the event was enabled with a handler the specified event handler will be called when the specified event occurs This is called a callback VISA cannot call back to a Visual Basic function This means that you can only use the VI_QUEUE mechanism in viEnableEvent There is no way to install a VISA event handler in Visual Basic Enable one or sever...

Page 47: ...disabled regardless of the current state of the other Events that can be Enabled The following table shows the events that are implemented for Agilent VISA for each resource class where AP Access Privilege RO Read Only and RW Read Write Note that some resource classes events such as the SERVANT class are not implemented by Agilent VISA and are not listed in the following tables Once the applicatio...

Page 48: ...ventTy pe VI_EVENT_TRIG VI_ATTR_RECV_TRIG_I D The identifier of the triggering mechanism on which the specified trigger event was received R O ViInt16 VI_TRIG_TTL0 to VI_TRIG_TTL7 VI_TRIG_ECL0 to VI_TRIG_ECL1 Agilent VISA can also return VI_TRIG_PANEL_IN exception to the VISA Specification VI_EVENT_IO_COMPLETION Notification that an asynchronous operation has completed Event Attribute Description ...

Page 49: ...ta that was received from the USB interrupt IN pipe This value will never be larger than the sessions value of VI_ATTR_USB_MAX_ INTR_SIZE R O ViUInt16 0 to FFFFh VI_ATTR_USB_RECV_IN TR _DATA Specifies the actual data that was received from the USB interrupt IN pipe Querying this attribute copies the contents of the data to the users buffer The users buffer must be sufficiently large enough to hold...

Page 50: ...a buffer that was used in an asynchronous operation R O ViBuf N A VI_ATTR_RET_COUNT Actual number of elements that were asynchronously transferred R O ViUInt32 0 to FFFFFFFFh VI_ATTR_OPER_NAME Name of the operation generating the event R O ViString N A Table 13 GPIB Bus Interface INTFC Resource Events VI_EVENT_GPIB_CIC Notification that the GPIB controller has gained or lost CIC controller in char...

Page 51: ...ler has been sent a device clear message Event Attribute Description A P Data Type Range VI_ATTR_EVENT_TYPE Unique logical identifier of the event R O ViEventTy pe VI_EVENT_CLEAR VI_EVENT_TRIGGER Notification that a trigger interrupt was received from the interface Event Attribute Description A P Data Type Range VI_ATTR_EVENT_TYPE Unique logical identifier of the event R O ViEventTy pe VI_EVENT_TR...

Page 52: ...ame of the operation generating the event R O ViString N A Table 14 VXI Mainframe Backplane BACKPLANE Resource Events VI_EVENT_TRIG Notification that a trigger interrupt was received from the backplane For VISA the only triggers that can be sensed are VXI hardware triggers on the assertion edge SYNC and ON trigger protocols only Event Attribute Description A P Data Type Range VI_ATTR_EVENT_TYPE Un...

Page 53: ... Event VI_EVENT_IO_COMPLETION Notification that an asynchronous operation has completed Event Attribute Description A P Data Type Range VI_ATTR_EVENT_TYPE Unique logical identifier of the event R O ViEventTy pe VI_EVENT_IO_COMPLE TION VI_ATTR_STATUS Return code of the asynchronous I O operation that has completed R O ViStatus N A VI_ATTR_JOB_ID Job ID of the asynchronous operation that has complet...

Page 54: ...6 state viGetAttribute context VI_ATTR_RECV_TRIG_ID state Using the Callback Method The callback method of event notification is used when an immediate response to an event is required To use the callback method for receiving notification that an event has occurred you must do the following Install an event handler with the viInstallHandler function Enable one or several events with the viEnableEv...

Page 55: ...ation adds to the previous list of handlers If more than one handler is installed for an event type each of the handlers is invoked on every occurrence of the specified event s VISA specifies that the handlers are invoked in Last In First Out LIFO order Use the following function when installing an event handler viInstallHandler vi eventType handler userHandle These parameters are defined as follo...

Page 56: ...EVENT_SERVICE_REQ must also be an enabled event with the viEnableEvent function for the service request event to be delivered viInstallHandler vi VI_EVENT_SERVICE_REQ my_handler addr Use the viUninstallHandler function to uninstall a specific handler or you can use wildcards VI_ANY_HNDLR in the handler parameter to uninstall groups of handlers See viUninstallHandler in the VISA Online Help for mor...

Page 57: ...ts that have previously been enabled on the specified session will be enabled for the mechanism specified in this function call Use the viDisableEvent function to stop servicing the event specified Table 17 Description of Parameters Used to Install a Handler Parameter Description vi The session on which the handler will be installed eventType The type of event to enable mechanism The mechanism by ...

Page 58: ...es subdirectory See the IO Libraries Suite Online Help for locations of example programs evnthdlr c This example program illustrates installing an event handler to be called when a trigger interrupt occurs Note that you may need to change the address include visa h include stdio h trigger event handler ViStatus _VI_FUNCH myHdlr ViSession vi ViEventType eventType ViEvent ctx ViAddr userHdlr ViInt16...

Page 59: ...lect trigger line TTL0 viSetAttribute vi VI_ATTR_TRIG_ID VI_TRIG_TTL0 install the handler and enable it viInstallHandler vi VI_EVENT_TRIG myHdlr ViAddr 10 viEnableEvent vi VI_EVENT_TRIG VI_HNDLR VI_NULL fire trigger line twice viAssertTrigger vi VI_TRIG_PROT_SYNC viAssertTrigger vi VI_TRIG_PROT_SYNC unenable and uninstall the handler viDisableEvent vi VI_EVENT_TRIG VI_HNDLR viUninstallHandler vi V...

Page 60: ...rammingSamples subdirectory See the IO Libraries Suite Online Help for locations of example programs srqhdlr c This example program illustrates installing an event handler to be called when an SRQ interrupt occurs Note that you may need to change the address include visa h include stdio h if defined _WIN32 include windows h for Sleep define YIELD Sleep 10 elif defined _WINDOWS include io h for _wy...

Page 61: ...x x n statusByte srqOccurred 1 return VI_SUCCESS void main ViSession defaultRM vi long count open session to message based VXI device viOpenDefaultRM defaultRM viOpen defaultRM GPIB VXI0 24 INSTR VI_NULL VI_NULL vi Enable command error events viPrintf vi ESE 32 n Enable event register interrupts viPrintf vi SRE 32 n install the handler and enable it viInstallHandler vi VI_EVENT_SERVICE_REQ mySrqHd...

Page 62: ...nt2 100 srqOccurred 0 YIELD printf n disable and uninstall the handler viDisableEvent vi VI_EVENT_SERVICE_REQ VI_HNDLR viUninstallHandler vi VI_EVENT_SERVICE_REQ mySrqHdlr ViAddr 10 Clean up do not leave device in error state viPrintf vi CLS n close the sessions viClose vi viClose defaultRM printf End of program n Using the Queuing Method The queuing method is generally used when an immediate resp...

Page 63: ...cified timeout period is reached Example Using the Queuing Method This example program shows one way you can use the queuing method main ViSession vi ViEventType eventType ViEvent event viEnableEvent vi VI_EVENT_SERVICE_REQ VI_QUEUE VI_NULL viWaitOnEvent vi VI_EVENT_SERVICE_REQ VI_TMO_INFINITE eventType event viClose event viDisableEvent vi VI_EVENT_SERVICE_REQ VI_QUEUE Enabling Events Before an e...

Page 64: ...I_ALL_ENABLE_EVENTS in the eventType parameter all events that have previously been enabled on the specified session will be enabled for the mechanism specified in this function call Use the viDisableEvent function to stop servicing the event specified Wait on the Event When using the viWaitOnEvent function specify the session the event type to wait for and the timeout period to wait viWaitOnEvent...

Page 65: ...r event in a queuing mode When the viWaitOnEvent function is called the program will suspend operation until the trigger line is fired or the timeout period is reached Since the trigger lines were already fired and the events were put into a queue the function will return and print the trigger line that fired This program is intended to show specific VISA functionality and does not include error t...

Page 66: ...vent viEnableEvent vi VI_EVENT_TRIG VI_QUEUE VI_NULL fire trigger line twice viAssertTrigger vi VI_TRIG_PROT_SYNC viAssertTrigger vi VI_TRIG_PROT_SYNC Wait for the event to occur err viWaitOnEvent vi VI_EVENT_TRIG 10000 eventType eventVi if err VI_ERROR_TMO printf Timeout Occurred Event not received n return print the event information printf Trigger Event Occurred n printf Original Device Session...

Page 67: ...nuing viClose eventVi get second event err viWaitOnEvent vi VI_EVENT_TRIG 10000 eventType eventVi if err VI_ERROR_TMO printf Timeout Occurred Event not received n return printf Got second event n close the context before continuing viClose eventVi disable event viDisableEvent vi VI_EVENT_TRIG VI_QUEUE close the sessions viClose vi viClose defaultRM ...

Page 68: ...ou can test to see if err is less than VI_SUCCESS Since WARNINGS are greater than VI_SUCCESS and ERRORS are less than VI_SUCCESS err_handler would only be called when the function returns an ERROR For example if err VI_SUCCESS err_handler vi err Example Checking for VI_SUCCESS This example illustrates checking for VI_SUCCESS If VI_SUCCESS is not returned an error handler written by the programmer ...

Page 69: ...f vi SYSTEM ERR n if err VI_SUCCESS err_handler vi err err viScanf vi d t err_no buf if err VI_SUCCESS err_handler vi err while err_no 0 printf Error Found d s n err_no buf err viScanf vi d t err_no buf err viFlush vi VI_READ_BUF if err VI_SUCCESS err_handler vi err err viFlush vi VI_WRITE_BUF if err VI_SUCCESS err_handler vi err Exception Events An alternative to trapping VISA errors by checking ...

Page 70: ... returning VI_SUCCESS_NCHAIN As noted an exception operation blocks until the exception handler execution is completed However an exception handler sometimes may prefer to terminate the program prematurely without returning the control to the operation generating the exception VISA does not preclude an application from using a platform specific or language specific exception handling mechanism fro...

Page 71: ...fact that asynchronous operations already raise an event when they complete and this I O completion event may occur in the context of a separate thread previously unknown to the application In summary a single application event handler can easily handle error conditions arising from both exception events and failed asynchronous operations Using the VI_EVENT_EXCEPTION Event You can use the VI_EVENT...

Page 72: ... ViString functionName nameBuffer char errStrBuffer 256 Get the error value from the exception context viGetAttribute context VI_ATTR_STATUS exceptionErrNbr Get the function name from the exception context viGetAttribute context VI_ATTR_OPER_NAME functionName errStrBuffer 0 0 viStatusDesc vi exceptionErrNbr errStrBuffer printf ERROR Exception Handler reports n s n VISA function s failed with error...

Page 73: ...serHandle if status VI_SUCCESS printf ERROR viInstallHandler failed with error 0x lx n status status viEnableEvent drm VI_EVENT_EXCEPTION VI_HNDLR VI_NULL if status VI_SUCCESS printf ERROR viEnableEvent failed with error 0x lx n status Generate an error to demonstrate that the handler will be called status viOpen drm badVisaName NULL NULL vi if status VI_SUCCESS printf ERROR viOpen failed with err...

Page 74: ...e operations invoked on the resource through other sessions either are serviced or are returned with an error depending on the operation and the type of lock If a VISA resource is not locked by any of its sessions all sessions have full privilege to invoke any operation and update any global attributes Sessions are not required to have locks to invoke operations or update global attributes However...

Page 75: ...ck on that resource A session that does not share the lock will lack these capabilities Locking a resource restricts access from other sessions and in the case where an exclusive lock is acquired ensures that operations do not fail because other sessions have acquired a lock on that resource Thus locking a resource prevents other subsequent sessions from acquiring an exclusive lock on that resourc...

Page 76: ...ice for an identification string and prints the results Note that you may need to change the address include visa h include stdio h void main ViSession defaultRM vi char buf 256 0 Open session to GPIB device at address 22 viOpenDefaultRM defaultRM viOpen defaultRM GPIB0 22 INSTR VI_NULL VI_NULL vi Initialize device viPrintf vi RST n Make sure no other process or thread does anything to this resour...

Page 77: ...ck When the session holding the exclusive lock unlocks the resource via the viUnlock function all the sessions sharing the lock again have all the access privileges associated with the shared lock lockshr c This example program queries a GPIB device for an identification string and prints the results Note that you must change the address include visa h include stdio h void main ViSession defaultRM...

Page 78: ...ce viPrintf vi RST n Make sure no other process or thread does anything to this resource between the viPrintf and the viScanf calls Note this also locks out the processes with which we shared our shared lock key viLock vi VI_EXCLUSIVE_LOCK 2000 VI_NULL VI_NULL Send an IDN string to the device viPrintf vi IDN n Read results viScanf vi t buf unlock this session so other processes and threads can use...

Page 79: ...es information to program GPIB and VXI devices via the GPIB VXI or GPIB VXI interfaces including GPIB and VXI Interfaces Overview Using High Level Memory Functions Using Low Level Memory Functions Using High Low Level Memory I O Methods Using the Memory Access Resource Using VXI Specific Attributes See Chapter 3 Programming with VISA for general information on VISA programming for the GPIB VXI and...

Page 80: ...nique interface name with a hardware interface Agilent IO Libraries Suite uses a VISA interface name to identify an interface This information is passed in the parameter string of the viOpen function call in a VISA program Connection Expert assigns a VISA interface name to the interface hardware and other necessary configuration values for an interface when the interface is configured See the Agil...

Page 81: ...sed VXI device typically does not have a processor to interpret high level commands Therefore the device must be programmed with register peeks and pokes directly to the device s registers VISA provides two different methods you can use to program register based devices high level memory functions or low level memory functions GPIB Interfaces Overview As shown in the following figure a typical GPI...

Page 82: ... 82350 GPIB cards connected to three GPIB instruments via GPIB cables For this system Agilent Connection Expert has been used to assign GPIB card 1 a VISA name of GPIB0 and to assign GPIB card 2 a VISA name of GPIB1 VISA addressing is as shown in the figure 5 82350 GPIB Card 1 Windows PC 3 3 GPIB Instruments GPIB Cable 82350 GPIB Card 2 GPIB Interface 82350 PCI GPIB Cards ...

Page 83: ...82350 GPIB Card 2 VISA Name GPIB0 GPIB1 VISA Addressing viOpen GPIB0 5 INSTR viOpen GPIB0 3 INSTR viOpen GPIB1 3 INSTR GPIB Interface 82350 PCI GPIB Cards Open IO path to GPIB instrument at address 5 using 82350 Card 1 Open IO path to GPIB instrument at address 3 using 82350 Card 1 Open IO path to GPIB instrument at address 3 using 82350 Card 2 ...

Page 84: ...e consists of a Windows PC with an E8491 PC card that connects to an E8491B IEEE 1394 to VXI Module in a VXI Mainframe For this system the three VXI instruments shown have logical addresses 8 16 and 24 The Connection Expert utility has been used to assign the E8491 PC card a VISA name of VXI0 VISA addressing is as shown in the figure For information on the E8491B module see the Agilent E8491B User...

Page 85: ...E1406A sends commands to the VXI instruments in a VXI mainframe There is no direct access to the VXI backplane from the PC E8491 PC Card Windows PC Interface VISA Name VISA Name VXI0 VISA Addressing viOpen VXI0 24 INSTR VXI Interface E8491B IEEE 1394 to VXI Module Open IO path to VXI instrument at logical address 24 using E8491 PC Card and E8491 IEEE 1394 to VXI Module E 8 4 9 1 B V X I I n s t r ...

Page 86: ... installed and the E1406A was configured for primary address 9 and logical address LA 0 The three VXI instruments shown have logical addresses 8 16 and 24 NOTE For a GPIB VXI interface VISA uses a DLL supplied by the Command Module vendor to translate the VISA VXI calls to Command Module commands that are vendor specific The DLL required for Agilent Command Modules is installed by the Agilent IO L...

Page 87: ...odule User s Guide For information on VXI instruments see the applicable instrument s User s Guide 82350 GPIB Card Windows PC Interface VISA Name VISA Name GPIB VXI0 GPIB0 VISA Addressing viOpen GPIB VXI0 24 INSTR GPIB VXI Interface E1406A Command Module Open IO path to VXI instrument at logical address 24 using 82350 GPIB Card and E1406A VXI Command Module at GPIB primary address 9 E 1 4 0 6 A V ...

Page 88: ...ctions discussed in Using Low Level Memory Functions on page 94 Programming the Registers High level memory functions include the viIn and viOut functions for transferring 8 16 or 32 bit values as well as the viMoveIn and viMoveOut functions for transferring 8 16 or 32 bit blocks of data into or out of local memory You can therefore program using 8 16 or 32 bit transfers High Level Memory Function...

Page 89: ...ss space VI_A32_SPACE Maps in VXI MXI A32 address space viOut16 vi space offset val16 Writes 16 bits of data to the specified offset viOut32 vi space offset val32 Writes 32 bits of data to the specified offset viMoveIn8 vi space offset length buf8 Moves an 8 bit block of data from the specified offset to local memory viMoveIn16 vi space offset length buf16 Moves a 16 bit block of data from the spe...

Page 90: ...and the viMoveOut functions moves an 8 16 or 32 bit block of data from local memory to the specified offset Again the memory mapping is done for you For example in this function viMoveIn32 vi space offset length buf32 vi is the session identifier and offset is used to indicate the offset of the memory to be mapped offset is relative to the location of this device s memory in the given address spac...

Page 91: ...am uses the high level memory functions to read the id and device type registers of the device at VXI0 24 Change this address if necessary The register contents are then displayed include visa h include stdlib h include stdio h void main ViSession defaultRM dmm unsigned short id_reg devtype_reg Open session to VXI device at address 24 viOpenDefaultRM defaultRM viOpen defaultRM VXI0 24 INSTR VI_NUL...

Page 92: ...level memory functions to read the id and device type registers of the device at GPIB VXI0 24 Change this address if necessary The register contents are then displayed include visa h include stdlib h include stdio h void main ViSession defaultRM dmm unsigned short id_reg devtype_reg Open session to VXI device at address 24 viOpenDefaultRM defaultRM viOpen defaultRM GPIB VXI0 24 INSTR VI_NULL VI_NU...

Page 93: ...Programming via GPIB and VXI 4 Agilent VISA User s Guide 93 Print results printf ID Register 0x 4X n id_reg printf Device Type Register 0x 4X n devtype_reg Close sessions viClose dmm viClose defaultRM ...

Page 94: ... memory functions for direct register access you must first map a range of addresses using the viMapAddress function Next you can send a series of peeks and pokes using the viPeek and viPoke low level memory functions Then you must free the address window using the viUnmapAddress function A process you could use is 1 Map memory space using viMapAddress 2 Read and write to the register s contents u...

Page 95: ...aps in VXI MXI A16 address space VI_A24_SPACE Maps in VXI MXI A24 address space VI_A32_SPACE Maps in VXI MXI A32 address space A pointer to the address space where the memory was mapped is returned in the address parameter If the device specified by vi does not have memory in the specified address space an error is returned Some sample viMapAddress function calls follow Maps to A32 address space v...

Page 96: ... for a description of the registers and register locations You can then use this information and the VISA low level functions to access the device registers Sample Using viPeek16 A code sample using viPeek16 follows ViSession defaultRM vi ViUInt16 value ViAddr address ViUInt16 value viOpenDefaultRM defaultRM viOpen defaultRM VXI 24 INSTR VI_NULL VI_NULL vi viMapAddress vi VI_A16_SPACE 0x00 0x04 VI...

Page 97: ...ctions This program uses low level memory functions and the VXI interface to read the ID and Device Type registers of a device at VXI0 24 vxill c This example program uses the low level memory functions to read the id and device type registers of the device at VXI0 24 Change this address if necessary The register contents are then displayed include visa h include stdlib h include stdio h void main...

Page 98: ...essions viClose dmm viClose defaultRM Sample Using the GPIB VXI Interface Low Level Memory Functions This program uses low level memory functions and the GPIB VXI interface to read the ID and Device Type registers of a device at GPIB VXI0 24 gpibvxil c This example program uses the low level memory functions to read the id and device type registers of the device at GPIB VXI0 24 Change this address...

Page 99: ...VI_FALSE VI_NULL address Read instrument id register contents viPeek16 dmm address id_reg Read device type register contents ViAddr is defined as a void so we must cast it to something else to do pointer arithmetic viPeek16 dmm ViAddr ViUInt16 address 0x01 devtype_reg Unmap memory space viUnmapAddress dmm Print results printf ID Register 0x 4X n id_reg printf Device Type Register 0x 4X n devtype_r...

Page 100: ...viIn8 viIn16 viIn32 viOut8 viOut16 viOut32 High level viMoveIn viMoveOut viMoveIn8 viMoveIn16 viMoveIn32 viMoveOut8 viMoveOut16 viMoveOut32 Using Low Level viPeek viPoke Low level viPeek viPoke is the most efficient in programs that require repeated access to different addresses in the same memory space The advantages of low level viPeek viPoke are Individual viPeek viPoke calls are faster than vi...

Page 101: ...viMoveIn viMoveOut High level viMoveIn viMoveOut calls provide the highest possible performance for transferring blocks of data to or from the VXI backplane Although these calls have higher initial overhead than the viPeek viPoke calls they are optimized on each platform to provide the fastest possible transfer rate for large blocks of data For small blocks the overhead associated with viMoveIn vi...

Page 102: ...thods in VISA include visa h include stdlib h include stdio h define VXI_INST VXI0 24 INSTR void main ViSession defaultRM vi ViAddr address ViUInt16 accessMode unsigned short memPtr16 unsigned short id_reg unsigned short devtype_reg unsigned short memArray 2 Open default resource manager and session to instr viOpenDefaultRM defaultRM viOpen defaultRM VXI_INST VI_NULL VI_NULL vi Low level memory I ...

Page 103: ...x01 devtype_reg Print results printf viPeek16 ID Register 0x 4X n id_reg printf viPeek16 Device Type Register 0x 4X n devtype_reg Use direct memory dereferencing if supported viGetAttribute vi VI_ATTR_WIN_ACCESS accessMode if accessMode VI_DEREF_ADDR assign pointer to variable of correct type memPtr16 unsigned short address do the actual memory reads id_reg memPtr16 devtype_reg memPtr16 1 Print re...

Page 104: ...n16 The viMoveIn viMoveOut commands do both block read write and FIFO read write These commands offer the best performance for reading and writing large data blocks on the VXI backplane For this example we are only moving 2 words at a time Normally these functions would be used to move much larger blocks of data If the value of VI_ATTR_SRC_INCREMENT is 1 the default viMoveIn does a block read If t...

Page 105: ... 0 printf viMoveIn16 Device Type Register 0x 4X n memArray 1 Demonstrate FIFO read First set the source increment to 0 so we will repetitively read from the same memory location viSetAttribute vi VI_ATTR_SRC_INCREMENT 0 Do a FIFO read of the Id Register viMoveIn16 vi VI_A16_SPACE 0x00 2 memArray Print results printf viMoveIn16 1 ID Register 0x 4X n memArray 0 printf viMoveIn16 2 ID Register 0x 4X ...

Page 106: ...mory I O services and low level memory I O services High Level Memory I O Services High level memory I O services allow register level access to the interfaces that support direct memory access such as the VXIbus VMEbus MXIbus or even VME or VXI memory through a system controlled by a GPIB VXI controller A resource exists for each interface to which the controller has access You can access memory ...

Page 107: ...MACC resource to open the entire VXI A16 memory and then calculate an offset to address a specific device peek16 c include stdio h include stdlib h include visa h define EXIT1 define NO_EXIT 0 This function simplifies checking for VISA errors void checkError ViSession vi ViStatus status char errStr int doexit char buf 256 if status VI_SUCCESS return buf 0 0 viStatusDesc vi status buf printf ERROR ...

Page 108: ...s 8 offset 0xc000 64 8 Open a map to all of A16 memory space status viMapAddress vi VI_A16_SPACE 0 0x10000 VI_FALSE 0 ViPAddr addr checkError vi status viMapAddress EXIT Offset the address pointer returned from viMapAddress for use with viPeek16 addr16 ViUInt16 addr offset Peek the contents of the card s ID register offset 0 from card s base address Note that viPeek does not return a status code v...

Page 109: ...vide General Interface Information Attribute Description VI_ATTR_INTF_TYPE Interface type of the given session VI_ATTR_INTF_NUM Board number for the given interface VI_ATTR_TMO_VALUE Minimum timeout value to use in milliseconds A timeout value of VI_TMO_IMMEDIATE means operation should never wait for the device to respond A timeout value of VI_TMO_INFINITE disables the timeout mechanism VI_ATTR_IN...

Page 110: ...from the same element essentially treating the source as a FIFO register VI_ATTR_DEST_INCREMEN T Used in viMoveOutxx operation to specify how much the destination offset is to be incremented after every transfer The default value is 1 and the viMoveOutxx operation moves into consecutive elements If this attribute is set to 0 the viMoveOutxx operation will always write to the same element essential...

Page 111: ...iMapAddress viPeekxx and viPokexx when accessing the mapped window VI_ATTR_SRC_ACCESS_PRI V Specifies the address modifier used in high level access operations such as viInxx and viMoveInxx when reading from the source VI_ATTR_DEST_ACCESS_P RIV Specifies the address modifier used in high level access operations such as viOutxx and viMoveOutxx when writing to destination VI_ATTR_WIN_ACCESS_PR IV Sp...

Page 112: ...ntroller used by the session Table 25 Events Providing Notification About Asynchronous Operations Attribute Description VI_ATTR_EVENT_T YPE Unique logical identifier of the event VI_ATTR_STATUS Return code of the asynchronous I O operation that has completed VI_ATTR_JOB_ID Job ID of the asynchronous I O operation that has completed VI_ATTR_BUFFER Address of a buffer used in an asynchronous operati...

Page 113: ...e accessed You can access a mapped window with the VISA low level memory functions or with a C pointer if the address is de referenced To determine how to access the window read the VI_ATTR_WIN_ACCESS attribute VI_ATTR_WIN_ACCESS Settings The VI_ATTR_WIN_ACCESS read only attribute can be set to one of the following Table 26 Settings for the VI_ATTR_WIN_ACCESS Attribute Setting Description VI_NMAPP...

Page 114: ...k16 vi ViAddr ViUInt16 address 4 sizeof ViUInt16 value else if access VI_DEREF_ADDR value ViUInt16 address 4 sizeof ViUInt16 else if access VI_NMAPPED return error Setting the VXI Trigger Line The VI_ATTR_TRIG_ID attribute is used to set the VXI trigger line This attribute is listed under generic attributes and defaults to VI_TRIG_SW software trigger To set one of the VXI trigger lines set the VI_...

Page 115: ...read only attribute and cannot be changed You must set this attribute prior to enabling event triggers The VI_ATTR_TRIG_ID attribute can also be used by viAssertTrigger function to assert software or hardware triggers If VI_ATTR_TRIG_ID is VI_TRIG_SW the device is sent a Word Serial Trigger command If the attribute is any other value a hardware trigger is sent on the line corresponding to the valu...

Page 116: ...116 Agilent VISA User s Guide 4 Programming via GPIB and VXI ...

Page 117: ...mming using the VISA TCPIP interface type to communicate directly with a LAN connected device as well as using a remote interface also known as a LAN client to emulate a GPIB serial ASRL or USB interface on the local machine to communicate with a LAN connected device See the Agilent IO Libraries Suite Online Help for information on how to start and stop the Remote IO Server software and on how to ...

Page 118: ...Libraries Suite you can connect to instruments across the LAN even if they do not have direct LAN capability if they are connected to gateways such as the Agilent E5810A or to another PC running the Remote IO Server software Refer to the IO Libraries Suite and the Connectivity Guide for information on connecting and configuring different types of LAN instrument connections Remote IO Server Client ...

Page 119: ...server is connected to the instrumentation or devices to be controlled Once the remote I O server has completed the requested operation on the instrument or device the remote I O server sends a reply to the client This reply contains the requested data and status information that indicates whether or not the operation was successful The remote I O server acts as a gateway between the LAN software ...

Page 120: ...ming via LAN Windows PCs Client LAN Remote I O Server Series 700 workstation or Windows PC GPIB bus GPIB Instrument GPIB Instruments E5810 LAN GPIB Gateway GPIB bus or other LAN Instruments VXI 11 2 GPIB Emulation or VXI 11 3 LAN Instruments ...

Page 121: ...it The format of a TCPIP VISA resource string is TCPIP board hostname LAN device name INSTR where board board number default is 0 hostname the hostname or IP address of the LAN device or server LAN device name the remote device name case sensitive with default name of inst0 Using Connection Expert you can configure a LAN interface to use either the VXI 11 protocol or the SICL LAN protocol The prot...

Page 122: ...ne1 COM1 488 INSTR An RS 232 device connected to a LAN server or gateway at hostname testMachine1 This device must use SICL LAN protocol since RS 232 devices are not supported by the VXI 11 protocol TCPIP0 myMachine gpib0 2 INSTR A GPIB device at hostname myMachine This device must use SICL LAN protocol since gpib0 2 is not a valid remote name with the VXI 11 protocol TCPIP0 myMachine UsbDevice1 I...

Page 123: ... defaultRM viOpen defaultRM TCPIP0 myMachine gpib0 23 INSTR VI_NULL VI_NULL vi viClose vi TCPIP0 myMachine usb0 2391 1031 SN_00123 0 INSTR A USB device with Manufacture ID 2391 Model Code 1031 Serial Number SN_00123 USBTMC Intfc 0 connected to a LAN server at hostname myMachine This device must use SICL LAN protocol since USB devices are not supported by the VXI 11 protocol Table 28 Example TCPIP ...

Page 124: ...ted to the local machine See the Agilent IO Libraries Suite Online Help for specific information on configuring remote interfaces Remote Serial Interface ASRL VISA LAN Client A remote serial interface can use only the SICL LAN protocol A remote serial interface can be configured to use the serial port on the Agilent E5810 LAN GPIB gateway or the serial ports on a PC running the Remote IO Server so...

Page 125: ...ession Using a Remote Interface In general the rules to address a remote session are the same as to address a local session The only difference for a remote session is that you use the VISA interface ID provided during I O configuration via Connection Expert that relates to the remote interface The following sample shows one way to open a device session with a GPIB device at primary address 23 on ...

Page 126: ...126 Agilent VISA User s Guide 5 Programming via LAN ...

Page 127: ...des guidelines for VISA programming of USB instruments that conform to USBTMC Universal Serial Bus Test and Measurement Class and or USBTMC USB488 Universal Serial Bus Test and Measurement Class Subclass USB488 Specification The chapter contents are USB Interfaces Overview Communicating with a USB Instrument Using VISA ...

Page 128: ...ugged into the computer You can use either the alias or the full VISA resource string when opening a VISA resource but using the alias is recommended because it is simpler and because it allows substitution of USB instruments without the need to change the VISA program You can also create VISA aliases for other non USB instruments using the Agilent Connection Expert NOTE Do not confuse the Agilent...

Page 129: ...e string are displayed in a dialog box when the device is plugged into the computer To simplify the way a USB device is identified Agilent VISA also provides an alias which can be used in place of this resource string The first USB device that is plugged in is assigned a default alias of UsbDevice1 Additional devices are assigned aliases of UsbDevice2 UsbDevice3 etc You can modify the default alia...

Page 130: ...sing the alias in a program also makes it more portable For example two identical USB function generators have different resource strings because they have different serial numbers If these function generators are used in two different test systems and you use the full resource string to access the function generator in the test program you cannot use that same program for both test systems since ...

Page 131: ...faces and VISA resources Agilent 488 An I O library provided in Agilent IO Libraries Suite for compatibility with existing test measurement programs that were developed using National Instruments NI 488 or other similar libraries Agilent 488 supports communication with GPIB devices and interfaces but does not support USB LAN RS 232 or VXI communications alias See VISA alias API Application Program...

Page 132: ...alled an interface descriptor or board unit descriptor board level Refers to Agilent 488 functions that operate on an interface board rather than on a device bus error An error that signals failure to access an address Bus errors occur in conjunction with low level accesses to memory and usually involve hardware with bus mapping capabilities Bus errors may be caused by non existent memory a non ex...

Page 133: ...resource In VISA communication channel is synonymous with session Every communication channel in VISA is unique Connection Expert An Agilent software utility that helps you quickly establish connections between your instruments and your PC It also helps you troubleshoot connectivity problems Connection Expert is part of the Agilent IO Libraries Suite product Controller A device typically a compute...

Page 134: ...device for example a printer driver that communicates with a printer from a PC A device driver may either communicate directly with a device by reading to and writing from registers or it may communicate through an interface driver device session A session that communicates as a Controller with a single specific device such as an instrument device level Refers to Agilent 488 functions that operate...

Page 135: ...O An Agilent application that allows you to interactively send commands to instruments and read the results Interactive IO is part of the Agilent IO Libraries Suite product interface A connection and medium of communication between devices and controllers Interfaces include mechanical electrical and protocol connections interface descriptor A handle returned from ibfind that uniquely identifies a ...

Page 136: ...tion area usually the lower right corner of your screen The IO Control gives you access to Agilent I O utilities such as Connection Expert Agilent I O documentation and VISA options IO Libraries Application programming interfaces APIs for direct I O communication between applications and devices There are four Agilent IO Libraries in the Agilent IO Libraries Suite VISA VISA COM SICL and Agilent 48...

Page 137: ... a computer that is in a Controller role notification area The area on the Windows taskbar where notifications are posted typically in the lower right corner of the screen Also called taskbar notification area or Windows notification area operation A defined action that can be performed on a resource primary VISA The VISA installation that controls the visa32 dll file The primary VISA will be used...

Page 138: ...r resource instance In VISA an implementation of a resource class in object oriented terms an instance of a resource class For example an instrument is represented by a resource instance resource class The definition of a particular resource type a class in object oriented terms For example the VISA Instrument Control resource classes define how to create a resource to control a particular capabil...

Page 139: ...nique SICL Standard Instrument Control Library SICL is an Agilent defined API for instrument I O Agilent SICL is one of the IO Libraries installed with Agilent IO Libraries Suite side by side A side by side installation allows two vendors implementations of VISA to be used on the same computer See also primary VISA and secondary VISA SRQ An IEEE 488 Service Request This is an asynchronous request ...

Page 140: ...n the Controller or gateway each interface must have a unique symbolic name System Controller One Controller on a GPIB is the System Controller This is a master Controller it has the ability to demand control and to assert the IFC Interface Clear and REN remote enable lines system tray See notification area Talker A device that transmits data onto the bus when instructed addressed to talk task gui...

Page 141: ...useful for verifying that all expected interfaces have been configured by Connection Expert and that the expected devices have been attached ViFind32 is part of the Agilent IO Libraries Suite virtual instrument A name given to the grouping of software modules such as VISA resources with any associated or required hardware to give them the functionality of a traditional stand alone instrument Withi...

Page 142: ...VISA defined device and interface capabilities for direct low level instrument control VISA name The prefix of a VISA address also called the VISA interface ID The VISA name specifies the interface VISA resource manager The part of VISA that manages resources This management includes support for opening closing and finding resources setting attributes retrieving attributes and generating events on...

Page 143: ...Glossary Agilent VISA User s Guide 143 Windows notification area See notification area ...

Page 144: ...144 Agilent VISA User s Guide Glossary ...

Page 145: ...rogram 107 Opening a Device Session 121 Opening a Resource Session 32 Opening a Session 36 Printing Error Code 68 Reading a VISA Attribute 29 Receiving Data From a Session 41 Searching VXI Interface for Resources 39 SRQ Callback 60 Trigger Callback 58 Trigger Event Queuing 65 Using Non Formatted I O Functions 44 Using the Callback Method 54 Using the GPIB VXI Interface Low Level Memory Functions 9...

Page 146: ...ing high level memory functions 88 low level memory functions 94 resource manager 31 resource manager session 31 resources finding 37 locking 74 S sample code See also examples searching for resources 37 sessions device 31 opening 31 resource manager 31 SRQs 46 starting the resource manager 31 T timeout 32 65 trigger lines 115 triggers and events 46 U USB communicating with instruments using VISA ...

Reviews: