Movicon CE - Rel. 11.7.1301
The Movicon CE historicals (Log, Trace, Data Loggers and Recipes) are recored for default in IMDB (In Memory DB) mode. When creating projects for WinCE all the historical settings with IMDB are enabled for default in the developing enviroment as the ADOCE components need for recording on SQLCE are not always available in all devices. As an alternative, you can use a relational database, defined as the ODBC (Open Database Connectivity) in the development environment, for recording instead of the IMDB. WinCe does not support ODBC and therefore allODBC connections on the target device are converted automatically in ADOCE connections by Movicon. The SQL Server is the DataBase format set for default.
IMDB Engine
The IMDB engine saves and manages data directly in RAM. The memory tables are unloaded on text files with .dat extensions.
Each historical table has its own file where data is only saved in delayed mode based on a preset time (10 seconds for default) after the table has undergone any modifications. These text files have two functions: they can be used for transferring data to other supported files and are used at the project startup for preloading the tables with their most recent values in the historicals.
|
The Panel RAM use is also strongly conditioned by the use of the IMDB historicals (InMemoryDB). |
|
There is a "General/InstallComponents" registry key for WinCE that can be set at zero block the ADOCE and SQL Server CE components from being loaded at project start up. This will save memory space if you do not intend to use these components for recording data. |
The Movicon CE project's historicals record data using the IMDB engine for default, (except for certain different settings). As an alternative, you can use a relational database for recording instead of the IMDB. If you do not select the IMDB settings in the project, Movicon will use the ODBC (Open DataBase Connectivity) in the Desktop by automatically converting to ADOCE (SQLCE) connections on the panel (WinCE does not have ODBC).
Historical data is recorded by the IMDB engine on output files in the permanent memory (Flash compact) and loaded in RAM at each project startup. The IMDB works in RAM (InMemoryDB) to ensure data access management, analysis, filters and queries in the project.
Default values
When creating a project for WinCE, Movicon will set the following values for default in each of the project's historical recording engines:
Use IMDB Manager (property)
Shared IMDB Tables
Data Max.Age is 180 days (caution, we recommend you reduce this value in panels with little memory capacity)
Nr. 4 MB RAM allocation for IMDB manager (MovCE.ini)
The default values can or should be changed as required and according to device being use.
New contraint values for the historicals
The maximum historical log table age has been set with a new constraints value (in act from build 955) called "MaxDaysAgeHistoric". This value has been set at 7 days for WinCE projects, therefore the alarm, driver and system message tables cannot exceed this maximum age limit in WinCE projects.
Movicon CE will therefore allocate 4MB of RAM for the projects IMDB tables for default. This value can be changed in the MovCE.ini file. You will need to check that:
1. The device has at least 4MB of RAM available.
2. That 4MB of RAM are enough to contain the files required in the project.
3. If the "Shared Tables" setting is disabled Movicon CE will no longer allocate memory and therefore you will need to make sure there is enough RAM to cater for the size of the files set.
|
It is essential that the recording engines (Historical Log and Data Loggers) are sized according to the amount of data needed: All the IMDB historicals are always stored in RAM which will be consumed during the project run until the preset memory allocated is completely occupied!! |
|
Once this preset limit has been reached (4 MB for default) the IMDB will stop recording any further values until space has been freed from the Historicals' tables. A "IMDB - Internal error: Out of shared memory" message will appear in the system Log. |
measure memory consumptions
The IMDB uses the RAM for managing historicals and allocates space to the compact flash for saving .dat and /or xml. files.
The following table shows the correspondence between the types of Movicon project variables and the data type created by the IMDB in its tables:
Data Type |
Movicon Data Type |
IMDB Bytes Size |
Bit, String, Array, Structure
|
Character |
1 byte per character (2 bytes for unicode) |
Byte, Sign Byte, Sign Word, Word, Sign Dword, Dword
|
Numeric |
4/8 bytes (32/64 bit value)
|
Float, Double
|
Decimal |
8 bytes |
TimeCol, LocalCol
|
Date/Time |
8 bytes (100 nano-seconds resolute) |
Space occupied by a .dat file is about a ratio of 1:3 in respect to memory occupied of the same table. For instance, a table occupying 1 MByte memory space will be about 350 KBytes in size when exported to a text file.
Space occupied by a xml file is about a ratio of 1:3 in repect to memory occupied of there same table. However, you must keep in mind that the xml file is 5 times bigger in size than the dat. file meaning that a noticeable higher amount of memory will be use when saving in xml files.
In principle, an estimated memory use can be calculated using this formula:(Size .dat + Size .xml) * 3
Below is a table showing how much memory will be used according to the number of records to be saved in a .dat or xml file. These value calculations were taken from a Data Logger with 10 mixed columns (Bit, Sign Byte, Byte, Sign Word, Word, Sign Dword, Dword, Float, Double, Strings with 15 chars), in a Vipa XScale PXA255 device .
Records Nr. |
Memory size with .dat file |
Memory size with .dat and .xml file |
100 |
~ 467 Kbyte |
~ 780 Kbyte |
1000 |
~ 865 Kbyte |
~ 3940 Mbyte |
2000 |
~ 1292 Mbyte |
~ 7448 Mbyte |
5000 |
~ 2737 Mbyte |
~ 18038 Mbyte |
|
Note: Using a project with more than one Data Logger IMDB, it's reccomended to set an adequate value as property that define the writing delay time on the storage card, and if possible, different for any Data Logger. This is due to the slow response in writing on a compact flash of certain devices. |
|
It is strongly advised that you use the historicals in ADOCE (SQLCE) when large amounts of data need filing or a big historical file (more than 30 days) needs to be stored!! |
IMDB Setting Options
"Shared Table" |
Tables are created in shared memory, which is a chew memory not reserved just for Movicon CE applications but can be shared (default value = true). As WinCE 5.0 is fixed at 32 MB the memory limit that each process can allocate, this option allows the remaining memory to be used in cases where the device's program memory is more than 32 MB.
|
"Max # Records" |
This value can be used to limit the number of records existing on database. Therefore Movicon will see that the maximum number of records in the table is maintained, as from parameter. In any case, data which is older than the maximum age set will be deleted even though the maximum number of records has not been reached. The "0" default value disabled this function. This stops data from being lost when any product updates occur. The recipes are not subject to the max. number of records and age management even though they have these properties.
|
Some options can be inserted into the "MovCE.ini" file which allow you to customize some aspects of the IMDB.
"IMDBMaxHMemory" |
Maximum memory size which can be allocated in the shared area for managing the historicals. The default value is 4 Mbytes for WinCE and 16 Mbytes for Win32/64. Once this limit has been reached the IMDB will no longer record any values until space has been freed in the historical tables. This message will appear in the system log: "IMDB - Internal error: Out of shared memory".
|
"IMDBMaxLMemory" |
Maximum memory size which can be allocated in the local area for managing historicals. This parameter has meaning only when historicals have been set not use the shared area. The default value is 4 Mbytes for WinCE and 64 Mbytes for Win32/64. Once this limit has been reached the IMDB will no longer record any values until space has been freed in the historical tables. This message will appear in the system log: "IMDB - Internal error: Out of local memory".
|
|
When using the Movicon Desktop version, local memory is always used for exporting .xml files. When using the WinCE version, the shared memory is always used for exporting .xml files that will, however, be limited by the IMDBMaxHMemory (default 4MB) value. |