Open Erik0x42 opened 2 years ago
Edited on 2022-11-21: Changed issue title. Edited issue text to cover two alternative proposed solutions for custom arithmetic functions.
Discussions have been taken in the workshop held on 21.06.2023, refer to item 5. https://github.com/equinor/iec63131/blob/2c8fa87426e072459c5afc61afd97b1ce53cd28c/MOM%20AML%20Library%200.0.11%20workshop.docx
It has been agreed to add the possibility to write the Formula as an attribute.
'FunctionDefinition' attribute was added to 'Opt' elementary function and black box in 46fbaf6bf0b8aee3f369da10a985fd151185ac22
Item/issue remains open. Language (e.g. IEC61131 Structured Text) / allowed operators restrictions are to be assessed by IEC63131 committee acc. to workshop held on 21.06.2023, refer to item 5. https://github.com/equinor/iec63131/blob/2c8fa87426e072459c5afc61afd97b1ce53cd28c/MOM%20AML%20Library%200.0.11%20workshop.docx
Proposal summary, three alternative solutions: a) Facilitate direct entry of arithmetic function in a new attribute in AML, with language/syntax conformity requirements b) By new attribute/field; Facilitate reference to externally defined type, by type name and/or ID, with only interface (terminals) defined in AML c) Combine/merge a) and b) into a single new attribute, and allow both use cases concurrently
The AML library name for the custom/arithmetic function is "ElementaryFunctionLibrary/NorsokElementaryFunctionClass/Arithmetic/Opt", with Description "Optional formula - Terminal names users choice". This corresponds with the '#' entry in IEC PAS 63131:2017 Table B.2 - EFB function notations.
One solution (a) to allow instances of this type to be machine readable, and conducive to auto-generation of PLC logic, is to declare the arithmetic formula - precisely and faithfully (according to a syntax/language that is also part of the declaration) - in a field/attribute in the custom arithmetic function instance.
Another solution (b), is to reference - in the instance - a named type to be used in the logic implementation for a custom function. The named type may - subject to project agreements - be taken from any supplementary AML library (vendor specific, or project specific).
All three alternatives could be covered with one single new attribute - leaving the choice between alternatives up to standard (normative or informative) and/or project guideline. The proposal is to add an attribute to the custom function AML type, named "FunctionDefinition" (the following example is compatible with alternatives a and c):