--- a/lib/counter.txt Mon May 18 13:19:30 2009 +0200
+++ b/lib/counter.txt Tue May 19 16:31:35 2009 +0200
@@ -28,11 +28,8 @@
Q : BOOL;
CV : INT;
END_VAR
- VAR RETAIN
- PVmax : INT;
- END_VAR
IF R THEN CV := 0 ;
- ELSIF CU AND (CV < PVmax)
+ ELSIF CU AND (CV < PV)
THEN CV := CV+1;
END_IF ;
Q := (CV >= PV) ;
@@ -49,11 +46,8 @@
Q : BOOL;
CV : INT;
END_VAR
- VAR RETAIN
- PVmin : INT;
- END_VAR
IF LD THEN CV := PV ;
- ELSIF CD AND (CV > PVmin)
+ ELSIF CD AND (CV > 0)
THEN CV := CV-1;
END_IF ;
Q := (CV <= 0) ;
@@ -73,17 +67,13 @@
QD : BOOL;
CV : INT;
END_VAR
- VAR RETAIN
- PVmax : INT;
- PVmin : INT;
- END_VAR
IF R THEN CV := 0 ;
ELSIF LD THEN CV := PV ;
ELSE
IF NOT (CU AND CD) THEN
- IF CU AND (CV < PVmax)
+ IF CU AND (CV < PV)
THEN CV := CV+1;
- ELSIF CD AND (CV > PVmin)
+ ELSIF CD AND (CV > 0)
THEN CV := CV-1;
END_IF;
END_IF;