background image

©

 National Instruments Corporation

G-1

Measurement Studio User Manual

Glossary

A

ActiveX

Set of Microsoft technologies for reusable software components. Formerly 
called OLE.

ActiveX control

Reusable software component that adds functionality to any ActiveX 
control container through exposed properties, methods, and events. The 
Measurement Studio data acquisition, user interface, and analysis controls 
are examples of ActiveX controls.

ActiveX control 
container

Development environment that fully supports ActiveX controls and 
integrates them into its own environment using COM. An ActiveX control 
container enables you to specify how ActiveX controls interact with the 
environment through environment properties. Visual Basic is an example of 
an ActiveX control container.

analog I/O

Reading or writing data in continuously variable physical quantities, such 
as voltage or current.

annotate

Adding text, arrows, or shapes to describe or highlight a point or region on 
a graph.

ANSI C

C programming language defined by the American National Standards 
Institute.

API

Application Programming Interface. A specification of software functions 
and their input and return parameters.

array control

An array of Measurement Studio user interface controls that behave as a 
single unit.

assembly

A collection of one or more files that are versioned and deployed as a unit. 
An assembly is the primary building block of a .NET Framework 
application. All managed types and resources are contained within an 
assembly and are marked either as accessible only within the assembly or 
as accessible from code in other assemblies.

asynchronous

Function that begins an operation and returns control to the program prior 
to the completion or termination of the operation.

Summary of Contents for none

Page 1: ...Measurement Studio TM User Manual Subtitle Measurement Studio User Manual April 2008 373392C 01 ...

Page 2: ...Lebanon 961 0 1 33 28 28 Malaysia 1800 887710 Mexico 01 800 010 0793 Netherlands 31 0 348 433 466 New Zealand 0800 553 322 Norway 47 0 66 90 76 60 Poland 48 22 3390150 Portugal 351 210 311 210 Russia 7 495 783 6851 Singapore 1800 226 5886 Slovenia 386 3 425 42 00 South Africa 27 0 11 805 8197 Spain 34 91 640 0085 Sweden 46 0 8 587 895 00 Switzerland 41 56 2005151 Taiwan 886 02 2377 2222 Thailand 6...

Page 3: ...respects the intellectual property of others and we ask our users to do the same NI software is protected by copyright and other intellectual property laws Where NI software may be used to reproduce software or other materials belonging to others you may use NI software only to reproduce materials that you may reproduce in accordance with the terms of any applicable license or other legal restrict...

Page 4: ...ement Studio over Previous Versions of Measurement Studio 1 6 Measurement Studio Package Comparison Chart 1 6 Learning Measurement Studio 1 9 Chapter 2 Measurement Studio NET Class Libraries Measurement Studio Support for Visual Studio NET Class Library Overview 2 1 Analysis 2 2 Standard Analysis 2 2 Professional Analysis 2 2 Enterprise Analysis 2 3 Common 2 13 Data Transfer 2 14 Network Variable ...

Page 5: ...c Controls 2 44 Numeric Edit Control 2 47 Switch and LED Controls 2 48 AutoRefresh Control 2 49 AutoRefresh Callback 2 49 Chapter 3 Measurement Studio Visual C Class Libraries Measurement Studio Visual C Class Library Overview 3 1 ActiveX Controls in Visual C 3 2 3D Graph Control 3 2 Plot Operations 3 3 Additional Operations 3 3 Analysis 3 3 Standard Analysis 3 4 Professional Analysis 3 4 Enterpri...

Page 6: ...ment Studio Parameter Value 4 11 Using the Instrument Driver Wizard 4 12 Chapter 5 Getting Started with Measurement Studio Measurement Studio Walkthroughs 5 1 Walkthrough Creating a Measurement Studio Application with Windows Forms Controls and Analysis 5 2 Walkthrough Creating a Measurement Studio Application with Web Forms Controls and Analysis 5 11 Walkthrough Creating a Measurement Studio Appl...

Page 7: ...ual Studio 2005 and Visual Studio 2008 For help with Visual Studio 6 0 refer to the Measurement Studio Support for Visual Studio 6 0 Readme located on the Measurement Studio for Visual Studio 6 0 CD The Measurement Studio User Manual is organized into five chapters Chapter 1 Introduction to Measurement Studio is an overview of Measurement Studio This chapter includes installation and deployment re...

Page 8: ...wn the File menu select the Page Setup item and select Options from the last dialog box This icon denotes a tip which alerts you to advisory information This icon denotes a note which alerts you to important information bold Bold text denotes items that you must select or click on in the software such as menu items and dialog box options Bold text also denotes class library member names or emphasi...

Page 9: ...s include two Visual Studio support CDs one CD with support for Visual Studio NET 2003 Visual Studio 2005 and Visual Studio 2008 and one CD with support for Visual Studio 6 0 The Measurement Studio 8 5 Standard package includes one CD with support for Visual Studio NET 2003 Visual Studio 2005 and Visual Studio 2008 Visual Studio 6 0 support includes ActiveX controls for use in Visual Basic 6 0 and...

Page 10: ... XP 2000 for Visual Studio 2005 or Microsoft Windows Vista XP for Visual Studio 2008 Note If you have Windows Vista installed you must also have both Visual Studio 2005 Service Pack 1 and Visual Studio Service Pack 1 Update for Windows Vista installed on your machine for Measurement Studio to function properly Microsoft NET Framework 2 0 for Visual Studio 2005 or Microsoft NET Framework 3 5 for Vi...

Page 11: ... and Updates on ni com and enter Device Drivers into the search field to download the latest version of the NI Device Drivers CD Deployment Requirements To deploy an application built with Measurement Studio NET class libraries the target computer must have a Windows Vista XP 2000 operating system and the NET Framework version 2 0 for Visual Studio 2005 or the NET Framework version 3 5 for Visual ...

Page 12: ...io features Complete the following steps to install Measurement Studio 1 Log on as an administrator or as a user with administrator privileges 2 Launch Autorun exe either from the installation CD or from the location to which you extracted the downloaded CD image 3 Select the version of Visual Studio you want to install support for 4 Follow the instructions that appear on the screen Note If you wa...

Page 13: ... VS2008 DotNET IIOAssistant Support feature 2 In the NI Device Drivers installer enable the Instrument Control NI VISA feature To install support for NI 488 2 1 In the NI Measurement Studio 8 5 installer enable the VS2008 Driver Support NET Framework 3 5 Languages Support for NI 488 2 feature 2 In the NI Device Drivers installer enable the Instrument Control NI 488 2 feature To install support for...

Page 14: ...Studio installed the newer version installer replaces the prior version functionality including class libraries However the prior version assemblies remain in the global assembly cache GAC therefore applications that reference the prior version continue to use the prior version NET assemblies Note This does not apply to NationalInstruments Common dll NationalInstruments Common dll uses a publisher...

Page 15: ...ition Project Wizards Windows Forms User Interface Controls Standard Analysis Libraries1 NI 488 2 Class Libraries2 NI VISA Class Libraries2 NI DAQmx Class Libraries2 NET Instrument Driver Wizard User Interface DataSocket Binding Web Forms User Interface Controls MFC and ActiveX Controls for Visual C 6 0 Professional Analysis Libraries3 3D Graph ActiveX Control User Interface Network Variable Bindi...

Page 16: ...y included in the Standard Analysis class library 2 Included with the Device Drivers CD 3 Refer to the Professional Analysis section of Chapter 2 Measurement Studio NET Class Libraries for a list of the functionality included in the Professional Analysis class library 4 Refer to the Enterprise Analysis section of Chapter 2 Measurement Studio NET Class Libraries for a list of the functionality incl...

Page 17: ...ect Help Contents to view the Visual Studio table of contents The NI Measurement Studio Help is listed in the table of contents From Visual Studio select Measurement Studio NI Measurement Studio Help The help launches within the application Tip As you work through this manual you will see italicized references to relevant help topics To find these topics use the table of contents in the NI Measure...

