InfluxDB
This section contains information about the configuration and the data type mapping of InfluxDB.
Supported version: 1.7.x, 1.8.x
Declaration in the TwinCAT Database Server Configurator
InfluxDB | |
---|---|
Database type | Select "InfluxDB" from the drop-down menu. |
Server | Enter the address of the desired database server here. |
Database | Enter the name of the database. If the database does not yet exist, you can create it with "Create". |
Authentication | None: No authentication User name/password: Login with user name and password |
Windows CE support Under Windows CE this database is not supported by the TwinCAT Database Server. |
Data type mapping between DB and PLC
E_ColumnTypes | InfluxDB | TwinCAT PLC |
---|---|---|
BigInt | Integer | LINT |
Integer | Integer | DINT |
SmallInt | Integer | INT |
TinyInt | Integer | BYTE |
Bit_ | Boolean | BOOL |
Money | Float | LREAL |
Float | Float | LREAL |
Real_ | Float | LREAL |
DateTime |
| DT |
NText | String | STRING |
NChar | String | STRING |
Image |
| ARRAY OF BYTE |
NVarChar | String | STRING |
Binary |
| ARRAY OF BYTE |
VarBinary |
| ARRAY OF BYTE |
| Tag | STRING |
| "time" | LINT |
Time
As a time series database, InfluxDB has some special features. Each measurement (table) of a series contains the time column, tag columns and field columns. The time column is stored in the database as UNIX epoch time. The function blocks of the database server use the TwinCAT time (number of 100 ns steps since January 1, 1601). They are converted to UNIX epoch time. The FB_SQLDBCommand is excluded from this conversion. Here you can transfer your own free timestamps without conversion. The precision is set to "ns" accuracy. Times are unique in InfluxDB as ID together with the tag columns. If the tags and the time are identical, a data set is overwritten.
Standard table structure
The standard table structure for InfluxDB looks like this in the PLC:
ColumnName | InfluxDB | TwinCAT PLC |
---|---|---|
time | Integer | LINT |
Name | Tag | T_MaxString |
Value | Float | LREAL |
Data type support WSTRING is not supported by this database. (See WString support) |
Notice | |
Data security In flash memory devices the number of write access operations is limited. The flash memory devices can fail, with a risk of data loss.
|