J
Campbell, David (Ex AS17):
> There is an area which needs to be clarified. The LPLC uses names
> (strings) to reference memory locations while the IEC standard uses
> direct referencing, eg:
> ===================================================================
> B.1.4.1 Directly represented variables
> PRODUCTION RULES:
> direct_variable ::= '%' location_prefix size_prefix integer {'.' integer}
> location_prefix ::= 'I' | 'Q' | 'M'
> size_prefix ::= NIL | 'X' | 'B' | 'W' | 'D' | 'L'
> ===================================================================
> This may require some modifications of plc_pt_by_name() to handle
> references such as "%MW1.3.2".
plc_pt_by_name() can handle such references now.
My opinion: I would consider the % sign a syntactic element and "MW1.3.2" the point name. This will avoid the need to quote things in linuxplc.conf while providing strict standard compliance.
The function obtaining the handle (or a standalone program) should check the size and mode of the handles obtained and verify that they are compatible with the location and size prefixes, but that's easy enough.
There should probably be an option to accept "%"[[:alnum:]._-]+ as direct variables; again, drop the % sign and pass the rest to plc_pt_by_name(), skipping the type-check. Does the standard provide some way of switching
vendor-specific options? ("pragma relax_points" or something...)
Jiri
--
Jiri Baum <[email protected]>
What we do Every Night! Take Over the World!
_______________________________________________
LinuxPLC mailing list
[email protected]
http://linuxplc.org/mailman/listinfo/linuxplc
> There is an area which needs to be clarified. The LPLC uses names
> (strings) to reference memory locations while the IEC standard uses
> direct referencing, eg:
> ===================================================================
> B.1.4.1 Directly represented variables
> PRODUCTION RULES:
> direct_variable ::= '%' location_prefix size_prefix integer {'.' integer}
> location_prefix ::= 'I' | 'Q' | 'M'
> size_prefix ::= NIL | 'X' | 'B' | 'W' | 'D' | 'L'
> ===================================================================
> This may require some modifications of plc_pt_by_name() to handle
> references such as "%MW1.3.2".
plc_pt_by_name() can handle such references now.
My opinion: I would consider the % sign a syntactic element and "MW1.3.2" the point name. This will avoid the need to quote things in linuxplc.conf while providing strict standard compliance.
The function obtaining the handle (or a standalone program) should check the size and mode of the handles obtained and verify that they are compatible with the location and size prefixes, but that's easy enough.
There should probably be an option to accept "%"[[:alnum:]._-]+ as direct variables; again, drop the % sign and pass the rest to plc_pt_by_name(), skipping the type-check. Does the standard provide some way of switching
vendor-specific options? ("pragma relax_points" or something...)
Jiri
--
Jiri Baum <[email protected]>
What we do Every Night! Take Over the World!
_______________________________________________
LinuxPLC mailing list
[email protected]
http://linuxplc.org/mailman/listinfo/linuxplc