Page 18: ... and evaluation software NI Developer Zone zone ni com Provides access to online example programs tutorials technical news and a Measurement Studio Discussion Forum where you can participate in discussion forums for Visual Basic 6 0 Visual C and NET Languages Measurement Studio NET Class Hierarchy Chart and Measurement Studio Visual C Class Hierarchy Chart Provide overviews of class relationships ...

Page 19: ...s Refer to Chapter 5 Getting Started with Measurement Studio for step by step instructions on developing applications with these libraries Measurement Studio Support for Visual Studio NET Class Library Overview Measurement Studio provides NET class libraries that you can use to develop complete measurement and automation applications in Visual Basic NET and Visual C Measurement Studio includes the...

Page 20: ...is The Standard Analysis class library which ships with Measurement Studio Standard Edition includes the sawtooth sine square triangle and basic function wave generators Professional Analysis The Professional Analysis class library which ships with Measurement Studio Professional Edition includes the Standard Analysis functionality as well as the following functionality Bessel Chebyshev Inverse Ch...

Page 21: ...pulse ramp and chirp patterns General least square curve fit power fit log fit Gauss fit cubic spline fit and interpolation functions Measurement functions such as transition measurements pulse measurements and cycle RMS average functions Special functions Refer to Table 2 1 to determine the type of measurements available in the Professional and Enterprise Analysis NET libraries Table 2 1 Analysis...

Page 22: ...nsition Measurements Signal Generation Arbitrary Wave Chirp Pattern Gaussian White Noise Impulse Pattern Pulse Pattern Ramp Pattern Sawtooth Wave Sinc Pattern Sine Pattern Sine Wave Square Wave Triangle Wave Uniform White Noise Windowing Blackman Window Blackman Harris Window Table 2 1 Analysis NET Library Measurement Types included in the Professional and Enterprise Packages Continued Analysis NE...

Page 23: ...p Window Force Window Gauss Window General Cosine Window Hamming Window Hanning Window Kaiser Bessel Window Scaled Time Domain Windows Symmetric Time Domain Windows Triangle Window Filters Bessel Butterworth Cascade Chebyshev Elliptic Equiripple FIR FIR Windowed Table 2 1 Analysis NET Library Measurement Types included in the Professional and Enterprise Packages Continued Analysis NET Library Prof...

Page 24: ... Cosine Transform Discrete Sine Transform Fast Hilbert Transform Fast Hartley Transform Integral x t Inverse Real and Complex Fast Fourier Transform FFT Inverse Fast Hilbert Transform Inverse Fast Hartley Transform Peak Detection Power Spectrum Pulse Parameters Real and Complex FFT Table 2 1 Analysis NET Library Measurement Types included in the Professional and Enterprise Packages Continued Analy...

Page 25: ...zation Complex Determinant Complex Dot Product Complex Eigen Vectors and Eigen Values Complex General Eigen AB Complex Hessenberg Decomposition Complex Inverse Matrix Complex Linear Equations Complex LU Factorization Complex Matrix Balance Complex Matrix Condition Number Complex Matrix Norm Complex Matrix Rank Complex Outer Product Table 2 1 Analysis NET Library Measurement Types included in the P...

Page 26: ...Linear Equations Multiple Right Hand Complex Solve Linear Equations Single Right Hand Complex SVD Factorization Complex Vector Norm Determinant Dot Product Forward Substitution General Eigen AB Hessenberg Decomposition Inverse Matrix Linear Equations LU Factorization Matrix Balance Matrix Condition Number Matrix Multiplication Table 2 1 Analysis NET Library Measurement Types included in the Profes...

Page 27: ...n Solve Linear Equations Multiple Right Hand Solve Linear Equations Single Right Hand Special Matrix SVD Factorization Test Positive Definite Matrix Trace Transpose Array and Numeric Operations 1D and 2D Array Arithmetic 1D and 2D Linear Evaluation 1D and 2D Polynomial Evaluation 1D Polar to Rectangular 1D Rectangular to Polar Table 2 1 Analysis NET Library Measurement Types included in the Profes...

Page 28: ...nterval General Least Squares Linear Fit General Polynomial Fit Goodness of Fit Linear Fit Linear Fit Interval Logarithm Fit Logarithm Fit Interval Nonlinear Fit Power Fit Power Fit Interval Remove Outliers Statistics 1D 2D and 3D ANOVA Chi Square Distribution erf x and erfc x Table 2 1 Analysis NET Library Measurement Types included in the Professional and Enterprise Packages Continued Analysis N...

Page 29: ...n Mean Median and Mode Moment about Mean Normal Distribution Polynomial Interpolation Root Mean Square RMS Spline Interpolant Spline Interpolation Standard Deviation T Distribution Variance Special Functions Airy Bessel 1st Bessel 2nd Beta Complimentary Gamma Cosine Integral Table 2 1 Analysis NET Library Measurement Types included in the Professional and Enterprise Packages Continued Analysis NET...

Page 30: ...Integral Hyperbolic Sine Integral Incomplete Beta Incomplete Elliptic 1st Incomplete Elliptic 2nd Incomplete Gamma Jacobian Elliptic Function Kelvin 1st Kelvin 2nd Kummer Logarithm of Factorial Modified Bessel 1st Modified Bessel 2nd Parabolic Cylinder Psi Sine Integral Table 2 1 Analysis NET Library Measurement Types included in the Professional and Enterprise Packages Continued Analysis NET Libr...

Page 31: ...your application The Common class library includes the following features A ComplexDouble data type This data type represents a complex number of type Double that is composed of a real part and an imaginary part A DigitalWaveform data type This data type represents a set of digital states that are grouped by samples or signals A ComplexWaveform data type This data type represents an analog signal ...

Page 32: ... NetworkVariable or DataSocket to exchange different types of data between Measurement Studio LabVIEW LabWindows CVI and other applications that support NI Publish Subscribe Protocol psp NetworkVariable is the preferred method for transferring data between these applications and in these cases NetworkVariable supersedes DataSocket You can also use NetworkVariable and DataSocket to exchange differe...

Page 33: ...ariables and processes Use the NationalInstruments NetworkVariable ServerProcess NationalInstruments NetworkVariable ServerProcessInfo NationalInstruments NetworkVariable ServerVariable and NationalInstruments NetworkVariable ServerVariableInfo classes to explicitly create network variables Use the Network Variable Browser dialog box to quickly locate and select data items on other computers and s...

Page 34: ...The NI 488 2 driver is available at ni com downloads The NI 488 2 class library includes a set of classes for communicating with GPIB instruments controlling GPIB devices and acquiring GPIB status information Use this library to design code that communicates with and controls instruments on a GPIB interface Use the NI 488 2 class library to configure and communicate with GPIB devices using the Dev...

Page 35: ...SCOPE components programmatically and at design time Tip For further information on NI SCOPE NET driver support and to download the NI SCOPE NET class libraries refer to NI SCOPE NET Driver Support at NI Developer Zone ni com devzone NI VISA The Measurement Studio NI VISA NET class library is in the NationalInstruments VisaNS namespace This class library is included when you install the NI VISA dr...

Page 36: ...plication in Chapter 5 Getting Started with Measurement Studio For more information about NI VISA visit ni com visa User Interface The Measurement Studio user interface controls are in the Windows Forms and Web Forms NET class libraries The following sections list the functionality included with the Measurement Studio Windows Forms and Web Forms controls Refer to Table 2 2 for the UI controls prov...

Page 37: ...brary encapsulates the following Measurement Studio user interface controls Waveform graph Scatter graph Digital waveform graph Complex graph Legend Knob Gauge Meter Slide Thermometer Tank Numeric edit Switch LED Property editor Array controls Numeric edit Switch LED Property editor Array controls AutoRefresh control InstrumentControlStrip control Table 2 2 Measurement Studio User Interface Contro...

Page 38: ...Windows Forms NET Controls section in the NI Measurement Studio Help Waveform Graph and Scatter Graph Controls Use the Measurement Studio waveform graph and scatter graph controls as shown in Figure 2 1 to display two dimensional data on a Windows Forms user interface Use the waveform graph to display two dimensional linear data You explicitly specify each value in one dimension and provide an ini...

