The config file is traditionally called
you can give it any name you like). It determines what modules are running
and any tuning parameters the modules require as well as configuring the
MatPLC core, its global memory map and the like.
As such, the
matplc.conf file is effectively the `main'
file in any installation: all options and settings are either in this file,
or in some file it specifies.
The Configuration Editor
will be the easiest way to create and edit
it is finished. For now, you will still have to do at least some editing
with a text editor.
Lines that begin with
# are comments, and are ignored.
Comments may also be placed on the end of a line. To put a
into a value, enclose the whole value with quote marks,
Quote marks may generally be used to enclose things that otherwise
wouldn't be allowed in a value, like spaces or similar. Quotes may be
\" and backslashes must then be
#!magic. As far as the MatPLC itself is concerned, that's just a comment.
PLC. In addition, when a module is started, it is always given a name, and this name is used as the config section to retrieve all settings. In this way, two modules of the same kind (for instance two Modbus modules, to run on different serial ports) can be started at once without interfering with one another by giving them different names.
Sections are indicated in two ways:
[section]header on its own line, which gives the section for the following lines up to the next
[section]or the end of the file, or
section:prefix on the beginning of a line, which overrides the section only for this line. The next line is back to the section indicated by the last
[section], unless it has its own prefix.
In each section, each setting can only be given once, because it doesn't make sense to have two different settings for the same option. (Technically, it can be repeated, but only if they all have exactly the same value.)
name = value
These may be interspersed with other settings and tables, even in separate pieces of a section or different files. When the config is read in, all the pieces of each table are joined together exactly as though it was given in one place.
name value value...
name value value...
Note that the first value in each row must start with an alphanumeric; if you need to start it with a punctuation symbol, enclose it in quotes. This is because the MatPLC needs to be able to distinguish tables from single values and so on.
This allows one to separate the config into various logical pieces, for instance by module, or to have various configurations of options with common pieces being in common files.
The included files may themselves
*include others, and so
on. Even circular
*includes are supported and handled
sensibly: each file will only be read once.
Shell expansion is also done, so
filename may include
wildcards, environment variable substitution, and so on (however, backticks
are not allowed).
Sections do not continue from one file to another: each file must take
care of its own sections. In effect, this basically means that each file
must start with a
[section] header, possibly after
$Date: 2004/12/28 05:32:10 $