Walkthrough: Creating a Measurement Studio Application with Web Forms Controls and Network Variable

From this document you will learn the answers to the following questions:

What is written to the server?

What is the name of the program that runs the walkthrough?

What interface does the walkthrough have?

Similar documents
Coupling Microsoft Visio with NI Requirements Gateway

Measurement Studio. Contents RELEASE NOTES

Walkthrough: Creating and Using an ASP.NET Web Service in Visual Web Developer

LabVIEW Report Generation Toolkit for Microsoft Office User Guide

Getting Started with the LabVIEW Mobile Module Version 2009

Crystal Reports. For Visual Studio.NET. Reporting Off ADO.NET Datasets

Coupling Microsoft Excel with NI Requirements Gateway

LabVIEW Report Generation Toolkit for Microsoft Office

Getting Started Manual

Getting Started with the LabVIEW Mobile Module

VB.NET - WEB PROGRAMMING

Cloud Attached Storage

System Overview and Terms

Census. di Monitoring Installation User s Guide

Hands-On Lab. Lab 01: Getting Started with SharePoint Lab version: Last updated: 2/23/2011

Scripting with CAMMaster And Visual Basic.NET

LabVIEW DSP Test Integration Toolkit for TI DSP

NI InsightCM Server Version 1.0

Measurement Studio. Contents RELEASE NOTES

Hands-On Lab. Building a Data-Driven Master/Detail Business Form using Visual Studio Lab version: Last updated: 12/10/2010.

Working with SQL Server Integration Services

Crystal Reports. For Visual Studio.NET. Designing and Viewing a Report in a Windows Application

Hands-On Lab. Client Workflow. Lab version: Last updated: 2/23/2011

Configuring.NET based Applications in Internet Information Server to use Virtual Clocks from Time Machine

Application Note No. 12

Save Actions User Guide

Crystal Reports Installation Guide

Getting Started with Telerik Data Access. Contents

Issue Tracking Anywhere Installation Guide

DEPLOYING A VISUAL BASIC.NET APPLICATION

Appendix A How to create a data-sharing lab

BACKING UP DATA FROM VIRTUAL OFFICE CS OR SAAS APPLICATIONS

Intelli-M Access Quick Start Guide

This document describes the installation of the Web Server for Bosch Recording Station 8.10.

DAQ Getting Started Guide

0651 Installing PointCentral 8.0 For the First Time

Promap V4 ActiveX MSI File

EventTracker: Support to Non English Systems

To install the SMTP service:

Appendix K Introduction to Microsoft Visual C++ 6.0

HTTP communication between Symantec Enterprise Vault and Clearwell E- Discovery

Windows Server Update Services 3.0 SP2 Step By Step Guide

How To Develop A Mobile Application On Sybase Unwired Platform


Introduction to the use of the environment of Microsoft Visual Studio 2008

Lab Answer Key for Module 9: Active Directory Domain Services. Table of Contents Lab 1: Exploring Active Directory Domain Services 1

Getting Started with the LabVIEW Embedded Module for ARM Microcontrollers 1.0 For the Keil MCB2300

CRM Setup Factory Installer V 3.0 Developers Guide

Dell PowerVault MD Storage Array Management Pack Suite Version 6.0 for Microsoft System Center Operations Manager Installation Guide

Tutorial: Windows Mobile Application Development. Sybase Unwired Platform 2.1 ESD #2

USER GUIDE Appointment Manager

Distributing SMS v2.0

NovaBACKUP xsp Version 15.0 Upgrade Guide

Setting Up a Unisphere Management Station for the VNX Series P/N Revision A01 January 5, 2010

Tutorial #1: Getting Started with ASP.NET

Wavecrest Certificate

Install the Production Treasury Root Certificate (Vista / Win 7)

How to Install and Setup IIS Server

Sitecore Ecommerce Enterprise Edition Installation Guide Installation guide for administrators and developers

Secrets of Event Viewer for Active Directory Security Auditing Lepide Software

Richmond SupportDesk Web Reports Module For Richmond SupportDesk v6.72. User Guide

Configuring Load Balancing

Getting Started Guide

Microsoft SQL Server 2008 R2 (64-bit) Standard Edition Installation Guide

Generating Visual Studio Project Files

About Measurement Studio

