measurement studio by mr. ashish chandiok

27
Measurement Studio Ashish Chandiok Dayalbagh Educational Institute Agra [email protected] Mob:09837761031 6/17/22 Ashish Chandiok Dayalbagh Educational Institute 1

Upload: mayank-agarwal

Post on 14-Apr-2017

493 views

Category:

Education


1 download

TRANSCRIPT

Page 1: Measurement Studio by Mr. Ashish chandiok

Measurement Studio

Ashish ChandiokDayalbagh Educational Institute Agra

[email protected]:09837761031

May 2, 2023 Ashish ChandiokDayalbagh Educational Institute 1

Page 2: Measurement Studio by Mr. Ashish chandiok

Table of Contents

• What is Measurement Studio• Key Features of Measurement Studio• Installation• Getting Started with Measurement Studio• Example• Result

May 2, 2023 Ashish Chandiok,Dayalbagh Engineering Institute 2

Page 3: Measurement Studio by Mr. Ashish chandiok

What is Measurement Studio• Measurement Studio is the only suite of tools designed for

building professional engineering applications in Microsoft Visual Studio 2010, 2012, and 2013

• It acquire, analyse, and display measurement data.

• It offers extensible measurement classes and user interface (UI) controls for Windows Presentation Foundation (WPF), Windows, and Web Forms to help you design an end-to-end test or measurement system in Visual Basic .NET and Visual C#.

May 2, 2023 Ashish Chandiok,Dayalbagh Engineering Institute 3

Page 4: Measurement Studio by Mr. Ashish chandiok

Key Features of Measurement Studio

May 2, 2023 Ashish Chandiok,Dayalbagh Engineering Institute 4

Engineering UI Controls Present Data in an Intuitive and Impactful FormatUse graphs, charts, gauges, knobs, meters, and LEDs that are designed for engineering applications and are compatible with hardware-acquired data types.Easily Create Professional UIsChoose from a full suite of WPF controls to create a sophisticated, resolution-independent user experience.

Support Tools in Visual StudioStart With Integrated Examples, Templates, and WizardsGet started faster with over 100 fully functional example applications and built-in project templates. Access Help and Technical SupportReceive personalized help from trained engineers to design, set up, and troubleshoot your hardware and software.

                          

Page 5: Measurement Studio by Mr. Ashish chandiok

Key Features of Measurement Studio

May 2, 2023 Ashish Chandiok,Dayalbagh Engineering Institute 5

Hardware CommunicationAchieve Shorter Time to Meaningful MeasurementsRemove the complexity of hardware communication through high-level, intuitive, object-oriented hardware class libraries. Accelerate Development With Productivity ToolsInteractively configure and generate ready-to-use DAQ code from within Visual Studio.

Advanced Analysis LibrariesDraw Meaningful Information From Your DataAccess over 500 engineering functions such as frequency analysis, curve fitting, statistics, and advanced math.Implement Inline Processing of Raw DataPerform inline analysis in real time on acquired signals without the difficult task of writing custom parsing algorithms.

Page 6: Measurement Studio by Mr. Ashish chandiok

Key Features of Measurement Studio

May 2, 2023 Ashish Chandiok,Dayalbagh Engineering Institute 6

Installer BuilderEnsure Proper Run-Time BehaviorHarness Microsoft Windows Installer distribution technology to package built libraries, executables, drivers, and dependencies into a single installer. Stay in Your Native Environment Launch the Installer Builder from within Visual Studio and configure options in an intuitive user interface.Compatibility With NI TestStandAutomate the Test ProcessUse Measurement Studio to create the UI for your test system. Take Advantage of Flexible DebuggingEdit and debug .NET assemblies from NI TestStand using Visual Studio with direct integration provided by Measurement Studio.

Back to Top

                                              

Page 7: Measurement Studio by Mr. Ashish chandiok

Getting Started with Measurement Studio• Getting Started information—Refer to the installed NI Measurement Studio Help topic

to get started with Measurement Studio. For a list of Measurement Studio resources, refer to the Using the Measurement Studio Help topic in the NI Measurement Studio Help.

