IMSE MxA12
Detaljer
- Typ
- Drivrutin
- Upplaggd av
- Daniel Carlson, Abelko Innovation
- Version
- 4
- Uppdaterad
- 2016-11-02
- Skapad
- 2016-03-15
- Kategori
- IO enheter, Modbus
- Visningar
- 4288
Beskrivning
Typdefinition för Abelkos expansionsmodul MxA28 som ingår IMSE-familjen. Detta skript används då modulen kopplas som en modbus-enhet.
Modulen har 8 universalingångar och 4 analoga utgångar
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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for IMSE ExA12
%
% Settings module:
% Parity: None
% Baud: 38400
% Mode: RTU
%
% Factory default
% Address: 1
%
% Author: Daniel Carlson, ABELKO AB Luleå
%
% History: 2015-10-12 initial version
%
DEVICETYPE IMSE_MxA12 NAMED "IMSE_MxA12" TYPEID 21466 IS
PARAMETER
%%%%%%%%%%%%%%%%%%%%%%
% Address of this unit
Addr: "Address" [""] INT
| (sv) "Adress"
| (en) "Address"
| (MENU) "YES";
%%%%%%%%%%%%%%%%%%%%%%%
% Communication timeout
ComTimeout: "Com timeout" [""] INT
| (sv) "Kommunikationstimeout"
| (en) "Communication timeout"
| (MENU) "YES";
%%%%%%%%%%%%%%%%%%%%%%
% Universal input type
UI1_Type: "UI1_Type" ["Ohm,Volt,mA,DI"] ENUM
| (sv) "UI1 Typ av mätning"
| (en) "UI1 Measurement type"
| (NODE) "UI1"
| (MENU) "YES";
UI2_Type: "UI2_Type" ["Ohm,Volt,mA,DI"] ENUM
| (sv) "UI2 Typ av mätning"
| (en) "UI2 Measurement type"
| (NODE) "UI2"
| (MENU) "YES";
UI3_Type: "UI3_Type" ["Ohm,Volt,mA,DI"] ENUM
| (sv) "UI3 Typ av mätning"
| (en) "UI3 Measurement type"
| (NODE) "UI3"
| (MENU) "YES";
UI4_Type: "UI4_Type" ["Ohm,Volt,mA,DI"] ENUM
| (sv) "UI4 Typ av mätning"
| (en) "UI4 Measurement type"
| (NODE) "UI4"
| (MENU) "YES";
UI5_Type: "UI5_Type" ["Ohm,Volt,mA,DI"] ENUM
| (sv) "UI5 Typ av mätning"
| (en) "UI5 Measurement type"
| (NODE) "UI5"
| (MENU) "YES";
UI6_Type: "UI6_Type" ["Ohm,Volt,mA,DI"] ENUM
| (sv) "UI6 Typ av mätning"
| (en) "UI6 Measurement type"
| (NODE) "UI6"
| (MENU) "YES";
UI7_Type: "UI7_Type" ["Ohm,Volt,mA,DI"] ENUM
| (sv) "UI7 Typ av mätning"
| (en) "UI7 Measurement type"
| (NODE) "UI7"
| (MENU) "YES";
UI8_Type: "UI8_Type" ["Ohm,Volt,mA,DI"] ENUM
| (sv) "UI8 Typ av mätning"
| (en) "UI8 Measurement type"
| (NODE) "UI8"
| (MENU) "YES";
%%%%%%%%%%%%%%%%
% Resistor Range
UI1_Range : "UI1_Range " ["Auto,250,2500,25000,250000"] ENUM
| (sv) "UI1 Mätområde"
| (en) "UI1 Measurement range"
| (NODE) "UI1"
| (MENU) "COND, UI1_Type, =, 0";
UI2_Range : "UI2_Range " ["Auto,250,2500,25000,250000"] ENUM
| (sv) "UI2 Mätområde"
| (en) "UI2 Measurement range"
| (NODE) "UI2"
| (MENU) "COND, UI2_Type, =, 0";
UI3_Range : "UI3_Range " ["Auto,250,2500,25000,250000"] ENUM
| (sv) "UI3 Mätområde"
| (en) "UI3 Measurement range"
| (NODE) "UI3"
| (MENU) "COND, UI3_Type, =, 0";
UI4_Range : "UI4_Range " ["Auto,250,2500,25000,250000"] ENUM
| (sv) "UI4 Mätområde"
| (en) "UI4 Measurement range"
| (NODE) "UI4"
| (MENU) "COND, UI4_Type, =, 0";
UI5_Range : "UI5_Range " ["Auto,250,2500,25000,250000"] ENUM
| (sv) "UI5 Mätområde"
| (en) "UI5 Measurement range"
| (NODE) "UI5"
| (MENU) "COND, UI5_Type, =, 0";
UI6_Range : "UI6_Range " ["Auto,250,2500,25000,250000"] ENUM
| (sv) "UI6 Mätområde"
| (en) "UI6 Measurement range"
| (NODE) "UI6"
| (MENU) "COND, UI6_Type, =, 0";
UI7_Range : "UI7_Range " ["Auto,250,2500,25000,250000"] ENUM
| (sv) "UI7 Mätområde"
| (en) "UI7 Measurement range"
| (NODE) "UI7"
| (MENU) "COND, UI7_Type, =, 0";
UI8_Range : "UI8_Range " ["Auto,250,2500,25000,250000"] ENUM
| (sv) "UI8 Mätområde"
| (en) "UI8 Measurement range"
| (NODE) "UI8"
| (MENU) "COND, UI8_Type, =, 0";
%%%%%%%%%%%%%%%
% Analog output
AO1: "AO1" ["V"] DEC2
| (sv) "AO1"
| (en) "AO1"
| (NODE) "AO1";
AO2: "AO2" ["V"] DEC2
| (sv) "AO2"
| (en) "AO2"
| (NODE) "AO2";
AO3: "AO3" ["V"] DEC2
| (sv) "AO3"
| (en) "AO3"
| (NODE) "AO3";
AO4: "AO4" ["V"] DEC2
| (sv) "AO4"
| (en) "AO4"
| (NODE) "AO4";
PUBLIC
%%%%%%%%%%%%%%%%%%%%%%%
% Cable sequence number
CSN: "CSN" [""] INT
| (sv) "Kabelsekvensnummer"
| (en) "Cable sequence number"
| (MENU) "YES";
%%%%%%%%%%%%%%%%%%%%%%%
% Universal input value
UI1 : "UI1" [""] DEC2
| (sv) "UI1"
| (en) "UI1"
| (NODE) "UI1"
| (MUNIT) "IOC, UI1_Type"
| (RANGE) "IOC, UI1_Type, SRV, UI1_Range, R, 0-10, R, 0-20, R, 0/1";
UI2 : "UI2" [""] DEC2
| (sv) "UI2"
| (en) "UI2"
| (NODE) "UI2"
| (MUNIT) "IOC, UI2_Type"
| (RANGE) "IOC, UI2_Type, SRV, UI2_Range, R, 0-10, R, 0-20, R, 0/1";
UI3 : "UI3" [""] DEC2
| (sv) "UI3"
| (en) "UI3"
| (NODE) "UI3"
| (MUNIT) "IOC, UI3_Type"
| (RANGE) "IOC, UI3_Type, SRV, UI3_Range, R, 0-10, R, 0-20, R, 0/1";
UI4 : "UI4" [""] DEC2
| (sv) "UI4"
| (en) "UI4"
| (NODE) "UI4"
| (MUNIT) "IOC, UI4_Type"
| (RANGE) "IOC, UI4_Type, SRV, UI4_Range, R, 0-10, R, 0-20, R, 0/1";
UI5 : "UI5" [""] DEC2
| (sv) "UI5"
| (en) "UI5"
| (NODE) "UI5"
| (MUNIT) "IOC, UI5_Type"
| (RANGE) "IOC, UI5_Type, SRV, UI5_Range, R, 0-10, R, 0-20, R, 0/1";
UI6 : "UI6" [""] DEC2
| (sv) "UI6"
| (en) "UI6"
| (NODE) "UI6"
| (MUNIT) "IOC, UI6_Type"
| (RANGE) "IOC, UI6_Type, SRV, UI6_Range, R, 0-10, R, 0-20, R, 0/1";
UI7 : "UI7" [""] DEC2
| (sv) "UI7"
| (en) "UI7"
| (NODE) "UI7"
| (MUNIT) "IOC, UI7_Type"
| (RANGE) "IOC, UI7_Type, SRV, UI7_Range, R, 0-10, R, 0-20, R, 0/1";
UI8 : "UI8" [""] DEC2
| (sv) "UI8"
| (en) "UI8"
| (NODE) "UI8"
| (MUNIT) "IOC, UI8_Type"
| (RANGE) "IOC, UI8_Type, SRV, UI8_Range, R, 0-10, R, 0-20, R, 0/1";
%%%%%%%%%%%%%%%%%%%%%%%%
% Universal input status
UI1_Status : "UI1 Status" [""] INT
| (sv) "UI1 Status"
| (en) "UI1 Status"
| (NODE) "UI1";
UI2_Status : "UI2 Status" [""] INT
| (sv) "UI2 Status"
| (en) "UI2 Status"
| (NODE) "UI2";
UI3_Status : "UI3 Status" [""] INT
| (sv) "UI3 Status"
| (en) "UI3 Status"
| (NODE) "UI3";
UI4_Status : "UI4 Status" [""] INT
| (sv) "UI4 Status"
| (en) "UI4 Status"
| (NODE) "UI4";
UI5_Status : "UI5 Status" [""] INT
| (sv) "UI5 Status"
| (en) "UI5 Status"
| (NODE) "UI5";
UI6_Status : "UI6 Status" [""] INT
| (sv) "UI6 Status"
| (en) "UI6 Status"
| (NODE) "UI6";
UI7_Status : "UI7 Status" [""] INT
| (sv) "UI7 Status"
| (en) "UI7 Status"
| (NODE) "UI7";
UI8_Status : "UI8 Status" [""] INT
| (sv) "UI8 Status"
| (en) "UI8 Status"
| (NODE) "UI8";
%%%%%%%%%%%%%
% AO Override
AO1_Overridden : "AO1 Manually overriden" [""] DEC2
| (sv) "AO1 Manuelt styrd"
| (en) "AO1 Manually overriden"
| (NODE) "AO1";
AO2_Overridden : "AO2 Manually overriden" [""] DEC2
| (sv) "AO2 Manuelt styrd"
| (en) "AO2 Manually overriden"
| (NODE) "AO2";
AO3_Overridden : "AO3 Manually overriden" [""] DEC2
| (sv) "AO3 Manuelt styrd"
| (en) "AO3 Manually overriden"
| (NODE) "AO3";
AO4_Overridden : "AO4 Manually overriden" [""] DEC2
| (sv) "AO4 Manuelt styrd"
| (en) "AO4 Manually overriden"
| (NODE) "AO4";
PRIVATE
BAUDRATE 38400;
CHECKSUM MODBUS SWAPPED;
TELEGRAM SetComTimeout NAMED "SetCommunicationTimeout"
| (sv) "Ställ kommunikationstimeout"
| (en) "Set Communication timeout"
IS
QUESTION
DATA[0] := BYTE(Addr); % Modbus unit address
DATA[1] := BYTE(6); % Modbus command "6" write single register
DATA[2] := RWORD(33); % Start register
DATA[4] := RWORD(ComTimeout);
ANSWER SIZE 8
DATA[0] = BYTE(Addr);
DATA[1] = BYTE(6);
DATA[2] = RWORD(33);
TIMEOUT 300
END;
TELEGRAM SetUISettings NAMED "SetUISettings"
| (sv) "Ställ UI-inställningar"
| (en) "Set UI settings"
IS
QUESTION
DATA[0] := BYTE(Addr); % Modbus unit address
DATA[1] := BYTE(16); % Modbus command "16" write multiple registers
DATA[2] := RWORD(34); % Start register
DATA[4] := RWORD(8); % Number of registers to write
DATA[6] := BYTE(16); % Numer of bytes of data, two for each DO
DATA[7] := RWORD(UI1_Type*64 + UI1_Range);
DATA[9] := RWORD(UI2_Type*64 + UI2_Range);
DATA[11] := RWORD(UI3_Type*64 + UI3_Range);
DATA[13] := RWORD(UI4_Type*64 + UI4_Range);
DATA[15] := RWORD(UI5_Type*64 + UI5_Range);
DATA[17] := RWORD(UI6_Type*64 + UI6_Range);
DATA[19] := RWORD(UI7_Type*64 + UI7_Range);
DATA[21] := RWORD(UI8_Type*64 + UI8_Range);
ANSWER SIZE 8
DATA[0] = BYTE(Addr);
DATA[1] = BYTE(16);
DATA[2] = RWORD(34);
DATA[4] = RWORD(8);
TIMEOUT 300
END;
TELEGRAM SetAO1_6 NAMED "SetAO1-4"
| (sv) "Ställ AO1-AO4"
| (en) "Set AO1-AO4"
IS
QUESTION
DATA[0] := BYTE(Addr); % Modbus unit address
DATA[1] := BYTE(16); % Modbus command "16" write multiple registers
DATA[2] := RWORD(42); % Start register
DATA[4] := RWORD(8); % Number of registers to write
DATA[6] := BYTE(16); % Numer of bytes of data, two for each AO
DATA[7] := RINT32(AO1 * 1000);
DATA[11] := RINT32(AO2 * 1000);
DATA[15] := RINT32(AO3 * 1000);
DATA[19] := RINT32(AO4 * 1000);
ANSWER SIZE 8
DATA[0] = BYTE(Addr);
DATA[1] = BYTE(16);
DATA[2] = RWORD(42);
DATA[4] = RWORD(8);
TIMEOUT 300
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Telegrams used for getting values from the unit
TELEGRAM GetCSN NAMED "GetCSN"
| (sv) "Hämta kabelsekvensnummer"
| (en) "Get cable sequence number"
IS
QUESTION
DATA[0] := BYTE(Addr); % Modbus unit address
DATA[1] := BYTE(3); % Modbus command "03h" read multiple registers
DATA[2] := RWORD(0); % Start register
DATA[4] := RWORD(1); % Number of registers to read
ANSWER SIZE 7
DATA[0] = BYTE(Addr); % Modbus unit address
DATA[1] = BYTE(3); % Modbus command "03h" read multiple registers
DATA[2] = BYTE(2) ; % Numer of bytes of data
CSN := RWORD[3];
TIMEOUT 300
END;
TELEGRAM GetUI1_8 NAMED "GetUI1_8"
| (sv) "Hämta UI1-UI8"
| (en) "Get UI1-UI8"
IS
QUESTION
DATA[0] := BYTE(Addr); % Modbus unit address
DATA[1] := BYTE(3); % Modbus command "03h" read multiple registers
DATA[2] := RWORD(1); % Start register
DATA[4] := RWORD(16); % Number of registers to read
ANSWER SIZE 37
DATA[0] = BYTE(Addr); % Modbus unit address
DATA[1] = BYTE(3); % Modbus command "03h" read multiple registers
DATA[2] = BYTE(32); % Numer of bytes of data
UI1 := RINT32[3] / 1000;
UI2 := RINT32[7] / 1000;
UI3 := RINT32[11] / 1000;
UI4 := RINT32[15] / 1000;
UI5 := RINT32[19] / 1000;
UI6 := RINT32[23] / 1000;
UI7 := RINT32[27] / 1000;
UI8 := RINT32[31] / 1000;
TIMEOUT 300
END;
TELEGRAM GetUI1_8Status NAMED "GetUI1_8Status"
| (sv) "Hämta status för UI1-UI8"
| (en) "Get UI1-UI8 status"
IS
QUESTION
DATA[0] := BYTE(Addr); % Modbus unit address
DATA[1] := BYTE(3); % Modbus command "03h" read multiple registers
DATA[2] := RWORD(17); % Start register
DATA[4] := RWORD(8); % Number of registers to read
ANSWER SIZE 21
DATA[0] = BYTE(Addr); % Modbus unit address
DATA[1] = BYTE(3); % Modbus command "03h" read multiple registers
DATA[2] = BYTE(16); % Numer of bytes of data
UI1_Status := RWORD[3];
UI2_Status := RWORD[5];
UI3_Status := RWORD[7];
UI4_Status := RWORD[9];
UI5_Status := RWORD[11];
UI6_Status := RWORD[13];
UI7_Status := RWORD[15];
UI8_Status := RWORD[17];
TIMEOUT 300
END;
TELEGRAM GetAO1_6Status NAMED "GetAO1_4Status"
| (sv) "Hämta status för AO1-AO4"
| (en) "Get AO1-AO4 status"
IS
QUESTION
DATA[0] := BYTE(Addr); % Modbus unit address
DATA[1] := BYTE(3); % Modbus command "03h" read multiple registers
DATA[2] := RWORD(25); % Start register
DATA[4] := RWORD(8); % Number of registers to read
ANSWER SIZE 21
DATA[0] = BYTE(Addr); % Modbus unit address
DATA[1] = BYTE(3); % Modbus command "03h" read multiple registers
DATA[2] = BYTE(16); % Numer of bytes of data
AO1_Overridden := RINT32[3] / 1000;
AO2_Overridden := RINT32[7] / 1000;
AO3_Overridden := RINT32[11] / 1000;
AO4_Overridden := RINT32[15] / 1000;
TIMEOUT 300
END;
END;
% Device definition for IMSE ExA12
%
% Settings module:
% Parity: None
% Baud: 38400
% Mode: RTU
%
% Factory default
% Address: 1
%
% Author: Daniel Carlson, ABELKO AB Luleå
%
% History: 2015-10-12 initial version
%
DEVICETYPE IMSE_MxA12 NAMED "IMSE_MxA12" TYPEID 21466 IS
PARAMETER
%%%%%%%%%%%%%%%%%%%%%%
% Address of this unit
Addr: "Address" [""] INT
| (sv) "Adress"
| (en) "Address"
| (MENU) "YES";
%%%%%%%%%%%%%%%%%%%%%%%
% Communication timeout
ComTimeout: "Com timeout" [""] INT
| (sv) "Kommunikationstimeout"
| (en) "Communication timeout"
| (MENU) "YES";
%%%%%%%%%%%%%%%%%%%%%%
% Universal input type
UI1_Type: "UI1_Type" ["Ohm,Volt,mA,DI"] ENUM
| (sv) "UI1 Typ av mätning"
| (en) "UI1 Measurement type"
| (NODE) "UI1"
| (MENU) "YES";
UI2_Type: "UI2_Type" ["Ohm,Volt,mA,DI"] ENUM
| (sv) "UI2 Typ av mätning"
| (en) "UI2 Measurement type"
| (NODE) "UI2"
| (MENU) "YES";
UI3_Type: "UI3_Type" ["Ohm,Volt,mA,DI"] ENUM
| (sv) "UI3 Typ av mätning"
| (en) "UI3 Measurement type"
| (NODE) "UI3"
| (MENU) "YES";
UI4_Type: "UI4_Type" ["Ohm,Volt,mA,DI"] ENUM
| (sv) "UI4 Typ av mätning"
| (en) "UI4 Measurement type"
| (NODE) "UI4"
| (MENU) "YES";
UI5_Type: "UI5_Type" ["Ohm,Volt,mA,DI"] ENUM
| (sv) "UI5 Typ av mätning"
| (en) "UI5 Measurement type"
| (NODE) "UI5"
| (MENU) "YES";
UI6_Type: "UI6_Type" ["Ohm,Volt,mA,DI"] ENUM
| (sv) "UI6 Typ av mätning"
| (en) "UI6 Measurement type"
| (NODE) "UI6"
| (MENU) "YES";
UI7_Type: "UI7_Type" ["Ohm,Volt,mA,DI"] ENUM
| (sv) "UI7 Typ av mätning"
| (en) "UI7 Measurement type"
| (NODE) "UI7"
| (MENU) "YES";
UI8_Type: "UI8_Type" ["Ohm,Volt,mA,DI"] ENUM
| (sv) "UI8 Typ av mätning"
| (en) "UI8 Measurement type"
| (NODE) "UI8"
| (MENU) "YES";
%%%%%%%%%%%%%%%%
% Resistor Range
UI1_Range : "UI1_Range " ["Auto,250,2500,25000,250000"] ENUM
| (sv) "UI1 Mätområde"
| (en) "UI1 Measurement range"
| (NODE) "UI1"
| (MENU) "COND, UI1_Type, =, 0";
UI2_Range : "UI2_Range " ["Auto,250,2500,25000,250000"] ENUM
| (sv) "UI2 Mätområde"
| (en) "UI2 Measurement range"
| (NODE) "UI2"
| (MENU) "COND, UI2_Type, =, 0";
UI3_Range : "UI3_Range " ["Auto,250,2500,25000,250000"] ENUM
| (sv) "UI3 Mätområde"
| (en) "UI3 Measurement range"
| (NODE) "UI3"
| (MENU) "COND, UI3_Type, =, 0";
UI4_Range : "UI4_Range " ["Auto,250,2500,25000,250000"] ENUM
| (sv) "UI4 Mätområde"
| (en) "UI4 Measurement range"
| (NODE) "UI4"
| (MENU) "COND, UI4_Type, =, 0";
UI5_Range : "UI5_Range " ["Auto,250,2500,25000,250000"] ENUM
| (sv) "UI5 Mätområde"
| (en) "UI5 Measurement range"
| (NODE) "UI5"
| (MENU) "COND, UI5_Type, =, 0";
UI6_Range : "UI6_Range " ["Auto,250,2500,25000,250000"] ENUM
| (sv) "UI6 Mätområde"
| (en) "UI6 Measurement range"
| (NODE) "UI6"
| (MENU) "COND, UI6_Type, =, 0";
UI7_Range : "UI7_Range " ["Auto,250,2500,25000,250000"] ENUM
| (sv) "UI7 Mätområde"
| (en) "UI7 Measurement range"
| (NODE) "UI7"
| (MENU) "COND, UI7_Type, =, 0";
UI8_Range : "UI8_Range " ["Auto,250,2500,25000,250000"] ENUM
| (sv) "UI8 Mätområde"
| (en) "UI8 Measurement range"
| (NODE) "UI8"
| (MENU) "COND, UI8_Type, =, 0";
%%%%%%%%%%%%%%%
% Analog output
AO1: "AO1" ["V"] DEC2
| (sv) "AO1"
| (en) "AO1"
| (NODE) "AO1";
AO2: "AO2" ["V"] DEC2
| (sv) "AO2"
| (en) "AO2"
| (NODE) "AO2";
AO3: "AO3" ["V"] DEC2
| (sv) "AO3"
| (en) "AO3"
| (NODE) "AO3";
AO4: "AO4" ["V"] DEC2
| (sv) "AO4"
| (en) "AO4"
| (NODE) "AO4";
PUBLIC
%%%%%%%%%%%%%%%%%%%%%%%
% Cable sequence number
CSN: "CSN" [""] INT
| (sv) "Kabelsekvensnummer"
| (en) "Cable sequence number"
| (MENU) "YES";
%%%%%%%%%%%%%%%%%%%%%%%
% Universal input value
UI1 : "UI1" [""] DEC2
| (sv) "UI1"
| (en) "UI1"
| (NODE) "UI1"
| (MUNIT) "IOC, UI1_Type"
| (RANGE) "IOC, UI1_Type, SRV, UI1_Range, R, 0-10, R, 0-20, R, 0/1";
UI2 : "UI2" [""] DEC2
| (sv) "UI2"
| (en) "UI2"
| (NODE) "UI2"
| (MUNIT) "IOC, UI2_Type"
| (RANGE) "IOC, UI2_Type, SRV, UI2_Range, R, 0-10, R, 0-20, R, 0/1";
UI3 : "UI3" [""] DEC2
| (sv) "UI3"
| (en) "UI3"
| (NODE) "UI3"
| (MUNIT) "IOC, UI3_Type"
| (RANGE) "IOC, UI3_Type, SRV, UI3_Range, R, 0-10, R, 0-20, R, 0/1";
UI4 : "UI4" [""] DEC2
| (sv) "UI4"
| (en) "UI4"
| (NODE) "UI4"
| (MUNIT) "IOC, UI4_Type"
| (RANGE) "IOC, UI4_Type, SRV, UI4_Range, R, 0-10, R, 0-20, R, 0/1";
UI5 : "UI5" [""] DEC2
| (sv) "UI5"
| (en) "UI5"
| (NODE) "UI5"
| (MUNIT) "IOC, UI5_Type"
| (RANGE) "IOC, UI5_Type, SRV, UI5_Range, R, 0-10, R, 0-20, R, 0/1";
UI6 : "UI6" [""] DEC2
| (sv) "UI6"
| (en) "UI6"
| (NODE) "UI6"
| (MUNIT) "IOC, UI6_Type"
| (RANGE) "IOC, UI6_Type, SRV, UI6_Range, R, 0-10, R, 0-20, R, 0/1";
UI7 : "UI7" [""] DEC2
| (sv) "UI7"
| (en) "UI7"
| (NODE) "UI7"
| (MUNIT) "IOC, UI7_Type"
| (RANGE) "IOC, UI7_Type, SRV, UI7_Range, R, 0-10, R, 0-20, R, 0/1";
UI8 : "UI8" [""] DEC2
| (sv) "UI8"
| (en) "UI8"
| (NODE) "UI8"
| (MUNIT) "IOC, UI8_Type"
| (RANGE) "IOC, UI8_Type, SRV, UI8_Range, R, 0-10, R, 0-20, R, 0/1";
%%%%%%%%%%%%%%%%%%%%%%%%
% Universal input status
UI1_Status : "UI1 Status" [""] INT
| (sv) "UI1 Status"
| (en) "UI1 Status"
| (NODE) "UI1";
UI2_Status : "UI2 Status" [""] INT
| (sv) "UI2 Status"
| (en) "UI2 Status"
| (NODE) "UI2";
UI3_Status : "UI3 Status" [""] INT
| (sv) "UI3 Status"
| (en) "UI3 Status"
| (NODE) "UI3";
UI4_Status : "UI4 Status" [""] INT
| (sv) "UI4 Status"
| (en) "UI4 Status"
| (NODE) "UI4";
UI5_Status : "UI5 Status" [""] INT
| (sv) "UI5 Status"
| (en) "UI5 Status"
| (NODE) "UI5";
UI6_Status : "UI6 Status" [""] INT
| (sv) "UI6 Status"
| (en) "UI6 Status"
| (NODE) "UI6";
UI7_Status : "UI7 Status" [""] INT
| (sv) "UI7 Status"
| (en) "UI7 Status"
| (NODE) "UI7";
UI8_Status : "UI8 Status" [""] INT
| (sv) "UI8 Status"
| (en) "UI8 Status"
| (NODE) "UI8";
%%%%%%%%%%%%%
% AO Override
AO1_Overridden : "AO1 Manually overriden" [""] DEC2
| (sv) "AO1 Manuelt styrd"
| (en) "AO1 Manually overriden"
| (NODE) "AO1";
AO2_Overridden : "AO2 Manually overriden" [""] DEC2
| (sv) "AO2 Manuelt styrd"
| (en) "AO2 Manually overriden"
| (NODE) "AO2";
AO3_Overridden : "AO3 Manually overriden" [""] DEC2
| (sv) "AO3 Manuelt styrd"
| (en) "AO3 Manually overriden"
| (NODE) "AO3";
AO4_Overridden : "AO4 Manually overriden" [""] DEC2
| (sv) "AO4 Manuelt styrd"
| (en) "AO4 Manually overriden"
| (NODE) "AO4";
PRIVATE
BAUDRATE 38400;
CHECKSUM MODBUS SWAPPED;
TELEGRAM SetComTimeout NAMED "SetCommunicationTimeout"
| (sv) "Ställ kommunikationstimeout"
| (en) "Set Communication timeout"
IS
QUESTION
DATA[0] := BYTE(Addr); % Modbus unit address
DATA[1] := BYTE(6); % Modbus command "6" write single register
DATA[2] := RWORD(33); % Start register
DATA[4] := RWORD(ComTimeout);
ANSWER SIZE 8
DATA[0] = BYTE(Addr);
DATA[1] = BYTE(6);
DATA[2] = RWORD(33);
TIMEOUT 300
END;
TELEGRAM SetUISettings NAMED "SetUISettings"
| (sv) "Ställ UI-inställningar"
| (en) "Set UI settings"
IS
QUESTION
DATA[0] := BYTE(Addr); % Modbus unit address
DATA[1] := BYTE(16); % Modbus command "16" write multiple registers
DATA[2] := RWORD(34); % Start register
DATA[4] := RWORD(8); % Number of registers to write
DATA[6] := BYTE(16); % Numer of bytes of data, two for each DO
DATA[7] := RWORD(UI1_Type*64 + UI1_Range);
DATA[9] := RWORD(UI2_Type*64 + UI2_Range);
DATA[11] := RWORD(UI3_Type*64 + UI3_Range);
DATA[13] := RWORD(UI4_Type*64 + UI4_Range);
DATA[15] := RWORD(UI5_Type*64 + UI5_Range);
DATA[17] := RWORD(UI6_Type*64 + UI6_Range);
DATA[19] := RWORD(UI7_Type*64 + UI7_Range);
DATA[21] := RWORD(UI8_Type*64 + UI8_Range);
ANSWER SIZE 8
DATA[0] = BYTE(Addr);
DATA[1] = BYTE(16);
DATA[2] = RWORD(34);
DATA[4] = RWORD(8);
TIMEOUT 300
END;
TELEGRAM SetAO1_6 NAMED "SetAO1-4"
| (sv) "Ställ AO1-AO4"
| (en) "Set AO1-AO4"
IS
QUESTION
DATA[0] := BYTE(Addr); % Modbus unit address
DATA[1] := BYTE(16); % Modbus command "16" write multiple registers
DATA[2] := RWORD(42); % Start register
DATA[4] := RWORD(8); % Number of registers to write
DATA[6] := BYTE(16); % Numer of bytes of data, two for each AO
DATA[7] := RINT32(AO1 * 1000);
DATA[11] := RINT32(AO2 * 1000);
DATA[15] := RINT32(AO3 * 1000);
DATA[19] := RINT32(AO4 * 1000);
ANSWER SIZE 8
DATA[0] = BYTE(Addr);
DATA[1] = BYTE(16);
DATA[2] = RWORD(42);
DATA[4] = RWORD(8);
TIMEOUT 300
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Telegrams used for getting values from the unit
TELEGRAM GetCSN NAMED "GetCSN"
| (sv) "Hämta kabelsekvensnummer"
| (en) "Get cable sequence number"
IS
QUESTION
DATA[0] := BYTE(Addr); % Modbus unit address
DATA[1] := BYTE(3); % Modbus command "03h" read multiple registers
DATA[2] := RWORD(0); % Start register
DATA[4] := RWORD(1); % Number of registers to read
ANSWER SIZE 7
DATA[0] = BYTE(Addr); % Modbus unit address
DATA[1] = BYTE(3); % Modbus command "03h" read multiple registers
DATA[2] = BYTE(2) ; % Numer of bytes of data
CSN := RWORD[3];
TIMEOUT 300
END;
TELEGRAM GetUI1_8 NAMED "GetUI1_8"
| (sv) "Hämta UI1-UI8"
| (en) "Get UI1-UI8"
IS
QUESTION
DATA[0] := BYTE(Addr); % Modbus unit address
DATA[1] := BYTE(3); % Modbus command "03h" read multiple registers
DATA[2] := RWORD(1); % Start register
DATA[4] := RWORD(16); % Number of registers to read
ANSWER SIZE 37
DATA[0] = BYTE(Addr); % Modbus unit address
DATA[1] = BYTE(3); % Modbus command "03h" read multiple registers
DATA[2] = BYTE(32); % Numer of bytes of data
UI1 := RINT32[3] / 1000;
UI2 := RINT32[7] / 1000;
UI3 := RINT32[11] / 1000;
UI4 := RINT32[15] / 1000;
UI5 := RINT32[19] / 1000;
UI6 := RINT32[23] / 1000;
UI7 := RINT32[27] / 1000;
UI8 := RINT32[31] / 1000;
TIMEOUT 300
END;
TELEGRAM GetUI1_8Status NAMED "GetUI1_8Status"
| (sv) "Hämta status för UI1-UI8"
| (en) "Get UI1-UI8 status"
IS
QUESTION
DATA[0] := BYTE(Addr); % Modbus unit address
DATA[1] := BYTE(3); % Modbus command "03h" read multiple registers
DATA[2] := RWORD(17); % Start register
DATA[4] := RWORD(8); % Number of registers to read
ANSWER SIZE 21
DATA[0] = BYTE(Addr); % Modbus unit address
DATA[1] = BYTE(3); % Modbus command "03h" read multiple registers
DATA[2] = BYTE(16); % Numer of bytes of data
UI1_Status := RWORD[3];
UI2_Status := RWORD[5];
UI3_Status := RWORD[7];
UI4_Status := RWORD[9];
UI5_Status := RWORD[11];
UI6_Status := RWORD[13];
UI7_Status := RWORD[15];
UI8_Status := RWORD[17];
TIMEOUT 300
END;
TELEGRAM GetAO1_6Status NAMED "GetAO1_4Status"
| (sv) "Hämta status för AO1-AO4"
| (en) "Get AO1-AO4 status"
IS
QUESTION
DATA[0] := BYTE(Addr); % Modbus unit address
DATA[1] := BYTE(3); % Modbus command "03h" read multiple registers
DATA[2] := RWORD(25); % Start register
DATA[4] := RWORD(8); % Number of registers to read
ANSWER SIZE 21
DATA[0] = BYTE(Addr); % Modbus unit address
DATA[1] = BYTE(3); % Modbus command "03h" read multiple registers
DATA[2] = BYTE(16); % Numer of bytes of data
AO1_Overridden := RINT32[3] / 1000;
AO2_Overridden := RINT32[7] / 1000;
AO3_Overridden := RINT32[11] / 1000;
AO4_Overridden := RINT32[15] / 1000;
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.