Vacon 100 varvtalsstyrning
Detaljer
- Typ
- Drivrutin
- Upplaggd av
- Peter Widetun, Abelko Innovation
- Version
- 1
- Uppdaterad
- 2018-12-17
- Skapad
- 2018-12-17
- Kategori
- Modbus, Ventilation
- Visningar
- 1841
Beskrivning
Skript för fläkststyrning
Bruksanvisning
Går att köra i Wmpro och Ultra
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 definition for VACON read registers 2101-2111 and set register 2001-2011
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2009-04-07 inital version
% 2009-04-16 PW Ändrat för ställa läsa börvärde
% 2009-04-29 PW Ändrat för att hantera negativa börvärden
%
DEVICETYPE VaconData NAMED "VACON data 1" TYPEID 21300 IS
PARAMETER
Id : "Adress" INT;
% Ställbar processdata (2001-2011)
%S1 : "< FB Styrord" [""] INT; %Bitmask FB Kontroll
%S2 : "< FB Allmänt styrord" [""] INT; %Bitmask FB Kontroll
S3 : "< FB Börvärde varvtal" [""] DEC2; %0-100.00% FB Fart ref.
%S4 : "< PID Börvärde" ["°C"] DEC1; %0.1°C FB Data in 1
%S5 : "< PID Ärvärde" ["°C"] DEC1; %0.1°C FB Data in 2
%S6 : "< FB Data in 3" [""] INT; %Int 16 FB Data in 3
%S7 : "< FB Data in 4" [""] INT; %Int 16 FB Data in 4
%S8 : "< FB Data in 5" [""] INT; %Int 16 FB Data in 5
%S9 : "< FB Data in 6" [""] INT; %Int 16 FB Data in 6
%S10 : "< FB Data in 7" [""] INT; %Int 16 FB Data in 7
%S11 : "< FB Data in 8" [""] INT; %Int 16 FB Data in 8
PUBLIC
% Ingående processdata (2001-2011)
U1 : "> FB Styrord" [""] INT; %Bitmask FB Kontroll
U2 : "> FB Allmänt styrord" [""] INT; %Bitmask FB Kontroll
U3 : "> FB Börvärde varvtal" [""] DEC2; %0-100.00% FB Fart ref.
U4 : "> PID Börvärde" ["°C"] DEC1; %0.1°C FB Data in 1
U5 : "> PID Ärvärde" ["°C"] DEC1; %0.1°C FB Data in 2
U6 : "> FB Data in 3" [""] INT; %Int 16 FB Data in 3
U7 : "> FB Data in 4" [""] INT; %Int 16 FB Data in 4
U8 : "> FB Data in 5" [""] INT; %Int 16 FB Data in 5
U9 : "> FB Data in 6" [""] INT; %Int 16 FB Data in 6
U10 : "> FB Data in 7" [""] INT; %Int 16 FB Data in 7
U11 : "> FB Data in 8" [""] INT; %Int 16 FB Data in 8
% Utgående procesdata (2101-2111)
R1 : "> FB Statusord" [""] INT; %Bitmask FB Kontroll 1
R2 : "> FB Allmänt statusord" [""] INT; %Bitmask FB Kontroll 2
R3 : "> FB Ärvärde varvtal" ["%"] DEC2; %0-100.00% FB Fart verklig % 0,01
R4 : "> MotorFrekvens" ["Hz"] DEC2; %0.01 Hz FB Output Frequency Hz 0,01
R5 : "> MotorVarvtal" ["rpm"] INT; %1 rpm FB Motor Speed rpm 1
R6 : "> MotorStröm" ["A"] DEC1; %0.1 A FB Motor Current A 0,1
R7 : "> MotorVridmoment" ["%"] DEC1; %0.1 % FB Motor Torque % 0,1
R8 : "> MotorEffekt" ["%"] DEC1; %0.1 % FB Motor Power % 0,1
R9 : "> MotorSpänning" ["V"] DEC1; %0.1 V FB Motor Voltage V 0,1
R10 : "> DC spänning" ["V"] INT; %1 V FB DC link voltage V 1
R11 : "> Aktivt fel" [""] INT; %1 FB Active Fault Code - 1
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM DataIn1 NAMED "Läs utgående p.data" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(04); % Modbus command "04h" Read registers
DATA[2] := RWORD(2100); % Start address register 2101-1
DATA[4] := RWORD(11); % Number of registers
ANSWER SIZE 27
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(04); % Modbus command "04h" Read registers
%DATA[2] = BYTE(22); % Byte count
DATA[3] -> RINT(R1 := DATA;); %Bitmask
DATA[5] -> RINT(R2 := DATA;); %Bitmask
DATA[7] -> RINT(R3 := DATA / 100;); %0-100.00%
DATA[9] -> RINT(R4 := DATA / 100;); %0.01 Hz
DATA[11] -> RINT(R5 := DATA;); %1 rpm
DATA[13] -> RINT(R6 := DATA / 10;); %0.1 A
DATA[15] -> RINT(R7 := DATA / 10;); %0.1 %
DATA[17] -> RINT(R8 := DATA / 10;); %0.1 %
DATA[19] -> RINT(R9 := DATA / 10;); %0.1 V
DATA[21] -> RINT(R10 := DATA;); %1 V
DATA[23] -> RINT(R11 := DATA;); %1
TIMEOUT 1000
END;
TELEGRAM DataIn2 NAMED "Läs ingående p.data" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(04); % Modbus command "04h" Read registers
DATA[2] := RWORD(2000); % Start address register 2001-1
DATA[4] := RWORD(11); % Number of registers
ANSWER SIZE 27
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(04); % Modbus command "04h" Read registers
%DATA[2] = BYTE(22); % Byte count
DATA[3] -> RINT(R1 := DATA;); %Bitmask
DATA[5] -> RINT(R2 := DATA;); %Bitmask
DATA[7] -> RINT(R3 := DATA / 100;); %0-100.00%
DATA[9] -> RINT(R4 := DATA / 10;); %0.1°C
DATA[11] -> RINT(R5 := DATA / 10;); %0.1°C
DATA[13] -> RINT(R6 := DATA;);
DATA[15] -> RINT(R7 := DATA;);
DATA[17] -> RINT(R8 := DATA;);
DATA[19] -> RINT(R9 := DATA;);
DATA[21] -> RINT(R10 := DATA;);
DATA[23] -> RINT(R11 := DATA;);
TIMEOUT 1000
END;
TELEGRAM DataUt NAMED "Ställ BV varvtal" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := BYTE(6); % Modbus command "6" Write singel register
DATA[2] := RWORD(2002); % Start address register 2003 (- 1)
DATA[4] <- RWORD(DATA := S3 * 100;); %0-100.00% FB Fart ref.
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = BYTE(6);
TIMEOUT 1000
END;
END;
% Device definition for VACON read registers 2101-2111 and set register 2001-2011
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2009-04-07 inital version
% 2009-04-16 PW Ändrat för ställa läsa börvärde
% 2009-04-29 PW Ändrat för att hantera negativa börvärden
%
DEVICETYPE VaconData NAMED "VACON data 1" TYPEID 21300 IS
PARAMETER
Id : "Adress" INT;
% Ställbar processdata (2001-2011)
%S1 : "< FB Styrord" [""] INT; %Bitmask FB Kontroll
%S2 : "< FB Allmänt styrord" [""] INT; %Bitmask FB Kontroll
S3 : "< FB Börvärde varvtal" [""] DEC2; %0-100.00% FB Fart ref.
%S4 : "< PID Börvärde" ["°C"] DEC1; %0.1°C FB Data in 1
%S5 : "< PID Ärvärde" ["°C"] DEC1; %0.1°C FB Data in 2
%S6 : "< FB Data in 3" [""] INT; %Int 16 FB Data in 3
%S7 : "< FB Data in 4" [""] INT; %Int 16 FB Data in 4
%S8 : "< FB Data in 5" [""] INT; %Int 16 FB Data in 5
%S9 : "< FB Data in 6" [""] INT; %Int 16 FB Data in 6
%S10 : "< FB Data in 7" [""] INT; %Int 16 FB Data in 7
%S11 : "< FB Data in 8" [""] INT; %Int 16 FB Data in 8
PUBLIC
% Ingående processdata (2001-2011)
U1 : "> FB Styrord" [""] INT; %Bitmask FB Kontroll
U2 : "> FB Allmänt styrord" [""] INT; %Bitmask FB Kontroll
U3 : "> FB Börvärde varvtal" [""] DEC2; %0-100.00% FB Fart ref.
U4 : "> PID Börvärde" ["°C"] DEC1; %0.1°C FB Data in 1
U5 : "> PID Ärvärde" ["°C"] DEC1; %0.1°C FB Data in 2
U6 : "> FB Data in 3" [""] INT; %Int 16 FB Data in 3
U7 : "> FB Data in 4" [""] INT; %Int 16 FB Data in 4
U8 : "> FB Data in 5" [""] INT; %Int 16 FB Data in 5
U9 : "> FB Data in 6" [""] INT; %Int 16 FB Data in 6
U10 : "> FB Data in 7" [""] INT; %Int 16 FB Data in 7
U11 : "> FB Data in 8" [""] INT; %Int 16 FB Data in 8
% Utgående procesdata (2101-2111)
R1 : "> FB Statusord" [""] INT; %Bitmask FB Kontroll 1
R2 : "> FB Allmänt statusord" [""] INT; %Bitmask FB Kontroll 2
R3 : "> FB Ärvärde varvtal" ["%"] DEC2; %0-100.00% FB Fart verklig % 0,01
R4 : "> MotorFrekvens" ["Hz"] DEC2; %0.01 Hz FB Output Frequency Hz 0,01
R5 : "> MotorVarvtal" ["rpm"] INT; %1 rpm FB Motor Speed rpm 1
R6 : "> MotorStröm" ["A"] DEC1; %0.1 A FB Motor Current A 0,1
R7 : "> MotorVridmoment" ["%"] DEC1; %0.1 % FB Motor Torque % 0,1
R8 : "> MotorEffekt" ["%"] DEC1; %0.1 % FB Motor Power % 0,1
R9 : "> MotorSpänning" ["V"] DEC1; %0.1 V FB Motor Voltage V 0,1
R10 : "> DC spänning" ["V"] INT; %1 V FB DC link voltage V 1
R11 : "> Aktivt fel" [""] INT; %1 FB Active Fault Code - 1
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM DataIn1 NAMED "Läs utgående p.data" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(04); % Modbus command "04h" Read registers
DATA[2] := RWORD(2100); % Start address register 2101-1
DATA[4] := RWORD(11); % Number of registers
ANSWER SIZE 27
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(04); % Modbus command "04h" Read registers
%DATA[2] = BYTE(22); % Byte count
DATA[3] -> RINT(R1 := DATA;); %Bitmask
DATA[5] -> RINT(R2 := DATA;); %Bitmask
DATA[7] -> RINT(R3 := DATA / 100;); %0-100.00%
DATA[9] -> RINT(R4 := DATA / 100;); %0.01 Hz
DATA[11] -> RINT(R5 := DATA;); %1 rpm
DATA[13] -> RINT(R6 := DATA / 10;); %0.1 A
DATA[15] -> RINT(R7 := DATA / 10;); %0.1 %
DATA[17] -> RINT(R8 := DATA / 10;); %0.1 %
DATA[19] -> RINT(R9 := DATA / 10;); %0.1 V
DATA[21] -> RINT(R10 := DATA;); %1 V
DATA[23] -> RINT(R11 := DATA;); %1
TIMEOUT 1000
END;
TELEGRAM DataIn2 NAMED "Läs ingående p.data" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(04); % Modbus command "04h" Read registers
DATA[2] := RWORD(2000); % Start address register 2001-1
DATA[4] := RWORD(11); % Number of registers
ANSWER SIZE 27
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(04); % Modbus command "04h" Read registers
%DATA[2] = BYTE(22); % Byte count
DATA[3] -> RINT(R1 := DATA;); %Bitmask
DATA[5] -> RINT(R2 := DATA;); %Bitmask
DATA[7] -> RINT(R3 := DATA / 100;); %0-100.00%
DATA[9] -> RINT(R4 := DATA / 10;); %0.1°C
DATA[11] -> RINT(R5 := DATA / 10;); %0.1°C
DATA[13] -> RINT(R6 := DATA;);
DATA[15] -> RINT(R7 := DATA;);
DATA[17] -> RINT(R8 := DATA;);
DATA[19] -> RINT(R9 := DATA;);
DATA[21] -> RINT(R10 := DATA;);
DATA[23] -> RINT(R11 := DATA;);
TIMEOUT 1000
END;
TELEGRAM DataUt NAMED "Ställ BV varvtal" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := BYTE(6); % Modbus command "6" Write singel register
DATA[2] := RWORD(2002); % Start address register 2003 (- 1)
DATA[4] <- RWORD(DATA := S3 * 100;); %0-100.00% FB Fart ref.
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = BYTE(6);
TIMEOUT 1000
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.