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

Named / Type defined Enums #277

Closed
ghaith opened this issue Sep 8, 2021 · 1 comment · Fixed by #404
Closed

Named / Type defined Enums #277

ghaith opened this issue Sep 8, 2021 · 1 comment · Fixed by #404
Assignees
Labels
language feature (norm) a missing language feature according to iec61131-3

Comments

@ghaith
Copy link
Collaborator

ghaith commented Sep 8, 2021

Is your feature request related to a problem? Please describe.
The norm supports different datatype for enums, where an enum field behaves as a named value of that datatype.
Example :

TYPE MyInt : INT ( Red := 1, Yellow := 2, Green := 3); END_TYPE
PROGRAM prg
VAR value : MyINT := RED; END_VAR
value := value + 2; //Green
IF value = MyInt#Green THEN
  value := 10; //Outside the enum range but allowed
END_IF
@riederm riederm added the language feature (norm) a missing language feature according to iec61131-3 label Oct 29, 2021
@riederm riederm self-assigned this Dec 4, 2021
@create-issue-branch
Copy link

Branch issue-277-Named_/_Type_defined_Enums created!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
language feature (norm) a missing language feature according to iec61131-3
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants