Hallo Hugo,
ich habe das mit der Hochfahr - Verriegelung im Blind_night so gelöst evtl. könnt ihr das ja übernehmen ?
VAR_INPUT
UP, DN : BOOL;
S_IN : BYTE;
PI, AI : BYTE;
E_NIGHT : BOOL := TRUE;
E_DAY : BOOL := TRUE;
DTIN : DT;
SUNRISE, SUNSET : TOD;
BLOCK_TIME_UP :TOD;
END_VAR
IF NOT (up AND dn) AND night THEN
(* manual operation at night will cancel operation for one night *)
night := FALSE;
ELSIF (DT_TO_TOD(dtin) > sunset + sunset_offset) AND (last_night < DT_TO_DATE(dtin)) AND NOT night AND e_night THEN
(* enable night *)
night := TRUE;
last_night := DT_TO_DATE(dtin);
ELSIF (DT_TO_TOD(dtin) > BLOCK_TIME_UP) AND (DT_TO_TOD(dtin) > sunrise + sunrise_offset) AND (last_day < DT_TO_DATE(dtin)) AND night AND e_day AND (last_night < DT_TO_DATE(dtin)) THEN
(* disable night *)
night := FALSE;
last_day := DT_TO_DATE(dtin);
END_IF;
(* shade at night only in auto mode and enable = true *)
IF UP AND DN AND night THEN
status := 141;
po := night_position;
ao := night_angle;
ELSE
QU := UP;
QD := DN;
po := pi;
ao := ai;
status := s_in;
END_IF;