Properties and use of the XML-configuration file
Storage place of the XML-configuration file:
The configuration file has a fixed storage place.
- On CE devices the configuration file is placed at the following folder "\Hard Disk\TwinCAT\Boot" (If you change the XML-configuration file with the XML-configuration file editor, you have to copy this file back to the folder "\Hard Disk\TwinCAT\Boot")
- On PCs the configuration file is placed at the folder "C:\TwinCAT\Boot"
Loading the XML-configuration file:
The configuration file will be read once if the TcDatabaseSrv.exe is starting.
With the Function block "FB_DBReloadConfig" you can read the configuration file once again. (This is only possible, if the cyclic read/write isn't started.)
After every restart of the TwinCAT System the XML-configuration file will be reloaded.
Mode 1 (StartUp = "AutoStart")
The XML configuration file loads automatically, when the TcDatabaseSrv.exe starts. Because of the value "AutoStart" at the tag StartUp, the Database Server starts immediately creating the connections to the declared databases und ADS-devices. Also, all variables, which are described in symbol groups, are logged to the specified database resp. written with values of the database. This process will be executed with the declared cycle time. The process will be continued until the Database Server is stopped by the PLC with the function block "FB_DBCyclicRdWrt"
Mode 2 (StartUp = "Manual")
The XML-configuration file loads automatically, when the TcDatabaseSrv.exe starts. Because of the value "Manual" at the tag StartUp, no further function will be executed. After this the Database Server is waiting for commands from the PLC.
"FB_DBCyclicRdWrt"
All sections of the configuration file are needed for this function block.
Create the connection to the databases and the ADS-devices which are declared in the XML-configuration file and the cyclic logging with all symbol groups will be started.
All other function blocks only needs the declared databases and ADS-devices of the configuration file. The symbol groups will be ignored. You can see that at the following function block.
"FB_DBWrite"
A connection to the selected database (hDBID) and the selected ADS-device (hAdsID) will be created. After this the variable which is indicated at the function block will be read out from the ADS-device and logged into the database.