Download Print this page
Agilent Technologies U2300A Series Quick Reference Manual

Agilent Technologies U2300A Series Quick Reference Manual

Usb multifunction daq devices vee application program
Hide thumbs Also See for U2300A Series:

Advertisement

Quick Links

Agilent U2300A Series
USB Multifunction DAQ
Devices VEE Application
Program
Quick Reference Guide
Agilent Technologies

Advertisement

loading

Summary of Contents for Agilent Technologies U2300A Series

  • Page 1 Agilent U2300A Series USB Multifunction DAQ Devices VEE Application Program Quick Reference Guide Agilent Technologies...
  • Page 2 Safety Symbols The following symbols indicate the precautions taken to maintain safe operation of the instrument. Direct current Warning Regulatory Markings The CE mark shows that the product complies with all the relevant European Legal Directives (if accompanied by a year, it signifies when the design was proven).
  • Page 3 General Safety Information • Do not use the device if it is damaged. Before you use the device, WA R N I N G inspect the case. Look for cracks or missing plastic. Do not operate the device around explosive gas, vapor, or dust. •...
  • Page 4 Environmental Conditions This instrument is designed for indoor use and in an area with low condensation. The table below shows the general environmental requirements for this instrument. Environmental conditions Requirements Operating temperature 0 °C to 55 °C Operating humidity 15% to 85% at 40 °C RH (non-condensing) Storage temperature –20 °C to 70 °C The U2300A complies with the following safety and EMC requirements.
  • Page 5: Table Of Contents

    Contents Introduction Analog Input (U2300_AI.vee) Analog Output (U2300_AO.vee) Digital Input/Output (U2300_DIO.vee) Counter (U2300_CNT.vee) Temperature Monitoring Application (U2300_TempMonitor.vee) Simple Test Application (U2300 Auto Prog Tool.vee) Appendix U2300A Quick Reference Guide...
  • Page 6: Introduction

    Introduction This document will describe the functionality of each of the application. These applications consist of the following: 1 U2300_AI.vee — Analog input application 2 U2300_AO.vee — Analog output application 3 U2300_DIO.vee — Digital input/output application 4 U2300_CNT.vee — General purpose counter application 5 U2300_TempMonitor.vee —...
  • Page 7: Analog Input (U2300_Ai.vee)

    Analog Input (U2300_AI.vee) This is a standalone application that provides control over the analog input of the U2300A Series DAQ devices. The user can control up to a maximum of six units of DAQ within the cardcage or via any USB port. Users can monitor the input data on all the analog input channels.
  • Page 8 The main workspace is where all the main routine of the program is located. Once the program started, it will import the "kernel32.dll" file that will enable the program to read and write to initialize the files. It will then automatically detect any DAQ that is connected to the pc individually or in a cardcage.
  • Page 9 The detailed view of "InstrAutoDetect" is as shown below. It employs the "visa32.dll" to detect the DAQ that are connected to the pc. The program will then initialize all the program variables and establish communication with the instrument. It will obtain the serial and model number.
  • Page 10 Once it has established the connection, the "Analog Input Channel Settings" screen will appear. This will enable the user to select the type of monitoring they want to perform, whether it is continuous mode, single shot mode or polling mode. The program will ask for the sampling rate they want to read the data.
  • Page 11 The channel editor will show the channels available depending on the attached model. Users can select each channel and set the mode, signal type, polarity, range and also the polynomial factor to be used for that channel. The settings can be saved to a Windows configuration settings file or "ini"...
  • Page 12 The monitoring screen will display the channel status, whether it is set to differential, RSE or NRSE. The user may select to view the graph for the enabled channels. A maximum of six graphs can be shown on the screen at any one time.
  • Page 13 Channel status will show in bright red for the selected channels, dark red for the corresponding low- differential input and gray for disabled channels. U2300A Quick Reference Guide...
  • Page 14 A list of all the userfunctions in the "U2300_AI.vee" application is as given; Userfunction Description A_InitErrorRecord () Initializes the error handling variable record (loc_Error). Used for the functions that only sets the DAQ. A_InitOutputRecord () Initializes the error handling variable of 6 records (loc_Output). Used for the functions that queries the DAQ.
  • Page 15 INI_Write (File, Section, Keyword, Function that writes to "INI" file. Makes use of kernel32.dll IniString) InstrAutoDetect () Function that automatically detects any instrument that is connected to the pc via GPIB, USB or LAN interface. InstrInterfaceType (str) Function that distinguish between a GPIB or USB interface. InstSearch_MsgBox () Function that displays a message "Please wait…...
  • Page 16 U2300_RunUSB1~6 () Activate the U2300 "Run" function. U2300_ScanChan (Select, Chan) Sets the channels for scanning on selected DAQ. U2300_SetAnTrgCond (Select, Inp) Sets the analog trigger condition on selected DAQ. U2300_SetAnTrgHTrh (Select, Inp) Sets the analog trigger high threshold value on selected DAQ. U2300_SetAnTrgLTrh (Select, Inp) Sets the analog trigger low threshold value on selected DAQ.
  • Page 17: Analog Output (U2300_Ao.vee)

    Analog Output (U2300_AO.vee) This is a standalone application that provides control over the analog output of the U2300A Series DAQ devices. The user can control up to a maximum of six units of DAQ within the cardcage or via any USB ports. Users can output dc voltages, standard waveforms and user- defined waveforms for analog output channel 201 and 202.
  • Page 18 The main workspace is where all the main routine of the program is located. Once the program starts, it will import the "kernel32.dll" file that will enable the program to read and write to initialize the files. It then proceeds to automatically detect for any DAQ that is connected to the pc individually or in a cardcage.
  • Page 19 If no error is detected in the process, it will prompt the U2300_AO_Select dialog box for the user to select their choice of operation. “ DC Voltage" selection allows the user to simultaneously output voltage at channel 201 and 202 of any DAQ unit connected to the pc.
  • Page 20 The "Analog DC Manual" control is made up from multiple user objects running in their own thread. U2300A Quick Reference Guide...
  • Page 21 If we take a closer look at one of the channel control, we can observe that it will automatically update the voltage setting to a variable once the user turns the knob. U2300A Quick Reference Guide...
  • Page 22 Once the variable is set, it will translate the data over to the DAQ in the "Set Channel Voltages" user- object. U2300A Quick Reference Guide...
  • Page 23 "Waveform Generation" has an array of waveforms such as sine, square, sawtooth, triangle and noise. User can simultaneously output different waveforms with varying amplitude and offset level for both channels. However, the frequency is fixed for both channels for each DAQ. U2300A Quick Reference Guide...
  • Page 24 The "DC Step Generation" is a user- defined step voltage output. The user determines which channel to output the signal, the number of points and the step sequence. The application comes with a "Step Editor" that allows the user to configure the dc steps. There is a "Load Step" button to retrieve stored dc steps.
  • Page 25 The "Step Editor" can cater up to 100 steps. User can define the voltage level, the duration of each step and whether to set the voltage to 0 V once it finishes that step. A "–9999" on the voltage level represents a non- operational step, hence that step will be ignored.
  • Page 26 The "Configure Wave" button lets the user create an arbitrary waveform. Users can combine waveforms from two virtual waveform generators through a series of predefined formulas. Users also have to determine the time span and the number of points before running it. U2300A Quick Reference Guide...
  • Page 27 A list of all the userfunctions in the "U2300_AO.vee" application is as given; Userfunction Description A_InitErrorRecord () Initializes the error handling variable record (loc_Error). Used for the functions that only sets the DAQ. A_InitOutputRecord () Initializes the error handling variable of 6 records (loc_Output). Used for the functions that queries the DAQ.
  • Page 28 InstSearch_MsgBox () Function that displays a message "Please wait… Searching for instrument" Int_ExtractStepRec (iniFile) Internal function to extract the analog output steps from a given "ini" file. It formats the data to be displayed on the step editor. Load_Pattern () Function that loads the analog output pattern from a selected "ini"...
  • Page 29 U2300_GetModel () Get the model of the attached U2300. U2300_GetOutput () Query the U2300 for the output voltage. U2300_GetSerial () Get the serial number of the attached U2300. U2300_Init () Perform a "Reset" and "Clear" the event registry and error queues of the U2300.
  • Page 30: Digital Input/Output (U2300_Dio.vee)

    Digital Input/Output (U2300_DIO.vee) This is a standalone application that provides control over the digital port of the U2300A Series DAQ devices. The user can control up to a maximum of six units of DAQ within the cardcage or via any USB port. Users have control over four digital ports (Channel 501, 502, 503 and 504) and they can set it to be input or output.
  • Page 31 Once the DAQ selection is made, the program will initialize all the DAQ and get its model and serial number. On the "DIO Channel Setting" screen, users can set the direction of the digital ports, they can retrieve pre- saved digital output steps and activate them via output ports.
  • Page 32 Within the pattern editor, users can define the output pattern bitwise, the duration, number of times to repeat and whether to reset after each step. It can cater up to 100 steps and a "–1" on the duration or repeats represents a non- operational step, hence it will be ignored.
  • Page 33 For example, the "Ch501 Display" user- object referred here is to determine what to display based on the user's selection. U2300A Quick Reference Guide...
  • Page 34 The detailed view of "U2300_Ch501DO" shows the control of digital output for channel 501. U2300A Quick Reference Guide...
  • Page 35 U2300A Quick Reference Guide...
  • Page 36 A list of all the userfunctions in the "U2300_DIO.vee" application is as given; Userfunction Description A_InitErrorRecord () Initializes the error handling variable record (loc_Error). Used for the functions that only sets the DAQ. A_InitOutputRecord () Initializes the error handling variable of 6 records (loc_Output). Used for the functions that queries the DAQ.
  • Page 37 InstrAutoDetect () Function that automatically detects any instrument that is connected to the pc via GPIB, USB or LAN interface. InstrInterfaceType (str) Function that distinguish between a GPIB or USB interface. InstSearch_MsgBox () Function that displays a message "Please wait… Searching for instrument"...
  • Page 38 U2300_SetDir (Select, Ch, Dir) Configures the given channel for either input ("INP") or output ("OUTP") direction on the selected DAQ. U2300_SetDO (Select, Ch, Value) Sets the given channel (Ch) to output the state based on the integer value given on the selected DAQ. U2300A Quick Reference Guide...
  • Page 39: Counter (U2300_Cnt.vee)

    Counter (U2300_CNT.vee) The "U2300_CNT.vee" is a standalone application that provides control for the counter of the U2300A Series DAQ devices. The user can control up to a maximum of six units of DAQ within the cardcage or via any USB port. The application will automatically detect the DAQ when it is connected to the pc via USB port.
  • Page 40 U2300A Quick Reference Guide...
  • Page 41 The detailed view of the control is made up from several user- objects running in separate threads. The unit selection control allows the user to choose the DAQ unit they want to control. This will set the "loc_select" variable. Once there is a changed in this variable, the controls will be directed to that particular DAQ.
  • Page 42 U2300A Quick Reference Guide...
  • Page 43 Channel 301 counter settings are controlled by another user- object called "Ch301 controls". Within this user- object, it is running on an individual loop, it will update the variable and update the DAQ once there is a change in the setting.
  • Page 44 U2300A Quick Reference Guide...
  • Page 45 A list of all the userfunctions in the "U2300_CNT.vee" application is as given below. Userfunction Description A_InitErrorRecord () Initializes the error handling variable record (loc_Error). Used for the functions that only sets the DAQ. A_InitOutputRecord () Initializes the error handling variable of 6 records (loc_Output). Used for the functions that queries the DAQ.
  • Page 46 U2300_Cnt_Init () This function must be called first to establish communication with the U2300 unit. It obtains the model and serial number. U2300_Cnt_InitVar () This function initializes all the variables used in this program. U2300_Cnt_Manual () This function holds the main controls to the counter application. U2300_Cnt_Off (Select) Function to abort counter measurements on selected DAQ.
  • Page 47: Temperature Monitoring Application (U2300_Tempmonitor.vee)

    101 to channel 106. The polarity of these channels are fixed as bipolar and 10 V range. It can support any U2300A Series models. The DAQ can either be on a USB port or in a cardcage. However, the present program can only support one DAQ at a time.
  • Page 48 If no instrument is detected, it will give an error message and then terminate the program. The following action is used to initialize all the variables used in the program, start communicating with the instrument and obtain its model and serial number. It also determines the maximum sampling rate that is settable depending on model.
  • Page 49 When the temperature monitoring is activated, the user can see the above screen. User is able to view the six channels, set the analog output voltage, set the temperature coefficient factors, select the temperature sensor that is connected to each channel and activate the monitoring itself. Before any monitoring can be initiated, the channels have to be properly configured.
  • Page 50 "U2300_ScanChan (Select, Channels)", "U2300_SetSampRate (Select, Maximum Rate, Channels, Rate)" and "U2300_SetWavPoint (Select, No of Points)". The "Analog Output" button allows the user to set the output voltage for channel 201 and 202. It makes use of functions imported from "Simple U2300_AO.vee" like "U2300_SetVolt (Select, Volt, Channel)", "U2300_AO_Off (Select)"...
  • Page 51 Users can change the factor settings for the temperature sensor via the "Factor Settings" button. Currently the sensor factors that are programmed in are of LM19 and LM60 from National Semiconductor. Users can also determine the sensors that are connected to each respective channel. U2300A Quick Reference Guide...
  • Page 52 Functions that are used in getting the waveform, converting it from binary to decimal and applying the coefficient factors are "U2300_GetWavData (Select)", "U2300_TranslateData (Select, Chan#, Channel Position, Data)" and "U2300_ConvertData (Select, Data, Channel Position)" from the imported userfunctions from "Simple U2300_AI.vee". To start and stop the monitoring, the "U2300_RunUSB1 ()"...
  • Page 53: Simple Test Application (U2300 Auto Prog Tool.vee)

    Simple Test Application (U2300 Auto Prog Tool.vee) This application allows the user to test three devices via the analog input of the U2300A Series DAQ devices. The program also allows the user to control a SCPI- based power supply. The DAQ can either be on a USB port or in a cardcage.
  • Page 54 After that step, if no instruments can be detected, it will prompt the user to run in simulation mode or quit the program. Since the emphasis on this application is on the U2300A, the user can still proceed to use it even a programmable power supply is not present.
  • Page 55 The following object is used to start communicating with the instrument and obtain its model and serial number. It also determines the maximum sampling rate that is settable depending on model. The following step will request the user to select and configure the tests or proceed to test.
  • Page 56 Within the configuration screen, the user can determine the voltage and current setting of the power supply. They can also set the sequence of the tests and the limits. The "AutoTest" userobject uses a sequencer to handle all the tests and it passes the results to a userfunction called "Logging ()".
  • Page 57 Before any test starts, the "setup" routine is called to set up the power supply. When all the tests is completed, the "end" sequence will ensure that the power supply is switched off. The sequence of testing for DUT1 to DUT3 is determined by the user.
  • Page 58 All the test results are passed to a userfunction called "Logging ()". The "setup" routine calls the "T_Start ()" userfunction that prepares all the instruments for measurement. Within the "T_Start ()" userfunction, it calls upon the "PS_Setup ()" userfunction that setup the power supply. It also determines that if it is not operating in simulation mode, it will setup the DAQ for analog input in "Setup in measurement"...
  • Page 59 In the "PS_Setup ()" userfunction, the program determines which interface to use. In this case, only "GPIB" or "USB" based power supply is considered. If the power supply is other than the covered interfaces or without any interfaces, a message box will appear instructing the user what to do manually.
  • Page 60 U2300A Quick Reference Guide...
  • Page 61 Test function "T_DUT1 ()" checks if it is live mode before actually running the measurement, else it will generate a random number for the simulation mode. Inside the "DUT1 Test" object, it calls upon userfunctions from "Simple U2300_AI.vee" and "Simple U2300_DIO.vee". It will set digital channel "501"...
  • Page 62 Test functions "T_DUT2 ()" and "T_DUT3 ()" are similar to "T_DUT1 ()" except it controls different channels. "T_End ()" is called to complete the tests by switching off the power supply and resetting the digital output of the DAQ. U2300A Quick Reference Guide...
  • Page 63: Appendix

    Appendix User-Defined Functions/Libraries About UserFunctions Using a Library of Functions Creating UserFunctions for a Library About Compiled Functions About Remote Functions Agilent Technologies...
  • Page 64 User-Defined Functions/Libraries VEE provides 19 categories of built- in functions you can use in programs. When one of these built- in functions is not exactly right for your program, you can define your own function. This chapter describes how to create custom functions with/using UserFunctions.
  • Page 65 AppendixChapter About UserFunctions A UserFunction is specifically designed for creating a user- defined function. You create a UserFunction by selecting it from the Device menu or by converting existing objects or an existing UserObject into a UserFunction. This section describes how to create a UserFunction. The next section describes how to convert a UserObject into a UserFunction.
  • Page 66 Converting Between UserObjects and UserFunctions To convert a UserObject into a UserFunction, select Make UserFunction from the UserObject's object menu. The UserObject window is replaced by a UserFunction window with the same input and output terminals. The UserObject object is replaced by a UserFunction Call object. To reconvert the UserFunction back into a UserObject, select Make UserObject from the object menu of the UserFunction window.
  • Page 67 AppendixChapter Figure 1 Calling a UserFunction from Expressions In the program, the Call object calls the UserFunction noiseUF and returns a sine wave with an added noise component. The expression abs(noiseUF(Y)) in the first Formula object returns the absolute value of the waveform returned by the UserFunction.
  • Page 68 Using a Library of Functions Methods for creating each type of user- defined function and using it in a VEE program are similar. All these functions are called using the Call object or from certain expressions, such as in Sequencer or Formula objects. You can use any of the three kinds of user- defined functions in a library.
  • Page 69 AppendixChapter Creating a UserFunction Library So far we have looked at local UserFunctions that are created and used within the same program. You can also create a library of multiple UserFunctions stored externally and later imported into a program. To create a library of UserFunctions, create the UserFunctions in the empty VEE work area and save them to a file.
  • Page 70 Normally, the program should contain only UserFunctions. If other objects N O T E are in the program (e.g., in Main), they are ignored when the library is imported. If you use Declare Variable objects, put them in one of the UserFunctions, not in the Main window of the library.
  • Page 71 AppendixChapter The Library Name field specifies a local name for the library within the program. This makes it possible for the Delete Library object to delete the library from the program. In this case, Import Library attaches the name myLib to the library imported from the file user_func_lib.
  • Page 72 About Compiled Functions A Compiled Function is created by dynamically linking a library written in C, C++, FORTRAN, or Pascal, to the VEE process. A library of compiled functions is called a dynamic link library (DLL) in Microsoft Windows. Creating a Compiled Function is considerably more difficult than creating a UserFunction.
  • Page 73 AppendixChapter Because Compiled Functions do not timeslice (i.e., they execute until they are done without interruption) they are only useful for specific purposes that are not otherwise available in VEE. You can extend the capabilities of your VEE program by using Compiled Functions, but it adds complexity to the VEE process.
  • Page 74 • If your external routine accepts arrays, it must have a valid pointer for the type of data it will examine. The routine also must check the size of the array on which it is working. The best way to do this is to pass the size of the array from VEE as an input to the routine, separate from the array itself.
  • Page 75 AppendixChapter Just as for a UserFunction, the Library Name field attaches a name to identify the library within the program, and the File Name field specifies the file from which to import the library. For a Compiled Function, there is a fourth field, which specifies the name of the Definition File, shown in Figure 4.
  • Page 76 Select the desired function using Select Function from the Call object menu or from the Function & Object Browser (under Device ⇒ Function & Object Browser), or type the name in the Call object. If VEE recognizes the function, the input and output terminals of the Call object are configured automatically for the function.
  • Page 77 AppendixChapter • <function name> can be a string consisting of an alpha character followed by alphanumeric characters, up to a total of 512 characters. • <type> can be: int, short, long, float, double, int*, char*, short*, long*, float*, double*, char**, or void. •...
  • Page 78 VEE allows both "enclosed" comments and "to- end- of- line" comments in the definition file. "Enclosed" comments use the delimiter sequence /*comments*/, where /* and */ mark the beginning and end of the comment, respectively. "To- end- of- line" comments use the delimiting characters // to indicate the beginning of a comment that runs to the end of the current line.
  • Page 79 AppendixChapter passed in"; DLLEXPORT long myFunc(long arraySize, double *array) { long i; for (i = 0; i < arraySize; i++, array++) { *array += 1.0; } return(arraySize); The definition file for this function is as follows: definition file for manual49.c long myFunc(long arraySize, double *array);...
  • Page 80 One variable in the C function (and correspondingly, one data input terminal in the Call object) is used to indicate the size of the array. The arraySize variable is used to prevent data from being written beyond the end of the array.
  • Page 81 AppendixChapter Figure 6 Program Calling a Compiled Function The example in Figure 6 is saved in the file manual49.vee in the examples directory. The C file is saved as manual49.c, the definition file as manual49.h and the shared library as manual49.sl.
  • Page 82 Creating the DLL Create the DLL before writing the VEE program. Create the DLL as you would any other DLL, except that only a subset of C types are allowed. (See “Creating the Definition File” page 78.) Declaring DLL Functions If you are using Microsoft Visual C++ Version 2.0 or greater, the function definition should be: __declspec(dllexport) long myFunc (...);...
  • Page 83 AppendixChapter <return type> <modifier> <function name> (<type> <paramname>, <type> <paramname>, ...) ; where: • <return type> can be: int, short, long, float, double, char*, or void. • <function name> can be a string consisting of an alpha character followed by alphanumeric characters, up to a total of 512 characters.
  • Page 84 uses four bytes, a double uses eight bytes and a pointer uses four bytes. For example, a function could have 36 longs, or 18 doubles, or 20 pointers and 8 doubles. The Import Library Object Before you can use a Call object or Formula box to execute a DLL function you must import the function into the VEE environment via the Import Library object.
  • Page 85 AppendixChapter 3 Enter the correct DLL function name in the Function Name field. For example, for a DLL function defined as long foo(double *x, double y, long *z); you need three input terminals for x, y, and z and three output terminals, one for the return value and two for x and z.
  • Page 86 About Remote Functions A Remote Function is a UserFunction that runs in another VEE process on a remote host computer. Remote Functions are a special case of UserFunction. See “About UserFunctions” on page 61 for general information that applies to UserFunctions. Using Remote Functions The Remote Function is called from the local VEE process over the LAN.
  • Page 87 AppendixChapter Figure 7 Import Library for Remote Functions The Library Type and Library Name fields function the same as for UserFunctions and Compiled Functions. The other fields are as follows: • Remote Host Name - The name of the host on which the "service"...
  • Page 88 The remote VEE service invoked by the client is dependent on the Host N O T E Name specified in the Import Library object. If you have two Import Library objects using the same Host Name, only one service process is invoked. Even if two different Library Names and Remote File Names are used, each communicates with the same service.
  • Page 89 AppendixChapter The service VEE process can exist on the same computer or "host" as the client or on another host as long as there is a network connection between them. The most common connection is between two hosts on a LAN. However, if a network path exists, the two hosts could be a continent apart.
  • Page 90 To automate the VEE Service Manager startup: 1 Create a shortcut to veesm.exe 2 Select Start ⇒ Programs 3 Move the shortcut to the Startup folder. U2300A Quick Reference Guide...
  • Page 91 Or visit Agilent worlwide web at: www.agilent.com/find/assist Product specifications and descriptions in this document are subject to change without notice. Always refer to Agilent Web site for the latest revision. © Agilent Technologies, Inc. 2007, 2008 Printed in Malaysia July 21, 2008 U2351-90701 Agilent Technologies...