Page 39: ...ible plot and plot area drawing capabilities and events to customize the graph appearance Use plot data tooltips to display X and Y coordinates when a user hovers the mouse over a data point Create custom point and line styles for plots Specify anti aliased plots for plot lines Calculate and display error bands Axis Operations Configure a graph to include multiple axes or independent ranges so tha...

Page 40: ...sor to previous or next position or to a specified coordinate Annotation Operations Configure text labels arrows and drawing shapes to annotate a point anywhere in the plot area of the graph Configure range area text labels and arrows to annotate a range in the plot area of the graph Show tooltips configured to display data or other custom text Additional Operations Pan and zoom interactively as w...

Page 41: ...ital Graph Windows Forms Control With the digital waveform graph control and the classes that interface with the control you can perform the following operations Plot Operations Plot digital waveform data Data values can represent up to eight different digital states Configure plot labels on the y axis Configure plot templates to customize plots that are implicitly created from plotted data Specif...

Page 42: ...me by clicking on the axis end labels Display captions on the axis Display grid lines Position the axis to display on one or both sides of the graph s plot area Configure major minor and custom divisions Additional Operations Display data in sample or time mode Perform hit testing of mouse cursor coordinates Pan with scroll bars Configure the style and mode of scroll bars Create custom scroll bars...

Page 43: ...plex graph control and the classes that interface with the control you can perform the following operations Plot Operations Plot and chart ComplexDouble data Configure a graph to contain multiple plots to show separate but related data on the same graph Draw lines or fills from a plot to an X value Y value or another plot Use the extensible plot and plot area drawing capabilities and events to cus...

Page 44: ...Cursor Operations Use cursors to identify key points in plots and the plot area Configure cursor snap modes to be fixed floating nearest point or to plot Use cursor labels to display X and Y data coordinates that the cursor crosshair points to and customize the text font and colors of the label Create custom point and line styles for cursors Configure the graph to display cursors that are used to ...

Page 45: ... reflected in the legend Tip For more information about using the legend control refer to the Using the Measurement Studio Windows Forms Legend NET Control section in the NI Measurement Studio Help Numeric Controls Use the Measurement Studio numeric controls to display numerical information on a Windows Forms user interface with the look of scientific instruments The numeric controls include a kno...

Page 46: ...atically move the pointer to previous or next value Perform hit testing of mouse cursor coordinates Specify the image format of the control as BMP GIF JPEG or PNG Use the Measurement Studio knob gauge and meter controls as shown in Figure 2 4 to input and display numeric data on your user interface Figure 2 4 Knob Gauge and Meter Windows Forms Controls With the knob gauge and meter controls and th...

Page 47: ... the scale horizontally with left right or both and position the scale vertically with top bottom or both Tip For more information about using the Windows Forms knob gauge meter slide tank or thermometer controls refer to the Knob Gauge Meter Slide Tank or Thermometer Class sections in the NI Measurement Studio Help Numeric Edit Control Use the Measurement Studio numeric edit control as shown in F...

Page 48: ...a Measurement Studio numeric control so that if you change the value of one control it changes the value of the other control Set the coercion mode property to discrete or continuous values This property configures the control to allow entry or display of either a discrete set of values or any value Set the interaction mode to keyboard and mouse keyboard only mouse only or none Tip For more inform...

Page 49: ...he following operations Receive notification before or after the state of the control changes Configure how the control behaves when you click it with the mouse or press the spacebar when the control has focus Configure the appearance of the control Make the control background transparent Configure the LED control to blink while it is on or off and configure the rate at which the LED control blink...

Page 50: ...lasses that interface with the control you can perform the following operations Edit any NET type at run time including collections Edit expandable properties that represent nested properties of another object such as major divisions of an axis Display custom editors and type converters for properties Connect to a Windows Forms control so that if you change the value of a property of the control t...

Page 51: ...Switch and LED Array Controls Use the Measurement Studio switch and LED array controls as an array of Boolean controls on a Windows Forms user interface You typically use a switch array control as shown in Figure 2 10 to control ports of a digital line or values of an array You typically use an LED array control as shown in Figure 2 10 to visualize ports of a digital line or values of an array Fig...

Page 52: ...l and visualize values of an array of double values With the numeric edit array control and the classes that interface with the control you can perform the following operations Figure 2 11 Numeric Edit Array control Set values by passing an array of data Modify the number of controls displayed based on the length of the array of values you specify Use up and down buttons for easy incrementing and ...

Page 53: ...he numeric edit array control refer to the Using the Measurement Studio Control Array NET Controls topic in the NI Measurement Studio Help InstrumentControlStrip Control You can use the InstrumentControlStrip control as a toolbar for editing property values of another control through the associated editors at run time For example you can populate the InstrumentControlStrip with ToolStripPropertyEd...

Page 54: ...dio User Manual 2 36 ni com Figure 2 12 InstrumentControlStrip Control Tip For more information about the InstrumentControlStrip control refer to Using the Measurement Studio Windows Forms Instrument Control Strip NET Control topic in the NI Measurement Studio Help ...

Page 55: ...Complex graph Legend Knob Gauge Meter Slide Thermometer Tank Numeric edit Switch LED AutoRefresh Note All Measurement Studio ASP NET Web Forms controls for Visual Studio 2008 are designed to work with ASP NET AJAX controls The Measurement Studio ASP NET Web Forms controls for Visual Studio 2005 are not designed to work with Microsoft ASP NET AJAX controls Use this class library to add measurement ...

Page 56: ...l to implicitly specify the values in the other dimension Use the scatter graph to display two dimensional linear or nonlinear data you explicitly specify each value in both dimensions Figure 2 13 Waveform Graph and Scatter Graph Web Forms Controls Both Graphs Have Corresponding Legends With the waveform graph and scatter graph controls and the classes that interface with the controls you can perf...

Page 57: ...he visible data only strip chart or scope chart Use logarithmic axes with configurable bases Interactively change the range of an axis and invert the axis at run time by clicking on the axis end labels Configure major minor and custom divisions and origin lines Cursor Operations Use cursors to identify key points in plots and the plot area Configure cursor snap modes to be floating nearest point o...

Page 58: ... more information about using the waveform and scatter graph controls refer to the Using the Measurement Studio Web Forms Scatter and Waveform Graph NET Controls section in the NI Measurement Studio Help Digital Waveform Graph Control Use the Measurement Studio digital waveform graph control as shown in Figure 2 14 to display DigitalWaveform data in an ASP NET Web application Figure 2 14 Digital W...

Page 59: ...s Simultaneously display waveforms and signals or display signals only Create custom waveform sample and signal state styles Configure the appearance of sample and state labels Create custom waveform sample and signal state labels Axis Operations Configure the axis modes to fixed exact autoscaling or loose autoscaling Interactively change the range of an axis and invert the axis at run time by cli...

Page 60: ...s of a real part and an imaginary part You can use a waveform graph to plot complex waveform data Figure 2 15 Complex Graph Web Forms Control With the complex graph control and the classes that interface with the control you can perform the following operations Plot Operations Plot and chart ComplexDouble data Configure a graph to contain multiple plots to show separate but related data on the sam...

Page 61: ...d lines Position the axis to display on one or both sides of the graph s plot area Configure major minor and custom divisions and origin lines Cursor Operations Use cursors to identify key points in plots and the plot area Configure cursor snap modes to be floating nearest point or to plot Use cursor labels to display real imaginary magnitude or phase data that the cursor crosshair points to and c...

Page 62: ... the legend control with the plots of a graph any changes you make in the plots collection editor are automatically reflected in the legend Tip For more information about using the legend control refer to the Using the Measurement Studio Web Forms Legend NET Control section in the NI Measurement Studio Help Numeric Controls Use the Measurement Studio numeric controls to display numerical informati...

