Analyzing Historic Trends Obtained with LabVIEW DSC

This project uses DIAdem to view, analyze, and present trend data that have been logged into a historic data base using LabVIEW DSC.

Introduction

LabVIEW provides so called Shared Variables (SV) for data transfer and on-line monitoring. The Datalogging and Supervisory Control (DSC) module of LabVIEW adds additional features to SVs, such as alarming and historic trending. For this, the DSC module uses a Citadel real-time database. This project aims at retrieving, viewing and analyzing historical trend data using DIAdem. Note: Citadel (or LabVIEW DSC) needs to be installed for importing Citadel data into DIAdem.

Shown in the figure below is a view of the "NI Distributed System Manager" (in LabVIEW 8.2 this was called "Shared Variable Manager" and "Tag Monitor/Editor" in LabVIEW 7.1). SVs are part of a SV process. Here, such a process is called "weatherLogger". As shown in the figure below, the Distributed System Manager can be used for on-line monitoring and configuration of SV properties. One of the properties is the "Logging".

bla

Once the logging feature is configured and enabled, historic trends of such SVs are stored in the Citadel database. The easiest way to retrieve and view historic trends is by using the Measurement and Automation Explorer (MAX). Comment: Typically, you won't create and edit properties of SVs in the Distributed System Manager but this is done in the project explorer, where SVs are part of a LabVIEW library (lvlib). One either uses the "properties" dialog of a SV or the "Multiple Variable Editor". A more advanced way is to create SVs and set their properties programmatically by using the VIs of the DSC module.

The figure belows demonstrates the historic trend viewer (HTV) that is part of the MAX. Shown are a couple of trends, of which atmospheric temperature, pressured and wind speed are enabled.

blabla

Here, the aim is to retrieve and analyze historical data in DIAdem. For an introduction into DIAdem please refer to the tutorials that are available in the welcome screen of DIAdem. The aim of this project is not how to acquire weather data, the usage of SVs and the related tools like the Distributed Systeme Manager or MAX. For information on SVs and their usage, please refer to the documentation by National Instruments.

Importing Data

It is possible to export the historic data from MAX, write it to a file and find that file with the "DataFinder" that is part of DIAdem (and that is also accessible via the Windows Task Bar). However, it is also possible to connect directly to the Citadel database from DIAdem.

bla3

As shown in the figure above, create a "Data Store" and select the historical data of the SV process.

In the next step, simply do "File->Open Data Store" and select the data store that you just created. In the "Data Portal" of DIAdem you may change the name of the data to "weatherData" and create a new group "original" (the names are just for convenience, you may use other names like "test" and "test data").

Viewing Data

After selecting "VIEW" in the panel bar and selecting a two array worksheet partition, the data can be dragged and dropped from the data portal. Then, they are ready for display as shown below.

bla4

For more information about this step, have a look into the DIAdem tutorials. Viewing is just "viewing". Don't invest too much time in making a view nice. Viewing is just a tool to look at the data, especially after analyzing data.

Analyzing Data

There are plenty of options and possibilities when analyzing data. Like offset correction, curve fitting, FFT, removing of "NoValue" points withing the data, adding, multiplying, statistical analysis. All this is not explained here - please have a look at the documentation and play around with it.

Here, the feature of "Linear Mapping" is presented. When viewing and comparing historical trending data, it is typical that time stamps of different curves are not synchronized. This is due to the fact, that historical trending minimizes the amount of stored data by only storing a datum, when its value has changed. For SVs, one can specify a dead-band for trending. Only if a value undergoes a change larger than its dead-band, the new value will be logged together with its time stamp.

At this moment, it might be a good idea creating a new group "intermediate" in the Data Portal. Set this new group as default group also. The next thing to do is generating a new time channel with equidistant time stamps. Do "DIAdem Analysis"->"Channel Functions"->"Generate Time Channel". Select proper start and end times and time steps of, say, 10 minutes. This is shown below.

bla5

Lets assume we would like to correlate wind speed and direction. So we need to do linear mapping on both data. As a prerequisite data points containing "NoValue" have to be removed. Do "DIAdem Analysis"->"Channel Functions"->"Process No Values". Select a pair of data points together with its time stamps. Shown below is an example, where the "NoValue" data are removed for the wind speed. The same thing is then done also for wind direction (not shown).

bla 6

The last step is the linear mapping itself. Do "DIAdem Analysis"->"Curve Fitting"->"Linear Mapping". For the example of wind speed, select the channels with "NoValues removed" windSpeed.time (as X-channel), windSpeed.data (as Y-Channel) and the channel with equidistant time values TimeGenerated (as Interpolation Channel). This is shown in the figure below. The same thing is then done also for wind direction (not shown). bla7

Presenting Data

Finally one would like to present the data. This is done be doing "DIAdem REPORT-> ....". What you like to see depends on situation. Refer to the DIAdem help and tutorials. Shown below is a figure, where atmospheric properties (dew point, pressure, humidity and temperature) are plotted on a 2D-Plot with three y-axes and wind speed and direction are plotted in a polar plot.

bla8

Please note, that the polar plot was only possible after the linear mapping of wind speed and direction. Once you have a nice layout for your report, save that "report layout". It is handy when using scripts (see below).

Using Scripts

Our weather station keeps on delivering new data all the time. However, one does not like manually repeating everything shown above, since this was quite some work. Here, the option of scripts comes into play. The easiest is not to program a script but to record a script. Start DIAdem from scratch and do "DIAdem SCRIPT"->"Enable Recording Mode" (from the tool bar). This is shown in the figure below.

bla9

Then, repeat all the steps again as shown above. But for creating the report, just load the "report layout" that you saved before. Finally do "DIAdem SCRIPT"->"Disable Recording Mode" and save the script. If, in the future, you would like to re-create the weather report with updated data, just load and run the script again. Of course, the script can be refined using dialogs and so on. Refer to the DIAdem help and tutorial for more information.

-- DietrichBeck - 22 Oct 2010
Topic revision: r8 - 2011-02-28, DietrichBeck
 
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding GSI Wiki? Send feedback
Imprint (in German)
Privacy Policy (in German)