Siemens Wind Turbines with Config Files
This plugin will read from the Siemens Data Historian, which is a Microsoft SQL Server, and send the data to the Ardexa cloud. It can be used to discover data, and also log data to the local device, and send it to the Ardexa cloud. This plugin works by using configuration files to control the names of variables, tables and sources.
Configuration of the Ardexa Edge Device
Ensure you have read a copy of the manufacturer's operating and safety manual. Please review the manual for safety instructions. Ardexa uses the Siemens Historian to read live and historical data. The Historian uses a Microsoft SQL Server to store the data. It is available from TCP Port 1433 on the IP address for which the Siemens Historian server is located. Access to the data is via userid and password to a specific database. Once the Ardexa edge device is installed on the plant's network, verify that it can "ping" the Siemens Historian using the following command in the REMOTE SHELL (replace the IP address with the IP address of the Historian Server):
ping -c 1 192.168.1.2
Also, check that the TCP Port for the Siemens Historian is open. You can do this using the REMOTE SHELL, using the nmap command as follows.
nmap -sS -p 1433 192.168.1.2
Generally speaking, most firewalls are stateful. This means that once you allow outgoing connections, the firewall will recognise responses coming back from the Internet and let them pass despite the fact that there is no explicit rule to allow incoming data. Some older Siemens installations may require additional rules to allow the Ardexa machine to work correctly. So be aware that;
The firewall may not be stateful and therefore explicit incoming rules need to be created to allow replies to come back through the firewall (5671/tcp, 53/udp)
DNS uses UDP which is not a "connection orientated" protocol and while modern routers handle it just fine. Some Siemens sites might be old enough to require explicit rules to allow DNS.
Please don't forget to send to Ardexa:
Clear photographs of the installation
The IP address of the Siemens Historian
The userid of the Siemens Historian
The password of the Siemens Historian
The database name, if it is different to
WpsHistory
The port of the Siemens Historian, if it is different to 1433.
The quantity and model numbers of all wind turbines at the park
Data Discovery
The plugin can be used to discover data, in particular:
All the tables in the Siemens database
All the fields within those tables, and/or
A sample of the data within those fields
The following sections detail how to undertake data discovery.
Discovering Tables
In order to list all the table names, the following command can be executed either on the REMOTE SHELL, or the via the plugin RUN DISCOVERY function. To run a discovery via the plugin's RUN DISCOVERY function, do the following:
Ensure the
Database config YAML
has the correct credentials to connect to the database. This file must be formatted as follows:
ip_address: 192.168.1.10
user: {whatever}
passwd: {whatever}
db_name: WpsHistory
driver: FreeTDS
port: 1433
If db_name
is optional. If it is not defined, it will default to: WpsHistory
. The driver
is the software driver to use to connect to the database. For MSSQL installations greater than Version 2000, remove the driver
entry and it will default to ODBC Driver 17 for SQL Server
. For all other installations, include the line driver: FreeTDS
. The port
maybe excluded and the default value of 1433
will be used. So they default values look like:
db_name: WpsHistory
driver: ODBC Driver 17 for SQL Server
port: 1433
Ensure the
Output config file
is set toshow_tables
.Select
RUN DISCOVERY
.
This will then show a list of tables, which should look like this:
Date on SQL Server: 2024-08-13 01:23:32.677000
Date on Ardexa Device: 2024-08-13 01:23:32 +0100
Available Database Tables:
tblAlarmLog
tblDailySummary
tblGrid
tblGridScientific
tblMaintenancePlan
tblSCMet
tblSCTurCount
tblSCTurDigiIn
tblSCTurDigiOut
tblSCTurFlag
tblSCTurGrid
tblSCTurIntern
tblSCTurPress
tblSCTurTemp
tblSCTurbine
tblSCWps
tblStation
Note that it also shows the date on the Siemens SQL server and the Ardexa device. CHECK THAT BOTH TIMES MATCH. This is important since the database server's time sometimes drifts, if it is no regularly synced with a time source.
The equivalent REMOTE SHELL command to view all the database tables is:siemens_odbc_ardexa discover data {CONFIG_FILE} {SHOW_TABLES_FILE}
. The CONFIG_FILE is the location of the file containing the credentials. The SHOW_TABLES_FILE file is an empty file that ends with show_tables
(with this exact name - path does not matter)
For example: siemens_odbc_ardexa discover data /opt/ardexa/config/siemens-odbc-ardexa/testonly.config_file /opt/ardexa/config/siemens-odbc-ardexa/show_tables
Discovering Fields
In order to list all the field names within a table, the following command can be executed either on the REMOTE SHELL, or the via the plugin RUN DISCOVERY function. To run a discovery via the plugin's RUN DISCOVERY function, do the following:
Ensure the
Database config YAML
has the correct credentials to connect to the database as discussed above.Ensure the
Output config file
is set toshow_fields
.Include the table, for which the fields must be known. For example; using the above tables output, this could be
tblSCTurTemp
. This should only be a single table entry.Select
RUN DISCOVERY
The output of this command will show all the fields in the specified database table, along with a sample of the rows in the table. For some of the tables, the fields will also details the name and units of the fields. This will be something like the following. Note that it also shows the date on the Siemens SQL server and the Ardexa device. CHECK THAT BOTH TIMES MATCH. This is important since the database server's time sometimes drifts, if it is no regularly synced with a time source. Also note the unique turbines (or grids) are also displayed when discovering fields.
Date on SQL Server: 2024-08-17 01:40:24.840000
Date on Ardexa Device: 2024-08-17 01:40:24 +0100
Table Name Type Start
------------ ----------------------------- -------- -------
tblSCTurGrid TimeStamp datetime 1
tblSCTurGrid StationId int 2
tblSCTurGrid wtc_VoltPhR_min real 3
tblSCTurGrid wtc_VoltPhR_max real 4
tblSCTurGrid wtc_VoltPhR_mean real 5
tblSCTurGrid wtc_VoltPhR_stddev real 6
tblSCTurGrid wtc_VoltPhS_min real 7
Sample rows for table tblSCTurGrid
TimeStamp StationId wtc_VoltPhR_min wtc_VoltPhR_max wtc_VoltPhR_mean wtc_VoltPhR_stddev wtc_VoltPhS_min
------------------- ----------- ----------------- ----------------- ------------------ -------------------- -----------------
2024-08-17 01:30:00 1234569 398.5 399.4 398.985 0.169307 401.3
2024-08-17 01:30:00 1234568 398.8 399.7 399.262 0.165296 402.7
2024-08-17 01:30:00 1234567 399 400.4 399.78 0.164595 402
2024-08-17 01:30:00 1234566 398.7 400 399.507 0.167934 402.3
2024-08-17 01:30:00 1234565 398.6 399.9 399.453 0.166993 401.6
2024-08-17 01:20:00 1234569 397.9 399.2 398.876 0.0893104 400.8
2024-08-17 01:20:00 1234568 398.6 399.5 399.206 0.0862405 402.4
2024-08-17 01:20:00 1234567 399 400 399.727 0.0864405 401.9
2024-08-17 01:20:00 1234566 398.7 399.7 399.44 0.0871474 402.4
2024-08-17 01:20:00 1234565 398.7 399.7 399.395 0.0844909 401.7
Turbine Name: WEA01 StationId: 1 CommunicationId: 1234565
Turbine Name: WEA02 StationId: 2 CommunicationId: 1234566
Turbine Name: WEA03 StationId: 3 CommunicationId: 1234567
Turbine Name: WEA04 StationId: 4 CommunicationId: 1234568
Turbine Name: WEA05 StationId: 5 CommunicationId: 1234569
The equivalent REMOTE SHELL command to view all the database tables is:siemens_odbc_ardexa discover fields {CONFIG_FILE} {TABLE_NAME}
. The CONFIG_FILE is the location of the file containing the credentials. The TABLE_NAME is an entry from the output of Discovering Tables
discussed above.
For example: siemens_odbc_ardexa discover data /opt/ardexa/config/siemens-odbc-ardexa/testonly.config_file /opt/ardexa/config/siemens-odbc-ardexa/show_fields tblSCTurbine
Discovering Data Using Custom Mapping File
The primary purpose of a configuration file driven plugin is to provide as much flexibility as possible when defining what to capture and what to call each field. This plugin is able to read a mapping file to undertaken one or more of the following tasks:
Only collecting required variables and ignoring anything else.
Renaming all or selected variables to something else.
Scaling variables.
Changing units.
Sending data to customised tables and sources in the Ardexa cloud.
The mapping file is a comma separated file containing 9 items as follows:
Ardexa Table. This is the name of the Ardexa table, where the data will be copied.
Ardexa Source. This is the Ardexa source name given to the data.
Ardexa Variable Name. This is the name given to the variable as it will appear in the Ardexa cloud.
Station ID. This is the source name (usually the "turbine or grid name") to get the data. This name is not case sensitive. Running the "show tables" command will show all available Station names and their IDs.
DB Table. This is the database table that needs to be queried to get the variable. This name IS case sensitive.
DB Field Name. The name of the required variable in the database table. Use the
discover fields
item discussed previously to find the name. This name is not case sensitive.Type. The Ardexa variable type. Can be one of
decimal
,int
,keyword
ordate
Units. The units if the variable. May be empty.
Scale. The scale of the variable. May be empty
Here is an example of a mapping file:
# Ardexa Table[0], Ardexa Source[1], Ardexa Variable Name[2], Station ID[3], DB Table[4], DB Field[5], Type[6], Units[7], Scale[8]
wind_test, turbine-01, WTEST_TIME1, 1234567, tblSCTurTemp, timestamp, date, , 1
wind_test, turbine-01, WTEST_TEMP1, 1234567, tblSCTurTemp, wtc_a1exttmp_mean, decimal, °C, 1
wind_test, turbine-01, WTEST_TEMP2, 1234567, tblSCTurTemp, wtc_ReacUTmp_mean, decimal, °C, 1
wind_test, turbine-01, WTEST_TEMP3, 1234567, tblSCTurTemp, wtc_ReacVTmp_mean, decimal, °C, 1
wind_test, turbine-01, WTEST_TEMP4, 1234567, tblSCTurTemp, wtc_ReacWTmp_mean, decimal, °C, 1
wind_test, turbine-01, WTEST_TEMP5, 1234567, tblSCTurTemp, wtc_trafotma_mean, decimal, °C, 1
wind_test, turbine-01, WTEST_TEMP6, 1234567, tblSCTurTemp, wtc_gens01tf_mean, decimal, °C, 1
wind_test, turbine-01, WTEST_TEMP7, 1234567, tblSCTurTemp, wtc_genavgtm_mean, decimal, °C, 1
wind_test, turbine-02, WTEST_TIME1, 1234568, tblSCTurTemp, timestamp, date, , 1
wind_test, turbine-02, WTEST_TEMP1, 1234568, tblSCTurTemp, wtc_a1exttmp_mean, decimal, °C, 1
wind_test, turbine-02, WTEST_TEMP2, 1234568, tblSCTurTemp, wtc_ReacUTmp_mean, decimal, °C, 1
wind_test, turbine-02, WTEST_TEMP3, 1234568, tblSCTurTemp, wtc_ReacVTmp_mean, decimal, °C, 1
wind_test, turbine-02, WTEST_TEMP4, 1234568, tblSCTurTemp, wtc_ReacWTmp_mean, decimal, °C, 1
wind_test, turbine-02, WTEST_TEMP5, 1234568, tblSCTurTemp, wtc_trafotma_mean, decimal, °C, 1
wind_test, turbine-02, WTEST_TEMP6, 1234568, tblSCTurTemp, wtc_gens01tf_mean, decimal, °C, 1
wind_test, turbine-02, WTEST_TEMP7, 1234568, tblSCTurTemp, wtc_genavgtm_mean, decimal, °C, 1
Note:
Anything starting with
#
is a comment and can be ignored.If timestamp need to be included, then use
timestamp
. See the first 1 lines above as an example.
The above mapping file will produce the following output. Note that it shows the date on the Siemens SQL server and the Ardexa device. CHECK THAT BOTH TIMES MATCH. This is important since the database server's time sometimes drifts, if it is no regularly synced with a time source.
Date on SQL Server: 2024-08-17 04:10:02.947000
Date on Ardexa Device: 2024-08-17 04:10:02 +0100
Table wind_test
Source turbine-01
WTEST_TIME1(date) 2024-08-17T04:00:00
WTEST_TEMP1(decimal:°C) 17.6
WTEST_TEMP2(decimal:°C) 53.9
WTEST_TEMP3(decimal:°C) 56.4
WTEST_TEMP4(decimal:°C) 53.4
WTEST_TEMP5(decimal:°C) 47.3
WTEST_TEMP6(decimal:°C) 42.5498
WTEST_TEMP7(decimal:°C) 47.506
Table wind_test
Source turbine-02
WTEST_TIME1(date) 2024-08-17T04:00:00
WTEST_TEMP1(decimal:°C) 17.1
WTEST_TEMP2(decimal:°C) 54.9
WTEST_TEMP3(decimal:°C) 57.2
WTEST_TEMP4(decimal:°C) 56.4
WTEST_TEMP5(decimal:°C) 47.7919
WTEST_TEMP6(decimal:°C) 46.1779
WTEST_TEMP7(decimal:°C) 50.2364
The equivalent REMOTE SHELL command to view all the database tables is:siemens_odbc_ardexa discover data {CONFIG_FILE} {MAPPING_FILE}
. The CONFIG_FILE is the location of the file containing the credentials. The MAPPING_FILE is the mapping file name and must exist
For example: siemens_odbc_ardexa discover data /opt/ardexa/config/siemens-odbc-ardexa/testonly.config_file /opt/ardexa/config/siemens-odbc-ardexa/mapping.csv
Discovering Data Using Custom "Per Source" Files
Instead of using a single mapping file (as discussed above), a separate file for each "source" can be used in conjunction with the file system to produce the desired table/source names. If the "mapping file" argument ends with the (exact) name per_source
(an empty file with this exact name, path does not matter), then the plugin will recursively look for files in the directory /opt/ardexa/config/siemens-odbc-ardexa/per-source
. The file structure is very similar to that used in /opt/ardexa/logs
, where the first directory is the Ardexa Table
, and any subsequent directories, plus the file name (minus the extension) will form the Ardexa Source Name
. For example, take the following file structure:
/opt/ardexa/config/siemens-odbc-ardexa/per-source
└── wind_iec_600s
├── WTG01
│ └── turbine1.csv
└── turbine2.csv
This file structure will produce two sources (WTG01
, WTG01/Data2
) that will both log data to the Ardexa table called wind_iec_600s
. The contents of the file is the same as the single mapping file, minus the "Table" and "Source Name" fields. The "per-source" file is a comma separated file containing 7 items as follows:
Ardexa Variable Name. This is the name given to the variable as it will appear in the Ardexa cloud.
Station ID. This is the source name (usually the "turbine or grid name") to get the data. This name is not case sensitive. Running the "show tables" command will show all available Station names and their IDs.
DB Table. This is the database table that needs to be queried to get the variable. This name IS case sensitive.
DB Field Name. The name of the required variable in the database table. Use the
discover fields
item discussed previously to find the name. This name is not case sensitive.Type. The Ardexa variable type. Can be one of
decimal
,int
,keyword
ordate
Units. The units if the variable. May be empty.
Scale. The scale of the variable. May be empty
Here is an example of two mapping files:
turbine1.csv
# Ardexa Variable Name[0], Station ID[1], DB Table[2], DB Field[3], Type[4], Units[5], Scale[6]
WTEST_TIME1, 1234567, tblSCTurTemp, timestamp, date, , 1
WTEST_TEMP1, 1234567, tblSCTurTemp, wtc_a1exttmp_mean, decimal, °C, 1
WTEST_TEMP2, 1234567, tblSCTurTemp, wtc_ReacUTmp_mean, decimal, °C, 1
WTEST_TEMP3, 1234567, tblSCTurTemp, wtc_ReacVTmp_mean, decimal, °C, 1
WTEST_TEMP4, 1234567, tblSCTurTemp, wtc_ReacWTmp_mean, decimal, °C, 1
WTEST_TEMP5, 1234567, tblSCTurTemp, wtc_trafotma_mean, decimal, °C, 1
WTEST_TEMP6, 1234567, tblSCTurTemp, wtc_gens01tf_mean, decimal, °C, 1
WTEST_TEMP7, 1234567, tblSCTurTemp, wtc_genavgtm_mean, decimal, °C, 1
turbine2.csv
# Ardexa Variable Name[0], Station ID[1], DB Table[2], DB Field[3], Type[4], Units[5], Scale[6]
WTEST_TIME1, 1234568, tblSCTurTemp, timestamp, date, , 1
WTEST_TEMP1, 1234568, tblSCTurTemp, wtc_a1exttmp_mean, decimal, °C, 1
WTEST_TEMP2, 1234568, tblSCTurTemp, wtc_ReacUTmp_mean, decimal, °C, 1
WTEST_TEMP3, 1234568, tblSCTurTemp, wtc_ReacVTmp_mean, decimal, °C, 1
WTEST_TEMP4, 1234568, tblSCTurTemp, wtc_ReacWTmp_mean, decimal, °C, 1
WTEST_TEMP5, 1234568, tblSCTurTemp, wtc_trafotma_mean, decimal, °C, 1
WTEST_TEMP6, 1234568, tblSCTurTemp, wtc_gens01tf_mean, decimal, °C, 1
WTEST_TEMP7, 1234568, tblSCTurTemp, wtc_genavgtm_mean, decimal, °C, 1
Note:
Anything starting with
#
is a comment and can be ignored.If timestamp need to be included, then use
timestamp
. See the first 1 lines above as an example.
The above "per source" mapping files will produce the following output. Note that it shows the date on the Siemens SQL server and the Ardexa device. CHECK THAT BOTH TIMES MATCH. This is important since the database server's time sometimes drifts, if it is no regularly synced with a time source.
Date on SQL Server: 2024-08-17 04:55:27.613000
Date on Ardexa Device: 2024-08-17 04:55:27 +0100
Table wind_iec_600s
Source turbine2
WTEST_TIME1(date) 2024-08-17T04:50:00
WTEST_TEMP1(decimal:°C) 16.6
WTEST_TEMP2(decimal:°C) 54.9
WTEST_TEMP3(decimal:°C) 57.2
WTEST_TEMP4(decimal:°C) 55.4
WTEST_TEMP5(decimal:°C) 46.742
WTEST_TEMP6(decimal:°C) 53.8385
WTEST_TEMP7(decimal:°C) 56.9697
Table wind_iec_600s
Source WTG01/turbine1
WTEST_TIME1(date) 2024-08-17T04:50:00
WTEST_TEMP1(decimal:°C) 17.1
WTEST_TEMP2(decimal:°C) 53.9
WTEST_TEMP3(decimal:°C) 55.5915
WTEST_TEMP4(decimal:°C) 53.4
WTEST_TEMP5(decimal:°C) 46.8
WTEST_TEMP6(decimal:°C) 49.9627
WTEST_TEMP7(decimal:°C) 55.7957
The equivalent REMOTE SHELL command to view all the database tables is:siemens_odbc_ardexa discover data {CONFIG_FILE} {PER_SOURCE_FILE}
. The CONFIG_FILE is the location of the file containing the credentials. The PER_SOURCE_FILE argument must ends with the name per_source
(an empty file with this exact name, path does not matter), then the plugin will recursively look for files in the directory /opt/ardexa/config/siemens-odbc-ardexa/per-source
For example: siemens_odbc_ardexa discover data /opt/ardexa/config/siemens-odbc-ardexa/testonly.config_file /opt/ardexa/config/siemens-odbc-ardexa/per_source
Remember that the per-source directory must be created, as follows: mkdir -p /opt/ardexa/config/siemens-odbc-ardexa/per-source
. Then create directories and files as required, and in accordance with the discussion above.
"Per Source" Mapping Generator
As discussed above, mapping files allow as much flexibility as possible. There is a very high probability that most of the time, the same OEM input field will need to be to mapped to the same output field name (such as an IEC name), for all the turbines at a site. To assist with this repetitive process, the plugin includes a generate
sub-command that will accept a template
CSV file, which describes the general mapping and applies it to any turbines that can be automatically discovered. The template file for a "per source" generate command will look a "mapping" file discussed above, except that the first 2 columns (table and source) have been removed.
This is an example "per source" mapping file. Note that the mapping will only handle Turbines (for now - not "Grids). Also, note that the all the fields are case sensitive.
# Source Name[0], Variable Name[1], DB Table[2], DB Field[3], Type[4], Units[5], Scale[6]
${turbine}, WTEST_AENO_MEAN, tblSCTurbine, wtc_SecAnemo_mean, float, m/s, 1
${turbine}, WTEST_GEN_RPM, tblSCTurbine, wtc_GenRpm_mean, float, rpm, 1
${turbine}, WTEST_MAIN_RPM, tblSCTurbine, wtc_MainSRpm_mean, float, rpm, 1
${turbine}, WTEST_PITCH_BLADEA, tblSCTurbine, wtc_PitchRef_BladeA_mean, float, °, 1
${turbine}, WTEST_PITCH_BLADEB, tblSCTurbine, wtc_PitchRef_BladeB_mean, float, °, 1
${turbine}, WTEST_PITCH_BLADEC, tblSCTurbine, wtc_PitchRef_BladeC_mean, float, °, 1
${turbine}, WTEST_PRI_ANEM, tblSCTurbine, wtc_PriAnemo_mean, float, m/s, 1
${turbine}, WTEST_NAC_HUMID, tblSCTurbine, wtc_NacHumid_mean, float, %, 1
${turbine}, WTEST_YAW_POS, tblSCTurbine, wtc_ScYawPos_mean, float, °, 1
${turbine}, WTEST_WIND_SPEED, tblSCTurbine, wtc_PrWindSp_mean, float, m/s, 1
${turbine}, WTEST_NAC_POS, tblSCTurbine, wtc_NacelPos_mean, float, °, 1
${turbine}, WTEST_TWR_FREQ, tblSCTurbine, wtc_TowerFrq_Frequenc_mean, float, Hz, 1
${turbine}, WTEST_WIND_DIR, tblSCTurbine, wtc_ActualWindDirection_mean, float, °, 1
${turbine}, WTEST_GEN_SPD, tblSCTurbine, wtc_GenSpd_mean, float, rpm, 1
${turbine}, WTEST_ROTOR_SPD, tblSCTurbine, wtc_RotSpdSe_mean, float, rpm, 1
The equivalent REMOTE SHELL command to generate the "per source" mappings files is:siemens_odbc_ardexa generate {CONFIG_FILE} {PER_SOURCE MAPPING FILE} {TABLE NAME}
. The CONFIG_FILE is the location of the file containing the credentials. The MAPPING_FILE is the per source mapping file. The "TABLE NAME" is the name of the Ardexa table, where the events will be sent.
For example: siemens_odbc_ardexa generate /opt/ardexa/config/siemens-odbc-ardexa/task/testonly.config_file /opt/ardexa/config/siemens-odbc-ardexa/oem-to-iec-test_v1.csv wind_iec_600s
Running this command will create the following directories and files.
/opt/ardexa/config/siemens-odbc-ardexa/per-source
└── wind_iec_600s
├── turbine1.csv
└── turbine2.csv
The data can then be discovered using the section titled Discovering Data Using Custom "Per Source" Files
above, to display the data
Log
Logging data to the cloud can be enacted via the Ardexa Front End. The equivalent REMOTE SHELL command is:siemens_odbc_ardexa log {CONFIG_FILE} {PER_SOURCE_FILE or MAPPING FILE}
. The CONFIG_FILE is the location of the file containing the credentials. The MAPPING_FILE argument must ends with the name per_source
(an empty file with this exact name, path does not matter), then the plugin will recursively look for files in the directory /opt/ardexa/config/siemens-odbc-ardexa/per-source
. Otherwise, if a MAPPING FILE is used, it will use that log data
For example: `siemens_odbc_ardexa log /opt/ardexa/config/siemens-odbc-ardexa/task/testonly.config_file
siemens_odbc_ardexa log /opt/ardexa/config/siemens-odbc-ardexa/task/testonly.config_file /opt/ardexa/config/siemens-odbc-ardexa/per_source
Was this helpful?