Page 63: ...s Display tooltips reflecting the current value of the pointer Interactively change the value of the control by clicking the pointer with the mouse Programmatically move the pointer to previous or next value Use the Measurement Studio knob gauge and meter controls as shown in Figure 2 16 to input and display numeric data on your user interface Figure 2 16 Knob Gauge and Meter Web Forms Controls Wi...

Page 64: ... the slide tank and thermometer controls and the classes that interface with them you can perform the following operations Fill to the minimum or maximum value of the scale Position the scale horizontally with left right or both and position the scale vertically with top bottom or both Tip For more information about using the Web Forms knob gauge meter slide tank or thermometer controls refer to t...

Page 65: ...lue to negative infinity and the maximum range value to positive infinity Create custom formats or use built in numeric formats including generic engineering and simple double You can use these numeric formats with other Measurement Studio user interface controls such as the waveform graph and numeric pointer controls Connect to a Measurement Studio numeric control so that if you change the value ...

Page 66: ...eb Forms Control in Vertical Toggle 3D Style and LED Web Forms Control in Square 3D Style With the switch and LED controls and the classes that interface with the controls you can perform the following operations Receive notification before or after the state of the control changes Specify the image format of the control as BMP GIF JPEG or PNG Configure the appearance of the control Configure the ...

Page 67: ...oup For down level browsers the controls update when the page posts back to the server If the client browser supports client callbacks the client side script rendered by the AutoRefresh control uses a client callback to update the associated controls on the client without posting the page back to the server Note The AutoRefresh control is designed to work with the ASP NET AJAX UpdatePanel and Time...

Page 68: ...Libraries section of the NI Measurement Studio Help for detailed information about these libraries Note Measurement Studio 8 5 support for Visual Studio 2008 does not include Visual C class libraries Measurement Studio Visual C Class Library Overview Measurement Studio provides libraries of MFC based classes that you can use to develop complete measurement and automation applications in Visual C M...

Page 69: ... ActiveX graph control The Measurement Studio classes that provide interfaces to the Measurement Studio ActiveX controls simplify using ActiveX controls in Visual C interfaces and programs The features that simplify this process include overloaded functions the ability to call the control from any thread and automatic data type translations 3D Graph Control Use the Measurement Studio ActiveX 3D gr...

Page 70: ...ate systems Customize the control using color maps transparency and lighting Display in orthographic and perspective views Use built in format styles for labels including scientific symbolic engineering scaling time and date Rotate pan and zoom interactively Tip For information about easily creating graphs with the 3D graph control library refer to the 3D Graph Visual C Class Library Overview topi...

Page 71: ... Inverse DST DCT and Inverse DCT transformations Linear algebra functions such as determinant check positive definiteness calculate dot product and other various matrix methods Scaled and unscaled windowing classes Common statistical functions such as mean median mode and variance Exponential linear and polynomial curve fitting functions Signal generation functions Enterprise Analysis The Enterpri...

Page 72: ...ise Packages Analysis Visual C Library Professional Package Enterprise Package Measurements AC and DC Estimator Amplitude and Phase Spectrum Auto Power Spectrum Cross Power Spectrum Harmonic Analyzer Impulse Response Function Network Functions avg Power and Frequency Estimate Scaled Time Domain Window Spectrum Unit Conversion Transfer Function Signal Generation Arbitrary Wave Chirp Wave Gaussian W...

Page 73: ...kman Window Exponential Window Flat Top Window Force Window Gauss Window General Cosine Window Hamming Window Hanning Window Kaiser Bessel Window Scaled Time Domain Windows Symmetric Time Domain Windows Triangle Window Filters Bessel Butterworth Table 3 1 Analysis Visual C Library Measurement Types Included in the Professional and Enterprise Packages Continued Analysis Visual C Library Professiona...

Page 74: ...tion Cross Power Cross Correlation Decimate Deconvolution Derivative x t Discrete Cosine Transform Discrete Sine Transform Fast Hilbert Transform Fast Hartley Transform Integral x t Inverse Real and Complex Fast Fourier Transform FFT Table 3 1 Analysis Visual C Library Measurement Types Included in the Professional and Enterprise Packages Continued Analysis Visual C Library Professional Package En...

Page 75: ...actorization Complex Back Transform Eigen Vectors Complex Cholesky Factorization Complex Determinant Complex Dot Product Complex Eigen Vectors and Eigen Values Complex General Eigen AB Complex Hessenberg Decomposition Complex Inverse Matrix Complex Linear Equations Complex LU Factorization Complex Matrix Balance Table 3 1 Analysis Visual C Library Measurement Types Included in the Professional and...

Page 76: ...th Pivot Vector Complex QZ Decomposition Complex Schur Decomposition Complex Solve Linear Equations Multiple Right Hand Complex Solve Linear Equations Single Right Hand Complex SVD Factorization Complex Vector Norm Determinant Dot Product Forward Substitution General Eigen AB Hessenberg Decomposition Inverse Matrix Table 3 1 Analysis Visual C Library Measurement Types Included in the Professional ...

Page 77: ...torization with Pivot Vector QZ Decomposition Schur Decomposition Solve Linear Equations Multiple Right Hand Solve Linear Equations Single Right Hand Special Matrix SVD Factorization Test Positive Definite Matrix Trace Transpose Array and Numeric Operations 1D and 2D Array Arithmetic Table 3 1 Analysis Visual C Library Measurement Types Included in the Professional and Enterprise Packages Continue...

Page 78: ...Cubic Spline Fit Exponential Fit Exponential Fit Interval Gauss Fit Gauss Fit Interval General Least Squares Linear Fit General Polynomial Fit Goodness of Fit Linear Fit Linear Fit Interval Logarithm Fit Logarithm Fit Interval Nonlinear Fit Polynomial Fit Power Fit Power Fit Interval Table 3 1 Analysis Visual C Library Measurement Types Included in the Professional and Enterprise Packages Continue...

Page 79: ...mal Distribution Inverse T Distribution Mean Median and Mode Moment about Mean Normal Distribution Polynomial Interpolation Root Mean Square RMS Spline Interpolant Spline Interpolation Standard Deviation T Distribution Variance Special Functions Airy Table 3 1 Analysis Visual C Library Measurement Types Included in the Professional and Enterprise Packages Continued Analysis Visual C Library Profes...

Page 80: ...nel Integrals Gamma Gauss HyperGeometric Hyperbolic Cosine Integral Hyperbolic Sine Integral Incomplete Beta Incomplete Elliptic 1st Incomplete Elliptic 2nd Incomplete Gamma Jacobian Elliptic Function Kelvin 1st Kelvin 2nd Kummer Logarithm of Factorial Table 3 1 Analysis Visual C Library Measurement Types Included in the Professional and Enterprise Packages Continued Analysis Visual C Library Prof...

Page 81: ...ctionality included in the Analysis class library visit ni com analysis and select Visual Basic Visual Basic NET C and C with Measurement Studio Modified Bessel 1st Modified Bessel 2nd Parabolic Cylinder Psi Sine Integral Spherical Bessel 1st Spherical Bessel 2nd Stirling Struve Tricomi Zeta Table 3 1 Analysis Visual C Library Measurement Types Included in the Professional and Enterprise Packages ...

Page 82: ...plex CNiVector and CNiMatrix derived objects and with cast operators to convert CNiVariant objects to a variety of other object types CNiException Extends the MFC CException class and serves as the base class for many Measurement Studio exceptions CNiRegKey Encapsulates the interface to the Windows registry Use this class and related classes to open and create keys get keys and get values associat...

Page 83: ...rement Studio Visual C classes This class library is included only in the Measurement Studio Enterprise package Tip For more information about using the Measurement Studio Excel Visual C class library to create applications that present data in Microsoft Excel format refer to the Microsoft Excel Interface Visual C Class Library Overview topic in the NI Measurement Studio Help Microsoft Word Interf...

