beautypg.com

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

Page 9

background image

7

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 10).

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).

When reading the "Hold function setting (data number: 136)" of the SK-1000 Series (ID
number: 01) being activated:

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 15).

ID No. 00

Main

Exp.

Exp.

Exp.

Exp.

01

02

06

07

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) (33H) (36H)(0DH)(0AH)

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

R

CR LF

0 1

1 3 6

,

,

Command :

S

(53H)

,

(2CH)

R

(52H)

0

(30H)

1

(31H)

1

(31H)

,

(2CH)

3

(33H)

6

(36H)

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

→ 312C

H

→ 3133

H

→ 360D

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 10).

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 sending the command format "SR, 01, 136CRLF" of the SK-1000 Series (ID number:
01) being activated and receiving a response that the hold function setting is "Peak hold"

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) (33H) (36H)

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

R

0 1

1 3 6

,

,

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

1 CR LF

,

Response format :

Peak hold

S

(53H)

,

(2CH)

R

(52H)

0

(30H)

1

(31H)

1

(31H)

,

(2CH)

3

(33H)

1

(31H)

LF

(0AH)

CR

(0DH)

ASCII character conversion :

5352

H

Value to store in
data memory
(hexadecimal)

2C30

H

312C

H

3133

H

310D

H

0A00

H

bit
15

bit

0

6

(36H)

362C

H

,

(2CH)