Table of Contents
- ASAM-ODS Background/Connection/Setup
- ASAM-ODS Data Reading with LabVIEW
- ASAM-ODS Data Object Querying
- ASAM-ODS Query Syntax
This document is designed to give the LabVIEW programmer all the required ASAM-ODS background and all the needed descriptions of the VIs this document comes with to successfully read from and write to an ASAM-ODS server or ATF file.
ASAM-ODS Background/Connection/Setup
National Instruments applications LabVIEW and DIAdem both connect to ASAM-ODS servers via a shared data management layer called USI (Universal Storage Interface). In fact, ASAM-ODS data bases and ATF files are only some of the many data sources, including other industry standard files and customer legacy files, to which USI can connect LabVIEW and DIAdem. The USI layer abstracts the details of the particular data source and groups together input and output routines common to all data sources. The individual components which plug into USI and contain the data source-specific routines for reading and sometimes writing data from/to the particular data source are called “Plugins” or “DataPlugins”. You must have LabVIEW version 7.1 or later in order to use USI to connect to ASAM-ODS data bases and ATF files.

Install the AOP Plugin
Get the AOP Connection String
Query the AOP Data Model
Adapt the Storage VIs to the AOP Model
Install the AOP Plugin
You may or may not have the required AOP Plugin to connect to your ASAM-ODS data base and ATF files. You can tell by launching one of the below-listed VIs and checking its run arrow. If the run arrow is white, you have the required AOP Plugin to connect to that ASAM-ODS data base with LabVIEW. If the run arrow is broken, you need to first download the required AOP Plugin before you can connect to that ASAM-ODS data base. Note that there are two VIs because there are two fundamentally different kinds of ASAM-ODS servers.
AOP3 Server “…\ASAM-ODS Example.llb\Get AOP3 Connection String.vi”
AOP5 Server “…\ASAM-ODS Example.llb\Get AOP5 Connection String.vi”
www.ni.com/diadem/dataplugins
If the “Get AOP# Connection String.vi” opens up with a broken run arrow, you can download and install the required Plugin from the above-linked ni.com/datplugins site. After installation, the next time you launch LabVIEW and load the above VI, it should be ready to run.
Get the AOP Connection String
Open the appropriate “…\ASAM-ODS Example.llb\Get AOP# Connection String.vi” if you don’t already have it open from the previous (Install the AOP DataPlugin) section. The AOP/AOP5 Plugins both require an XML connection string to specify all the connection parameters (user name, password, server location, port number, etc.). The VI you now have open will pop up a configuration dialog to create this XML connection string.

Note that you will need to use different parameters from those shown in the above dialogs, and this will probably require a conversation with your ASAM-ODS server administrator. Once you have the correct connection parameters entered above, clicking the <OK> button will result in the creation of the XML connection string, which will look like the following.

Note that connecting to an ATF file requires a particularly simple connection string:
<filename>C:\Path to Directory\Name of File.atf</filename>
In the remainder of this document the “Test ASAM-ODS.atf” file will be used to illustrate the methods of reading from and writing to an AOP server. You will hopefully find this fully functional example file helpful in acquainting yourself with the different topics, but you will no doubt want to try those same methods with your own AOP server. Note that in order to use this example ATF file, you will need to change the XML connection string to point to the actual location of the file on your hard drive.
Query the AOP Data Model
Once you have the XML connection string for your ASAM-ODS server or ATF file from the previous (Get the AOP Connection String) section, you can query that ASAM-ODS server’s data model to see what the various hierarchy levels are and what properties they each have. Open up the “…\ASAM-ODS Example.llb\Get Main db Object Names.vi” and paste your XML connection string into the “Connection Paramters” control. Also make sure to put either “AOP” (for AOP3) or “AOP5” (for AOP5) in the “Plugin Name” control. This VI will request the entire object structure of the data base as well as the entire property list for the entity in the “Object name or type to query properties from” control. You can also look at the object structure of an ATF file by typing in “ATF” instead of “AOP” in the “Server Type” control and typing in the full path to the ATF file (where it actually is on your hard drive) between “<filename></filename>” XML tags, as shown below:

Note that the above ATF file connection string will be used in all the screenshots in this document, but you will need to always replace it either 1) the correct connection string to your own AOP server, or 2) the correct connection string to the actual location on your hard drive of the sample ATF that ships with this document.
Run the VI to observe the Object structure. You will find the main objects in the data model for your ASAM-ODS data base in the “Main Model Objects” indicator on the VI’s front panel.

Note that there can be 0, 1, or more than 1 “aosubtest” level in your ASAM-ODS data base— all of the nested “aosubtest” levels will be listed here.
Next look at the “All Model Object” indicator— here again you will see the main object levels, but in addition you will see other object levels that do not belong directly to the data storage hierarchy, such as “aoquantity”, “aounit”, etc.

Finally look at the “Queried Object level’s properties” indicator, which shows all the properties of the object level selected in the “Object name or type to query properties from” control.

