IMSE MxDI12
Detaljer
- Typ
- Drivrutin
- Upplaggd av
- Daniel Carlson, Abelko Innovation
- Version
- 9
- Uppdaterad
- 2016-11-02
- Skapad
- 2015-01-15
- Kategori
- IO enheter, Modbus
- Visningar
- 4229
Beskrivning
Typdefinition för Abelkos expansionsmodul MxDI12 som ingår IMSE-familjen. Detta skript används då modulen kopplas som en modbus-enhet.
Modulen har 12 digitala ingå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 MxDI12
%
% Settings module:
% Parity: None
% Baud: 38400
% Mode: RTU
%
% Factory default
% Address: 1
%
% Author: Daniel Carlson, ABELKO AB Luleå
%
% History: 2014-04-07 initial version
% 2016-05-13 DC Munit added for counters and frequency
%
DEVICETYPE IMSE_MxDI12 NAMED "IMSE_MxDI12" TYPEID 21464 IS
PARAMETER
%%%%%%%%%%%%%%%%%%%%%%
% Address of this unit
Addr: "Address" [""] INT
| (sv) "Adress"
| (en) "Address"
| (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";
DI5_CounterReset :"DI5 Reset counter" [""] INT
| (sv) "DI5 Nollställ räknare"
| (en) "DI5 Reset counter"
| (NODE) "DI5";
DI6_CounterReset :"DI6 Reset counter" [""] INT
| (sv) "DI6 Nollställ räknare"
| (en) "DI6 Reset counter"
| (NODE) "DI6";
DI7_CounterReset :"DI7 Reset counter" [""] INT
| (sv) "DI7 Nollställ räknare"
| (en) "DI7 Reset counter"
| (NODE) "DI7";
DI8_CounterReset :"DI8 Reset counter" [""] INT
| (sv) "DI8 Nollställ räknare"
| (en) "DI8 Reset counter"
| (NODE) "DI8";
DI9_CounterReset :"DI9 Reset counter" [""] INT
| (sv) "DI9 Nollställ räknare"
| (en) "DI9 Reset counter"
| (NODE) "DI9";
DI10_CounterReset :"DI10 Reset counter" [""] INT
| (sv) "DI10 Nollställ räknare"
| (en) "DI10 Reset counter"
| (NODE) "DI10";
DI11_CounterReset :"DI11 Reset counter" [""] INT
| (sv) "DI11 Nollställ räknare"
| (en) "DI11 Reset counter"
| (NODE) "DI11";
DI12_CounterReset :"DI12 Reset counter" [""] INT
| (sv) "DI12 Nollställ räknare"
| (en) "DI12 Reset counter"
| (NODE) "DI12";
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 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";
DI5_OverflowFlagReset :"DI5 Reset overflow flag" [""] INT
| (sv) "DI5 Nollställ fullindikering"
| (en) "DI5 Reset overflow flag"
| (NODE) "DI5";
DI6_OverflowFlagReset :"DI6 Reset overflow flag" [""] INT
| (sv) "DI6 Nollställ fullindikering"
| (en) "DI6 Reset overflow flag"
| (NODE) "DI6";
DI7_OverflowFlagReset :"DI7 Reset overflow flag" [""] INT
| (sv) "DI7 Nollställ fullindikering"
| (en) "DI7 Reset overflow flag"
| (NODE) "DI7";
DI8_OverflowFlagReset :"DI8 Reset overflow flag" [""] INT
| (sv) "DI8 Nollställ fullindikering"
| (en) "DI8 Reset overflow flag"
| (NODE) "DI8";
DI9_OverflowFlagReset :"DI9 Reset overflow flag" [""] INT
| (sv) "DI9 Nollställ fullindikering"
| (en) "DI9 Reset overflow flag"
| (NODE) "DI9";
DI10_OverflowFlagReset :"DI10 Reset overflow flag" [""] INT
| (sv) "DI10 Nollställ fullindikering"
| (en) "DI10 Reset overflow flag"
| (NODE) "DI10";
DI11_OverflowFlagReset :"DI11 Reset overflow flag" [""] INT
| (sv) "DI11 Nollställ fullindikering"
| (en) "DI11 Reset overflow flag"
| (NODE) "DI11";
DI12_OverflowFlagReset :"DI12 Reset overflow flag" [""] INT
| (sv) "DI12 Nollställ fullindikering"
| (en) "DI12 Reset overflow flag"
| (NODE) "DI12";
%%%%%%%%%%%%%%%%
% 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";
DI5_FlankSettings: "DI5 Pulse edge" ["Positiv,Negativ,Båda"] ENUM
| (sv) "DI5 Flankinställning"
| (en) "DI5 Flank setting"
| (NODE) "DI5"
| (MENU) "YES";
DI6_FlankSettings: "DI6 Pulse edge" ["Positiv,Negativ,Båda"] ENUM
| (sv) "DI6 Flankinställning"
| (en) "DI6 Flank setting"
| (NODE) "DI6"
| (MENU) "YES";
DI7_FlankSettings: "DI7 Pulse edge" ["Positiv,Negativ,Båda"] ENUM
| (sv) "DI7 Flankinställning"
| (en) "DI7 Flank setting"
| (NODE) "DI7"
| (MENU) "YES";
DI8_FlankSettings: "DI8 Pulse edge" ["Positiv,Negativ,Båda"] ENUM
| (sv) "DI8 Flankinställning"
| (en) "DI8 Flank setting"
| (NODE) "DI8"
| (MENU) "YES";
DI9_FlankSettings: "DI9 Pulse edge" ["Positiv,Negativ,Båda"] ENUM
| (sv) "DI9 Flankinställning"
| (en) "DI9 Flank setting"
| (NODE) "DI9"
| (MENU) "YES";
DI10_FlankSettings: "DI10 Pulse edge" ["Positiv,Negativ,Båda"] ENUM
| (sv) "DI10 Flankinställning"
| (en) "DI10 Flank setting"
| (NODE) "DI10"
| (MENU) "YES";
DI11_FlankSettings: "DI11 Pulse edge" ["Positiv,Negativ,Båda"] ENUM
| (sv) "DI11 Flankinställning"
| (en) "DI11 Flank setting"
| (NODE) "DI11"
| (MENU) "YES";
DI12_FlankSettings: "DI12 Pulse edge" ["Positiv,Negativ,Båda"] ENUM
| (sv) "DI12 Flankinställning"
| (en) "DI12 Flank setting"
| (NODE) "DI12"
| (MENU) "YES";
%%%%%%%%%%%%%%
% Trip voltage
DI_TripVoltage: "DI Trip voltage" ["10V,4V"] ENUM
| (sv) "DI Omslagsspänning"
| (en) "DI Trip voltage"
| (MENU) "YES";
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";
DI5 :"DI5" [""] INT
| (sv) "DI5"
| (en) "DI5"
| (NODE) "DI5";
DI6 :"DI6" [""] INT
| (sv) "DI6"
| (en) "DI6"
| (NODE) "DI6";
DI7 :"DI7" [""] INT
| (sv) "DI7"
| (en) "DI7"
| (NODE) "DI7";
DI8 :"DI8" [""] INT
| (sv) "DI8"
| (en) "DI8"
| (NODE) "DI8";
DI9 :"DI9" [""] INT
| (sv) "DI9"
| (en) "DI9"
| (NODE) "DI9";
DI10 :"DI10" [""] INT
| (sv) "DI10"
| (en) "DI10"
| (NODE) "DI10";
DI11 :"DI11" [""] INT
| (sv) "DI11"
| (en) "DI11"
| (NODE) "DI11";
DI12 :"DI12" [""] INT
| (sv) "DI12"
| (en) "DI12"
| (NODE) "DI12";
%%%%%%%%%%%
% 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";
DI5_Freq :"DI5 Frequency" ["Hz"] FLOAT
| (sv) "DI5 Frekvens"
| (en) "DI5 Frequency"
| (NODE) "DI5"
| (MUNIT) "Hertz"
| (RANGE) "0-200";
DI6_Freq :"DI6 Frequency" ["Hz"] FLOAT
| (sv) "DI6 Frekvens"
| (en) "DI6 Frequency"
| (NODE) "DI6"
| (MUNIT) "Hertz"
| (RANGE) "0-200";
DI7_Freq :"DI7 Frequency" ["Hz"] FLOAT
| (sv) "DI7 Frekvens"
| (en) "DI7 Frequency"
| (NODE) "DI7"
| (MUNIT) "Hertz"
| (RANGE) "0-200";
DI8_Freq :"DI8 Frequency" ["Hz"] FLOAT
| (sv) "DI8 Frekvens"
| (en) "DI8 Frequency"
| (NODE) "DI8"
| (MUNIT) "Hertz"
| (RANGE) "0-200";
DI9_Freq :"DI9 Frequency" ["Hz"] FLOAT
| (sv) "DI9 Frekvens"
| (en) "DI9 Frequency"
| (NODE) "DI9"
| (MUNIT) "Hertz"
| (RANGE) "0-200";
DI10_Freq :"DI10 Frequency" ["Hz"] FLOAT
| (sv) "DI10 Frekvens"
| (en) "DI10 Frequency"
| (NODE) "DI10"
| (MUNIT) "Hertz"
| (RANGE) "0-200";
DI11_Freq :"DI11 Frequency" ["Hz"] FLOAT
| (sv) "DI11 Frekvens"
| (en) "DI11 Frequency"
| (NODE) "DI11"
| (MUNIT) "Hertz"
| (RANGE) "0-200";
DI12_Freq :"DI12 Frequency" ["Hz"] FLOAT
| (sv) "DI12 Frekvens"
| (en) "DI12 Frequency"
| (NODE) "DI12"
| (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";
DI5_Counter :"DI5 Counter" [""] INT
| (sv) "DI5 Räknare"
| (en) "DI5 Counter"
| (NODE) "DI5"
| (MUNIT) "pulses";
DI6_Counter :"DI6 Counter" [""] INT
| (sv) "DI6 Räknare"
| (en) "DI6 Counter"
| (NODE) "DI6"
| (MUNIT) "pulses";
DI7_Counter :"DI7 Counter" [""] INT
| (sv) "DI7 Räknare"
| (en) "DI7 Counter"
| (NODE) "DI7"
| (MUNIT) "pulses";
DI8_Counter :"DI8 Counter" [""] INT
| (sv) "DI8 Räknare"
| (en) "DI8 Counter"
| (NODE) "DI8"
| (MUNIT) "pulses";
DI9_Counter :"DI9 Counter" [""] INT
| (sv) "DI9 Räknare"
| (en) "DI9 Counter"
| (NODE) "DI9"
| (MUNIT) "pulses";
DI10_Counter :"DI10 Counter" [""] INT
| (sv) "DI10 Räknare"
| (en) "DI10 Counter"
| (NODE) "DI10"
| (MUNIT) "pulses";
DI11_Counter :"DI11 Counter" [""] INT
| (sv) "DI11 Räknare"
| (en) "DI11 Counter"
| (NODE) "DI11"
| (MUNIT) "pulses";
DI12_Counter :"DI12 Counter" [""] INT
| (sv) "DI12 Räknare"
| (en) "DI12 Counter"
| (NODE) "DI12"
| (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";
DI5_Overflow :"DI5 Counter Overflow" [""] INT
| (sv) "DI5 Räknare full"
| (en) "DI5 Counter overflow"
| (NODE) "DI5";
DI6_Overflow :"DI6 Counter Overflow" [""] INT
| (sv) "DI6 Räknare full"
| (en) "DI6 Counter overflow"
| (NODE) "DI6";
DI7_Overflow :"DI7 Counter Overflow" [""] INT
| (sv) "DI7 Räknare full"
| (en) "DI7 Counter overflow"
| (NODE) "DI7";
DI8_Overflow :"DI8 Counter Overflow" [""] INT
| (sv) "DI8 Räknare full"
| (en) "DI8 Counter overflow"
| (NODE) "DI8";
DI9_Overflow :"DI9 Counter Overflow" [""] INT
| (sv) "DI9 Räknare full"
| (en) "DI9 Counter overflow"
| (NODE) "DI9";
DI10_Overflow :"DI10 Counter Overflow" [""] INT
| (sv) "DI10 Räknare full"
| (en) "DI10 Counter overflow"
| (NODE) "DI10";
DI11_Overflow :"DI11 Counter Overflow" [""] INT
| (sv) "DI11 Räknare full"
| (en) "DI11 Counter overflow"
| (NODE) "DI11";
DI12_Overflow :"DI12 Counter Overflow" [""] INT
| (sv) "DI12 Räknare full"
| (en) "DI12 Counter overflow"
| (NODE) "DI12";
%%%%%%%%%%%%%%%
% Short circuit
DI_ShortCirc: "DI Short Circuit" [""] INT
| (sv) "DI Kortslutning"
| (en) "DI Short circuit"
| (MENU) "YES";
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(74); % Start register
DATA[4] := RWORD(13); % Number of registers to write
DATA[6] := BYTE(26); % 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(DI5_CounterReset + DI5_OverflowFlagReset*2 + DI5_FlankSettings*4);
DATA[17] := RWORD(DI6_CounterReset + DI6_OverflowFlagReset*2 + DI6_FlankSettings*4);
DATA[19] := RWORD(DI7_CounterReset + DI7_OverflowFlagReset*2 + DI7_FlankSettings*4);
DATA[21] := RWORD(DI8_CounterReset + DI8_OverflowFlagReset*2 + DI8_FlankSettings*4);
DATA[23] := RWORD(DI9_CounterReset + DI9_OverflowFlagReset*2 + DI9_FlankSettings*4);
DATA[25] := RWORD(DI10_CounterReset + DI10_OverflowFlagReset*2 + DI10_FlankSettings*4);
DATA[27] := RWORD(DI11_CounterReset + DI11_OverflowFlagReset*2 + DI11_FlankSettings*4);
DATA[29] := RWORD(DI12_CounterReset + DI12_OverflowFlagReset*2 + DI12_FlankSettings*4);
DATA[31] := RWORD(DI_TripVoltage);
ANSWER SIZE 8
DATA[0] = BYTE(Addr);
DATA[1] = BYTE(16);
DATA[2] = RWORD(74);
DATA[4] = RWORD(13);
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_12 NAMED "GetDI1-12"
| (sv) "Hämta DI1-DI12"
| (en) "Get DI1-DI12"
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(12); % Number of registers to read
ANSWER SIZE 29
DATA[0] = BYTE(Addr); % Modbus unit address
DATA[1] = BYTE(3); % Modbus command "03h" read multiple registers
DATA[2] = BYTE(24); % Numer of bytes of data, two for each DI
DI1 := RWORD[3];
DI2 := RWORD[5];
DI3 := RWORD[7];
DI4 := RWORD[9];
DI5 := RWORD[11];
DI6 := RWORD[13];
DI7 := RWORD[15];
DI8 := RWORD[17];
DI9 := RWORD[19];
DI10 := RWORD[21];
DI11 := RWORD[23];
DI12 := RWORD[25];
TIMEOUT 300
END;
TELEGRAM GetFreqAndCounterDI1_12 NAMED "GetDI1-12FreqAndCounter"
| (sv) "Hämta frekvens och räknare för DI1-DI12"
| (en) "Get frequency and counter for DI1-DI12"
IS
QUESTION
DATA[0] := BYTE(Addr); % Modbus unit address
DATA[1] := BYTE(3); % Modbus command "03h" read multiple registers
DATA[2] := RWORD(13); % Start register
DATA[4] := RWORD(48); % Number of registers to read
ANSWER SIZE 101
DATA[0] = BYTE(Addr); % Modbus unit address
DATA[1] = BYTE(3); % Modbus command "03h" read multiple registers
DATA[2] = BYTE(96); % 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;
DI5_Freq := RWORD32[19] / 1000;
DI6_Freq := RWORD32[23] / 1000;
DI7_Freq := RWORD32[27] / 1000;
DI8_Freq := RWORD32[31] / 1000;
DI9_Freq := RWORD32[35] / 1000;
DI10_Freq := RWORD32[39] / 1000;
DI11_Freq := RWORD32[43] / 1000;
DI12_Freq := RWORD32[47] / 1000;
DI1_Counter := RWORD32[51];
DI2_Counter := RWORD32[55];
DI3_Counter := RWORD32[59];
DI4_Counter := RWORD32[63];
DI5_Counter := RWORD32[67];
DI6_Counter := RWORD32[71];
DI7_Counter := RWORD32[75];
DI8_Counter := RWORD32[79];
DI9_Counter := RWORD32[83];
DI10_Counter := RWORD32[87];
DI11_Counter := RWORD32[91];
DI12_Counter := RWORD32[95];
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(61); % Start register
DATA[4] := RWORD(13); % Number of registers to read
ANSWER SIZE 31
DATA[0] = BYTE(Addr); % Modbus unit address
DATA[1] = BYTE(3); % Modbus command "03h" read multiple registers
DATA[2] = BYTE(26); % Numer of bytes of data
DI1_Overflow := RWORD[3];
DI2_Overflow := RWORD[5];
DI3_Overflow := RWORD[7];
DI4_Overflow := RWORD[9];
DI5_Overflow := RWORD[11];
DI6_Overflow := RWORD[13];
DI7_Overflow := RWORD[15];
DI8_Overflow := RWORD[17];
DI9_Overflow := RWORD[19];
DI10_Overflow := RWORD[21];
DI11_Overflow := RWORD[23];
DI12_Overflow := RWORD[25];
DI_ShortCirc := RWORD[27];
TIMEOUT 300
END;
END;
% Device definition for IMSE MxDI12
%
% Settings module:
% Parity: None
% Baud: 38400
% Mode: RTU
%
% Factory default
% Address: 1
%
% Author: Daniel Carlson, ABELKO AB Luleå
%
% History: 2014-04-07 initial version
% 2016-05-13 DC Munit added for counters and frequency
%
DEVICETYPE IMSE_MxDI12 NAMED "IMSE_MxDI12" TYPEID 21464 IS
PARAMETER
%%%%%%%%%%%%%%%%%%%%%%
% Address of this unit
Addr: "Address" [""] INT
| (sv) "Adress"
| (en) "Address"
| (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";
DI5_CounterReset :"DI5 Reset counter" [""] INT
| (sv) "DI5 Nollställ räknare"
| (en) "DI5 Reset counter"
| (NODE) "DI5";
DI6_CounterReset :"DI6 Reset counter" [""] INT
| (sv) "DI6 Nollställ räknare"
| (en) "DI6 Reset counter"
| (NODE) "DI6";
DI7_CounterReset :"DI7 Reset counter" [""] INT
| (sv) "DI7 Nollställ räknare"
| (en) "DI7 Reset counter"
| (NODE) "DI7";
DI8_CounterReset :"DI8 Reset counter" [""] INT
| (sv) "DI8 Nollställ räknare"
| (en) "DI8 Reset counter"
| (NODE) "DI8";
DI9_CounterReset :"DI9 Reset counter" [""] INT
| (sv) "DI9 Nollställ räknare"
| (en) "DI9 Reset counter"
| (NODE) "DI9";
DI10_CounterReset :"DI10 Reset counter" [""] INT
| (sv) "DI10 Nollställ räknare"
| (en) "DI10 Reset counter"
| (NODE) "DI10";
DI11_CounterReset :"DI11 Reset counter" [""] INT
| (sv) "DI11 Nollställ räknare"
| (en) "DI11 Reset counter"
| (NODE) "DI11";
DI12_CounterReset :"DI12 Reset counter" [""] INT
| (sv) "DI12 Nollställ räknare"
| (en) "DI12 Reset counter"
| (NODE) "DI12";
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 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";
DI5_OverflowFlagReset :"DI5 Reset overflow flag" [""] INT
| (sv) "DI5 Nollställ fullindikering"
| (en) "DI5 Reset overflow flag"
| (NODE) "DI5";
DI6_OverflowFlagReset :"DI6 Reset overflow flag" [""] INT
| (sv) "DI6 Nollställ fullindikering"
| (en) "DI6 Reset overflow flag"
| (NODE) "DI6";
DI7_OverflowFlagReset :"DI7 Reset overflow flag" [""] INT
| (sv) "DI7 Nollställ fullindikering"
| (en) "DI7 Reset overflow flag"
| (NODE) "DI7";
DI8_OverflowFlagReset :"DI8 Reset overflow flag" [""] INT
| (sv) "DI8 Nollställ fullindikering"
| (en) "DI8 Reset overflow flag"
| (NODE) "DI8";
DI9_OverflowFlagReset :"DI9 Reset overflow flag" [""] INT
| (sv) "DI9 Nollställ fullindikering"
| (en) "DI9 Reset overflow flag"
| (NODE) "DI9";
DI10_OverflowFlagReset :"DI10 Reset overflow flag" [""] INT
| (sv) "DI10 Nollställ fullindikering"
| (en) "DI10 Reset overflow flag"
| (NODE) "DI10";
DI11_OverflowFlagReset :"DI11 Reset overflow flag" [""] INT
| (sv) "DI11 Nollställ fullindikering"
| (en) "DI11 Reset overflow flag"
| (NODE) "DI11";
DI12_OverflowFlagReset :"DI12 Reset overflow flag" [""] INT
| (sv) "DI12 Nollställ fullindikering"
| (en) "DI12 Reset overflow flag"
| (NODE) "DI12";
%%%%%%%%%%%%%%%%
% 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";
DI5_FlankSettings: "DI5 Pulse edge" ["Positiv,Negativ,Båda"] ENUM
| (sv) "DI5 Flankinställning"
| (en) "DI5 Flank setting"
| (NODE) "DI5"
| (MENU) "YES";
DI6_FlankSettings: "DI6 Pulse edge" ["Positiv,Negativ,Båda"] ENUM
| (sv) "DI6 Flankinställning"
| (en) "DI6 Flank setting"
| (NODE) "DI6"
| (MENU) "YES";
DI7_FlankSettings: "DI7 Pulse edge" ["Positiv,Negativ,Båda"] ENUM
| (sv) "DI7 Flankinställning"
| (en) "DI7 Flank setting"
| (NODE) "DI7"
| (MENU) "YES";
DI8_FlankSettings: "DI8 Pulse edge" ["Positiv,Negativ,Båda"] ENUM
| (sv) "DI8 Flankinställning"
| (en) "DI8 Flank setting"
| (NODE) "DI8"
| (MENU) "YES";
DI9_FlankSettings: "DI9 Pulse edge" ["Positiv,Negativ,Båda"] ENUM
| (sv) "DI9 Flankinställning"
| (en) "DI9 Flank setting"
| (NODE) "DI9"
| (MENU) "YES";
DI10_FlankSettings: "DI10 Pulse edge" ["Positiv,Negativ,Båda"] ENUM
| (sv) "DI10 Flankinställning"
| (en) "DI10 Flank setting"
| (NODE) "DI10"
| (MENU) "YES";
DI11_FlankSettings: "DI11 Pulse edge" ["Positiv,Negativ,Båda"] ENUM
| (sv) "DI11 Flankinställning"
| (en) "DI11 Flank setting"
| (NODE) "DI11"
| (MENU) "YES";
DI12_FlankSettings: "DI12 Pulse edge" ["Positiv,Negativ,Båda"] ENUM
| (sv) "DI12 Flankinställning"
| (en) "DI12 Flank setting"
| (NODE) "DI12"
| (MENU) "YES";
%%%%%%%%%%%%%%
% Trip voltage
DI_TripVoltage: "DI Trip voltage" ["10V,4V"] ENUM
| (sv) "DI Omslagsspänning"
| (en) "DI Trip voltage"
| (MENU) "YES";
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";
DI5 :"DI5" [""] INT
| (sv) "DI5"
| (en) "DI5"
| (NODE) "DI5";
DI6 :"DI6" [""] INT
| (sv) "DI6"
| (en) "DI6"
| (NODE) "DI6";
DI7 :"DI7" [""] INT
| (sv) "DI7"
| (en) "DI7"
| (NODE) "DI7";
DI8 :"DI8" [""] INT
| (sv) "DI8"
| (en) "DI8"
| (NODE) "DI8";
DI9 :"DI9" [""] INT
| (sv) "DI9"
| (en) "DI9"
| (NODE) "DI9";
DI10 :"DI10" [""] INT
| (sv) "DI10"
| (en) "DI10"
| (NODE) "DI10";
DI11 :"DI11" [""] INT
| (sv) "DI11"
| (en) "DI11"
| (NODE) "DI11";
DI12 :"DI12" [""] INT
| (sv) "DI12"
| (en) "DI12"
| (NODE) "DI12";
%%%%%%%%%%%
% 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";
DI5_Freq :"DI5 Frequency" ["Hz"] FLOAT
| (sv) "DI5 Frekvens"
| (en) "DI5 Frequency"
| (NODE) "DI5"
| (MUNIT) "Hertz"
| (RANGE) "0-200";
DI6_Freq :"DI6 Frequency" ["Hz"] FLOAT
| (sv) "DI6 Frekvens"
| (en) "DI6 Frequency"
| (NODE) "DI6"
| (MUNIT) "Hertz"
| (RANGE) "0-200";
DI7_Freq :"DI7 Frequency" ["Hz"] FLOAT
| (sv) "DI7 Frekvens"
| (en) "DI7 Frequency"
| (NODE) "DI7"
| (MUNIT) "Hertz"
| (RANGE) "0-200";
DI8_Freq :"DI8 Frequency" ["Hz"] FLOAT
| (sv) "DI8 Frekvens"
| (en) "DI8 Frequency"
| (NODE) "DI8"
| (MUNIT) "Hertz"
| (RANGE) "0-200";
DI9_Freq :"DI9 Frequency" ["Hz"] FLOAT
| (sv) "DI9 Frekvens"
| (en) "DI9 Frequency"
| (NODE) "DI9"
| (MUNIT) "Hertz"
| (RANGE) "0-200";
DI10_Freq :"DI10 Frequency" ["Hz"] FLOAT
| (sv) "DI10 Frekvens"
| (en) "DI10 Frequency"
| (NODE) "DI10"
| (MUNIT) "Hertz"
| (RANGE) "0-200";
DI11_Freq :"DI11 Frequency" ["Hz"] FLOAT
| (sv) "DI11 Frekvens"
| (en) "DI11 Frequency"
| (NODE) "DI11"
| (MUNIT) "Hertz"
| (RANGE) "0-200";
DI12_Freq :"DI12 Frequency" ["Hz"] FLOAT
| (sv) "DI12 Frekvens"
| (en) "DI12 Frequency"
| (NODE) "DI12"
| (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";
DI5_Counter :"DI5 Counter" [""] INT
| (sv) "DI5 Räknare"
| (en) "DI5 Counter"
| (NODE) "DI5"
| (MUNIT) "pulses";
DI6_Counter :"DI6 Counter" [""] INT
| (sv) "DI6 Räknare"
| (en) "DI6 Counter"
| (NODE) "DI6"
| (MUNIT) "pulses";
DI7_Counter :"DI7 Counter" [""] INT
| (sv) "DI7 Räknare"
| (en) "DI7 Counter"
| (NODE) "DI7"
| (MUNIT) "pulses";
DI8_Counter :"DI8 Counter" [""] INT
| (sv) "DI8 Räknare"
| (en) "DI8 Counter"
| (NODE) "DI8"
| (MUNIT) "pulses";
DI9_Counter :"DI9 Counter" [""] INT
| (sv) "DI9 Räknare"
| (en) "DI9 Counter"
| (NODE) "DI9"
| (MUNIT) "pulses";
DI10_Counter :"DI10 Counter" [""] INT
| (sv) "DI10 Räknare"
| (en) "DI10 Counter"
| (NODE) "DI10"
| (MUNIT) "pulses";
DI11_Counter :"DI11 Counter" [""] INT
| (sv) "DI11 Räknare"
| (en) "DI11 Counter"
| (NODE) "DI11"
| (MUNIT) "pulses";
DI12_Counter :"DI12 Counter" [""] INT
| (sv) "DI12 Räknare"
| (en) "DI12 Counter"
| (NODE) "DI12"
| (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";
DI5_Overflow :"DI5 Counter Overflow" [""] INT
| (sv) "DI5 Räknare full"
| (en) "DI5 Counter overflow"
| (NODE) "DI5";
DI6_Overflow :"DI6 Counter Overflow" [""] INT
| (sv) "DI6 Räknare full"
| (en) "DI6 Counter overflow"
| (NODE) "DI6";
DI7_Overflow :"DI7 Counter Overflow" [""] INT
| (sv) "DI7 Räknare full"
| (en) "DI7 Counter overflow"
| (NODE) "DI7";
DI8_Overflow :"DI8 Counter Overflow" [""] INT
| (sv) "DI8 Räknare full"
| (en) "DI8 Counter overflow"
| (NODE) "DI8";
DI9_Overflow :"DI9 Counter Overflow" [""] INT
| (sv) "DI9 Räknare full"
| (en) "DI9 Counter overflow"
| (NODE) "DI9";
DI10_Overflow :"DI10 Counter Overflow" [""] INT
| (sv) "DI10 Räknare full"
| (en) "DI10 Counter overflow"
| (NODE) "DI10";
DI11_Overflow :"DI11 Counter Overflow" [""] INT
| (sv) "DI11 Räknare full"
| (en) "DI11 Counter overflow"
| (NODE) "DI11";
DI12_Overflow :"DI12 Counter Overflow" [""] INT
| (sv) "DI12 Räknare full"
| (en) "DI12 Counter overflow"
| (NODE) "DI12";
%%%%%%%%%%%%%%%
% Short circuit
DI_ShortCirc: "DI Short Circuit" [""] INT
| (sv) "DI Kortslutning"
| (en) "DI Short circuit"
| (MENU) "YES";
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(74); % Start register
DATA[4] := RWORD(13); % Number of registers to write
DATA[6] := BYTE(26); % 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(DI5_CounterReset + DI5_OverflowFlagReset*2 + DI5_FlankSettings*4);
DATA[17] := RWORD(DI6_CounterReset + DI6_OverflowFlagReset*2 + DI6_FlankSettings*4);
DATA[19] := RWORD(DI7_CounterReset + DI7_OverflowFlagReset*2 + DI7_FlankSettings*4);
DATA[21] := RWORD(DI8_CounterReset + DI8_OverflowFlagReset*2 + DI8_FlankSettings*4);
DATA[23] := RWORD(DI9_CounterReset + DI9_OverflowFlagReset*2 + DI9_FlankSettings*4);
DATA[25] := RWORD(DI10_CounterReset + DI10_OverflowFlagReset*2 + DI10_FlankSettings*4);
DATA[27] := RWORD(DI11_CounterReset + DI11_OverflowFlagReset*2 + DI11_FlankSettings*4);
DATA[29] := RWORD(DI12_CounterReset + DI12_OverflowFlagReset*2 + DI12_FlankSettings*4);
DATA[31] := RWORD(DI_TripVoltage);
ANSWER SIZE 8
DATA[0] = BYTE(Addr);
DATA[1] = BYTE(16);
DATA[2] = RWORD(74);
DATA[4] = RWORD(13);
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_12 NAMED "GetDI1-12"
| (sv) "Hämta DI1-DI12"
| (en) "Get DI1-DI12"
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(12); % Number of registers to read
ANSWER SIZE 29
DATA[0] = BYTE(Addr); % Modbus unit address
DATA[1] = BYTE(3); % Modbus command "03h" read multiple registers
DATA[2] = BYTE(24); % Numer of bytes of data, two for each DI
DI1 := RWORD[3];
DI2 := RWORD[5];
DI3 := RWORD[7];
DI4 := RWORD[9];
DI5 := RWORD[11];
DI6 := RWORD[13];
DI7 := RWORD[15];
DI8 := RWORD[17];
DI9 := RWORD[19];
DI10 := RWORD[21];
DI11 := RWORD[23];
DI12 := RWORD[25];
TIMEOUT 300
END;
TELEGRAM GetFreqAndCounterDI1_12 NAMED "GetDI1-12FreqAndCounter"
| (sv) "Hämta frekvens och räknare för DI1-DI12"
| (en) "Get frequency and counter for DI1-DI12"
IS
QUESTION
DATA[0] := BYTE(Addr); % Modbus unit address
DATA[1] := BYTE(3); % Modbus command "03h" read multiple registers
DATA[2] := RWORD(13); % Start register
DATA[4] := RWORD(48); % Number of registers to read
ANSWER SIZE 101
DATA[0] = BYTE(Addr); % Modbus unit address
DATA[1] = BYTE(3); % Modbus command "03h" read multiple registers
DATA[2] = BYTE(96); % 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;
DI5_Freq := RWORD32[19] / 1000;
DI6_Freq := RWORD32[23] / 1000;
DI7_Freq := RWORD32[27] / 1000;
DI8_Freq := RWORD32[31] / 1000;
DI9_Freq := RWORD32[35] / 1000;
DI10_Freq := RWORD32[39] / 1000;
DI11_Freq := RWORD32[43] / 1000;
DI12_Freq := RWORD32[47] / 1000;
DI1_Counter := RWORD32[51];
DI2_Counter := RWORD32[55];
DI3_Counter := RWORD32[59];
DI4_Counter := RWORD32[63];
DI5_Counter := RWORD32[67];
DI6_Counter := RWORD32[71];
DI7_Counter := RWORD32[75];
DI8_Counter := RWORD32[79];
DI9_Counter := RWORD32[83];
DI10_Counter := RWORD32[87];
DI11_Counter := RWORD32[91];
DI12_Counter := RWORD32[95];
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(61); % Start register
DATA[4] := RWORD(13); % Number of registers to read
ANSWER SIZE 31
DATA[0] = BYTE(Addr); % Modbus unit address
DATA[1] = BYTE(3); % Modbus command "03h" read multiple registers
DATA[2] = BYTE(26); % Numer of bytes of data
DI1_Overflow := RWORD[3];
DI2_Overflow := RWORD[5];
DI3_Overflow := RWORD[7];
DI4_Overflow := RWORD[9];
DI5_Overflow := RWORD[11];
DI6_Overflow := RWORD[13];
DI7_Overflow := RWORD[15];
DI8_Overflow := RWORD[17];
DI9_Overflow := RWORD[19];
DI10_Overflow := RWORD[21];
DI11_Overflow := RWORD[23];
DI12_Overflow := RWORD[25];
DI_ShortCirc := RWORD[27];
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.