You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It shall be an error if a WHILE or REPEAT statement is used in an algorithm for which satisfaction
of the loop termination condition or execution of an EXIT statement cannot be guaranteed.
I am a bit unclear about what is the scope of this validation - should a check to a variable-state from another POU be an error? Or a conditional that is not modified in the body? E.g.:
...
VAR
a : DINT;
b : BOOL;
other_prog: somePOU;
END_VAR
WHILE b DO
WHILE other_prog.flag DO
a := a + 1;
END_WHILE
END_WHILE
...
Neither of the termination conditions are directly modified in the loop bodies, therefore the loop termination cannot be guaranteed?
Or does this refer to external variables like hardware-access/values being read from the network?
Is this strictly a part of static-analysis? Afaik the standard doesn't specify anything about static analysis being a requirement to fulfil the standard, but this validation fits more into that category than regular compile-time checks to me.
I'd like to hear some opinions on how you guys interpret this part of the standard, plus if and how we should implement this.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
In section 7.3.3.4.1 in the standard it says
I am a bit unclear about what is the scope of this validation - should a check to a variable-state from another POU be an error? Or a conditional that is not modified in the body? E.g.:
Neither of the termination conditions are directly modified in the loop bodies, therefore the loop termination cannot be guaranteed?
Or does this refer to external variables like hardware-access/values being read from the network?
Is this strictly a part of static-analysis? Afaik the standard doesn't specify anything about static analysis being a requirement to fulfil the standard, but this validation fits more into that category than regular compile-time checks to me.
I'd like to hear some opinions on how you guys interpret this part of the standard, plus if and how we should implement this.
Beta Was this translation helpful? Give feedback.
All reactions