You can type in different object level names in the “Object name or type to query properties from” control and re-run this VI to inspect the properties of any other object level. Note than you can use either the Object Type (aotest) or the Object Name (TestBed) in the “Object name or type to query properties from” control.
Adapt Storage VIs to the AOP model
Before you can query, read, and write from/to an ASAM-ODS data base with the LabVIEW Storage VIs, you will probably need to insert a line into the LabVIEW.ini file. The Storage VIs use the TDM file data model by default, and this new ini file token will unlock the ability to load an arbitrary data model.
Open up the file “…\National Instruments\LabVIEW 7.1\LabVIEW.ini” in a text editor and add (anywhere) the new line:
“unlockStorageImportObjectDefinition=True”
Once you save the “LabVIEW.ini” file and restart LabVIEW, you will be able to load the ASAM-ODS data model from your ATF file or AOP server. To test that you can now import data models, open up the “…\ASAM-ODS Example.llb\Simple Data Query.vi” and look at its block diagram. Double-click on the “Read Data” Storage VI to pull up its configuration dialog, and verify that you now have an “Import data types” button in the top right of the dialog (which before was blank).

Click on the new “Import data types” button to pull up the model-importing dialog, shown below.

Select the “Import from data storage” and “other (advanced)” radio buttons. Then enter the server type (AOP or AOP5) in the “Data storage format” box and the XML connection string in the “Connection parameters” box and click <OK> to load the AOP model. It make take a few seconds to download the AOP model, after which your “Configure Read Data.vi” configuration dialog will have new choices. This procedure will also work with “Write Data.vi”, “Get Properties.vi”, and “Set Properties.vi”.

ASAM-ODS Data Reading with LabVIEW
All data in ASAM-ODS data bases is stored with parent object hierarchy. Reading data back out of an ASAM-ODS data base, therefore, requires you to specify conditions for one or more parent object levels to return the data set you really want. You can execute a query with conditions on multiple parent object levels all at once, similar to the case of an SQL “inner join” query of nested, linked tables in a relational data base. But the ASAM-ODS api also enables you to query a reference to a particular hierarchy level, then use that reference as the beginning of another query. In this way you can “feel” your way up or down the object tree, checking the properties of the returned hierarchy level before querying the next hierarchy level. Note that every object level has the property “name” and “id”, though in an ATF file the “id” property does not exist by default. For a full list of the properties of each object level, consult the ASAM-ODS Object Querying section. For tips on converting examples that run with the “Test ASAM-ODS.atf” file over to your own AOP server, view the Adapt the Storage VIs to the AOP model section.

Read All MeasurementQuantity Data
Single-Stage MeasurementQuantity Query
Two-Stage MeasurementQuantity Query
Three-Stage Measurement Query
All-In-One Measurement Query
Free-form Object Query
Read All MeasurementQuantity Data
Load the “…\ASAM-ODS Example.llb\Simple Data Read.vi”. This VI executes the simplest possible read action for an ASAM-ODS data base or ATF file, namely reading ALL possible data into a 2D array of values. This is NOT a good idea on a production ASAM-ODS data base with tons of data in it!! But it works just fine on the simple example ATF file that the VI defaults to, and it does a good job of illustrating just how simple it is to read out data channels (MeasurementQuantities) with the Storage VIs.

Run the VI with the Connection String for the “Test ASAM-ODS.atf” file:

Single-Stage MeasurementQuantity Query
Load the “…\ASAM-ODS Example.llb\Simple Data Query.vi”. This VI adds a single query condition to the previous “read-all” example, comparing the name of the MeasurementQuantity with the “Name” control on the front panel. Note that you can also select the operator for the comparison with the “Comparison” control on the front panel. This VI also illustrates how to read off the value of the “Name” property from the queried MeasurementQuantity reference array.

Run the VI with the default condition values (= Sine):

Now change the “comparison” control to “!=” (not equal to) and run the VI. Note that there are 3 other channel names in the ATF file, repeated several times.

Finally change the “comparison” control to “>” and run the VI. This time only the “TimeCh” and “Square” channels are returned, satisfying the alphabetic “>” comparison to the “Sine” channel name.

Two-Stage MeasurementQuantity Query
Load the “…\ASAM-ODS Example.llb\Medium Query.vi”. This VI first queries the correct Measurement(s) and then queries the correct MeasurementQuantity data from within the queried Measurement(s) subset, in a two-stage approach. In the previous example you saw how you could use a queried reference array to read off object properties— here you are using the queried Measurement references as the starting point for a second MeasurementQuantity query.

Run the VI with the default query conditions— note that there are 3 (non-TimeCh) MeasurementQuantities for each Measurement queried:

Change the “Meas Comparison” operator to “!=” and run the VI again.

Change the “Meas Comparison” operator to “=” and the “Measurement Name” comparison value to the wildcard “*” and run the VI again. Note that there are only 4 Measurements in the ATF file, each with almost identical channels in them.

Three-Stage Measurement Query
Load the “…\ASAM-ODS Example.llb\ Read Measurement.vi”.

Run the VI with the default “Hierarchy Names”, noting that the “Connect/Disconnect” button lights briefly while connecting to the AOP server or ATF file. Next click on the “EXECUTE Query” button to execute the selected queries defined on the left side of the front panel. The SubVIs called by this VI execute 3 sequential queries on the aotest, aosubtest and aomeasurement levels, in order to query a specific Measurement from the ATF file, then load all its MeasurementQuantities. Finally click on the “QUIT” button to end the VI after you see the queried data appear in the graph on the right.

