ER- ppe
Detaljer
- Typ
- Drivrutin
- Upplaggd av
- Ove Jansson, Abelko Innovation
- Version
- 1
- Uppdaterad
- 2013-08-27
- Skapad
- 2013-08-27
- Kategori
- Energioptimering, Övrig utrustning
- Visningar
- 3284
Beskrivning
Drivrutin
Bruksanvisning
Hur man installerar typdefinitionerna och driftsätter modulerna finns beskrivet i användarmanualen, kapitel 18.7.
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
% ER-ppe1
DEVICETYPE ERppe1 NAMED "ER-ppe1" TYPEID 12345 IS
PARAMETER
Id : "Adress 1-4";
GIVARTYP : "Givare"; % 0=PT1000, 1=TAC-EGU
UTEGIVARE : "Utegivare" [""]; % 0=prognos,1=utegivare
TEMP : "Temperatur" ["°C"]DEC1;
%setbit: "setbit";
PUBLIC
status : "Status" [""]; %
%res: "Resistans" ["Ohm"]DEC2;
%settemp: "Set temp" ["°C"]DEC1;
%utmask: "Utmask";
PRIVATE
value; % resistans (Ohm)
test; % att testa mot
ohmStart;
ohmEnd;
bit;
BAUDRATE 19200;
CHECKSUM SUM8;
TELEGRAM send NAMED "send" IS
QUESTION
DATA[0] := HEX(01);
DATA[1] := HEX(FE);
DATA[2] := HEX(06);
DATA[3] := HEX(00);
DATA[4] := HEX(4D); % M
DATA[5] := HEX(00);
DATA[6] := BYTE(Id);
DATA[7] <- WORD(
IF GIVARTYP=0 THEN % PT1000
ohmStart:= 816.00;
ohmEnd:=1145.78;
%value:=(1000+((3.90802*TEMP) - (5.80195E-4*(TEMP*TEMP))));
value:=((1000*(1+(0.0039078076*TEMP )+(-0.0000005784084*(TEMP*TEMP)))));
ELSE % TAC-EGU
ohmStart:= 31877.80;
ohmEnd:=1800.00;
value:=( 1800*(EXP((3400/(TEMP+273.0))-(3400/(25+273.0)))));
ENDIF;
value :=value - 0.35; % Adjust value because of relay resistans
IF ohmEnd > ohmStart THEN bit:= (511*((value - ohmStart)/(ohmEnd - ohmStart)));
ELSE bit:= (511*((value-ohmEnd)/(ohmStart-ohmEnd)));
ENDIF;
IF bit < 0 THEN bit:=0; ENDIF;
IF bit > 511 THEN bit:=511; ENDIF;
bit:=FLOOR(bit);
IF UTEGIVARE>0 THEN bit:=(bit+512); ENDIF;
%res:=value;
%settemp:=TEMP;
%utmask:=bit;
DATA := bit;
%DATA:=setbit;
);
ANSWER SIZE 10
DATA[0] = HEX(01);
DATA[1] = HEX(FE);
DATA[2] = HEX(06);
DATA[3] = HEX(00);
DATA[4] = HEX(6D); % m
DATA[5] = BYTE(Id);
DATA[6] = HEX(00);
DATA[7] -> RWORD(
status := DATA;
);
TIMEOUT 500
END;
END;
DEVICETYPE ERppe1 NAMED "ER-ppe1" TYPEID 12345 IS
PARAMETER
Id : "Adress 1-4";
GIVARTYP : "Givare"; % 0=PT1000, 1=TAC-EGU
UTEGIVARE : "Utegivare" [""]; % 0=prognos,1=utegivare
TEMP : "Temperatur" ["°C"]DEC1;
%setbit: "setbit";
PUBLIC
status : "Status" [""]; %
%res: "Resistans" ["Ohm"]DEC2;
%settemp: "Set temp" ["°C"]DEC1;
%utmask: "Utmask";
PRIVATE
value; % resistans (Ohm)
test; % att testa mot
ohmStart;
ohmEnd;
bit;
BAUDRATE 19200;
CHECKSUM SUM8;
TELEGRAM send NAMED "send" IS
QUESTION
DATA[0] := HEX(01);
DATA[1] := HEX(FE);
DATA[2] := HEX(06);
DATA[3] := HEX(00);
DATA[4] := HEX(4D); % M
DATA[5] := HEX(00);
DATA[6] := BYTE(Id);
DATA[7] <- WORD(
IF GIVARTYP=0 THEN % PT1000
ohmStart:= 816.00;
ohmEnd:=1145.78;
%value:=(1000+((3.90802*TEMP) - (5.80195E-4*(TEMP*TEMP))));
value:=((1000*(1+(0.0039078076*TEMP )+(-0.0000005784084*(TEMP*TEMP)))));
ELSE % TAC-EGU
ohmStart:= 31877.80;
ohmEnd:=1800.00;
value:=( 1800*(EXP((3400/(TEMP+273.0))-(3400/(25+273.0)))));
ENDIF;
value :=value - 0.35; % Adjust value because of relay resistans
IF ohmEnd > ohmStart THEN bit:= (511*((value - ohmStart)/(ohmEnd - ohmStart)));
ELSE bit:= (511*((value-ohmEnd)/(ohmStart-ohmEnd)));
ENDIF;
IF bit < 0 THEN bit:=0; ENDIF;
IF bit > 511 THEN bit:=511; ENDIF;
bit:=FLOOR(bit);
IF UTEGIVARE>0 THEN bit:=(bit+512); ENDIF;
%res:=value;
%settemp:=TEMP;
%utmask:=bit;
DATA := bit;
%DATA:=setbit;
);
ANSWER SIZE 10
DATA[0] = HEX(01);
DATA[1] = HEX(FE);
DATA[2] = HEX(06);
DATA[3] = HEX(00);
DATA[4] = HEX(6D); % m
DATA[5] = BYTE(Id);
DATA[6] = HEX(00);
DATA[7] -> RWORD(
status := DATA;
);
TIMEOUT 500
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.