Getting Started with the Data Dashboard for LabVIEW

Publish Date: May 06, 2013 | 13 Ratings | 3.08 out of 5 |  PDF


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.0 is available for the Apple iPad in the Apple App Store. This tutorial describes the basic steps for getting started with Data Dashboard 2.0. You can find the same content plus more in the tutorials that are included in Data Dashboard 2.0.

Table of Contents

  1. Creating a Dashboard 
  2. Deploying Shared Variables 
  3. Connecting to Shared Variables 
  4. Deploying Web Services
  5. Connecting to Web Services

1. Creating a Dashboard 

Open Data Dashboard 2.0 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 pallet. 

To place an indicator on the dashboard drag it from the pallet onto the page.  For this example we want to drag a Chart and a Numeric on to the page. 

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 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. Build and 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. 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. 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 2.0 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 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. 

  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 the Data Dashboard can monitor the output of the Web method VI. 
    1. On the front panel, select a connector pane pattern.
    2. Click a terminal of the connector pane. The terminal turns black.
    3. 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). Refer to LabVIEW Help: Building and Accessing a LabVIEW Web Service Application if you need a more detailed instructions on creating a LabVIEW Web service.
  3. On the Information page, select the name of the Web service and its destination directory. Use the default settings. 
  4. 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.
  5. 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.

Back to Top

5. 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. Tap the Controls and Indicators icon and select LabVIEW Web Services.

  1. Drag 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 adorner 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

Bookmark & Share


Rate this document

Answered Your Question?
Yes No