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. Down-link
Down-link is the link from the LSC to the READERS. The link is
RS-485 or RS-232 half duplex. Data rate can be one of the
following: 2400, 4800, 9600, 19200, 38400 BPS. The default rate
is set at 9600 BPS.
6.2.2. Up-link
Up-link is the link from the READERS to the LSC. The link is
RS-485 or RS-232 half duplex. Data rate can be one of the
following: 2400, 4800, 9600, 19200, 38400 BPS. The default rate
is set at 9600 BPS.
6.3. Protocol Flow.
Communication is initiated by a command sent by the LSC to the
READER. The READER executes the command and responds
accordingly. In a long command session, the session is concluded
when the LSC acknowledges the READER within T = 50 msec.
ACK
If the READERS are in sleep mode, the LSC must ensure they are
awakened prior to the initialization of the session. In this case, the
LSC should wait T = 50 msec before sending the main command.
There are 2 types of commands: SHORT COMMANDS and LONG
COMMANDS.
Short Commands: These are commands that are relevant to
internal tasks at the reader level.
Long Commands: These commands involve sessions with seals.
The READER will respond to commands generated by the LSC
within T seconds.
For short commands, response time should be: T = 50 msec.
RLSC
RLSC
For long commands, the LSC should return to retrieve the results
after T with the appropriate GET RESULTS command.
Tis a derivative of the type of command executed to the seals.
session
session
Acknowledge can be positive or negative.
If the LSC detects a problem, Acknowledge will be negative.
The READERS are designed to work in cycles. Following an
internal or external trigger, a READER SESSION is generated.
This is a full communication cycle going back and forth between
a READER and the tags located in the READER's receiving zone.
The LSC operates differently The READERs are scanned on a
different time line, using the same frequency as that of the
READER's cycles or greater.
This protocol supports RS-485 and RS-232 communication
fashions. When working with the LSC using RS-232 communication
opposite only one device, address fields should be set to 0xFFFF.
When using RS-485 communication in broadcast situations, the
address field should be set to 0x0000.
STX This is the marker for the beginning of the
messages. STX = 02 hex.
#B String length, the string contains the R#,CMND,
the DATA field, and the CRC.
R# This session's READER address .
CMND This session's command code .
DATA The data field contains the data required to execute
the command
CRC This is the cyclic redundancy check for DATA and
fields #B, R#, CMND.
ETX This is the marker for the end of the messages.
ETX = 03 hex.
6.4.1.1. CRC Calculation.
CRC calculations are based on the following CCITT polynomial:
The command field is divided into several sections:
Where:
DIR Denotes string direction. In case of a command
from the LSC to the reader, it is equal to 0.
PK Denotes whether the command transmitted is
composed of packets or not. PK = 0 is for non-packet
commands. PK = 1 is for packet commands.
ERR this flag indicates an error.
ERR = 0 no error.
ERR = 1 Error. The first byte in the data field is the
error code.
CT Is the scenario command type. It describes the
CC
RS 485/232 Communication Protocol
command type, and whether it is in short or long form
00000 designates SHORT commands that stream
from the LCR to the Reader for MCU purposes.
00011 is for LONG commands.
This is the command code .
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.1)
This is the message code (see paragraph 5.2)
This is the status field of the reader. The field contains
bytes A&B (see paragraph 6.4.2.2)
The data field contains the relevant response data.
This is the cyclic redundancy check for fields #B,
MSGT, R_status and DATA.
This is the marker for the end of the messages.
ETX=03 hex.
The Message Type field is divided into several sections:
Where:
RS 485/232 Communication Protocol
DIR
PK
ERR
MT
MC
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).
This flag indicates an error.
ERR = 0 no error.
ERR = 1 Error. The first byte in the data field stores
the error code.
This code reflects the nature of the response. A
regular response to a command has the same value
as the CC (See paragraph 6.4.1.2).
This field holds the same value as the Command
Code of the related commands. This field makes it
possible to link the response to the appropriate
command.
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.
Byte A:
Where:
LCK
If the response shows 0, the READER's parameters
are locked.
If the response is 1, the READER's parameters
are unlocked.
If the response is 0, the READER is using RS-232
mode for communication.
485
If the response shows 1, the READER is using
RS-485 mode for communication.
PCR
If the response shows 0, the parameters in the MCU's
2
E ROM are OK.
If the reponse is 1, parameters were corrupted and
successfully restored.
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.
If 0, channe4 is OK.
If 1, channe4 is defective, details are in byte D.
If byte D flags are OK, there is a communication
failure with this channel.
VCCERR
If 0, power is OK.
If 1, power is not faulty
PMC
EMC
EME
If 0, program memory in the module is OK.
If 1, program memory is corrupted.
If 0, E ROM is OK.
If 1, E ROM was corrupted and then restored.
If 0, E ROM is OK.
If 1, E ROM was corrupted.
Maximum total message length is 128 bytes.
Maximum Data* length is 115 bytes.
6.4.2.3.1. Packed Data from the LSC.
When the packets originate with the LSC, each packet will be
transmitted after an appropriate response from the READER.
The LSC may retransmit the last packet upon receipt of a
response indicating that the last packet was not received
satisfactorily.
6.4.2.3.2. Packed Data from the READER.
When the packets originate with the READER, each packet will be
transmitted after an appropriate acknowledgement from the LSC.
The READER may retransmit the last packet upon receipt of an
acknowledgment indicating that the packet was not received
satisfactorily
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.
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:
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:
6.5.3.5. Reader ID RID,
This is a Reader's ID.
Bits assignment:
Reader and Seal IDs format are identical. For additional information,
see paragraph 5.3.2.
This is the Reader's IH string length. The values may be modified
for a specific application.
Bits assignment:
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:
6.5.3.11. Mode MODE.
The MODE parameter determines the operating mode of the
Reader. Each bit indicates another feature.
CRNC
Carrier Sense: In some applications, carrier sense
must be used before bursting into the air.
The Reader uses this flag to decide whether it is
required or not.
CRNC=0 This response determines the regular
mode (no carrier sense).
CRNC=1 This response determines that the Reader
can sense the carrier. The Reader will execute the
RF command only after determining that the air is
free.
Unrecognized Command 01 h
MCU Error 02 h
HF Modem Error 03 h
Result is not ready 05 h
HF Modem is not responding 06 h
MCU I/O Error 07 h
HF Modem BIT Error 08 h
Parameter is locked 09 h
Illegal Parameter Code 0A h
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.
ABMSGBurst Messages. This flag indicates whether the
alert messages will be sent following Alert GET
Results, or whether the Reader will burst
independently with Alert Messages.
BRMSG=0 determines the independent messages
burst mode.
BRMSG=1 indicates the Alert GET Results mode.
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. After the command is issued the
READER is ready to receive regular commands.
RS 485/232 Communication Protocol
6.5.5.2. Execute RF Command.
6.5.5.2.1. Command Transmission
This command enables communication sessions with the seals.
The LSC inserts the relevant information in the data field allowing
the reader to easily compile the final command string.
Time&Date are the current Time and Date of the LSC.
ADI 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.
NOTE: In the Data Field, #B includes the Time & Data and ADI fields.
6.5.5.2.2. Execute RF Command ACK.
This command involves a RF session with either the tags or seals.
For that reason, the READER carries a Long Command. The
READER responds with an ACK if the command was successfully
received.
Reader > LSC
In case of an ACK with an error response:
The final results of this command will be ready later. The LSC
should use the GET RESULTS command to retrieve the results.
For detailed error codes see para 5.4.
The Verify command is carried through the high frequency modem.
The data field in the Execute RF Command will be:
RS 485/232 Communication Protocol
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.
Resolution is in units of 1024 msec.
The duration of a slot for receiving responses from
a tag or a seal. Resolution is in units of 1024 msec.
The number of slots in the Fixed Assignment
Receiving Window.
The number of slots in the Random Access
Receiving Window.
The number of slots in the Alert Receiving Window.
The number of random retransmissions from a tag
in the Random Access Receiving Window.
The number of random retransmissions from a tag
in the Alert Receiving Window.
Is a random unique ID that is assigned to a specific
assignment. For details see Assign commands.
Is the parameters bit mask to which the tags and
seal respond.
This is the interrogation cycle for reading short messages from tags
and seals. Tw wakes the tags in random phase.
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.
RS 485/232 Communication Protocol
6.5.5.2.5. Set
Set command is a command used when it is necessary to approach
a large number of tags or seals. If the string becomes too large it
will be split into packets.
Each packet includes information for up to 8 tags or seals. This is
a very critical command, as it uses internal CRC for each tag data.
The high 4 bits of the first byte are the packet
serial number.
PK
The low 4 bits of the first byte are the total number
of packets in the BMM string.
CRC
CRC
p
t
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. The command
functions in the same way as the SET command, the only
difference being that the SET command is executed immediately,
while the Seal executes the Suspended SET command
automatically only after the Seal wire has been plugged into the
Seal.
The opcode for this command is 99h. The response is identical to
that of the SET response, but with 19h as the message type.
6.5.5.2.7. Soft set
This command has the same structure as the SET command.
The difference between the two is at the seal level. The seal
marks this command as an event, but doesn't reset the events
memory. The opcode for this command is 9Ah. The response is
identical to that of the SET response, but with 1Ah as the message
type.
Bit mask marks the status bits to be reset.
A value of 0 means “don't modify”.
A value of 1 is to “reset value to zero”.
Each bit corresponds to the appropriate bit in the LTS.
is the sequential number of the first Event.
is the number of events to be read from the memory.
143
6
STX #B R# CMND(0015h) Channel CRC ETX
1 2 2 2 1 2 1 # of bytes
STX #B R# MSGT(xx20h ) R_status DATA CRC ETX
1 2 2 2 2 n 2
1 # of bytes
channel PK P# Data*
1 1 1 m
# of bytes
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
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. Get Results Command General Response
The following string is the general response
Reader > LSC
Where:
MSGT The high byte of MSGT is according the scenario in
use. The low byte is 20 h.
DATA In case the result is not ready, the value of this field
is 05 hex error code see paragraph 5.4. If the results
are ready, the following applies:
Data**
TF TID Message Type Data Result
2 4 1 # of bytes
Data*1
Seal record
#B=0
1
RS 485/232 Communication Protocol
PK
P#
Data*
Seals Records:
Where:
#B
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.
is the number of bytes for a seal record (including
the #B field)
is the data received after executing the RF command
led by TF, TID and Message Type.
Where:
TF&TID
Message Type
is the ID of the seal.TF&TID
is the transmitted Cmnd*.
In case of a problem the Message Type's MSB will be set to “1”.
If no seal is detected:
For the case of an unfinished RF session the complete response is:
Reader > LSC
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.5.5.5.2. Get Burst Message Command General Response.
The following string is the general response.
Reader > LSC
Where:
MSGT
high byte of MSGT is according the scenario in use.
The low byte is 1C h.
DATA
If the result is not ready, the value of this field is 05
hex error code see Paragraph 5.4. If the result is
ready the following applies:
PK
P#
Data*
Total number of packets.
Packet number sequence number.
This string ccontains the seal records. The field
should first be concentrated from all packets before
analyzing.
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 .
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
6.5.5.12.2. Get Reader's Baudrate Response.
The following string is the response:
Reader > LSC
Baudrate: 2400, 4800, 9600, 19200, 38400
6.5.5.13 Set Reader's Baud Rate.
The baud rate is interpreted as a decimal number translated
into a 32 bit binary number or vise-versa.
6.5.5.13.1. Command Transmission
This command puts the Reader in a sleep mode of operation to
save energy. The Wakeup command wakes the Reader from this
mode. The baudrate is updated after the completion of this
command and receipt of the response.
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.
CMND* is the command code of the saved command for
delayed execution.
Data* is the relevant data field for the CMND*
If data=0 this command will clear the saved command.
6.5.5.17.2. Save Command Response.
The following string is the response:
Reader > LSC
6.5.5.18. Execute Saved Command
6.5.5.18.1. Command Transmission
This command executes the saved command.
This is a broadcast command sent to all readers.
There will be no response from any reader to this command.
This command enables the writing of definitions of a device.
LSC > Reader
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.
File is the data file that defines the device.