J
Hello,
the new improved linuxplc.conf file parser has progressed...
Incompatible change: linuxplc.conf now must have sections.
The linuxplc.conf file is divided into sections. Sections are normally indicated by a word in square brackets.
Eg:
[SMM]
xyzzy=42
plugh=86
Alternately, a section can be prepended to a single line like this:
SMM:xyzzy=42
SMMlugh=42
A section can appear any number of times in the file with cummulative effect.
File inclusion is supported. (Recursive, circular OK.)
*include "linuxplc-part1.conf"
There are two types of setting in linuxplc.conf: variables and tables.
Variables
=========
Use:
single values that need to be configured within a module (or
globally throughout the PLC)
Syntax:
variable = value
Variables may be specified any number of times, but only if the
value is always the same (within the same section).
Access from program:
v=conffile_get_value("variable");
or:
v=conffile_get_value_sec("section", "variable");
The first form is preferred, as it will use the module name for the
section. Thus it will be possible to start two instances of the
same module with different configurations.
If the variable doesn't exist, NULL is returned.
Tables
======
Use:
a list of values to be used in a module (or globally in the PLC).
For instance, the mapping between linuxPLC points and physical I/O.
I expect that at least some of the tables will be in keyword
format, so that (after a few initial values each row has) there
will be a sequence of "keyword value" pairs.
Syntax:
tablename word value ...
tablename word value ...
...
For example:
point L1 "light 1" Chaser at 0.0
point L2 "light 2" Chaser at 0.1
point L3 "light 3" Chaser at 0.2
point L4 "light 4" Chaser at 0.3
Access from program:
Err, none yet (except for the "point" table in the "SMM" section).
I think these two types should cover the configuration needs of most
modules...
Comments?
Jiri
--
Jiri Baum <[email protected]>
Windows is not popular. Windows is *widespread*. Linux is popular.
_______________________________________________
LinuxPLC mailing list
[email protected]
http://linuxplc.org/mailman/listinfo/linuxplc
the new improved linuxplc.conf file parser has progressed...
Incompatible change: linuxplc.conf now must have sections.
The linuxplc.conf file is divided into sections. Sections are normally indicated by a word in square brackets.
Eg:
[SMM]
xyzzy=42
plugh=86
Alternately, a section can be prepended to a single line like this:
SMM:xyzzy=42
SMMlugh=42
A section can appear any number of times in the file with cummulative effect.
File inclusion is supported. (Recursive, circular OK.)
*include "linuxplc-part1.conf"
There are two types of setting in linuxplc.conf: variables and tables.
Variables
=========
Use:
single values that need to be configured within a module (or
globally throughout the PLC)
Syntax:
variable = value
Variables may be specified any number of times, but only if the
value is always the same (within the same section).
Access from program:
v=conffile_get_value("variable");
or:
v=conffile_get_value_sec("section", "variable");
The first form is preferred, as it will use the module name for the
section. Thus it will be possible to start two instances of the
same module with different configurations.
If the variable doesn't exist, NULL is returned.
Tables
======
Use:
a list of values to be used in a module (or globally in the PLC).
For instance, the mapping between linuxPLC points and physical I/O.
I expect that at least some of the tables will be in keyword
format, so that (after a few initial values each row has) there
will be a sequence of "keyword value" pairs.
Syntax:
tablename word value ...
tablename word value ...
...
For example:
point L1 "light 1" Chaser at 0.0
point L2 "light 2" Chaser at 0.1
point L3 "light 3" Chaser at 0.2
point L4 "light 4" Chaser at 0.3
Access from program:
Err, none yet (except for the "point" table in the "SMM" section).
I think these two types should cover the configuration needs of most
modules...
Comments?
Jiri
--
Jiri Baum <[email protected]>
Windows is not popular. Windows is *widespread*. Linux is popular.
_______________________________________________
LinuxPLC mailing list
[email protected]
http://linuxplc.org/mailman/listinfo/linuxplc