All-In-One Measurement Query
Use the same “…\ASAM-ODS Example.llb\Read Measurement.vi”.

But this time use the “Run Query Array” tab on the front panel to define an “all-in-one” (extended) query that will run comparisons on 3 different hierarchy levels at once. Change the first “Measurement Query Array in” element to the value “name='Measurement 3'“ and run the VI again, remembering to click on the “EXECUTE Query” and “QUIT” buttons to run the query and end the VI.

Free-form Object Query
Load the “…\ASAM-ODS Example.llb\Test Queries.vi”. This VI runs a user-selected array of query conditions, returning an array of references from a user-selected hierarchy level, and displays a user-selected list of (string-only) property values for each returned object reference. Run this VI with all the default parameters.

Note that you are requesting a return-type of “aomeasurement” and are requesting the name and description of the returned measurements as well as the name of the aosubtest level directly above each returned aomeasurement. Change the second query array element to “test.name = 'SubTest *'” and run the VI again.

Now your query returns all 4 aomeasurements from both aosubtest parent levels. Note how the object hierarchy is reflected with parent.child syntax— for further details regarding the property structure of each ASAM-ODS base object type and how to query an AOP server, consult the ASAM-ODS Object Querying section.
Finally, practice changing the return-type of the query by altering the following items on the front panel:
1) Change the “base object type” control to “aomeasurementquantity”
2) Add the text “measurement.” To the beginning of each “Query Array” element
3) Change the second “String Property Array” element to “measurement.name”
4) Change the third “String Property Array” element to “measurement.test.name”
5) Change the “Max # of Objects” to “100”
Now run the VI again and observe that for the first time in any of these exercises, you can now see all the Measurements and MeasurementQuantities in the ATF file, including their hierarchy.

ASAM-ODS Data Writing with LabVIEW
All data in ASAM-ODS data bases is stored with parent object hierarchy. The first task in writing a set of data values to an ASAM-ODS data base or ATF file is, therefore, to query a reference to the desired target Measurement. In many cases you will want to create a new Measurement to put the data values in and return the reference from that new Measurement. In some cases you may want to create new parent hierarchy objects (SubTest, Test) above the new Measurement. You also need to create a MeasurementQuantity and LocalColumn object for each data channel below the Measurement, and in most cases a new SubMatrix as well for the entire data set.

Using the ATF File Browser (OCX)
Browsing the Data Structure in a Tree Control
Writing a Waveform Array Data Set
Writing a 2D Array of DBLs Data Set
Using the ATF File Browser (OCX)
Load the “…\ASAM-ODS Example.llb\ATF File Browser.vi”. This VI uses an OCX registered by USI which automatically shows the data structure of any ATF file in a tree view, along with all non-reference properties of each object level.

You can move the boundary of the lower window down out of sight and click on the “Properties” tab at the bottom right to achieve an excellent overview of the data structure.

Browsing the Data Structure in a Tree Control
Load and run the “…\ASAM-ODS Example.llb\Read Tree View.vi”. This VI queries the data structure of an AOP server or ATF file and displays it in a native LabVIEW tree control. This is the easiest way to observe the new data sets you write to the server.

Once the VI starts and the object hierarchy appears in the tree control on the left, you can open the branches and also select a measurement or channel to load it into the graph.

For a peek into how the tree control is populated programmatically, pop open the “Fill Tree Control.vi” on the block diagram of the “Read Tree View.vi”. There’s more going on in the actual “Fill Tree Control.vi”, but the crux of its functioning is captured in the following G code snippet, where only the main blocks from the VI are shown schematically.

The VI starts by querying out an array of references to all the aotest (TestBed) objects in the AOP data base or ATF file, then reads from each aotest (TestBed) object an array of references to all its aosubtest (Test) child objects. At each level in the hierarchy the link to the next level down is stored in a property as an array of child references. In general this would continue through N aosubtest levels, then end in the aomeasurement (Measurement) and aomeasurementquantity (MeaQuantity) levels.
The object model pictured above is from the “Test ASAM-ODS.atf” file that is used throughout this document and happens to have only 1 aosubtest (Test) level. Your AOP server or ATF file might have more than the 1 aosubtest level pictured above, or it might have no aosubtest level at all. In all cases adapting the VIs in this document to read and write from/to your AOP server or ATF file will involve loading your object model into each of the blue storage VIs (except for Open and Close), such as those shown above. A brief explanation of this is included in the Adapt the Storage VIs to the AOP model section. If your AOP server or ATF file data model has more than 1 aosubtest level, you will need to expand the above VI to the left and include additional “Get Properties.vi”, each with their own following FOR loop, located to the left and outside of the existing FOR loops but to the right of the “Read Data.vi”.
Writing a Waveform Array Data Set
Load the “…\ASAM-ODS Example.llb\Write Measurement.vi”. This VI executes a three-stage query to return the desired Measurement reference, then inserts a newly simulated data set into that Measurement. With the “Input Data Type” control set to “Waveform Array”, the data is simulated as a waveform array and stored to the ATF file with the “Write Waveform Data.vi”, shown below.

