IMSE MxD8
Detaljer
- Typ
- Drivrutin
- Upplaggd av
- Daniel Carlson, Abelko Innovation
- Version
- 9
- Uppdaterad
- 2016-11-02
- Skapad
- 2015-01-15
- Kategori
- IO enheter, Modbus
- Visningar
- 4473
Beskrivning
Typdefinition för Abelkos expansionsmodul MxD8 som ingår IMSE-familjen. Detta skript används då modulen kopplas som en modbus-enhet.
Modulen har 4 digitala ingångar och 4 digitala relä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 MxD8
%
% Settings module:
% Parity: None
% Baud: 38400
% Mode: RTU
%
% Factory default
% Address: 1
%
% Author: Daniel Carlson, ABELKO AB Luleå
%
% History: 2014-04-07 DC initial version
% 2016-05-13 DC Munit added for counters and frequency
%
DEVICETYPE IMSE_MxD8 NAMED "IMSE_MxD8" TYPEID 21463 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";
%%%%%%%%%%%%%%%%
% Reset counters
DI1_CounterReset :"DI1 Reset counter" [""] INT
| (sv) "DI1 Nollställ räknare"
| (en) "DI1 Reset counter"
| (NODE) "DI1";
DI2_CounterReset :"DI2 Reset counter" [""] INT
| (sv) "DI2 Nollställ räknare"
| (en) "DI2 Reset counter"
| (NODE) "DI2";
DI3_CounterReset :"DI3 Reset counter" [""] INT
| (sv) "DI3 Nollställ räknare"
| (en) "DI3 Reset counter"
| (NODE) "DI3";
DI4_CounterReset :"DI4 Reset counter" [""] INT
| (sv) "DI4 Nollställ räknare"
| (en) "DI4 Reset counter"
| (NODE) "DI4";
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Reset counter overflow flag
DI1_OverflowFlagReset :"DI1 Reset overflow flag" [""] INT
| (sv) "DI1 Nollställ fullindikering"
| (en) "DI1 Reset overflow flag"
| (NODE) "DI1";
DI2_OverflowFlagReset :"DI2 Reset overflow flag" [""] INT
| (sv) "DI2 Nollställ fullindikering"
| (en) "DI2 Reset overflow flag"
| (NODE) "DI2";
DI3_OverflowFlagReset :"DI3 Reset overflow flag" [""] INT
| (sv) "DI3 Nollställ fullindikering"
| (en) "DI3 Reset overflow flag"
| (NODE) "DI3";
DI4_OverflowFlagReset :"DI4 Reset overflow flag" [""] INT
| (sv) "DI4 Nollställ fullindikering"
| (en) "DI4 Reset overflow flag"
| (NODE) "DI4";
%%%%%%%%%%%%%%%%
% Flank Settings
DI1_FlankSettings: "DI1 Pulse edge" ["Positiv,Negativ,Båda"] ENUM
| (sv) "DI1 Flankinställning"
| (en) "DI1 Flank setting"
| (NODE) "DI1"
| (MENU) "YES";
DI2_FlankSettings: "DI2 Pulse edge" ["Positiv,Negativ,Båda"] ENUM
| (sv) "DI2 Flankinställning"
| (en) "DI2 Flank setting"
| (NODE) "DI2"
| (MENU) "YES";
DI3_FlankSettings: "DI3 Pulse edge" ["Positiv,Negativ,Båda"] ENUM
| (sv) "DI3 Flankinställning"
| (en) "DI3 Flank setting"
| (NODE) "DI3"
| (MENU) "YES";
DI4_FlankSettings: "DI4 Pulse edge" ["Positiv,Negativ,Båda"] ENUM
| (sv) "DI4 Flankinställning"
| (en) "DI4 Flank setting"
| (NODE) "DI4"
| (MENU) "YES";
%%%%%%%%%%%%%%
% Trip voltage
DI_TripVoltage: "DI Trip voltage" ["10V,4V"] ENUM
| (sv) "DI Omslagsspänning"
| (en) "DI Trip voltage"
| (MENU) "YES";
%%%%%%%%%%%%%%%%
% Digital output
DO1: "DO1" [""] INT
| (sv) "DO1"
| (en) "DO1"
| (NODE) "DO1";
DO2: "DO2" [""] INT
| (sv) "DO2"
| (en) "DO2"
| (NODE) "DO2";
DO3: "DO3" [""] INT
| (sv) "DO3"
| (en) "DO3"
| (NODE) "DO3";
DO4: "DO4" [""] INT
| (sv) "DO4"
| (en) "DO4"
| (NODE) "DO4";
PUBLIC
%%%%%%%%%%%%%%%%%%%%%%%
% Cable sequence number
CSN: "CSN" [""] INT
| (sv) "Kabelsekvensnummer"
| (en) "Cable sequence number"
| (MENU) "YES";
%%%%%%%%%%%%%%%
% Digital input
DI1 :"DI1" [""] INT
| (sv) "DI1"
| (en) "DI1"
| (NODE) "DI1";
DI2 :"DI2" [""] INT
| (sv) "DI2"
| (en) "DI2"
| (NODE) "DI2";
DI3 :"DI3" [""] INT
| (sv) "DI3"
| (en) "DI3"
| (NODE) "DI3";
DI4 :"DI4" [""] INT
| (sv) "DI4"
| (en) "DI4"
| (NODE) "DI4";
%%%%%%%%%%%
% Frequency
DI1_Freq :"DI1 Frequency" ["Hz"] FLOAT
| (sv) "DI1 Frekvens"
| (en) "DI1 Frequency"
| (NODE) "DI1"
| (MUNIT) "Hertz"
| (RANGE) "0-200";
DI2_Freq :"DI2 Frequency" ["Hz"] FLOAT
| (sv) "DI2 Frekvens"
| (en) "DI2 Frequency"
| (NODE) "DI2"
| (MUNIT) "Hertz"
| (RANGE) "0-200";
DI3_Freq :"DI3 Frequency" ["Hz"] FLOAT
| (sv) "DI3 Frekvens"
| (en) "DI3 Frequency"
| (NODE) "DI3"
| (MUNIT) "Hertz"
| (RANGE) "0-200";
DI4_Freq :"DI4 Frequency" ["Hz"] FLOAT
| (sv) "DI4 Frekvens"
| (en) "DI4 Frequency"
| (NODE) "DI4"
| (MUNIT) "Hertz"
| (RANGE) "0-200";
%%%%%%%%%
% Counter
DI1_Counter :"DI1 Counter" [""] INT
| (sv) "DI1 Räknare"
| (en) "DI1 Counter"
| (NODE) "DI1"
| (MUNIT) "pulses";
DI2_Counter :"DI2 Counter" [""] INT
| (sv) "DI2 Räknare"
| (en) "DI2 Counter"
| (NODE) "DI2"
| (MUNIT) "pulses";
DI3_Counter :"DI3 Counter" [""] INT
| (sv) "DI3 Räknare"
| (en) "DI3 Counter"
| (NODE) "DI3"
| (MUNIT) "pulses";
DI4_Counter :"DI4 Counter" [""] INT
| (sv) "DI4 Räknare"
| (en) "DI4 Counter"
| (NODE) "DI4"
| (MUNIT) "pulses";
%%%%%%%%%%%%%%%%%%
% Counter overflow
DI1_Overflow :"DI1 Counter Overflow" [""] INT
| (sv) "DI1 Räknare full"
| (en) "DI1 Counter overflow"
| (NODE) "DI1";
DI2_Overflow :"DI2 Counter Overflow" [""] INT
| (sv) "DI2 Räknare full"
| (en) "DI2 Counter overflow"
| (NODE) "DI2";
DI3_Overflow :"DI3 Counter Overflow" [""] INT
| (sv) "DI3 Räknare full"
| (en) "DI3 Counter overflow"
| (NODE) "DI3";
DI4_Overflow :"DI4 Counter Overflow" [""] INT
| (sv) "DI4 Räknare full"
| (en) "DI4 Counter overflow"
| (NODE) "DI4";
%%%%%%%%%%%%%%%
% Short circuit
DI_ShortCirc: "DI Short Circuit" [""] INT
| (sv) "DI Kortslutning"
| (en) "DI Short circuit"
| (MENU) "YES";
%%%%%%%%%%%%%
% DO Override
DO1_Overridden : "DO1 Manually overriden" [""] INT
| (sv) "DO1 Manuelt styrd"
| (en) "DO1 Manually overriden"
| (NODE) "DO1";
DO2_Overridden : "DO2 Manually overriden" [""] INT
| (sv) "DO2 Manuelt styrd"
| (en) "DO2 Manually overriden"
| (NODE) "DO2";
DO3_Overridden : "DO3 Manually overriden" [""] INT
| (sv) "DO3 Manuelt styrd"
| (en) "DO3 Manually overriden"
| (NODE) "DO3";
DO4_Overridden : "DO4 Manually overriden" [""] INT
| (sv) "DO4 Manuelt styrd"
| (en) "DO4 Manually overriden"
| (NODE) "DO4";
PRIVATE
BAUDRATE 38400;
CHECKSUM MODBUS SWAPPED;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Telegrams used for settting values in the unit
TELEGRAM SetDISettings NAMED "SetDISettings"
| (sv) "Ställ DI-inställningar"
| (en) "Set DI settings"
IS
QUESTION
DATA[0] := BYTE(Addr); % Modbus unit address
DATA[1] := BYTE(16); % Modbus command "16" write multiple registers
DATA[2] := RWORD(30); % Start register
DATA[4] := RWORD(5); % Number of registers to write
DATA[6] := BYTE(10); % Numer of bytes of data, two for each register
DATA[7] := RWORD(DI1_CounterReset + DI1_OverflowFlagReset*2 + DI1_FlankSettings*4);
DATA[9] := RWORD(DI2_CounterReset + DI2_OverflowFlagReset*2 + DI2_FlankSettings*4);
DATA[11] := RWORD(DI3_CounterReset + DI3_OverflowFlagReset*2 + DI3_FlankSettings*4);
DATA[13] := RWORD(DI4_CounterReset + DI4_OverflowFlagReset*2 + DI4_FlankSettings*4);
DATA[15] := RWORD(DI_TripVoltage);
ANSWER SIZE 8
DATA[0] = BYTE(Addr);
DATA[1] = BYTE(16);
DATA[2] = RWORD(30);
DATA[4] = RWORD(5);
TIMEOUT 300
END;
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(35); % Start register
DATA[4] := RWORD(ComTimeout);
ANSWER SIZE 8
DATA[0] = BYTE(Addr);
DATA[1] = BYTE(6);
DATA[2] = RWORD(35);
TIMEOUT 300
END;
TELEGRAM SetDO1_6 NAMED "SetDO1-4"
| (sv) "Ställ DO1-DO4"
| (en) "Set DO1-DO4"
IS
QUESTION
DATA[0] := BYTE(Addr); % Modbus unit address
DATA[1] := BYTE(16); % Modbus command "16" write multiple registers
DATA[2] := RWORD(36); % Start register
DATA[4] := RWORD(4); % Number of registers to write
DATA[6] := BYTE(8); % Numer of bytes of data, two for each DO
DATA[7] := RWORD(DO1);
DATA[9] := RWORD(DO2);
DATA[11] := RWORD(DO3);
DATA[13] := RWORD(DO4);
ANSWER SIZE 8
DATA[0] = BYTE(Addr);
DATA[1] = BYTE(16);
DATA[2] = RWORD(36);
DATA[4] = RWORD(4);
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 GetDI1_4 NAMED "GetDI1-4"
| (sv) "Hämta DI1-DI4"
| (en) "Get DI1-DI4"
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(4); % Number of registers to read
ANSWER SIZE 13
DATA[0] = BYTE(Addr); % Modbus unit address
DATA[1] = BYTE(3); % Modbus command "03h" read multiple registers
DATA[2] = BYTE(8); % Numer of bytes of data, two for each DI
DI1 := RWORD[3];
DI2 := RWORD[5];
DI3 := RWORD[7];
DI4 := RWORD[9];
TIMEOUT 300
END;
TELEGRAM GetFreqAndCounterDI1_4 NAMED "GetDI1-4FreqAndCounter"
| (sv) "Hämta frekvens och räknare för DI1-DI4"
| (en) "Get frequency and counter for DI1-DI4"
IS
QUESTION
DATA[0] := BYTE(Addr); % Modbus unit address
DATA[1] := BYTE(3); % Modbus command "03h" read multiple registers
DATA[2] := RWORD(5); % 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, two for each DI
DI1_Freq := RWORD32[3] / 1000;
DI2_Freq := RWORD32[7] / 1000;
DI3_Freq := RWORD32[11] / 1000;
DI4_Freq := RWORD32[15] / 1000;
DI1_Counter := RWORD32[19];
DI2_Counter := RWORD32[23];
DI3_Counter := RWORD32[27];
DI4_Counter := RWORD32[31];
TIMEOUT 300
END;
TELEGRAM GetDIStatus NAMED "GetDIStatus"
| (sv) "Hämta status för DI"
| (en) "Get DI status"
IS
QUESTION
DATA[0] := BYTE(Addr); % Modbus unit address
DATA[1] := BYTE(3); % Modbus command "03h" read multiple registers
DATA[2] := RWORD(21); % Start register
DATA[4] := RWORD(5); % Number of registers to read
ANSWER SIZE 15
DATA[0] = BYTE(Addr); % Modbus unit address
DATA[1] = BYTE(3); % Modbus command "03h" read multiple registers
DATA[2] = BYTE(10); % Numer of bytes of data
DI1_Overflow := RWORD[3];
DI2_Overflow := RWORD[5];
DI3_Overflow := RWORD[7];
DI4_Overflow := RWORD[9];
DI_ShortCirc := RWORD[11];
TIMEOUT 300
END;
TELEGRAM GetDOManualOverrideStatusIstatus NAMED "GetDOManualOverrideStatus"
| (sv) "Hämta status för manuell styrning av DO1-4"
| (en) "Get manual override status for DO1-4"
IS
QUESTION
DATA[0] := BYTE(Addr); % Modbus unit address
DATA[1] := BYTE(3); % Modbus command "03h" read multiple registers
DATA[2] := RWORD(26); % Start register
DATA[4] := RWORD(4); % Number of registers to read
ANSWER SIZE 13
DATA[0] = BYTE(Addr); % Modbus unit address
DATA[1] = BYTE(3); % Modbus command "03h" read multiple registers
DATA[2] = BYTE(8); % Numer of bytes of data
DO1_Overridden := RWORD[3];
DO2_Overridden := RWORD[5];
DO3_Overridden := RWORD[7];
DO4_Overridden := RWORD[9];
TIMEOUT 300
END;
END;
% Device definition for IMSE MxD8
%
% Settings module:
% Parity: None
% Baud: 38400
% Mode: RTU
%
% Factory default
% Address: 1
%
% Author: Daniel Carlson, ABELKO AB Luleå
%
% History: 2014-04-07 DC initial version
% 2016-05-13 DC Munit added for counters and frequency
%
DEVICETYPE IMSE_MxD8 NAMED "IMSE_MxD8" TYPEID 21463 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";
%%%%%%%%%%%%%%%%
% Reset counters
DI1_CounterReset :"DI1 Reset counter" [""] INT
| (sv) "DI1 Nollställ räknare"
| (en) "DI1 Reset counter"
| (NODE) "DI1";
DI2_CounterReset :"DI2 Reset counter" [""] INT
| (sv) "DI2 Nollställ räknare"
| (en) "DI2 Reset counter"
| (NODE) "DI2";
DI3_CounterReset :"DI3 Reset counter" [""] INT
| (sv) "DI3 Nollställ räknare"
| (en) "DI3 Reset counter"
| (NODE) "DI3";
DI4_CounterReset :"DI4 Reset counter" [""] INT
| (sv) "DI4 Nollställ räknare"
| (en) "DI4 Reset counter"
| (NODE) "DI4";
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Reset counter overflow flag
DI1_OverflowFlagReset :"DI1 Reset overflow flag" [""] INT
| (sv) "DI1 Nollställ fullindikering"
| (en) "DI1 Reset overflow flag"
| (NODE) "DI1";
DI2_OverflowFlagReset :"DI2 Reset overflow flag" [""] INT
| (sv) "DI2 Nollställ fullindikering"
| (en) "DI2 Reset overflow flag"
| (NODE) "DI2";
DI3_OverflowFlagReset :"DI3 Reset overflow flag" [""] INT
| (sv) "DI3 Nollställ fullindikering"
| (en) "DI3 Reset overflow flag"
| (NODE) "DI3";
DI4_OverflowFlagReset :"DI4 Reset overflow flag" [""] INT
| (sv) "DI4 Nollställ fullindikering"
| (en) "DI4 Reset overflow flag"
| (NODE) "DI4";
%%%%%%%%%%%%%%%%
% Flank Settings
DI1_FlankSettings: "DI1 Pulse edge" ["Positiv,Negativ,Båda"] ENUM
| (sv) "DI1 Flankinställning"
| (en) "DI1 Flank setting"
| (NODE) "DI1"
| (MENU) "YES";
DI2_FlankSettings: "DI2 Pulse edge" ["Positiv,Negativ,Båda"] ENUM
| (sv) "DI2 Flankinställning"
| (en) "DI2 Flank setting"
| (NODE) "DI2"
| (MENU) "YES";
DI3_FlankSettings: "DI3 Pulse edge" ["Positiv,Negativ,Båda"] ENUM
| (sv) "DI3 Flankinställning"
| (en) "DI3 Flank setting"
| (NODE) "DI3"
| (MENU) "YES";
DI4_FlankSettings: "DI4 Pulse edge" ["Positiv,Negativ,Båda"] ENUM
| (sv) "DI4 Flankinställning"
| (en) "DI4 Flank setting"
| (NODE) "DI4"
| (MENU) "YES";
%%%%%%%%%%%%%%
% Trip voltage
DI_TripVoltage: "DI Trip voltage" ["10V,4V"] ENUM
| (sv) "DI Omslagsspänning"
| (en) "DI Trip voltage"
| (MENU) "YES";
%%%%%%%%%%%%%%%%
% Digital output
DO1: "DO1" [""] INT
| (sv) "DO1"
| (en) "DO1"
| (NODE) "DO1";
DO2: "DO2" [""] INT
| (sv) "DO2"
| (en) "DO2"
| (NODE) "DO2";
DO3: "DO3" [""] INT
| (sv) "DO3"
| (en) "DO3"
| (NODE) "DO3";
DO4: "DO4" [""] INT
| (sv) "DO4"
| (en) "DO4"
| (NODE) "DO4";
PUBLIC
%%%%%%%%%%%%%%%%%%%%%%%
% Cable sequence number
CSN: "CSN" [""] INT
| (sv) "Kabelsekvensnummer"
| (en) "Cable sequence number"
| (MENU) "YES";
%%%%%%%%%%%%%%%
% Digital input
DI1 :"DI1" [""] INT
| (sv) "DI1"
| (en) "DI1"
| (NODE) "DI1";
DI2 :"DI2" [""] INT
| (sv) "DI2"
| (en) "DI2"
| (NODE) "DI2";
DI3 :"DI3" [""] INT
| (sv) "DI3"
| (en) "DI3"
| (NODE) "DI3";
DI4 :"DI4" [""] INT
| (sv) "DI4"
| (en) "DI4"
| (NODE) "DI4";
%%%%%%%%%%%
% Frequency
DI1_Freq :"DI1 Frequency" ["Hz"] FLOAT
| (sv) "DI1 Frekvens"
| (en) "DI1 Frequency"
| (NODE) "DI1"
| (MUNIT) "Hertz"
| (RANGE) "0-200";
DI2_Freq :"DI2 Frequency" ["Hz"] FLOAT
| (sv) "DI2 Frekvens"
| (en) "DI2 Frequency"
| (NODE) "DI2"
| (MUNIT) "Hertz"
| (RANGE) "0-200";
DI3_Freq :"DI3 Frequency" ["Hz"] FLOAT
| (sv) "DI3 Frekvens"
| (en) "DI3 Frequency"
| (NODE) "DI3"
| (MUNIT) "Hertz"
| (RANGE) "0-200";
DI4_Freq :"DI4 Frequency" ["Hz"] FLOAT
| (sv) "DI4 Frekvens"
| (en) "DI4 Frequency"
| (NODE) "DI4"
| (MUNIT) "Hertz"
| (RANGE) "0-200";
%%%%%%%%%
% Counter
DI1_Counter :"DI1 Counter" [""] INT
| (sv) "DI1 Räknare"
| (en) "DI1 Counter"
| (NODE) "DI1"
| (MUNIT) "pulses";
DI2_Counter :"DI2 Counter" [""] INT
| (sv) "DI2 Räknare"
| (en) "DI2 Counter"
| (NODE) "DI2"
| (MUNIT) "pulses";
DI3_Counter :"DI3 Counter" [""] INT
| (sv) "DI3 Räknare"
| (en) "DI3 Counter"
| (NODE) "DI3"
| (MUNIT) "pulses";
DI4_Counter :"DI4 Counter" [""] INT
| (sv) "DI4 Räknare"
| (en) "DI4 Counter"
| (NODE) "DI4"
| (MUNIT) "pulses";
%%%%%%%%%%%%%%%%%%
% Counter overflow
DI1_Overflow :"DI1 Counter Overflow" [""] INT
| (sv) "DI1 Räknare full"
| (en) "DI1 Counter overflow"
| (NODE) "DI1";
DI2_Overflow :"DI2 Counter Overflow" [""] INT
| (sv) "DI2 Räknare full"
| (en) "DI2 Counter overflow"
| (NODE) "DI2";
DI3_Overflow :"DI3 Counter Overflow" [""] INT
| (sv) "DI3 Räknare full"
| (en) "DI3 Counter overflow"
| (NODE) "DI3";
DI4_Overflow :"DI4 Counter Overflow" [""] INT
| (sv) "DI4 Räknare full"
| (en) "DI4 Counter overflow"
| (NODE) "DI4";
%%%%%%%%%%%%%%%
% Short circuit
DI_ShortCirc: "DI Short Circuit" [""] INT
| (sv) "DI Kortslutning"
| (en) "DI Short circuit"
| (MENU) "YES";
%%%%%%%%%%%%%
% DO Override
DO1_Overridden : "DO1 Manually overriden" [""] INT
| (sv) "DO1 Manuelt styrd"
| (en) "DO1 Manually overriden"
| (NODE) "DO1";
DO2_Overridden : "DO2 Manually overriden" [""] INT
| (sv) "DO2 Manuelt styrd"
| (en) "DO2 Manually overriden"
| (NODE) "DO2";
DO3_Overridden : "DO3 Manually overriden" [""] INT
| (sv) "DO3 Manuelt styrd"
| (en) "DO3 Manually overriden"
| (NODE) "DO3";
DO4_Overridden : "DO4 Manually overriden" [""] INT
| (sv) "DO4 Manuelt styrd"
| (en) "DO4 Manually overriden"
| (NODE) "DO4";
PRIVATE
BAUDRATE 38400;
CHECKSUM MODBUS SWAPPED;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Telegrams used for settting values in the unit
TELEGRAM SetDISettings NAMED "SetDISettings"
| (sv) "Ställ DI-inställningar"
| (en) "Set DI settings"
IS
QUESTION
DATA[0] := BYTE(Addr); % Modbus unit address
DATA[1] := BYTE(16); % Modbus command "16" write multiple registers
DATA[2] := RWORD(30); % Start register
DATA[4] := RWORD(5); % Number of registers to write
DATA[6] := BYTE(10); % Numer of bytes of data, two for each register
DATA[7] := RWORD(DI1_CounterReset + DI1_OverflowFlagReset*2 + DI1_FlankSettings*4);
DATA[9] := RWORD(DI2_CounterReset + DI2_OverflowFlagReset*2 + DI2_FlankSettings*4);
DATA[11] := RWORD(DI3_CounterReset + DI3_OverflowFlagReset*2 + DI3_FlankSettings*4);
DATA[13] := RWORD(DI4_CounterReset + DI4_OverflowFlagReset*2 + DI4_FlankSettings*4);
DATA[15] := RWORD(DI_TripVoltage);
ANSWER SIZE 8
DATA[0] = BYTE(Addr);
DATA[1] = BYTE(16);
DATA[2] = RWORD(30);
DATA[4] = RWORD(5);
TIMEOUT 300
END;
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(35); % Start register
DATA[4] := RWORD(ComTimeout);
ANSWER SIZE 8
DATA[0] = BYTE(Addr);
DATA[1] = BYTE(6);
DATA[2] = RWORD(35);
TIMEOUT 300
END;
TELEGRAM SetDO1_6 NAMED "SetDO1-4"
| (sv) "Ställ DO1-DO4"
| (en) "Set DO1-DO4"
IS
QUESTION
DATA[0] := BYTE(Addr); % Modbus unit address
DATA[1] := BYTE(16); % Modbus command "16" write multiple registers
DATA[2] := RWORD(36); % Start register
DATA[4] := RWORD(4); % Number of registers to write
DATA[6] := BYTE(8); % Numer of bytes of data, two for each DO
DATA[7] := RWORD(DO1);
DATA[9] := RWORD(DO2);
DATA[11] := RWORD(DO3);
DATA[13] := RWORD(DO4);
ANSWER SIZE 8
DATA[0] = BYTE(Addr);
DATA[1] = BYTE(16);
DATA[2] = RWORD(36);
DATA[4] = RWORD(4);
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 GetDI1_4 NAMED "GetDI1-4"
| (sv) "Hämta DI1-DI4"
| (en) "Get DI1-DI4"
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(4); % Number of registers to read
ANSWER SIZE 13
DATA[0] = BYTE(Addr); % Modbus unit address
DATA[1] = BYTE(3); % Modbus command "03h" read multiple registers
DATA[2] = BYTE(8); % Numer of bytes of data, two for each DI
DI1 := RWORD[3];
DI2 := RWORD[5];
DI3 := RWORD[7];
DI4 := RWORD[9];
TIMEOUT 300
END;
TELEGRAM GetFreqAndCounterDI1_4 NAMED "GetDI1-4FreqAndCounter"
| (sv) "Hämta frekvens och räknare för DI1-DI4"
| (en) "Get frequency and counter for DI1-DI4"
IS
QUESTION
DATA[0] := BYTE(Addr); % Modbus unit address
DATA[1] := BYTE(3); % Modbus command "03h" read multiple registers
DATA[2] := RWORD(5); % 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, two for each DI
DI1_Freq := RWORD32[3] / 1000;
DI2_Freq := RWORD32[7] / 1000;
DI3_Freq := RWORD32[11] / 1000;
DI4_Freq := RWORD32[15] / 1000;
DI1_Counter := RWORD32[19];
DI2_Counter := RWORD32[23];
DI3_Counter := RWORD32[27];
DI4_Counter := RWORD32[31];
TIMEOUT 300
END;
TELEGRAM GetDIStatus NAMED "GetDIStatus"
| (sv) "Hämta status för DI"
| (en) "Get DI status"
IS
QUESTION
DATA[0] := BYTE(Addr); % Modbus unit address
DATA[1] := BYTE(3); % Modbus command "03h" read multiple registers
DATA[2] := RWORD(21); % Start register
DATA[4] := RWORD(5); % Number of registers to read
ANSWER SIZE 15
DATA[0] = BYTE(Addr); % Modbus unit address
DATA[1] = BYTE(3); % Modbus command "03h" read multiple registers
DATA[2] = BYTE(10); % Numer of bytes of data
DI1_Overflow := RWORD[3];
DI2_Overflow := RWORD[5];
DI3_Overflow := RWORD[7];
DI4_Overflow := RWORD[9];
DI_ShortCirc := RWORD[11];
TIMEOUT 300
END;
TELEGRAM GetDOManualOverrideStatusIstatus NAMED "GetDOManualOverrideStatus"
| (sv) "Hämta status för manuell styrning av DO1-4"
| (en) "Get manual override status for DO1-4"
IS
QUESTION
DATA[0] := BYTE(Addr); % Modbus unit address
DATA[1] := BYTE(3); % Modbus command "03h" read multiple registers
DATA[2] := RWORD(26); % Start register
DATA[4] := RWORD(4); % Number of registers to read
ANSWER SIZE 13
DATA[0] = BYTE(Addr); % Modbus unit address
DATA[1] = BYTE(3); % Modbus command "03h" read multiple registers
DATA[2] = BYTE(8); % Numer of bytes of data
DO1_Overridden := RWORD[3];
DO2_Overridden := RWORD[5];
DO3_Overridden := RWORD[7];
DO4_Overridden := RWORD[9];
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.