Page 84: ...tions with the Instrument I O Assistant in Visual Studio NET 2003 only For more information about GPIB visit ni com gpib NI DAQmx Use the Measurement Studio NI DAQmx Visual C class library to communicate with and control an NI data acquisition DAQ device This class library is included when you install the NI DAQmx driver Note Some DAQ devices are not currently supported by the NI DAQmx driver Refe...

Page 85: ... Use the NI VISA class library to quickly create bus independent and bus specific instrument control applications The NI VISA class library supports I O operations locking event handling and interface specific extensions With this class library you can access the functionality available in NI VISA for communicating with message based and register based instruments using the following interfaces GP...

Page 86: ... shown in Figure 3 2 for different Boolean displays such as on or off or true or false Typically you use buttons to input or display Boolean information or initiate an action in a program The CNiButton class provides the Visual C interface to the ActiveX button control Figure 3 2 ActiveX Button Control With the button control and the classes that interface with the control you can perform the foll...

Page 87: ...ional data The CNiGraph class provides the Visual C interface to the ActiveX graph control Figure 3 3 ActiveX Graph Control With the graph control and the classes that interface with the control you can perform the following operations Plot Operations Plot and chart data Configure a graph to contain multiple plots to show separate but related data on the same graph Configure a graph to include mul...

Page 88: ...ly Configure the graph for fixed strip or scope charting Customize the graph by using ticks labels and value pairs Bind properties to a DataSocket source or target You use binding to read property values from a source and write property values to a target Tip For more information about easily using the graph control refer to the Using the Measurement Studio Graph Visual C Control section in the NI...

Page 89: ...rget Tip For more information about easily using the knob control refer to the Using the Measurement Studio Knob Visual C Control section in the NI Measurement Studio Help Numeric Edit Control Use the Measurement Studio ActiveX numeric edit control as shown in Figure 3 5 to display numeric values and provide a way by which end users can edit numeric values Typically you use a numeric edit control ...

Page 90: ...rform the following operations Use different display styles vertical horizontal tank and thermometer Use the CNiAxis class to interface to a single axis of a slide control This ability allows you to modify the appearance and behavior of the axis Use multiple control pointers each one representing one scalar value Automatically label axes with log or inverted numeric scales and continuous or discre...

Page 91: ...e for generating synchronous and asynchronous tones at specific frequencies CNiSystem CNiSystem provides the following functionality Getting and setting system preferences Displaying help files Getting input for the keyboard CNiSystemTrayIcon CNiSystemTrayIcon encapsulates the interface to the system tray area that displays changes in the status of an application The CNiSystemTrayIcon class includ...

Page 92: ...ion and manipulation CNiTimer CNiTimer objects use the Windows multimedia timer to generate high resolution asynchronous tick events Respond to tick events when you want to perform an action at a discrete interval Additionally you can count the tick events to calculate elapsed time The CNiTimer class also contains static functions you can use to delay for a period of time or to determine elapsed t...

Page 93: ...ent Studio Project Adding or Removing Measurement Studio NET Class Libraries Creating a Measurement Studio NI DAQmx Application Creating an Instrument Control Application Selecting a Measurement Studio Parameter Value Using the Instrument Driver Wizard Refer to the Developing with Measurement Studio section in the NI Measurement Studio Help for more information about the functionality of these too...

Page 94: ...rating Systems and Protecting Your Project from LC0000 Build Error in the NI Measurement Studio Help for more information This menu item is only available in Visual Studio 2005 on a 64 bit Windows OS Visual Studio 2008 projects function correctly without this protection Remove 64 Bit Protection from Project Removes protection for build error LC0000 from your project Refer to Using Measurement Stud...

Page 95: ... news support downloads and evaluation software Select Measurement Studio Online Resources Measurement Studio Home Page to access this menu item Measurement Studio Online Resources Instrument Driver Network Use the NI Instrument Driver Network at ni com idnet as a central resource for downloading developing and submitting instrument drivers Select Measurement Studio Online Resources Instrument Dri...

Page 96: ... this menu item Tip For more information about the resources included in the Measurement Studio Menu refer to the Measurement Studio Menu topic in the NI Measurement Studio Help Creating a Measurement Studio Project Measurement Studio includes class library and application templates that you can use to quickly create measurement applications with Visual Basic NET Visual C ASP NET and Visual C Refe...

Page 97: ...Studio Help Note For information about converting Measurement Studio projects refer to the Converting Measurement Studio Projects section in the NI Measurement Studio Help Adding or Removing Measurement Studio NET Class Libraries To add or remove Measurement Studio NET class libraries from a project use the Measurement Studio Add Remove NET Class Libraries wizard on the Measurement Studio menu Thi...

Page 98: ...lass libraries refer to the Adding or Removing Measurement Studio NET Class Libraries section in the NI Measurement Studio Help Creating a Measurement Studio NI DAQmx Application To create a Measurement Studio NI DAQmx application use the DAQ Assistant The DAQ Assistant integrates into Visual Studio as a code designer Use the Add New Item wizard to add an NI DAQmx task to your project and use the ...

Page 99: ...e DAQ Assistant is available only if you have installed NI DAQmx and either the Measurement Studio Professional or Measurement Studio Enterprise package Refer to Chapter 5 the Walkthrough Creating a Measurement Studio NI DAQmx Application section for step by step instructions on how to create DAQ applications Figure 4 3 DAQ Assistant ...

Page 100: ... project Generating a DAQ component that uses the task to provide appropriate operations for your measurement type Tip For more information about using the DAQ Assistant to create a Measurement Studio NI DAQmx application refer to the Creating a Measurement Studio NI DAQmx Application section in the NI Measurement Studio Help Creating an NI DAQmx User Interface Using the Configure DAQ Component UI...

Page 101: ...ode just as you create an instance of any class directly in source code Declare a variable of the appropriate type and use it directly The h file for the user friendly wrapper for the DAQmx task class contains additional information on using the user code Tip For more information on how to create user code refer to the Using a DAQmx Task Class in a Project topic in the NI Measurement Studio Help C...

Page 102: ... I O Assistant The Instrument I O Assistant aids you in performing the following operations Creating an instrumentation task class Configuring an instrumentation task class to communicate with an instrument and parse data you receive from the instrument Tip For more information about using the Instrument I O Assistant to create a Measurement Studio instrument control application refer to the Creat...

Page 103: ...A Note The Parameter Assistant is available in prior versions of Visual Studio only if you have at least one Measurement Studio class library installed that supports the Parameter Assistant With the Parameter Assistant you can select the correct parameter value for a device or resource as shown in Figure 4 6 based on your current system configuration Click the Insert Selected Item button on the Pa...

Page 104: ...r wizard as shown in Figure 4 7 generates a NET wrapper class for calling into IVI VXI plug play and legacy instrument drivers based on the instrument driver function panel header file and an optional sub file for IVI drivers The wizard can generate both Visual C and Visual Basic NET source code After completing the wizard a new instrument driver wrapper class is added to your project and opened i...

Page 105: ...and features Measurement Studio Walkthroughs Use the following walkthroughs to help you develop Measurement Studio applications in Visual Studio 2005 or Visual Studio 2008 Walkthrough Creating a Measurement Studio Application with Windows Forms Controls and Analysis Walkthrough Creating a Measurement Studio Application with Web Forms Controls and Analysis Walkthrough Creating a Measurement Studio ...

Page 106: ...t that references the Measurement Studio Analysis class library and Windows Forms controls Adding user interface controls to the project Using the Toolbox smart tags and the Properties window you will add and configure a button waveform graph legend gauge and numeric edit user interface control Generating plotting and analyzing the data Using NationalInstruments Analysis SignalGeneration White Noi...

Page 107: ...l Studio 2008 2 Select File New Project The New Project dialog box launches 3 In the Project Types pane select Measurement Studio under Visual C or Visual Basic depending on which language you want to create the project in 4 In the Templates pane select NI Windows Application Specify MyMeasurementStudioProject for Name and specify a Location of your choice 5 Click OK The Measurement Studio Applica...

