Warning 1499: Loop error at download
When downloading the programm I get the loop error. The entire logic seems to works fine. I by-pass the loop error during compilation.
The question i wanted to ask is, what are the potential hazards that I will be facing if i by-pass the error and let it exist in my logic? Any manual i can refer if to remove this loop?
I have attached the loop inspection file that i get at compilation, any help in understanding it would be greatly appreciated.
Code loops mean that the compiler cannot determine the correct execution order for your program. The execution order of the control blocks in your code is now arbitrary and can change if you make changes to your program.
If the execution order of your code does not matter, then you can ignore the code loop. Personally I dont really like this, and prefer to know the execution order of my code is actually correct. Otherwise timing problems can occur. And in a boiler that ca mean unexpected trips.
With large code loops like this it can be very tricky to find out exactly what is causing the loop. One way to solve the problem is to look for the code blocks that have the least amount of reads and writes and start from there. In your case I would GUESS that the loop is caused by reading and writing to a component of AIR_F in the same code block somewhere. Unfortunatly you might have done this several times which is why your loop is so big.
(TBH I would prefer to actually have proper control over the execution order of the code, which is the main reason that I hate code sorting, but thats another discussion entirely)
If possible, they shall be avoided at any cost and as mentioned in the earlier answer it kind of confuses the compiler.
But if it has to used then to get rid of the error we use generally
1. State retain attribute to the variable. By using this, a variable's last scan value can be used(XYZ:old). This removes the loop error
2. Nosort attribute is also used but always prefer not to.
3. There are certain blocks in customized libraries such as REUSE has ''Loop Break' etc. refer to library you are using to understand if it has a customized solution for this.
I hope this helps