Getting Started with Data Dashboard for LabVIEW

Publish Date: Oct 16, 2014 | 17 Ratings | 2.88 out of 5 |  PDF

Overview

Data Dashboard allows you to create custom, portable views of National Instruments LabVIEW applications. Using this application, you can create dashboards to display the values of network-published shared variables and deployed LabVIEW Web services on indicators, such as charts, gauges, textboxes, and LEDs.

Data Dashboard 2.2 is available for Apple iPad and Android tablets in the iTunes and Google Play Store. This tutorial describes the basic steps for getting started with Data Dashboard. You can find the same content plus more in the tutorials that are installed with the Data Dashboard app. For more background information on how Data Dashboard interfaces with network shared variables and LabVIEW Web Services, please see "Integrating NI Data Dashboard for LabVIEW into your LabVIEW Applications".

Table of Contents

  1. Creating a Dashboard 
  2. Deploying Shared Variables 
  3. Connecting to Shared Variables 
  4. Deploying Web Services in LabVIEW 2012 and Earlier
  5. Deploying Web Services in LabVIEW 2013 and Later
  6. Connecting to Web Services
  7. Additional Resources

1. Creating a Dashboard 

Open Data Dashboard on your device.  When the app opens you will see the screen shown below.  This main view is the dashboard carousel,  you can use the dashboard carousel to manage your dashboards.  To create a new dashboard tap the "+" sign at the bottom of the carousel and select New Dashboard.

You will then be prompted to choose the orientation of your dashboard, Portrait or Landscape. For this tutorial you can select either option.

Your new dashboard will open and appear as below.  To place an indicator on the dashboard tap the Controls and Indicators Icon and select Indicators.  This will open the indicators palette. 

To place an indicator on the dashboard, tap the desired indicator and then tap where you want to place it on the page. For this example, we want to drag a Chart and a Numeric on to the dashboard.

The next step is to link the indicators to the data connections.  The processes for linking Network Published Shared Variables and Web methods are described in the following sections.

 

Back to Top

2. Deploying Shared Variables 

Before you can link your dashboard controls and indicators you need to have variables to connect to.  If you already have a network-published shared variable deployed, you can move to the next section, Connecting to Shared Variables. To deploy network-published shared variables you will need to create a project in LabVIEW.

  1. In LabVIEW select File>>New Project to create a new LabVIEW project
  2. Add a shared variable to the project. Right-click My Computer in the Project Explorer window and select New>>Variable.

  1. Right-click the shared variable and select Rename. Rename the shared variable DDVariable1.
  2. Right-click My Computer and select New>>VI to create a new VI and add it to the project. This VI will periodically update the shared variable value with a random number.
  3. Save the project.
  4. Add a While Loop to block diagram of the VI. 
  5. Place a Random Number (0-1) function and a Wait (ms) function inside the While Loop. 
  6. Right-click the input terminal of the Wait (ms) function and select Create>>Constant. Set the value of the constant to 500 to update the value every half second. 
  7. Drag the shared variable you created from the Project Explorer window onto the block diagram. Right-click on the shared variable and select Access Mode>>Write. 
  8. Wire the output terminal of the Random Number (0-1) function to the input terminal of the shared variable.
  9. Right-click the input terminal of the stop terminal and select Create>>Control, to create a button for stopping and starting the program. Your block diagram should resemble the following example.

  1. You must deploy the shared variable before you can display its value in the Data Dashboard. In the Project Explorer window, right-click the project library that contains the shared variable and select Deploy.
  2. Run the application to continuously update the shared variable. 

 

Back to Top

3. Connecting to Shared Variables 

Now that you have placed your indicators and deployed your network-published shared variables you can link your dashboard to your shared variables.

  1. In Data Dashboard, tap the Chart indicator and select the Data Link icon shown in the following image.  This will open the Connect dialog.

  1. Select Shared Variables in the Connect dialog.  Then, enter the Shared Variable server DNS or IP address as shown in the following image. In most cases, this will be your computer's IP address. Tap Connect to connect to the Share Variable Engine.

  1. Tap the name of the library that contains the deployed shared variable.  Then, select your shared variable, as shown below. The data type of each shared variable is listed below the variable name. 

  1. Repeat steps 1-3 for your Numeric indicator. Data Dashboard only allows you to select shared variables that are compatible with the data type of the selected indicator. In this example, the deployed Shared Variable is a double-precision floating point number, which you can display using a Chart or Numeric indicator.  
  2. You can customize the chart's appearance by selecting the properties menu shown below. 

  1. Run the dashboard by selecting Play in the upper right hand corner. The running dashboard should appear similar to the following image. 

 

Back to Top

4. Deploying Web Services in LabVIEW 2012 and Earlier