Page 108: ...e project 1 Select View Toolbox to display the Toolbox The Toolbox contains components and controls that you can add to your project 2 Expand the All Windows Forms group The All Windows Forms group contains controls and components included in the System WindowsForms namespace 3 Select the Button control and drag and drop it onto the form 4 Right click the button and select Properties to display th...

Page 109: ... Measurement Studio group in the Toolbox 7 Select the WaveformGraph control and drag and drop it onto the form 8 Right click the waveform graph and select Edit Plots to display the WaveformPlot Collection Editor dialog box You use the WaveformPlot Collection Editor dialog box to add or remove plots and to configure plot properties ...

Page 110: ...the upper right corner of the control 9 Type Plot for the Name Click OK 10 Before you add the Measurement Studio legend numeric edit and gauge controls you need to resize the form to accommodate them Select the form and use the double sided arrow to resize it 11 Select the Legend control and drag and drop it onto the form 12 Select the NumericEdit control and drag and drop it onto the form 13 Sele...

Page 111: ...5 Getting Started with Measurement Studio National Instruments Corporation 5 7 Measurement Studio User Manual 15 Type gauge for the name of the gauge The following screenshot shows Form1 with the user controls ...

Page 112: ...al Store the generated data in a double array named data Dim data As Double whiteNoise Generate 1000 0 256 Use the PlotY method to plot the data Plot PlotY data Use the Mean method to calculate the mean of the data Dim mean As Double Statistics Mean data Display the mean on the gauge gauge Value mean C Declare and initialize an instance of WhiteNoiseSignal WhiteNoiseSignal whiteNoise new WhiteNois...

Page 113: ...nd to configure legend item properties 2 Select Plot in the Source drop down list and enter Signal in the Text box Click OK Now that you have specified a legend item for the plot changes you make to the plot will be reflected on the legend 3 Right click the graph and select Auto Format to display the Auto Format dialog box The Auto Format dialog box provides a set of pre configured control styles ...

Page 114: ...pe 0 2 for the minimum value and type 0 2 for the maximum value 10 Click the numeric edit smart tag to display the Numeric Edit Tasks 11 Select Gauge in the Source drop down list Setting the Source property to the gauge allows two way binding between the controls 12 Deselect ArrowKeys Buttons and Text for the InteractionMode property of the numeric edit control Deselecting these interaction modes ...

Page 115: ...kthrough will not work with the Measurement Studio Standard package Measurement Studio includes user interface controls such as a waveform graph control and a gauge control and Analysis functionality such as signal generation and mathematical functions This walkthrough is designed to help you learn how to add analysis and presentation functionality to a Web Forms application by taking you through ...

Page 116: ...ay the mean value on the gauge and the numeric edit as well as customize your user interface Before you begin The following components are required to complete this walkthrough Microsoft Visual Studio 2005 or Visual Studio 2008 Measurement Studio 8 0 1 or later Professional or Enterprise package for Visual Studio 2005 or Measurement Studio 8 5 or later Professional or Enterprise package for Visual...

Page 117: ... select NI ASP NET Web Site Select File System and specify a file path of your choice 4 Use the drop down box to select Visual C or Visual Basic depending on which language you want to create the project in 5 Click OK The Measurement Studio ASP NET Web Site Wizard launches 6 Select Analysis Library and Web Forms User Interface Control Library ...

Page 118: ... can access the Add Remove Class Libraries dialog box by selecting Measurement Studio Add Remove NET Class Libraries Wizard 7 Click Finish to display Default aspx in the Web Forms Designer 8 You can change the title of your Web page Click inside the title tag and rename the title to Measurement Studio Web Forms Controls and Analysis Walkthrough ...

Page 119: ... cells to arrange the user interface controls on your Web page as shown in the previous screenshot 4 The default table that appears is 3 3 This table provides a customizable form for arranging the user interface controls for your Web page Expand the table to approximately 300 px pixels tall by 550 px wide by clicking and dragging the table borders 5 If you are using Visual Studio 2005 merge the to...

Page 120: ...the control in the Properties window 9 Scroll to the Text property in the Properties window Type Start for the button text 10 Expand the Measurement Studio group on the Toolbox 11 Select the WaveformGraph control and drag and drop it into the top table cell 12 On the waveform graph smart tag type graph for the name of the waveform graph ID Tip To access the smart tag left click on a control to sel...

Page 121: ...cell 14 Select the NumericEdit control and drag and drop it into the bottom center table cell 15 On the numeric edit smart tag type numericedit for the name of the numeric edit ID 16 Select the Gauge control and drag and drop it into the top table cell to the right of the waveform graph Resize controls and table cells as necessary 17 On the gauge smart tag type gauge for the name of the gauge ID ...

Page 122: ...de to generate random data plot the data calculate the mean of the data and display the mean on the gauge VB NET Declare and initialize an instance of WhiteNoiseSignal Dim whiteNoise As New WhiteNoiseSignal Store the generated data in a double array named data Dim data As Double whiteNoise Generate 1000 0 256 Use the PlotY method to plot the data graph PlotY data Use the Mean method to calculate t...

Page 123: ... plot the data graph PlotY data Use the Mean method to calculate the mean of the data double mean Statistics Mean data Display the mean on the numeric edit numericedit Value mean Display the mean on the gauge gauge Value mean Customizing your user interface 1 Select the Default aspx tab to return to the Web Forms Designer 2 Right click the legend and select Edit Items to display the LegendItem Col...

Page 124: ...ppropriate control properties to reflect the style you chose 5 Select Points Only Click OK Notice that the legend changed automatically to match the formatting of the graph 6 Right click the gauge and select Auto Format to display the Auto Format dialog box 7 Select Dark and click OK 8 On the gauge smart tag set the Range property for the gauge with the drop down Range type editor Type 0 2 for the...

Page 125: ... Select File Save Default aspx to save your application 12 Select Debug Start Without Debugging to run the application 13 After your program builds click Start Notice the graph shows the data plot and the gauge and the numeric edit display the mean of the data The following screenshot shows Default aspx in its final form ...

Page 126: ...etworkVariable NetworkVariable BufferedWriter TValue you will create and run a console application that writes an array of values to the server Setting up a Windows Forms project Using the Measurement Studio Application Wizard you will create a new project that references the Measurement Studio Network Variable class library and Windows Forms controls Configuring the network variable data source c...

Page 127: ...08 2 Select File New Project The New Project dialog box launches 3 In the Project Types pane select Visual C or Visual Basic depending on which language you want to create the project in 4 In the Templates pane select Console Application Specify NetworkVariableWriter for Name and specify a Location of your choice 5 Click OK 6 Select Measurement Studio Add Remove NET Class Libraries The Measurement...

Page 128: ... Note You should choose the appropriate code depending on whether you created a VB or C project VB NET Imports System Imports System Collections Generic Imports System Text Imports System Threading Imports NationalInstruments NetworkVariable Module Module1 Private Function GenerateDoubleArray ByVal phase As Double As Double Dim values 999 As Double Dim x As Integer For x 0 To 999 values x Math Sin...

Page 129: ...hread Sleep 500 phase phase 1 End While End Sub End Module C using System using System Collections Generic using System Text using System Threading using NationalInstruments NetworkVariable namespace NetworkVariableWriter class Program private static double GenerateDoubleArray double phase double values new double 1000 for int x 0 x 1000 x values x Math Sin 2 Math PI x 1000 phase 2 return values s...

Page 130: ...easurement Studio Measurement Studio User Manual 5 26 ni com bufferedWrite WriteValue value Thread Sleep 500 phase 9 Select Debug Start Without Debugging to run the application 10 Minimize the console but keep the application running ...

Page 131: ...ect The New Project dialog box launches 3 In the Project types pane select Measurement Studio under Visual C or Visual Basic depending on which language you want to create the project in 4 In the Templates pane select NI Windows Application Name the project WindowsNetworkVariableReader and specify a Location you wish to save to project by clicking Browse and navigating to a directory of your choic...

