You are on page 1of 11

SOYAL

AR-401E
PROTOCOL

Version : 1.4

2003/12/29

Web:http://www.soyal.com/ E-mail: tech@soyal.com


1 Communication Protocol
All SOYAL® devices use the same protocol, only the commands given vary depending on
different devices

1.1 Preparing Connect:


Prior to connection to AR-401E, the node number of the device has to be setting by DIP switch.

1.2 Data Format:


Baud Rate 9600,N,8,1
Data Format Binary HEX Data
Data Packet
Head Length Destination ID Command Code Data … XOR SUM
8bits 8bits 8bits 8bits 8bits 8bits

1.3 Data packed :


Size Description XOR SUM
(Byte) 0xFF 0x00
Head 1 0x7E No No
Length 1 Data Length Indicator which denotes the No No
length from Destination to the end including
XOR and SUM
Destinati 1 Destination Node ID Yes Yes
on ID 00: Reserved for the bus master
FF: Broadcast to each reader
Comman 1 Instruction Command Yes Yes
d Code
Data 00 Length of Data Block which varies depending Yes Yes
~ on instructions
D0
XOR 1 To XOR each byte from Destination ID to Data Yes
with 0xFF
SUM 1 TO sum each byte from Destination to XOR
with 0x00. If the summary is greater than
0xFF, it should keep the low byte.

Example:Polling Status from Node. 1


Head Length Destination Command Data … XOR SUM
0x7E 0x04 0x01 0x18 0xE6 0xFF
XOR = 0xFF ^ 0x01 ^ 0x18 = 0xE6 SUM = 0x01 + 0x18 + 0xE6 = 0xFF
Node ID needs to set from the keypad。Please refer to the command list for- 00*
2 Command List
2.1 12H Get Device Parameters
Send Value Description
Head 7E Initial Value
Length 04 Data Length Indicator which denotes the length from Destination
ID to the end including XOR and SUM
Destination 01 Destination Node ID, it refers node 1 here
ID
Command 12 Get the current device status
XOR XOR= FF^01^12
SUM SUM= 01+12+E6

The device respond depending on different status as follows


Echo Value

Head 7E Initial Value

Data Length Indicator which denotes the length from Node to the end
Length ??
including XOR and SUM

Destination 00 Destination Node ID. 00H mean send to host ( PC )

Function
03 03H is echo request data.
Code

Source SID Source Node ID. (Who send);

41H Type of AR401E

Version H.L Version H.L in High/Low nibble

Option Option of AR401E (Reserved)

16
Node-I 16 Bytes of Channel-I Node type form node 1 to 16
Bytes

16
Node-II 16 Bytes of Channel-II Node type form node 1 to 16
Bytes

XOR Check byte

SUM Check byte

Type of sub module define NODE_NULL(0x00), NODE_DI16(0x81),NODE_RO16(0x82)


2.2 20H Set Device Parameters
Send Value Description
Head 7E Initial Value
Length 04 Data Length Indicator which denotes the length from Destination
ID to the end including XOR and SUM
Destination 01 Destination Node ID, it refers node 1 here
ID
Command 20 Set the device Parameters
Complement of Destination Node ( ~ DID )
0 Reserved, Must be 0
16 bytes Sub Node Type of Channel I
16 bytes Sub Node Type of Channel II
XOR XOR
SUM SUM

The device respond depending on different status as follows


Echo Value

Head 7E Initial Value

Data Length Indicator which denotes the length from Node to the end
Length ??
including XOR and SUM

Destination 00 Destination Node ID. 00H mean send to host ( PC )

Function
04 04H/05H -> ACK / NACK
Code

XOR Check byte

SUM Check byte


2.3 15H Get Sub Node Link Status
Send Value Description
Head 7E Initial Value
Length 04 Data Length Indicator which denotes the length from Destination
ID to the end including XOR and SUM
Destination 01 Destination Node ID, it refers node 1 here
ID
Command 15 Get the current device status
XOR XOR
SUM SUM

