Introduction
Querying of time series data is done via custom functions in Excel. After defining a connection in the configuration screen you can use these functions the same way as you would other built in functions. If you type a ‘=’ sign into a cell a dropdown list of all available functions will appear. The functions starting with FACTRY are the functions implemented by the add-in. In the following 2 section we will describe the usage for 2 functions. All other available functions are described in the help section that you can access by clicking the help button in the task pane.
Example for getting a single value of a measurement
- Select any cell in the worksheet and type in the following formula: =FACTRY.GET_VAL(“historian”;“plant1”;“MACHINE1/TEMPERATURE”; NOW();“1h”).
- Replace “historian” with the name of the connection you have configured here
- Replace “plant1” with the name of the time series database of the measurement.
- Replace “MACHINE1/TEMPERATURE” with the name of the measurement you whish to query.
- Replace NOW() with the specific timestamp to query or keep it to get the most recent value.
- Replace “1h” with the maximum age that the value may have.
- Pressing enter will display the resulting value in the selected cell.
Example for getting multiple raw values
- Select any cell in the worksheet and type in the following formula: =FACTRY.GET_RAW_DATA(“historian”;“plant1”;{“CALC_CONST_BOOL”;“CALC_CONST_NUMBER”};NOW()-1;NOW()-1;10)
- Replace “historian” with the name of the connection you have configured here
- Replace “plant1” with the name of the time series database of the measurement.
- Replace {“CALC_CONST_BOOL”;“CALC_CONST_NUMBER”} with an array the measurement you whish to query. You can also use a single measurement.
- Replace NOW()-1 with the start time and NOW() with the end time.
- Replace 10 with the maximum number of values you want returned.
- Pressing enter will display the resulting value in the cells below the formula.
Use reference to other cells in the function for an easy configuration and reusability
For example =FACTRY.GET_RAW_DATA(B1;B2;B3:G3;B4;B5;B6) will fill in the parameters for this function from the values that are filled into column b
For example =FACTRY.GET_RAW_DATA(B1;B2;B3:G3;B4;B5;B6) will fill in the parameters for this function from the values that are filled into column b