Appendix M: Introduction to Microsoft Visual C Express Edition

Create a New Database in Access 2010

Microsoft SQL Server 2008 R2 Express Edition with Advanced Services Installation Guide

Business Insight Report Authoring Getting Started Guide

How To Install Ctera Agent On A Pc Or Macbook With Acedo (Windows) On A Macbook Or Macintosh (Windows Xp) On An Ubuntu (Windows 7) On Pc Or Ipad

A SharePoint Developer Introduction. Hands-On Lab. Lab Manual HOL8 Using Silverlight with the Client Object Model C#

Developing, Deploying, and Debugging Applications on Windows Embedded Standard 7

Hands-On Lab. Web Development in Visual Studio Lab version: Last updated: 12/10/2010. Page 1

Creating and Issuing the Workstation Authentication Certificate Template on the Certification Authority

How to Configure a Secure Connection to Microsoft SQL Server

HELP DOCUMENTATION E-SSOM DEPLOYMENT GUIDE

Step-by-Step Guide for Microsoft Advanced Group Policy Management 4.0

A SharePoint Developer Introduction. Hands-On Lab. Lab Manual SPCHOL306 Using Silverlight with the Client Object Model VB

Contents Overview... 5 Configuring Project Management Bridge after Installation... 9 The Project Management Bridge Menu... 14

System Area Management Software Tool Tip: Integrating into NetIQ AppManager

1/4/12 Installing and Configuring WebDAV on IIS 7 : WebDAV for IIS 7.0 : Publishing Content to Web Sites : T

NI-XNET Hardware and Software

How to test and debug an ASP.NET application

Non-ThinManager Components

Integration with Active Directory

Lab 8: ASP.NET 2.0 Configuration API and Health Monitoring

Tutorial Build a simple IBM Rational Publishing Engine (RPE) template for IBM Rational DOORS

Technical White Paper

Administration Guide. . All right reserved. For more information about Specops Deploy and other Specops products, visit

KEYWORDS InteractX, database, SQL Server, SQL Server Express, backup, maintenance.

TIBCO Spotfire Automation Services Installation and Configuration

About SharePoint Server 2007 My Sites

LDAP Server Configuration Example

K2 Designer for SharePoint Hands-On Exercise - Leave Request process

Administrator s Guide to deploying Engagement across multiple computers in a network using Microsoft Active Directory

How To Integrate SAP Business Data Into SharePoint 2010 Using Business Connectivity Services And LINQ to SAP

To install Multifront you need to have familiarity with Internet Information Services (IIS), Microsoft.NET Framework and SQL Server 2008.

Learn how to create web enabled (browser) forms in InfoPath 2013 and publish them in SharePoint InfoPath 2013 Web Enabled (Browser) forms

IIS Web Server Configuration Guide

Transcription:

Walkthrough: Creating a Measurement Studio Application with Web Forms Controls and Network Variable Before You Begin 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: Writing an array of data to the server Using NationalInstruments.NetworkVariable.NetworkVariable BufferedWriter<TValue>, you will create and run a console application that writes an array of values to the server. Setting up a Web Forms project Using the Measurement Studio Application Wizard, you will create a new project that references the 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 a NationalInstruments. UI.WebForms.WaveformGraph control to display the data. 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. Select Start»All Programs»Microsoft Visual Studio 2005» Microsoft Visual Studio 2005. 2. Select File»New»Project. The New Project dialog launches. 3. In the Project Types pane, select Visual C# or Visual Basic, depending on which language you want to create the project in. 4. In the Templates pane, select Console Application. Specify NetworkVariableWriter for Name and specify a Location of your choice. 5. Click OK. 6. Select Measurement Studio»Add/Remove.NET Class Libraries. The Measurement Studio Add/Remove Class Libraries Wizard launches. You use this wizard to add Measurement Studio components to your project. Measurement Studio Walkthrough 2 ni.com

