Commands and responses, Overview of commands and responses – KEYENCE DL-RS1A User Manual

Page 10

Advertising
background image

8

Commands and Responses

Overview of Commands and Responses

Command format

You can send specific commands based on ASCII codes from an external device to DL-RS1A.
For information on the parameters used in the command, refer to "Parameters of Commands and
Responses" (page 11).

Sample command format structure

(1) With the first two bytes, specify the communication command.
(2) Specify the ID number assigned to the target sensor amplifier using two digits (ASCII characters).
(3) Specify the data number for the data you want to read from or write to the sensor amplifier using

three digits (ASCII characters).

(4) Insert CR or CR + LF as the command delimiter.

You must use commas (,) to separate (1), (2), and (3).

To read the "Detection mode (data number: 101)" from an expansion unit of an active
GT2-70 Series (ID number: 06):

From an external device, 11-byte data will be sent to the DL-RS1A.

The last byte of the command you send must be CR (0DH) or LF (0AH). Specifying a value
other than CR or LF results in an error response (error number: 00). For information on the
error responses, refer to "Error numbers" (page 14).

ID No. 00

Main

Exp.

Exp.

Exp.

Exp.

01

02

13

14

Sensor amplifier

DL-RS1A

External device like PLC or PC

Response

or

error response

Command or DRQ input

S

(1)

(2)

(3)

(4)

R

CR LF

ID No.

Data No.

,

,

Important

Example

S

(53H) (52H)

(2CH)(31H) (30H) (31H)(0DH)(0AH)

(2CH)(30H) (36H)

R

CR LF

0 6

1 0 1

,

,

Command :

S

(53H)

,

(2CH)

R

(52H)

0

(30H)

6

(36H)

1

(31H)

,

(2CH)

0

(30H)

1

(31H)

LF

(0AH)

CR

(0DH)

ASCII character conversion :

Data memory 0

Data memory 1

Data memory 2

Data memory 3

Data memory 4

Data memory 5

5352

H

Value to store in
data memory (hexadecimal)

2C30

H

362C

H

3130

H

310D

H

0A00

H

bit
15

bit

0

Important

Commands and Responses

Response

When DL-RS1A successfully receives a command from the external device, it automatically returns a
response based on ASCII codes.
For information on the parameters used in the response, refer to "Parameters of Commands and
Responses" (page 11).

Sample response structure

(1) Contains the same communication command as the received command.
(2) Contains the same ID number as the received command.
(3) Contains the same data number as the received command.
(4) Contains the data that DL-RS1A retrieved from the specified sensor amplifier. Contains maximum

of 10 bytes according to the specified data number (3).

(5) Contains CR + LF as the response delimiter.

When the command format "SR,06,101CRLF" is sent to the GT2-70 Series (ID number: 06)
in operation and the response indicating that the Detection mode is "Peak hold" is received:

DL-RS1A sends the response to the external device.

S

(1)

(2)

(3)

(4)

(5)

R

ID No.

Data No.

,

,

CR LF

Data

,

Example

S

(53H) (52H)

(2CH) (31H) (30H) (31H)

(2CH)(3CH) (36H)

R

0 6

1 0 1

,

,

(2CH) (32H) (0DH) (0AH)

2 CR LF

,

Response format :

Peak hold

S

(53H)

,

(2CH)

R

(52H)

0

(30H)

6

(36H)

1

(31H)

,

(2CH)

0

(30H)

2

(32H)

LF

(0AH)

CR

(0DH)

ASCII character conversion:

5352

H

Value to store in
data memory
(hexadecimal)

2C30

H

362C

H

3130

H

320D

H

0A00

H

bit
15

bit

0

1

(31H)

312C

H

,

(2CH)

Advertising