Hub Help.md

OSIsoft Academic Hub LabVIEW Toolkit v1.5.0

NOTE: the Hub user portal can be found at: http://academic.osisoft.com

Last update: 2/12/2019

Overview

The OSIsoft Academic Hub Toolkit has two main components:

  • OMFListener: a Windows application to run on the PC with LabVIEW. It receives and buffers HTTP messages received from LabVIEW and forwards those messages to the OSIsoft Academic Hub backend.
  • Hub VIs and 6 Sample VIs showing all the supported ways to collect data:
    • SampleSignals.vi generates 3 signals which are then collected with the Hub
    • SampleDAQAssistant.vi (requires NI-DAQ to be installed) shows an Hub-enabled example with simple data acquisition using DAQ Assistants simulators
    • Please jump to this section for detailed information how to convert your LabVIEW VI for the Academic Hub.

The Academic Hub Toolkit for LabVIEW and Hub accounts are all that's required to start sending data to the Hub which is hosted in Azure and fully administered by OSIsoft. This architecture allows professors, lab administrators and students to focus on sensor and data collection 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 Hub-enable an existing LabVIEW applications are the following:

  1. Installation of VI Package Manager (for lab admin)
  2. Installation of LabVIEW Hub Toolkit (for lab admin)
  3. Installation of Redis and configuration of OMFListener (for lab admin)
  4. Testing with Hub toolkit sample: SampleSignals.vi
  5. Other examples how to collect data

Hub Toolkit Installation for LabVIEW

Note: a Hub account and OMFListener token are required to complete Hub Toolkit installation.

Step 1: Install VI Package Manager

Hub Toolkit for LabVIEW is distributed as a package, like other toolkits found on National Instrument LabVIEW Tools Network. Those packages are installed and managed using the VI Package Manager (VIPM) from JKI.

To install VIPM, please to go https://academic.osisoft.com/toolkit for a download link. Open the installer file and complete the installation.

Step 2: Install Hub Toolkit

The web page https://academic.osisoft.com/toolkit also has a link on the latest release of the Hub Toolkit. Download the package on your LabVIEW computer and double-click (or open) the toolkit package file to start VIPM which will bring up a window like the following: Hub Toolkit Installation with VIPM

Note that Academic Hub Toolkit requires LabVIEW 2014 or newer.

Click Install to proceed. Once completed, keep this window around for the next step.

Step 3: Configure OMFListener

The Hub Toolkit installs a new option in LabVIEW Tools menu: Start OMEListener: ACS Start OMFListener in Tools Menu

Select this option and confirm that OMFListener is started by seeing this window: ACS Start OMFListener VI

WARNING 1: OMFListener takes between 10-20 secs to start displaying something once started, so please be patient.

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/execution.

The very first time OMFListener runs on a computer, it won't find Redis, an open source in-memory data structure store, used to buffer messages. The following web page will display: Hub Install Redis page

Please download and install Redis with default options (click Next on all panels): Hub Redis Installer

You need local administrator rights to install Redis

Once Redis is installed, restart OMFListener by clicking on the link provided: Restart OMFListener after Redis

Finally OMFListener needs a token to register itself with the Hub ingress service (Azure IoT Hub): OMFListener token

If a token wasn't already provided to you, contact hubssupport@osisoft.com/.

After a successful registration, OMFListener statistics page should show up: Hub OMFListener stats page Take note of the Hub root information. This is required to browse to your data with the data portal later on.

Step 4: Test with SampleSignals VI

To access the SampleSignals VI, in LabVIEW navigate to the Help -> Hub LabVIEW Toolkit -> Hub Help menu. This opens a File Explorer window with the directory where all the Hub VI samples are installed. Double-click on SampleSignals.vi to open it. Then double-click SampleSignals.vi to open it within LabVIEW: Hub SampleSignals Front Panel

The first step to run this sample is to generate a configuration file name Sample_config.ini. During this step, the block diagram is scanned to collect sensor/data names and types. No messages are sent to the Hub during configuration.

Generation of the configuration file is done by:

  1. Putting the configuration toggle Init
  2. Providing an asset name to anchor all sensor/data sent to the Hub.

Below is an example: Hub SampleSignals Configuration Generation

Running this VI once should display that the configuration file has been generated. The front panel reflects all the sensor/signal that have been collected from the block view: Hub SampleSignals Configuration OK

You're now ready to start collecting data. To do so, make sure that OMFListener is running and then simply restart the VI (now in 'Run' mode): Hub SampleSignals Running OK