In this section of the tutorial you will be creating a Web Service and a web method to connect your Data Dashboard. The following steps describe the process of building a Web Service with LabVIEW 2012 and earlier. For LabVIEW versions 2013 and later, please see "Deploying Web Services in LabVIEW 2013 and Later".

  1. Create a new LabVIEW project.
  2. Name the project Data Dashboard Demo.
  3. Add a new VI to the project. Name the VI DDDemo-Method.
  4. Place a Random Number (0-1) function on the block diagram. 
  5. Right-click on the output terminal of the Random Number (0-1) function and select Create>>Indicator.
  6. Edit the indicator label and rename the indicator as DDVariable1, as shown in the following image.

  1. Assign the indicator to a connector pane terminal for the VI so that Data Dashboard can monitor the output of the web method VI. 
    1. On the front panel, click a terminal of the connector pane. The terminal turns black
    2. Click the DDVariable1 indicator on the front panel. A marquee highlights the indicator and the terminal changes to the data type color to indicate you connected the terminal, as shown in the following image.

  1. Save the project. 
  2. Create a new Web service. Right-click Build Specifications in the Project Explorer window and select New>>Web Service (RESTful). On the Information page, set the Build specification name as "Data Dashboard Demo" and set the Service name as "DataDashboardDemo". Leave the Destination directory as the default setting.
  3. On the Source Files page, use the Add Item arrow to move the VI you created from the Project Files tree to the Service VIs tree.
  4. In the Configure RESTful VI dialog box, specify the following settings for the Web method VI. 

  1. Build the project.
  2. Right-click on Data Dashboard Demo build specification in the Project Explorer window and select Deploy to deploy the Web service application.

  1. Now to connect to your Web Service via Data Dashboard, continue to "Connecting to Web Services".

 

Back to Top

5. Deploying Web Services in LabVIEW 2013 and Later

In this section of the tutorial you will be creating a Web Service and a web method to connect your Data Dashboard. The following steps describe the process of building a Web Service with LabVIEW 2013 and later.

  1. Create a new LabVIEW project.
  2. Name the project Data Dashboard Demo.
  3. Right click My Computer and select New»Web Service. LabVIEW adds a Web Service project item and folders under the target.
  4. Right-click the Web Service project item and select Rename. Name the Web Service "DataDashboardDemo". 
  5. Right-click Web Resources and select New VI to create a new HTTP method VI. LabVIEW will open a new VI from a template.

  1. Place a Random Number (0-1) function on the block diagram.
  2. Right-click on the output terminal of the Random Number (0-1) function and select Create>>Indicator.
  3. Edit the indicator label and rename the indicator as DDVariable1, as shown in the following image.
  4. Assign the indicator to a connector pane terminal for the VI so that Data Dashboard can monitor the output of the web method VI. 
    1. On the front panel, click a terminal of the connector pane. The terminal turns black.
    2. Click the DDVariable1 indicator on the front panel. A marquee highlights the indicator and the terminal changes to the data type color to indicate you connected the terminal, as shown in the following image.

  1. Save the VI as DDDemo-Method.vi 
  2. Right-click on the DataDashboardDemo Web Service in the Project Explorer window and select     Application Web Server»Publish to publish the Web Service application. The Deployment Progress dialog box appears. When the Web Service publishes successfully, close the dialog box.

 

Back to Top

6. Connecting to Web Services

Now that you have placed down your indicators and deployed your Web Service, you can link your dashboard indicators to your Web methods.  There are two ways to connect to a Web method, polling and calling.  Polling a Web method calls the Web method continuously every .3 to 30 seconds as specified by the user.  Calling a Web method only calls the Web method when the Call button is pressed.  For this tutorial, we will use a polling connection to continuously populate the data on our chart and indicator.

  1. In Data Dashboard, tap the Controls and Indicators icon and select LabVIEW Web Services.

  1. Add a Poll Web Service to the dashboard and select the Web Link icon.

  1. The Web Services connection dialog will open and you will be able to enter the server DNS or IP address, and Port of your Web Service.  Tap Connect.

  1. Next, you will see a display of Web Services hosted on your target.  Choose your Web Service and then, the Web Method you want to link to your poll.

  1. When the Web method connects successfully, you will see the Web Link icon turn green.  To link your Poll to an indicator select the name of the variable you want to link.

  1. You will now see an overlay that shows you which indicators on the dashboard that you can link to your variable.  Tap the Chart to link the your Web method variable to the chart indicator.  You can also choose to create a new indicator from the overlay.

  1. When you finish linking your Web method variable, you will see the mappings as shown below. 

  1. Repeat steps 1-7 to link your Numeric indicator to your Web method. Run your dashboard. The running dashboard should appear similar to the following image.  

 

Back to Top

7. Additional Resources

These are links to our Data Dashboard community resources as well as articles that have more in depth information about the LabVIEW features used in this tutorial.

NI Community: Data Dashboard Product Page

NI Community: Troubleshooting and Support for Data Dashboard

NI Community: Smartphones, Tablets, and Mobile Devices Developer’s Forum

Whitepaoer: Integrating NI Data Dashboard for LabVIEW into your LabVIEW Applications

Whitepaper: Using the LabVIEW Shared Variable

Whitepaper: LabVIEW Web Services FAQ

Back to Top

Bookmark & Share


Ratings

Rate this document

Answered Your Question?
Yes No

Submit