Use this page if you want to connect to a MongoDB or InfluxDB database.
Usually, a PLC is needed to control the data exchange with the database. The source memory area in the PLC is specified under General settings.
Data can also be inserted directly into the database via Modbus or MEWTOCOL/MEWTOCOL7 from a device that is connected to the FP-I4C unit. In this case, enable Inserting data automatically from connected device and specify the source and the target.
Ready-made function blocks are available for Control FPWIN Pro7. To download these function blocks or a programming example, select the buttons at the end of the configuration page.
Use database client: Use this toggle switch to enable the NoSQL client function.
First control register: Specify the start address of the control registers used in the PLC to trigger an action.
Last control register: This address is calculated based on the specified control register.
Polling time: Set the interval in seconds to poll the PLC's control registers. If no PLC is used, this is the interval to read the data from the connected device and insert it into the database.
Database type: The FP-I4C unit supports MongoDB and InfluxDB databases.
For MongoDB, make the following settings:
Database instance name: Enter the name of the database instance.
DB connection string URI: Type the string used to connect to MongoDB. If you log in with your username and password, do not enter the credentials in the string. Instead, enter them in the fields below.
Example with username and password: mongodb+srv://<username>:<password>@mongoserver.mongodb.net
(Fill in the login fields.)
Example without username and password: mongodb+srv://@mongoserver.mongodb.net
(Leave the login fields empty.)
Login user name: Enter the user name to log into the database (only required if the <username>
placeholder is used in the connection string).
Login password: Enter the password to log into the database (only required if the <password>
placeholder is used in the connection string).
For InfluxDB, make the following settings:
Organization name: Enter the organization name of InfluxDB.
Server URL: Enter the URL to the InfluxDB server including the port number.
Secret token: Enter the token for the client to access the InfluxDB server.
You can test the connection to the database. This may take up to 60s. Be sure to save your settings before testing so that your changes are taken into account.
If you are not using a PLC, enable Inserting data automatically from connected device to insert new records into the database directly from a connected device. Max. 100 data points can be added. All data points are inserted as one record.
For MongoDB: Enter the name of the target collection.
For InfluxDB: Enter the names of the target bucket and measurement.
Select the interface and station number of the FP-I4C unit.
Select Add new to specify the data to be read from the connected device.
To delete one or more entries from the list, click the individual check boxes and then Delete selection.
For MongoDB, make the following settings:
Property name: Enter the property name of the data.
Data format: Select INT, UINT, BOOL, DINT, UDINT, REAL, STRING, WORD, or DWORD.
Register address: Select the memory area (R, X, or Y for bit addresses and DT, LD, WR, WX, or WY for word addresses) and enter the address number of the memory area to be read.
For InfluxDB, make the following settings:
Field name: Enter the field name of the data.
Tag name (optional): Enter optional metadata. If a tag name is specified, you must also enter a tag value.
Tag value (optional): Enter a tag value if you specified a tag name.
Data format: Select INT, UINT, BOOL, DINT, UDINT, REAL, STRING, WORD, or DWORD.
Register address: Select the memory area (R, X, or Y for bit addresses and DT, LD, WR, WX, or WY for word addresses) and enter the address number of the memory area to be read.
Enable Use encryption if you want to encrypt the communication with the database.
Use CA verification
Usually official certificates must be signed by a certificate authority (CA). If you use a self-signed certificate, turn the toggle switch off (no CA verification is requested).
If official certificates are used, turn the toggle switch on. To upload a certificate from the PC to the FP-I4C unit, drag a file onto the drag and drop area or select a file with the + icon and then select the cloud icon. You can upload all three certificates at the same time.
The following certificates are supported:
Certificate |
File names |
---|---|
CA certificate of the certificate authority (.crt, .csr, .pem) |
ca.crt, ca.csr, ca.pem |
Client certificate (.crt, .csr, .pem) |
client.crt, client.csr, client.pem |
Key file (.key, .pem) |
key.key, key.pem |
Select Save to PC to download a programming example. You can also copy the example to the clipboard and paste it directly into Control FPWIN Pro7. In this case you must download and install the FP-I4C library separately.
When you have changed any settings, a Save button appears in the upper right corner of the screen. You can make changes on multiple pages and then save your settings.
To reset all settings on the current page to the default configuration, select the Reset button at the bottom of the page.