I want really simple task to be programmed in APEX, but in APEX logic it looks not so simple as it sounds (at least for me).
So, I have tank with water and two sensors in it (SW 13_3 for upper level and SW 13_4 for bottom level) and I have let's say pump (to fill tank) on OUTLET 2_5.
And what I want just to fill tank by pump only when it completely empty.
So we have 3 states:
1 - when all sensors under water (both CLOSED state) -- FULL: OUTLET 2_5 OFF
2 - when upper sensor clear (OPEN) but bottom sensor still CLOSE -- DECREASES: OUTLET 2_5 OFF
3 - when both sensors OPEN -- EMPTY: OUTLET 2_5 ON
IMG_0580.JPG
The problems is that we have state 4 which by sensors looks like state 2. I mean, when happens state 3, pump is turning on and filling bottom sensor and occurs "state 2/4" and it stops filling but in this situation we want fillup up to SW 13_3. How can I solve the problem? In my point of view the difference between "state 2" and "state 4" in previous values of SW 13_4, but as far as I know it's not possible to check previous value of sensor...
Bookmarks