oscat.lib > Bestehende Module / Existing Modules

Pumpensteuerung

(1/3) > >>

swmggs:
Hier mal meine fast fertige Pumpensteuerung, hoffe es klappt mit der angehängten Datei.

mfg swmggs

[gelöscht durch Administrator]

hugo:
hast du hierzu auch schon eine beschreibung / source code?

swmggs:
bin im Moment dabei noch ein paar Temperatureingänge dazu zu programmieren, und so wächst auch die Beschreibung.

Hoffe der Feiertagsstress lässt es zu ;) ;)

swmggs

swmggs:
Hier meine neuster Version. Habe ich was vergessen, um Anregungen bin ich dankbar.

mfg  swmggs

[gelöscht durch Administrator]

hugo:
hier das pump interface aus der oscat lib vielleicht kannst du das mitverwenden

FUNCTION_BLOCK actuator_pump
VAR_INPUT
   in : BOOL;
   manual : BOOL;
   rst : BOOL := FALSE;
END_VAR
VAR_INPUT CONSTANT
   min_ontime : TIME := t#10s;
   min_offtime : TIME := t#10s;
   run_every : TIME := t#10000m;
END_VAR
VAR_OUTPUT
   pump : BOOL;
   runtime : REAL;
   cycles : REAL;
END_VAR
VAR
   tx : TIME;
   last_change : TIME;
   meter : ontime;
   old_man : BOOL;
END_VAR

(*
   version 1.0   4 dec 2006
   programmer    oscat
   tested BY      oscat

actuator_pump is a pump interface which cam be controlled by an input in and an input manual.
in or manual high turns the pump output on.
a rst input is used to reset the runtime counters.
when the pump was not active for a time run_every the actuator turns on the pump automatically for min_ontime.
two setup variables min_ontime and min_offtime guarantee a minimum runtime and offtime of the pump.
the units are hours and the output type is real to prevent fromoverfow.

*)

tx := TIME();
IF rst THEN
   rst := FALSE;
   meter(rst := 1);
   meter.rst := 0;
ELSIF manual AND NOT pump AND NOT old_man THEN
   last_change := tx;
   pump := 1;
ELSIF NOT manual AND old_man AND pump AND NOT in THEN
   last_change := tx;
   pump := 0;
ELSIF in AND NOT pump AND tx - last_change >= min_offtime THEN
   last_change := tx;
   pump := 1;
ELSIF pump AND NOT in AND NOT manual AND tx - last_change >= min_ontime THEN
   last_change := tx;
   pump := 0;
ELSIF NOT pump AND tx - last_change >= run_every THEN
   last_change := tx;
   pump := 1;
END_IF;

meter(in := pump);
runtime := meter.ontime;
cycles := meter.cycles;
old_man := manual;

Navigation

[0] Themen-Index

[#] Nächste Seite

Zur normalen Ansicht wechseln