Page 132: ...Variable Communication Library and Windows Forms User Interface Control Library Tip If you are working with an existing project you can access the Add Remove Class Libraries dialog box by selecting Measurement Studio Add Remove Class Libraries Wizard 7 Click Finish to display Form1 in the Windows Forms Designer ...

Page 133: ... it on the form The NetworkVariableDataSource control is a data source control with functionality similar to System Web UI WebControls ObjectDataSource and System Web UI WebControls SqlDataSource in the NET Framework The NetworkVariableDataSource control encapsulates Network Variable functionality 4 In the NetworkVariableDataSource smart tag select Edit Bindings to launch the NetworkVariableBindin...

Page 134: ...ck the waveform graph and select Properties to display the Properties window for the graph You can configure the properties of the control in the Properties window 3 Expand the Data Bindings group in the Properties window Select Other Data Sources Form 1 List Instances networkVariableDataSource1 Binding1 from the Binding Data drop down list This will bind the waveform graph to the network variable...

Page 135: ...n applications over the network This walkthrough is designed to help you learn how to add network variable functionality to a Web Forms application by taking you through the following steps Writing an array of data to the server Using NationalInstruments NetworkVariable NetworkVariable BufferedWriter TValue you will create and run a console application that writes an array of values to the server ...

Page 136: ...omponents are required to complete this walkthrough Microsoft Visual Studio 2005 or Visual Studio 2008 Measurement Studio 8 0 1 or later Professional or Enterprise package for Visual Studio 2005 or Measurement Studio 8 5 or later Professional or Enterprise package for Visual Studio 2008 Writing an array of data to the server 1 Select Start All Programs Microsoft Visual Studio 2005 Microsoft Visual...

Page 137: ... create the project in 4 In the Templates pane select Console Application Specify NetworkVariableWriter for Name and specify a Location of your choice 5 Click OK 6 Select Measurement Studio Add Remove NET Class Libraries The Measurement Studio Add Remove Class Libraries wizard launches You use this wizard to add Measurement Studio components to your project 7 Select NetworkVariable Communication L...

Page 138: ...Main Const location As String localhost system double Dim bufferedWriter As NetworkVariableBufferedWriter Of Double New NetworkVariableBufferedWriter Of Double location bufferedWriter Connect Dim phase As Integer 0 While True Dim values As Double GenerateDoubleArray phase Console WriteLine Writing Array bufferedWriter WriteValue values Thread Sleep 500 phase phase 1 End While End Sub End Module C ...

Page 139: ...orkVariableBufferedWriter double bufferedWriter new NetworkVariableBufferedWriter double Location bufferedWriter Connect int phase 0 while true double value GenerateDoubleArray phase Console WriteLine Writing array bufferedWriter WriteValue value Thread Sleep 500 phase 9 Select Debug Start Without Debugging to run the application 10 Minimize the console application but keep the application running...

Page 140: ... Microsoft Visual Studio 2008 Microsoft Visual Studio 2008 2 Select File New Web Site The New Web Site dialog box launches 3 In the Templates pane select NI ASP NET Web Site Select File System for Location and specify a file path of your choice 4 Use the drop down box to select Visual C or Visual Basic depending on which language you want to create the project in 5 Click OK The Measurement Studio ...

Page 141: ...brary Tip If you are working with an existing project you can access the Add Remove Class Libraries dialog box by selecting Measurement Studio Add Remove Class Libraries Wizard 7 Click Finish to display Default aspx in the Web Forms Designer 8 You can rename the title of your Web page Click inside the title tag and rename the title to Measurement Studio Network Variable and Web Forms Controls Walk...

Page 142: ...and the Measurement Studio group on the Toolbox 4 Select the NetworkVariableDataSource control in the toolbox and drag and drop it on the form The NetworkVariableDataSource control is a data source control with functionality similar to System Web UI WebControls ObjectDataSource and System Web UI WebControls SqlDataSource in the NET Framework The NetworkVariableDataSource control encapsulates Netwo...

Page 143: ...underlying network variable and you use the NetworkVariableBinding Collection Editor to configure the binding properties Select Object for the BindingType You select Object because this walkthrough binds to NationalInstruments UI WebForms WaveformGraph BindingData Enter 0 as the DefaultReadValue 7 Browse to the localhost System double location in the Select Network Item dialog box ...

Page 144: ...figure the binding properties click OK to return to the ASP NET Designer Displaying the array of data on a Web page 1 Select WaveformGraph in the Toolbox and drag and drop it on the form 2 Select AutoRefresh in the Toolbox and drag and drop it on the form 3 In the AutoRefresh smart tag check Enabled Select Edit Default Refresh Items to launch the RefreshItem Collection Editor dialog box ...

Page 145: ...or the ItemID and click OK 5 Double click the AutoRefresh control Add the following code to the AutoRefresh event handler to bind the waveform graph control to the network variable data source control VB NET WaveformGraph1 BindingData NetworkVariableDataSource1 Bindings 0 GetValue C WaveformGraph1 BindingData NetworkVariableDataSource1 Bindings 0 GetValue ...

Page 146: ...e in Web Forms for more information Walkthrough Creating a Measurement Studio NI DAQmx Application Note To complete this walkthrough you must have either the Measurement Studio Professional or Measurement Studio Enterprise package installed This walkthrough requires the DAQ Assistant which is not included in the Measurement Studio Standard package This walkthrough is designed to help you learn how...

Page 147: ...fessional or Enterprise package for Visual Studio 2008 NI DAQmx 8 1 or later for Visual Studio 2005 or NI DAQmx 8 7 1 or later for Visual Studio 2008 NI DAQmx supported DAQ device or simulated device For information about installing and configuring your DAQ device refer to the DAQ Getting Started Guide You can also use a simulated device to complete this walkthrough For information on how to creat...

Page 148: ...r Visual Basic node depending on which language you want to create the project in and select Measurement Studio Code generation works in both languages 4 In the Templates pane select NI DAQ Windows Application Specify MyDAQmxProject for Name and specify a Location of your choice Click OK The Measurement Studio DAQ Application Wizard launches ...

Page 149: ... you can choose to create a new project task create a new MAX task create a reference to a MAX task copy a MAX task to a project task or copy an existing mxb For this walkthrough select Create a new project task and click Finish The Measurement Studio DAQ Application Wizard automatically sets up your data acquisition project and launches the DAQ Assistant ...

Page 150: ... Studio User Manual 5 46 ni com To configure your task 1 In the Create New dialog box of the DAQ Assistant you can begin to interactively define your DAQ task Select Acquire Signals and then Analog Input as the measurement type for your task 2 Next select Voltage ...

Page 151: ... Physical Channels tree in the Physical tab select the physical channel such as ai1 on the DAQ device to which you connected the voltage signal Click Finish Note You can also use a simulated device in this walkthrough For more information refer to Creating NI DAQmx Simulated Devices in the Measurement Automation Explorer Help for NI DAQmx ...

Page 152: ...nt Studio User Manual 5 48 ni com 4 In the Edit DAQ Task dialog box you can edit the configuration of your DAQ task If the embedded DAQ Assistant help is not open by default click the Show Help button in the upper right corner of the window to display the help ...

Page 153: ... in the NI DAQmx Help 6 Next click the Run button in the toolbar near the top of the Edit DAQ Task dialog box The test runs automatically You can run the test in the DAQ Assistant to test the task and make sure you connected the signal properly If necessary you can modify the settings before any code is generated 7 Click the Finish button in the Edit DAQ Task dialog box to complete the configurati...

Page 154: ... Studio User Manual 5 50 ni com To create a custom user interface for the task 1 In the Configure DAQ Component UI wizard you can customize and preview a user interface and code for your task 2 Click Finish to generate the task user interface in your project form ...

Page 155: ...ng Started with Measurement Studio National Instruments Corporation 5 51 Measurement Studio User Manual The wizard also generates event handlers and code to acquire data and present it on your generated user interface ...

