Danelko/Themokon SR04 via STC65
Detaljer
- Typ
- Drivrutin
- Upplaggd av
- Ove Jansson, Abelko Innovation
- Version
- 1
- Uppdaterad
- 2018-10-03
- Skapad
- 2018-10-03
- Kategori
- IO enheter, Modbus, Övriga protokoll
- Visningar
- 2550
Beskrivning
Läser alla 32 enheter och visar de med A5-02-05 profil.
Läser en enhet i sekunden och uppdaterar antal enheter och antal enheter med för gamla värden efter varje genomläsning.
Bruksanvisning
För att detta ska fungera lär först in SR04 i STC65
Juridisk information
Alla skript tillhandahålls i befintligt skick och all användning sker på eget ansvar. Felaktig använding kan leda till skadad eller förstörd utrustning.
Skript kod
% Skapad med Modbus Creator
% - OBS! Användaren ansvarar själv för att samma TYPID inte används flera gånger i samma apparat.
% TYPID 10000-19999 är för användardefinierade enheter
DEVICETYPE SR04x32s NAMED "SR04x32s" TYPEID 12749 IS
PARAMETER
Id : "Adress" [""]INT;
maxSek : "Max ålder (1001)" ["sek"]INT;
PUBLIC
NUM_SR04 : "Antal SR04" INT;
OLD_SR04 : "Antal gamla SR04" INT;
T1 : "Temperatur 1" ["°C"]DEC2;
T2 : "Temperatur 2" ["°C"]DEC2;
T3 : "Temperatur 3" ["°C"]DEC2;
T4 : "Temperatur 4" ["°C"]DEC2;
T5 : "Temperatur 5" ["°C"]DEC2;
T6 : "Temperatur 6" ["°C"]DEC2;
T7 : "Temperatur 7" ["°C"]DEC2;
T8 : "Temperatur 8" ["°C"]DEC2;
T9 : "Temperatur 9" ["°C"]DEC2;
T10 : "Temperatur 10" ["°C"]DEC2;
T11 : "Temperatur 11" ["°C"]DEC2;
T12 : "Temperatur 12" ["°C"]DEC2;
T13 : "Temperatur 13" ["°C"]DEC2;
T14 : "Temperatur 14" ["°C"]DEC2;
T15 : "Temperatur 15" ["°C"]DEC2;
T16 : "Temperatur 16" ["°C"]DEC2;
T17 : "Temperatur 17" ["°C"]DEC2;
T18 : "Temperatur 18" ["°C"]DEC2;
T19 : "Temperatur 19" ["°C"]DEC2;
T20 : "Temperatur 20" ["°C"]DEC2;
T21 : "Temperatur 21" ["°C"]DEC2;
T22 : "Temperatur 22" ["°C"]DEC2;
T23 : "Temperatur 23" ["°C"]DEC2;
T24 : "Temperatur 24" ["°C"]DEC2;
T25 : "Temperatur 25" ["°C"]DEC2;
T26 : "Temperatur 26" ["°C"]DEC2;
T27 : "Temperatur 27" ["°C"]DEC2;
T28 : "Temperatur 28" ["°C"]DEC2;
T29 : "Temperatur 29" ["°C"]DEC2;
T30 : "Temperatur 30" ["°C"]DEC2;
T31 : "Temperatur 31" ["°C"]DEC2;
T32 : "Temperatur 32" ["°C"]DEC2;
PRIVATE
Tmp;
Unit;
ORG;
FUNC;
TYPE;
RTIME;
MAXAGE;
Counter;
numSR04;
oldSR04;
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM ReadT NAMED "Read" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(03);
DATA[2] <- RWORD(
IF Unit>31 THEN
Unit:=0;
oldSR04:=0;
numSR04:=0;
ENDIF;
DATA:=200+(Unit*20);
); % Start address
DATA[4] := RWORD(11); % Antal register att läsa
ANSWER SIZE 27 % (Antal register * 2) + 5
DATA[0] = BYTE(Id);
DATA[1] = HEX(03);
DATA[2] = BYTE(22); % Antal Bytes
DATA[4] ->BYTE(FUNC:=DATA;); %0
DATA[6] ->BYTE(TYPE:=DATA;); %1
DATA[15] ->RWORD(RTIME:=DATA;); %6
DATA[18] ->BYTE(ORG:=DATA;); %7
DATA[23] -> RWORD(
Tmp:=0;
IF maxSek<1 THEN MAXAGE:=1001; ELSE MAXAGE:=maxSek; ENDIF;
IF Unit=0 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T1:=Tmp;
ELSIF Unit=1 THEN
IF FUNC=2 AND TYPE=5 AND ORG=165 THEN
numSR04:=numSR04+1;
IF RTIME<MAXAGE THEN
Tmp:=(255-DATA)/255*40;
ELSE
oldSR04:=oldSR04+1;
Tmp:=-275;
ENDIF;
ELSE
Tmp:=-300;
ENDIF;
T2:=Tmp;
ELSIF Unit=2 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T3:=Tmp;
ELSIF Unit=3 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T4:=Tmp;
ELSIF Unit=4 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T5:=Tmp;
ELSIF Unit=5 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T6:=Tmp;
ELSIF Unit=6 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T7:=Tmp;
ELSIF Unit=7 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T8:=Tmp;
ELSIF Unit=8 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T9:=Tmp;
ELSIF Unit=9 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T10:=Tmp;
ELSIF Unit=10 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T11:=Tmp;
ELSIF Unit=11 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T12:=Tmp;
ELSIF Unit=12 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T13:=Tmp;
ELSIF Unit=13 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T14:=Tmp;
ELSIF Unit=14 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T15:=Tmp;
ELSIF Unit=15 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T16:=Tmp;
ELSIF Unit=16 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T17:=Tmp;
ELSIF Unit=17 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T18:=Tmp;
ELSIF Unit=18 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T19:=Tmp;
ELSIF Unit=19 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T20:=Tmp;
ELSIF Unit=20 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T21:=Tmp;
ELSIF Unit=21 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T22:=Tmp;
ELSIF Unit=22 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T23:=Tmp;
ELSIF Unit=23 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T24:=Tmp;
ELSIF Unit=24 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T25:=Tmp;
ELSIF Unit=25 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T26:=Tmp;
ELSIF Unit=26 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T27:=Tmp;
ELSIF Unit=27 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T28:=Tmp;
ELSIF Unit=28 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T29:=Tmp;
ELSIF Unit=29 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T30:=Tmp;
ELSIF Unit=30 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T31:=Tmp;
ELSIF Unit=31 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T32:=Tmp;
NUM_SR04:=numSR04; OLD_SR04:=oldSR04;
ENDIF;
Unit:=Unit+1;
);
TIMEOUT 300
END;
END;
% - OBS! Användaren ansvarar själv för att samma TYPID inte används flera gånger i samma apparat.
% TYPID 10000-19999 är för användardefinierade enheter
DEVICETYPE SR04x32s NAMED "SR04x32s" TYPEID 12749 IS
PARAMETER
Id : "Adress" [""]INT;
maxSek : "Max ålder (1001)" ["sek"]INT;
PUBLIC
NUM_SR04 : "Antal SR04" INT;
OLD_SR04 : "Antal gamla SR04" INT;
T1 : "Temperatur 1" ["°C"]DEC2;
T2 : "Temperatur 2" ["°C"]DEC2;
T3 : "Temperatur 3" ["°C"]DEC2;
T4 : "Temperatur 4" ["°C"]DEC2;
T5 : "Temperatur 5" ["°C"]DEC2;
T6 : "Temperatur 6" ["°C"]DEC2;
T7 : "Temperatur 7" ["°C"]DEC2;
T8 : "Temperatur 8" ["°C"]DEC2;
T9 : "Temperatur 9" ["°C"]DEC2;
T10 : "Temperatur 10" ["°C"]DEC2;
T11 : "Temperatur 11" ["°C"]DEC2;
T12 : "Temperatur 12" ["°C"]DEC2;
T13 : "Temperatur 13" ["°C"]DEC2;
T14 : "Temperatur 14" ["°C"]DEC2;
T15 : "Temperatur 15" ["°C"]DEC2;
T16 : "Temperatur 16" ["°C"]DEC2;
T17 : "Temperatur 17" ["°C"]DEC2;
T18 : "Temperatur 18" ["°C"]DEC2;
T19 : "Temperatur 19" ["°C"]DEC2;
T20 : "Temperatur 20" ["°C"]DEC2;
T21 : "Temperatur 21" ["°C"]DEC2;
T22 : "Temperatur 22" ["°C"]DEC2;
T23 : "Temperatur 23" ["°C"]DEC2;
T24 : "Temperatur 24" ["°C"]DEC2;
T25 : "Temperatur 25" ["°C"]DEC2;
T26 : "Temperatur 26" ["°C"]DEC2;
T27 : "Temperatur 27" ["°C"]DEC2;
T28 : "Temperatur 28" ["°C"]DEC2;
T29 : "Temperatur 29" ["°C"]DEC2;
T30 : "Temperatur 30" ["°C"]DEC2;
T31 : "Temperatur 31" ["°C"]DEC2;
T32 : "Temperatur 32" ["°C"]DEC2;
PRIVATE
Tmp;
Unit;
ORG;
FUNC;
TYPE;
RTIME;
MAXAGE;
Counter;
numSR04;
oldSR04;
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM ReadT NAMED "Read" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(03);
DATA[2] <- RWORD(
IF Unit>31 THEN
Unit:=0;
oldSR04:=0;
numSR04:=0;
ENDIF;
DATA:=200+(Unit*20);
); % Start address
DATA[4] := RWORD(11); % Antal register att läsa
ANSWER SIZE 27 % (Antal register * 2) + 5
DATA[0] = BYTE(Id);
DATA[1] = HEX(03);
DATA[2] = BYTE(22); % Antal Bytes
DATA[4] ->BYTE(FUNC:=DATA;); %0
DATA[6] ->BYTE(TYPE:=DATA;); %1
DATA[15] ->RWORD(RTIME:=DATA;); %6
DATA[18] ->BYTE(ORG:=DATA;); %7
DATA[23] -> RWORD(
Tmp:=0;
IF maxSek<1 THEN MAXAGE:=1001; ELSE MAXAGE:=maxSek; ENDIF;
IF Unit=0 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T1:=Tmp;
ELSIF Unit=1 THEN
IF FUNC=2 AND TYPE=5 AND ORG=165 THEN
numSR04:=numSR04+1;
IF RTIME<MAXAGE THEN
Tmp:=(255-DATA)/255*40;
ELSE
oldSR04:=oldSR04+1;
Tmp:=-275;
ENDIF;
ELSE
Tmp:=-300;
ENDIF;
T2:=Tmp;
ELSIF Unit=2 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T3:=Tmp;
ELSIF Unit=3 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T4:=Tmp;
ELSIF Unit=4 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T5:=Tmp;
ELSIF Unit=5 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T6:=Tmp;
ELSIF Unit=6 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T7:=Tmp;
ELSIF Unit=7 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T8:=Tmp;
ELSIF Unit=8 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T9:=Tmp;
ELSIF Unit=9 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T10:=Tmp;
ELSIF Unit=10 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T11:=Tmp;
ELSIF Unit=11 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T12:=Tmp;
ELSIF Unit=12 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T13:=Tmp;
ELSIF Unit=13 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T14:=Tmp;
ELSIF Unit=14 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T15:=Tmp;
ELSIF Unit=15 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T16:=Tmp;
ELSIF Unit=16 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T17:=Tmp;
ELSIF Unit=17 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T18:=Tmp;
ELSIF Unit=18 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T19:=Tmp;
ELSIF Unit=19 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T20:=Tmp;
ELSIF Unit=20 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T21:=Tmp;
ELSIF Unit=21 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T22:=Tmp;
ELSIF Unit=22 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T23:=Tmp;
ELSIF Unit=23 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T24:=Tmp;
ELSIF Unit=24 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T25:=Tmp;
ELSIF Unit=25 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T26:=Tmp;
ELSIF Unit=26 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T27:=Tmp;
ELSIF Unit=27 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T28:=Tmp;
ELSIF Unit=28 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T29:=Tmp;
ELSIF Unit=29 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T30:=Tmp;
ELSIF Unit=30 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T31:=Tmp;
ELSIF Unit=31 THEN IF FUNC=2 AND TYPE=5 AND ORG=165 THEN numSR04:=numSR04+1; IF RTIME<MAXAGE THEN Tmp:=(255-DATA)/255*40; ELSE oldSR04:=oldSR04+1; Tmp:=-275; ENDIF; ELSE Tmp:=-300; ENDIF; T32:=Tmp;
NUM_SR04:=numSR04; OLD_SR04:=oldSR04;
ENDIF;
Unit:=Unit+1;
);
TIMEOUT 300
END;
END;
Användarnas noteringar
Du måste vara inloggad för att göra en notering. Bli medlem eller logga in. Vi använder en moderator som godkänner noteringarna innan de visas.