Chapter 6 RS 485/232 Communication Protocol
6 RS 485/232 Communication Protocol 6.1. RS- 485/232 Communication Protocol: General Description Communication between the Local Site Controller LSC and the STAR READER is based on the master/slave approach. The LSC is the MASTER unit, the READERS are the SLAVE units. The LSC and the READERS communicate via a RS-485 multi drop or RS-232 connection. Each READER has its own address, enabling the LSC to approach each reader individually. 6.2. Physical Layer 6.2.1.
6 RS 485/232 Communication Protocol There are 2 types of commands: SHORT COMMANDS and LONG COMMANDS. Short Commands: Long Commands: These are commands that are relevant to internal tasks at the reader level. These commands involve sessions with seals. The READER will respond to commands generated by the LSC within TRLSC seconds. For short commands, response time should be: TRLSC = 50 msec.
6 RS 485/232 Communication Protocol Short Commands Mode: Long Commands Mode: Hi-G-Tek Ltd.
6 RS 485/232 Communication Protocol 6.4. String Formats. 6.4.1. LSC to READERS messages. Commands & Acknowledge strings: CRC STX 1 #B 2 R# 2 CMND 2 data n CRC 2 ETX 1 # of bytes #B Where: STX #B R# CMND DATA CRC ETX This is the marker for the beginning of the messages. STX = 02 hex. String length, the string contains the R#,CMND, the DATA field, and the CRC. This session's READER address . This session's command code .
RS 485/232 Communication Protocol 6.4.1.2. CMND Field Structure. The command field is divided into several sections: Where: DIR PK ERR CT CC Denotes string direction. In case of a command from the LSC to the reader, it is equal to 0. Denotes whether the command transmitted is composed of packets or not. PK = 0 is for non-packet commands. PK = 1 is for packet commands. this flag indicates an error. ERR = 0 no error. ERR = 1 Error. The first byte in the data field is the error code.
6 RS 485/232 Communication Protocol 6.4.2. Reader to LSC Message Response & Acknowledge strings: STX #B R# MSGT MC R_status DATA CRC ETX This is the marker for the beginning of the messages. STX=02 hex. String length, the string contains the R#, MSGT, MC, R_status, the DATA field and the CRC. This is the address of the READER for the current session. This is the message type response for the current session. The MSGT corresponds to a specific command (see paragraph 6.4.2.
6 RS 485/232 Communication Protocol 6.4.2.1. MSGT Field Structure. The Message Type field is divided into several sections: Where: DIR PK Is the string direction.Response will be 1. Denotes whether the transmitted message is composed of packets. A response of 1 indicates that the message is composed of packets. If the response is 0, the message was transmitted without packets. (If PK=0 there must be 1 reserved data byte). ERR This flag indicates an error. ERR = 0 no error. ERR = 1 Error.
6 RS 485/232 Communication Protocol 6.4.2.2. R_Status Field Structure The READER's STATUS field is 4 bytes. Byte A Byte B Byte C Byte D Byte A represents the status of the main motherboard MCU. The other bytes represent the RF modems' status. In a general Reader response the R-Status reply contains bytes A&B only. In a GET Status command, the reply contains all the R-Status bytes.
6 RS 485/232 Communication Protocol PER If the response is 0, the parameters in the MCU's E2ROM are OK. If the answer is 1, parameters are corrupted. VCCERR If response is 0, internal power is OK. If response is 1, internal power is faulty. VBERR If response shows 0, internal battery is OK. If response is1, internal battery is faulty. PMC If response is 0, program memory in the MCU is OK. If response is 1, program memory is corrupted.
6 RS 485/232 Communication Protocol Ch1err Ch2err Ch3err Ch4err If 0, channel is OK If 1, channel is defective, details are in byte C. If byte C flags are OK, there is a communication failure with this channel.I If 0, channe2 is OK. If 1, channe2 is defective, details are in byte C. If byte C flags are OK, there is a communication failure with this channel. If 0, channe3 is OK. If 1, channe3 is defective, details are in byte D. If byte D flags are OK, there is a communication failure with this channel.
6 RS 485/232 Communication Protocol 6.4.2.3. Reader Messages Packed Data Format Where: PK P# Ch The first byte is the total number of packets in the string. The second byte is the packet serial number. The third byte is the channel number from which the message is received. Maximum total message length is 128 bytes. Maximum Data* length is 115 bytes. 6.4.2.3.1. Packed Data from the LSC.
6 RS 485/232 Communication Protocol 6.5. LSC and Reader Messages. 6.5.1. LSC Commands and Acknowledge Table: # Commands Command Code Set Comments 1 Wakeup E0 h 2 20 h 3 Execute RF cmnd Get Results 4 Get Status 16 h 5 Get Burs t Mess age 1C h 6 Reset Reader Write Parameters 14 h This comm and wakens REA DERS it hat were in sl eep mode. This comm and generates an appropriat e comm and from the READE R to the tags .
6 RS 485/232 Communication Protocol 6.5.2.
6 RS 485/232 Communication Protocol 6.5.3.
6 RS 485/232 Communication Protocol Parameters Format: 6.5.3.1. Reader Master Firmware Version MVER, MVER is the version of the master firmware. This is a read only parameter. Bits assignment: 6.5.3.2. Reader Slave1 Firmware Version SVER1. SVER1 is the version of the first slave's firmware. This is a read only parameter. Bits assignment: 6.5.3.3. Reader Slave1 Firmware Version SVER2, SVER2 is the version of the second slave's firmware. This is a read only parameter. Bits assignment: Hi-G-Tek Ltd.
6 RS 485/232 Communication Protocol 6.5.3.4. Reader's receives signal strength RSSI1, RSSI1 is the amplitude of the received signal from the READER at the first channel. This value indicates the link's properties to the READER and the system. Bits assignment: 7 0 1 byte Reader's receives signal strength RSSI2, RSSI2 is the amplitude of the received signal from the READER at the second channel. This value indicates the link's properties to the READER and the system. Bits assignment: 7 0 1 byte 6.5.3.5.
6 RS 485/232 Communication Protocol 6.5.3.6. Group Access Identifier ADI. The identifier allows the READER to access groups that conform to this value. Bits assignment: 7 0 High byte 7 0 mid byte 7 0 mid byte 7 0 Low byte 6.5.3.7. Organization identifier OrgID*, This is the end user's identifier. This parameter is used to segregate between companies. Bits assignment: 7 0 High byte 7 0 Low byte * See paragraph 5.3.3. 6.5.3.8. Department DEP This is the customer's department identifier.
6 RS 485/232 Communication Protocol 6.5.3.9. Reader IH length Thw This is the Reader's IH string length. The values may be modified for a specific application. Bits assignment: 7 0 High byte 7 0 Low byte 6.5.3.10. Reader Address RADD. This is the Reader's address on the RS-485 link. For RS-232, the value is 0xFFFF Bits assignment: 7 0 High byte 7 0 Low byte 6.5.3.11. Mode MODE. The MODE parameter determines the operating mode of the Reader. Each bit indicates another feature.
6 RS 485/232 Communication Protocol UNSYNC In the unsynchronized commands such as Unsynchronized Alert, the Reader's receiver must be ON at all times, waiting for incoming messages from the seals. The mode will be set according to the flag's value: UNSYNC=0 Synchronized mode only. UNSYNC=1 Unsynchronized mode in use, receiver should be set to ON. ABMSG Burst Messages.
6 RS 485/232 Communication Protocol 6.5.5. Detailed Commands. 6.5.5.1. Wakeup 6.5.5.1.1. Command Transmission To wake a READER in sleep mode, a very short string must be sent by the LSC. This will be detected by the hardware and will awaken the READER. As this is a hardware-oriented command, the format is different then all the other commands. LSC > Reader 6.5.5.1.2. Wakeup Response A WAKEUP string transmission wakens the READER. The READER does not respond to such a string.
6 RS 485/232 Communication Protocol Where the channel field is one of the following: Channel Channel 1 Channel 2 Code 01 h 02 h Time&Date are the current Time and Date of the LSC. ADI NOTE: This parameter allows the User to subgroup seals. If the response indicates 0,the Reader uses its internal value for ADI. If not, this is the value which will be transmitted to the seals. In the Data Field, #B includes the Time & Data and ADI fields. 6.5.5.2.2. Execute RF Command ACK.
6 RS 485/232 Communication Protocol 6.5.5.2.3. Verify. The Verify command is carried through the high frequency modem. The data field in the Execute RF Command will be: Where: #B Cnmd* Tcm Tiw Ts Na Nr Nt #Rr #Rt ASID Parameters Mask is the number of bytes in the string from the Cmnd* field up to the ADI field. is the opcode of the RF command. The duration of the calibration message window. Resolution is in units of 1024 msec. The duration of the READER interlace window.
6 RS 485/232 Communication Protocol Bit Mask should comply with the following table: 6.5.5.2.4. Tamper The Tamper command is intended solely for interrogation of tampered Seals. This command is identical to the Verify command except for the opcode which is 11h. In accordance to this, only Seals that have detected tamper status will respond. The aim of this command is to provide high priority to tampered Seals in a crowded Seal environment. 6.5.5.2.5.
6 RS 485/232 Communication Protocol Where: P# PK CRCp CRCt The high 4 bits of the first byte are the packet serial number. The low 4 bits of the first byte are the total number of packets in the BMM string. Is the CRC of the packet. Is the CRC of the tag or seal TF & TID 6.5.5.2.6. Suspended set The Suspended Set command is the command used when it is necessary to prepare a large number of Seals.
6 RS 485/232 Communication Protocol 6.5.5.2.8. Deep Sleep 6.5.5.2.9. Hard Wakeup Hard Wakeup is the command used to wake the seal from deep sleep mode. 6.5.5.2.10. Start Alert Burst Mode Starting all seals. Starting specific tags. Hi-G-Tek Ltd.
6 RS 485/232 Communication Protocol 6.5.5.2.11. Stop Alert Burst Mode Stopping all tags. Data* #B* (09 h) 1 Cmnd* (39h) 1 # of bytes Stopping specific tags Data* #B* (n h) 1 Cmnd* (B9h) 1 PK/P# TF TID CRC TF TID CRC TF TID CRC 1 2 4 2 2 4 2 2 4 2 Seal #1 # of bytes Seal #j Seal #2 6.5.5.2.12. Acknowledge Alert Burst Mode Data* #B* (n h) 1 Cmnd* (BBh) 1 PK/P# TF TID CRC TF TID CRC TF TID CRC 1 2 4 2 2 4 2 2 4 2 Seal #1 # of bytes Seal #j Seal #2 6.5.5.
6 RS 485/232 Communication Protocol 6.5.5.2.14. Write Data Data* #B* (n h) 1 Cmnd* (68h) 1 TF TID PK/P# 2 4 1 BA Base address 2 Data # of bytes m PK/P# = 11h. At present the packets are fixed. 6.5.5.2.15. Reset Data Data* #B* (nh) Cmnd* (AAh) PK/P# TF TID CRCt TF8 TID8 CRC8 1 1 1 2 4 2 2 4 2 Seal #1 # of bytes Seal #8 Up to 8 seals can be reset in one cycle 6.5.5.2.16. Set/Reset Status.
6 RS 485/232 Communication Protocol 6.5.5.2.17. Write Parameters TF&TID=00 is for a broadcast command. PK/P# = 11h. At present the packets are fixed. 6.5.5.2.18. Read Parameters 6.5.5.2.19. Addressed Verify The following parameters are not applicable to this command: Na, Nt, Rt. 6.5.5.2.20. Read Events Where: EV# #EV is the sequential number of the first Event. is the number of events to be read from the memory. Hi-G-Tek Ltd.
6 RS 485/232 Communication Protocol 6.5.5.3. Get Results 6.5.5.3.1. Command Transmission This command is used to retrieve the results after an RF communication session. LSC > Reader STX 1 #B 2 R# 2 CMND(0015h) 2 Channel 1 CRC 2 ETX 1 # of bytes Channel indicates the source channel for the results. The value is according to the table in paragraph 5.5.2.1. 6.5.5.3.2.
6 RS 485/232 Communication Protocol PK P# Data* Total number of packets. Packet number sequence number. This string contains the seal records. The field should first be concentrated from all packets before being analyzed.
6 RS 485/232 Communication Protocol For the case of an unfinished RF session the complete response is: Reader > LSC STX 1 #B 2 R# 2 MSGT(xx15h) 2 R_status 2 error 1 CRC 2 ETX 1 # of bytes 6.5.5.3.3. Get Results Command Response for Verify Command. The response data field is a string of data received from all the seals. Each seal record is marked with the seal's TF&ID. The internal data field is according to the Parameters mask transmitted with the Verify command.
6 RS 485/232 Communication Protocol 6.5.5.3.4. Get Results Command Response for Tamper Command. Results are the same as for the Verify command. 6.5.5.3.5. Get Results Command Response for SET Command. Reader > LSC Data** TF TID Message Type 2 1 4 Seal Long Status 4 Seal Stamp 2 # of bytes If no seal detected: Data*1 Seal record #B=0 1 6.5.5.3.6. Get Results Command Response for Suspended SET Command. Results are the same as for the SET command. 6.5.5.3.7.
6 RS 485/232 Communication Protocol 6.5.5.3.9. Get Results Command Response for Write Data Command. Reader > LSC Data** TF 2 TID 4 Message Type 1 Short seal status 1 # of bytes 6.5.5.3.10. Get Results Command Response for Deep Sleep. Reader > LSC Data** TF 2 TID 4 Message Type 1 Short seal status 1 # of bytes If no seal detected: Data*1 Seal record #B=0 1 6.5.5.3.11. Get Results Command Response for Hard Wakeup Command.
6 RS 485/232 Communication Protocol 6.5.5.3.12. Get Results Command Response for Reset Data Command. Reader > LSC Data** TF 2 TID 4 Message Type 1 Short seal status 1 # of bytes 6.5.5.3.13. Get Results Command Response for Start Alert Burst Mode Command. Reader > LSC Data** TF 2 TID 4 Message Type 1 Short seal status 1 # of bytes 6.5.5.3.14. Get Results Command Response for Stop Alert Burst Mode Command.
6 RS 485/232 Communication Protocol 6.5.5.3.15. Get Results Command Response for Set/Reset Status Command. Reader > LSC For a group approach: Data** Seal record 00 h 1 For a specific seal response: Data** TF 2 TID 4 Message Type 1 Short seal status 1 # of bytes 6.5.5.3.16. Get Results Command Response for Write Parameters Command. Reader > LSC Data** TF 2 TID 4 Message Type 1 Short seal status 1 # of bytes 6.5.5.3.17. Get Results Command Response for Read Parameters Command.
6 RS 485/232 Communication Protocol 6.5.5.3.18. Get Results Command Response for Addressed Verify Command. Reader > LSC Data** TF TID 2 4 Message Type 1 Data results according to the bit mask # of bytes Where: If no seal detected: Data*1 Seal record #B=0 1 6.5.5.3.19. Get Results Command Response for Read Events Command.
6 RS 485/232 Communication Protocol If no seal detected: Data*1 Seal record #B=0 1 8 bytes EVENT message format FSsm #B TF TID MT(33) EV# 1 2 4 1 1 Event Code 1 D&T STMP CRC 4 2 1 EM # of bytes Where Event Code is one of the following: Event Wire Tampered Low Battery Wire Open Wire Closed RTC Stopped DB Corrupted Event Code 0x02 0x03 0x04 0x05 0x08 0x09 16 bytes EVENT message format FSsm #B 1 FSsm #B 1 TF 2 TF 2 TID 4 TID 4 Where: Event Code* ** Event SET SOFT SET READ TIME Ch
6 RS 485/232 Communication Protocol 6.5.5.4. Get Status. 6.5.5.4.1. Command Transmission This command is to retrieve the READER status. Reader > LSC STX 1 #B 2 R# 2 CMND(0016h) 2 CRC 2 ETX 1 # of bytes 6.5.5.4.2. Get Status Command Response The following string is the general response. Reader > LSC STX 1 #B 2 R# 2 MSGT(xx16h) 2 R_status 4 CRC 2 ETX 1 # of bytes 6.5.5.5. Get Burst Message 6.5.5.5.1.
6 RS 485/232 Communication Protocol 6.5.5.5.2. Get Burst Message Command General Response. The following string is the general response. Reader > LSC STX #B R# MSGT(xx1Ch) 1 2 2 2 channel 1 PK 1 R_statu s 2 P# 1 DATA CRC ETX n 2 1 Data* m # of bytes # of bytes Where: MSGT DATA PK P# Data* high byte of MSGT is according the scenario in use. The low byte is 1C h. If the result is not ready, the value of this field is 05 hex error code see Paragraph 5.4.
6 RS 485/232 Communication Protocol Where: #B is the number of bytes for a seal record (including the #B fiels). is the data received after executing the RF command led by TF, TID and Message Type DATA** Data** TF 2 TID 4 Message Type 1 Data Results # of bytes If no seal detected: Data*1 Seal record #B=0 1 6.5.5.6. Reset Reader. 6.5.5.6.1. Command Transmission This command performs a general reset to all readers at one time. In this command, the LSC does not prompt.
6 RS 485/232 Communication Protocol 6.5.5.6.2. Reset Reader Command Response The following string is the response. Reader > LSC STX 1 #B 2 R# 2 MSGT(xx14h) 2 R_status 2 CRC 2 ETX 1 # of bytes 6.5.5.7. Write Parameters 6.5.5.7.1. Command Transmission This command enables modification of the parameter's value in the reader. Not all the parameters are available for modification. Please see Table 5.3 .
6 RS 485/232 Communication Protocol 6.5.5.8. Read Parameters. 6.5.5.8.1. Command Transmission This command enables the reading of the parameter's value from the reader. LSC > Reader STX #B R# 1 2 2 PAR1code 1 CMND(0007 h) 2 PAR2 code 1 Data CRC ETX n 2 1 PARm code 1 # of bytes # of bytes 6.5.5.8.2. Read Parameters Command Response The following string is the response.
6 RS 485/232 Communication Protocol 6.5.5.9. BIT 6.5.5.9.1. Command Transmission. This command generates a set of built-in test procedures. LSC > Reader STX 1 #B 2 R# 2 CMND(0009h) 2 CRC 2 ETX 1 # of bytes 6.5.5.9.2. BIT Command Response. The following string is the response. Reader > LSC STX 1 #B 2 R# 2 MSGT(xx09 h) 2 R_status 4 CRC 2 ETX 1 # of bytes 6.5.5.10. Sleep. 6.5.5.10.1. Command Transmission This command places the Reader in sleep mode of operation to save energy.
6 RS 485/232 Communication Protocol 6.5.5.11. Unsynchronized Reader Message. 6.5.5.11.1. Message Transmission When in unsynchronized mode of operation the Reader may burst with a message. The following string will be received for each seal. Reader > LSC STX 1 #B 2 R# 2 MSGT(800Ah) 2 Channel 1 #B 1 R_status 2 TF 2 TID 4 Data n Command code 1 CRC 2 Short status 1 ETX 1 # of bytes ORG_ID 3 # of bytes ORG_ID is an option in the response. It depends on the seal's configuration. 6.5.5.11.2.
6 RS 485/232 Communication Protocol 6.5.5.12. Get Reader's Baud Rate. 6.5.5.12.1. Command Transmision This command places the Reader in a sleep mode of operation to save energy. The Reader will wakeup from this mode by receiving a Wakeup command. LSC > Reader STX 1 #B 2 R# (0000) 2 CMND (00f f h) 2 R_ID 4 CRC 2 ETX 1 # of bytes 6.5.5.12.2. Get Reader's Baudrate Response.
6 RS 485/232 Communication Protocol 6.5.5.13.2. Set Reader's Baud Rate Response. The following string is the response: Reader > LSC STX 1 #B 2 R# 2 MSGT(80feh) 2 R_ID 4 baudrate 4 CRC 2 ETX 1 # of bytes 6.5.5.14. Set Reader's Address 6.5.5.14.1. Command Transmission This command sets the Reader's address for RS-485 communication purposes.
6 RS 485/232 Communication Protocol 6.5.5.15 Acknowledge OK. LSC > Reader This string is a one-way string that acknowledges a positive message received from the READER. LSC > Reader STX 1 #B 2 R# 2 CMND(0092h) 2 CRC 2 ETX 1 # of bytes 6.5.5.16. Acknowledge Failed. LSC > Reader This string is a one-way string that acknowledges a message indicating a problem coming from the READER. LSC > Reader STX 1 #B 2 R# 2 CMND (0094h) 2 CRC 2 ETX 1 # of bytes 6.5.5.17. Save Command 6.5.5.17.1.
6 RS 485/232 Communication Protocol Where: Phase is the duration from the end of the “Execute Saved Command” and the time required to execute the saved command. The phase is in units of 1.024 msec. is the command code of the saved command for delayed execution. is the relevant data field for the CMND* CMND* Data* If data=0 this command will clear the saved command. 6.5.5.17.2. Save Command Response.
6 RS 485/232 Communication Protocol 6.5.5.18.2. Execute Saved Command Response There is no response for this command. 6.5.5.19. Read Channel Definitions Command 6.5.5.19.1. Command Transmission This command allows the reading of the definitions for a device. LSC > Reader STX 1 #B 2 R# 2 CMND(0011h) 2 channel 1 CRC 2 ETX 1 # of bytes Where: Channel is the channel number that the device is connected to. Channel can be 0 to indicate the MCU, or 1,2 etc for the other channels. 6.5.5.19.2.
6 RS 485/232 Communication Protocol 6.5.5.20. Write Channel Definitions Command 6.5.5.20.1. Command Transmission This command enables the writing of definitions of a device. LSC > Reader STX 1 #B 2 R# 2 CMND(0010h) 2 data channel 1 Where: Channel CRC 2 file 82 ETX 1 # of bytes # of bytes is the channel number that the device is connected to. Channel can be 0 to indicate the MCU, or 1,2 etc for the other channels. is the data file that defines the device. File 6.5.5.20.2.
6 RS 485/232 Communication Protocol Hi-G-Tek Ltd.