7. Select NetworkVariable Communication Library. Click Finish. 8. 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 Module1 Private Function GenerateDoubleArray(ByVal phase As Double) As Double() Dim values(999) As Double Dim x As Integer For x = 0 To 999 values(x) = Math.Sin(((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) National Instruments Corporation 3 Measurement Studio Walkthrough

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 System.Threading; using NationalInstruments.NetworkVariable; namespace NetworkVariableWriter { class Program { private static double[] GenerateDoubleArray(double phase) { double[] values = new double[1000]; for (int x = 0; x < 1000; x++) values[x] = Math.Sin(((2 * Math.PI * x) / 1000) + phase) * 2; return values; } static void Main(string[] args) { const string Location = @"\\localhost\system\double"; NetworkVariableBufferedWriter<double[]> bufferedwriter = new NetworkVariableBufferedWriter<double[]>(Location); bufferedwriter.connect(); int phase = 0; while (true) { double[] value = GenerateDoubleArray(phase); Console.WriteLine("Writing array"); bufferedwriter.writevalue(value); Thread.Sleep(500); phase++; } } } } Measurement Studio Walkthrough 4 ni.com

9. Select Debug»Start Without Debugging to run the application. 10. Minimize the console application, but keep the application running. Setting Up a Web Forms Project 1. Select Start»All Programs»Microsoft Visual Studio 2005» Microsoft Visual Studio 2005. 2. Select File»New»Web Site. The New Web Site dialog box launches. National Instruments Corporation 5 Measurement Studio Walkthrough

3. In the Templates pane, select NI ASP.NET Web Site. Select File System for Location and specify a file path of your choice. 4. Use the drop-down box to select Visual C# or Visual Basic, depending on which language you want to create the project in. 5. Click OK. The Measurement Studio ASP.NET Web Site Wizard launches. Measurement Studio Walkthrough 6 ni.com

6. Select Network Variable Communication Library and Web Forms User Interface Control Library. Tip If you are working with an existing project, you can access the Add/Remove Class Libraries dialog box by selecting Measurement Studio»Add/Remove Class Libraries Wizard. 7. Click Finish to display Default.aspx in the Web Forms Designer. 8. You can rename the title of your Web page. Click inside the <title> tag and rename the title to Measurement Studio Network Variable and Web Forms Controls 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 display the Toolbox. The toolbox contains components and controls that you can add to your project. 3. Expand the Measurement Studio group on the Toolbox. 4. Select the NetworkVariableDataSource control in the toolbox and drag and drop it on the form. The NationalInstruments. National Instruments Corporation 7 Measurement Studio Walkthrough

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 NationalInstruments.NetworkVariable functionality. 5. In the NetworkVariableDataSource smart tag, select Edit Bindings to launch the NetworkVariableBinding Collection Editor dialog box. 6. Select Add. You add a binding to create a connection with the underlying network variable, and you use the NetworkVariableBinding Collection Editor to configure the binding properties. Select Object for the BindingType. You select Object because this walkthrough binds to NationalInstruments.UI.WebForms. WaveformGraph.BindingData. Enter 0 as the DefaultReadValue. Measurement Studio Walkthrough 8 ni.com

7. Browse to the \\localhost\system\double location in the Select Network Item dialog box. 8. Click OK to return to the NetworkVariableBinding Collection Editor dialog box. 9. 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. 3. In the AutoRefresh smart tag, check Enabled. Select Edit Default Refresh Items to launch the RefreshItem Collection Editor dialog box. 4. Select Add. Select WaveformGraph1 for the ItemID and click OK. National Instruments Corporation 9 Measurement Studio Walkthrough

5. Double-click the AutoRefresh control. Add the following code to the AutoRefresh event handler to bind the waveform graph control to the network variable data source control: [VB.NET] WaveformGraph1.BindingData = NetworkVariableDataSource1.Bindings(0).GetValue() [C#] WaveformGraph1.BindingData = NetworkVariableDataSource1.Bindings[0].GetValue(); 6. Select File»Save Default.aspx to save your application. Measurement Studio Walkthrough 10 ni.com

7. Select Debug»Start Without Debugging to run the application. The waveform graph displays the array of data. Note You can also use the System.Web.UI.WebControls.FormView control to bind to NationalInstruments.NetworkVariable.WebForms. NetworkVariableDataSource. Refer to Using the Measurement Studio Network Variable Data Source in Web Forms for more information. 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. Other product and company names mentioned herein are trademarks or trade names of their respective companies. For patents covering National Instruments products, refer to the appropriate location: Help»Patents in your software, the patents.txt file on your CD, or ni.com/patents. 2007 National Instruments Corporation. All rights reserved. 351522A-01 Oct07