hier das ganze auch lauffähig......
PROGRAM askres
%ALPHABETIZE
%NOLOCKGROUP
%NOPAUSE = COMMAND + TPENABLE + ERROR
%NOBUSYLAMP -- BUSY und RUNNING AUS
%COMMENT = 'reset2dout'
CONST
tpireset = 153
VAR
-- Eigene Variablen
status : INTEGER -- Statusvariable von Build In Routinen
real_flag : BOOLEAN -- Identifizierung Integer oder Realwert in Register
int_value : INTEGER -- R?ckgabe des Integerwert in Register
real_value : REAL -- R?ckgabe des Realwertes in Register
--*******************************************************************
-- Hauptprogramm
--*******************************************************************
BEGIN
repeat
GET_REG(77, real_flag, int_value, real_value, status)
-- Wert aus Register [77] lesen (Welcher Ausgang ist an solang TP-Reset gedrückt ist)
DELAY 100 -- immer für eine unterbrechung in so kurzen hardloops sorgen sonst wird das tp-display extrem in die knie gezogen
IF TPIN[153]= TRUE OR TPIN[159]= TRUE THEN -- TPIN153-->RESET TPIN159-->SHIFT+RESET
dout[int_value] = TRUE
ELSE
dout[int_value] = FALSE
ENDIF
until int_value=0 --programm läuft endlos bis Register 77 eine 0 enthält
END askres