M
Juan Carlos Orozco wrote:
> > (...)
> > Can anybody think of an acceptable syntax for the point configuration
> > line? Or maybe we should use another table for initializing points?
>
> Using an extra parameter on the point configuration sounds like a better
> solution. Maybe
>
> point name "large name" Module at xx [default xxx]
> or
> point name "large name" Module at xx [init xxx]
> It should be an optional parameter, if its not there the point will default
> to 0.
> One more thing, the point declaration has no data type except for the
> distinction of single-bit and multi-bit points, therefore we have to
> interpret the number from its format.
By the way, the current acceptable syntax for the point config is, (taken from lib/gmm/linuxplc.conf):
# The POINT table
# ---------------
# syntax:
# point name "full name" owner at offset[.bit] [length]
#
# where:
# point = 'point' identifier
# name = Name used to search for point in plc_pt_by_name()
# full name = More extensive description of the point
# This information is not loaded into the confmap of the plc
# owner = Name of the module with write permission on the point
# at = 'at' identifier
# offset = location of word in the globalmap that holds the point's
state
# bit = the bit, in the word, that holds the point's state. This
is
# optional, defaulting to 0.
# length = the size in bits of the point. The point must not overflow
# onto the next offset position (i.e. (bit + length) <
# (8*sizeof (u32)). The length is optional, defaulting to 32
# if bit is not explicitly defined, and 1 otherwise.
#
#
# the POINT_ALIAS table
# ---------------------
# syntax:
# point_alias name "full name" org_name [bit [length]]
#
# where:
# point_alias = 'point_alias' identifier
# name = Name used to search for point in plc_pt_by_name()
# full name = More extensive description of the point
# This information is not loaded into the confmap of the plc
# bit = The first bit, of the original point, that this alias will
# reference. This is optional, defaulting to 0.
# length = the size in bits of the point. The point must not overflow
# outside the original point (i.e. (bit + length) <
# (length of org_name point). The length is optional,
defaulting
# to the length of the org_name point if no bit is
explicitly
# specified, and 1 otherwise.
#
# note:
# (1) offset, bit and length may be written in hexadecimal (0xF45A),
# octal (0172132) or decimal (62554) formats.
#
Using Juan's sugestion, I was thinking we could now have:
# point name "full name" owner at offset[.bit] [length/type] [init xxx]
Where length/type would be either the length in bits, or the variable type (one of: u8, u16, u32, i8, i16, i32, f32). For the moment we would
not accept [{u|i|f}length] because I don't see how we could have f4, u5, etc...
If the variable type is present, it could be used to help interpret the xxx in the [init xxx] part. If not present, we would consider:
default : unsigned (u)
if it has leading +|- : signed (i)
if it has a decimal point: float (f)
The above seems reasonable to me. What do you all think?
Cheers,
Mario.
----------------------------------------------------------------------------
Mario J. R. de Sousa
[email protected]
----------------------------------------------------------------------------
The box said it requires Windows 95 or better, so I installed Linux
_______________________________________________
LinuxPLC mailing list
[email protected]
http://linuxplc.org/mailman/listinfo/linuxplc
> > (...)
> > Can anybody think of an acceptable syntax for the point configuration
> > line? Or maybe we should use another table for initializing points?
>
> Using an extra parameter on the point configuration sounds like a better
> solution. Maybe
>
> point name "large name" Module at xx [default xxx]
> or
> point name "large name" Module at xx [init xxx]
> It should be an optional parameter, if its not there the point will default
> to 0.
> One more thing, the point declaration has no data type except for the
> distinction of single-bit and multi-bit points, therefore we have to
> interpret the number from its format.
By the way, the current acceptable syntax for the point config is, (taken from lib/gmm/linuxplc.conf):
# The POINT table
# ---------------
# syntax:
# point name "full name" owner at offset[.bit] [length]
#
# where:
# point = 'point' identifier
# name = Name used to search for point in plc_pt_by_name()
# full name = More extensive description of the point
# This information is not loaded into the confmap of the plc
# owner = Name of the module with write permission on the point
# at = 'at' identifier
# offset = location of word in the globalmap that holds the point's
state
# bit = the bit, in the word, that holds the point's state. This
is
# optional, defaulting to 0.
# length = the size in bits of the point. The point must not overflow
# onto the next offset position (i.e. (bit + length) <
# (8*sizeof (u32)). The length is optional, defaulting to 32
# if bit is not explicitly defined, and 1 otherwise.
#
#
# the POINT_ALIAS table
# ---------------------
# syntax:
# point_alias name "full name" org_name [bit [length]]
#
# where:
# point_alias = 'point_alias' identifier
# name = Name used to search for point in plc_pt_by_name()
# full name = More extensive description of the point
# This information is not loaded into the confmap of the plc
# bit = The first bit, of the original point, that this alias will
# reference. This is optional, defaulting to 0.
# length = the size in bits of the point. The point must not overflow
# outside the original point (i.e. (bit + length) <
# (length of org_name point). The length is optional,
defaulting
# to the length of the org_name point if no bit is
explicitly
# specified, and 1 otherwise.
#
# note:
# (1) offset, bit and length may be written in hexadecimal (0xF45A),
# octal (0172132) or decimal (62554) formats.
#
Using Juan's sugestion, I was thinking we could now have:
# point name "full name" owner at offset[.bit] [length/type] [init xxx]
Where length/type would be either the length in bits, or the variable type (one of: u8, u16, u32, i8, i16, i32, f32). For the moment we would
not accept [{u|i|f}length] because I don't see how we could have f4, u5, etc...
If the variable type is present, it could be used to help interpret the xxx in the [init xxx] part. If not present, we would consider:
default : unsigned (u)
if it has leading +|- : signed (i)
if it has a decimal point: float (f)
The above seems reasonable to me. What do you all think?
Cheers,
Mario.
----------------------------------------------------------------------------
Mario J. R. de Sousa
[email protected]
----------------------------------------------------------------------------
The box said it requires Windows 95 or better, so I installed Linux
_______________________________________________
LinuxPLC mailing list
[email protected]
http://linuxplc.org/mailman/listinfo/linuxplc