Home
- National Instruments
Contents
1. National Instruments Corporation A 1 Measurement Studio Measurement Computing Edition Glossary A analog I O annotate API array control assembly asynchronous button C chart client callback National Instruments Corporation G 1 Reading or writing data in continuously variable physical quantities such as voltage or current Adding text arrows or shapes to describe or highlight a point or region on a graph Application Programming Interface A specification of software functions and their input and return parameters An array of Measurement Studio user interface controls that behave as a single unit 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 Function that begins an operation and returns control to the program prior to the completion or termination of the operation A control used to input or display Boolean information or to initiate an action in a program To append new data points to the end of an existing plot over time In Web Forms page calls back to the server without fully posting back Callbacks are asynchronous and are accomplished with XML HTTP Client callbacks do not include postback data and they
2. i 200 260 Creating a Measurement Studio Application with Web Forms Controls and Network Variable in Visual Studio 2005 Measurement Studio includes user interface controls such as a waveform graph control and network variable functionality to transfer live measurement data between 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 e Writing an array of data to the server Using NationalInstruments NetworkVariable NetworkVariable BufferedWriter lt TValue gt you will create and run a console application that writes an array of values to the server e Setting up a Web Forms project Using the Measurement Studio Application Wizard you will create a new project that references the Measurement Studio Measurement Computing Edition 3 40 ni com Chapter 3 Getting Started with Measurement Studio Measurement Computing Edition Measurement Studio Network Variable class library and Web Forms controls Configuring the network variable data source control Using the Toolbox and the NationalInstruments NetworkVariable WebForms NetworkVariableDataSource smart tag you will add and configure a data source control to your application Displaying the array of data on a Web page Using the Toolbox you will add and configure an NationalInstruments UI WebForms AutoRefresh control and aNationalIn
3. Q sax amp x a A P Search Ip Favorites Figure 2 4 Slide Tank and Thermometer NET Controls With the slide tank and thermometer controls and the classes that interface with them you can perform many operations including e Fill to the minimum or maximum value of the scale e Position the scale horizontally with left right or both and position the scale vertically with top bottom or both Q Tip For more information about using the Windows Forms and Web 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 to display numeric values and to provide a way by which end users can edit numeric values Typically you use a numeric edit control to input or display double numerical data instead of using a Windows Forms TextBox control National Instruments Corporation 2 9 Measurement Studio Measurement Computing Edition Chapter 2 Measurement Studio Measurement Computing Edition NET Class Libraries Windows Forms NumericUpDown control or a Web Forms TextBox control 3 Note The following section includes a sample of the functionality available with the numeric edit control however for a complete list of numeric edit control functionality refer to the Measurement Studio User Manual online at ni com manuals With the numeric edit
4. Use cursors to identify key points in plots and the plot area Annotation Operations e Configure text labels arrows and drawing shapes to annotate a point anywhere in the plot area of the graph Additional Operations e Zoom interactively e Pan interactively e Edit axis ranges interactively Digital Waveform Graph Control With the digital waveform graph control and the classes that interface with the control you can perform many operations including Plot Operations e Plot digital waveform data Data values can represent up to eight different digital states e Expand and collapse signal plots interactively Waveform Sample and Signal State Operations e Create custom waveform sample and signal state labels Axis Operations e Configure the axis modes to fixed exact autoscaling or loose autoscaling Additional Operations e Display data in sample or time mode e Zoom interactively e Pan interactively Measurement Studio Measurement Computing Edition 2 6 ni com Chapter 2 Measurement Studio Measurement Computing Edition NET Class Libraries Complex Graph Control With the complex graph control and the classes that interface with the control you can perform many operations including Plot Operations e Plot and chart ComplexDouble data e Configure a graph to contain multiple plots to show separate but related data on the same graph e Configure the plot to display arrows The arrows indicate the
5. 2 19 Universal Library 2 18 Network Variable NET class library 2 17 NI Discussion Forums 2 20 NI Instrument Driver Network 2 20 NI Measurement Encyclopedia 2 21 numeric controls 2 8 numeric edit NET control 2 8 2 9 0 overview Measurement Studio 1 5 P project templates 2 21 property editor control 2 11 S scatter graph control 2 4 slide control NET 2 9 support technical A 1 switch array control 2 14 switch control 2 10 Measurement Studio Measurement Computing Edition l 2 T tank control 2 9 technical support A 1 thermometer control 2 9 U Universal Library NET class library 2 18 User Interface NET class library 2 1 AutoRefresh 2 11 complex graph 2 4 digital waveform graph 2 4 gauge 2 8 knob 2 8 LED 2 10 legend 2 4 meter 2 8 numeric edit 2 8 2 9 property editor 2 11 scatter graph 2 4 slide 2 9 switch 2 10 tank 2 9 thermometer 2 9 waveform graph 2 4 W walkthrough Creating a Measurement Studio Application with Web Forms Controls and Network Variable 3 40 Creating a Measurement Studio Application with Webs Forms Controls and Analysis in Visual Studio 2005 3 31 Creating a Measurement Studio Application with Windows Forms Controls and Analysis in Visual Studio 2005 3 22 ni com Creating a Measurement Studio MCC 488 2 Application 3 17 Creating a Measurement Studio MCC DAQ Application 3 1 Creating a Measurement Studio MCC
6. Megabytes of memory Driver level software to control and communicate with Measurement Computing GPIB hardware National Instruments software that includes tools to build measurement applications in Visual Basic NET and Visual C A control used to input or display numerical data Function that performs a specific action on or with an object The operation of the method often depends on the values of the object properties A control used to display and edit numeric values oscilloscope Measurement instrument widely used in high speed testing applications such as telecommunication physical layer testing video testing and high speed digital design verification National Instruments Corporation G 5 Measurement Studio Measurement Computing Edition Glossary PCI plot point postback property property editor property pages range S scalar scale Peripheral Component Interconnect High performance expansion bus architecture commonly found in PCs 1 Trace data line on a graph representing the data in one row or column of an array 2 To display a new set of data while deleting any previous data on the graph Structure that contains two 16 bit integers that represent horizontal and vertical coordinates The process in which a Web page sends data back to the same page on the server Attribute that defines the appearance or state of an object The property can be a specific value or another objec
7. 17 complex graph control 2 4 conventions used in the manual viii creating Measurement Studio Application with Web Forms Controls and Analysis in Visual Studio 2005 walkthrough 3 31 Measurement Studio Application with Web Forms Controls and Network Variable walkthrough 3 40 Measurement Studio Application with Windows Forms Controls and Analysis in Visual Studio 2005 walkthrough 3 22 Measurement Studio MCC 488 2 Application walkthrough 3 17 Measurement Studio MCC DAQ Application walkthrough 3 1 Measurement Studio MCC Scan Components Application walkthrough 3 8 new Measurement Studio project 2 21 D data acquisition DAQ 2 18 2 19 digital waveform graph control 2 4 National Instruments Corporation l 1 documentation conventions used in the manual viii how to use manual set vii NI resources A 1 G gauge control 2 8 GPIBConfig 2 20 graph control complex 2 4 digital waveform 2 4 scatter 2 4 waveform 2 4 H help technical support A 1 how to use manual set vii InstaCal 2 20 installation optional 1 1 K knob NET control 2 8 L LED array control 2 14 LED control 2 10 legend control 2 4 Measurement Studio Measurement Computing Edition Index MCC 488 2 NET class library 2 19 Measurement Studio home page 2 21 Menu 2 20 overview 1 5 Preferences 2 21 meter control 2 9 NET class libraries Analysis 2 16 Common 2 17 MCC 488 2
8. 2003 and Visual Studio 2005 CD The Measurement Studio Measurement Computing Evaluation Guide is organized into three chapters Chapter 1 Measurement Studio Measurement Computing Edition Installation Instructions is an overview of Measurement Computing National Instruments virtual instrumentation and Measurement Studio This chapter includes installation requirements and installation and evaluation instructions Chapter 2 Measurement Studio Measurement Computing Edition NET Class Libraries includes information about Measurement Studio features and functionality Chapter 3 Getting Started with Measurement Studio Measurement Computing Edition includes walkthroughs that guide you through step by step instructions on how to develop with Measurement Studio features Use this guide as a starting point to learn about Measurement Studio Refer to the NI Measurement Studio Help within the Visual Studio environment for function reference and detailed information about the Measurement Studio class libraries wizards assistants and other features National Instruments Corporation vii Measurement Studio Measurement Computing Edition About This Manual Conventions lt gt Y 3 bold italic monospace The following conventions appear in this manual Text enclosed in angle brackets represents directory names and parts of paths that may vary on different computers such as lt windows System gt Square bracket
9. Libraries wizard to add or remove Measurement Studio class libraries or assemblies in existing Visual Basic NET and Visual C projects Select Measurement Studio View NET Class Library Wizard to access this menu item in Visual Studio 2005 Measurement Computing InstaCal Use JnstaCal to configure calibrate and test MCC hardware MCC Tools GPIBConfig Use GPIBConfig to configure MCC GPIB hardware Select MCC Tools GPIBConfig to access this menu item in Visual Studio 2005 Discussion Forums Use the NI Discussion Forums at forums ni com to participate in discussion forums and exchange code with measurement and automation developers around the world Select Measurement Studio Online Resources Discussion Forums to access this menu item in Visual Studio 2005 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 Driver Network to access this menu item in Visual Studio 2005 Search Technical Support Use NI Technical Support at ni com support to find support resources available for most products including software drivers and updates KnowledgeBase articles product manuals step by step troubleshooting wizards conformity documentation example code tutorials and application notes instrument drivers discussion forums and a measurement glossary Select Measu
10. Sawtooth sine square triangle and basic function wave generators e Bessel Chebyshev Inverse Chebyshev Windowed Kaiser and Elliptic Low High Bandpass and Bandstop filters e Signal processing functions such as convolution deconvolution correlation decimation integration and differentiation FFT Inverse FFT Real FFT Fast Hartley Inverse Fast Hartley Fast Hilbert Inverse Fast Hilbert DST Inverse DST DCT and Inverse DCT transformations e Linear algebra functions such as determinant check positive definiteness calculate dot product and other various matrix functions e Scaled and unscaled windowing classes e Common statistical functions such as mean median mode and variance e Exponential linear and polynomial curve fitting functions e Signal generation functions a Tip For more information about analyzing or generating data with the Analysis class library refer to the Using the Measurement Studio Analysis NET Library topic in the NI Measurement Studio Help For more information about the functionality included in the Analysis class library visit ni com analysis and select Analysis in Measurement Studio Measurement Studio Measurement Computing Edition 2 16 ni com Chapter 2 Measurement Studio Measurement Computing Edition NET Class Libraries Common The Measurement Studio Common NET class library is in the NationalInstruments namespace The Common class library provides a set of classe
11. Studio MCC DAQ Application in Visual Studio 2003 Measurement Studio includes class library and application templates that you can use to quickly create MCC DAQ applications with Visual Basic NET and Visual C Measurement Studio Measurement Computing Edition includes user interface controls such as a meter control and MCC DAQ functionality such as analog input and digital I O This walkthrough is designed to help you learn how to add MCC DAQ functionality to a Windows Forms application by taking you through the following steps 3 Note This walkthrough refers to Visual Studio NET 2003 but Visual Studio 2005 users can follow the same process e Setting up the project Using the Visual Studio New Project dialog you will create a new project that references the Measurement Studio National Instruments Corporation 3 1 Measurement Studio Measurement Computing Edition Chapter 3 Getting Started with Measurement Studio Measurement Computing Edition Measurement Computing DAQ class library and Windows Forms controls e Adding user interface controls to the project Using the Toolbox and the Properties window you will add and configure user interface controls including a button and meter e Generating and displaying the data Using McCDag MCCBoard AIn and MCCDag MCCBoard ToEngUnits you will read a raw data point from a channel on an MCC device convert the data point to volts and show the value on a meter Before You Beg
12. box by selecting Measurement Studio Add Remove Class Libraries Wizard Click Finish to display Default aspx in the Web Forms Designer You can change the title of your Web page Click inside the lt title gt tag and rename the title to Measurement Studio Web Forms Controls and Analysis Walkthrough National Instruments Corporation 3 33 Measurement Studio Measurement Computing Edition Chapter 3 Getting Started with Measurement Studio Measurement Computing Edition Adding user interface controls to the project 1 In this section you will build a Web page that looks like the following screenshot Default aspx vy xX a 3 t 4 6 2 8 J 10 Jemo Bo Mi 2 Click Design in the lower left corner to switch from Source View to Design View 3 Select View Toolbox to display the Toolbox The Toolbox contains components and controls that you can add to your project 4 Expand the HTML group on the Toolbox Select the Table control in the Toolbox and drag and drop it on the form You use the table cells to arrange the user interface controls on your Web page as shown in the previous screenshot 5 The default table that appears is 3x3 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 6 Merge the top two cells of all three col
13. computer Also called IEEE 488 bus because it is defined by ANSI TEEFE Standards 488 1978 488 1 1987 and 488 2 1987 A 2D or 3D display of one or more plots HyperText Transfer Protocol Protocol based on TCP IP which is used to download Web pages from an HTTP server to a Web browser Shortened notation for ANSI IEEE Standards 488 1978 488 1 1987 and 488 2 1987 See also GPIB A control in read only mode Software program that copies program system and other necessary files to computers Library of functions to control and use one specific physical instrument Also a set of functions that adds specific functionality to an application Connection between one or more of the following hardware software and the user For example hardware interfaces connect two other pieces of hardware A control used to input or display numerical data Measurement Studio Measurement Computing Edition G 4 ni com LED legend matrix MB MCC 488 2 Measurement Studio meter method numeric edit 0 Glossary Light Emitting Diode An indicator that emits a light when current passes through it For example an LED shows if your computer or printer is turned on A control that displays symbols and descriptions for a specific set of elements of another object such as the plots or cursors of a graph A rectangular array of numbers or mathematical elements that represent the coefficients in a system of linear equations
14. control and the classes that interface with the control you can perform many operations including e Set the minimum range value to negative infinity and the maximum range value to positive infinity e Create custom formats or use built in numeric formats including generic engineering and simple double Q Tip For more information about using the Windows Forms or Web Forms numeric edit control refer to the NumericEdit Class section in the NI Measurement Studio Help Boolean Controls Switch and LED Controls Use the Measurement Studio switch and LED controls as Boolean controls on a Windows Forms or Web Forms user interface You typically use a switch control as shown in Figure 2 5 to receive and control Boolean input on an application user interface Figure 2 5 Switch Control in Vertical Toggle 3D Style You typically use an LED control as shown in Figure 2 6 to indicate a Boolean value on an application user interface Figure 2 6 LED Control in Square 3D Style Measurement Studio Measurement Computing Edition 2 10 ni com Chapter 2 Measurement Studio Measurement Computing Edition NET Class Libraries 3 Note The following section includes a sample of the functionality available with the Boolean controls however for a complete list of Boolean control functionality refer to the Measurement Studio User Manual online at ni com manuals With the switch and LED controls and the classes that interface with the controls you
15. direction of the complex data e Plot error data Axis Operations e Configure a graph to include multiple axes or independent ranges so that plot data fits the graph plot area Cursor Operations e Use cursors to identify key points in plots and the plot area Annotation Operations e Configure text labels arrows and drawing shapes to annotate a point anywhere in the plot area of the graph Additional Operations e Zoom interactively e Pan interactively e Edit axis ranges interactively 0 Tip For more information about using the waveform scatter digital waveform and complex graph and legend controls refer to the Using the Measurement Studio Graph NET Controls and Using the Measurement Studio Legend NET Control sections in the NI Measurement Studio Help National Instruments Corporation 2 7 Measurement Studio Measurement Computing Edition Chapter 2 Measurement Studio Measurement Computing Edition NET Class Libraries Numeric Controls Numeric Pointer Controls Use the Measurement Studio numeric controls to display numerical information with the look of scientific instruments on a Windows Forms user interface and in an ASP NET Web application The numeric controls include a knob gauge meter slide thermometer and tank The following sections describe operations available with the controls and the classes that interface with them 3 Note The following sections include a sample of the functionality availab
16. of the control National Instruments Corporation 3 35 Measurement Studio Measurement Computing Edition Chapter 3 Getting Started with Measurement Studio Measurement Computing Edition 14 Select the Legend control and drag and drop it into the bottom left 15 16 17 18 table cell Select the NumericEdit control and drag and drop it into the bottom center table cell On the numeric edit smart tag type numericedit for the name of the numeric edit ID 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 On the gauge smart tag type gauge for the name of the gauge ID Measurement Studio Measurement Computing Edition 3 36 i Gauge Tasks ID Appearance Dial Color Gauge Style Pointer Color Spindle Color Scale Arc Value Behavior Coercion Mode Coercion Interval Interaction Mode Range Edit Range Fills kaugel White SunkenWithThickNeedle W Black Gainsboro 240 300 0 None 1 Indicator 0 10 Edit Custom Divisions Auto Format ni com Chapter 3 Getting Started with Measurement Studio Measurement Computing Edition The following screenshot shows Default aspx with the user controls Default aspx wy xX a H 4 6 2 8 10 Jemo Bo v Generating plotting and analyzing the data 1 Double click the button c
17. 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 Select the Gauge control and drag and drop it onto the form Measurement Studio Measurement Computing Edition 3 26 ni com Chapter 3 Getting Started with Measurement Studio Measurement Computing Edition 14 Click the gauge smart tag to display the Gauge Tasks 15 Type gauge for the name of the gauge tj 1 Gauge Tasks 4 6 uz gauge 7 Appearance I 2 g Dial Color White v S Gauge Style SunkenwWithThickNeedle w 1a Pointer Color W black v Spindle Color Gainsboro v Scale arc 240 300 v value 0 Behavior Coercion Mode None v Coercion Interval 1 Interaction Mode Indicator v Range 0 10 v Edit Range Fills Edit Custom Divisions Auto Format A National Instruments Corporation 3 27 Measurement Studio Measurement Computing Edition Chapter 3 Getting Started with Measurement Studio Measurement Computing Edition Generating plotting and analyzing the data 1 Double click the button control to display the Form1 code with the cursor inside the click event handler of the button control 2 Add the following code 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 WhiteNoi
18. to NationalInstruments UI WebForms WaveformGraph BindingData Enter 0 as the DefaultRead Value Measurement Studio Measurement Computing Edition 3 46 ni com Chapter 3 Getting Started with Measurement Studio Measurement Computing Edition NetworkVariableBinding Collection Editor Members Binding properties EUS B Behavior BindingMode Read BindingType Object ConnectionTimeout 00 00 10 DefaultReadyalue 0 Location localhost System double Name Binding1 WriteTimeout 00 00 10 7 Click OK to return to the Network VariableBinding Collection Editor dialog box 8 After you configure 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 In the AutoRefresh smart tag check Enabled Select Edit Default Refresh Items to launch the RefreshItem Collection Editor dialog box A qutoRefresh Tasks hutoRefresh AutoRefresh1 ID Enabled Interval 00 00 03 000 v Edit Default Refresh Items 4 Select Add Select WaveformGraph1 for the ItemID and click OK National Instruments Corporation 3 47 Measurement Studio Measurement Computing Edition Chapter 3 Getting Started with Measurement Studio Measurement Computing Edition Refreshitem Collection Editor Members NationalInstruments UI RefreshItem prop
19. 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 When you select a style and click OK the Auto Format feature configures the appropriate control properties to reflect the style you chose 4 Select Points Only Click OK Notice that the legend changed automatically to match the formatting of the graph National Instruments Corporation 3 29 Measurement Studio Measurement Computing Edition Chapter 3 Getting Started with Measurement Studio Measurement Computing Edition SY Auto Format Anti aliased plot Black and white Default Double Y axis Drop fill to 0 Drop lines to 0 Fill to 0 Hidden axes Histogram LabVIEW default Logarithmic Xx and Y axes een axis Strip chart Y step Description Configures the graph with settings that are ideal for plotting scatter data Click the gauge smart tag to display the Gauge Tasks Select Auto Format to display the Auto Format dialog box Select Dark and click OK Right click the gauge and select Properties to display the Properties window COS ON 9 Set the Range property for the gauge with the drop down Range type editor Type 0 2 for the minimu
20. Any applications you build with the Measurement Studio Evaluation package have a thirty day evaluation period To use Measurement Studio your computer must have the following Microsoft Windows 2000 XP Microsoft NET Framework 1 1 for Visual Studio NET 2003 or Microsoft NET Framework 2 0 for Visual Studio 2005 Standard Professional Enterprise Developer Enterprise Architect or Academic edition of Microsoft Visual Studio NET 2003 or Microsoft Visual Studio 2005 Intel Pentium II class processor 733 MHz or higher Video display 800 x 600 256 colors 16 bit color recommended for user interface controls Minimum of 256 MB of RAM 512 MB or higher recommended Minimum of 405 MB of free hard disk space for Visual Studio NET 2003 support and minimum of 385 MB of free hard disk space for Visual Studio 2005 support Microsoft compatible mouse Microsoft Internet Explorer 6 0 or later Optional Installation In order for links from Measurement Studio help topics to NET Framework help topics to work you must install the National Instruments Corporation 1 1 Measurement Studio Measurement Computing Edition Chapter 1 Measurement Studio Measurement Computing Edition Installation Instructions Microsoft NET Framework SDK 1 1 or Microsoft NET Framework SDK 2 0 Installing the Current Version of Measurement Studio over Previous Versions of Measurement Studio You can have only one version of Measurement Studio installed o
21. CC Platform isnin norin pte eaeis sete o a ER E A NE 1 4 INE Plath OM erin a a Revi hians 1 4 Virtual Instrumentation iinitan a eN E R 1 4 What Is Measurement Studio 0 0 ee eeseesesscceseeeseeceseeeeessaeeeseeeeeeeeseeeneeesaes 1 5 Why Should I Use Measurement Studio 0 eee eee eececesceeeeseeeseseeeeseesees 1 5 Chapter 2 Measurement Studio Measurement Computing Edition NET Class Libraries User Interface Controls vis a o a tes A T e e Oa aeieiea Neer 2 1 Graph and Legend Controls Aerenea iii 2 4 Waveform and Scatter Graph Controls eee eeeeeeseeeeeeneeeees 2 5 Digital Waveform Graph Control 0 eee eeceeeeeereceeeeeeneeeseeeees 2 6 Complex Graph Control cee eseeeseesecsseeeeeseessenseeeesseseeeeaees 2 7 Aumere COmtUQol secs cc ccecvecscdesedevacosdecvesusss A EAEE T A R Es 2 8 Numeric Pointer Controls esini erian 2 8 Numeric Edit Control ects nsei a a EEA E 2 9 Boolean Controls sieneen onae e e aa e 2 10 Switch and LED ControlSn sesira terrene E T 2 10 Additional Controls cc sctes veceeds avidivtetevecesstveadielcaves Wace a a a a a oea 2 11 Property Editor Control ossein nonrinie enen 2 11 Instrument Control Strip Control eee cece eseceesseeeseesecescesecseeesesneeeaeenees 2 12 Windows Forms Array Controls 00 csc ee eeceeseeseeseeeeeeseeeeeeseeneeenees 2 14 Switch and LED Array Controls eee eseeseeseeeeeeereeeeseeseeeneens 2 14 National Instruments Corporation v Measurement Studio Measurement Comput
22. DAQ Scan Components Application 3 8 waveform graph control 2 4 Web resources A 1 Windows Forms array controls 2 11 LED array control 2 14 switch array control 2 14 National Instruments Corporation l 3 Index Measurement Studio Measurement Computing Edition
23. Daq Components applications with Visual Basic NET and Visual C Refer to the following section Walkthrough Creating a Measurement Studio MccDaq Components Application for step by step instructions on how to create a Measurement Studio MccDaq Components project Measurement Studio Measurement Computing Edition 3 8 ni com Chapter 3 Getting Started with Measurement Studio Measurement Computing Edition Measurement Studio MCC Edition includes user interface controls such as a waveform graph control and MccDaq scan components that perform analog input scans and analog output scans This walkthrough is designed to help you learn how to add analog scan and presentation functionality to a Windows Forms application by taking you through the following steps 3 Note This walkthrough refers to Visual Studio NET 2003 but Visual Studio 2005 users can follow the same process Before You Begin Setting up the project Using the Visual Studio New Project dialog you will create a new project that references the Measurement Studio MccDaq Scan Components library and Windows Forms controls Adding user interface controls to the project Using the Toolbox and the Properties window you will add and configure user interface controls and MccDaq Scan components including a button and waveform graph and an AiScan component Generating and displaying the data Using the MccDaq Scan components you will read data from a channel on an MCC device con
24. Drop fill to 0 Drop lines to 0 Fill to 0 Hidden axes Histogram LabVIEW default Logarithmic X and Y axes 2 4 aoaie 2 axis 0 Strip chart 1 x Y step 0 Description Configures the graph with settings that are ideal for plotting scatter data Cancel Right click the gauge and select Auto Format to display the Auto Format dialog box Select Dark and click OK On the gauge smart tag set the Range property for the gauge with the drop down Range type editor Type 0 2 for the minimum value and type 0 2 for the maximum value On the numeric edit smart tag select Indicator for the InteractionMode property of the numeric edit control On the numeric edit smart tag select Format Mode and in the Numeric Format Mode Editor dialog box change the Precision to 4 to show four decimal places of precision Select File Save Default aspx to save your application 3 39 Measurement Studio Measurement Computing Edition Chapter 3 Getting Started with Measurement Studio Measurement Computing Edition 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 Measurement Studio Web Forms Controls and Analysis Walkthrough DER File Edit view Favorites Tools Help Q ax Z 4 a A P Search Se Favorites A
25. Measurement Studio Measurement Computing Edition Evaluation Guide October 2006 A MEASUREMENT 351417A 01 COMPUTING Worldwide Technical Support and Product Information ni com National Instruments Corporate Headquarters 11500 North Mopac Expressway Austin Texas 78759 3504 USA Tel 512 683 0100 Worldwide Offices Australia 1800 300 800 Austria 43 0 662 45 79 90 0 Belgium 32 0 2 757 00 20 Brazil 55 11 3262 3599 Canada 800 433 3488 China 86 21 6555 7838 Czech Republic 420 224 235 774 Denmark 45 45 76 26 00 Finland 385 0 9 725 725 11 France 33 0 1 48 14 24 24 Germany 49 0 89 741 31 30 India 91 80 41190000 Israel 972 0 3 6393737 Italy 39 02 413091 Japan 81 3 5472 2970 Korea 82 02 3451 3400 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 68 51 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 200 51 51 Taiwan 886 02 2377 2222 Thailand 662 278 6777 United Kingdom 44 0 1635 523545 For further support information refer to the Contacting Measurement Computing Corp appendix To comment on National Instruments documentation refer to the National Instruments Web site at ni com info and enter the info code feedback 2006 National Instruments Corporati
26. ONABLY PRUDENT STEPS TO PROTECT AGAINST SYSTEM FAILURES INCLUDING BUT NOT LIMITED TO BACK UP OR SHUT DOWN MECHANISMS BECAUSE EACH END USER SYSTEM IS CUSTOMIZED AND DIFFERS FROM NATIONAL INSTRUMENTS TESTING PLATFORMS AND BECAUSE A USER OR APPLICATION DESIGNER MAY USE NATIONAL INSTRUMENTS PRODUCTS IN COMBINATION WITH OTHER PRODUCTS IN A MANNER NOT EVALUATED OR CONTEMPLATED BY NATIONAL INSTRUMENTS THE USER OR APPLICATION DESIGNER IS ULTIMATELY RESPONSIBLE FOR VERIFYING AND VALIDATING THE SUITABILITY OF NATIONAL INSTRUMENTS PRODUCTS WHENEVER NATIONAL INSTRUMENTS PRODUCTS ARE INCORPORATED IN A SYSTEM OR APPLICATION INCLUDING WITHOUT LIMITATION THE APPROPRIATE DESIGN PROCESS AND SAFETY LEVEL OF SUCH SYSTEM OR APPLICATION Contents About This Manual How To Use This Manal cccccccccsccsessssssssscsscecsceccecececesessesesessssssssnccsesesseseeeess Vili EALO EAE AEEA EEE aaa at gies Se she anon he ix Chapter 1 Measurement Studio Measurement Computing Edition Installation Instructions Evaluating Measurement Studio on Your Machine sesssseseseeseereresreresresrsresresesresrsses 1 1 Installing the Current Version of Measurement Studio over Previous Versions of Measurement Studio esceeeeeseeenreeeeeeeeeees 1 2 Installing Measurement Studio 0 eee ee eeeeseceeceeeseeeseeseessecseessecaesesecaeenseeaeseeeeseesaes 1 2 Learning More About NI and Measurement Studio 0 0 cesses eeeeeeeeeeeseeseenseeaees 1 4 M
27. Search Online Templates Windows 4 Smart Device Database Starter Kits Measurement Studio E visual J E visual C Other Project Types 4 project for creating a Measurement Studio C application with a Windows user interface Name ReaderWriter Location C Documents and Settings Administrator My Documents isual Studio 2005 Projects v Solution Name ReaderWriter Create directory for solution Figure 2 11 New Project Dialog Box in Visual Studio 2005 Q Tip For more information about using project templates to create a new Measurement Studio project refer to the Creating a New Measurement Studio Project section in the NI Measurement Studio Help Measurement Studio Measurement Computing Edition 2 22 ni com Getting Started with Measurement Studio Measurement Computing Edition The following sections include overview information and step by step instructions on developing applications with Measurement Studio tools and features Refer to the Developing with Measurement Studio section and the Getting Started with the Measurement Studio Class Libraries section of the NI Measurement Studio Help for more information about the functionality of these tools and features 3 Note The Getting Started with the Measurement Studio Class Libraries section of the NI Measurement Studio Help includes Measurement Studio walkthroughs for Visual Studio 2003 Walkthrough Creating a Measurement
28. Studio 2005 0 Walkthrough Creating a Measurement Studio Application with Web Forms Controls and Analysis in Visual Studio 2005 0 eee Creating a Measurement Studio Application with Web Forms Controls and Network Variable in Visual Studio 2005 cccccscscsscscsceeeeceeeesssesesssereneeees Appendix A Technical Support and Professional Services Glossary Index Measurement Studio Measurement Computing Edition vi Before You Be sin sien s2icaseiveassicstvessschocnititat aes AE O E NES ni com About This Manual The Measurement Studio Measurement Computing Evaluation Guide introduces the concepts associated with the Measurement Studio class libraries and development tools This guide assumes that you have a general working knowledge of Microsoft Visual Studio including INET Windows and ASP NET How To Use This Manual The Measurement Studio Measurement Computing Evaluation package contains the Measurement Studio evaluation software Any applications you build with the Measurement Studio Evaluation package have a 30 day evaluation period Measurement Studio includes support for Visual Studio NET 2003 and Visual Studio 2005 The Measurement Studio Visual Studio NET 2003 and Visual Studio 2005 CD includes separate parallel sets of class libraries integration features and support documentation for developing with Visual Studio NET 2003 and Visual Studio 2005 This manual documents the Visual Studio NET
29. The New Project dialog box launches Templates isual Studio installed templates iyn Windows Application gf NI Class Library My Templates ag Search Online Templates L 4 project for creating a Measurement Studio C application with a Windows user interface Name Location Solution Name National Instruments Corporation 3 23 MyMeasurementStudioProject C Documents and Settings Administrator My Documents Visual Studio 2005 Projects MyMeasurementStudioProject Create directory For solution v Browse Cancel 3 Inthe Project Types pane select Measurement Studio under Visual C or Visual Basic depending on which language you want to create the project in 4 Inthe Templates pane select NI Windows Application Specify MyMeasurementStudioProject for Name and specify a Location of your choice Measurement Studio Measurement Computing Edition Chapter 3 Getting Started with Measurement Studio Measurement Computing Edition 5 Click OK The Measurement Studio Application Wizard launches 6 Select Analysis and Windows Forms User Interface Controls Measurement Studio Visual C Windows Application Wizard Measurement Studio Class Libraries NATIONAL Select the class libraries you want to include in the project INSTRUMENTS Professional Analysis C NetworkVariable Communication Windows Forms User Interface Controls C Measurement Studio Hardwa
30. X and Y coordinates that a cursor crosshair points to on a graph Data acquisition Process of acquiring data typically from A D or digital input plug in boards A device that acquires or generates data and can contain multiple channels and conversion devices DAQ devices include plug in devices which connect to a computer USB port or PCI bus An instrument or controller you can access as a single entity that controls or monitors real world I O points A device is often connected to a host computer through some type of communication network Reading or writing digital representations of data in discrete units the binary digits 1 and 0 Digital information is either on or off A control that displays DigitalWaveform data on a Windows Forms or Web Forms user interface the DigitalwWaveform data type represents a set of digital states that are grouped by samples or signals ni com distribution DLL DMM downlevel browser driver E Ethernet event executable F form front panel FTP National Instruments Corporation G 3 Glossary Ability to install programs you develop with Measurement Studio to others working on different computers 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 in software applications Digital Multimeter A common measurement instrument t
31. about using the numeric edit array control refer to the Using the Measurement Studio Control Array NET Controls topic in the NI Measurement Studio Help AutoRefresh Control Use the AutoRefresh control to update a Web control or a group of Web controls on the client at a specified interval The AutoRefresh control is available in Visual Studio 2005 only The AutoRefresh control renders JavaScript on the client to create a timer in the browser When the timer elapses the AutoRefresh updates the controls in the AutoRefresh group 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 National Instruments Corporation 2 15 Measurement Studio Measurement Computing Edition Chapter 2 Measurement Studio Measurement Computing Edition NET Class Libraries Analysis The Measurement Studio Analysis NET class library is in the NationalInstruments Analysis namespace The Analysis class library includes a set of classes that provides various digital signal processing signal filtering signal generation peak detection and other general mathematical functionality Use this library to analyze acquired data or to generate data The Analysis class library includes the following functionality e
32. acquired value Form1 0 01158 0 01157 0 01156 0 01155 0 National Instruments Corporation 3 21 Measurement Studio Measurement Computing Edition Chapter 3 Getting Started with Measurement Studio Measurement Computing Edition Measurement Studio Walkthroughs for Visual Studio 2005 Use the following walkthroughs to help you develop Measurement Studio applications in Visual Studio 2005 e Walkthrough Creating a Measurement Studio Application with Windows Forms Controls and Analysis in Visual Studio 2005 e Walkthrough Creating a Measurement Studio Application with Web Forms Controls and Analysis in Visual Studio 2005 e Creating a Measurement Studio Application with Web Forms Controls and Network Variable in Visual Studio 2005 Walkthrough Creating a Measurement Studio Application with Windows Forms Controls and Analysis in Visual Studio 2005 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 Windows Forms application by taking you through the following steps Setting up the project Using the Measurement Studio Application Wizard you will create a new project that references the Measurement Studio Analysis class library and Windows Forms controls e Addi
33. age you want to create the project in This walkthrough refers to Visual C but Visual Basic NET users can follow the same process 4 Inthe Templates pane select Windows Application Specify MyMCCGPIBProject for Name and select a Location of your choice 5 Click OK The Measurement Studio Application Wizard launches Q Tip Ifyou are working with an existing project you can access the Add Class Libraries dialog box by selecting Measurement Studio Add Remove Class Libraries Wizard 6 Inthe Application Wizard dialog box select Windows Forms User Interface Controls and MCC 488 2 Library The wizard automatically adds references to the appropriate class libraries and sets up the project for you 7 Click Finish to display Form1 in the Windows Forms Designer Measurement Studio Measurement Computing Edition 3 18 ni com Chapter 3 Getting Started with Measurement Studio Measurement Computing Edition Adding user interface controls to the project 1 Select View Toolbox to display the Toolbox The Toolbox contains components and controls that you can add to your project 2 Select the Windows Forms tab The Windows Forms tab contains controls and components included in the System Windows Forms namespace Select the Button control and drag and drop it onto the form 4 Right click the button and select Properties to display the Properties window You configure the properties of the control in the Properties window The Tex
34. ariable data items that you can bind to properties of a Windows Forms or a Web Forms control e Use the Network Variable Browser dialog box to quickly locate and select data items on other computers and servers The Browser Dialog is included in the NationalInstruments NetworkVariable WindowsForms class 0 Tip For more detailed information about the Network Variable class library refer to the Using the Meausrement Studio Network Variable NET Library section in the NI Measurement Studio Help Hardware Connectivity NI is committed to providing seamless connectivity for data acquisition and instrument control devices allowing you to quickly take measurements Data Acquisition Universal Library The Measurement Studio Universal Library NET class library is in the MccDag namespace This class library is included when you install the Universal Library driver Use the Universal Library class library to communicate with and control Measurement Computing data acquisition DAQ devices Measurement Studio Measurement Computing Edition 2 18 ni com Chapter 2 Measurement Studio Measurement Computing Edition NET Class Libraries Use the Universal Library class library to perform the following types of tasks e Analog signal measurement e Analog signal generation e Digital I O e Counting and timing x Temperature measurement MccDaq Scan Components The Measurement Studio Scan Components NET class library is in the MccDaq Sca
35. ble part of a slide control A glyph attached to a Measurement Studio control or component that exposes commonly performed tasks A control used to receive and control Boolean input in an application user interface Property or operation that begins and returns control to the program only when the operation is complete A control used to input or display numerical data Transmission Control Protocol Internet Protocol A standard format for transferring data in packets from one computer to another The two parts of TCP IP are TCP which deals with the construction of data pockets and IP which routes them from computer to computer A control used to input or display numerical data User Interface Recent generation Web browser that supports rich client interaction and functionality See also downlevel browser Measurement Studio Measurement Computing Edition Glossary V vector 1D array VXI VME eXtension for Instrumentation Instrumentation architecture and bus based on the VME standard Used in high end test applications W waveform graph A control that displays two dimensional data on a Windows Forms or Web Forms user interface displays data that is uniformly spaced in one dimension Measurement Studio Measurement Computing Edition G 8 ni com Index Symbols NET class libraries Scan Components 2 19 A Analysis NET class library 2 16 AutoRefresh control 2 11 C Common NET class library 2
36. can perform many operations including e Receive notification before or after the state of the control changes e Configure how the control behaves when you click it with the mouse or press the spacebar when the control has focus 0 Tip For more information about using the switch and LED controls refer to the Using the Measurement Studio Windows Forms Switch and LED NET Controls section or the Using the Measurement Studio Web Forms Switch and LED NET Controls section in the NI Measurement Studio Help Additional Controls Property Editor Control Use the Measurement Studio property editor control as shown in Figure 2 7 to configure properties for Windows Forms controls at run time ox t Property Editor Drag the sweep or start angle lines to ee the arc Scale Arc 0 240 300 18 A 0 Start angle poo 0 Sweep angle 300 0 ae Invert Cancel Figure 2 7 Property Editor Control for the Knob Control Scale Arc Property National Instruments Corporation 2 11 Measurement Studio Measurement Computing Edition Chapter 2 Measurement Studio Measurement Computing Edition NET Class Libraries B Note The following section includes a sample of the functionality available with the property editor control however for a complete list of property editor control functionality refer to the Measurement Studio User Manual online at ni com manuals With the property edito
37. ct the Windows Forms tab The Windows Forms tab contains controls and components included in the System Windows Forms namespace 3 Select the Button control and drag and drop it onto the form 4 Right click the button and select Properties to display the Properties window You configure the properties of the control in the Properties window Measurement Studio Measurement Computing Edition 3 4 ni com Chapter 3 Getting Started with Measurement Studio Measurement Computing Edition 5 The Text property will be highlighted Type Start for the button text 6 Select the Measurement Studio NET Tools tab on the Toolbox Toolbox Measurement Studio NET T A Pointer i WaveformGraph aaa i ScatterGraph aaa E DigitalwaveformGraph rr 1 ComplexGraph EJ Legend Gauge i Knob St Meter Slide jg Tank Thermometer pE NumericEdit amp Switch Led 4 PropertyEditor 7 Select the Meter control and drag and drop it onto the form 8 Right click the meter and select Properties to display the Properties window 9 Set the CoercionIntervalBase property for the meter to 10 National Instruments Corporation 3 5 Measurement Studio Measurement Computing Edition Chapter 3 Getting Started with Measurement Studio Measurement Computing Edition 10 Set the Range property for the meter with the drop down Range type editor Type 10 for the minimum value Leave the default of 10 for
38. dition Chapter 2 Measurement Studio Measurement Computing Edition NET Class Libraries Graph and Legend Controls Measurement Studio includes four graphs the waveform graph the scatter graph the digital waveform graph and the complex graph Use the graphs to display data in the application type you need You can 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 or in a Web browser Use the waveform graph to display two dimensional linear data You explicitly specify each value in one dimension and provide an initial value and interval to implicitly specify the values in the other dimension You can use the scatter graph to display two dimensional linear or nonlinear data by explicitly specifying each value in both dimensions Waveform and Scatter Graph controls Figure 2 1 Waveform Graph with Cursors and Scatter Graph with XY Point Annotation Both Graphs Have Corresponding Legends You can use the Measurement Studio digital waveform graph control as shown in Figure 2 2 to display DigitalWaveform data on a Windows Forms user interface or in a Web browser You can use the Measurement Studio complex graph control to display ComplexDoub1e data on a Windows Forms user interface or in a Web browser A ComplexDouble number consists of a real part and an imaginary part You can use the Measurement Studio Measurement Computin
39. do not force the page to refresh Client callbacks do require a browser that supports the XML HTTP protocol Measurement Studio Measurement Computing Edition Glossary coercion complex graph context sensitive help control counter timer I O cursor cursor label DAQ DAQ device device digital I O digital waveform graph Measurement Studio Measurement Computing Edition G 2 Automatic conversion that Measurement Studio controls perform to change the numeric representation of a data element A control that displays a ComplexDoub1e data type the ComplexDouble data type represents a complex number of type Double that is composed of a real part and an imaginary part Help for dialog boxes the controls in dialog boxes and keywords in source code that you can access with the key or a Help button or by clicking the link that appears in the Dynamic Help window in Visual Studio Object for entering displaying or manipulating data on a user interface 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 Flashing rectangle that shows where you may enter text on the screen If you have a mouse installed there is a rectangular mouse cursor or pointer Text object used to display
40. dress you will read and plot 100 data points from a GPIB device at the specified address The following components are required to complete this walkthrough Microsoft Visual Studio NET 2003 or Microsoft Visual Studio 2005 Measurement Studio 8 0 Measurement Computing 488 2 Library Measurement Computing GPIB Device Setting up the project 1 2 Open Visual Studio NET from Start All Programs Microsoft Visual Studio NET 2003 Microsoft Visual Studio NET 2003 Select File New Project The New Project dialog box launches 3 17 Measurement Studio Measurement Computing Edition Chapter 3 Getting Started with Measurement Studio Measurement Computing Edition New Project Project Types Templates Q visual Basic Projects C Visual C Projects l a Visual J Projects Windows Class Library visual C Projects Application Measurement Studio Projects C visual Basic Projects 3 Visual C Projects C visual C Projects C C I Projects Mme in os 4 project that uses Measurement Studio class libraries to create an application with a Windows user inte Name MyIIOAProject Location C Documents and Settings Administrator Desktop v Browse Project will be created at C Documents and Settings Administrator Desktop MyIIOAProject More Cancel Help 3 Inthe Project Types pane expand the Measurement Studio Projects folder Select Visual Basic Projects or Visual C Projects depending on which langu
41. e Edit multiple property values of controls with one instrument control strip control e Add other types of controls such as the tool strip button or tool strip label control to the instrument control strip control e Customize the appearance of the control National Instruments Corporation 2 13 Measurement Studio Measurement Computing Edition Chapter 2 Measurement Studio Measurement Computing Edition NET Class Libraries Q Tip For more information refer to the Using the Instrument Control Strip Control topic in s the NI Measurement Studio Help Windows Forms Array Controls You can create an array of Measurement Studio controls that behave as a single unit For example you can use these array controls to visualize and control ports of a digital line or values of an array Measurement Studio includes switch LED and numeric edit array controls You can create control arrays of other controls if those controls meet the constraints of the generic type parameter TControl The Windows Forms array controls are available in Visual Studio 2005 only 3 Note The following sections include a sample of the functionality available with the array controls however for a complete list of array control functionality refer to the Measurement Studio User Manual online at ni com manuals 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 Yo
42. echanical including photocopying recording storing in an information retrieval system or translating in whole or in part without the prior written consent of National Instruments Corporation National Instruments 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 restriction Trademarks National Instruments NI ni com and LabVIEW are trademarks of National Instruments Corporation Refer to the Terms of Use section on ni com legal for more information about National Instruments trademarks FireWire is the registered trademark of Apple Computer Inc Other product and company names mentioned herein are trademarks or trade names of their respective companies Other product and company names mentioned herein are trademarks or trade names of their respective companies Members of the National Instruments Alliance Partner Program are business entities independent from National Instruments and have no agency partnership or joint venture relationship with National Instruments Patents For patents covering National Instruments products refer to the appropriate location Help Patents in your software t
43. ement Studio Projects folder Select Visual Basic Projects or Visual C Projects depending on which language you want to create the project in 4 Inthe Templates pane select Windows Application Specify MyMCCDAQProject for Name and specify a Location of your choice Click OK The Measurement Studio Application Wizard launches Select Universal Library and Windows Forms User Interface Controls When you select these libraries the Measurement Studio Application Wizard automatically adds references to the appropriate class libraries National Instruments Corporation 3 3 Measurement Studio Measurement Computing Edition Chapter 3 Getting Started with Measurement Studio Measurement Computing Edition Measurement Studio Visual C Windows Application Wizard Add Class Libraries Select the class libraries to add to the project Q Measurement Studio Hardware APIs O MCC488 2 Library O Universal Library Windows Forms User Interface Controls Professional Analysis Help lt lt Back LL Finish Cancel Y Tip If you are working with an existing project you can access the Add Class Libraries dialog box by selecting Measurement Studio Add Remove Class Libraries Wizard 7 Click Finish to display Form1 in the Windows Forms Designer Adding user interface controls to the project 1 Select View Toolbox to display the Toolbox The Toolbox contains components and controls that you can add to your project 2 Sele
44. ementStudioProject More Cancel Help 3 Inthe Project Types pane expand the Measurement Studio Projects folder Select Visual Basic Projects or Visual C Projects depending on which language you want to create the project in 4 Inthe Templates pane select Windows Application Specify MyMCCScanProject for Name and specify a Location of your choice Click OK The Measurement Studio Application Wizard launches 6 Select MccDaq Scan Components and Windows Forms User Interface Controls When you select these libraries the Measurement Studio Application Wizard automatically adds references to the appropriate class libraries Measurement Studio Measurement Computing Edition 3 10 ni com Chapter 3 Getting Started with Measurement Studio Measurement Computing Edition gt Measurement Studio Visual C Windows Application Wizard Add Class Libraries Select the class libraries to add to the project Q Measurement Studio Hardware APIs O MCC488 2 Library O Universal Library Windows Forms User Interface Controls Professional Analysis Help lt lt Back j LL Finish Cancel 0 Tip If you are working with an existing project you can access the Add Class Libraries dialog box by selecting Measurement Studio Add Remove Class Libraries Wizard 7 Click Finish to display Form1 in the Windows Forms Designer Adding user interface controls to the project 1 Select View Toolbox to display the Toolbox The
45. epending on which language you want to create the project in 4 Inthe Templates pane select Console Application Specify NetworkVariableWriter for Name and specify a Location of your choice 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 Measurement Studio Measurement Computing Edition 3 42 ni com Chapter 3 Getting Started with Measurement Studio Measurement Computing Edition 7 In Program cs add the following code to write an array of data to the server VB NET Imports NationalInstruments NetworkVariable Imports System Threading Module Modulel 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 2 Math PI x 1000 phase 2 Next x Return values End Function Sub 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 using System using Syste
46. erti NationalInstruments UI Refreshitdm Al 4 E Behavior ItemID WaveformGraphi v lt amp 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 NetworkVariableDataSourcel Bindings 0 GetValue C WaveformGraphl BindingData NetworkVariableDataSourcel Bindings 0 GetValue 6 Select File Save Default aspx to save your application 7 Select Debug Start Without Debugging to run the application The waveform graph displays the array of data Measurement Studio Measurement Computing Edition 3 48 ni com Chapter 3 Getting Started with Measurement Studio Measurement Computing Edition Measurement Studio Network Variable DER a ae File Edit view Favorites Tools Help gt x 2 A Search National Instruments Corporation 3 49 Measurement Studio Measurement Computing Edition Contacting Measurement Computing Corp You can reach Measurement Computing Corp through the following ways Mail Measurement Computing Corp 16 Commerce Blvd Middleboro MA 02346 Telephone 508 946 5100 FAX 508 946 9500 Technical Support techsupport MeasurementComputing com Sales sales measurementcomputing com Other correspondence info measurementcomputing com Visit our Web site at www measurementcomputing com
47. g Edition 2 4 ni com Chapter 2 Measurement Studio Measurement Computing Edition NET Class Libraries Measurement Studio legend control as shown in Figure 2 1 to display symbols and descriptions for a specific set of elements of another object such as the plots or cursors of a graph Digital Waveform Graph Control 0 l Waveform Signal Signal Signal Signal Signal Signal Signal Waveform Signal Figure 2 2 NET Digital Graph The following sections list the operations you can perform with the Measurement Studio graphs 3 Note The following sections include a sample of the functionality available with the graph controls however for a complete list of graph control functionality refer to the Measurement Studio User Manual online at ni com manuals Waveform and Scatter Graph Controls With the waveform graph and scatter graph controls and the classes that interface with the controls you can perform many operations including Plot Operations e Plot and chart data e Configure a graph to contain multiple plots to show separate but related data on the same graph e Plot error bands National Instruments Corporation 2 5 Measurement Studio Measurement Computing Edition Chapter 2 Measurement Studio Measurement Computing Edition NET Class Libraries Axis Operations e Configure a graph to include multiple axes or independent ranges so that plot data fits the graph plot area Cursor Operations e
48. hat measures resistance current and voltage in a wide variety of applications Previous generation Web browser with limited client interaction See also uplevel browser Software that controls a specific hardware device such as a data acquisition board or GPIB interface board See also instrument driver Standard connection type for networks where computers are connected by coaxial or twisted pair cable Object generated response to some action or change in state such as a mouse click or a completed acquisition The event calls an event procedure that processes the event Program file with a exe extension that you can run independently of the development environment in which it was created Window or area on the screen on which you place controls and indicators to create the user interface for your program 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 File Transfer Protocol Protocol based on TCP IP to exchange files between computers Measurement Studio Measurement Computing Edition Glossary G gauge GPIB graph HTTP IEEE 488 indicator installer instrument driver interface knob A control used to input or display numerical data General Purpose Interface Bus The standard bus used for controlling electronic instruments with a
49. he patents txt file on your CD or ni com patents WARNING REGARDING USE OF NATIONAL INSTRUMENTS PRODUCTS 1 NATIONAL INSTRUMENTS PRODUCTS ARE NOT DESIGNED WITH COMPONENTS AND TESTING FOR A LEVEL OF RELIABILITY SUITABLE FOR USE IN OR IN CONNECTION WITH SURGICAL IMPLANTS OR AS CRITICAL COMPONENTS IN ANY LIFE SUPPORT SYSTEMS WHOSE FAILURE TO PERFORM CAN REASONABLY BE EXPECTED TO CAUSE SIGNIFICANT INJURY TO A HUMAN 2 IN ANY APPLICATION INCLUDING THE ABOVE RELIABILITY OF OPERATION OF THE SOFTWARE PRODUCTS CAN BE IMPAIRED BY ADVERSE FACTORS INCLUDING BUT NOT LIMITED TO FLUCTUATIONS IN ELECTRICAL POWER SUPPLY COMPUTER HARDWARE MALFUNCTIONS COMPUTER OPERATING SYSTEM SOFTWARE FITNESS FITNESS OF COMPILERS AND DEVELOPMENT SOFTWARE USED TO DEVELOP AN APPLICATION INSTALLATION ERRORS SOFTWARE AND HARDWARE COMPATIBILITY PROBLEMS MALFUNCTIONS OR FAILURES OF ELECTRONIC MONITORING OR CONTROL DEVICES TRANSIENT FAILURES OF ELECTRONIC SYSTEMS HARDWARE AND OR SOFTWARE UNANTICIPATED USES OR MISUSES OR ERRORS ON THE PART OF THE USER OR APPLICATIONS DESIGNER ADVERSE FACTORS SUCH AS THESE ARE HEREAFTER COLLECTIVELY TERMED SYSTEM FAILURES ANY APPLICATION WHERE A SYSTEM FAILURE WOULD CREATE A RISK OF HARM TO PROPERTY OR PERSONS INCLUDING THE RISK OF BODILY INJURY AND DEATH SHOULD NOT BE RELIANT SOLELY UPON ONE FORM OF ELECTRONIC SYSTEM DUE TO THE RISK OF SYSTEM FAILURE TO AVOID DAMAGE INJURY OR DEATH THE USER OR APPLICATION DESIGNER MUST TAKE REAS
50. hermometer PE NumericEdit A Switch Led EA NumericEditarray AA SwitchArray 2 Led rray l PropertyEditor 2 InstrumentControlStrip NetworkVariableDataSource Sa NetworkVariableBrowserDialog General ES Select the WaveformGraph control and drag and drop it onto the form 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 3 25 Measurement Studio Measurement Computing Edition Chapter 3 Getting Started with Measurement Studio Measurement Computing Edition WaveformP lot Collection Editor Members ie Plot Plot properties BR ApplicationSettin Tag E Design Name Plot GenerateMember True Modifiers Private Fill Lines To Base BasePlot CL none BasexValue 0 BaseYYalue 0 FillBase B value FillMode Gd None FillToBaseColor ij Firebrick ee v A Note You can also access the WaveformPlot Collection Editor dialog box by clicking the waveform graph smart tag To access the smart tag left click on the control to select it and then left click on the arrow button in 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
51. icrosoft Visual Studio 2005 Microsoft Visual Studio 2005 2 Select File New Web Site The New Web Site dialog box launches New Web Site Templates isual Studio installed templates ER ASP NET web Site PNI ASP NET Web Site 2 ASP NET Web Service Personal Web Site Starter Kit 2 Empty Web Site SRASP NET Crystal Reports Web Site My Templates Gylsearch Online Templates A Measurement Studio ASP NET web site Location File System C Documents and Settings MyMeasurementStudiowebSite v Browse Language Visual c 3 Inthe Templates pane select NI ASP NET Web Site Select File System and specify a file path of your choice Measurement Studio Measurement Computing Edition 3 32 ni com Chapter 3 Getting Started with Measurement Studio Measurement Computing Edition 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 and Web Forms User Interface Controls Measurement Studio ASP NET Web Site Wizard Measurement Studio Class Libraries Select the class libraries you want to include in the project NATIONAL INSTRUMENTS C Professional Analysis NetworkVariable Communication Web Forms User Interface Controls 0 Tip If you are working with an existing project you can access the Add Remove Class Libraries dialog
52. in The following components are required to complete this walkthrough e Microsoft Visual Studio NET 2003 or Microsoft Visual Studio 2005 e Measurement Studio e Universal Library e Measurement Computing DAQ device Sy Note For information about installing and configuring your Measurement Computing DAQ device refer to the Quick Start Guide that ships with your device You can also use the DEMO BOARD simulated DAQ device to complete this walkthrough Setting up the project 1 Select Start All Programs Microsoft Visual Studio NET 2003 Microsoft Visual Studio NET 2003 2 Select File New Project The New Project dialog box launches Measurement Studio Measurement Computing Edition 3 2 ni com Chapter 3 Getting Started with Measurement Studio Measurement Computing Edition New Project Project Types Templates Q Visual Basic Projects Visual C Projects i a Visual J Projects Windows Class Library visual C Projects Application Measurement Studio Projects Q Visual Basic Projects J visual C Projects E visual C Projects CVI Projects Moen in i om lA project that uses Measurement Studio class libraries to create an application with a Windows user inte Name MyMeasurementStudioProject Location C Documents and Settings Administrator Desktop v Browse Project will be created at C Administrator Desktop MyMeasurementStudioProject 3 Inthe Project Types pane expand the Measur
53. ing Edition Contents Numeric Edit Array Control cece eceeeeeeeeeceeeseeeeeeeeeeeeaeees AutoRefresh Controls Srne Hardware Connectivity eiie nores iaeio tanaoa ele ace ae RE EaSI a ase Data ACQUISITION wiseiceccetiezcogued neste a a a sweeadvescades EE R i Universal LibrarY sinon aG MccDaq Scan Components sssssesssessesreersersresrsrrsresrsresrsresresese Instrument Control sisisi aces setascgecstacedessesesisues aoea tea ae iee iapa Measurement Studio Integration with Visual Studio ssesesseeesseessesrsersreerereersses Measurement Studio Menu 00 eee ee eeceeseeeeceseeseeeseceecnseeseeesesseenseseeeaees Creating a Measurement Studio Project eee eeeeeeeseceseeseeeetseeseeens Chapter 3 Getting Started with Measurement Studio Measurement Computing Edition Walkthrough Creating a Measurement Studio MCC DAQ Application in Visual Studio 2003 s es Walkthrough Creating a Measurement Studio MCC DAQ Scan Components Application in Visual Studio 2003 0 0 eee esceecesecsseeseceeecsesseeesesesereeeaeesees Before You Besini annona n E E A auiad diated Walkthrough Creating a Measurement Studio MCC 488 2 Application in Vistial St udio 2003 wus sisseseade eo r ia e AEE T E E Before You B sInsiserosinranr eraa pasaia Measurement Studio Walkthroughs for Visual Studio 2005 sseeseeneeeeeeseese Walkthrough Creating a Measurement Studio Application with Windows Forms Controls and Analysis in Visual
54. izing 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 Collection Editor dialog box You use the LegendItem Collection Editor dialog box to add or remove legend items and to configure legend item properties Legenditem Collection Editor Members legendItem1 properties EE 5 Appearance Source B Plot Text Signal Visible True E Data ApplicationSettin Tag E Design Name legendItem1 GenerateMember True Modifiers Private Measurement Studio Measurement Computing Edition 3 38 ni com Chapter 3 Getting Started with Measurement Studio Measurement Computing Edition Select Plots 0 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 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 When you select a style and click OK the Auto Format feature configures the appropriate control properties to reflect the style you chose Select Points Only Click OK Notice that the legend changed automatically to match the formatting of the graph SY Auto Format 10 11 National Instruments Corporation Anti aliased plot Black and white Default Double Y axis
55. l ErrorOccurred AiScan1l Break True MessageBox Show AiScanl Status AI Scan Error End Sub C private void aiScanl_ErrorOccurred object sender MccDaq ScanComponents ErrorOccurredEventArgs e aiScanl Break true MessageBox Show aiScanl Status AI Scan Error 8 Select File Save Form1 cs to save your application 9 Select Debug Start Without Debugging to run the application 10 After your program builds click Start Scan The following screenshot shows Form1 with the waveform graph displaying the acquired values Formi Measurement Studio Measurement Computing Edition 3 16 ni com Chapter 3 Getting Started with Measurement Studio Measurement Computing Edition Walkthrough Creating a Measurement Studio MCC 488 2 Application in Visual Studio 2003 3 Note This walkthrough refers to Visual Studio NET 2003 but Visual Studio 2005 users can follow the same process Before You Begin National Instruments Corporation Setting up the project Using the Visual Studio New Project dialog you will create a new project that references the Measurement Studio Measurement Computing 488 2 class library and Windows Forms controls Adding user interface controls to the project Using the Toolbox and the Properties window you will add and configure user interface controls including a button and waveform graph Generating and displaying data Using MCC 488 2 Device and mcc 488 2 Ad
56. lay the Toolbox The toolbox contains components and controls that you can add to your project 3 Expand the Measurement Studio group on the Toolbox National Instruments Corporation 3 45 Measurement Studio Measurement Computing Edition Chapter 3 Getting Started with Measurement Studio Measurement Computing Edition Select the Network VariableDataSource control in the toolbox and drag and drop it on the form The NationalInstruments NetworkVariable WebForms NetworkVariableDataSource control is a data source control with functionality similar to System Web UI WebControls ObjectDataSource and System Web UI WebControls SqlDataSourcein the NET Framework The NationalInstruments NetworkVariable WebForms NetworkVariableDataSource control encapsulates NationaliInstruments NetworkVariable functionality In the Network VariableDataSource smart tag select Edit Bindings to launch the Network VariableBinding Collection Editor dialog box T Network ariableDataSource NetworkVariableDataSource1 I Network ariableDataSource Tasks ID JetworkVariableDataSourcel Connection cache expiration 00 20 00 v Connection timeout 00 00 10 v Edit Bindings Select Add You add a binding to create a connection with the underlying network variable and you use the Network VariableBinding Collection Editor to configure the binding properties Select Object for the BindingType You select Object because this walkthrough binds
57. le with the numeric controls however for a complete list of numeric control functionality refer to the Measurement Studio User Manual online at ni com manuals With the numeric controls and the classes that interface with them you can perform many operations including e Configure the scale to be linear or logarithmic and toggle the visibility of the scale e Fill the scale and configure the range color dimensions and style of the fill e Connect to the Measurement Studio NET numeric edit control so that if you change the value of one control it changes the value of the other control Use the Measurement Studio knob gauge and meter controls as shown in Figure 2 3 to input and display numeric data on your user interface us Knob Gauge and Meter Controls Figure 2 3 Knob Gauge and Meter NET Controls Measurement Studio Measurement Computing Edition 2 8 ni com Chapter 2 Measurement Studio Measurement Computing Edition NET Class Libraries With the knob gauge and meter controls and the classes that interface with the controls you can perform many operations including e Specify the start and sweep angle of the arc programmatically or from the Properties window Use the Measurement Studio slide tank and thermometer controls as shown in Figure 2 4 to input and display numeric data on your interface Se Measurement Studio Slide Tank and Thermometer Controls DEA File Edit view Favorites Tools Help
58. m Threading using NationalInstruments NetworkVariable namespace NetworkVariableWriter class Program private static double GenerateDoubleArray double phase double values new double 1000 for int x 0 x lt 1000 x values x Math Sin 2 Math PI x 1000 phase 2 return values National Instruments Corporation 3 43 Measurement Studio Measurement Computing Edition Chapter 3 Getting Started with Measurement Studio Measurement Computing Edition static void Main string args const string Location localhost system double NetworkVariableBufferedWriter lt double gt bufferedWriter new NetworkVariableBufferedWriter lt double gt Location bufferedWriter Connect int phase 0 while true double value GenerateDoubleArray phase Console WriteLine Writing array bufferedWriter WriteValue value Thread Sleep 500 phase 8 Select Debug Start Without Debugging to run the application et C WINDOWS system32 cmd exe Writing array Writing array Writing array Writing array Writing array Writing array Writing array Writing array Writing array Writing array Writing array Writing array Writing array Writing array Writing array Writing array Writing array Writing array Writing array Writing array array array 9 Minimize the console application but keep the application running Setting up the Web Forms project 1 Selec
59. m 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 makes the numeric edit an indicator The numeric edit control only displays the calculated mean 13 Select the Format Mode property and in the Numeric Edit Format Mode Editor dialog box change the Precision to 4 to show four decimal places of precision 14 Select File Save Form1 cs to save your application 15 Select Debug Start Without Debugging to run the application Measurement Studio Measurement Computing Edition 3 30 ni com Chapter 3 Getting Started with Measurement Studio Measurement Computing Edition 16 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 Form1 with customization Form1 Walkthrough Creating a Measurement Studio Application with Web Forms Controls and Analysis in Visual Studio 2005 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 i
60. ment Studio NET Tools Data XML Schema Dialog Editor Mobile Web Forms Web Forms Components Windows Forms HTML Clipboard Ring General MCC Scan Components A Pointer 4IScan ba AOScan E Output 3 Toolbox contents 10 Double click on the AIScan component aiScan1 to add it to the component tray beneath the form 11 Right click the AIScan component aiScan1 and select Properties to display the Properties window 12 Click on the ClockRate property and type 500 for this property setting National Instruments Corporation 3 13 Measurement Studio Measurement Computing Edition Chapter 3 Getting Started with Measurement Studio Measurement Computing Edition The following screenshot shows Form1 with the user controls The AIScan component is shown in the component tray Formi Generating and displaying the data 1 Double click on the Start Scan button to display the Form1 code 2 Add the following line of code to start an analog in scan VB NET This starts the scan AiScan1 Operate C This starts the scan private void buttonl_Click object sender System EventArgs e aiScanl Operate 3 Double click on the Stop Scan button to open the code window Measurement Studio Measurement Computing Edition 3 14 ni com Chapter 3 Getting Started with Measurement Studio Measurement Computing Edition 4 Add the following line of code that stops the a
61. n a system for each version of Visual Studio or the NET Framework installed on the system For example you can have Measurement Studio 8 0 1 for Visual Studio NET 2003 installed on the same system as Measurement Studio 8 1 for Visual Studio 2005 but you cannot have Measurement Studio 8 0 1 for Visual Studio 2005 installed on the same system as Measurement Studio 8 1 for Visual Studio 2005 If you install a newer version of Measurement Studio on a machine that has a prior version of Measurement 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 Installing Measurement Studio Complete the following steps to install Measurement Studio These steps describe a typical installation Please carefully review all additional licensing and warning dialog boxes 1 Insert the Measurement Studio CD into the CD drive autorun exe automatically starts If it does not automatically start double click the autorun exe icon 2 Click Next to install all NI software to the default installation directory or click Browse to select a different installation directory Click Next Sy Note The option to browse for an installation location is valid only if you have not already installed any Measurement St
62. nComponents namespace The MccDaq Scan Components library includes a set of components for reading and writing multiple channels of analog data Use the MccDaq Scan Components library to perform the following types of tasks e Analog input scans e Analog output scans Instrument Control MCC 488 2 The Measurement Studio MCC 488 2 NET class library is in the MccDaq Mcc4882namespace This class library is included when you install the MCC 488 2 driver The MCC 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 MCC 488 2 class library to configure and communicate with GPIB devices using the Device and Board classes National Instruments Corporation 2 19 Measurement Studio Measurement Computing Edition Chapter 2 Measurement Studio Measurement Computing Edition NET Class Libraries Measurement Studio Integration with Visual Studio Measurement Studio seamlessly integrates into Visual Studio allowing you to quickly create test and measurement applications without ever leaving the Visual Studio environment Measurement Studio Menu The Measurement Studio Menu provides an easy way to access the following National Instruments resources and tools Add Remove Class Libraries Wizard Use the Measurement Studio Add Remove Class
63. nalog in scan VB NET This stops the scan AiScan1 Break True C This stops the scan private void button2_Click object sender System EventArgs e aiScanl Break true 5 Double click on the AIScan component to open the code window 6 Add the following lines of code to the DataReady event of the aiScan1 component to copy the analog data to an array VB NET Private Sub AiScanl_DataReady ByVal sender As Object ByVal e As System EventArgs Handles AiScan1 DataReady Dim I As Integer Dim yData As Double ReDim yData UBound AiScanl Values 1 For I 0 To UBound AiScanl Values 1 yData I AiScanl Values I Next WaveformGraphl PlotY yData 0 1 0 AiScanl ActualRate End Sub C private void aiScanl_DataReady object sender System EventArgs e Array tempArray aiScanl Values as Array double yData new double tempArray Length Array Copy tempArray yData tempArray Length waveformGraphl1 PlotY yData 0 1 0 aiScanl ActualRate National Instruments Corporation 3 15 Measurement Studio Measurement Computing Edition Chapter 3 Getting Started with Measurement Studio Measurement Computing Edition 7 Add the following lines of code to the ErrorOccurred event of the aiScan1 component to display a message box if an error occurs VB NET Private Sub AiScanl_ErrorOccurred ByVal sender As Object ByVal e As MccDaq ScanComponents ErrorOccurredEventArgs Handles AiScan
64. ng 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 e Generating plotting and analyzing the data Using NationalInstruments Analysis SignalGeneration White NoiseSignal and NationalInstruments Analysis Math Statistics Mean you will generate data plot the generated data on a waveform graph and calculate the mean of the data e Customizing the user interface Using smart tags and the Collection Editor and Auto Format dialog boxes you will display the mean value on the gauge and the numeric edit as well as customize your user interface Measurement Studio Measurement Computing Edition 3 22 ni com New Project Project types E Visual Basic Windows Smart Device Database Starter Kits Measurement Studio Visual C Windows Smart Device Database Starter Kits Measurement Studio Visual J visual C Other Project Types Chapter 3 Before you begin Getting Started with Measurement Studio Measurement Computing Edition The following components are required to complete this walkthrough e Microsoft Visual Studio NET 2005 e Measurement Studio 8 0 1 or later Professional or Enterprise package Setting up the project 1 Select Start All Programs Microsoft Visual Studio 2005 Microsoft Visual Studio 2005 2 Select File New Project
65. oard channel and range and return raw value DaqBoard AIn Channel Range RawValue Convert raw value to engineering units DaqBoard ToEngUnits Range RawValue Volts Display value on meter Meter1l Value Volts MCCDaq Range Bip1l0Volts C Set channel range raw value and volt variables int channel 0 MCCDaq Range range MCCDaq Range Bipl0Volts ushort rawValue 0 float volts 0 0f Perform analog input operation with Measurement Computing board channel and range and return raw value daqBoard AIn channel range out rawValue Convert raw value to engineering units daqBoard ToEngUnits range rawValue out volts Display value on meter meterl Value volts 2003 Select File Save Form1 cs to save your application Select Debug Start Without Debugging to run the application After your program builds click Start Notice each time you click the Start button the meter shows the acquired value National Instruments Corporation 3 7 Measurement Studio Measurement Computing Edition Chapter 3 Getting Started with Measurement Studio Measurement Computing Edition The following screenshot shows Form1 with the meter displaying the acquired value Formi Walkthrough Creating a Measurement Studio MCC DAQ Scan Components Application in Visual Studio 2003 Measurement Studio includes a component library and application templates that you can use to quickly create Mcc
66. on All rights reserved Important Information Warranty The media on which you receive National Instruments software are warranted not to fail to execute programming instructions due to defects in materials and workmanship for a period of 90 days from date of shipment as evidenced by receipts or other documentation National Instruments will at its option repair or replace software media that do not execute programming instructions if National Instruments receives notice of such defects during the warranty period National Instruments does not warrant that the operation of the software shall be uninterrupted or error free A Return Material Authorization RMA number must be obtained from the factory and clearly marked on the outside of the package before any equipment will be accepted for warranty work National Instruments will pay the shipping costs of returning to the owner parts which are covered by warranty National Instruments believes that the information in this document is accurate The document has been carefully reviewed for technical accuracy In the event that technical or typographical errors exist National Instruments reserves the right to make changes to subsequent editions of this document without prior notice to holders of this edition The reader should consult National Instruments if errors are suspected In no event shall National Instruments be liable for any damages arising out of or related to this document or the info
67. ontrol to display the Default aspx cs code with the cursor inside the click event handler of the button control 2 Add the following code 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 PlotyY data Use the Mean method to calculate the mean of the data Dim mean As Double Statistics Mean data Display the mean on the numeric edit numericedit Value mean Display the mean on the gauge gauge Value mean National Instruments Corporation 3 37 Measurement Studio Measurement Computing Edition Chapter 3 Getting Started with Measurement Studio Measurement Computing Edition C Declare and initialize an instance of WhiteNoiseSignal WhiteNoiseSignal whiteNoise new WhiteNoiseSignal Store the generated data in a double array named data double data whiteNoise Generate 1000 0 256 Use the PlotY method to 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 Custom
68. ouble S Replace N1lChar NullChar Plot the point WaveformGraph1 PlotYAppend D 1 Next System Runtime InteropServices Marshal FreeHGlobal Buffer C stringwrtString val int rdBufSize 100 char nlChar n char nullChar 0 addressprimaryAddress new Address 2 int boardNum 0 open a gpib device Device device new Device boardNum primaryAddress allocate a buffer to hold the data IntPtr buffer Measurement Studio Measurement Computing Edition 3 20 ni com Chapter 3 Getting Started with Measurement Studio Measurement Computing Edition System Runtime InteropServices Marshal AllocHGlobal rdBufSize read and plot 100 samples for int i 0 i lt 100 i write the string val to the Fluke45 device Write wrtString read the response from the Fluke45 string s device ReadString rdBufSize replace the newline character with a null and convert the string to a double double d Convert ToDouble s Replace nlChar nullChar plot the point waveformGraphl1 PlotYAppend d 1 System Runtime InteropServices Marshal FreeHGlobal buffer 3 Select File Save Form1 cs to save your application 4 Select Debug Start Without Debugging to run the application 5 After your program builds click Run Notice each time you click the Run button the graph shows the acquired value The following screenshot shows Form1 with the graph displaying the
69. r control and the classes that interface with the control you can perform many operations including e Edit any NET type at run time including collections e Edit expandable properties that represent nested properties of another object such as major divisions of an axis 0 Tip For more information about using the property editor control refer to the Using the Measurement Studio Property Editor Control topic in the NI Measurement Studio Help Instrument Control Strip Control Use the Measurement Studio instrument control strip control to display a set of Measurement Studio property editor controls through the ToolStripPropertyEditor The instrument control strip control is available in Visual Studio 2005 only Figure 2 8 shows the Measurement Studio instrument control strip control Measurement Studio Measurement Computing Edition 2 12 ni com Chapter 2 Measurement Studio Measurement Computing Edition NET Class Libraries Instrument Control Strip Control DEAR i Scale Arc Drag the sweep or start angle lines to change the arc Start angle Sweep angle Figure 2 8 Instrument Control Strip Control With the instrument control strip control and the classes that interface with the control you can perform the following operations e Use the instrument control strip control as a toolbar for editing property values of another control through the associated editors at run time
70. re Class Libraries C MCC488 2 Library C Universal Library 0 Tip If you are working with an existing project you can access the Add Remove Class Libraries dialog box by selecting Measurement Studio View NET Class Library Wizard 7 Click Finish to display Form1 in the Windows Forms Designer Adding user interface controls to the 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 the Properties window You configure the properties of the control in the Properties window Measurement Studio Measurement Computing Edition 3 24 ni com 2 6 National Instruments Corporation Chapter 3 Getting Started with Measurement Studio Measurement Computing Edition The Text property will be highlighted Type Start for the button text Expand the Measurement Studio group in the Toolbox i Menus amp Toolbars a i Data i Components Printing i Dialogs Crystal Reports Measurement Studio A Pointer MB WaveformGraph BY ScatterGraph DigitalWaveformGraph Re ComplexGraph EJ Legend D Gauge us Knob C Meter Slide p Tank 7 T
71. rement Studio Online Resources Search Technical Support to access this menu item in Visual Studio 2005 NI Measurement Studio Help Use the NJ Measurement Studio Help to access detailed Measurement Studio help including function Measurement Studio Measurement Computing Edition 2 20 ni com Chapter 2 Measurement Studio Measurement Computing Edition NET Class Libraries reference walkthroughs and conceptual topic documentation on developing with Measurement Studio e Additional Online Resources Measurement Studio Home Page Use the Measurement Studio Web site at ni com mstudio to find Measurement Studio news support downloads and evaluation software Select Measurement Studio Online Resources Measurement Studio Home Page to access this menu item in Visual Studio 2005 e Additional Online Resources Measurement Encyclopedia Use the online NI Measurement Encyclopedia to find information on measurement principles standards organizations and a wide range of technology and measurement terms Select Measurement Studio Online Resources Measurement Encyclopedia to access this menu item in Visual Studio 2005 e Preferences Use the Measurement Studio Preferences dialog box to configure Measurement Studio settings such as conversion options and add in preferences Select Tools Options to access this menu item in Visual Studio 2005 e Patents Use the Patents dialog box to view information about NI patents e Licenses Use
72. rmation contained in it EXCEPT AS SPECIFIED HEREIN NATIONAL INSTRUMENTS MAKES NO WARRANTIES EXPRESS OR IMPLIED AND SPECIFICALLY DISCLAIMS ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE CUSTOMER S RIGHT TO RECOVER DAMAGES CAUSED BY FAULT OR NEGLIGENCE ON THE PART OF NATIONAL INSTRUMENTS SHALL BE LIMITED TO THE AMOUNT THERETOFORE PAID BY THE CUSTOMER NATIONAL INSTRUMENTS WILL NOT BE LIABLE FOR DAMAGES RESULTING FROM LOSS OF DATA PROFITS USE OF PRODUCTS OR INCIDENTAL OR CONSEQUENTIAL DAMAGES EVEN IF ADVISED OF THE POSSIBILITY THEREOF This limitation of the liability of National Instruments will apply regardless of the form of action whether in contract or tort including negligence Any action against National Instruments must be brought within one year after the cause of action accrues National Instruments shall not be liable for any delay in performance due to causes beyond its reasonable control The warranty provided herein does not cover damages defects malfunctions or service failures caused by owner s failure to follow the National Instruments installation operation or maintenance instructions owner s modification of the product owner s abuse misuse or negligent acts and power failure or surges fire flood accident actions of third parties or other events outside reasonable control Copyright Under the copyright laws this publication may not be reproduced or transmitted in any form electronic or m
73. rs and highly extensible NET classes You can use Measurement Studio to develop a complete measurement and automation application that includes data acquisition analysis and presentation functionalities National Instruments Corporation 1 5 Measurement Studio Measurement Computing Edition Measurement Studio Measurement Computing Edition NET Class Libraries This chapter provides overview information about features and functionality included in Measurement Studio 8 1 support for Visual Studio NET 2003 and Visual Studio 2005 Refer to the NJ Measurement Studio Help for detailed information about these features Refer to Chapter 3 Getting Started with Measurement Studio Measurement Computing Edition for step by step instructions on developing Measurement Studio applications Measurement Studio includes the following features and functionality e User Interface controls e Analysis class libraries e Common class library e Data acquisition e Instrument control e Integration into the Visual Studio environment User Interface Controls Measurement Studio includes managed NET user interface Windows Forms and Web Forms controls designed specifically for test and measurement applications The Measurement Studio ASP NET Web Forms controls are designed to provide a rich user interface experience through the web browser The browsers are divided into two broad categories uplevel and downlevel Uplevel browsers include recent ve
74. rsions of Microsoft Internet Explorer and Mozilla Firefox All other browsers are downlevel browsers By using Measurement Studio controls you can focus on creating an end solution instead of developing UI components National Instruments Corporation 2 1 Measurement Studio Measurement Computing Edition Chapter 2 Measurement Studio Measurement Computing Edition NET Class Libraries User Interface Controls Visual Studio 2005 Visual Studio 2003 Windows Forms Web Forms Windows Forms Waveform graph Vv Vv Y Scatter graph Y Y Y Digital waveform graph Complex graph SN SN NS Legend Knob Gauge Meter Slide Thermometer Tank Numeric edit Switch LED VINEE SESYESY SENT SIS Property editor KIRIS ESSENSE NSYESTS Array controls KIRIS ISIS AIA IR SISS AutoRefresh control Instrument control strip Measurement Studio Measurement Computing Edition 2 2 ni com Chapter 2 Measurement Studio Measurement Computing Edition NET Class Libraries The following figure shows the Measurement Studio controls Measurement Studio User Interface Controls Line 3 Thermometer Tanks 100 200 10 acl M I i Dei Switches a 9 4 7 S O National Instruments Corporation 2 3 Measurement Studio Measurement Computing E
75. s designed to help you learn how to add analysis and presentation functionality to a Web Forms application by taking you through the following steps e Setting up the project Using the Measurement Studio Application Wizard you will create a new project that references the Measurement Studio Analysis class library and Web Forms controls e Adding user interface controls to the project Using the Toolbox and the Properties window you will add and configure a button waveform graph legend gauge and numeric edit user interface control e Generating plotting and analyzing the data Using NationalInstruments Analysis SignalGeneration White NoiseSignal and NationalInstruments Analysis Math National Instruments Corporation 3 31 Measurement Studio Measurement Computing Edition Chapter 3 Getting Started with Measurement Studio Measurement Computing Edition Statistics Mean you will generate data plot the generated data on a waveform graph and calculate the mean of the data e Customizing the user interface Using the Collection Editor and Auto Format dialog boxes you will display 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 e Microsoft Visual Studio NET 2005 e Measurement Studio 8 0 1 or later Professional or Enterprise package Setting up the project 1 Select Start All Programs M
76. s enclose optional items for example response The symbol leads you through nested menu items and dialog box options to a final action The sequence File Page Setup Options directs you to pull down 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 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 emphasis Italic text denotes parameters variables cross references or an introduction to a key concept Italic text also denotes text that is a placeholder for a word or value that you must supply Text in this font denotes text or characters that you should enter from the keyboard sections of code programming examples and syntax examples This font is also used for the proper names of disk drives paths directories programs subprograms subroutines device names functions operations variables filenames and extensions Measurement Studio Measurement Computing Edition viii ni com Measurement Studio Measurement Computing Edition Installation Instructions Evaluating Measurement Studio on Your Machine The following sections contain information and instructions for installing the Measurement Studio Evaluation Package 3 Note
77. s that facilitates the exchange of data between the acquisition analysis and user interface portions of your application The Common class library includes the following features e AComplexDouble data type This data type represents a complex number of type Double that is composed of a real part and an imaginary part e A DigitalWaveform data type This data type represents a set of digital states that are grouped by samples or signals e An AnalogWaveform data type This data type represents an analog signal that varies over time e ADataConverter class that converts data from one data type to another data type such as converting an array of integers to an array of doubles e AnEngineeringFormatiInfo class that defines a custom formatter to format numeric values as strings with engineering notation and International System of Units SI prefixes and symbols e A PrecisionWaveformTiming class that you can use to represent the timing of an analog or digital waveform that is accurate to the nearest 2 second PrecisionWaveformTiming is available only in Measurement Studio support for Visual Studio 2005 Tip For more detailed information about the Common class library refer to the NationalInstruments section in the NI Measurement Studio Help Network Variable The Measurement Studio Network Variable NET class library includes three namespaces NationaliInstruments NetworkVariable NationalInstruments NetworkVariable Window
78. s to complete this step 6 In the Installation Summary dialog box review the features you selected Click Next B Note Step 8 starts the installation of Measurement Studio Be aware that when the installer indicates that it is removing backup files this is a normal operation The installer may take several minutes to complete this step 10 11 12 13 National Instruments Corporation In the MCC Drivers for Measurement Studio dialog box select the Device Drivers components you want to install Click Install If you choose to install InstaCal and Universal Library continue with the following steps If not skip to step 13 In the Welcome to InstaCal and Universal Library dialog box click Next In the Destination Folder dialog box click Next to install InstaCal and Universal Library to the default location or click Change to install to a different location In the Ready to Install dialog box click Install to install InstaCal and Universal Library Click Finish If you choose to install GPIB 488 continue with the following steps If not skip to step 19 In the GPIB 488 Installation Wizard select Next Review the license agreement and select I accept the License Agreement s Click Next 1 3 Measurement Studio Measurement Computing Edition Chapter 1 Measurement Studio Measurement Computing Edition Installation Instructions 14 In the Destination Folder dialog box click Next to install GPIB 488 to the defa
79. sForms and NationalInstruments NetworkVariable WebForms Use the Network Variable class library to transfer live measurement data between applications and servers over the network Note The Network Variable class library is intended to supersede the Measurement Studio DataSocket NET class library The Measurement Studio DataSocket NET library is not available from the Toolbox in Visual Studio 2005 However you can add DataSocket back National Instruments Corporation 2 17 Measurement Studio Measurement Computing Edition Chapter 2 Measurement Studio Measurement Computing Edition NET Class Libraries to the Toolbox Right click the Toolbox Select Choose Items In the Choose Toolbox Items dialog box select DataSocket Use the features in the Network Variable class library to perform the following operations e Exchange different types of data between Measurement Studio LabVIEW LabWindows CVI and other applications that support NI Publish Subscribe Protocol psp and OLE for Process Control opc servers Exchanging data between Measurement Studio applications and OPC servers requires LabVIEW DSC 3 Note Measurement Studio and LabWindows CVI refer to variables as network variables and LabVIEW refers to variables as shared variables However you can read to and write from Measurement Studio and LabWindows CVI network variables with LabVIEW shared variables e Use Windows Forms and Web Forms data sources to expose Network V
80. seSignal 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 PlotyY 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 WhiteNoiseSignal Store the generated data in a double array named data double data whiteNoise Generate 1000 0 256 Use the PlotY method to plot the data Plot PlotyY data Use the Mean method to calculate the mean of the data double mean Statistics Mean data Display the mean on the gauge gauge Value mean Customizing your user interface 1 Right click the legend and select Edit Items to display the LegendItem Collection Editor dialog box You use the LegendItem Collection Editor dialog box to add or remove legend items and to configure legend item properties Measurement Studio Measurement Computing Edition 3 28 ni com Chapter 3 Getting Started with Measurement Studio Measurement Computing Edition Legenditem Collection Editor Members legendItem1 properties i A M legenditemi AS E Appearance Source B Plot Text Signal Visible True E Data ApplicationSettin Tag E Design Name legendItem1 GenerateMember True Modifiers Private
81. struments UI WebForms WaveformGraph control to display the data Before you begin The following components are required to complete this walkthrough Microsoft Visual Studio NET 2005 Measurement Studio 8 1 or later Professional or Enterprise package Writing an array of data to the server 1 2 National Instruments Corporation Select Start All Programs Microsoft Visual Studio 2005 Microsoft Visual Studio 2005 Select File New Project The New Project dialog launches 3 41 Measurement Studio Measurement Computing Edition Chapter 3 Getting Started with Measurement Studio Measurement Computing Edition New Project Project types Templates E Visual C Windows E Smart Device EA Windows Application E NI DAQ Windows Application Database RENI Windows Application ENI VISA Windows Application Starter Kits Class Library g Windows Control Library Measurement Studio Console Application FAlcrystal Reports Application Other Languages giDevice Application Other Project Types isual Studio installed templates My Templates E search Online Templates 4 project for creating a command line application Name NetworkVariablewriter Location C Documents and Settings Administrator My Documents Wisual Studio 2005 Projects E v Solution Name NetworkVariableWriter Create directory for solution 3 Inthe Project Types pane select Visual C or Visual Basic d
82. t Start All Programs Microsoft Visual Studio 2005 Microsoft Visual Studio 2005 2 Select File New Web Site The New Web Site dialog box launches Measurement Studio Measurement Computing Edition 3 44 ni com Chapter 3 Getting Started with Measurement Studio Measurement Computing Edition New Web Site Templates isual Studio installed templates ASP NET Web Site PNT ASP NET Web Site 2 ASP NET Web Service Personal Web Site Starter Kit 2 Empty Web Site SRASP NET Crystal Reports Web Site My Templates Ej Search Online Templates A Measurement Studio ASP NET web site Location File System v C Documents and Settings MyMeasurementStudio website v Browse Language 3 Inthe 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 ASP NET Web Site Wizard launches Click Finish to display Default aspx in the Web Forms Designer You can rename the title of your Web page Click inside the lt title gt tag and rename the title to Measurement Studio Network Variable and Web Forms Controls Walkthrough Configuring the network variable data source control 1 Click Design in the lower left corner to switch from Source View to Design View 2 Select View Toolbox to disp
83. t property will be highlighted Type Run for the button text 6 Select the WaveformGraph control and drag and drop it onto the form The following screenshot shows Form1 with the user controls Formi National Instruments Corporation 3 19 Measurement Studio Measurement Computing Edition Chapter 3 Getting Started with Measurement Studio Measurement Computing Edition Generating and displaying the data 1 Double click the button control to display the Form1 code with the cursor inside the click event handler of the button control 2 Add the following code to read a raw data point from a specified channel on the Measurement Computing device convert the data to volts and display the value on the graph VB NET Dim I As Integer Dim WrtString As String val Dim RdBufSize As Integer 100 Dim NlChar As Char n Dim NullChar As Char 0 Dim PrimaryAddress As New Address 2 Dim BoardNum As Integer 0 Open a gpib device Dim Device As New Device BoardNum PrimaryAddress Allocate a buffer to hold the data Dim Buffer As IntPtr System Runtime InteropServices Marshal AllocHGlobal RdBufSize Read and plot 100 samples For I 0 To 99 Write the string val to the Fluke45 Device Write WrtString Read the response from the Fluke45 Dim S As String Device ReadString RdBufSize Replace the newline character with a null and convert the string to a double Dim D As Double Convert ToD
84. t 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 object The Y axis itself is another object with properties such as minimum and maximum values A control used to configure properties for Windows Forms controls at run time Window or dialog box that displays current configuration information and allows users to modify the configuration Region between the limits within which a quantity is measured received or transmitted The range is expressed by stating the lower and upper range values Number that a point on a scale can represent The number is a single value as opposed to an array Part of graph chart and some numeric controls and indicators that contains a series of marks or points at known intervals to denote units of measure Measurement Studio Measurement Computing Edition G 6 ni com scatter graph scope serial slide slider smart tag switch synchronous T tank TCP IP thermometer U UI uplevel browser National Instruments Corporation G 7 Glossary A control that displays two dimensional data on a Windows Forms or Web Forms user interface displays a graph of X and Y data pairs See oscilloscope Standard serial bus on a computer used to communicate with instruments Also known as RS 232 A control used to input or display numerical data Movea
85. the maximum value The following screenshot shows Form1 with the user controls Formi Generating and displaying the data 1 Double click on Form1 to display the Form1 code 2 Add the following code to declare a new Measurement Computing board object VB NET Declare a new Measurement Computing board object that uses board 0 Public DaqBoard As MCCDaq MCCBoard New MCCDaq MCCBoard 0 C private System Windows Forms Button button1 private MCCDaq MCCBoard daqBoard private NationalInstruments UI WindowsForms Meter meter1 lt summary gt Required designer variable lt summary gt private System ComponentModel Container components null Measurement Studio Measurement Computing Edition 3 6 ni com Chapter 3 Getting Started with Measurement Studio Measurement Computing Edition public Form Required for Windows Form Designer support InitializeComponent daqBoard new MCCDaq MCCBoard 0 3 Scroll down to move the cursor inside the click event handler of the button control 4 Add the following code to read a raw data point from a specified channel on the Measurement Computing device convert the data to volts and display the value on the meter VB NET Set channel range raw value and volt variables Dim Channel As Integer 0 Dim Range As MCCDaq Range Dim RawValue As Integer 0 Dim Volts As Double 0 0F Perform analog input operation with Measurement Computing b
86. the Licenses dialog box to view information about NI licenses About NI Measurement Studio Use the NI Measurement Studio About box to view version information 0 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 and ASP NET Refer to Chapter 3 Getting Started with Measurement Studio Measurement Computing Edition for step by step instructions on how to create a Measurement Studio project Use the Visual Studio New Project dialog box as shown for Visual Studio 2005 in Figure 2 11 to access these templates and to create projects You can create the following projects in Measurement Studio e Measurement Studio Visual Basic NET project e Measurement Studio Visual C project e Measurement Studio ASP NET project National Instruments Corporation 2 21 Measurement Studio Measurement Computing Edition Chapter 2 Measurement Studio Measurement Computing Edition NET Class Libraries New Project Project types Templates Visual Basic isual Studio installed templates Windows i Smart Device Pg NI Windows Application gf NI Class Library Database Starter Kits My Templates Measurement Studio i i Visual C
87. toolbox contains components and controls that you can add to your project 2 Select the Windows Forms tab The Windows Forms tab contains controls and components included in the System Windows Forms namespace 3 Select the Button control and drag and drop it onto the form 4 Right click the button and select Properties to display the Properties window You configure the properties of the control in the Properties window National Instruments Corporation 3 11 Measurement Studio Measurement Computing Edition Chapter 3 Getting Started with Measurement Studio Measurement Computing Edition 5 The Text property will be highlighted Type Start Scan for the button text 6 Select another button control and drag and drop it onto the form Type Stop Scan for the button text 7 Select the Measurement Studio NET Tools tab on the Toolbox Toolbox Measurement Studio NET T h Pointer E WaveformGraph aaa E ScatterGraph aaa DigitalWaveformGraph Daa ComplexGraph E3 Legend Gauge 13 Knob SS Meter Slide jf Tank Thermometer pE NumericEdit amp Switch Led PropertyEditor 8 Select the Waveform graph control and drag and drop it onto the form 9 Select the MCC Scan Components tab on the Toolbox Measurement Studio Measurement Computing Edition 3 12 ni com Chapter 3 Getting Started with Measurement Studio Measurement Computing Edition Device Controls Measure
88. u typically use a switch array control as shown in Figure 2 9 to control ports of a digital line or values of an array You typically use an LED array control as shown in Figure to visualize ports of a digital line or values of an array Figure 2 9 Switch and LED Array Controls With the switch and LED array controls and the classes that interface with the controls you can perform many operations including e Set values by passing an array of data e Modify the number of controls displayed based on the length of the specified values Measurement Studio Measurement Computing Edition 2 14 ni com Chapter 2 Measurement Studio Measurement Computing Edition NET Class Libraries Tip For more information about using the switch and LED array controls refer to the Using the Measurement Studio Control Array NET Controls topic in the NI Measurement Studio Help wg Numeric Edit Array Control Use the Measurement Studio numeric edit array control as shown in Figure 2 10 to control and visualize values of an array of double values 2e 000 2e 000 as las e 2e 000 Figure 2 10 Numeric Edit Array Control With the numeric edit array control and the classes that interface with the control you can perform many operations including e Set values by passing an array of data e Modify the number of controls displayed based on the length of the array of values you specify 0 Tip For more information
89. udio features for the version of Visual Studio that you are installing If you have any Measurement Studio features installed then Measurement Studio installs to the same root directory to which you installed other Measurement Studio features 1 This does not apply to NationalInstruments Common d1l NationalInstruments Common d11 uses a publisher policy file to redirect applications to always use the newest version of NationalInstruments Common d11 installed on the system for each version of the NET Framework NationalInstruments Common d11 is backward compatible Measurement Studio Measurement Computing Edition 1 2 ni com Chapter 1 Measurement Studio Measurement Computing Edition Installation Instructions From the feature tree select the features you want to install To change the Measurement Studio installation directory select the first feature in the list and click Browse You must install Measurement Studio to a local drive If you install Measurement Studio support for more than one version of Visual Studio install them to different directories Click Next Review the license agreement and select I accept the License Agreement s Click Next In the Installation Summary dialog box review the features you selected Click Next 3 Note Step 6 starts the installation of Measurement Studio Be aware that when the installer indicates that it is removing backup files this is a normal operation The installer may take several minute
90. uild user defined measurement and automation systems that suit their needs exactly instead of being limited by traditional vendor defined instruments Measurement Studio Measurement Computing Edition 1 4 ni com Chapter 1 Measurement Studio Measurement Computing Edition Installation Instructions What Is Measurement Studio Measurement Studio is the software tool for creating virtual instruments with Microsoft Visual Studio Measurement Studio is an integrated suite of tools and class libraries that are designed for developers using Microsoft NET Windows and ASP NET to develop measurement and automation applications This evaluation package includes Measurement Studio tools for Visual C and Visual Basic NET Q Tip As you work through this manual you will see italicized references to relevant Measurement Studio help topics To find these topics use the table of contents in the NI Measurement Studio Help Why Should Use Measurement Studio Measurement Studio is an integrated suite of tools and class libraries that are designed for developers using Microsoft Visual Basic NET Visual C and ASP NET to develop measurement and automation applications Measurement Studio dramatically reduces application development time through object oriented measurement hardware interfaces advanced analysis libraries scientific user interface controls for Windows and Web applications measurement data networking wizards interactive code designe
91. ult location or click Browse to install the driver to a different location 15 In the Select Features dialog box select the features you want to install Click Next 16 Click Next to start the installation 17 Click Finish to complete the installation 18 In the Installation Summary dialog box review the features you selected Click Next 19 Click Finish to complete the installation 20 If prompted click the appropriate restart option If you did not install a component that requires a restart you will not be prompted to restart Learning More About NI and Measurement Studio MCC Platform NI Platform The mission of Measurement Computing Corporation is to provide our customers with PC based data acquisition hardware and software that will save time and save money National Instruments is committed to providing software and hardware for engineers and scientists who develop measurement and automation applications NI provides high performance tight integration and rapid application development of virtual instruments at a lower cost than traditional measurement instruments Virtual Instrumentation Virtual instruments represent a fundamental shift from traditional hardware centered instrumentation systems to software centered systems that exploit the computing power productivity display and connectivity capabilities of popular desktop computers and workstations With virtual instruments engineers and scientists b
92. umns by selecting the cells right clicking and selecting Merge 7 Expand the Standard group on the Toolbox The Standard group contains ASP NET server controls included in the System Web UI namespace 8 Select the Button control and drag and drop it into the lower right table cell Measurement Studio Measurement Computing Edition 3 34 ni com Chapter 3 Getting Started with Measurement Studio Measurement Computing Edition 9 Right click the button and select Properties to display the Properties window You configure the properties of the control in the Properties window 10 Scroll to the Text property in the Properties window Type Start for the button text 11 Expand the Measurement Studio group on the Toolbox Toolbox IX Standard Data alidation Navigation Login WebParts HTML Crystal Reports Measurement Studio h Pointer WE WaveformGraph BY ScatterGraph DigitalWaveformGraph a ComplexGraph EJ Legend D Gauge X Knob U Meter Slide f Tank Thermometer 00 NumericEdit amp Switch Led AutoRefresh EN NetworkVariableDataSource id G a E 12 Select the WaveformGraph control and drag and drop it into the top table cell 13 On the waveform graph smart tag type graph for the name of the waveform graph ID 0 Tip To access the smart tag left click on a control to select it and then left click on the arrow button in the upper right corner
93. vert the data object to an array and show the value on a waveform graph The following components are required to complete this walkthrough Microsoft Visual Studio NET 2003 or Microsoft Visual Studio 2005 Measurement Studio MccDaq Scan Components MCC DAQ device B Note For information about installing and configuring your MCC DAQ device refer to the Quick Start Guide that ships with your device You can also use the DEMO BOARD simulated DAQ device to complete this walkthrough Setting up the project 1 Select Start All Programs Microsoft Visual Studio NET 2003 Microsoft Visual Studio NET 2003 2 Select File New Project The New Project dialog box launches National Instruments Corporation 3 9 Measurement Studio Measurement Computing Edition Chapter 3 Getting Started with Measurement Studio Measurement Computing Edition New Project Project Types Templates Visual Basic Projects J Visual C Projects i oa Visual J Projects Windows Class Library H visual C Projects Application Q Measurement Studio Projects 5 visual Basic Projects J Visual C Projects G visual C Projects E CVI Projects ee in on A project that uses Measurement Studio class libraries to create an application with a Windows user inte Name MyMeasurementStudioProject Location C Documents and Settings Administrator Desktop X Browse Project will be created at C Administrator Desktop MyMeasur
Download Pdf Manuals
Related Search
Related Contents
据付工事説明書 User Guide - OPTI-UPS GEIGER-SOLIDline GEIGER-SoftPlusWireless (GU45..F02) grandes écoles universités Silverstone ST56ZF e!Sankey - ifu Hamburg GmbH Complimenti, hai raggiunto una sintonia perfetta con il tuo GT Simulator Version5 Operating Manual Appendix XIII - Hints, Tips, and Workarounds Copyright © All rights reserved.
Failed to retrieve file