DANFOSS serie FC102M frekvensomformare
Detaljer
- Typ
- Drivrutin
- Upplaggd av
- Ove Jansson, Abelko Innovation
- Version
- 2
- Uppdaterad
- 2013-08-27
- Skapad
- 2013-08-27
- Kategori
- Frekvensomformare, Modbus
- Visningar
- 3116
Beskrivning
Drivrutin för DANFOSS serie FC102 frekvensomformare Modbus
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
% Device driver för DANFOSS serie FC102 frekvensomformare Modbus
% till IMSE WebMaster Pro
% ABELKO AB
%
DEVICETYPE Danfoss_FC102M NAMED "Danfoss FC102M" TYPEID 22003 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"];
MaxFreq: "Max frekvens"["Hz"];
test: "Test" INT;
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;
Torq: "Vridmoment" ["Nm"] DEC1;
TLoad: "TempLast" ["%"] INT;
PRIVATE
State;
rState; % read state
wState; % write state
wVal;
stat;
valLow;
valHigh;
RefFreq;
wPNU;
Reset;
Styrord;
Tripp;
LastFmin;
hErr;
hWarning;
TripTimer;
tmp;
BAUDRATE 38400;
PARITY EVEN;
CHECKSUM MODBUS SWAPPED;
TELEGRAM Styr NAMED "Styr" IS
QUESTION
DATA[0] := BYTE(Addr);
DATA[1] := HEX(0F);
DATA[2] := RWORD(0);
DATA[4] := RWORD(32);
DATA[6] := BYTE(4); % antal byte
DATA[7] <- WORD(
IF (Nostop>0) THEN
Styrord:=HEX(7C);
ELSIF (test<>0) THEN
Styrord:=HEX(7C);
ELSE
Styrord:=HEX(34); %off
ENDIF;
DATA := HEX(400) + Styrord;
);
DATA[9] <- WORD(DATA:=test*163.84;);
ANSWER SIZE 8
DATA[0] = BYTE(Addr); % address
% DATA[1] = HEX(10); % läs register
DATA[1] = HEX(0F); % läs register
TIMEOUT 2000
END;
TELEGRAM Read NAMED "ReadVars" IS
QUESTION
DATA[0] := BYTE(Addr);
DATA[1] := HEX(03); % läs inforegister
DATA[2] <- RWORD(
IF (rState>7) THEN rState :=0; ENDIF;
IF (rState=0) THEN tmp := 1610; % effekt
ELSIF (rState=1) THEN tmp := 1612; % motorspänning
ELSIF (rState=2) THEN tmp := 1613; % frekvens
ELSIF (rState=3) THEN tmp := 1614; % motorström
ELSIF (rState=4) THEN tmp := 1635; % temp last
ELSIF (rState=5) THEN tmp := 1616; % vridmoment
ELSIF (rState=6) THEN tmp := 1690; % larmord
ELSIF (rState=7) THEN tmp := 1692; % varningsord
ENDIF;
DATA:= (tmp*10)-1;
);
DATA[4] := HEX(00); % antal register hi
DATA[5] := HEX(02); % antal register lo, läser alltid 2 register
ANSWER SIZE 9
DATA[0] = BYTE(Addr); % address
DATA[1] = BYTE(03); % läs register
DATA[3] -> RWORD(tmp:=DATA;); % register hi
DATA[5] -> RWORD( % register lo
IF (rState=0) THEN Power := (DATA + 65536*tmp)/100;
ELSIF (rState=1) THEN Volt := tmp/10;
ELSIF (rState=2) THEN Freq := tmp/10;
ELSIF (rState=3) THEN Curr := (DATA + 65536*tmp)/100;
ELSIF (rState=4) THEN TLoad := (DATA + 65536*tmp)/100;
ELSIF (rState=5) THEN Torq := tmp/10;
ELSIF (rState=6) THEN Err := (DATA + 65536*tmp);
ELSIF (rState=7) THEN Warning := (DATA + 65536*tmp);
ENDIF;
rState := rState+1;
);
TIMEOUT 2000
END;
TELEGRAM WriteParams NAMED "WriteParams" IS
QUESTION
DATA[0] := BYTE(Addr);
DATA[1] := HEX(10);
DATA[2] <- RWORD(
valLow:=0;
valHigh:=0;
%wState := 0;
IF (wState > 15) THEN wState := 0; ENDIF;
IF (wState=0) THEN
wPNU:=100; % Parameter: 1-00 Konfigurationläge
valLow:=0; % 0 = Utan återkoppling
ELSIF (wState=1) THEN
wPNU := 122; % Parameter: 1-22 Motorspänning
valLow := 400; % 400 V
ELSIF (wState=2) THEN
wPNU := 120; % Parameter: 1-20 Motoreffekt
valLow := Mpow * 100; % ? W
ELSIF (wState=3) THEN
wPNU := 123; % Paramter: 1-23 Motorfrekvens
valLow := 50; % 50 Hz
ELSIF (wState=4) THEN
wPNU := 124; % Paramter: 1-24 Motorström
valLow := Mcurr * 100; % ? A
ELSIF (wState=5) THEN
wPNU := 125; % Parameter: 1-25 Nominellt varvtal
%wVal := MNomRpm; % ? RPM
valLow := MNomRpm; % ? RPM
ELSIF (wState=6) THEN
wPNU := 412; % Parameter: 4-12 Min utfrekvens
valLow := Fmin * 10; % ? Hz
LastFmin := Fmin;
ELSIF (wState=7) THEN
wPNU := 341; % Paramter: 3-41 Uppramptid
valLow := Tru*100; % ? s
ELSIF (wState=8) THEN
wPNU := 342; % Parameter: 3-42 Nedramptid
valLow := Trd*100; % ? s
ELSIF (wState=9) THEN
wPNU := 414; % Parameter: 4-14 Max utfrekvens
valLow := MaxFreq*10; % Hz
ELSIF (wState=10) THEN
wPNU := 173; % Parameter 1-73 Flygande start
valLow := 1; % 1 aktiv
ELSIF (wState=11) THEN
wPNU := 002; % Parameter 0-02 Hz eller RPM
valLow := 1; % 0=RPM, 1=Hz
ELSIF (wState=12) THEN
wPNU := 850; % Paramter: 8-50 Utrullningsstop
valLow := 1; % 1 = seriekom
ELSIF (wState=13) THEN
wPNU := 852; % Parameter: 8-52 DC-broms
valLow := 1; % 1 = seriekom
% ELSIF (wState=14) THEN
% wPNU := 508; % Parameter: Referensvarvtal
% valLow := 1; % 1 = seriekom
ELSIF (wState=14) THEN
wPNU := 803; % Parameter: 8-03 tidsgräns för styrord(bus timeout)
valLow := 30*10; % 30 s
ELSIF (wState=15) THEN
wPNU := 804; % Parameter: 8-04 funktion vid timeout
IF Nostop > 0 THEN
valLow := 1; % fryser motor
ELSE
valLow := 2; % stoppar motor
ENDIF;
ELSIF (wState=16) THEN
wPNU := 5001;
valHigh:=test;
ELSIF (wState=17) THEN
wPNU := 5000;
valHigh:=HEX(7C);
ENDIF;
wState := wState + 1;
%wPNU := 124; % max current
DATA := (wPNU*10)-1; );
DATA[4] <- RWORD(DATA:=2;); % antal register
DATA[6] := HEX(4); % antal byte
DATA[7] <- RWORD(DATA:=valHigh;);
DATA[9] <- RWORD(DATA:=valLow;);
ANSWER SIZE 8
DATA[0] = BYTE(Addr); % address
DATA[1] = HEX(10); % läs register
TIMEOUT 2000
END;
END;
% till IMSE WebMaster Pro
% ABELKO AB
%
DEVICETYPE Danfoss_FC102M NAMED "Danfoss FC102M" TYPEID 22003 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"];
MaxFreq: "Max frekvens"["Hz"];
test: "Test" INT;
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;
Torq: "Vridmoment" ["Nm"] DEC1;
TLoad: "TempLast" ["%"] INT;
PRIVATE
State;
rState; % read state
wState; % write state
wVal;
stat;
valLow;
valHigh;
RefFreq;
wPNU;
Reset;
Styrord;
Tripp;
LastFmin;
hErr;
hWarning;
TripTimer;
tmp;
BAUDRATE 38400;
PARITY EVEN;
CHECKSUM MODBUS SWAPPED;
TELEGRAM Styr NAMED "Styr" IS
QUESTION
DATA[0] := BYTE(Addr);
DATA[1] := HEX(0F);
DATA[2] := RWORD(0);
DATA[4] := RWORD(32);
DATA[6] := BYTE(4); % antal byte
DATA[7] <- WORD(
IF (Nostop>0) THEN
Styrord:=HEX(7C);
ELSIF (test<>0) THEN
Styrord:=HEX(7C);
ELSE
Styrord:=HEX(34); %off
ENDIF;
DATA := HEX(400) + Styrord;
);
DATA[9] <- WORD(DATA:=test*163.84;);
ANSWER SIZE 8
DATA[0] = BYTE(Addr); % address
% DATA[1] = HEX(10); % läs register
DATA[1] = HEX(0F); % läs register
TIMEOUT 2000
END;
TELEGRAM Read NAMED "ReadVars" IS
QUESTION
DATA[0] := BYTE(Addr);
DATA[1] := HEX(03); % läs inforegister
DATA[2] <- RWORD(
IF (rState>7) THEN rState :=0; ENDIF;
IF (rState=0) THEN tmp := 1610; % effekt
ELSIF (rState=1) THEN tmp := 1612; % motorspänning
ELSIF (rState=2) THEN tmp := 1613; % frekvens
ELSIF (rState=3) THEN tmp := 1614; % motorström
ELSIF (rState=4) THEN tmp := 1635; % temp last
ELSIF (rState=5) THEN tmp := 1616; % vridmoment
ELSIF (rState=6) THEN tmp := 1690; % larmord
ELSIF (rState=7) THEN tmp := 1692; % varningsord
ENDIF;
DATA:= (tmp*10)-1;
);
DATA[4] := HEX(00); % antal register hi
DATA[5] := HEX(02); % antal register lo, läser alltid 2 register
ANSWER SIZE 9
DATA[0] = BYTE(Addr); % address
DATA[1] = BYTE(03); % läs register
DATA[3] -> RWORD(tmp:=DATA;); % register hi
DATA[5] -> RWORD( % register lo
IF (rState=0) THEN Power := (DATA + 65536*tmp)/100;
ELSIF (rState=1) THEN Volt := tmp/10;
ELSIF (rState=2) THEN Freq := tmp/10;
ELSIF (rState=3) THEN Curr := (DATA + 65536*tmp)/100;
ELSIF (rState=4) THEN TLoad := (DATA + 65536*tmp)/100;
ELSIF (rState=5) THEN Torq := tmp/10;
ELSIF (rState=6) THEN Err := (DATA + 65536*tmp);
ELSIF (rState=7) THEN Warning := (DATA + 65536*tmp);
ENDIF;
rState := rState+1;
);
TIMEOUT 2000
END;
TELEGRAM WriteParams NAMED "WriteParams" IS
QUESTION
DATA[0] := BYTE(Addr);
DATA[1] := HEX(10);
DATA[2] <- RWORD(
valLow:=0;
valHigh:=0;
%wState := 0;
IF (wState > 15) THEN wState := 0; ENDIF;
IF (wState=0) THEN
wPNU:=100; % Parameter: 1-00 Konfigurationläge
valLow:=0; % 0 = Utan återkoppling
ELSIF (wState=1) THEN
wPNU := 122; % Parameter: 1-22 Motorspänning
valLow := 400; % 400 V
ELSIF (wState=2) THEN
wPNU := 120; % Parameter: 1-20 Motoreffekt
valLow := Mpow * 100; % ? W
ELSIF (wState=3) THEN
wPNU := 123; % Paramter: 1-23 Motorfrekvens
valLow := 50; % 50 Hz
ELSIF (wState=4) THEN
wPNU := 124; % Paramter: 1-24 Motorström
valLow := Mcurr * 100; % ? A
ELSIF (wState=5) THEN
wPNU := 125; % Parameter: 1-25 Nominellt varvtal
%wVal := MNomRpm; % ? RPM
valLow := MNomRpm; % ? RPM
ELSIF (wState=6) THEN
wPNU := 412; % Parameter: 4-12 Min utfrekvens
valLow := Fmin * 10; % ? Hz
LastFmin := Fmin;
ELSIF (wState=7) THEN
wPNU := 341; % Paramter: 3-41 Uppramptid
valLow := Tru*100; % ? s
ELSIF (wState=8) THEN
wPNU := 342; % Parameter: 3-42 Nedramptid
valLow := Trd*100; % ? s
ELSIF (wState=9) THEN
wPNU := 414; % Parameter: 4-14 Max utfrekvens
valLow := MaxFreq*10; % Hz
ELSIF (wState=10) THEN
wPNU := 173; % Parameter 1-73 Flygande start
valLow := 1; % 1 aktiv
ELSIF (wState=11) THEN
wPNU := 002; % Parameter 0-02 Hz eller RPM
valLow := 1; % 0=RPM, 1=Hz
ELSIF (wState=12) THEN
wPNU := 850; % Paramter: 8-50 Utrullningsstop
valLow := 1; % 1 = seriekom
ELSIF (wState=13) THEN
wPNU := 852; % Parameter: 8-52 DC-broms
valLow := 1; % 1 = seriekom
% ELSIF (wState=14) THEN
% wPNU := 508; % Parameter: Referensvarvtal
% valLow := 1; % 1 = seriekom
ELSIF (wState=14) THEN
wPNU := 803; % Parameter: 8-03 tidsgräns för styrord(bus timeout)
valLow := 30*10; % 30 s
ELSIF (wState=15) THEN
wPNU := 804; % Parameter: 8-04 funktion vid timeout
IF Nostop > 0 THEN
valLow := 1; % fryser motor
ELSE
valLow := 2; % stoppar motor
ENDIF;
ELSIF (wState=16) THEN
wPNU := 5001;
valHigh:=test;
ELSIF (wState=17) THEN
wPNU := 5000;
valHigh:=HEX(7C);
ENDIF;
wState := wState + 1;
%wPNU := 124; % max current
DATA := (wPNU*10)-1; );
DATA[4] <- RWORD(DATA:=2;); % antal register
DATA[6] := HEX(4); % antal byte
DATA[7] <- RWORD(DATA:=valHigh;);
DATA[9] <- RWORD(DATA:=valLow;);
ANSWER SIZE 8
DATA[0] = BYTE(Addr); % address
DATA[1] = HEX(10); % läs register
TIMEOUT 2000
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.