Seneca Z-3AO
Detaljer
- Typ
- Drivrutin
- Upplaggd av
- Ove Jansson, Abelko Innovation
- Version
- 1
- Uppdaterad
- 2013-08-27
- Skapad
- 2013-08-27
- Kategori
- IO enheter, Modbus
- Visningar
- 2516
Beskrivning
Seneca Z-3AO (tre analoga utgå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
DEVICETYPE SenecaZ3AO NAMED "Seneca Z-3AO" TYPEID 21015
IS
PARAMETER
Id :"Address";
AO_1:"AO1" ["%"];
AO_2:"AO2" ["%"];
AO_3:"AO3" ["%"];
TimeOut:"TimeOut" ["s"]; % 1 - 2.5 sekunder
DAO_1:"Default AO1" ["%"]; % Starvärde Analog ut 1
DAO_2:"Default AO2" ["%"]; % Starvärde Analog ut 2
DAO_3:"Default AO3" ["%"]; % Starvärde Analog ut 3
LowEndFlg:"0-20 or 4-20 mA" ["0 or 1"]; % Min strömutgång 1-3: 0=0mA, 1=4mA
% Min spänningsutgång AO1: 0=0V, 1=1V eller 2V beroende på full scale
HighEndFlg:"AO1 FS 10 or 20 mA" ["0 or 1"]; % Max strömutgång 1-3: 0=10mA,1=20mA
% Max spänningsutgång AO1: 0=5V, 1=10V
PUBLIC
PAO_1 :"AO1" ["%"];
PAO_2 :"AO2" ["%"];
PAO_3 :"AO3" ["%"];
PRIVATE
L_DAO_1;
L_DAO_2;
L_DAO_3;
L_LowEndFlg;
L_HighEndFlg;
NoChange;
Tmp;
BAUDRATE 38400;
CHECKSUM MODBUS SWAPPED;
TELEGRAM WriteOutputs NAMED "Write Outputs" IS
QUESTION
DATA[0] := BYTE(Id);
DATA[1] := HEX(10);
DATA[2] := HEX(00);
DATA[3] := HEX(04);
DATA[4] := HEX(00);
DATA[5] := HEX(03);
DATA[6] := HEX(06);
DATA[7] <- RWORD(
IF AO_1 > 100 THEN Tmp := 10000;
ELSIF AO_1 < 0 THEN Tmp := 0;
ELSE Tmp := AO_1 * 100; ENDIF;
PAO_1 := Tmp / 100;
DATA := Tmp;
);
DATA[9] <- RWORD(
IF AO_2 > 100 THEN Tmp := 10000;
ELSIF AO_2 < 0 THEN Tmp := 0;
ELSE Tmp := AO_2 * 100; ENDIF;
PAO_2 := Tmp / 100;
DATA := Tmp;
);
DATA[11] <- RWORD(
IF AO_3 > 100 THEN Tmp := 10000;
ELSIF AO_3 < 0 THEN Tmp := 0;
ELSE Tmp := AO_3 * 100; ENDIF;
PAO_3 := Tmp / 100;
DATA := Tmp;
);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = HEX(10);
TIMEOUT 300
END;
TELEGRAM WriteSettings NAMED "Write Settings" IS
QUESTION
DATA[0] := BYTE(Id);
DATA[1] := HEX(10);
DATA[2] <- RWORD(
IF (L_DAO_1 = DAO_1) AND
(L_DAO_2 = DAO_2) AND
(L_DAO_3 = DAO_3) AND
(L_LowEndFlg = LowEndFlg) AND
(L_HighEndFlg = HighEndFlg)
THEN
NoChange := 1;
DATA := 2;
ELSE
NoChange := 0;
DATA := 66;
ENDIF;
L_DAO_1 := DAO_1;
L_DAO_2 := DAO_2;
L_DAO_3 := DAO_3;
L_LowEndFlg := LowEndFlg;
L_HighEndFlg := HighEndFlg;
);
DATA[4] := HEX(00);
DATA[5] := HEX(05);
DATA[6] := HEX(0A);
DATA[7] <- RWORD(
IF TimeOut > 25 THEN DATA := 250;
ELSIF TimeOut < 1 THEN DATA := 10;
ELSE DATA := TimeOut * 10; ENDIF;
);
DATA[9] <- RWORD(
IF TimeOut = 0 THEN Tmp := 64;
ELSE Tmp := 0; ENDIF;
IF LowEndFlg THEN Tmp := Tmp + 1792; ENDIF;
IF HighEndFlg THEN Tmp := Tmp + 2048; ENDIF;
DATA := Tmp;
);
DATA[11] <- RWORD(
IF NoChange THEN Tmp := AO_1;
ELSE Tmp := DAO_1; ENDIF;
IF Tmp > 100 THEN DATA := 100;
ELSIF Tmp < 0 THEN DATA := 0;
ELSE DATA := Tmp * 100; ENDIF;
);
DATA[13] <- RWORD(
IF NoChange THEN Tmp := AO_2;
ELSE Tmp := DAO_2; ENDIF;
IF Tmp > 100 THEN DATA := 100;
ELSIF Tmp < 0 THEN DATA := 0;
ELSE DATA := Tmp * 100; ENDIF;
);
DATA[15] <- RWORD(
IF NoChange THEN Tmp := AO_3;
ELSE Tmp := DAO_3; ENDIF;
IF Tmp > 100 THEN DATA := 100;
ELSIF Tmp < 0 THEN DATA := 0;
ELSE DATA := Tmp * 100; ENDIF;
);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = HEX(10);
TIMEOUT 300
END;
END;
IS
PARAMETER
Id :"Address";
AO_1:"AO1" ["%"];
AO_2:"AO2" ["%"];
AO_3:"AO3" ["%"];
TimeOut:"TimeOut" ["s"]; % 1 - 2.5 sekunder
DAO_1:"Default AO1" ["%"]; % Starvärde Analog ut 1
DAO_2:"Default AO2" ["%"]; % Starvärde Analog ut 2
DAO_3:"Default AO3" ["%"]; % Starvärde Analog ut 3
LowEndFlg:"0-20 or 4-20 mA" ["0 or 1"]; % Min strömutgång 1-3: 0=0mA, 1=4mA
% Min spänningsutgång AO1: 0=0V, 1=1V eller 2V beroende på full scale
HighEndFlg:"AO1 FS 10 or 20 mA" ["0 or 1"]; % Max strömutgång 1-3: 0=10mA,1=20mA
% Max spänningsutgång AO1: 0=5V, 1=10V
PUBLIC
PAO_1 :"AO1" ["%"];
PAO_2 :"AO2" ["%"];
PAO_3 :"AO3" ["%"];
PRIVATE
L_DAO_1;
L_DAO_2;
L_DAO_3;
L_LowEndFlg;
L_HighEndFlg;
NoChange;
Tmp;
BAUDRATE 38400;
CHECKSUM MODBUS SWAPPED;
TELEGRAM WriteOutputs NAMED "Write Outputs" IS
QUESTION
DATA[0] := BYTE(Id);
DATA[1] := HEX(10);
DATA[2] := HEX(00);
DATA[3] := HEX(04);
DATA[4] := HEX(00);
DATA[5] := HEX(03);
DATA[6] := HEX(06);
DATA[7] <- RWORD(
IF AO_1 > 100 THEN Tmp := 10000;
ELSIF AO_1 < 0 THEN Tmp := 0;
ELSE Tmp := AO_1 * 100; ENDIF;
PAO_1 := Tmp / 100;
DATA := Tmp;
);
DATA[9] <- RWORD(
IF AO_2 > 100 THEN Tmp := 10000;
ELSIF AO_2 < 0 THEN Tmp := 0;
ELSE Tmp := AO_2 * 100; ENDIF;
PAO_2 := Tmp / 100;
DATA := Tmp;
);
DATA[11] <- RWORD(
IF AO_3 > 100 THEN Tmp := 10000;
ELSIF AO_3 < 0 THEN Tmp := 0;
ELSE Tmp := AO_3 * 100; ENDIF;
PAO_3 := Tmp / 100;
DATA := Tmp;
);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = HEX(10);
TIMEOUT 300
END;
TELEGRAM WriteSettings NAMED "Write Settings" IS
QUESTION
DATA[0] := BYTE(Id);
DATA[1] := HEX(10);
DATA[2] <- RWORD(
IF (L_DAO_1 = DAO_1) AND
(L_DAO_2 = DAO_2) AND
(L_DAO_3 = DAO_3) AND
(L_LowEndFlg = LowEndFlg) AND
(L_HighEndFlg = HighEndFlg)
THEN
NoChange := 1;
DATA := 2;
ELSE
NoChange := 0;
DATA := 66;
ENDIF;
L_DAO_1 := DAO_1;
L_DAO_2 := DAO_2;
L_DAO_3 := DAO_3;
L_LowEndFlg := LowEndFlg;
L_HighEndFlg := HighEndFlg;
);
DATA[4] := HEX(00);
DATA[5] := HEX(05);
DATA[6] := HEX(0A);
DATA[7] <- RWORD(
IF TimeOut > 25 THEN DATA := 250;
ELSIF TimeOut < 1 THEN DATA := 10;
ELSE DATA := TimeOut * 10; ENDIF;
);
DATA[9] <- RWORD(
IF TimeOut = 0 THEN Tmp := 64;
ELSE Tmp := 0; ENDIF;
IF LowEndFlg THEN Tmp := Tmp + 1792; ENDIF;
IF HighEndFlg THEN Tmp := Tmp + 2048; ENDIF;
DATA := Tmp;
);
DATA[11] <- RWORD(
IF NoChange THEN Tmp := AO_1;
ELSE Tmp := DAO_1; ENDIF;
IF Tmp > 100 THEN DATA := 100;
ELSIF Tmp < 0 THEN DATA := 0;
ELSE DATA := Tmp * 100; ENDIF;
);
DATA[13] <- RWORD(
IF NoChange THEN Tmp := AO_2;
ELSE Tmp := DAO_2; ENDIF;
IF Tmp > 100 THEN DATA := 100;
ELSIF Tmp < 0 THEN DATA := 0;
ELSE DATA := Tmp * 100; ENDIF;
);
DATA[15] <- RWORD(
IF NoChange THEN Tmp := AO_3;
ELSE Tmp := DAO_3; ENDIF;
IF Tmp > 100 THEN DATA := 100;
ELSIF Tmp < 0 THEN DATA := 0;
ELSE DATA := Tmp * 100; 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.