Use this page if you wish to connect to an SQL 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 SQL client: Use this toggle switch to enable the SQL 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.
SQL connection timeout: Set the timeout for the connection between the FP-I4C unit and the SQL database (min. 3s, max. 120s).
For Microsoft Azure, encryption is automatically enabled (all security settings will be ignored).
Database instance name: Enter the name of the database instance.
Server (IP address or host name): Enter the IP address or host name of the server.
Server port: Set the port number of the server.
Login user name: Enter the user name to log into the database.
Login password: Enter the password to log into the database.
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.
To insert data into the database directly via Modbus or MEWTOCOL/MEWTOCOL7, enable Inserting data automatically from connected device. Max. 100 data points can be added. All data points are inserted as one record. This method only works with a single table.
Enter the name of the target table.
Select the interface and station number of the FP-I4C unit.
Select Add new to specify the target columns of the SQL table to receive the data.
To delete one or more entries from the list, click the individual check boxes and then Delete selection.
Make the following settings:
Column name: Enter the name of the column.
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 SQL database. This setting has no effect for Microsoft Azure because connections are always encrypted.
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.