ACS Starter Kit v14

Academic Community Service LabVIEW Starter Kit v14

Version of this document: 14.0

Overview

The Academic Community Service (ACS) Starter Kit has two main components:

  • OMFListener: a Windows application to run on the PC with LabVIEW. It listens for and buffers HTTP messages received from LabVIEW and then forwards those messages to the OSIsoft PI System running in Microsoft Azure Cloud.
  • MainSensorLoop Virtual Instrument: this VI shows an actual usage of the 4 ACS Virtual Instruments (Initialize, Collect, Archive and Close) necessary to archive data.

OMFListener sends collected data to the Academic Community Service (ACS) hosted in Azure and fully administered by OSIsoft. This architecture allows lab administrators and students to focus on the sensor data collection easily within the known LabVIEW environment and then visualize the results in PI Vision or access it easily through standard tools like MatLab, Python and R for analysis.

The steps to ACS-enable an existing LabVIEW applications are the following:

  1. One-time install of Redis and OMFListener (for lab admin)
  2. Configure and run MainSensorLoop
  3. Copy-paste MainSensorLoop into the existing LabVIEW application and run
  4. Wire sensor data for ACS

One-Time Installation of Redis and OMFListener Configuration

OMFListener uses a persistent queue module which relies on Redis (https://redis.io/) for message storage. So first install Redis by double-clicking on Redis-x64-3.2.100.msi in directory OMFListener in the unzipped Starter Kit. Select all default options.

OMFListener doesn't need to be installed, only configured. If a newer version is available than the one within the Starter Kit, it will be automatically downloaded and installed when you first run OMFListener.

WARNING 1: OMFListener takes between 10-20 secs to start displaying something once started.

WARNING 2: some protection software may prevent OMFListener from connecting to the network. Those applications usually ask if you want to block/unblock OMFListener. Please answer that you trust OMFListener for communication.

To configure OMFListener, double-click on OMFListener.exe in directory OMFListener. The very first time Windows Defender SmartScreen may warn you that OMFListener is not recognized. Please click 'More info' as shown below:

Academic PI OMFListener not recognized by Windows Defender

Tell Windows Defender to trust OMFListener:

"Tell Windows Defender to run OMFLister

The very first time OMFListener starts in configuration mode and asks for your ACS email. It should be the same email as the one for the OSIsoftInnovation invite email, unless you've been told otherwise.

Once correctly configured, you should see it running with stats at the end similar to: "ACS OMFListener Start Running"

Leave it running to collect data from LabVIEW.

NOTE: It is possible to test OMFListener without LabVIEW. Follow the following step

  1. In directory tests, double-click on tanktest.exe to start it

  2. In the console window for tanktest , press for the Relay URL (default is OMFListener)

  3. Enter a name for the asset element that will be created. The asset created on ACS will be named tank<name> where <name> is the string you just provided. In the example below the asset is tanktest1: "ACS Tanktest.exe Input"

  4. You can check that the data has been archived by ACS from the Data Portal at https://academicpi.portal.azure-api.net/data-portal with username reader0 and password OSISoft2017, then click 'Submit': "ACS Data Portal Home" Then click on 'Select Database' to see which ones are available: "ACS Data Portal View Databases" Select the 'LabVIEW' database: "ACS Data Portal Select LabVIEW Database" Expend the LabVIEW node in Explorer by clicking on the small triangle found to its left: "ACS Data Portal Expend LabVIEW node" Expend further nodes to pick the tanktest1 asset: "ACS Data Portal Select tanktest1 Asset" Hover the mouse over one of the two simulated sensor reading to see its current value. Verify that the timestamp for the value is close to the current time (UTC): "ACS Data Portal tanktest1 Current Value Timestamp"

  5. It also possible to visualize the simulated (random) sensor values sent to ACS by going to PI Vision at https://academicpi.osisoft.com/PIVision:

    a. From PI Vision home page, click on the display named Tank - Test XYZ where YXZ is your university (e.g. CMU) Academic PI PI Vision Home Page b. Click on the asset selector to navigate to your newly created tank asset (Beware: it can take up to 3-5 minutes for a new asset to show up): Tank Test Display Asset Selection

To learn more on how to create your own display, please check this PI Vision Quick Start video at: https://www.youtube.com/watch?v=zi2yhapGmyA&list=PLMcG1Hs2JbcvWPkSbIbQEJqsTX9Sa1nty&index=2

Configure and run MainSensorLoop

Debug mode

The MainSensorLoop VI shows how to use the 4 Academic PI to archive sensor data. To do so, two simulated signal are generated, one Sine signal and a Triangle signal. The third one (Combo) is the sum of the first two ones.

First open MainSensorLoop.vi by double-clicking on it.

You should see a front panel like the one below: Academic PI MainSensorLoop Front Panel Default Configuration

The configuration filename Sample_config.ini in the text box indicates that the panel configuration panel information would be read from that file. This file is located in the same directory as MainSensorLoop.vi. You can load it by starting and stopping quickly the the MainSensorLoop VI. Just after the front panel should look like this: Academic PI MainSensorLoop Front Panel Default Config Loaded

Since the OMFListener URL is http://localhost:6008/ingress/debug, the whole ACS Asset configuration is tested and operational except for the transmission of data to the ACS. This way it is possible to verify a ACS-enabled LabVIEW application without creating spurious and incorrect data templates which can prevent your final and correct configuration to work properly. This is the suggested way to proceed with all new ACS installation or when doing modification to an existing one.

If everything is OK, running MainSensorLoop will display signal curves should and OMFListener will indicate it is receiving debug message with an increasing 'D' counter and the OK ### BUT NO ARCHIVE ### (DEBUG) ### <TIME> message in the OMListener status text box. Academic PI MainSensorLoop Front Panel Debug Mode Running OK

Once your LabVIEW application runs OK in debug mode, it's time to start sending data to ACS.

Archive mode

Here are the steps to send data to ACS:

  1. Change the OMFListener URL to http://localhost:6008/ingress/messages : Academic PI MainSensorLoop Front Panel Switch to ingress/messages

  2. Toggle to Save Configuration: Academic PI MainSensorLoop Front Panel Toggle Save Configuration

  3. [Optional] To avoid overwrite file Sample_config.ini, change it to something else like Sample_config_write.ini: Academic PI MainSensorLoop Front Panel Change Save Configuration File

When you restart, data will be sent to ACS (check for OK message in OMFListener status box): Academic PI MainSensorLoop Front Panel Archive Mode

Again, it's possible to verify that data is correctly archived by ACS by going to the Data Portal or PI Vision.

In the following section, we describe all the possible error cases.

Troubleshooting ACS setup

If something doesn't work, it should be one of the following error:

  1. OMFListener is not running: this will be indicated in the error out box with error code 363500: Academic PI MainSensorLoop: OMFListener not Running

2. ACS: Declared and type for sensor X are different. Make sure that the declared type for the sensor name in error is Number: Academic PI MainSensorLoop: Declared and actual types for a sensor are different

3. ACS: [DNVT] Not found (sensor name: X). Make sure that the front panel name for the sensor matches the name or its not missing: Academic PI MainSensorLoop: Missing or mistyped sensor name

4. ACS: [Missing] Cannot find any sensor data for . Make sure all sensor in the front panel receive a value: Academic PI MainSensorLoop: Missing or mistyped sensor name

5. OMFListener stops working at some point. Check OMFListener status and restart if needed: ACS: OMFListener stopped working

NOTE 1: ALL sensors defined in the front panel MUST be wired to a unique sensor wire in the block diagram. An error message is returned if a given sensor is connected to 2 or more wires.

NOTE 2: it is possible to see the messages sent by OMFListener in the last 2 minutes by opening a browser at the address http://localhost:6008/lastmsgs

MainSensorLoop Block Diagram

The block diagram for MainSensorLoop is fairly simple as shown below:

Academic PI MainSensorLoop Block View

The next step involves copying the whole MainSensorLoop block diagram into the existing LabVIEW application. If MainSensorLoop is running stop it first, then go to its block view, click anywhere in the window and select everything with Ctrl-A.

Copy-paste MainSensorLoop into the existing LabVIEW application and run

With the MainSensorLoop block diagram in the paste buffer, now open the LabVIEW application to modify and paste MainSensorLoop some where into the block diagram.

It may look something like the screenshot below (the idea is to have the whole of MainSensorLoop with all the parts). Academic PI After Cut-and-Paste

Now reproduce the same front panel information in ACPI Asset front panel in the first screenshot, but put acpi_test_no2 instead of acpi_test_no1.

Try running it and see the message are sent at http://localhost:6008/lastmsgs.

Now it's time to wire some real sensor data

Wire sensor data for ACPI

DAQ Assistant is one of the most common way to get data into LabVIEW. It manages input/output to devices and map them to channels.

The small watch with a number at its left control how often (in milliseconds) sensor data is sent.

So first remove the simulated signals as below:

Acadmic PI Removed Signals

And then move one DAQ within the ACPI loop (or DAQ plus other associated VIs if need be):

Academic PI Moved DAQ in ACPI Loop

Connect the Convert from Dynamic Data Express VI to the channel wire coming out of the DAQ Assistant. First point the mouse on the left side of the VI until a wire coil shows up:

Convert from Dynamic Data VI wiring

And then left-click to start a wire and connect somewhere on the channel wire out of DAQ:

Convert from Dynamic Data VI connect

Connect to other Convert from Dynamic Data Express VI to the same channel wire:

Convert from Dynamic Data VI connected

Now the trick is to extract the right channel. To learn which channel is which, first right-click on the DAQ Assistant VI and select Properties from the menu:

DAQ Assistant Property Menu

You'll see the list of all possible channels in the Channel Settings pane:

DAQ Assistant Channel Settings

After clicking on the blue arrows near Details, it's possible now to see the channel number associated with its channel name. The channel number is the critical piece of information to extract it and feed it to ACPI Collect VI:

DAQ Assistant Channel Numbers

To select the channel to extract, right-click on the Convert from Dynamic Data Express VI and select Properties:

Convert from Dynamic Data VI properties

This opens the configuration panel for this VI. Select Single Scalar as the Resulting data type and the Channel number to extract.

Convert from Dynamic Data VI Property Panel

You can test this change by running this new VI and checking the values sent at http://localhost:6008/lastmsgs.

The next steps are:

  • Wire the remaining sensors
  • Rename the sensor names both in the block view and the front panel (they must match!) to reflect the correct sensor names and data
  • Change the element name and template name each time you change the number of sensors and their names

What to do with more than 3 sensors?

The trick is to daisy-chain (put in series) multiple Collect VI to get as many input as necessary. The screenshots below shows the sequence of steps to add a new Collect VI.

First make a copy of the Collect VI:

Copy Collect VI

The next steps are not commented.

Collect VI Session Out

Collect VI Session In

Collect VI Error Out

Collect VI Session Out 2

Archive VI Session In

Collect VI Error Out 2

Final configuration:

Collect and Archive VI Final Configuration

Last update: Mon, Oct 16, 2017 1:57:04 PM