• Examples—Measurement Studio installs examples organized by class library, depending on the component, the version of Visual Studio or the .NET Framework that the example supports, the version of Measurement Studio installed on the system, and the operating system. For more information on example locations, refer to the Where to Find Examples topic in the NI Measurement Studio Help.

• Measurement Studio website, ni.com/mstudio—Contains Measurement Studio news, support, downloads, white papers, and product tutorials.

• NI Technical Support, ni.com/support—Provides access to online example programs, tutorials, technical news, and Measurement Studio discussion forums.

Review the information from the Microsoft website on using Visual Studio.

May 2, 2023 Ashish Chandiok,Dayalbagh Engineering Institute 7

Page 8: Measurement Studio by Mr. Ashish chandiok

Example: Creating Measurement Studio App• Setting up the project—Using the Measurement Studio Application Wizard, we will

create a new project that references the Measurement Studio Analysis class library and Windows Forms controls.

• Adding user interface controls to the project—Using the Toolbox, smart tags, and the Properties window, you will add and configure a button, waveform graph, legend, gauge, and numeric edit user interface control.

• Generating, plotting, and analyzing the data—Using WhiteNoiseSignal and Mean, you will generate data, plot the generated data on a waveform graph, and calculate the mean of the data.

• 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.

May 2, 2023 Ashish Chandiok,Dayalbagh Engineering Institute 8

Page 9: Measurement Studio by Mr. Ashish chandiok

Example: Before Creating a project, Requirements

• Before you begin The following components are required to complete a project in Measurement Studio:• Microsoft Visual Studio 2010 or later • Measurement Studio 2010 or later (Professional or Enterprise edition)• NIDAQMX Software

May 2, 2023 Ashish Chandiok,Dayalbagh Engineering Institute 9

Page 10: Measurement Studio by Mr. Ashish chandiok

Example: Setting up of the Project

Step 1. Select Start» All Programs» Microsoft Visual Studio» Microsoft Visual Studio. Step 2. Select File» New» Project. The New Project dialog box launches.

May 2, 2023 Ashish Chandiok,Dayalbagh Engineering Institute 10

Page 11: Measurement Studio by Mr. Ashish chandiok

Example: Setting up of the Project

Step 3 In the New Project window, in the pane on the left side, select Installed Templates, then select Visual C# or Visual Basic, depending on which language you want to create the project in. You can then select Measurement Studio to see a list of Measurement Studio project templates in the center pane. Step 4 In the center pane, select NI Windows Application. Specify MyMeasurementStudioProject for Name and specify a Location of your choice. Step 5Click OK. The Measurement Studio Application Wizard launches. Step 6Select Analysis Library and Windows Forms User Interface Control Library.

May 2, 2023 Ashish Chandiok,Dayalbagh Engineering Institute 11

Page 12: Measurement Studio by Mr. Ashish chandiok

Example: Setting up of the Project

Step 7Select Analysis Library and Windows Forms User Interface Control Library.

May 2, 2023 Ashish Chandiok,Dayalbagh Engineering Institute 12

Page 13: Measurement Studio by Mr. Ashish chandiok

Example: Adding User Interface Controls

Step 1Select View» Toolbox to display the Toolbox. The Toolbox contains components and controls that you can add to your project.

May 2, 2023 Ashish Chandiok,Dayalbagh Engineering Institute 13

Page 14: Measurement Studio by Mr. Ashish chandiok

Example: Adding User Interface Control

Step 2Expand the All Windows Forms group. The All Windows Forms group contains controls and components included in the System.Windows.Forms namespace.Step 3Select the Button control and drag and drop it onto the form.Step 4Right-click the button and select Properties to display the Properties window. You configure the properties of the control in the Properties window. Step 5The Text property will be highlighted. Type Start for the button text. Step 6Expand the Measurement Studio group in the Toolbox.

May 2, 2023 Ashish Chandiok,Dayalbagh Engineering Institute 14

Page 15: Measurement Studio by Mr. Ashish chandiok

Example: Adding User Interface Control

