IV Frånluftagregat MSF MX
Detaljer
- Typ
- Drivrutin
- Upplaggd av
- Ove Jansson, Abelko Innovation
- Version
- 1
- Uppdaterad
- 2016-11-17
- Skapad
- 2016-11-17
- Kategori
- Modbus, Ventilation
- Visningar
- 1926
Beskrivning
.
Bruksanvisning
.
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 IVMSFMX NAMED "VMSFMX" TYPEID 14687 IS
PARAMETER
Id : "Adress" [""]INT;
V14 : "Exhaust fan command" ["Auto","Off","Stage 1","Stage 2","Stage 3"]ENUM; % use this for wmpro-> V14 : "Exhaust fan command" [""]INT;
V15 : "Exhaust fan step 1 setpoint" ["Pa"]INT;
V16 : "Exhaust fan step 2 setpoint" ["Pa"]INT;
V17 : "Exhaust fan step 3 setpoint" ["Pa"]INT;
PUBLIC
V1 : "Exhaust fan alarm" [""]INT;
V2 : "Exhaust fan deviation alarm" [""]INT;
V3 : "Fire alarm" [""]INT;
V4 : "Exhaust temp fire alarm" [""]INT;
V5 : "Exhaust fan output signal" ["%"]INT;
V6 : "Exhaust fan command" ["Off","Stage 1","Stage 2","Stage 3"]ENUM; % use this for wmpro-> V6 : "Exhaust fan command" [""]INT;
V7 : "Outside air temp" ["°C"]DEC1;
V8 : "Exhaust air temperature" ["°C"]DEC1;
V9 : "Extract air temperature" ["°C"]DEC1;
V10 : "Exhaust air flow" ["l/s"]INT;
V11 : "Exhaust air pressure" ["Pa"]INT;
V12 : "Actual exhaust fan setpoint" ["Pa"]INT;
V13 : "Sensible Effect Eff" ["kW"]DEC1;
PRIVATE
count1;
count4;
count6;
tmp;
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM Read2 NAMED "Read 2" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(02); % Modbus kommando för att läsa register
DATA[2] <- RWORD(
IF(count1>3) THEN count1 := 0; ENDIF;
IF (count1=0) THEN tmp := 29;
ELSIF (count1=1) THEN tmp := 31;
ELSIF (count1=2) THEN tmp := 72;
ELSIF (count1=3) THEN tmp := 74;
ENDIF;
DATA:= tmp;
);
DATA[4] := RWORD(01);
ANSWER SIZE 6 DATA[0] = BYTE(Id);
DATA[1] = BYTE(02);
DATA[3] -> RWORD(
IF(count1>3) THEN count1 := 0; ENDIF;
IF (count1=0) THEN IF (DATA & 1) THEN V1 := 1; ELSE V1 := 0; ENDIF;
ELSIF (count1=1) THEN IF (DATA & 1) THEN V2 := 1; ELSE V2 := 0; ENDIF;
ELSIF (count1=2) THEN IF (DATA & 1) THEN V3 := 1; ELSE V3 := 0; ENDIF;
ELSIF (count1=3) THEN IF (DATA & 1) THEN V4 := 1; ELSE V4 := 0; ENDIF;
ENDIF;
count1 := count1+1;
);
TIMEOUT 300
END;
TELEGRAM Read4 NAMED "Read 4" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(04); % Modbus kommando för att läsa register
DATA[2] <- RWORD(
IF(count4>8) THEN count4 := 0; ENDIF;
IF (count4=0) THEN tmp := 30;
ELSIF (count4=1) THEN tmp := 31;
ELSIF (count4=2) THEN tmp := 71;
ELSIF (count4=3) THEN tmp := 75;
ELSIF (count4=4) THEN tmp := 76;
ELSIF (count4=5) THEN tmp := 95;
ELSIF (count4=6) THEN tmp := 97;
ELSIF (count4=7) THEN tmp := 112;
ELSIF (count4=8) THEN tmp := 146;
ENDIF;
DATA:= tmp;
);
DATA[4] := RWORD(01);
ANSWER SIZE 7 DATA[0] = BYTE(Id);
DATA[1] = BYTE(04);
DATA[3] -> RWORD(
IF (count4=0) THEN V5 := DATA;
ELSIF (count4=1) THEN V6 := DATA;
ELSIF (count4=2) THEN IF (DATA>=32768) THEN V7:=(DATA-65536)/10; ELSE V7:=DATA/10; ENDIF;
ELSIF (count4=3) THEN IF (DATA>=32768) THEN V8:=(DATA-65536)/10; ELSE V8:=DATA/10; ENDIF;
ELSIF (count4=4) THEN IF (DATA>=32768) THEN V9:=(DATA-65536)/10; ELSE V9:=DATA/10; ENDIF;
ELSIF (count4=5) THEN V10 := DATA;
ELSIF (count4=6) THEN V11 := DATA;
ELSIF (count4=7) THEN V12 := DATA;
ELSIF (count4=8) THEN IF (DATA>=32768) THEN V13:=(DATA-65536)/10; ELSE V13:=DATA/10; ENDIF;
ENDIF;
count4 := count4+1;
);
TIMEOUT 300
END;
TELEGRAM WriteRegister NAMED "Write Register" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(06); % Modbus kommando för att skriva ett register
DATA[2] <- RWORD(
IF(count6>3) THEN count6 := 0; ENDIF;
IF (count6=0) THEN DATA := 4;
ELSIF (count6=1) THEN DATA := 53;
ELSIF (count6=2) THEN DATA := 54;
ELSIF (count6=3) THEN DATA := 55;
ENDIF;
); % Register adress
DATA[4] <- RWORD(
IF (count6=0) THEN DATA := V14;
ELSIF (count6=1) THEN DATA := V15;
ELSIF (count6=2) THEN DATA := V16;
ELSIF (count6=3) THEN DATA := V17;
ENDIF;
count6 := count6+1;
);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = BYTE(06);
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 IVMSFMX NAMED "VMSFMX" TYPEID 14687 IS
PARAMETER
Id : "Adress" [""]INT;
V14 : "Exhaust fan command" ["Auto","Off","Stage 1","Stage 2","Stage 3"]ENUM; % use this for wmpro-> V14 : "Exhaust fan command" [""]INT;
V15 : "Exhaust fan step 1 setpoint" ["Pa"]INT;
V16 : "Exhaust fan step 2 setpoint" ["Pa"]INT;
V17 : "Exhaust fan step 3 setpoint" ["Pa"]INT;
PUBLIC
V1 : "Exhaust fan alarm" [""]INT;
V2 : "Exhaust fan deviation alarm" [""]INT;
V3 : "Fire alarm" [""]INT;
V4 : "Exhaust temp fire alarm" [""]INT;
V5 : "Exhaust fan output signal" ["%"]INT;
V6 : "Exhaust fan command" ["Off","Stage 1","Stage 2","Stage 3"]ENUM; % use this for wmpro-> V6 : "Exhaust fan command" [""]INT;
V7 : "Outside air temp" ["°C"]DEC1;
V8 : "Exhaust air temperature" ["°C"]DEC1;
V9 : "Extract air temperature" ["°C"]DEC1;
V10 : "Exhaust air flow" ["l/s"]INT;
V11 : "Exhaust air pressure" ["Pa"]INT;
V12 : "Actual exhaust fan setpoint" ["Pa"]INT;
V13 : "Sensible Effect Eff" ["kW"]DEC1;
PRIVATE
count1;
count4;
count6;
tmp;
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM Read2 NAMED "Read 2" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(02); % Modbus kommando för att läsa register
DATA[2] <- RWORD(
IF(count1>3) THEN count1 := 0; ENDIF;
IF (count1=0) THEN tmp := 29;
ELSIF (count1=1) THEN tmp := 31;
ELSIF (count1=2) THEN tmp := 72;
ELSIF (count1=3) THEN tmp := 74;
ENDIF;
DATA:= tmp;
);
DATA[4] := RWORD(01);
ANSWER SIZE 6 DATA[0] = BYTE(Id);
DATA[1] = BYTE(02);
DATA[3] -> RWORD(
IF(count1>3) THEN count1 := 0; ENDIF;
IF (count1=0) THEN IF (DATA & 1) THEN V1 := 1; ELSE V1 := 0; ENDIF;
ELSIF (count1=1) THEN IF (DATA & 1) THEN V2 := 1; ELSE V2 := 0; ENDIF;
ELSIF (count1=2) THEN IF (DATA & 1) THEN V3 := 1; ELSE V3 := 0; ENDIF;
ELSIF (count1=3) THEN IF (DATA & 1) THEN V4 := 1; ELSE V4 := 0; ENDIF;
ENDIF;
count1 := count1+1;
);
TIMEOUT 300
END;
TELEGRAM Read4 NAMED "Read 4" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(04); % Modbus kommando för att läsa register
DATA[2] <- RWORD(
IF(count4>8) THEN count4 := 0; ENDIF;
IF (count4=0) THEN tmp := 30;
ELSIF (count4=1) THEN tmp := 31;
ELSIF (count4=2) THEN tmp := 71;
ELSIF (count4=3) THEN tmp := 75;
ELSIF (count4=4) THEN tmp := 76;
ELSIF (count4=5) THEN tmp := 95;
ELSIF (count4=6) THEN tmp := 97;
ELSIF (count4=7) THEN tmp := 112;
ELSIF (count4=8) THEN tmp := 146;
ENDIF;
DATA:= tmp;
);
DATA[4] := RWORD(01);
ANSWER SIZE 7 DATA[0] = BYTE(Id);
DATA[1] = BYTE(04);
DATA[3] -> RWORD(
IF (count4=0) THEN V5 := DATA;
ELSIF (count4=1) THEN V6 := DATA;
ELSIF (count4=2) THEN IF (DATA>=32768) THEN V7:=(DATA-65536)/10; ELSE V7:=DATA/10; ENDIF;
ELSIF (count4=3) THEN IF (DATA>=32768) THEN V8:=(DATA-65536)/10; ELSE V8:=DATA/10; ENDIF;
ELSIF (count4=4) THEN IF (DATA>=32768) THEN V9:=(DATA-65536)/10; ELSE V9:=DATA/10; ENDIF;
ELSIF (count4=5) THEN V10 := DATA;
ELSIF (count4=6) THEN V11 := DATA;
ELSIF (count4=7) THEN V12 := DATA;
ELSIF (count4=8) THEN IF (DATA>=32768) THEN V13:=(DATA-65536)/10; ELSE V13:=DATA/10; ENDIF;
ENDIF;
count4 := count4+1;
);
TIMEOUT 300
END;
TELEGRAM WriteRegister NAMED "Write Register" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(06); % Modbus kommando för att skriva ett register
DATA[2] <- RWORD(
IF(count6>3) THEN count6 := 0; ENDIF;
IF (count6=0) THEN DATA := 4;
ELSIF (count6=1) THEN DATA := 53;
ELSIF (count6=2) THEN DATA := 54;
ELSIF (count6=3) THEN DATA := 55;
ENDIF;
); % Register adress
DATA[4] <- RWORD(
IF (count6=0) THEN DATA := V14;
ELSIF (count6=1) THEN DATA := V15;
ELSIF (count6=2) THEN DATA := V16;
ELSIF (count6=3) THEN DATA := V17;
ENDIF;
count6 := count6+1;
);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = BYTE(06);
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.