In this VI a new SubMatrix is created for each waveform in the waveform array, and each waveform is saved with its own x-axis information as its independent channel in the submatrix. In this way the stored data channels can be of different lengths.
You can choose whether creation of parent objects is allowed or forced at the aotest (TestBed) and/or aosubtest (Test) level. The default “Get existing or Create new” option inserts your new measurement in an existing parent object if one exists with a matching name but will create a new parent object if no object yet exists with the selected name.
Set the “Measurement Name” control in the bottom left of the front panel to be “Measurement 4” and run the VI. Initially the VI connects to the ATF file, then waits for you to sequentially write one or more measurements. Click on the <Execute Text> button near the top right of the front panel to write a new measurement called “Measurement 4” to the ATF file. Finally click on the <Quit> button to stop the VI.

Load and run the “…\ASAM-ODS Example.llb\Read Tree View.vi” to see the measurement you just wrote to the “Test ASAM-ODS.atf” file. Note that there is now a new “Measurement” level called “Measurement 4” in the tree view on the left, and that it contains 4 “MeaQuantity” levels called “TimeCh, Sine, Square, and Sawtooth”, exactly as you selected in the “Name Array” control in the bottom left of the “Write Measurement.vi “ front panel.
Notice also that the “TimeCh” was used as the independent (X-Axis) channel for the measurement and that the “Sine, Square, and Sawtooth” channels all have a different number of values (297, 198 and 99 respectively). This is possible because each channel in the waveform array was automatically stored in its own Submatrix— for a full discussion of this refer to the ASAM-ODS Data Storage Structure section.
The graph on the right side of the front panel is a waveform graph that displays each channel versus its array index, including the independent (X-Axis) “TimeCh” channel. Ideally you would display this measurement on an XY graph with the “Sine, Square, and Sawtooth” channels graphed versus the “TimeCh” channel. Try clicking on one of the new “MeaQuantity” channels in the tree view control on the left (while the VI is running) and notice how you can load 1 channel at a time into the graph on the right.

Writing a 2D Array of DBLs Data Set
Load the “…\ASAM-ODS Example.llb\Write Measurement.vi”. This VI executes a three-stage query to return the desired Measurement reference, then inserts a newly simulated data set into that Measurement. With the “Input Data Type” control set to “2D Array of DBLs”, the data is simulated as a rectangular 2D array of DBLs and stored to the ATF file with the “Write 2D Array Data.vi”, shown below.

In this VI a single new SubMatrix is created for all the data in the 2D array of DBLs, and the first channel of data in the 2D array is used as the dependent channel for the rest of the channels in the array. This forces each stored data channel to have the same length.
You can choose whether creation of parent objects is allowed or forced at the aotest (TestBed) and/or aosubtest (Test) level. The default “Get existing or Create new” option inserts your new measurement in an existing parent object if one exists with a matching name but will create a new parent object if no object yet exists with the selected name.
Set the “SubTest Name” control in the bottom left of the front panel to be “SubTest 3” and the “Measurement Name” control to be “Measurement 1” and run the VI. Initially the VI connects to the ATF file, then waits for you to sequentially write one or more measurements. Click on the <Execute Test> button near the top right of the front panel to write a new measurement called “Measurement 1” to a new subtest called “SubTest 3” in the ATF file. Finally click on the <Quit> button to stop the VI.

Load and run the “…\ASAM-ODS Example.llb\Read Tree View.vi” to see the measurement you just wrote to the “Test ASAM-ODS.atf” file. Note that there is now a new “Test” level called “SubTest 3” and under it a new “Measurement” level called “Measurement 4” in the tree view on the left, and that it contains 4 “MeaQuantity” levels called “TimeCh, Sine, Square, and Sawtooth”, exactly as you selected in the “Name Array” control in the bottom left of the “Write Measurement.vi “ front panel.
Notice also that the “TimeCh” was used as the independent (X-Axis) channel for the measurement and that the “Sine, Square, and Sawtooth” channels all have the same number of values (297). This is required because all channels in the 2D array of DBLs were automatically stored in the same Submatrix— for a full discussion of this refer to the ASAM-ODS Data Storage Structure section.
The graph on the right side of the front panel is a waveform graph that displays each channel versus its array index, including the independent (X-Axis) “TimeCh” channel. Ideally you would display this measurement on an XY graph with the “Sine, Square, and Sawtooth” channels graphed versus the “TimeCh” channel. Try clicking on one of the new “MeaQuantity” channels in the tree view control on the left (while the VI is running) and notice how you can load 1 channel at a time into the graph on the right.

ASAM-ODS Data Object Querying
A given ASAM-ODS data base will have a data base model that is a combination of the standard ASAM-ODS base model entity structure and additional custom hierarchy and/or attributes that were required for the given application. In general, the names of the base model hierarchy levels (entities) will vary from ASAM-ODS data base to ASAM-ODS data base. You can query the ASAM-ODS data base by either using the base model object names or the custom application model object names. Queries constructed solely from base model object and attribute names will run on all ASAM-ODS data bases, whereas queries which contain application model object or attribute names will usually only run on the particular ASAM-ODS data base for which they were designed.
All ASAM-ODS data storage hierarchy levels can be addressed with the following base model object naming scheme:

