-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path3pkt.fs
31 lines (23 loc) · 990 Bytes
/
3pkt.fs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
\ druck messen
include ad.fs
\ Ausgänge steuern
include rel.fs
\ schaltpunkte festlegen
3000 variable limit-v-on
2500 variable limit-v-off
1000 variable limit-p-on
1500 variable limit-p-off
100 variable pv-loop-delay
\ ===================
: pumpe? ( druck --) limit-p-on @ < IF pumpen THEN ; \ limit-p-off @ > IF pv-stop THEN ;
: ventil? ( druck --) limit-v-on @ > IF ablassen THEN ; \ limit-v-off @ < IF pv-stop THEN ;
\ : pvOK? ( druck --) dup limit-p-off @ > swap limit-v-off @ < and IF pv-stop THEN ;
: isbetween ( low high test -- flag) tuck > -rot < and ;
: pvOK? limit-p-off @ limit-v-off @ rot isbetween IF pv-stop THEN ;
: pv-check druck@ dup dup pumpe? ventil? pvOK? ;
: pv-loop BEGIN pv-check key? pv-loop-delay @ ms UNTIL ;
: pv-test BEGIN druck@ dup . dup dup pumpe? ventil? pvOK? key? 1000 ms UNTIL ;
\ timed calling
: pv-status. ." PV Status: " pv-status . cr ;
\ ' pv-status. 2000 1 call-every
' pv-check pv-loop-delay @ 0 call-every ok.