Converting Units in a Data Preparation Procedure

Updated Jun 1, 2023

Environment

Software

  • DIAdem
  • SystemLink

This article demonstrates how to use unit conversion when making a Data Preparation Procedure (*.DPP file) in DIAdem.
This feature is useful for standardizing units across multiple data files that may be created from multiple sources or operators.

For demonstration purposes, this example uses a TDMS data file and converts kV to V. Find the finalized .DPP and test TDMS file attached.

Follow the steps below to configure unit conversion:

1. Launch DIAdem.
2. Clear the Data Portal and load your data file from the NAVIGATOR panel.
  • This example loads a file called "Test Data.tdms".

Load Data File.PNG

3. Navigate to the SCRIPT tab and click Settings >> SystemLink TDM >> Data Preparation Procedure... from the top toolbar.
4. In the pop-up window, click New Data Preparation Procedure.
  • If prompted to save changes, click No.
  • Specify a Name, Description and Author. This example creates a file called "Test Data Preparation Procedure.DPP".
  • Click OK.
New DPP.PNG

5. From the Replace Identifiers tab, place a check in Harmonize property identifiers and click the Edit... button.
6. In the pop-up window, select the Channel tab.​​​​​​
7. Click Add DataPlugin Mapping.
  • In the pop-up window, select the DataPlugin that matches your data file. This example uses the TDMS DataPlugin.
  • Click OK.

Add DataPlugin Mapping.PNG

8. In the new pop-up window, set the Standardized Identifier to unit_string and Original Identifier to the name of the property that contains your units.
  • For example, the image below shows that the channel called "Sine Wave" has a Custom Property called "Units" with a value of kV. Therefore, the Original Identifier should be Units.
  • Click OK.
  • Click Close.
Replace Identifier.PNG

9. Select the Convert Units tab.
10. Place a checkmark in the Unit conversion box and click Edit...
11. In the pop-up window under the Unit Sets tab, enable the Unit Set you wish to use.
  • This example uses SI Units.
Unit Set.PNG

12. Select the Quantities tab.
  • Scroll through the list of quantities and select the quantity that you're interested in.
  • This example uses Electric potential.
Quantities.PNG

13. Select the Units tab.
  • Ensure that the unit you wish to convert is listed under the Symbol column. This example converts kV to V, which is already a recognised symbol.
  • If the symbol you wish to convert is not listed, click the New Entry (plus symbol) button.
  • Ensure that your standardized unit is set to Default. Since this example is standardizing to V, this is checked as Default.
  • Click Close.
Units.PNG

14. To test the Data Preparation Procedure, click Debug Data Preparation Procedure.
  • If prompted to save, click OK.
  • In the file selection dialog, select the data file you wish to test with.
  • When the simulation completes, click OK to dismiss the dialog.
  • In the Data Portal, check the Base Properties of the channel and observe that the unit conversion has taken place.
Debug Data Preparation Procedure.PNG

Complete Conversion.PNG

Once complete, the .DPP file can be uploaded to a SystemLink Data Preprocessor Instance. Refer to SystemLink Documentation: Creating a Data Preprocessor Instance and SystemLink Documentation: Configuring a Data Preprocessor Instance for instructions.