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:
- One-time install of Redis and OMFListener (for lab admin)
- Configure and run MainSensorLoop
- Copy-paste MainSensorLoop into the existing LabVIEW application and run
- 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:
Tell Windows Defender to trust OMFListener:
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:
Leave it running to collect data from LabVIEW.
NOTE: It is possible to test OMFListener without LabVIEW. Follow the following step
In directory
tests
, double-click ontanktest.exe
to start itIn the console window for
tanktest
, press for the Relay URL (default is OMFListener)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 istanktest1
: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': Then click on 'Select Database' to see which ones are available: Select the 'LabVIEW' database: Expend the LabVIEW node in Explorer by clicking on the small triangle found to its left: Expend further nodes to pick the
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):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
whereYXZ
is your university (e.g. CMU) 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):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:
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:
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.
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:
-
Change the OMFListener URL to http://localhost:6008/ingress/messages :
-
[Optional] To avoid overwrite file
Sample_config.ini
, change it to something else likeSample_config_write.ini
:
When you restart, data will be sent to ACS (check for OK message in OMFListener status box):
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:
2. ACS: Declared and type for sensor X are different. Make sure that the declared type for the sensor name in error is Number
:
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:
4. ACS: [Missing] Cannot find any sensor data for . Make sure all sensor in the front panel receive a value:
5. OMFListener stops working at some point. Check OMFListener status and restart if needed:
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:
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).
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:
And then move one DAQ within the ACPI loop (or DAQ plus other associated VIs if need be):
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:
And then left-click to start a wire and connect somewhere on the channel wire out of DAQ:
Connect to other Convert from Dynamic Data Express VI to the same channel wire:
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:
You'll see the list of all possible channels in the Channel Settings pane:
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:
To select the channel to extract, right-click on the Convert from Dynamic Data Express VI and select Properties:
This opens the configuration panel for this VI. Select Single Scalar as the Resulting data type and the Channel number to extract.
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:
The next steps are not commented.
Final configuration:
Last update: Mon, Oct 16, 2017 1:57:04 PM