Each object level has one or more base model relationship (link) attributes with which you can navigate the above hierarchy in an ASAM-ODS query.
AoTest
| Relation | Relationship | Range |
| children | CHILD | [0 : ?] |
AoSubTest
| Relation | Relationship | Range |
| parent_test | PARENT | [1 : 1] |
| children | CHILD | [0 : ?] |
AoMeasurement
| Relation | Relationship | Range |
| test | PARENT | [1 : 1] |
| measurement_quantities | CHILD | [0 : ?] |
| submatrices | CHILD | [0 : ?] |
AoMeasurementQuantity
| Relation | Relationship | Range |
| measurement | PARENT | [1 : 1] |
| local_columns | CHILD | [0 : ?] |
AoSubMatrix
RelationRelationshipRange
| Measurement | PARENT | [1 : 1] |
| local_columns | CHILD | [0 : ?] |
AoLocalColumn
| Relation | Relationship | Range |
| measurement_quantity | PARENT | [1 : 1] |
| Submatrix | PARENT | [1 : 1] |
Each object level further has a set of base model attributes which are guaranteed to be supported on any ASAM-ODS data base, and which can be used to find the desired objects in an ASAM-ODS query.
AoTest
| Name | Data Type |
| name | DT_STRING |
| id | DT_LONGLONG |
| description | DT_STRING |
| version | DT_STRING |
| version_date | DT_STRING |
AoSubTest
NameData Type
| name | DT_STRING |
| id | DT_LONGLONG |
| description | DT_STRING |
| version | DT_STRING |
| version_date | DT_STRING |
AoMeasurement
| Name | Data Type |
| name | DT_STRING |
| id | DT_LONGLONG |
| description | DT_STRING |
| version | DT_STRING |
| version_date | DT_STRING |
| measurement_begin | DT_DATE |
| measurement_end | DT_DATE |
AoMeasurementQuantity
| Name | Data Type |
| name | DT_STRING |
| id | DT_LONGLONG |
| description | DT_STRING |
| version | DT_STRING |
| version_date | DT_STRING |
| datatype | DT_LONG (Enum) |
| rank | DT_LONG |
| dimension | DT_LONG |
| type_size | DT_LONG |
| interpolation | DT_LONG (Enum) |
| minimum | DT_DOUBLE |
| maximum | DT_DOUBLE |
| average | DT_DOUBLE |
| standard_deviation | DT_DOUBLE |
AoSubMatrix
| Name | Data Type |
| name | DT_STRING |
| id | DT_LONGLONG |
| description | DT_STRING |
| version | DT_STRING |
| version_date | DT_STRING |
| number_of_rows | DT_LONG |
AoLocalColumn
| Name | Data Type |
| name | DT_STRING |
| id | DT_LONGLONG |
| description | DT_STRING |
| version | DT_STRING |
| version_date | DT_STRING |
| flags | DT_SHORT |
| global_flag | DT_SHORT |
| independent | DT_SHORT |
| minimum | DT_DOUBLE |
| maximum | DT_DOUBLE |
| sequence_representation | DT_LONG (Enum) |
| generation_parameters | DT_DOUBLE |
| values | any datatype |
ASAM-ODS Query Syntax
An ASAM-ODS query consists of one or more query condition which are each required to be TRUE (the conditions are AND-ed together). Each query condition specifies an attribute name, an operator, and an attribute value, as in:
name = ‘Test Run 59’
You must also specify the entity name that you want to return with the query, either with a base model object name or an application model object name, such as:
AoMeasurementQuantity
description = ‘manifold temperature’
average > 45.877
It is also possible to address properties of object levels linked to the return object by providing the “attribute path” to that linked object level within the query, as in:
AoMeasurementQuantity
average > 45.877
measurement.description = “Endurance Test”
measurement.test.name = “Life Cycle Test”
measurement.test.parent_test.id = 34736
NOTE: When an ASAM-ODS query contains attribute comparisons of object levels linked with the “attribute path” shown above, this is known as an “Extended Query”. Not all AOP servers support extended queries, and not all AOP clients emulate them when the server does not support them. The AOP and AOP5 plugins that LabVIEW and DIAdem use do emulate extended queries when the ASAM-ODS server does not support them, but that does add to the execution time.
NOTE: The native wildcard character for string attribute comparisons in an ASAM-ODS data base is the “%” character, as it is in most data bases. The LabVIEW Storage VIs, however, expect the “*” character to be used instead, as is common in most windows applications. The Storage VIs translate “*” characters into “%” characters before sending the query string on to the AOP server.
NOTE: Use the “…\ASAM-ODS Example.llb\ Test Queries.vi” to try out queries on an ASAM-ODS data base with LabVIEW. For a description of how to use this VI, consult the Free-form Object Query section.
ASAM-ODS Data Storage Structure

