Plant Model (CNS) Nodes in a Query
You can use plant model (CNS) nodes in the FROM part of an SQL query. This chapter shows how to use a plant model and its nodes for a query. Note that all SQL keywords can be used for queries.
The following view is used for this example. It contains two wind parks and the nodes Anemometer and Wind vane.
- Open the Plant Model Editor via GEDI. or via the icon in
- Create the nodes as shown above - see also the Plant model editor help.
- Create data points for your nodes via the PARA module and add alert handlings to your data points.
- Add the data points to your plant model nodes via drag&drop from the DP view on the right. Drag a data point to the Datapoint field.
- Open the SQL query via .
- Check the check box Alert:
- Open the Select tab and select the elements _alert_hdl.._value, _alert_hdl.._text and _alert_hdl.._alert_color:
- Open the From tab and select System1.Windpark1:WindResource.WindVane.WindDirection. Since the node WindDirection has sub elements, add .*: (dot
asterisk) before the colon.
Note: Note that the colon must be the last character of the FROM statement.
- Open the Where tab and select the Data-point level from the Keywords for WinCC OA check box.
Select then the comparison = (equals). For the Comparison value select the data point southerly:
Note: The timerange tab must not be used for plant model (CNS) queries since historical queries are not supported.
- Open the Sort/Group tab, enable the radio button DP element and select the _alert_hdl_..value from the drop-down menu:
- Open the Data tab and click the button Create query. Save the query via the disk symbol and click on
Start query button. The following query is created:
The query is executed and the alert of the data point node southerly is shown. The time, color and text of the alert are shown:SELECT ALERT '_alert_hdl.._value', '_alert_hdl.._text', '_alert_hdl.._alert_color' FROM 'System1.Windpark1:WindResource.WindVane.WindDirection.*:' WHERE _DP = "southerly"