Step 5: Check sent values with PI Vision

To check quickly that OMFListener transmitted real-time data is archived correctly, it's possible to jump to the pre-built PI Vision display by clicking the link showing on OMFListener statistics web page (to re-open this web page, simply go to Tools -> Start_OMEListener): SampleSignals link with OMFListener

If SampleSignals.vi is running correctly, the root in (1) will match the value in (2), and the asset name last part in (3) should match the asset name you assigned when you configured SampleSignals.vi. You're ready to click the link pointed by (4) to display the predefined PI Vision display with your new asset: Hub SampleSignals PI Vision Display

To learn more about PI Vision and 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

Step 6: Check and download values with Hub Data Portal

You can also check and even download your data from the Hub Data Portal at https://academic.osisoft.com/data-portal: with username reader0 and password OSISoft2017, then click 'Submit': "Hub Data Portal Home"

Then click on 'Select Database' to see which ones are available: "Hub Data Portal View Databases"

Select the 'Classroom Data' database and expand the LabVIEW node in Explorer by clicking on the small triangle found to its left: "Hub Data Portal Expand LabVIEW node"

The data sent to the Hub is anchored under the root element shown on the OMFListener statistics page (in the case here osi_test): "Hub Data Portal Expanded LabVIEW node"

A new element has been created when SampleSignals.vi ran, with the name you picked on the front panel (e.g. `hub_sample_signals). Hovering over attributes displays their actual value. Compare the timestamp and the current time to verify that the data is fresh: "Hub Data Portal : Combo signal"

LabVIEW Hub VI samples and supported sensor connection patterns

Over time new VIs are added to make it easier to collect data. The following 7 samples shows usage of those VI:

  1. SampleSignals.vi: most basic sample when wires are of signal type (signal contains both values and a signal name):

Signals pattern

  1. SampleDAQAssistant.vi: similar sample as SampleSignals.vi but with DAQ assistants (DAQ simulator requires NI-DAQ to be installed) as sources of data:

DAQ signal pattern

  1. Sample_Array_Data.vi: also similar to SampleSignals.vi but showing up to collect scalar sensor data together into an array, and then how to name the signals before Collect VI:

Array pattern

  1. Sample_Heat_Exchanger.vi: heat exchanger sample shows how to 1) convert array of data for ACS Collect VI and 2) provide names to dynamic wire if they got none:

Sensor with prefix pattern

  1. Sample_from_strings.vi: sample showing how to convert strings with sensor names and sensor data into dynamic wire ready for ACS Collect VI. This pattern is very useful for VI where data is already logged into files:

Values from string pattern

  1. SampleAdv2Loops.vi: how data collection at different speed can be achieved with parallel triplets Hub VIs (Init, Collect, Close) and notion of master/slave ACS control:

Parallel loops pattern

  1. SampleSignal_Nan_Error.vi: ACS cannot store NaN (not a number) values, so they are intercepted by Collect VI and flagged as an error. NaN should be filtered out.

To get quickly to those examples once the Hub Toolkit is installed, in LabVIEW go to Help -> Hub LabVIEW Toolkit -> Hub Examples...

In the following section we provide important information about the Hub operation.

Important Hub operation notes

After modifications to sensor names or number, rerun VI with Configuration Init

The configuration needs to be refreshed each time you modify sensor names and/or numbers. Any mismatch is detected at run-time and result in Error -8997 as seen below (Combo Signal is renamed Combo2 Signal):

Configuration mismatch

You can only click Stop at this point.

Already defined assets cannot be changed

Once you sent data to the Hub for a given asset name, you must select a different asset name each time you:

  • change a signal name
  • add or remove one or more signals

If you forget to change the asset name after sensor changes, you'll see the following Error -8999 upon starting the VI:

Bad asset name error

This is a current limitation of our implementation. If you end up with multiple assets which you don't need anymore once development of your Hub-enabled VI is completed, email hubsupport@osisoft.com to remove the obsolete assets.

A Hub or OMFListener malfunction or not running won't affect your experiment

If for some reason OMFListener stops working, the Collect VI will stop momentarily sending data without interfering with the experiment VI.

You'll know something is wrong with OMFListener when the Hub Status Error light is red:

OMFListener error

Finally there are cases where you may want to run your VI without sending data to the Hub. In this case the Collect VI detects that OMFListener is not running and offer the option to Continue in offline mode:

Ask for offline mode

After Continue:

Offline mode

------------------------------------------ end -----------------------------------------