Page 156: ...elp For more information about creating and using tasks in Measurement Studio refer to Using the Measurement Studio NI DAQmx NET Library You can also look at examples that ship with NI DAQmx Refer to Measurement Studio NI DAQmx NET Examples for the locations of these examples Walkthrough Creating a Measurement Studio Instrument I O Application Note To complete this walkthrough you must have either...

Page 157: ...stant data on your UI Using text box and button controls you will create a Windows Forms application to display the Instrument I O Assistant data Before you begin The following components are required to complete this walkthrough Visual Studio 2005 or Visual Studio 2008 Measurement Studio 8 0 1 or later Professional or Enterprise package for Visual Studio 2005 or Measurement Studio 8 5 or later Pr...

Page 158: ...ocess if you use Visual Basic NET 4 In the Templates pane select NI VISA Windows Application Specify MyIIOAProject for Name and select a Location of your choice 5 Click OK Your project opens in Visual Studio with a VisaTask mxb file and references to NationalInstruments VisaNS NationalInstruments UI WindowsForms and NationalInstruments created for you 6 Select View Solution Explorer to display the...

Page 159: ...instrument drop down listbox 2 Select Add Step and then select Query and Parse from the expanded list You use a Query and Parse step to both write a command to an instrument and read the instrument s response 3 Enter the command idn and click Run this step The idn command is a standard instrument command for querying an instrument s identification information If your instrument does not support th...

Page 160: ... about how to manually parse the data into two tokens 6 In the Token name text box enter Vendor to rename the first token You use this name to reference the token in your application Ensure that the data type of the token is String You specify the data type of the token using the Type drop down list on the Data Type tab 7 Select Token2 rename it to Device and ensure that the data type for Token2 i...

Page 161: ...e 1 Double click the Form1 file in the Solution Explorer to open your main application form 2 Select View Toolbox to display the Toolbox 3 Expand the All Windows Forms group on the Toolbox 4 Select the Button control and drag and drop it onto the form 5 Select the TextBox control and drag and drop it onto the form Repeat this step to add a second text box to the form The following screenshot shows...

Page 162: ... in the text boxes VisaTaskResults results myTask Run textBox1 Text results Vendor textBox2 Text results Device Note Your sample code will be different depending on the instrument actually used 8 Build and run the application 9 Click the Button on the form to run the task The following screenshot shows the controls on the form with sample returned data Note Although this walkthrough only covers th...

Page 163: ...ard Service Program Membership This program entitles members to direct access to NI Applications Engineers via phone and email for one to one technical support as well as exclusive access to on demand training modules via the Services Resource Center NI offers complementary membership for a full year after purchase after which you may renew to continue your benefits For information about other tec...

Page 164: ... you need contact your local office or NI corporate headquarters Phone numbers for our worldwide offices are listed at the front of this manual You also can visit the Worldwide Offices section of ni com niglobal to access the branch office Web sites which provide up to date contact information support phone numbers email addresses and current events ...

Page 165: ... analog I O Reading or writing data in continuously variable physical quantities such as voltage or current annotate Adding text arrows or shapes to describe or highlight a point or region on a graph ANSI C C programming language defined by the American National Standards Institute API Application Programming Interface A specification of software functions and their input and return parameters arr...

Page 166: ...rsions but is integral to every measurement you take in NI DAQmx In Traditional NI DAQ you configure virtual channels in MAX In NI DAQmx you can configure virtual channels in either MAX or in a program and you can configure channels as part of a task or separately 3 Switch a switch channel represents any connection point on a switch It may be made up of one or more signal wires commonly one two or...

Page 167: ...a user interface counter timer I O Reading or writing data based on high precision timing through a counter or timer By combining a counter with a highly accurate clock you can create a wide variety of timing and counting applications such as monitoring and analyzing digital waveforms and generating complex square waves cursor Flashing rectangle that shows where you may enter text on the screen If...

Page 168: ...orm data type represents a set of digital states that are grouped by samples or signals distribution Ability to install programs you develop with Measurement Studio to others working on different computers DLL Dynamic Link Library A library of functions that link to a program and load at run time rather than being compiled into the program Loading libraries only when they are needed saves memory i...

Page 169: ...ser interface for your program front panel Interactive user interface of a virtual instrument Modeled after the front panel of physical instruments it is composed of switches slides meters graphs charts gauges LEDs and other controls and indicators FTP File Transfer Protocol Protocol based on TCP IP to exchange files between computers G gauge A control used to input or display numerical data GPIB ...

Page 170: ...sistant Assists in writing code to communicate with devices such as serial Ethernet or GPIB instruments The Instrument I O Assistant provides a user interface within the Visual Studio environment You use the Instrument I O Assistant to interactively write commands to a device read data that the device returns and specify how to parse the response interface Connection between one or more of the fol...

Page 171: ...easurement Automation Explorer MAX National Instruments tool for configuring your National Instruments hardware and driver software executing system diagnostics adding new devices interfaces and virtual channels and viewing devices and instruments connected to your system measurement device DAQ devices such as the E Series multifunction I O MIO devices SCXI signal conditioning modules and switch m...

Page 172: ...s CVI and Measurement Studio increased performance such as faster single point analog I O and a simpler API for creating DAQ applications using fewer functions and VIs than earlier versions of NI DAQ NI IMAQ Driver level software to control and communicate with National Instruments image acquisition hardware numeric edit A control used to display and edit numeric values O OCX OLE Control eXtension...

Page 173: ...l coordinates postback The process in which a Web page sends data back to the same page on the server property Attribute that defines the appearance or state of an object The property can be a specific value or another object with its own properties and methods For example a value property is the color property of a plot object while an object property is a specific Y axis property on a graph obje...

Page 174: ...s a graph of X and Y data pairs scope See oscilloscope serial Standard serial bus on a computer used to communicate with instruments Also known as RS 232 slide A control used to input or display numerical data slider Moveable part of a slide control smart tag A glyph attached to a Measurement Studio control or component that exposes commonly performed tasks switch A control used to receive and con...

Page 175: ...e uplevel browser Recent generation Web browser that supports rich client interaction and functionality See also downlevel browser V vector 1D array virtual instrument VI Program in Measurement Studio that models the appearance and function of a physical instrument VISA Driver software architecture developed by National Instruments to unify instrumentation software for serial GPIB and VXI instrume...

Page 176: ...l Generation table 3 5 Signal Processing table 3 7 Standard Analysis 3 4 Statistics table 3 12 Windowing table 3 6 AutoRefresh control 2 49 B button control 3 19 C Common NET class library 2 13 Visual C class library 3 15 complex graph control 2 25 2 42 conventions used in the manual x creating Measurement Studio Application with Web Forms Controls and Analysis in Visual Studio 2005 walkthrough 5 ...

Page 177: ...20 2 38 H help NI Measurement Studio Help 1 9 technical support A 1 how to use manual set ix I installation optional 1 3 requirements 1 2 instrument drivers NI resources A 1 Instrument I O Assistant 4 9 K knob NET control 2 28 NET Web Forms control 2 45 Visual C control 3 21 KnowledgeBase A 1 L LED array control 2 33 LED control 2 30 2 48 legend control 2 27 2 44 M Measurement Automation Explorer ...

Page 178: ...8 numeric controls 2 27 2 44 numeric edit NET control 2 29 2 47 Visual C control 3 22 O overview Measurement Studio 1 1 NET class libraries 2 1 Visual C class libraries 3 1 P Parameter Assistant 4 11 programming examples NI resources A 1 project conversion wizard 4 2 project templates 4 4 property editor control 2 32 R requirements distribution 1 3 installation 1 2 S scatter graph control 2 20 2 3...

Page 179: ...6 Microsoft Word Interface 3 16 NI 488 2 3 17 NI DAQmx 3 17 NI Reports 3 18 NI VISA 3 18 overview 3 1 User Interface 3 19 Utility 3 24 W walkthrough Creating a Measurement Studio Application with Webs Forms Controls and Analysis in Visual Studio 2005 5 11 Creating a Measurement Studio Application with Webs Forms Controls and Network Variable in Visual Studio 2005 5 31 Creating a Measurement Studio...

Reviews: