Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define a mechanism/attribute to hold the function defintion for a custom arithmetic function ('#'-notation EFB) #66

Open
Erik0x42 opened this issue Aug 29, 2022 · 3 comments
Labels
question->committee Further information is requested

Comments

@Erik0x42
Copy link
Collaborator

Erik0x42 commented Aug 29, 2022

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):

<SystemUnitClass Name="Opt" RefBaseClassPath="ElementaryFunctionLibrary/NorsokElementaryFunctionClass/Arithmetic">
  <Description>Optional formula - Terminal names users choice</Description>
  <!-- new (non-parameter) attribute follows: -->
  <Attribute Name="FunctionDefinition" AttributeDataType="xs:string" Language="StructuredText">
    <Value>Y := X1 - 42 * SQRT( X2 );</Value>
  </Attribute>
  <Attribute Name="Notation" AttributeDataType="xs:string">
    <Description>Character in symbol</Description>
    <DefaultValue />
    <Value>#</Value>
  </Attribute>
  <ExternalInterface Name="X1" RefBaseClassPath="InterfaceClassLibrary/NorsokSignalClass/In/Analogue/X/X1">
  </ExternalInterface>
  <ExternalInterface Name="X2" RefBaseClassPath="InterfaceClassLibrary/NorsokSignalClass/In/Analogue/X/X2">
  </ExternalInterface>
  <ExternalInterface Name="Y" RefBaseClassPath="InterfaceClassLibrary/NorsokSignalClass/Out/Analogue/Y">
  </ExternalInterface>
</SystemUnitClass>
@Erik0x42 Erik0x42 changed the title Define a mechanism/attribute to declare a named type to be used for a custom function ('#'-notation EFB) Define a mechanism/attribute to hold the function defintion for a custom arithmetic function ('#'-notation EFB) Nov 21, 2022
@Erik0x42
Copy link
Collaborator Author

Edited on 2022-11-21:
Changed issue title.
Edited issue text to cover two alternative proposed solutions for custom arithmetic functions.

AlexTxen added a commit that referenced this issue Sep 1, 2023
@cdenisey
Copy link
Collaborator

cdenisey commented Sep 4, 2023

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.

@cdenisey cdenisey added the answered by committee/workshop Clarification from IEC63131 committee received label Sep 4, 2023
@AlexTxen AlexTxen linked a pull request Sep 5, 2023 that will close this issue
@AlexTxen AlexTxen removed a link to a pull request Sep 5, 2023
@AlexTxen
Copy link
Collaborator

AlexTxen commented Sep 5, 2023

'FunctionDefinition' attribute was added to 'Opt' elementary function and black box in 46fbaf6

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

@AlexTxen AlexTxen added question->committee Further information is requested and removed answered by committee/workshop Clarification from IEC63131 committee received labels Sep 5, 2023
cdenisey added a commit that referenced this issue Apr 9, 2024
* Create readme.md for AML

* file to be deleted

temp file only for folder creation. file to be deleted.

* added illustarion 1-69

* temp file deleted

* Added illustrations 70-117

* Updated readme without illustrations

* Delete temp AML readme.md

* illustration test

* illustrations uncritical dump

* ok until 4.6

* README.md updated

* added SFC illustarations to readme

* minor spelling simstake

* MOM from workshop held 21.06.2023

* Optimize NorsokSignalClass collection

Simplification of NorsokSignalClass collection, ref. #3

* Add tag info to reference triangles

Ref. #34

* Change Alarm/Warning representation for MB block

Ref. #49

* Add Missing Parameter attribute types

Ref. #70

* Change Legal Values for SBC attribute

Ref. #63

* Add overall sequence timeout

Ref. #53

* Changed Legal Values for CommunicationType

Ref. #68

* Add missing Direction attributes

Ref. #77

* Add SequenceIn/SequenceOut interfaces

Ref. #69

* Change FallbackValue to SubstituteValue

Ref. #58

* Change Valve device tree structure

* Add FunctionDefinition attributes

Ref. #66

* Add Shutdown alarm parameters to LB

Ref. #64

* Change time intervals data type to xs:duration

Ref. #60

* Correct interface descriptions

* Fixes

Spelling fixes
Library version updated

* Fix 'Split' interfaces classes, update library version to v0.0.12 (#81)

* Add interface class references to 'Split'

* Update CHANGELOG.md

* Update README.md (#86)

* Update README.md

DocumentReference changed to DrawingReference

* Add files via upload

* Update README.md

* Corrected filenames

---------

Co-authored-by: AlexTxen <[email protected]>

---------

Co-authored-by: Coralie <[email protected]>
Co-authored-by: Johan Christian Jenssen <[email protected]>
Co-authored-by: Johan Christian Jenssen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question->committee Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants