Barix X8 konfigureringsskript
Detaljer
- Typ
- Drivrutin
- Upplaggd av
- Ove Jansson, Abelko Innovation
- Version
- 5
- Uppdaterad
- 2013-12-03
- Skapad
- 2013-12-03
- Kategori
- IO enheter, Modbus
- Visningar
- 3379
Beskrivning
Barix X8 är en trevlig liten enhet som kan fungera som
- 8st digital input
- 8st digital output
- 0-5V analog input
- Lokal temperatur 8st Barix TS digitala sensorer (OneWire)
- WIEGAND läsare 2 inputs + 6 med standard io funktioner)
Det här är ett skript för att konfigurera Barix X8 IO enheten.
Bruksanvisning
Bruksanvisning på Engelska barixx8_manual_V200.pdf (1,9MB).
Juridisk information
Alla skript tillhandahålls i befintligt skick och all användning sker på eget ansvar. Felaktig använding kan leda till skadad eller förstörd utrustning.
Skript kod
DEVICETYPE BarixX8Config NAMED "Barix X8 Config" TYPEID 21458
IS
PARAMETER
Id :"Address";
Sn1 :"Serienr del 1";
Sn2 :"Serienr del 2";
Resistor : "Pull-up resistor";
Baudrate : "Baudrate"; % only 19200 or 9600
Wiegand : "WIEGAND support"; % 1 to enable
parity : "Parity"; % 0=EVEN, 1=ODD
output: "I or O"; % 0=input, 1=output
PUBLIC
PRIVATE
tmp;
BAUDRATE 19200; % manually switch between 9600 and 19200 if the first doesn't succed
PARITY EVEN; % manually switch between parity none (comment the whole row with %) or PARITY EVEN;
CHECKSUM MODBUS SWAPPED;
TELEGRAM wConfig NAMED "wConfig" IS
QUESTION
DATA[0] := BYTE(0); % Broadcast
DATA[1] := HEX(45); % Command 69
DATA[2] := BYTE(Sn1); % First part of the serial number
DATA[3] := BYTE(Sn2); % Second part of the serial number
DATA[4] := BYTE(Sn1); % First part of the serial number
DATA[5] := BYTE(Sn2); % Second part of the serial number
DATA[6] <- BYTE(IF(Resistor>0) THEN DATA := 1; ELSE DATA := 0; ENDIF;);
DATA[7] <- BYTE(
tmp := 0;
IF(Baudrate=9600) THEN tmp := 1; ENDIF;
IF(Wiegand=1) THEN tmp := tmp + 64; ENDIF;
IF(parity=1) THEN tmp := tmp +128; ENDIF;
);
DATA[8] := BYTE(Id); % Set this address
DATA[9] <- ( IF(output=1) THEN DATA := 1; ELSE DATA := 0; ENDIF;);
ANSWER SIZE 8
DATA[0] := BYTE(0); % Broadcast
DATA[1] := HEX(45); % Command 69
DATA[2] := BYTE(Sn1); % First part of the serial number
DATA[3] := BYTE(Sn2); % Second part of the serial number
DATA[4] := BYTE(Sn1); % First part of the serial number
DATA[5] := BYTE(Sn2); % Second part of the serial number
TIMEOUT 300
END;
END;
IS
PARAMETER
Id :"Address";
Sn1 :"Serienr del 1";
Sn2 :"Serienr del 2";
Resistor : "Pull-up resistor";
Baudrate : "Baudrate"; % only 19200 or 9600
Wiegand : "WIEGAND support"; % 1 to enable
parity : "Parity"; % 0=EVEN, 1=ODD
output: "I or O"; % 0=input, 1=output
PUBLIC
PRIVATE
tmp;
BAUDRATE 19200; % manually switch between 9600 and 19200 if the first doesn't succed
PARITY EVEN; % manually switch between parity none (comment the whole row with %) or PARITY EVEN;
CHECKSUM MODBUS SWAPPED;
TELEGRAM wConfig NAMED "wConfig" IS
QUESTION
DATA[0] := BYTE(0); % Broadcast
DATA[1] := HEX(45); % Command 69
DATA[2] := BYTE(Sn1); % First part of the serial number
DATA[3] := BYTE(Sn2); % Second part of the serial number
DATA[4] := BYTE(Sn1); % First part of the serial number
DATA[5] := BYTE(Sn2); % Second part of the serial number
DATA[6] <- BYTE(IF(Resistor>0) THEN DATA := 1; ELSE DATA := 0; ENDIF;);
DATA[7] <- BYTE(
tmp := 0;
IF(Baudrate=9600) THEN tmp := 1; ENDIF;
IF(Wiegand=1) THEN tmp := tmp + 64; ENDIF;
IF(parity=1) THEN tmp := tmp +128; ENDIF;
);
DATA[8] := BYTE(Id); % Set this address
DATA[9] <- ( IF(output=1) THEN DATA := 1; ELSE DATA := 0; ENDIF;);
ANSWER SIZE 8
DATA[0] := BYTE(0); % Broadcast
DATA[1] := HEX(45); % Command 69
DATA[2] := BYTE(Sn1); % First part of the serial number
DATA[3] := BYTE(Sn2); % Second part of the serial number
DATA[4] := BYTE(Sn1); % First part of the serial number
DATA[5] := BYTE(Sn2); % Second part of the serial number
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.