FIDELIX Digital inputs
Detaljer
- Typ
- Drivrutin
- Upplaggd av
- Ove Jansson, Abelko Innovation
- Version
- 1
- Uppdaterad
- 2013-08-27
- Skapad
- 2013-08-27
- Kategori
- IO enheter, Modbus
- Visningar
- 2565
Beskrivning
Device definition for FIDELIX Digital inputs
Bruksanvisning
See Fidelix I/O-module specifications (pdf)
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 FIDELIX Digital inputs
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% OBS! Använd "Read holding registers" kommando 3 för Fidelix
%
% If input is connected longer than minimum pulse width
% status is cleared, otherwise set.
% Register 0
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2009-12-14 Ändrat kommando 4 till kommando 3 Read holding registers
%
DEVICETYPE FidelixDI NAMED "Fidelix DI" TYPEID 21230 IS
PARAMETER
Id : "Adress";
PUBLIC
DI1 : "Status DI1";
DI2 : "Status DI2";
DI3 : "Status DI3";
DI4 : "Status DI4";
DI5 : "Status DI5";
DI6 : "Status DI6";
DI7 : "Status DI7";
DI8 : "Status DI8";
DI9 : "Status DI9";
DI10 : "Status DI10";
DI11 : "Status DI11";
DI12 : "Status DI12";
DI13 : "Status DI13";
DI14 : "Status DI14";
DI15 : "Status DI15";
DI16 : "Status DI16";
PRIVATE
Tmp;
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM DigitalInput NAMED "Läs DI" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(03); % Modbus command "03h" Read holding registers
DATA[2] := RWORD(0); % Start address register
DATA[4] := RWORD(1); % Number of registers
ANSWER SIZE 7
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(03); % Modbus command "03h" Read holding registers
DATA[2] = BYTE(2); % Byte count
DATA[3] -> RWORD(
Tmp := DATA;
IF (Tmp & 1) THEN DI1 :=0; ELSE DI1 :=1; ENDIF;
IF (Tmp & 2) THEN DI2 :=0; ELSE DI2 :=1; ENDIF;
IF (Tmp & 4) THEN DI3 :=0; ELSE DI3 :=1; ENDIF;
IF (Tmp & 8) THEN DI4 :=0; ELSE DI4 :=1; ENDIF;
IF (Tmp & 16) THEN DI5 :=0; ELSE DI5 :=1; ENDIF;
IF (Tmp & 32) THEN DI6 :=0; ELSE DI6 :=1; ENDIF;
IF (Tmp & 64) THEN DI7 :=0; ELSE DI7 :=1; ENDIF;
IF (Tmp & 128) THEN DI8 :=0; ELSE DI8 :=1; ENDIF;
IF (Tmp & 256) THEN DI9 :=0; ELSE DI9 :=1; ENDIF;
IF (Tmp & 512) THEN DI10:=0; ELSE DI10:=1; ENDIF;
IF (Tmp & 1024) THEN DI11:=0; ELSE DI11:=1; ENDIF;
IF (Tmp & 2048) THEN DI12:=0; ELSE DI12:=1; ENDIF;
IF (Tmp & 4096) THEN DI13:=0; ELSE DI13:=1; ENDIF;
IF (Tmp & 8192) THEN DI14:=0; ELSE DI14:=1; ENDIF;
IF (Tmp & 16384) THEN DI15:=0; ELSE DI15:=1; ENDIF;
IF (Tmp & 32768) THEN DI16:=0; ELSE DI16:=1; ENDIF;
);
TIMEOUT 1000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for FIDELIX Digital pulse counter
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Pulses longer than corresponding pulse width register are counted.
% Register 14-29
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2009-01-12
%
DEVICETYPE FidelixDICounter NAMED "Fidelix Pulser" TYPEID 21231 IS
PARAMETER
Id : "Adress";
PUBLIC
DI1 : "Pulser DI1";
DI2 : "Pulser DI2";
DI3 : "Pulser DI3";
DI4 : "Pulser DI4";
DI5 : "Pulser DI5";
DI6 : "Pulser DI6";
DI7 : "Pulser DI7";
DI8 : "Pulser DI8";
DI9 : "Pulser DI9";
DI10 : "Pulser DI10";
DI11 : "Pulser DI11";
DI12 : "Pulser DI12";
DI13 : "Pulser DI13";
DI14 : "Pulser DI14";
DI15 : "Pulser DI15";
DI16 : "Pulser DI16";
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM DigitalPulse NAMED "Läs DI pulser" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(03); % Modbus command "03h" Read holding registers
DATA[2] := RWORD(14); % Start address register
DATA[4] := RWORD(16); % Number of registers
ANSWER SIZE 37
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(03); % Modbus command "03h" Read holding registers
DATA[2] = BYTE(32); % Byte count
DATA[3] -> RWORD(DI1 := DATA;);
DATA[5] -> RWORD(DI2 := DATA;);
DATA[7] -> RWORD(DI3 := DATA;);
DATA[9] -> RWORD(DI4 := DATA;);
DATA[11] -> RWORD(DI5 := DATA;);
DATA[13] -> RWORD(DI6 := DATA;);
DATA[15] -> RWORD(DI7 := DATA;);
DATA[17] -> RWORD(DI8 := DATA;);
DATA[19] -> RWORD(DI9 := DATA;);
DATA[21] -> RWORD(DI10 := DATA;);
DATA[23] -> RWORD(DI11 := DATA;);
DATA[25] -> RWORD(DI12 := DATA;);
DATA[27] -> RWORD(DI13 := DATA;);
DATA[29] -> RWORD(DI14 := DATA;);
DATA[31] -> RWORD(DI15 := DATA;);
DATA[33] -> RWORD(DI16 := DATA;);
TIMEOUT 1000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for FIDELIX Digital input Jumper mode
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% No jumper connected 0 = Pulse counting mode
% Pulses longer than minimum pulsewidth are counted.
% Jumper mode upper position 1 = Alarm mode,
% Pulses longer than minimum pulsewidth indicates om RED led
% Jumper mode lower position 2 = Pulse indication mode
% Pulses longer than minimum pulsewidth indicates om GREEN led
% Funktion = 0, Counting mode
% Funktion = 1, Alarm mode
% Funktion = 2, Pulse Indication mode
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2009-01-12
%
DEVICETYPE FidelixDIAlarm NAMED "Fidelix DI Mode" TYPEID 21232 IS
PARAMETER
Id : "Adress";
PUBLIC
DI1 : "Funktion DI1";
DI2 : "Funktion DI2";
DI3 : "Funktion DI3";
DI4 : "Funktion DI4";
DI5 : "Funktion DI5";
DI6 : "Funktion DI6";
DI7 : "Funktion DI7";
DI8 : "Funktion DI8";
DI9 : "Funktion DI9";
DI10 : "Funktion DI10";
DI11 : "Funktion DI11";
DI12 : "Funktion DI12";
DI13 : "Funktion DI13";
DI14 : "Funktion DI14";
DI15 : "Funktion DI15";
DI16 : "Funktion DI16";
PRIVATE
Tmp1;
Tmp2;
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM DigitalMode NAMED "Läs DI mode" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(03); % Modbus command "03h" Read holding registers
DATA[2] := RWORD(1); % Start address register
DATA[4] := RWORD(2); % Number of registers
ANSWER SIZE 9
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(03); % Modbus command "03h" Read holding registers
DATA[2] = BYTE(4); % Byte count
DATA[3] -> RWORD(Tmp1 := DATA;);
DATA[5] -> RWORD(
Tmp2 := DATA;
IF(Tmp1&1) =0 THEN DI1 :=1; ELSIF(Tmp2&1) =0 THEN DI1 :=2; ELSE DI1 :=0; ENDIF;
IF(Tmp1&2) =0 THEN DI2 :=1; ELSIF(Tmp2&2) =0 THEN DI2 :=2; ELSE DI2 :=0; ENDIF;
IF(Tmp1&4) =0 THEN DI3 :=1; ELSIF(Tmp2&4) =0 THEN DI3 :=2; ELSE DI3 :=0; ENDIF;
IF(Tmp1&8) =0 THEN DI4 :=1; ELSIF(Tmp2&8) =0 THEN DI4 :=2; ELSE DI4 :=0; ENDIF;
IF(Tmp1&16) =0 THEN DI5 :=1; ELSIF(Tmp2&16) =0 THEN DI5 :=2; ELSE DI5 :=0; ENDIF;
IF(Tmp1&32) =0 THEN DI6 :=1; ELSIF(Tmp2&32) =0 THEN DI6 :=2; ELSE DI6 :=0; ENDIF;
IF(Tmp1&64) =0 THEN DI7 :=1; ELSIF(Tmp2&64) =0 THEN DI7 :=2; ELSE DI7 :=0; ENDIF;
IF(Tmp1&128) =0 THEN DI8 :=1; ELSIF(Tmp2&128) =0 THEN DI8 :=2; ELSE DI8 :=0; ENDIF;
IF(Tmp1&256) =0 THEN DI9 :=1; ELSIF(Tmp2&256) =0 THEN DI9 :=2; ELSE DI9 :=0; ENDIF;
IF(Tmp1&512) =0 THEN DI10:=1; ELSIF(Tmp2&512) =0 THEN DI10:=2; ELSE DI10:=0; ENDIF;
IF(Tmp1&1024) =0 THEN DI11:=1; ELSIF(Tmp2&1024) =0 THEN DI11:=2; ELSE DI11:=0; ENDIF;
IF(Tmp1&2048) =0 THEN DI12:=1; ELSIF(Tmp2&2048) =0 THEN DI12:=2; ELSE DI12:=0; ENDIF;
IF(Tmp1&4096) =0 THEN DI13:=1; ELSIF(Tmp2&4096) =0 THEN DI13:=2; ELSE DI13:=0; ENDIF;
IF(Tmp1&8192) =0 THEN DI14:=1; ELSIF(Tmp2&8192) =0 THEN DI14:=2; ELSE DI14:=0; ENDIF;
IF(Tmp1&16384)=0 THEN DI15:=1; ELSIF(Tmp2&16384)=0 THEN DI15:=2; ELSE DI15:=0; ENDIF;
IF(Tmp1&32768)=0 THEN DI16:=1; ELSIF(Tmp2&32768)=0 THEN DI16:=2; ELSE DI16:=0; ENDIF;
);
TIMEOUT 1000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for FIDELIX Set minimum pulsewidth
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Register 14-21, DI1-8
% Filter funnction for digital input.
% Minimum pulse width for digital input is set 5 to 1275 ms (1-255).
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2009-01-12
%
DEVICETYPE FidelixDIpulse1 NAMED "Fidelix MinPB1" TYPEID 21233 IS
PARAMETER
Id : "Adress";
P1 : "Minsta puls DI1" ["ms"];
P2 : "Minsta puls DI2" ["ms"];
P3 : "Minsta puls DI3" ["ms"];
P4 : "Minsta puls DI4" ["ms"];
P5 : "Minsta puls DI5" ["ms"];
P6 : "Minsta puls DI6" ["ms"];
P7 : "Minsta puls DI7" ["ms"];
P8 : "Minsta puls DI8" ["ms"];
PUBLIC
PRIVATE
Tmp1;
Tmp2;
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM Pulsewidth1 NAMED "Ställ MinPB1-8" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(10); % Modbus command "0x10" write multiple registers
DATA[2] := RWORD(6); % start register
DATA[4] := RWORD(8); % number of registers to write
DATA[6] := BYTE(16); % number of bytes
DATA[7] <- RWORD(
Tmp1 := P1/5;
IF Tmp1<1 THEN Tmp1:=1;
ELSIF Tmp1>255 THEN Tmp1:=255;
ENDIF;
Tmp2 := P2/5;
IF Tmp2<1 THEN Tmp2:=1;
ELSIF Tmp2>255 THEN Tmp2:=255;
ENDIF;
DATA := Tmp1 + (Tmp2*256);
);
DATA[9] <- RWORD(
Tmp1 := P3/5;
IF Tmp1<1 THEN Tmp1:=1;
ELSIF Tmp1>255 THEN Tmp1:=255;
ENDIF;
Tmp2 := P4/5;
IF Tmp2<1 THEN Tmp2:=1;
ELSIF Tmp2>255 THEN Tmp2:=255;
ENDIF;
DATA := Tmp1 + (Tmp2*256);
);
DATA[11] <- RWORD(
Tmp1 := P5/5;
IF Tmp1<1 THEN Tmp1:=1;
ELSIF Tmp1>255 THEN Tmp1:=255;
ENDIF;
Tmp2 := P6/5;
IF Tmp2<1 THEN Tmp2:=1;
ELSIF Tmp2>255 THEN Tmp2:=255;
ENDIF;
DATA := Tmp1 + (Tmp2*256);
);
DATA[13] <- RWORD(
Tmp1 := P7/5;
IF Tmp1<1 THEN Tmp1:=1;
ELSIF Tmp1>255 THEN Tmp1:=255;
ENDIF;
Tmp2 := P8/5;
IF Tmp2<1 THEN Tmp2:=1;
ELSIF Tmp2>255 THEN Tmp2:=255;
ENDIF;
DATA := Tmp1 + (Tmp2*256);
);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = HEX(10);
%DATA[2] = RWORD(0); % start register
%DATA[4] = RWORD(8); % number of registers to write
TIMEOUT 1000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for FIDELIX Set minimum pulsewidth
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Register 10-13, DI9-16
% Filter funnction for digital input.
% Minimum pulse width for digital input is set 5 to 1275 ms (1-255).
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2009-01-12
%
DEVICETYPE FidelixDIpulse2 NAMED "Fidelix MinPB2" TYPEID 21234 IS
PARAMETER
Id : "Adress";
P9 : "Minsta puls DI9" ["ms"];
P10 : "Minsta puls DI10" ["ms"];
P11 : "Minsta puls DI11" ["ms"];
P12 : "Minsta puls DI12" ["ms"];
P13 : "Minsta puls DI13" ["ms"];
P14 : "Minsta puls DI14" ["ms"];
P15 : "Minsta puls DI15" ["ms"];
P16 : "Minsta puls DI16" ["ms"];
PUBLIC
PRIVATE
Tmp1;
Tmp2;
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM Pulsewidth2 NAMED "Ställ MinPB9-16" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(10); % Modbus command "0x10" write multiple registers
DATA[2] := RWORD(6); % start register
DATA[4] := RWORD(8); % number of registers to write
DATA[6] := BYTE(16); % number of bytes
DATA[7] <- RWORD(
Tmp1 := P9/5;
IF Tmp1<1 THEN Tmp1:=1;
ELSIF Tmp1>255 THEN Tmp1:=255;
ENDIF;
Tmp2 := P10/5;
IF Tmp2<1 THEN Tmp2:=1;
ELSIF Tmp2>255 THEN Tmp2:=255;
ENDIF;
DATA := Tmp1 + (Tmp2*256);
);
DATA[9] <- RWORD(
Tmp1 := P11/5;
IF Tmp1<1 THEN Tmp1:=1;
ELSIF Tmp1>255 THEN Tmp1:=255;
ENDIF;
Tmp2 := P12/5;
IF Tmp2<1 THEN Tmp2:=1;
ELSIF Tmp2>255 THEN Tmp2:=255;
ENDIF;
DATA := Tmp1 + (Tmp2*256);
);
DATA[11] <- RWORD(
Tmp1 := P13/5;
IF Tmp1<1 THEN Tmp1:=1;
ELSIF Tmp1>255 THEN Tmp1:=255;
ENDIF;
Tmp2 := P14/5;
IF Tmp2<1 THEN Tmp2:=1;
ELSIF Tmp2>255 THEN Tmp2:=255;
ENDIF;
DATA := Tmp1 + (Tmp2*256);
);
DATA[13] <- RWORD(
Tmp1 := P15/5;
IF Tmp1<1 THEN Tmp1:=1;
ELSIF Tmp1>255 THEN Tmp1:=255;
ENDIF;
Tmp2 := P16/5;
IF Tmp2<1 THEN Tmp2:=1;
ELSIF Tmp2>255 THEN Tmp2:=255;
ENDIF;
DATA := Tmp1 + (Tmp2*256);
);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = HEX(10);
%DATA[2] = RWORD(0); % start register
%DATA[4] = RWORD(8); % number of registers to write
TIMEOUT 1000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for FIDELIX Set digital leds
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Set leds 9-16
% Indicate Led OFF = 0
% Red = 1
% Green = 2
% Red flashing = 1+4 = 5
% Green flashing = 2+4 = 6
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2009-01-12
%
%DEVICETYPE FidelixDILeds1 NAMED "Fidelix SetLed1" TYPEID 21240 IS
%
% PARAMETER
%
% Id : "Adress";
%
% Led1 : "LED-status DI1";
% Led2 : "LED-status DI2";
% Led3 : "LED-status DI3";
% Led4 : "LED-status DI4";
% Led5 : "LED-status DI5";
% Led6 : "LED-status DI6";
% Led7 : "LED-status DI7";
% Led8 : "LED-status DI8";
% Led9 : "LED-status DI9";
% Led10 : "LED-status DI10"; // To many must be changed
% Led11 : "LED-status DI11";
% Led12 : "LED-status DI12";
% Led13 : "LED-status DI13";
% Led14 : "LED-status DI14";
% Led15 : "LED-status DI15";
% Led16 : "LED-status DI16";
%
% PUBLIC
%
% PRIVATE
% Tmp;
%
% BAUDRATE 9600;
%
% CHECKSUM MODBUS SWAPPED;
%
% TELEGRAM LedStatusOut NAMED "LED-status 1-8" IS
%
% QUESTION
% DATA[0] := BYTE(Id); % Modbus unit address
% DATA[1] := HEX(10); % Modbus command "0x10" write multiple registers
% DATA[2] := RWORD(3); % start register
% DATA[4] := RWORD(3); % number of registers to write
% DATA[6] := BYTE(6); % number of bytes
% DATA[7] <- RWORD(
% Tmp := 0;
% IF (Led1 & 1) THEN Tmp:=Tmp+1; ENDIF;
% IF (Led2 & 1) THEN Tmp:=Tmp+2; ENDIF;
% IF (Led3 & 1) THEN Tmp:=Tmp+4; ENDIF;
% IF (Led4 & 1) THEN Tmp:=Tmp+8; ENDIF;
% IF (Led5 & 1) THEN Tmp:=Tmp+16; ENDIF;
% IF (Led6 & 1) THEN Tmp:=Tmp+32; ENDIF;
% IF (Led7 & 1) THEN Tmp:=Tmp+64; ENDIF;
% IF (Led8 & 1) THEN Tmp:=Tmp+128; ENDIF;
% IF (Led9 & 1) THEN Tmp:=Tmp+256; ENDIF;
% IF (Led10 & 1) THEN Tmp:=Tmp+512; ENDIF;
% IF (Led11 & 1) THEN Tmp:=Tmp+1024; ENDIF;
% IF (Led12 & 1) THEN Tmp:=Tmp+2048; ENDIF;
% IF (Led13 & 1) THEN Tmp:=Tmp+4096; ENDIF;
% IF (Led14 & 1) THEN Tmp:=Tmp+8192; ENDIF;
% IF (Led15 & 1) THEN Tmp:=Tmp+16384; ENDIF;
% IF (Led16 & 1) THEN Tmp:=Tmp+32768; ENDIF;
% DATA := Tmp;
% );
% DATA[9] <- RWORD(
% Tmp := 0;
% IF (Led1 & 2) THEN Tmp:=Tmp+1; ENDIF;
% IF (Led2 & 2) THEN Tmp:=Tmp+2; ENDIF;
% IF (Led3 & 2) THEN Tmp:=Tmp+4; ENDIF;
% IF (Led4 & 2) THEN Tmp:=Tmp+8; ENDIF;
% IF (Led5 & 2) THEN Tmp:=Tmp+16; ENDIF;
% IF (Led6 & 2) THEN Tmp:=Tmp+32; ENDIF;
% IF (Led7 & 2) THEN Tmp:=Tmp+64; ENDIF;
% IF (Led8 & 2) THEN Tmp:=Tmp+128; ENDIF;
% IF (Led9 & 2) THEN Tmp:=Tmp+256; ENDIF;
% IF (Led10 & 2) THEN Tmp:=Tmp+512; ENDIF;
% IF (Led11 & 2) THEN Tmp:=Tmp+1024; ENDIF;
% IF (Led12 & 2) THEN Tmp:=Tmp+2048; ENDIF;
% IF (Led13 & 2) THEN Tmp:=Tmp+4096; ENDIF;
% IF (Led14 & 2) THEN Tmp:=Tmp+8192; ENDIF;
% IF (Led15 & 2) THEN Tmp:=Tmp+16384; ENDIF;
% IF (Led16 & 2) THEN Tmp:=Tmp+32768; ENDIF;
% DATA := Tmp;
% );
% DATA[11]<- RWORD(
% Tmp := 0;
% IF (Led1 & 4) THEN Tmp:=Tmp+1; ENDIF;
% IF (Led2 & 4) THEN Tmp:=Tmp+2; ENDIF;
% IF (Led3 & 4) THEN Tmp:=Tmp+4; ENDIF;
% IF (Led4 & 4) THEN Tmp:=Tmp+8; ENDIF;
% IF (Led5 & 4) THEN Tmp:=Tmp+16; ENDIF;
% IF (Led6 & 4) THEN Tmp:=Tmp+32; ENDIF;
% IF (Led7 & 4) THEN Tmp:=Tmp+64; ENDIF;
% IF (Led8 & 4) THEN Tmp:=Tmp+128; ENDIF;
% IF (Led9 & 4) THEN Tmp:=Tmp+256; ENDIF;
% IF (Led10 & 4) THEN Tmp:=Tmp+512; ENDIF;
% IF (Led11 & 4) THEN Tmp:=Tmp+1024; ENDIF;
% IF (Led12 & 4) THEN Tmp:=Tmp+2048; ENDIF;
% IF (Led13 & 4) THEN Tmp:=Tmp+4096; ENDIF;
% IF (Led14 & 4) THEN Tmp:=Tmp+8192; ENDIF;
% IF (Led15 & 4) THEN Tmp:=Tmp+16384; ENDIF;
% IF (Led16 & 4) THEN Tmp:=Tmp+32768; ENDIF;
% DATA := Tmp;
% );
%
% ANSWER SIZE 8
% DATA[0] = BYTE(Id);
% DATA[1] = HEX(10);
% %DATA[2] = RWORD(3); % start register
% %DATA[4] = RWORD(3); % number of registers to write
%
% TIMEOUT 1000
%
% END;
%
%END;
% Device definition for FIDELIX Digital inputs
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% OBS! Använd "Read holding registers" kommando 3 för Fidelix
%
% If input is connected longer than minimum pulse width
% status is cleared, otherwise set.
% Register 0
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2009-12-14 Ändrat kommando 4 till kommando 3 Read holding registers
%
DEVICETYPE FidelixDI NAMED "Fidelix DI" TYPEID 21230 IS
PARAMETER
Id : "Adress";
PUBLIC
DI1 : "Status DI1";
DI2 : "Status DI2";
DI3 : "Status DI3";
DI4 : "Status DI4";
DI5 : "Status DI5";
DI6 : "Status DI6";
DI7 : "Status DI7";
DI8 : "Status DI8";
DI9 : "Status DI9";
DI10 : "Status DI10";
DI11 : "Status DI11";
DI12 : "Status DI12";
DI13 : "Status DI13";
DI14 : "Status DI14";
DI15 : "Status DI15";
DI16 : "Status DI16";
PRIVATE
Tmp;
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM DigitalInput NAMED "Läs DI" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(03); % Modbus command "03h" Read holding registers
DATA[2] := RWORD(0); % Start address register
DATA[4] := RWORD(1); % Number of registers
ANSWER SIZE 7
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(03); % Modbus command "03h" Read holding registers
DATA[2] = BYTE(2); % Byte count
DATA[3] -> RWORD(
Tmp := DATA;
IF (Tmp & 1) THEN DI1 :=0; ELSE DI1 :=1; ENDIF;
IF (Tmp & 2) THEN DI2 :=0; ELSE DI2 :=1; ENDIF;
IF (Tmp & 4) THEN DI3 :=0; ELSE DI3 :=1; ENDIF;
IF (Tmp & 8) THEN DI4 :=0; ELSE DI4 :=1; ENDIF;
IF (Tmp & 16) THEN DI5 :=0; ELSE DI5 :=1; ENDIF;
IF (Tmp & 32) THEN DI6 :=0; ELSE DI6 :=1; ENDIF;
IF (Tmp & 64) THEN DI7 :=0; ELSE DI7 :=1; ENDIF;
IF (Tmp & 128) THEN DI8 :=0; ELSE DI8 :=1; ENDIF;
IF (Tmp & 256) THEN DI9 :=0; ELSE DI9 :=1; ENDIF;
IF (Tmp & 512) THEN DI10:=0; ELSE DI10:=1; ENDIF;
IF (Tmp & 1024) THEN DI11:=0; ELSE DI11:=1; ENDIF;
IF (Tmp & 2048) THEN DI12:=0; ELSE DI12:=1; ENDIF;
IF (Tmp & 4096) THEN DI13:=0; ELSE DI13:=1; ENDIF;
IF (Tmp & 8192) THEN DI14:=0; ELSE DI14:=1; ENDIF;
IF (Tmp & 16384) THEN DI15:=0; ELSE DI15:=1; ENDIF;
IF (Tmp & 32768) THEN DI16:=0; ELSE DI16:=1; ENDIF;
);
TIMEOUT 1000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for FIDELIX Digital pulse counter
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Pulses longer than corresponding pulse width register are counted.
% Register 14-29
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2009-01-12
%
DEVICETYPE FidelixDICounter NAMED "Fidelix Pulser" TYPEID 21231 IS
PARAMETER
Id : "Adress";
PUBLIC
DI1 : "Pulser DI1";
DI2 : "Pulser DI2";
DI3 : "Pulser DI3";
DI4 : "Pulser DI4";
DI5 : "Pulser DI5";
DI6 : "Pulser DI6";
DI7 : "Pulser DI7";
DI8 : "Pulser DI8";
DI9 : "Pulser DI9";
DI10 : "Pulser DI10";
DI11 : "Pulser DI11";
DI12 : "Pulser DI12";
DI13 : "Pulser DI13";
DI14 : "Pulser DI14";
DI15 : "Pulser DI15";
DI16 : "Pulser DI16";
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM DigitalPulse NAMED "Läs DI pulser" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(03); % Modbus command "03h" Read holding registers
DATA[2] := RWORD(14); % Start address register
DATA[4] := RWORD(16); % Number of registers
ANSWER SIZE 37
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(03); % Modbus command "03h" Read holding registers
DATA[2] = BYTE(32); % Byte count
DATA[3] -> RWORD(DI1 := DATA;);
DATA[5] -> RWORD(DI2 := DATA;);
DATA[7] -> RWORD(DI3 := DATA;);
DATA[9] -> RWORD(DI4 := DATA;);
DATA[11] -> RWORD(DI5 := DATA;);
DATA[13] -> RWORD(DI6 := DATA;);
DATA[15] -> RWORD(DI7 := DATA;);
DATA[17] -> RWORD(DI8 := DATA;);
DATA[19] -> RWORD(DI9 := DATA;);
DATA[21] -> RWORD(DI10 := DATA;);
DATA[23] -> RWORD(DI11 := DATA;);
DATA[25] -> RWORD(DI12 := DATA;);
DATA[27] -> RWORD(DI13 := DATA;);
DATA[29] -> RWORD(DI14 := DATA;);
DATA[31] -> RWORD(DI15 := DATA;);
DATA[33] -> RWORD(DI16 := DATA;);
TIMEOUT 1000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for FIDELIX Digital input Jumper mode
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% No jumper connected 0 = Pulse counting mode
% Pulses longer than minimum pulsewidth are counted.
% Jumper mode upper position 1 = Alarm mode,
% Pulses longer than minimum pulsewidth indicates om RED led
% Jumper mode lower position 2 = Pulse indication mode
% Pulses longer than minimum pulsewidth indicates om GREEN led
% Funktion = 0, Counting mode
% Funktion = 1, Alarm mode
% Funktion = 2, Pulse Indication mode
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2009-01-12
%
DEVICETYPE FidelixDIAlarm NAMED "Fidelix DI Mode" TYPEID 21232 IS
PARAMETER
Id : "Adress";
PUBLIC
DI1 : "Funktion DI1";
DI2 : "Funktion DI2";
DI3 : "Funktion DI3";
DI4 : "Funktion DI4";
DI5 : "Funktion DI5";
DI6 : "Funktion DI6";
DI7 : "Funktion DI7";
DI8 : "Funktion DI8";
DI9 : "Funktion DI9";
DI10 : "Funktion DI10";
DI11 : "Funktion DI11";
DI12 : "Funktion DI12";
DI13 : "Funktion DI13";
DI14 : "Funktion DI14";
DI15 : "Funktion DI15";
DI16 : "Funktion DI16";
PRIVATE
Tmp1;
Tmp2;
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM DigitalMode NAMED "Läs DI mode" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(03); % Modbus command "03h" Read holding registers
DATA[2] := RWORD(1); % Start address register
DATA[4] := RWORD(2); % Number of registers
ANSWER SIZE 9
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(03); % Modbus command "03h" Read holding registers
DATA[2] = BYTE(4); % Byte count
DATA[3] -> RWORD(Tmp1 := DATA;);
DATA[5] -> RWORD(
Tmp2 := DATA;
IF(Tmp1&1) =0 THEN DI1 :=1; ELSIF(Tmp2&1) =0 THEN DI1 :=2; ELSE DI1 :=0; ENDIF;
IF(Tmp1&2) =0 THEN DI2 :=1; ELSIF(Tmp2&2) =0 THEN DI2 :=2; ELSE DI2 :=0; ENDIF;
IF(Tmp1&4) =0 THEN DI3 :=1; ELSIF(Tmp2&4) =0 THEN DI3 :=2; ELSE DI3 :=0; ENDIF;
IF(Tmp1&8) =0 THEN DI4 :=1; ELSIF(Tmp2&8) =0 THEN DI4 :=2; ELSE DI4 :=0; ENDIF;
IF(Tmp1&16) =0 THEN DI5 :=1; ELSIF(Tmp2&16) =0 THEN DI5 :=2; ELSE DI5 :=0; ENDIF;
IF(Tmp1&32) =0 THEN DI6 :=1; ELSIF(Tmp2&32) =0 THEN DI6 :=2; ELSE DI6 :=0; ENDIF;
IF(Tmp1&64) =0 THEN DI7 :=1; ELSIF(Tmp2&64) =0 THEN DI7 :=2; ELSE DI7 :=0; ENDIF;
IF(Tmp1&128) =0 THEN DI8 :=1; ELSIF(Tmp2&128) =0 THEN DI8 :=2; ELSE DI8 :=0; ENDIF;
IF(Tmp1&256) =0 THEN DI9 :=1; ELSIF(Tmp2&256) =0 THEN DI9 :=2; ELSE DI9 :=0; ENDIF;
IF(Tmp1&512) =0 THEN DI10:=1; ELSIF(Tmp2&512) =0 THEN DI10:=2; ELSE DI10:=0; ENDIF;
IF(Tmp1&1024) =0 THEN DI11:=1; ELSIF(Tmp2&1024) =0 THEN DI11:=2; ELSE DI11:=0; ENDIF;
IF(Tmp1&2048) =0 THEN DI12:=1; ELSIF(Tmp2&2048) =0 THEN DI12:=2; ELSE DI12:=0; ENDIF;
IF(Tmp1&4096) =0 THEN DI13:=1; ELSIF(Tmp2&4096) =0 THEN DI13:=2; ELSE DI13:=0; ENDIF;
IF(Tmp1&8192) =0 THEN DI14:=1; ELSIF(Tmp2&8192) =0 THEN DI14:=2; ELSE DI14:=0; ENDIF;
IF(Tmp1&16384)=0 THEN DI15:=1; ELSIF(Tmp2&16384)=0 THEN DI15:=2; ELSE DI15:=0; ENDIF;
IF(Tmp1&32768)=0 THEN DI16:=1; ELSIF(Tmp2&32768)=0 THEN DI16:=2; ELSE DI16:=0; ENDIF;
);
TIMEOUT 1000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for FIDELIX Set minimum pulsewidth
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Register 14-21, DI1-8
% Filter funnction for digital input.
% Minimum pulse width for digital input is set 5 to 1275 ms (1-255).
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2009-01-12
%
DEVICETYPE FidelixDIpulse1 NAMED "Fidelix MinPB1" TYPEID 21233 IS
PARAMETER
Id : "Adress";
P1 : "Minsta puls DI1" ["ms"];
P2 : "Minsta puls DI2" ["ms"];
P3 : "Minsta puls DI3" ["ms"];
P4 : "Minsta puls DI4" ["ms"];
P5 : "Minsta puls DI5" ["ms"];
P6 : "Minsta puls DI6" ["ms"];
P7 : "Minsta puls DI7" ["ms"];
P8 : "Minsta puls DI8" ["ms"];
PUBLIC
PRIVATE
Tmp1;
Tmp2;
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM Pulsewidth1 NAMED "Ställ MinPB1-8" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(10); % Modbus command "0x10" write multiple registers
DATA[2] := RWORD(6); % start register
DATA[4] := RWORD(8); % number of registers to write
DATA[6] := BYTE(16); % number of bytes
DATA[7] <- RWORD(
Tmp1 := P1/5;
IF Tmp1<1 THEN Tmp1:=1;
ELSIF Tmp1>255 THEN Tmp1:=255;
ENDIF;
Tmp2 := P2/5;
IF Tmp2<1 THEN Tmp2:=1;
ELSIF Tmp2>255 THEN Tmp2:=255;
ENDIF;
DATA := Tmp1 + (Tmp2*256);
);
DATA[9] <- RWORD(
Tmp1 := P3/5;
IF Tmp1<1 THEN Tmp1:=1;
ELSIF Tmp1>255 THEN Tmp1:=255;
ENDIF;
Tmp2 := P4/5;
IF Tmp2<1 THEN Tmp2:=1;
ELSIF Tmp2>255 THEN Tmp2:=255;
ENDIF;
DATA := Tmp1 + (Tmp2*256);
);
DATA[11] <- RWORD(
Tmp1 := P5/5;
IF Tmp1<1 THEN Tmp1:=1;
ELSIF Tmp1>255 THEN Tmp1:=255;
ENDIF;
Tmp2 := P6/5;
IF Tmp2<1 THEN Tmp2:=1;
ELSIF Tmp2>255 THEN Tmp2:=255;
ENDIF;
DATA := Tmp1 + (Tmp2*256);
);
DATA[13] <- RWORD(
Tmp1 := P7/5;
IF Tmp1<1 THEN Tmp1:=1;
ELSIF Tmp1>255 THEN Tmp1:=255;
ENDIF;
Tmp2 := P8/5;
IF Tmp2<1 THEN Tmp2:=1;
ELSIF Tmp2>255 THEN Tmp2:=255;
ENDIF;
DATA := Tmp1 + (Tmp2*256);
);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = HEX(10);
%DATA[2] = RWORD(0); % start register
%DATA[4] = RWORD(8); % number of registers to write
TIMEOUT 1000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for FIDELIX Set minimum pulsewidth
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Register 10-13, DI9-16
% Filter funnction for digital input.
% Minimum pulse width for digital input is set 5 to 1275 ms (1-255).
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2009-01-12
%
DEVICETYPE FidelixDIpulse2 NAMED "Fidelix MinPB2" TYPEID 21234 IS
PARAMETER
Id : "Adress";
P9 : "Minsta puls DI9" ["ms"];
P10 : "Minsta puls DI10" ["ms"];
P11 : "Minsta puls DI11" ["ms"];
P12 : "Minsta puls DI12" ["ms"];
P13 : "Minsta puls DI13" ["ms"];
P14 : "Minsta puls DI14" ["ms"];
P15 : "Minsta puls DI15" ["ms"];
P16 : "Minsta puls DI16" ["ms"];
PUBLIC
PRIVATE
Tmp1;
Tmp2;
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM Pulsewidth2 NAMED "Ställ MinPB9-16" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(10); % Modbus command "0x10" write multiple registers
DATA[2] := RWORD(6); % start register
DATA[4] := RWORD(8); % number of registers to write
DATA[6] := BYTE(16); % number of bytes
DATA[7] <- RWORD(
Tmp1 := P9/5;
IF Tmp1<1 THEN Tmp1:=1;
ELSIF Tmp1>255 THEN Tmp1:=255;
ENDIF;
Tmp2 := P10/5;
IF Tmp2<1 THEN Tmp2:=1;
ELSIF Tmp2>255 THEN Tmp2:=255;
ENDIF;
DATA := Tmp1 + (Tmp2*256);
);
DATA[9] <- RWORD(
Tmp1 := P11/5;
IF Tmp1<1 THEN Tmp1:=1;
ELSIF Tmp1>255 THEN Tmp1:=255;
ENDIF;
Tmp2 := P12/5;
IF Tmp2<1 THEN Tmp2:=1;
ELSIF Tmp2>255 THEN Tmp2:=255;
ENDIF;
DATA := Tmp1 + (Tmp2*256);
);
DATA[11] <- RWORD(
Tmp1 := P13/5;
IF Tmp1<1 THEN Tmp1:=1;
ELSIF Tmp1>255 THEN Tmp1:=255;
ENDIF;
Tmp2 := P14/5;
IF Tmp2<1 THEN Tmp2:=1;
ELSIF Tmp2>255 THEN Tmp2:=255;
ENDIF;
DATA := Tmp1 + (Tmp2*256);
);
DATA[13] <- RWORD(
Tmp1 := P15/5;
IF Tmp1<1 THEN Tmp1:=1;
ELSIF Tmp1>255 THEN Tmp1:=255;
ENDIF;
Tmp2 := P16/5;
IF Tmp2<1 THEN Tmp2:=1;
ELSIF Tmp2>255 THEN Tmp2:=255;
ENDIF;
DATA := Tmp1 + (Tmp2*256);
);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = HEX(10);
%DATA[2] = RWORD(0); % start register
%DATA[4] = RWORD(8); % number of registers to write
TIMEOUT 1000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for FIDELIX Set digital leds
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Set leds 9-16
% Indicate Led OFF = 0
% Red = 1
% Green = 2
% Red flashing = 1+4 = 5
% Green flashing = 2+4 = 6
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2009-01-12
%
%DEVICETYPE FidelixDILeds1 NAMED "Fidelix SetLed1" TYPEID 21240 IS
%
% PARAMETER
%
% Id : "Adress";
%
% Led1 : "LED-status DI1";
% Led2 : "LED-status DI2";
% Led3 : "LED-status DI3";
% Led4 : "LED-status DI4";
% Led5 : "LED-status DI5";
% Led6 : "LED-status DI6";
% Led7 : "LED-status DI7";
% Led8 : "LED-status DI8";
% Led9 : "LED-status DI9";
% Led10 : "LED-status DI10"; // To many must be changed
% Led11 : "LED-status DI11";
% Led12 : "LED-status DI12";
% Led13 : "LED-status DI13";
% Led14 : "LED-status DI14";
% Led15 : "LED-status DI15";
% Led16 : "LED-status DI16";
%
% PUBLIC
%
% PRIVATE
% Tmp;
%
% BAUDRATE 9600;
%
% CHECKSUM MODBUS SWAPPED;
%
% TELEGRAM LedStatusOut NAMED "LED-status 1-8" IS
%
% QUESTION
% DATA[0] := BYTE(Id); % Modbus unit address
% DATA[1] := HEX(10); % Modbus command "0x10" write multiple registers
% DATA[2] := RWORD(3); % start register
% DATA[4] := RWORD(3); % number of registers to write
% DATA[6] := BYTE(6); % number of bytes
% DATA[7] <- RWORD(
% Tmp := 0;
% IF (Led1 & 1) THEN Tmp:=Tmp+1; ENDIF;
% IF (Led2 & 1) THEN Tmp:=Tmp+2; ENDIF;
% IF (Led3 & 1) THEN Tmp:=Tmp+4; ENDIF;
% IF (Led4 & 1) THEN Tmp:=Tmp+8; ENDIF;
% IF (Led5 & 1) THEN Tmp:=Tmp+16; ENDIF;
% IF (Led6 & 1) THEN Tmp:=Tmp+32; ENDIF;
% IF (Led7 & 1) THEN Tmp:=Tmp+64; ENDIF;
% IF (Led8 & 1) THEN Tmp:=Tmp+128; ENDIF;
% IF (Led9 & 1) THEN Tmp:=Tmp+256; ENDIF;
% IF (Led10 & 1) THEN Tmp:=Tmp+512; ENDIF;
% IF (Led11 & 1) THEN Tmp:=Tmp+1024; ENDIF;
% IF (Led12 & 1) THEN Tmp:=Tmp+2048; ENDIF;
% IF (Led13 & 1) THEN Tmp:=Tmp+4096; ENDIF;
% IF (Led14 & 1) THEN Tmp:=Tmp+8192; ENDIF;
% IF (Led15 & 1) THEN Tmp:=Tmp+16384; ENDIF;
% IF (Led16 & 1) THEN Tmp:=Tmp+32768; ENDIF;
% DATA := Tmp;
% );
% DATA[9] <- RWORD(
% Tmp := 0;
% IF (Led1 & 2) THEN Tmp:=Tmp+1; ENDIF;
% IF (Led2 & 2) THEN Tmp:=Tmp+2; ENDIF;
% IF (Led3 & 2) THEN Tmp:=Tmp+4; ENDIF;
% IF (Led4 & 2) THEN Tmp:=Tmp+8; ENDIF;
% IF (Led5 & 2) THEN Tmp:=Tmp+16; ENDIF;
% IF (Led6 & 2) THEN Tmp:=Tmp+32; ENDIF;
% IF (Led7 & 2) THEN Tmp:=Tmp+64; ENDIF;
% IF (Led8 & 2) THEN Tmp:=Tmp+128; ENDIF;
% IF (Led9 & 2) THEN Tmp:=Tmp+256; ENDIF;
% IF (Led10 & 2) THEN Tmp:=Tmp+512; ENDIF;
% IF (Led11 & 2) THEN Tmp:=Tmp+1024; ENDIF;
% IF (Led12 & 2) THEN Tmp:=Tmp+2048; ENDIF;
% IF (Led13 & 2) THEN Tmp:=Tmp+4096; ENDIF;
% IF (Led14 & 2) THEN Tmp:=Tmp+8192; ENDIF;
% IF (Led15 & 2) THEN Tmp:=Tmp+16384; ENDIF;
% IF (Led16 & 2) THEN Tmp:=Tmp+32768; ENDIF;
% DATA := Tmp;
% );
% DATA[11]<- RWORD(
% Tmp := 0;
% IF (Led1 & 4) THEN Tmp:=Tmp+1; ENDIF;
% IF (Led2 & 4) THEN Tmp:=Tmp+2; ENDIF;
% IF (Led3 & 4) THEN Tmp:=Tmp+4; ENDIF;
% IF (Led4 & 4) THEN Tmp:=Tmp+8; ENDIF;
% IF (Led5 & 4) THEN Tmp:=Tmp+16; ENDIF;
% IF (Led6 & 4) THEN Tmp:=Tmp+32; ENDIF;
% IF (Led7 & 4) THEN Tmp:=Tmp+64; ENDIF;
% IF (Led8 & 4) THEN Tmp:=Tmp+128; ENDIF;
% IF (Led9 & 4) THEN Tmp:=Tmp+256; ENDIF;
% IF (Led10 & 4) THEN Tmp:=Tmp+512; ENDIF;
% IF (Led11 & 4) THEN Tmp:=Tmp+1024; ENDIF;
% IF (Led12 & 4) THEN Tmp:=Tmp+2048; ENDIF;
% IF (Led13 & 4) THEN Tmp:=Tmp+4096; ENDIF;
% IF (Led14 & 4) THEN Tmp:=Tmp+8192; ENDIF;
% IF (Led15 & 4) THEN Tmp:=Tmp+16384; ENDIF;
% IF (Led16 & 4) THEN Tmp:=Tmp+32768; ENDIF;
% DATA := Tmp;
% );
%
% ANSWER SIZE 8
% DATA[0] = BYTE(Id);
% DATA[1] = HEX(10);
% %DATA[2] = RWORD(3); % start register
% %DATA[4] = RWORD(3); % number of registers to write
%
% TIMEOUT 1000
%
% 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.