Details of Command

Details of Command

Read Word Data

 

Function

  • This is used to read the data in the word device of a PLC. (Max. 63 words)

  • Device Symbol: X, Y, M, L, K, F, Z, TC, TS, CC, CS, D, S

 

 

Request Frame (Master)

  • COMMAND: ‘R’

  • Data Device Format

 

Address

8 Char

Size (Word)

Hexadecimal, 2 Char

......

Address

8 Char

Size (Word)

Hexadecimal, 2 Char

 

 

[Master(Request Format)]

HEADER

Stn

H

Stn

L

Cmd

Leng

H

Leng

L

Data

BCC

H

BCC

L

EOT

ENQ

02

R

0A

D0000001 01

B9

EOT

05H

30H

32H

52H

30H

41H

4430303030303031 3031H

42H

39H

04H

 

Leng is the length of a data and its value means the length of a data (D0000001 01).

Data means the address really read (D0000001) and the length of the word data read (01).

BCC is the remainder value when dividing the binary-sum from Cmd to the end of data by 256.

 

 

Response Frame (Slave)

  • COMMAND (In completed case: ‘R’   /   In failed case: ‘E’)

  • Format of Data Device

 

[Completed Case]

PLC Data

Word Data

4 Char

Word Data

4 Char

......

Word Data

4 Char

 

Slave(Response Format)

HEADER

Stn

H

Stn

L

Cmd

Leng

H

Leng

L

Data

BCC

H

BCC

L

ETX

STX

02

R

04

F4AC

B4

ETX

02H

30H

32H

52H

30H

34H

46344143H

42H

34H

03H

 

The request frame received from a master is used as the response frame of a PLC.

BCC is the remainder value when dividing binary-sum from Cmd to the end of data by 256.

As the response frame is processed, Cmd is ‘R’. (* Leng means the length of a data (F4AC).

 

 

[Failed Case]

Error Code

Error Code

2 Char

 

Slave(Response Format)

HEADER

Stn

H

Stn

L

Cmd

Leng

H

Leng

L

Error Code

BCC

H

BCC

L

ETX

STX

02

E

02

02

09

ETX

02H

30H

32H

45H

30H

32H

3032H

30H

39H

03H

 

The request frame received from a master is used as the response frame of a PLC.

BCC is the remainder value when dividing the binary-sum from Cmd to the end of data by 256.

As the response frame is not processed, Cmd is ‘E’. (*Leng means the length of error code(02).)

 

  • Error code displays the type of an error. Please refer to the ‘ERROR RESPONSE’.

 

 

[Ex.] Read data from Address D00040 of Station 02H.

Master (Request Format)

HEADER

Stn

H

Stn

L

Cmd

Leng

H

Leng

L

Data

BCC

H

BCC

L

EOT

ENQ

02

R

0A

D0000040 01

BC

EOT

05H

30H

32H

52H

30H

41H

4430303030303430 3031H

42H

43H

04H

 

Completed Case> reads 1-word data ‘F4AC’

Slave(Response Format)

HEADER

Stn

H

Stn

L

Cmd

Leng

H

Leng

L

Data

BCC

H

BCC

L

ETX

STX

02

R

04

F4AC

B4

ETX

02H

30H

32H

52H

30H

34H

46344143H

42H

34H

03H

 

Failed Case> Error in BCC

Slave(Response Format)

HEADER

Stn

H

Stn

L

Cmd

Leng

H

Leng

L

Error Code

BCC

H

BCC

L

ETX

STX

02

E

02

02

09

ETX

02H

30H

32H

45H

30H

32H

3032H

30H

39H

03H

 

 

Write Word Data

Function

  • This is used to write a data to the word device of a PLC.

  • Device Symbol: X, Y, M, L, K, F, Z, TC, TS, CC, CS, D, S

 

 

Request Frame

  • COMMAND: ‘W’

  • Format of Data Device

Address

8 Char

Size (Word)

Hexadecimal,

2 Char

Word Data

Hexadecimal,

Size*4 Char

.......

Address

8 Char

Size (Word)

Hexadecimal,

2 Char

Word Data

Hexadecimal,

Size*4 Char

 

[Master (Request Format)]

HEADER

Stn

H

Stn

L

Cmd

Leng

H

Leng

L

Data

BCC

H

BCC

L

EOT

ENQ

02

W

0E

D0000010 01 FA34

B0

EOT

05H

30H

32H

57H

30H

45H

4430303030303130 3031 46413334H

42H

30H

04H

 

Leng is the length of a data and its value means the length of the Data (D0000010 01 FA34).

The address really written (D0000010), the length of the data (01) and the data written (FA34) are input in the Data (D1000 02 FA34).

BCC is the remainder value (F3) when dividing the binary-sum from Cmd to the end of data by 256.

 

 

Response Frame

  • COMMAND ( In completed case: ‘W’  /   In failed case: ‘E’ )

  • Format of Data Device

 

[Completed Case]

No Data

 

Slave (Response Format)

HEADER

Stn

H

Stn

L

Cmd

Leng

H

Leng

L

BCC

H

BCC

L

ETX

STX

02

W

00

B7

ETX

02H

30H

32H

57H

30H

30H

42H

37H

03H

 

The request frame received from a master is used as the response frame of a PLC.

BCC is the remainder value when dividing the binary-sum from Cmd to the end of data by 256.

As the response frame is processed, Cmd is ‘W’.

Leng means the length of a data.

 

 

[Failed Case]

Error Code

Error Code

2 Char

 

Slave (Response Format)

HEADER

Stn

H

Stn

L

Cmd

Leng

H

Leng

L

Error Code

BCC

H

BCC

L

ETX

STX

02

E

02

01

08

ETX

02H

30H

32H

45H

30H

32H

3031H

30H

38H

03H

 

The request frame received from a master is used as the response frame of a PLC.

BCC is the remainder value when dividing the binary-sum from Cmd to the end of data by 256.

As the response frame is not processed, Cmd is ‘E’.

Leng(02) means the length of Error Code(01).

Error code displays the type of an error. Please refer to the ‘ERROR RESPONSE’.

 

 

[ [Ex.] Write FA34H to Address D0010 and 8D41H to Address D0020. ]

Master (Request Format)

HEADER

Stn

H

Stn

L

Cmd

Leng

H

Leng

L

Data

BCC

H

BCC

L

EOT

ENQ

02

W

12

D0000010 02 FA34

8D41

AF

EOT

05H

30H

32H

57H

31H

32H

4430303030303130 3032 46413334 38443431H

41H

46H

04H

 

Completed Case>

Slave (Response Format)

HEADER

Stn

H

Stn

L

Cmd

Leng

H

Leng

L

BCC

H

BCC

L

ETX

STX

02

W

0

B7

ETX

02H

30H

32H

57H

30H

30H

42H

37H

03H

 

Failed Case>Receiving unknown command code (01H).

Slave (Response Format)

HEADER

Stn

H

Stn

L

Cmd

Leng

H

Leng

L

Error Code

BCC

H

BCC

L

ETX

STX

02

E

02

01

08

ETX

02H

30H

32H

45H

30H

32H

3031H

30H

38H

03H

 

 

Read Bit Data

 

Function

  • This is used to read the data in the bit device of a PLC.

  • Device Symbol: X, Y, M, L, K, F, Z, T, C

 

 

Request Frame

  • COMMAND: ‘r’

  • Format of Data Device

 

Address

8 Char

Size (Bit)

Hexadecimal,

2 Char

.......

Address

8 Char

Size (Bit)

Hexadecimal,

2 Char

 

Master(Request Format)

HEADER

Stn

H

Stn

L