Measurement
MeasurementQuantity
Independent MeasurementQuantity
SubMatrix
LocalColumn
Example of measured data
The definitions and interrelations of the above ASAM-ODS terms will be presented below using a simple example that grows in complexity. The ASAM-ODS view of data is that each measurement is always ordered relative to a single “independent” parameter (“Time”, “Angle”, “RPMs”, “Index”, etc.). This means that for each measured value there MUST be an associated “independent” value to determine the ordering of all the measured values, usually the time at which each measured value was acquired. A full set of these value pairs forms what can be called a waveform, trace, curve, etc., which can by definition be plotted in an x-y graph. Take as a starting place the below simple data set:
Measurement 1
| Time [date] | Sensor 1 [°C] |
| 11/25/2002 16:17:25 | 20 |
| 11/25/2002 16:18:25 | 20.3 |
| 11/25/2002 16:19:25 | 20.8 |
| 11/25/2002 16:20:25 | 20.59 |
| 11/25/2002 16:21:25 | 20.89 |
| 11/25/2002 16:22:25 | 23.1 |
Measurement 2
| Time [date] | Sensor 1 [°C] | Sensor 2 [°C] |
| 11/25/2002 16:17:25 | 20 | 15.5 |
| 11/25/2002 16:18:25 | 20.3 | 15.8 |
| 11/25/2002 16:19:25 | 20.8 | 15.9 |
| 11/25/2002 16:20:25 | 20.59 | 16 |
| 11/25/2002 16:21:25 | 20.89 | 16.3 |
| 11/25/2002 16:22:25 | 23.1 | 16.5 |
Measurement 3
| Time [date] | Sensor 1 [°C] | Sensor 2 [°C] | Sensor 3 [°C] |
| 11/25/2002 16:17:25 | 20 | 15.5 | 0.012 |
| 11/25/2002 16:18:25 | 20.3 | 15.8 | NOVALUE |
| 11/25/2002 16:19:25 | 20.8 | 15.9 | 0.013 |
| 11/25/2002 16:20:25 | 20.59 | 16 | NOVALUE |
| 11/25/2002 16:21:25 | 20.89 | 16.3 | 0.018 |
| 11/25/2002 16:22:25 | 23.1 | 15.8 | NOVALUE |
Measurement 4
| Time [date] | Sensor 1 [°C] | Sensor 2 [°C] | Sensor 3 [°C] | Sensor 4 [°C] |
| 11/25/2002 16:17:25 | 20 | 15.5 | 0.012 | 15.51234 |
| 11/25/2002 16:18:25 | 20.3 | 15.8 | NOVALUE | 15.8376 |
| 11/25/2002 16:19:25 | 20.8 | 15.9 | 0.013 | 15.9345 |
| 11/25/2002 16:20:25 | 20.59 | 16 | NOVALUE | NOVALUE |
| 11/25/2002 16:21:25 | 20.89 | 16.3 | 0.018 | NOVALUE |
| 11/25/2002 16:22:25 | 23.1 | 15.8 | NOVALUE | 15.8765 |
Measurement 5
| Time [date] | Sensor 1 [°C] | Sensor 2 [°C] | Sensor 3 [°C] | Sensor 4 [°C] | Sensor 5 [°C] |
| 11/25/2002 16:17:25 | 20 | 15.5 | 0.012 | 15.51234 | NOVALUE |
| 11/25/2002 16:17:37 | NOVALUE | NOVALUE | NOVALUE | NOVALUE | 31.1 |
| 11/25/2002 16:18:25 | 20.3 | 15.8 | NOVALUE | 15.8376 | NOVALUE |
| 11/25/2002 16:18:37 | NOVALUE | NOVALUE | NOVALUE | NOVALUE | 30 |
| 11/25/2002 16:19:25 | 20.8 | 15.9 | 0.013 | 15.9345 | NOVALUE |
| 11/25/2002 16:19:37 | NOVALUE | NOVALUE | NOVALUE | NOVALUE | 29.2 |
| 11/25/2002 16:20:25 | 20.59 | 16 | NOVALUE | NOVALUE | NOVALUE |
| 11/25/2002 16:20:37 | NOVALUE | NOVALUE | NOVALUE | NOVALUE | 32.1 |
| 11/25/2002 16:21:25 | 20.89 | 16.3 | 0.018 | NOVALUE | NOVALUE |
| 11/25/2002 16:21:37 | NOVALUE | NOVALUE | NOVALUE | NOVALUE | 28.2 |
| 11/25/2002 16:22:25 | 23.1 | 15.8 | NOVALUE | 15.8765 | NOVALUE |
| 11/25/2002 16:22:37 | NOVALUE | NOVALUE | NOVALUE | NOVALUE | 28.3 |
Measurement
In ASAM-ODS a Measurement is a set of related data channels, called “MeasurementQuantities”, which share a common X axis, called the “Independent MeasurementQuantity” (in the above example this is the “Time” channel). The Measurement has a link to each of these “MeasurementQuantities” as well as a link to one or more “SubMatrices” to help order the data matrices by using the “Independent MeasurementQuantity”. In the above example the “Measurement” might be called “Temperature Profile Run 6”, and would contain links to the “Time” channel and each of the “Sensor” channels.
MeasurementQuantity
In ASAM-ODS each “MeasurementQuantity” contains information about a single measured data channel. Each “MeasurementQuantity” links to its parent “Measurement” as well as its child “LocalColumn”(s), where the data values are actually stored or described. In the above example the “Time” and all “Sensor” channels are each a separate “MeasurementQuantity”.
Independent MeasurementQuantity
The “Independent MeasurementQuantity” is the unique “MeasurementQuantity” by which all the other “MeasurementQuantities” in the “Measurement” are ordered. In simpler terms, the “Independent MeasurementQuantity” forms the common X axis against which all the other “MeasurementQuantities” will be plotted. Common examples include “Time”, “Angle”, “RPMs”, “Index”, etc. In the above example, the “Independent MeasurementQuantity” is the “Time” channel, and any data loading operation will always automatically order the data values by their respective “Time” values. The simplest and most flexible type of “Independent MeasurementQuantity” is to use a unitless “Index” channel.
SubMatrix
In ASAM-ODS a “SubMatrix” is used to order one or more “MeasurementQuantities” by a common sequence of “Independent MeasurementQuantity” values. Take another look at the example of 5 Sensors, pictured again below. This is what the 5 channel “Measurement” would look like with only 1 “SubMatrix”.
| Time [date] | Sensor 1 [°C] | Sensor 2 [°C] | Sensor 3 [°C] | Sensor 4 [°C] | Sensor 5 [°C] |
| 11/25/2002 16:17:25 | 20 | 15.5 | 0.012 | 15.51234 | NOVALUE |
| 11/25/2002 16:17:37 | NOVALUE | NOVALUE | NOVALUE | NOVALUE | 31.1 |
| 11/25/2002 16:18:25 | 20.3 | 15.8 | NOVALUE | 15.8376 | NOVALUE |
| 11/25/2002 16:18:37 | NOVALUE | NOVALUE | NOVALUE | NOVALUE | 30 |
| 11/25/2002 16:19:25 | 20.8 | 15.9 | 0.013 | 15.9345 | NOVALUE |
| 11/25/2002 16:19:37 | NOVALUE | NOVALUE | NOVALUE | NOVALUE | 29.2 |
| 11/25/2002 16:20:25 | 20.59 | 16 | NOVALUE | NOVALUE | NOVALUE |
| 11/25/2002 16:20:37 | NOVALUE | NOVALUE | NOVALUE | NOVALUE | 32.1 |
| 11/25/2002 16:21:25 | 20.89 | 16.3 | 0.018 | NOVALUE | NOVALUE |
| 11/25/2002 16:21:37 | NOVALUE | NOVALUE | NOVALUE | NOVALUE | 28.2 |
| 11/25/2002 16:22:25 | 23.1 | 15.8 | NOVALUE | 15.8765 | NOVALUE |
| 11/25/2002 16:22:37 | NOVALUE | NOVALUE | NOVALUE | NOVALUE | 28.3 |
Step 1: Now reorganize the “Measurement” into 2 separate “SubMatrices”
| Time [date] | Sensor 1 [°C] | Sensor 2 [°C] | Sensor 3 [°C] | Sensor 4 [°C] |
| 11/25/2002 16:17:25 | 20 | 15.5 | 0.012 | 15.51234 |
| 11/25/2002 16:18:25 | 20.3 | 15.8 | NOVALUE | 15.8376 |
| 11/25/2002 16:19:25 | 20.8 | 15.9 | 0.013 | 15.9345 |
| 11/25/2002 16:20:25 | 20.59 | 16 | NOVALUE | NOVALUE |
| 11/25/2002 16:21:25 | 20.89 | 16.3 | 0.018 | NOVALUE |
| 11/25/2002 16:22:25 | 23.1 | 15.8 | NOVALUE | 15.8765 |
| Time [date] | Sensor 5 [°C] |
| 11/25/2002 16:17:37 | 31.1 |
| 11/25/2002 16:18:37 | 30 |
| 11/25/2002 16:19:37 | 29.2 |
| 11/25/2002 16:20:37 | 32.1 |
| 11/25/2002 16:21:37 | 28.2 |
| 11/25/2002 16:22:37 | 28.3 |
Step 2: Next reorganize the matrix into 3 separate “SubMatrices”
| Time [date] | Sensor 1 [°C] | Sensor 2 [°C] | Sensor 3 [°C] |
| 11/25/2002 16:17:25 | 20 | 15.5 | 0.012 |
| 11/25/2002 16:18:25 | 20.3 | 15.8 | NOVALUE |
| 11/25/2002 16:19:25 | 20.8 | 15.9 | 0.013 |
| 11/25/2002 16:20:25 | 20.59 | 16 | NOVALUE |
| 11/25/2002 16:21:25 | 20.89 | 16.3 | 0.018 |
| 11/25/2002 16:22:25 | 23.1 | 15.8 | NOVALUE |
| Time [date] | Sensor 5 [°C] |
| 11/25/2002 16:17:37 | 31.1 |
| 11/25/2002 16:18:37 | 30 |
| 11/25/2002 16:19:37 | 29.2 |
| 11/25/2002 16:20:37 | 32.1 |
| 11/25/2002 16:21:37 | 28.2 |
| 11/25/2002 16:22:37 | 28.3 |
| Time [date] | Sensor 4 [°C] |
| 11/25/2002 16:17:25 | 15.51234 |
| 11/25/2002 16:18:25 | 15.8376 |
| 11/25/2002 16:19:25 | 15.9345 |
| 11/25/2002 16:22:25 | 15.8765 |
Result: Using 3 “SubMatrices” eliminates almost all the NoValue cells. Note that now the 3 different “Time” columns have overlapping values-- optimizing data storage in this context requires a balancing of a number of items, including minimizing time repeats and NoValue cells. In the above example each Sensor channels is saved in its entirety, but the Time channel is now saved as 3 different columns. In ASAM-ODS these are called “LocalColumns”, and the Time channel’s “MeasurementQuantity” would link to 3 different “LocalColumns” of values which all belong to the same channel..
LocalColumn
In ASAM-ODS a “LocalColumn” contains a segment of values from a “MeasurementQuantity”. The simplest case is that each “MeasurementQuantity” links to one and only one “LocalColumn” which contains all the values for that “MeasurementQuantity”. In some cases (e.g. the Time channel above) a single “MeasurementQuantity” will link to multiple “LocalColumns” which each store a portion of the values in the “”MeasurementQuantity”. Each “LocalColumn” links to its parent “MeasurementQuantity” and “SubMatrix”. The “LocalColumn” can either contain (“SequenceRepresentation”) or describe (“ExternalComponent”) the data values. At load time all “LocalColumns” of a given “MeasurementQuantity” are reviewed to reconstitute all its values, and the “SubMatrix” is used to order those values relative to other “MeasurementQuantities” also being loaded at the same time. Take the example of the 5 Sensor channels spread over 3 “SubMatrices”:
| Time [date] | Sensor 1 [°C] | Sensor 2 [°C] | Sensor 3 [°C] |
| 11/25/2002 16:17:25 | 20 | 15.5 | 0.012 |
| 11/25/2002 16:18:25 | 20.3 | 15.8 | NOVALUE |
| 11/25/2002 16:19:25 | 20.8 | 15.9 | 0.013 |
| 11/25/2002 16:20:25 | 20.59 | 16 | NOVALUE |
| 11/25/2002 16:21:25 | 20.89 | 16.3 | 0.018 |
| 11/25/2002 16:22:25 | 23.1 | 15.8 | NOVALUE |
| Time [date] | Sensor 5 [°C] |
| 11/25/2002 16:17:37 | 31.1 |
| 11/25/2002 16:18:37 | 30 |
| 11/25/2002 16:19:37 | 29.2 |
| 11/25/2002 16:20:37 | 32.1 |
| 11/25/2002 16:21:37 | 28.2 |
| 11/25/2002 16:22:37 | 28.3 |
| Time [date] | Sensor 4 [°C] |
| 11/25/2002 16:17:25 | 15.51234 |
| 11/25/2002 16:18:25 | 15.8376 |
| 11/25/2002 16:19:25 | 15.9345 |
| 11/25/2002 16:22:25 | 15.8765 |
Now if all 5 channels are loaded at once, you get 1 composite matrix of values:
| Time [date] | Sensor 1 [°C] | Sensor 2 [°C] | Sensor 3 [°C] | Sensor 4 [°C] | Sensor 5 [°C] |
| 11/25/2002 16:17:25 | 20 | 15.5 | 0.012 | 15.51234 | NOVALUE |
| 11/25/2002 16:17:37 | NOVALUE | NOVALUE | NOVALUE | NOVALUE | 31.1 |
| 11/25/2002 16:18:25 | 20.3 | 15.8 | NOVALUE | 15.8376 | NOVALUE |
| 11/25/2002 16:18:37 | NOVALUE | NOVALUE | NOVALUE | NOVALUE | 30 |
| 11/25/2002 16:19:25 | 20.8 | 15.9 | 0.013 | 15.9345 | NOVALUE |
| 11/25/2002 16:19:37 | NOVALUE | NOVALUE | NOVALUE | NOVALUE | 29.2 |
| 11/25/2002 16:20:25 | 20.59 | 16 | NOVALUE | NOVALUE | NOVALUE |
| 11/25/2002 16:20:37 | NOVALUE | NOVALUE | NOVALUE | NOVALUE | 32.1 |
| 11/25/2002 16:21:25 | 20.89 | 16.3 | 0.018 | NOVALUE | NOVALUE |
| 11/25/2002 16:21:37 | NOVALUE | NOVALUE | NOVALUE | NOVALUE | 28.2 |
| 11/25/2002 16:22:25 | 23.1 | 15.8 | NOVALUE | 15.8765 | NOVALUE |
| 11/25/2002 16:22:37 | NOVALUE | NOVALUE | NOVALUE | NOVALUE | 28.3 |
Result: In the reconstituted single matrix of values above, you can see that all the white NoValue cells which were avoided by grouping the channels in 3 separate “SubMatrices”. The remaining NoValues in the Sensor 3 column could also be eliminated by creating a fourth “SubMatrix”, but it is not always best to create as many “SubMatrices” as possible. Organizing measured data is a optimization job. Achieving a truly optimized data structure requires extensive knowledge of the ASAM-ODS structures and the behaviors as well as a clear definition of what you want to optimize.
Related Links:
Download the examples files and these instructions in a Word document
Reader Comments | Submit a comment »
good article but exmaple not running
many of the VIs are broken. it seems that
the reference created by the Open Storage VI
is not accepted by the "Close Storage" vi.
i.e. Get Main db Object names.vi
-
Joe Guo,SignalX Tech.
jyguo@signalxtech.com
- Jul 31, 2008
Legal
This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).