The device respond depending on different status as follows


Echo Value

Head 7E Initial Value

Data Length Indicator which denotes the length from Node to the end
Length ??
including XOR and SUM

Destination 00 Destination Node ID. 00H mean send to host ( PC )

Function
03 03H is echo request data.
Code

16 16 Bytes of Channel-I Status form node 1 to 16


Node-I
Bytes 00H: Online, 8xH Offline

16 16 Bytes of Channel-II Status form node 1 to 16


Node-II
Bytes 00H: Online, 8xH Offline

XOR Check byte

SUM Check byte


2.4 28H Set controlor time

command example description


7E 7E Initial Value
LEN 0B Data Length Indicator which denotes the length from Destination ID to the
end including XOR and SUM
DID 01 Node ID of destination,the node ID is 01here
CTL 28 Function code:
Set controller time
SEC 01 sec 01h = 01 sec
MIN 02 minute 02h = 02 minute
HR 03 hour 03h = 03 hour
WEEK 04 weeks 04h = wed.
DAY 05 day 05h = 5 day
MON 06 month 06h = 6 month
YEAR 07 year 07h = 07year (2007year)
XOR D6 XOR=FF^01^28^01^02^03^04^05^06^07 =D6
SUM 1B SUM=(01+28+01+02+03+04+05+06+07+D6)・FF=1B(select the LSB)

Echo value description


7E 7E Initial Value
LEN 07 Data Length Indicator which denotes the length from Node to the end
including XOR and SUM
00 00 The value 00 is fixed, the message would be sent to PC from the device
CTL 01 Command Acknowledge( ACK )
SID 01 Device ID of data source
Rev1 00 reserved
Rev2 01 reserved
XOR FE XOR=FF^00^01^01^00^01 =FE
SUM 01 SUM=(00+01+01+00+01+FE).FF=01(select the LSB)
2.5 19H Set controlor time
command example description
7E 7E Initial Value
LEN 04 Data Length Indicator which denotes the length from Destination ID to the
end including XOR and SUM
DID 01 Node ID of destination, the node ID is 01here
CTL 19 Function code:
Get conllor time
XOR E7 XOR=FF^01^19 =E7
SUM 01 SUM=(01+19+E7)・FF=01(select the LSB)

Echo value description


7E 7E Initial Value
LEN 0E Data Length Indicatior which denotes the length from Node to the end
including XOR and SUM
00 00 The value 00 is fixed, the message would be sent to PC from the device
CTL 03 Response to the request
SID 01 Device ID of data source
SEC 08 sec 08h = 08sec
MIN 17 minute 17h = 23minute
HR 12 hour 12h = 18hour (24hours)
WEEK 05 week 05h = thur. Data code

sunday 01
monday 02
tuesday 03
wednesday 04
thursday 05
friday 06
saturday 07
DAY 1D Day 1D = 29 day
MON 0C Mon 0C = 12 mon
YEAR 05 Year 05 = 05year(mean2005year)
Rev1 00 reserved
Rev2 02 reserved
XOR E3 XOR=FF^00^03^01^08^17^12^05^1D^0C^05^00^02 =E3
SUM 4D SUM=(00+03+01+08+17+12+05+1D+0C+05+00+02+E3)・FF=4D(select the
LSB)
2.6 25H – Read Controller Message
Command Example Description
7E 7E Header
LEN 04 Data Length. Counts from the DID byte until the examination code SUM as
the total length.
DID 01 Node ID of destination device; this example pointed to Device “01”.
CTL 25 Function code:
Read controller message
XOR DB XOR=FF^01^25 =DB
SUM 01 SUM=(01+25+DB).FF=01(Select the LSB)

2.7 37H – Delete Controller Message


