Approved by M. Yamano
Checked by Y. Takamuki
Written by N. Ohsugi
No. Y1499-1L11C
Communication Protocol Specification
SE2L-H05LP
SE2L Communication Protocol Specification(Y1499-1L11C)
1 / 29
Symbol
Revision Detail
Page
Date
Drafted
-
Initial - 2015/12/10
N.Ohsugi
B
Continuous data output commands(AR02,
AR03, AR04, AR05)added.
4, 7, 8, 11, 12
2016/3/29
N.Ohsugi
C
Commands (XR, YR) added.
Laser off State added in AR commands.
B Protocol commands added.
4, 7, 9 - 29
2017/1/17
N.Ohsugi
Revision history
SE2L Communication Protocol Specification(Y1499-1L11C)
2 / 29
Table of Contents
Revision history ............................................................................................................................................... 2
6.3 Status Data (XR Commands) ....................................................................................................... 13
6.4 Area Data (YR Commands) ......................................................................................................... 14
7. Reply Status ........................................................................................................................................... 15
8. B Protocol Mode Communication ........................................................................................................ 16
8.1 B Protocol Format ......................................................................................................................... 16
8.5 Data Splitting ................................................................................................................................. 20
8.6 Common B Protocol Status Codes ............................................................................................... 20
8.7 B Protocol Commands .................................................................................................................. 21
8.7.5 Sensor Information (VV, PP and II Commands) ................................................................... 27
SE2L Communication Protocol Specification(Y1499-1L11C)
3 / 29
1. Introduction
This document describes the communication protocol specification for the safety laser scanner,
SE2L-H05LP (henceforth SE2L).
Communication protocol is a predefined format of ASCII strings used for data transmission
between host computer and SE2L referred as, “Command” and “Reply”. Commands are sent
from the host computer to SE2L which will then reply with the data corresponding to the type of
command. Protocol should be strictly followed in order to obtain the appropriate data. Set of
such commands and their responses are explained in this document.
This specification is compatible with firmware version 2.0.0o (and later) of SE2L.
Note:
This specification is intended for the developers who have sufficient knowledge on the
product and software programming.
Read this document carefully before programming the communication software.
Read user’s manual of SE2L before programming the communication software.
Danger!
Sending commands other than those specified in this document can permanently damage
the SE2L.
Sending commands other than those specified in this document can lead to unintended
performance of SE2L causing critical injury or death.
Sending commands in sequence other than those specified in this document can lead to
unintended performance of SE2L causing critical injury or death.
Data integrity (size, CRC, status etc.) shall be sufficiently checked before using the data
for the intended purpose.
Data obtained through communication should not be used for controlling the safety
device.
Verification shall be done to ensure that the data output does not hamper the safety
operation of either SE2L or the controlled device.
2. Abbreviations and Descriptions
CRC: Cyclic Redundancy Check
STX: Start of Text
ETX: End of Text
OSSD: Output Signal Switching Device
SE2L Communication Protocol Specification(Y1499-1L11C)
4 / 29
3. Communication Format
STX
1 char
Command Size
4 char
Header
2 char
Sub Header
2 char
CRC
4 char
ETX
1 char
STX
1 char
Reply Size
4 char
Header
2 char
Sub Header
2 char
Data*
N char
Status
2 char
CRC
4 char
ETX
1 char
General communication format and terms used in it are explained below.
Command
Host » SE2L
Reply
Host « SE2L
* Some of the replies may not contain this field.
Command:
It is the data transmitted from the host computer to SE2L. It is enclosed between STX and ETX
and contains Command Size, Header, Sub-Header and CRC.
Command Size:
It is the total length of ASCII characters in a command. Command size is encoded to
hexadecimal strings (refer to section 4).
Header:
It is a unique code to differentiate the type of command.
Sub-Header:
It is an additional parameter to differentiate the same command having multiple replies.
CRC:
It is a 16-Bit code for checking the data integrity. Command size, header, sub-header and data
are included in CRC calculation (refer to section 5). CRC is encoded to hexadecimal strings
(refer to section 4)
Reply:
It is the data transmitted from SE2L to host computer upon receiving a command. It is enclosed
between STX and ETX and contains Reply size, Header, Sub-Header, Data, Status and CRC.
Reply is unique for each command.
Reply Size:
It is the total length of ASCII characters in a reply. Reply size is encoded to hexadecimal strings
(refer to section 4).
Data:
Data is SE2L’s internal state and/or measurement values. It is encoded in ASCII strings and
transmitted from SE2L. Some of the replies may not contain the data.
Status:
It is a code to inform the success or failure of the command execution. Status other than “00” is
error code. Refer to section 7 for details.
SE2L Communication Protocol Specification(Y1499-1L11C)
5 / 29
6857d = 0001 1010 1100 1001
2
To convert the data into ASCII, if data is less than 10d
add 30h, for data from 10d to 15d add 37h
1d 10d 12d 9d
31h 41h 43h 39h
1AC9
Separate the data into 4 bits
Decimal equivalent
ASCII equivalent
Figure 4.1: Data Encoding and Decoding
Data Encoding:
Data Decoding:
6857d
1AC9 = 31h 41h 43h 39h
1d 10d 12d 9d
0001 1010 1100 1001
2
0001101011001001
2
To convert the data into decimal, subtract 30h for the
data from 30h to 39h, and 37h for data from 41h to 46h.
Hexadecimal equivalent
Binary equivalent
Merge 16 bits
Decimal equivalent
4. Data Encoding and Decoding
Data encoding is applied in the communication protocol. Host computer should convert all the
numerical values into ASCII characters before transmitting them to SE2L. For encoding, the
data should be first divided into 4 bits, and then depending on its value, either 30h or 37h is
added to convert into ASCII characters (Figure 4.1). Values received from SE2L are also in the
same format therefore, program on the host computer should decode it before using. Decoding
is exactly the opposite of encoding process where, depending on the value of each received
ASCII characters, either 30h or 37h is subtracted and merged to generate the original value.
5. CRC Calculation
CRC is a 16 bit code to check the data integrity at the receiving end. It serves as a mean to
detect corruption or loss during transmission that may occur due noise in the communication
channel. When SE2L receives data from the host computer, it recalculates the CRC and
compares it with the CRC value in the command. SE2L will reply with the requested data only if
both CRCs match otherwise, it will reply with an error code in the status. Data integrity check
should be also applied on the host computer before using the received data. Discard the data if
verification fails data and try again by resending the command.
CRC is calculated using the polynomial X16 + X
characters (see section 4) before the transmission. STX and ETX are not included when
calculating the CRC value.
SE2L Communication Protocol Specification(Y1499-1L11C)
6 / 29
12
+ X5 + 1. CRC value is encoded into 4 ASCII
CRC Example:
“000EVR00” : 0x3492
Data
CRC
CRC Standard: Kermit
Polynomial: 0x1021
Shift Direction: Right
Initial Value: 0x0000
Byte Swap: Yes
Reverse CRC Result: Yes
6. Commands
Commands recognized by SE2L are described in this section. SE2L will respond with the
corresponding data when it receives these commands. Format should be strictly followed in
order to obtain the appropriate data. SE2L will reply with error status (refer to section 7) if length,
CRC or header string validation fails.
SE2L performs communication routine once in every sensing cycle (one sensing cycle of SE2L
is 29 to 30ms) and sends the reply to any command received during this period. Therefore, if
commands are not received completely in once cycle it will take another cycle to send the reply.
Further, reply can be delayed depending on the communication speed of the host system. Allow
sufficient timeout period by considering all possible delays that can occur in the system before
resending the command when reply is not received from SE2L. Avoid continuously sending the
commands to SE2L without waiting for the reply. It will affect the performance and becomes a
cause of error.
Some of the commands can set SE2L to supply the measurement data continuously. When
SE2L is in continuous transmission mode, it will supply the data at every 30ms (approx.).
Continuous mode can be terminated by sending the appropriate stop commands. In continuous
transmission mode, avoid sending additional commands to acquire the same data. However,
commands to request other information such as, sensor version can be sent to SE2L.
Important Note:
When the scan skip function is active, device will reply only during the measurement cycles. For
example, if the scan skip function is configured as 2, reply of AR02 and AR04 (refer to sections
6.2.3 and 6.2.4) commands will be provided at every 90msec. However, if the device is in the error
state, the reply will be sent at every cycle. In such case, the values of measurement data when the
sensor is skipping the measurement will be 0xFFFE. Further, scan skip function is temporarily
suspended when the device is in setting mode and the communication cycle is 30msec.
SE2L Communication Protocol Specification(Y1499-1L11C)
7 / 29
STX
1 char
Length
4 char
V
1 char
R
1 char
0
1 char
0
1 char
CRC
4 char
ETX
1 char
STX
1 char
Length
4 char
V
1 char
R
1 char
0
1 char
0
1 char
Status
2 char
Sensor model
29 char
,
1 char
Firmware version
29 char
,
1 char
Reserved
37 char
,
1 char
Serial Number
8 char
,
1 char
CRC
4 char
ETX
1 char
Command
Function
“AR00”
Acquire sensing data with measured distance
“AR01”
Acquire sensing data with measured distance and intensity
“AR02”
Acquire sensing data with measured distance in continuous mode
“AR03”
Stop continuous mode initiated by “AR02”
“AR04”
Acquire sensing data with measured distance and intensity in continuous mode
“AR05”
Stop continuous mode initiated by “AR04”
6.1 Version Details (VR Command)
When SE2L receives this command, it replies with its version details. Version details include
serial number, firmware version among other information. Data in the version command are not
encoded except the length and CRC.
Before acquiring sensing data using AR commands, send the VR command to confirm the
connection with intended SE2L.
Host » SE2L
Host « SE2L
6.2 Sensing Data (AR Commands)
There are 6 variations of this command differentiated by sub-header. Function of commands
will vary depending on it (Table 6.2.1). When SE2L receives this command, it replies with its
sensing data (Table 6.2.2).
After sending a command to acquire data in continuous transmission mode, avoid sending
additional commands to get the same data. However, commands to request other information
such as, sensor version, can be sent to SE2L even in continuous mode.
SE2L will supply the data at every 30ms (approx.) in continuous transmission mode. Even if
SE2L can not perform the measurement due to internal error or goes to lockout state, it will
continue to send the reply but the measurement values are not updated.
Important: Before acquiring sensing data using AR commands, send the VR command to
check the serial number for verifying the connection with an intended SE2L.
Table 6.2.1: Function of AR Commands Based on Sub-header Parameter
SE2L Communication Protocol Specification(Y1499-1L11C)
8 / 29
Table 6.2.2: Details of Sensing Data
Item
Data
Remarks
Operating Mode
0: Normal
1: Setting
Area Number
00 ~ 1F
Offset the number by 1 to match with 7-seg display of SE2L
Error State
0: No error
1: Error is detected
Use this information with Error Code to show the error status.
Also check the Lockout State.
Error Code
1 ~ BF
Use this information with Error Status to show the error
number. Offset the number by 0x40 to match with 7-seg
display of SE2L. Refer to SE2L user’s manual for error details.
Lockout State
0: Normal
1: Lockout
Use this information with Error Code to show the error status.
Also check the Error State.
OSSD 1 State
0: Off (No detection)
1: On (Detection)
Always 1 in setting mode
OSSD 2 Status
0: Off (No detection)
1: On (Detection)
Always 1 in setting mode
Warning 1 State
0: Off (No detection)
1: On (Detection)
Always 0 when SE2L is operating without warning zone1.
Always 1 in setting mode when operating with warning zone1.
Warning 2 State
0: Off (No detection)
1: On (Detection)
Always 0 when SE2L is operating without warning zone2.
Always 1 in setting mode when operating with warning zone2.
OSSD 3 State
0: Off (No detection)
1: On (Detection)
Always 0 when SE2L is operating without protection zone2.
Always 1 in setting mode when operating with protection
zone2.
OSSD 4 State
0: Off (No detection)
1: On (Detection)
Always 0 when SE2L is operating without protection zone2.
Always 1 in setting mode when operating with protection
zone2.
Muting/override State1
0: Not Active
1: Active
Always 0 when SE2L is operating without muting function.
Muting/override State2
0: Not active
1: Active
Always 0 when SE2L is operating without muting function
and/or without protection zone2.
Reset Request1
0: Off
1: On
Always 0 when SE2L is operating without interlock1 function.
Reset Request2
0: Off
1: On
Always 0 when SE2L is operating without interlock2 function
and/or without protection zone2.
Encoder Speed
0~FFFF
Always 0 when SE2L is operating without encoder Input
function.
Time Stamp
0 ~ FFFFFFFF
Unit is millisecond.
Laser off State
0: Laser is emitted
1: Laser is stopped
Always 0 when operating without Laser off function
Always 0 in setting mode
Distance Data
0000 ~ FFFF
1081 Steps data
Note:
1. Values more than 40000 are error code (0xFFFF).
2. If object is not detected value will be 65534 (0xFFFE).
3. If object is at a very close range value will be 65533
(0xFFFD).
4. When the device is in laser off state or lockout state the value will be
65532 (0xFFFC)
Intensity Data
0000 ~ FFFF
1081 Steps data
Note:
1. If object is not detected the value will be 0.
2. Do not use the value if distance of the corresponding step
has error.
3. When the device is in laser off state or lockout state the value will be
65532 (0xFFFC).
SE2L Communication Protocol Specification(Y1499-1L11C)
9 / 29
Loading...
+ 20 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.