Rung 1 of subroutine 10 Pumping to setpoint needs a [DS1 = 10] instruction in front of and in series with the [DF6 ≥ DF4] instruction, because we should never risk transitioning to step 20 unless we are currently in step 10.
@Aljubovic I am not trying to show you up here or prove what a great coder I am (I already know that - NOT!). The program is close to working.
It could be debated whether there are better ways to organize it, but that is secondary.
We learn far more from our failures than our successes. What is probably most important is that you Beaufort your code to understand the problems I found, and then Beaufort my code fixes (to find the new problems I introduced ).
Soon @OkiePC will present an absolutely gorgeous version of this application; you should also Beaufort that code to ensure you understand how it works.
or on step 30 i.e. the timed test at pressure!But now I see that if we are on step 20 ...
Also what does Beaufort mean? haha
By the way, how fast does the pressure rise, e.g. psi increase per minute, when the air pump is running and the relief valve is closed? I suspect it is faster at the beginning and slower as the pressure gets higher.
Doesn't this thing already exist with a manual knob that the operator turns? How long does it take to get to, say, 200PSI? One minute? Ten? One-hundred?I am not sure exactly how fast the pressure rises because I don't have the transducer here to test it. If you look at step 10 rung 3 you see when the timer is done it starts pumping. If the pressure in the system is less than the HMI fast slow setpoint then a fast pump speed value will be put into the transducer. If the pressure is greater than the setpoint then the pump will slow down. Not sure how fast or slow this will be. But whenever I am ready to buy parts (which will be a couple months) and get them, that's when I can test how fast actually will be.
By the way, how fast does the pressure rise, e.g. psi increase per minute, when the air pump is running and the relief valve is closed? I suspect it is faster at the beginning and slower as the pressure gets higher.
Here is an approach with a different partition into subroutines: input map; sequence logic; test logic. It still has the obsolete pre- and post-test logic.
One thing I wondered about is, if the tolerance is relative to the test pressure setpoint, then it is important that the test pressure when the pump is turned off is very near that setpoint.
Because if the test pressure overshoots the setpoint by a significant amount, then that would allow the measured pressure to drop by more than the tolerance difference from the start of the test and still be considered a passed test.
This is why we have the fast slow setpoints for the pump. With trial and error and testing I can probably make the pump run very slow so the PLC can stop it fairly close to the setpoint pressure