command example description
7E 7E Initial Value
LEN 07 Data Length Indicator which denotes the length from Destination ID to the
end including XOR and SUM
DID 01 Node ID of destination,the node ID is 01here
CTL 37 Function code:
Delete Controller Message
Delete 44 D ASCll code
45 E ASCll code
4C L ASCll code
XOR 84 XOR=FF^01^37^44^45^4C =84
SUM 91 SUM= (01+37+44+45+4C+84).FF=91{select the LSB)

Echo value description


7E 7E Initial Value
LEN 07 Data Length Indicator which denotes the length from Node to the end
including XOR and SUM
00 00 The value 00 is fixed, the message would be sent to PC from the device
CTL 01 Command Acknowledge( ACK )
SID 01 Device ID of data source
Rev1 00 reserved
Rev2 01 reserved
XOR FE XOR=FF^00^01^01^00^01 =FE
SUM 01 SUM=(00+01+01+00+01+FE).FF=01(select the LSB)
2.8 2DH – Clear All Controller Message
command example description
7E 7E Initial Value
LEN 0A Data Length Indicator which denotes the length from Destination ID to the
end including XOR and SUM
DID 01 Node ID of destination, the node ID is 01here
CTL 2D Function code:
Clear all message
Delete 44 D ASCll code
All 45 E ASCll code
4C L ASCll code
41 A ASCll code
4C L ASCll code
4C L ASCll code
XOR DF XOR=FF^01^2D^44^45^4C^41^4C^4C =DF
SUM BB SUM=(01+2D+44+45+4C+41+4C+4C+DF)・FF=BB(scele)

Echo Value description


7E 7E Initial Value
LEN 07 Data Length Indicatior which denotes the length from Node to the end
including XOR and SUM
00 00 The value 00 is fixed, the message would be sent to PC from the device
CTL 01 Command Acknowledge( ACK )
SID 01 Device ID of data source
Rev1 00 reserved
Rev2 01 reserved
XOR FE XOR=FF^00^01^01^00^01 =FE
SUM 01 SUM=(00+01+01+00+01+FE).FF=01(select the LSB)
2.9 69H – Get I/O Status
command example description
7E 7E Initial Value
LEN xx Data Length Indicator which denotes the length from Destination ID to the
end including XOR and SUM
DID 01 Node ID of destination, the node ID is 01here
CTL 69 Function code
High byte of Start Address of IO
Low byte of Start Address of IO
High byte of End Address of IO
Low byte of End Address of IO
XOR DF XOR
SUM BB SUM

Echo Value description


7E 7E Initial Value
LEN 07 Data Length Indicator which denotes the length from Node to the end
including XOR and SUM
00 00 The value 00 is fixed, the message would be sent to PC from the device
CTL 03 Control Code for Echo data
Data Byte

XOR FE XOR
SUM 01 SUM
Data Byte Format:
Each IO has two bits to indicator the DI/RO status.
00: Open / Off
01: Close / On
10: Break / Flashing
2.10 6AH Set I/O Status
command example description
7E 7E Initial Value
LEN xx Data Length Indicator which denotes the length from Destination ID to the
end including XOR and SUM
DID 01 Node ID of destination, the node ID is 01here
CTL 6A Function code
High byte of Start Address of IO
Low byte of Start Address of IO
High byte of End Address of IO
Low byte of End Address of IO
IO status (*1) (*2)

XOR DF XOR
SUM BB SUM

Echo value description


7E 7E Initial Value
LEN 07 Data Length Indicator which denotes the length from Node to the end
including XOR and SUM
00 00 The value 00 is fixed, the message would be sent to PC from the device
CTL 01 Command Acknowledge( ACK )
SID 01 Device ID of data source
Rev1 00 reserved
Rev2 01 reserved
XOR FE XOR=FF^00^01^01^00^01 =FE
SUM 01 SUM=(00+01+01+00+01+FE).FF=01(select the LSB)
(*1) Data Byte Format:
Each IO has two bits to indicator the RO status.
00: Off
01: On
10: Flashing
(*2) Only Output and virtual I/O will effected to this command.

You might also like