Step 7Select the WaveformGraph control and drag and drop it onto the form. Step 8Right-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.

Step 9 Type Plot for the

Name. Click OK.

May 2, 2023 Ashish Chandiok,Dayalbagh Engineering Institute 15

Page 16: Measurement Studio by Mr. Ashish chandiok

Example: Adding User Interface Control

Step 7Select the Waveform Graph control and drag and drop it onto the form. Step 10Select the Legend control and drag and drop it onto the form. Step 11Select the Numeric Edit control and drag and drop it onto the form. Step 12Select the Gauge control and drag and drop it onto the form. Step 13Click the gauge smart tag to display the Gauge Tasks.

May 2, 2023 Ashish Chandiok,Dayalbagh Engineering Institute 16

Page 17: Measurement Studio by Mr. Ashish chandiok

Example: Adding User Interface Control

Step 14Type gauge for the name of the gauge.

May 2, 2023 Ashish Chandiok,Dayalbagh Engineering Institute 17

Page 18: Measurement Studio by Mr. Ashish chandiok

Example: Adding User Interface Control

May 2, 2023 Ashish Chandiok,Dayalbagh Engineering Institute 18

Page 19: Measurement Studio by Mr. Ashish chandiok

Example: Generating Plotting and Analysing DataC#Step 1Double-click the button control to display the Form1 code, with the cursor inside the click event handler of the button control.Step 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.C# code// 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.PlotY(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;

May 2, 2023 Ashish Chandiok,Dayalbagh Engineering Institute 19

Page 20: Measurement Studio by Mr. Ashish chandiok

Example: Generating Plotting and Analysing Data VB.NetStep 1Double-click the button control to display the Form1 code, with the cursor inside the click event handler of the button control.Step 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 code

' 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.Plot.PlotY(data)

' Use the Mean method to calculate the mean of the data.Dim mean As Double = Statistics.Mean(data)

' Display the mean on the gauge.gauge.Value = mean

May 2, 2023 Ashish Chandiok,Dayalbagh Engineering Institute 20

Page 21: Measurement Studio by Mr. Ashish chandiok

Example: Customizing user interface

Step 1Right-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. Step 2Select 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.

May 2, 2023 Ashish Chandiok,Dayalbagh Engineering Institute 21

Page 22: Measurement Studio by Mr. Ashish chandiok

Example: Customizing User Interface

Step 3Right-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.

May 2, 2023 Ashish Chandiok,Dayalbagh Engineering Institute 22

Page 23: Measurement Studio by Mr. Ashish chandiok

Example: Customizing User Interface

Step 3Right-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. Step 4Select Points Only. Click OK. Notice that the legend changed automatically to match the formatting of the graph.

May 2, 2023 Ashish Chandiok,Dayalbagh Engineering Institute 23

Page 24: Measurement Studio by Mr. Ashish chandiok

Example: Customizing User Interface

Step 5Click the gauge smart tag to display the Gauge Tasks. Step 6Select Auto Format to display the Auto Format dialog box. Step 7Select Dark and click OK. Step 8Right-click the gauge and select Properties to display the Properties window. Step 9Set 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.

May 2, 2023 Ashish Chandiok,Dayalbagh Engineering Institute 24

Page 25: Measurement Studio by Mr. Ashish chandiok

Example: Customizing User Interface

Step 10Click the numeric edit smart tag to display the NumericEdit Tasks. Step 11Select Gauge in the Source drop-down list. Setting the Source property to the gauge allows two-way binding between the controls.Step 12Deselect 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. Step 13Select 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. Click OK.

May 2, 2023 Ashish Chandiok,Dayalbagh Engineering Institute 25

Page 26: Measurement Studio by Mr. Ashish chandiok

Example: Customizing User Interface

Step 14Select File » Save Form1.cs to save your application. Step 15Select Debug » Start Without Debugging to run the application.

May 2, 2023 Ashish Chandiok,Dayalbagh Engineering Institute 26

Page 27: Measurement Studio by Mr. Ashish chandiok

Example: Result

May 2, 2023 Ashish Chandiok,Dayalbagh Engineering Institute 27