Seneca Z-4AI
Detaljer
- Typ
- Drivrutin
- Upplaggd av
- Ove Jansson, Abelko Innovation
- Version
- 3
- Uppdaterad
- 2016-03-21
- Skapad
- 2013-08-27
- Kategori
- IO enheter, Modbus
- Visningar
- 2477
Beskrivning
Seneca Z-4AI (fyra analoga ingångar)
Bruksanvisning
Hur man installerar typdefinitionerna och driftsätter modulerna finns beskrivet i användarmanualen, kapitel 18.7. För inkopplingsanvisningar och liknande, se modulens manual. Den kan hämtas från Senecas hemsida: http://www.seneca.it/
Det finns ett skript för att konfigurera Seneca enheter
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
% Measured value from register 40021-40024 not normalized.
% Channel input value max 2000mV (current 0-20mA) or
% max 10V (voltage 0-10V) gives channel value 0..16000
%
DEVICETYPE SenecaZ4AI NAMED "Seneca Z-4AI" TYPEID 21007
IS
PARAMETER
Id :"Address";
FiltAI1 :"Filter AI1" ["0..6"];
FiltAI2 :"Filter AI2" ["0..6"];
FiltAI3 :"Filter AI3" ["0..6"];
FiltAI4 :"Filter AI4" ["0..6"];
PUBLIC
AI_1 :"AI1" ["%"];
AI_2 :"AI2" ["%"];
AI_3 :"AI3" ["%"];
AI_4 :"AI4" ["%"];
OOR_1 :"OutOfRange AI1";
OOR_2 :"OutOfRange AI2";
OOR_3 :"OutOfRange AI3";
OOR_4 :"OutOfRange AI4";
PRIVATE
BAUDRATE 38400;
CHECKSUM MODBUS SWAPPED;
TELEGRAM ReadInputs NAMED "Read Inputs" IS
QUESTION
DATA[0] := BYTE(Id);
DATA[1] := HEX(03);
DATA[2] := HEX(00);
DATA[3] := HEX(14);
DATA[4] := HEX(00);
DATA[5] := HEX(04);
ANSWER SIZE 13
DATA[0] = BYTE(Id);
DATA[1] = HEX(03);
DATA[2] = HEX(08);
DATA[3] -> RWORD(
IF DATA > 32767 THEN
AI_1 := (DATA - 65536) / 160;
ELSE
AI_1 := DATA / 160;
ENDIF;
);
DATA[5] -> RWORD(
IF DATA > 32767 THEN
AI_2 := (DATA - 65536) / 160;
ELSE
AI_2 := DATA / 160;
ENDIF;
);
DATA[7] -> RWORD(
IF DATA > 32767 THEN
AI_3 := (DATA - 65536) / 160;
ELSE
AI_3 := DATA / 160;
ENDIF;
);
DATA[9] -> RWORD(
IF DATA > 32767 THEN
AI_4 := (DATA - 65536) / 160;
ELSE
AI_4 := DATA / 160;
ENDIF;
);
TIMEOUT 300
END;
TELEGRAM ReadOverFlow NAMED "Read OverFlow" IS
QUESTION
DATA[0] := BYTE(Id);
DATA[1] := HEX(03);
DATA[2] := HEX(00);
DATA[3] := HEX(02);
DATA[4] := HEX(00);
DATA[5] := HEX(01);
ANSWER SIZE 7
DATA[0] = BYTE(Id);
DATA[1] = HEX(03);
DATA[2] = HEX(02);
DATA[3] -> RWORD(
IF (FLOOR(DATA / 256) MOD 2 > 0) THEN OOR_1 := 1; ELSE OOR_1 := 0; ENDIF;
IF (FLOOR(DATA / 512) MOD 2 > 0) THEN OOR_1 := 1; ENDIF;
IF (FLOOR(DATA / 1024) MOD 2 > 0) THEN OOR_2 := 1; ELSE OOR_2 := 0; ENDIF;
IF (FLOOR(DATA / 2048) MOD 2 > 0) THEN OOR_2 := 1; ENDIF;
IF (FLOOR(DATA / 4096) MOD 2 > 0) THEN OOR_3 := 1; ELSE OOR_3 := 0; ENDIF;
IF (FLOOR(DATA / 8192) MOD 2 > 0) THEN OOR_3 := 1; ENDIF;
IF (FLOOR(DATA / 16384) MOD 2 > 0) THEN OOR_4 := 1; ELSE OOR_4 := 0; ENDIF;
IF (FLOOR(DATA / 32768) MOD 2 > 0) THEN OOR_4 := 1; ENDIF;
);
TIMEOUT 300
END;
TELEGRAM WriteSettings NAMED "Write Settings" IS
QUESTION
DATA[0] := BYTE(Id);
DATA[1] := HEX(10);
DATA[2] := HEX(00);
DATA[3] := HEX(03);
DATA[4] := HEX(00);
DATA[5] := HEX(04);
DATA[6] := HEX(08);
DATA[7] <- RWORD(
IF FiltAI1 <= 6 THEN DATA := FiltAI1;
ELSE DATA := 0; ENDIF;
);
DATA[9] <- RWORD(
IF FiltAI2 <= 6 THEN DATA := FiltAI2;
ELSE DATA := 0; ENDIF;
);
DATA[11] <- RWORD(
IF FiltAI3 <= 6 THEN DATA := FiltAI3;
ELSE DATA := 0; ENDIF;
);
DATA[13] <- RWORD(
IF FiltAI4 <= 6 THEN DATA := FiltAI4;
ELSE DATA := 0; ENDIF;
);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = HEX(10);
TIMEOUT 300
END;
END;
% Channel input value max 2000mV (current 0-20mA) or
% max 10V (voltage 0-10V) gives channel value 0..16000
%
DEVICETYPE SenecaZ4AI NAMED "Seneca Z-4AI" TYPEID 21007
IS
PARAMETER
Id :"Address";
FiltAI1 :"Filter AI1" ["0..6"];
FiltAI2 :"Filter AI2" ["0..6"];
FiltAI3 :"Filter AI3" ["0..6"];
FiltAI4 :"Filter AI4" ["0..6"];
PUBLIC
AI_1 :"AI1" ["%"];
AI_2 :"AI2" ["%"];
AI_3 :"AI3" ["%"];
AI_4 :"AI4" ["%"];
OOR_1 :"OutOfRange AI1";
OOR_2 :"OutOfRange AI2";
OOR_3 :"OutOfRange AI3";
OOR_4 :"OutOfRange AI4";
PRIVATE
BAUDRATE 38400;
CHECKSUM MODBUS SWAPPED;
TELEGRAM ReadInputs NAMED "Read Inputs" IS
QUESTION
DATA[0] := BYTE(Id);
DATA[1] := HEX(03);
DATA[2] := HEX(00);
DATA[3] := HEX(14);
DATA[4] := HEX(00);
DATA[5] := HEX(04);
ANSWER SIZE 13
DATA[0] = BYTE(Id);
DATA[1] = HEX(03);
DATA[2] = HEX(08);
DATA[3] -> RWORD(
IF DATA > 32767 THEN
AI_1 := (DATA - 65536) / 160;
ELSE
AI_1 := DATA / 160;
ENDIF;
);
DATA[5] -> RWORD(
IF DATA > 32767 THEN
AI_2 := (DATA - 65536) / 160;
ELSE
AI_2 := DATA / 160;
ENDIF;
);
DATA[7] -> RWORD(
IF DATA > 32767 THEN
AI_3 := (DATA - 65536) / 160;
ELSE
AI_3 := DATA / 160;
ENDIF;
);
DATA[9] -> RWORD(
IF DATA > 32767 THEN
AI_4 := (DATA - 65536) / 160;
ELSE
AI_4 := DATA / 160;
ENDIF;
);
TIMEOUT 300
END;
TELEGRAM ReadOverFlow NAMED "Read OverFlow" IS
QUESTION
DATA[0] := BYTE(Id);
DATA[1] := HEX(03);
DATA[2] := HEX(00);
DATA[3] := HEX(02);
DATA[4] := HEX(00);
DATA[5] := HEX(01);
ANSWER SIZE 7
DATA[0] = BYTE(Id);
DATA[1] = HEX(03);
DATA[2] = HEX(02);
DATA[3] -> RWORD(
IF (FLOOR(DATA / 256) MOD 2 > 0) THEN OOR_1 := 1; ELSE OOR_1 := 0; ENDIF;
IF (FLOOR(DATA / 512) MOD 2 > 0) THEN OOR_1 := 1; ENDIF;
IF (FLOOR(DATA / 1024) MOD 2 > 0) THEN OOR_2 := 1; ELSE OOR_2 := 0; ENDIF;
IF (FLOOR(DATA / 2048) MOD 2 > 0) THEN OOR_2 := 1; ENDIF;
IF (FLOOR(DATA / 4096) MOD 2 > 0) THEN OOR_3 := 1; ELSE OOR_3 := 0; ENDIF;
IF (FLOOR(DATA / 8192) MOD 2 > 0) THEN OOR_3 := 1; ENDIF;
IF (FLOOR(DATA / 16384) MOD 2 > 0) THEN OOR_4 := 1; ELSE OOR_4 := 0; ENDIF;
IF (FLOOR(DATA / 32768) MOD 2 > 0) THEN OOR_4 := 1; ENDIF;
);
TIMEOUT 300
END;
TELEGRAM WriteSettings NAMED "Write Settings" IS
QUESTION
DATA[0] := BYTE(Id);
DATA[1] := HEX(10);
DATA[2] := HEX(00);
DATA[3] := HEX(03);
DATA[4] := HEX(00);
DATA[5] := HEX(04);
DATA[6] := HEX(08);
DATA[7] <- RWORD(
IF FiltAI1 <= 6 THEN DATA := FiltAI1;
ELSE DATA := 0; ENDIF;
);
DATA[9] <- RWORD(
IF FiltAI2 <= 6 THEN DATA := FiltAI2;
ELSE DATA := 0; ENDIF;
);
DATA[11] <- RWORD(
IF FiltAI3 <= 6 THEN DATA := FiltAI3;
ELSE DATA := 0; ENDIF;
);
DATA[13] <- RWORD(
IF FiltAI4 <= 6 THEN DATA := FiltAI4;
ELSE DATA := 0; ENDIF;
);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = HEX(10);
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.