Get MBLogic at SourceForge.net. Fast, secure and Free Open Source 
	software downloads

Help Topics

Topic Details for Soft Logic

Help - Soft Logic Data Table Save


Overview:

A soft logic system on a PC runs in volatile memory. The soft logic data table save/restore feature saves selected data table addresses to be saved to disk and restored when the system re-starts. Data table save and restore is part of the soft logic I/O configuration and does not require the use of any instructions in the soft logic program itself.


Data Table Save Configuration:

The soft logic data save is configured in the soft logic I/O configuration. There are two different save parameters. One parameter is the list of addresses which are to be saved, and the second is the minimum interval between updates. See the help page on soft logic configuration for details on configuration syntax.

Addresses:

The addresses to save are specified individually. Any of the following word address may be saved:

Boolean addresses may not be saved. Some types of word addresses may not be saved because they are normally used for I/O inteface (e.g. XD, YD), they contain system data (e.g. SD), or the complete internal state of the address cannot be guaranteed to be restored properly by simply restoring the data value (e.g. TD, CTD).

Each address is specified individually. There is no limit to the number of addresses which may be saved. However, saving an excessive number of addresses may cause slow down the system to an unacceptable degree. The system does not check to see if the data table addresses are actually used in the soft logic program.

Update Interval:

The update interval is also specified as a parameter in the I/O configuration. The update interval is the minimum time period between saving changes. This can be used to limit the rate at which updates are saved to disk.

The update interval is specified in seconds. Fractions of seconds may be expressed as decimal values. The minimum permitted update interval is 1.0 seconds. Values between 0 and 1 will be changed to 1 second. A negative value will disable data table save operations.


Save and Restore Process:

System Start Up:

When the system starts up, the soft logic configuration is read for the list of data table addresses to be monitored and the update interval. Then, the values previously saved are restored to the soft logic data table prior to the soft logic system being started. Any addresses which are no longer monitored are purged from the database. Unused addresses are also purged whenever a change in the configuration takes place.

Saving Data Table Values:

At the end of each soft logic scan the monitored values are written to disk provided (1) data table save is enabled (the update interval is greater than 0), and (2) the minimum update interval since the last save has expired, and (3) one or more data values have changed since the last update. Only changed values are written to disk.

Data Store File:

Monitored data table values are stored in a file called "mblogic.dtable". The file name is fixed and cannot be changed. This file will be located in the same directory as the configuration files and soft logic program. The file will be automatically created if it is not already present. The file is in a binary database format and should not be altered.