DANFOSS VLT 6000 HVAC
Detaljer
- Typ
- Drivrutin
- Upplaggd av
- Ove Jansson, Abelko Innovation
- Version
- 4
- Uppdaterad
- 2015-06-26
- Skapad
- 2013-08-27
- Kategori
- Frekvensomformare, Övrig utrustning, Övriga protokoll
- Visningar
- 3656
Beskrivning
Device driver för DANFOSS serie FC102 frekvensomformare med Danfoss eget protokoll
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
# MW, Abelko
# OBS Danfoss eget protokoll
DEVICETYPE Danfoss_VLT6000HVAC NAMED "VLT 6000 HVAC" TYPEID 22001 IS
PARAMETER
Addr: "Adress" INT;
Mpow: "Motoreffekt" ["kW"];
Mcurr: "Motorström" ["A"];
MNomRpm: "Nom varvtal" ["rpm"];
Fmin: "Min utfrekvens" ["Hz"];
Tru: "Uppramptid" ["s"];
Trd: "Nedramptid" ["s"];
Nostop: "Får ej stanna" ["0=falskt"];
PUBLIC
Running: "Drift";
StatW: "Status";
Err: "Felkod" INT;
Warning: "Varning" INT;
Freq: "Frekvens" ["Hz"] DEC1;
Power: "Effekt" ["kW"] DEC2;
Volt: "Motorspänning" ["V"] DEC1;
Curr: "Motorström" ["A"] DEC2;
Temp: "Temp VLT" ["ºC"] INT;
TLoad: "TempLast" ["%"] INT;
PRIVATE
State;
RefFreq;
AK;
PNU;
IND;
PWEhigh;
PWElow;
Reset;
Styrord;
Tripp;
LastFmin;
hErr;
hWarning;
TripTimer;
BAUDRATE 9600;
PARITY EVEN;
CHECKSUM XOR8;
TELEGRAM Update NAMED "Uppdatera" IS
QUESTION
DATA[0] := HEX(02); %STX
DATA[1] := HEX(0E); %LEN
DATA[2] <- BYTE(DATA := Addr;); %ADR
DATA[3] <- RWORD( %PKE
IF State = 0 THEN State := 100; ENDIF; %Skriv inställningar vid uppstart
IF (RefFreq > 0) AND (State > 93) THEN State := 93; ENDIF; %Det går ändå inte att skriva till dom vid drift
IND := 0; %Den ska nästan alltid vara 0
PWEhigh := 0;
PWElow := 0;
IF State = 100 THEN %100 Konfiguration 0 Utan återkoppling
AK := HEX(E000);
PNU := 100;
PWElow := 1;
ELSIF State = 99 THEN %101 Momentkurva 0 Automatisk
AK := HEX(E000);
PNU := 101;
PWElow := 0;
ELSIF State = 98 THEN %102 Motoreffekt
AK := HEX(E000);
PNU := 102;
PWElow := Mpow * 100;
ELSIF State = 97 THEN %103 Motorspänning 400 V
AK := HEX(E000);
PNU := 103;
PWElow := 400;
ELSIF State = 96 THEN %104 Motorfrekvens 50 Hz
AK := HEX(E000);
PNU := 104;
PWElow := 50;
ELSIF State = 95 THEN %105 Motorström
AK := HEX(E000);
PNU := 105;
PWElow := Mcurr * 100;
ELSIF State = 94 THEN %106 Nominellt varvtal
AK := HEX(E000);
PNU := 106;
PWElow := MNomRpm;
ELSIF State = 93 THEN %201 Min utfrekvens
AK := HEX(E000);
PNU := 201;
PWElow := Fmin * 10;
LastFmin := Fmin;
ELSIF State = 92 THEN %206 Uppramptid ? s
AK := HEX(E000);
PNU := 206;
PWElow := Tru;
ELSIF State = 91 THEN %Nedramptid ? s
AK := HEX(E000);
PNU := 207;
PWElow := Trd;
ELSIF State = 90 THEN %208 Automatisk nedrampning 1 Aktiv
AK := HEX(E000);
PNU := 208;
PWElow := 1;
ELSIF State = 89 THEN %402 Flygande start 1 Aktiv
AK := HEX(E000);
PNU := 402;
PWElow := 1;
ELSIF State = 88 THEN %411 Funktion vid överhettning 0 eller 1 (1 för rökgasfläkten)
AK := HEX(E000);
PNU := 411;
IF Nostop > 0 THEN
PWElow := 1;
ELSE
PWElow := 1;
ENDIF;
ELSIF State = 87 THEN %503 Utrullningsstopp 1 Seriekomm
AK := HEX(E000);
PNU := 503;
PWElow := 1;
ELSIF State = 86 THEN %504 DC-broms 1 Seriekomm
AK := HEX(E000);
PNU := 504;
PWElow := 1;
ELSIF State = 85 THEN %508 Referensvarvtal 1 Seriekomm
AK := HEX(E000);
PNU := 508;
PWElow := 1;
ELSIF State = 84 THEN %555 Bus timeout ? s
AK := HEX(E000);
PNU := 555;
PWElow := 5;
ELSIF State = 83 THEN %556 Timeoutfunktion ? 1 frys eller 2 stop
AK := HEX(E000);
PNU := 556;
IF Nostop > 0 THEN
PWElow := 1;
ELSE
PWElow := 2;
ENDIF;
ELSIF State = 82 THEN %555 Bus timeout ? s
AK := HEX(E000);
PNU := 308;
PWElow := 0;
ENDIF;
IF (State < 82) AND (State > 9) THEN State := 9; ENDIF;
IF State = 1 THEN %Frekvens
AK := HEX(1000);
PNU := 512;
ELSIF State = 2 THEN %Ström
AK := HEX(1000);
PNU := 514;
ELSIF State = 3 THEN %Effekt
AK := HEX(1000);
PNU := 515;
ELSIF State = 4 THEN %Spänning
AK := HEX(1000);
PNU := 517;
ELSIF State = 5 THEN %Larm
AK := HEX(1000);
PNU := 529;
ELSIF State = 6 THEN %TLoad
AK := HEX(1000);
PNU := 520;
ELSIF State = 7 THEN %Temp
AK := HEX(1000);
PNU := 528;
ELSIF State = 8 THEN %Varning
AK := HEX(1000);
PNU := 531;
ELSIF State = 9 THEN %Larm
AK := HEX(1000);
PNU := 529;
ENDIF;
DATA := AK | PNU;
);
DATA[5] <- RWORD(DATA := IND;);
DATA[7] <- RWORD(DATA := PWEhigh;);
DATA[9] <- RWORD(DATA := PWElow;);
DATA[11] <- RWORD( %Styrord
IF RefFreq > 2 * Fmin THEN %RefFreq is %, Fmin is Hz -> On when RefFreq > 0
Styrord := HEX(7C);
ELSIF Nostop > 0 THEN
Styrord := HEX(7C);
ELSE
Styrord := HEX(34); %off
ENDIF;
IF Reset > 0 THEN
Styrord := Styrord + HEX(80);
ENDIF;
DATA := HEX(400) + Styrord;
);
DATA[13] <- RWORD(DATA := RefFreq * 163.84;);
ANSWER SIZE 16
DATA[0] = HEX(02);
DATA[1] = HEX(0E);
DATA[2] = BYTE(Addr);
DATA[7] -> RWORD(
IF State = 5 THEN %Larm
hErr := DATA;
ELSIF State = 8 THEN %Varning
hWarning := DATA;
ELSIF State = 9 THEN %Larm
hErr := DATA;
ENDIF;
);
DATA[9] -> RWORD(
IF State = 1 THEN %Frekvens
Freq := DATA / 10;
ELSIF State = 2 THEN %Ström
Curr := DATA / 100;
ELSIF State = 3 THEN %Effekt
Power := DATA / 100;
ELSIF State = 4 THEN %Spänning
Volt := DATA / 10;
ELSIF State = 5 THEN %Larm
Err := DATA;
ELSIF State = 6 THEN %TLoad
TLoad := DATA;
ELSIF State = 7 THEN %Temp
Temp := DATA;
ELSIF State = 8 THEN %Varning
Warning := DATA;
ELSIF State = 9 THEN %Larm
Err := DATA;
ENDIF;
IF State = 8 AND Warning > 0 THEN
IF Warning & HEX(40) > 1 THEN Warning := 12;
ELSIF Warning & HEX(20) > 1 THEN Warning := 13;
ELSIF Warning & HEX(8000) > 1 THEN Warning := 2;
ELSIF Warning & HEX(4000) > 1 THEN Warning := 4;
ELSIF Warning & HEX(2000) > 1 THEN Warning := 5;
ELSIF Warning & HEX(0200) > 1 THEN Warning := 9;
ELSIF Warning & HEX(0400) > 1 THEN Warning := 8;
ELSIF Warning & HEX(1800) > 1 THEN Warning := 7;
ELSIF Warning & HEX(0080) > 1 THEN Warning := 11;
ELSIF Warning & HEX(0100) > 1 THEN Warning := 10;
ELSE Warning := 99;
ENDIF;
ELSIF State = 8 AND hWarning > 0 THEN
IF hWarning & HEX(0001) > 1 THEN Warning := 1;
ELSIF hWarning & HEX(0010) > 1 THEN Warning := 64;
ELSIF hWarning & HEX(0080) > 1 THEN Warning := 63;
ELSE Warning := 99;
ENDIF;
ELSIF State = 8 THEN
Warning := 0;
ENDIF;
IF ((State = 5) OR (State = 9))AND Err > 0 THEN
IF Err & HEX(40) > 1 THEN Err := 12;
ELSIF Err & HEX(20) > 1 THEN Err := 16;
ELSIF Err & HEX(40) > 1 THEN Err := 15;
ELSIF Err & HEX(80) > 1 THEN Err := 14;
ELSIF Err & HEX(100) > 1 THEN Err := 13;
ELSIF Err & HEX(0200) > 1 THEN Err := 12;
ELSIF Err & HEX(0400) > 1 THEN Err := 11;
ELSIF Err & HEX(0800) > 1 THEN Err := 10;
ELSIF Err & HEX(1000) > 1 THEN Err := 9;
ELSIF Err & HEX(2000) > 1 THEN Err := 8;
ELSIF Err & HEX(4000) > 1 THEN Err := 7;
ELSIF Err & HEX(8000) > 1 THEN Err := 4;
ELSE Err := 99;
ENDIF;
ELSIF ((State = 5) OR (State = 9)) AND hErr > 0 THEN
IF hErr & HEX(0001) > 1 THEN Err := 2;
ELSIF hErr & HEX(0002) > 1 THEN Err := 29;
ELSIF hErr & HEX(0004) > 1 THEN Err := 30;
ELSIF hErr & HEX(0008) > 1 THEN Err := 31;
ELSIF hErr & HEX(0010) > 1 THEN Err := 32;
ELSIF hErr & HEX(0020) > 1 THEN Err := 34;
ELSIF hErr & HEX(0040) > 1 THEN Err := 37;
ELSIF hErr & HEX(0080) > 1 THEN Err := 63;
ELSIF hErr & HEX(0100) > 1 THEN Err := 60;
ELSIF hErr & HEX(0200) > 1 THEN Err := 80;
ELSE Err := 99;
ENDIF;
ELSIF ((State = 5) OR (State = 9)) THEN
Err := 0;
ENDIF;
);
DATA[11] -> RWORD(
Tripp := DATA & HEX(08);
IF DATA & HEX(0800) THEN
Running := 1;
ELSE
Running := 0;
ENDIF;
StatW := DATA;
State := State -1;
IF (State = 0) AND (Running = 1) THEN
State := 9;
IF LastFmin = Fmin THEN %Updatera vid ändring
State := 93;
ENDIF;
ENDIF;
);
TIMEOUT 150
END;
END;
# OBS Danfoss eget protokoll
DEVICETYPE Danfoss_VLT6000HVAC NAMED "VLT 6000 HVAC" TYPEID 22001 IS
PARAMETER
Addr: "Adress" INT;
Mpow: "Motoreffekt" ["kW"];
Mcurr: "Motorström" ["A"];
MNomRpm: "Nom varvtal" ["rpm"];
Fmin: "Min utfrekvens" ["Hz"];
Tru: "Uppramptid" ["s"];
Trd: "Nedramptid" ["s"];
Nostop: "Får ej stanna" ["0=falskt"];
PUBLIC
Running: "Drift";
StatW: "Status";
Err: "Felkod" INT;
Warning: "Varning" INT;
Freq: "Frekvens" ["Hz"] DEC1;
Power: "Effekt" ["kW"] DEC2;
Volt: "Motorspänning" ["V"] DEC1;
Curr: "Motorström" ["A"] DEC2;
Temp: "Temp VLT" ["ºC"] INT;
TLoad: "TempLast" ["%"] INT;
PRIVATE
State;
RefFreq;
AK;
PNU;
IND;
PWEhigh;
PWElow;
Reset;
Styrord;
Tripp;
LastFmin;
hErr;
hWarning;
TripTimer;
BAUDRATE 9600;
PARITY EVEN;
CHECKSUM XOR8;
TELEGRAM Update NAMED "Uppdatera" IS
QUESTION
DATA[0] := HEX(02); %STX
DATA[1] := HEX(0E); %LEN
DATA[2] <- BYTE(DATA := Addr;); %ADR
DATA[3] <- RWORD( %PKE
IF State = 0 THEN State := 100; ENDIF; %Skriv inställningar vid uppstart
IF (RefFreq > 0) AND (State > 93) THEN State := 93; ENDIF; %Det går ändå inte att skriva till dom vid drift
IND := 0; %Den ska nästan alltid vara 0
PWEhigh := 0;
PWElow := 0;
IF State = 100 THEN %100 Konfiguration 0 Utan återkoppling
AK := HEX(E000);
PNU := 100;
PWElow := 1;
ELSIF State = 99 THEN %101 Momentkurva 0 Automatisk
AK := HEX(E000);
PNU := 101;
PWElow := 0;
ELSIF State = 98 THEN %102 Motoreffekt
AK := HEX(E000);
PNU := 102;
PWElow := Mpow * 100;
ELSIF State = 97 THEN %103 Motorspänning 400 V
AK := HEX(E000);
PNU := 103;
PWElow := 400;
ELSIF State = 96 THEN %104 Motorfrekvens 50 Hz
AK := HEX(E000);
PNU := 104;
PWElow := 50;
ELSIF State = 95 THEN %105 Motorström
AK := HEX(E000);
PNU := 105;
PWElow := Mcurr * 100;
ELSIF State = 94 THEN %106 Nominellt varvtal
AK := HEX(E000);
PNU := 106;
PWElow := MNomRpm;
ELSIF State = 93 THEN %201 Min utfrekvens
AK := HEX(E000);
PNU := 201;
PWElow := Fmin * 10;
LastFmin := Fmin;
ELSIF State = 92 THEN %206 Uppramptid ? s
AK := HEX(E000);
PNU := 206;
PWElow := Tru;
ELSIF State = 91 THEN %Nedramptid ? s
AK := HEX(E000);
PNU := 207;
PWElow := Trd;
ELSIF State = 90 THEN %208 Automatisk nedrampning 1 Aktiv
AK := HEX(E000);
PNU := 208;
PWElow := 1;
ELSIF State = 89 THEN %402 Flygande start 1 Aktiv
AK := HEX(E000);
PNU := 402;
PWElow := 1;
ELSIF State = 88 THEN %411 Funktion vid överhettning 0 eller 1 (1 för rökgasfläkten)
AK := HEX(E000);
PNU := 411;
IF Nostop > 0 THEN
PWElow := 1;
ELSE
PWElow := 1;
ENDIF;
ELSIF State = 87 THEN %503 Utrullningsstopp 1 Seriekomm
AK := HEX(E000);
PNU := 503;
PWElow := 1;
ELSIF State = 86 THEN %504 DC-broms 1 Seriekomm
AK := HEX(E000);
PNU := 504;
PWElow := 1;
ELSIF State = 85 THEN %508 Referensvarvtal 1 Seriekomm
AK := HEX(E000);
PNU := 508;
PWElow := 1;
ELSIF State = 84 THEN %555 Bus timeout ? s
AK := HEX(E000);
PNU := 555;
PWElow := 5;
ELSIF State = 83 THEN %556 Timeoutfunktion ? 1 frys eller 2 stop
AK := HEX(E000);
PNU := 556;
IF Nostop > 0 THEN
PWElow := 1;
ELSE
PWElow := 2;
ENDIF;
ELSIF State = 82 THEN %555 Bus timeout ? s
AK := HEX(E000);
PNU := 308;
PWElow := 0;
ENDIF;
IF (State < 82) AND (State > 9) THEN State := 9; ENDIF;
IF State = 1 THEN %Frekvens
AK := HEX(1000);
PNU := 512;
ELSIF State = 2 THEN %Ström
AK := HEX(1000);
PNU := 514;
ELSIF State = 3 THEN %Effekt
AK := HEX(1000);
PNU := 515;
ELSIF State = 4 THEN %Spänning
AK := HEX(1000);
PNU := 517;
ELSIF State = 5 THEN %Larm
AK := HEX(1000);
PNU := 529;
ELSIF State = 6 THEN %TLoad
AK := HEX(1000);
PNU := 520;
ELSIF State = 7 THEN %Temp
AK := HEX(1000);
PNU := 528;
ELSIF State = 8 THEN %Varning
AK := HEX(1000);
PNU := 531;
ELSIF State = 9 THEN %Larm
AK := HEX(1000);
PNU := 529;
ENDIF;
DATA := AK | PNU;
);
DATA[5] <- RWORD(DATA := IND;);
DATA[7] <- RWORD(DATA := PWEhigh;);
DATA[9] <- RWORD(DATA := PWElow;);
DATA[11] <- RWORD( %Styrord
IF RefFreq > 2 * Fmin THEN %RefFreq is %, Fmin is Hz -> On when RefFreq > 0
Styrord := HEX(7C);
ELSIF Nostop > 0 THEN
Styrord := HEX(7C);
ELSE
Styrord := HEX(34); %off
ENDIF;
IF Reset > 0 THEN
Styrord := Styrord + HEX(80);
ENDIF;
DATA := HEX(400) + Styrord;
);
DATA[13] <- RWORD(DATA := RefFreq * 163.84;);
ANSWER SIZE 16
DATA[0] = HEX(02);
DATA[1] = HEX(0E);
DATA[2] = BYTE(Addr);
DATA[7] -> RWORD(
IF State = 5 THEN %Larm
hErr := DATA;
ELSIF State = 8 THEN %Varning
hWarning := DATA;
ELSIF State = 9 THEN %Larm
hErr := DATA;
ENDIF;
);
DATA[9] -> RWORD(
IF State = 1 THEN %Frekvens
Freq := DATA / 10;
ELSIF State = 2 THEN %Ström
Curr := DATA / 100;
ELSIF State = 3 THEN %Effekt
Power := DATA / 100;
ELSIF State = 4 THEN %Spänning
Volt := DATA / 10;
ELSIF State = 5 THEN %Larm
Err := DATA;
ELSIF State = 6 THEN %TLoad
TLoad := DATA;
ELSIF State = 7 THEN %Temp
Temp := DATA;
ELSIF State = 8 THEN %Varning
Warning := DATA;
ELSIF State = 9 THEN %Larm
Err := DATA;
ENDIF;
IF State = 8 AND Warning > 0 THEN
IF Warning & HEX(40) > 1 THEN Warning := 12;
ELSIF Warning & HEX(20) > 1 THEN Warning := 13;
ELSIF Warning & HEX(8000) > 1 THEN Warning := 2;
ELSIF Warning & HEX(4000) > 1 THEN Warning := 4;
ELSIF Warning & HEX(2000) > 1 THEN Warning := 5;
ELSIF Warning & HEX(0200) > 1 THEN Warning := 9;
ELSIF Warning & HEX(0400) > 1 THEN Warning := 8;
ELSIF Warning & HEX(1800) > 1 THEN Warning := 7;
ELSIF Warning & HEX(0080) > 1 THEN Warning := 11;
ELSIF Warning & HEX(0100) > 1 THEN Warning := 10;
ELSE Warning := 99;
ENDIF;
ELSIF State = 8 AND hWarning > 0 THEN
IF hWarning & HEX(0001) > 1 THEN Warning := 1;
ELSIF hWarning & HEX(0010) > 1 THEN Warning := 64;
ELSIF hWarning & HEX(0080) > 1 THEN Warning := 63;
ELSE Warning := 99;
ENDIF;
ELSIF State = 8 THEN
Warning := 0;
ENDIF;
IF ((State = 5) OR (State = 9))AND Err > 0 THEN
IF Err & HEX(40) > 1 THEN Err := 12;
ELSIF Err & HEX(20) > 1 THEN Err := 16;
ELSIF Err & HEX(40) > 1 THEN Err := 15;
ELSIF Err & HEX(80) > 1 THEN Err := 14;
ELSIF Err & HEX(100) > 1 THEN Err := 13;
ELSIF Err & HEX(0200) > 1 THEN Err := 12;
ELSIF Err & HEX(0400) > 1 THEN Err := 11;
ELSIF Err & HEX(0800) > 1 THEN Err := 10;
ELSIF Err & HEX(1000) > 1 THEN Err := 9;
ELSIF Err & HEX(2000) > 1 THEN Err := 8;
ELSIF Err & HEX(4000) > 1 THEN Err := 7;
ELSIF Err & HEX(8000) > 1 THEN Err := 4;
ELSE Err := 99;
ENDIF;
ELSIF ((State = 5) OR (State = 9)) AND hErr > 0 THEN
IF hErr & HEX(0001) > 1 THEN Err := 2;
ELSIF hErr & HEX(0002) > 1 THEN Err := 29;
ELSIF hErr & HEX(0004) > 1 THEN Err := 30;
ELSIF hErr & HEX(0008) > 1 THEN Err := 31;
ELSIF hErr & HEX(0010) > 1 THEN Err := 32;
ELSIF hErr & HEX(0020) > 1 THEN Err := 34;
ELSIF hErr & HEX(0040) > 1 THEN Err := 37;
ELSIF hErr & HEX(0080) > 1 THEN Err := 63;
ELSIF hErr & HEX(0100) > 1 THEN Err := 60;
ELSIF hErr & HEX(0200) > 1 THEN Err := 80;
ELSE Err := 99;
ENDIF;
ELSIF ((State = 5) OR (State = 9)) THEN
Err := 0;
ENDIF;
);
DATA[11] -> RWORD(
Tripp := DATA & HEX(08);
IF DATA & HEX(0800) THEN
Running := 1;
ELSE
Running := 0;
ENDIF;
StatW := DATA;
State := State -1;
IF (State = 0) AND (Running = 1) THEN
State := 9;
IF LastFmin = Fmin THEN %Updatera vid ändring
State := 93;
ENDIF;
ENDIF;
);
TIMEOUT 150
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.