home *** CD-ROM | disk | FTP | other *** search
- program Listing 3_2;
-
- uses Tags, Crt;
-
- var
- LT100,
- FT100 : Analog;
- PSL100 : LoSwitch;
- PSH100 : HiSwitch;
- EY100 : Pump;
- time : integer;
-
- begin
-
- LT100.Init( 'LT100', 512, 50, 250 );
- FT100.Init( 'FT100', 2048, 0, 10000 );
- PSL100.Init( 'PSL100', 60, HtToPSI(LT100.GetValue) );
- PSH100.Init( 'PSH100', 75, HtToPSI(LT100.GetValue) );
- EY100.Init( 'EY100', off, 8000);
- time := 0;
-
- repeat
-
- Inc( time ); { increment the time }
- LT100.PutValue( LT100.GetValue - FlowToDeltaHt(FT100.GetValue) );
-
- PSL100.PutReading( HtToPSI(LT100.GetValue) );
- PSH100.PutReading( HtToPSI(LT100.GetValue) );
-
- if Quiet.IsOff then
- writeln( f, 'Level is ', LT100.GetValue:2:2,
- ' ft at minute ', time );
-
- if PSL100.GetStatus = on then
- EY100.PutStatus( ON );
- if PSH100.GetStatus = on then
- EY100.PutStatus( OFF );
-
- LT100.PutValue( LT100.GetValue + FlowToDeltaHt(EY100.Flow ));
-
- { if the next line of code is not commented out, you'll see only
- reports for even values of time; otherwise, reports for each
- time value will be printed. }
-
- { if (time mod 2 = 0) then Quiet.On else Quiet.Off; }
-
- until KeyPressed;
- Quiet.On;
- end.
-
- {Listing 3-2 }
-
-
-
-
-
-
-
-
-
-
-