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

PLCOpen N1: Avoid physical addresses #15

Open
jubnzv opened this issue Oct 26, 2022 · 0 comments
Open

PLCOpen N1: Avoid physical addresses #15

jubnzv opened this issue Oct 26, 2022 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers new check

Comments

@jubnzv
Copy link
Owner

jubnzv commented Oct 26, 2022

The use of hardcoded physical addresses should be avoided.

So, we have to report any physical address in the code, except those that are used when initializing variables:

PROGRAM l10
  VAR
    a AT %MW10.2.4.1 : INT;
  END_VAR

   %MW10.2.4.1 := 42; (* PLCOPEN-N1 *)
   a := 42; (* ok *)
END_PROGRAM

This could be implemented as a simple pass on AST.

@jubnzv jubnzv added enhancement New feature or request good first issue Good for newcomers new check static analysis and removed static analysis labels Oct 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers new check
Projects
None yet
Development

No branches or pull requests

1 participant