# point syntax in the linuxplc.conf file

M

#### Mario de Sousa

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

J

#### Jiri Baum

Mario:
> # syntax:
> # point name "full name" owner at offset[.bit] [length]

Note that this was originally intended to be

point name "full name" owner [at offset[.bit]] [length]

(Mario, didn't you update the library so it could handle that? So that if the at' part was missing it would automatically use the next available
location? I have this vague memory...)

> Using Juan's sugestion, I was thinking we could now have:
>
> # point name "full name" owner at offset[.bit] [length/type] [init xxx]

This would then become

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...

u5 is easy enough, i5 not all that more difficult...

We should be careful, though, not to get carried away too much. (Especially if we want to do a release soon.)

Jiri
--
Jiri Baum <[email protected]>
"In my opinion, the GPL is optimized to build a strong software community at the expense of a strong commercial software business model."
--Craig Mundie, Senior VP, Microsoft; 17 May 2001

_______________________________________________
LinuxPLC mailing list
[email protected]
http://linuxplc.org/mailman/listinfo/linuxplc

M

#### Mario de Sousa

Jiri Baum wrote:
>
> Mario:
> > # syntax:
> > # point name "full name" owner at offset[.bit] [length]
>
> Note that this was originally intended to be
>
> point name "full name" owner [at offset[.bit]] [length]
>
> (Mario, didn't you update the library so it could handle that? So that if
> the at' part was missing it would automatically use the next available
> location? I have this vague memory...)

Unfortunately, not yet... ;-(

That was one of the sugestions I put up on the list some people offered to help. It has not been implemented yet.

> > Using Juan's sugestion, I was thinking we could now have:
> >
> > # point name "full name" owner at offset[.bit] [length/type] [init xxx]
>
> This would then become
>
> 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...
>
> u5 is easy enough, i5 not all that more difficult...
>
> We should be careful, though, not to get carried away too much. (Especially
> if we want to do a release soon.)

Yes, as always you are correct.

But, like you, I don't want to get into this at the moment. This aspect opens a whole new can of worms that I would rather leave closed for some
time to come.

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

J

#### Jiri Baum

Jiri:
> > point name "full name" owner [at offset[.bit]] [length]

> > (Mario, didn't you update the library so it could handle that? So that
> > if the `at' part was missing it would automatically use the next
> > available location? I have this vague memory...)

Mario:
> Unfortunately, not yet... ;-(

> That was one of the sugestions I put up on the list some people offered
> to help. It has not been implemented yet.

Ah, OK, that's where I got it from. No worries.

(on another topic)
> > We should be careful, though, not to get carried away too much.
> > (Especially if we want to do a release soon.)

> Yes, as always you are correct.

> But, like you, I don't want to get into this at the moment. This aspect
> opens a whole new can of worms that I would rather leave closed for some
> time to come.

OK.

Jiri
--
Jiri Baum <[email protected]>
"In my opinion, the GPL is optimized to build a strong software community at the expense of a strong commercial software business model."
--Craig Mundie, Senior VP, Microsoft; 17 May 2001

_______________________________________________
LinuxPLC mailing list
[email protected]
http://linuxplc.org/mailman/listinfo/linuxplc