Chapter 8 Communication Functions

(4) Response format (NAK response)

 

Format name

 

 

Header

 

 

Station No.

 

 

Command

 

 

Command type

 

 

Error code

 

 

Tail

 

 

Frame check

 

 

 

 

 

 

 

 

 

 

 

 

(Hex 2 Byte)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Ex. of frame

 

 

NAK

 

 

H10

 

 

r

 

 

SB

 

 

H1132

 

 

ETX

 

 

BCC

 

 

ASCII value

 

 

H15

 

 

H3130

 

 

H72

 

 

H5342

 

 

H31313332

 

 

H03

 

 

 

 

 

Item

 

 

Explanation

 

BCC

 

 

When command is lowercase(r), only one lower byte of the value resulted by adding 1 Byte

 

 

 

each to ASCII values from NAK to ETX is converted into ASCII and added to BCC, and sent.

 

 

 

 

 

Error code

 

 

Hex and 2 bytes(ASCII code, 4 bytes) indicate error type. For the details, see 8.1.8 Error

 

 

 

codes.

 

 

 

 

(5) Example

This example supposes that 2 WORDs from M000 of station No. 10 is read and BCC value is checked. Also it is supposed that data in M000 and in M001 is as follow:

M000 = H1234

M001 = H5678

Computer request format (PC MASTER-K120S Main Unit)

 

 

 

 

Command

 

 

 

 

 

 

Format name

Header

Station No.

Command

Device length

Device name

 

Number of data

Tail

Frame check

type

 

 

 

 

 

 

 

 

 

 

 

Frame (Example)

ENQ

H0A

r

SB

H06

%MW000

 

H02

EOT

BCC

ASCII value

H05

H3041

H72

H5342

H3036

H254D5730

 

H3032

H04

 

3030

 

 

 

 

 

 

 

 

 

 

 

 

For ACK response after execution of command(PC MASTER-K120S Main Unit)

Format name

Header

Station No.

Command

Command

Number of

Data

Tail

Frame check

type

data

 

 

 

 

 

 

 

Frame (Example)

ACK

H0A

r

SB

H04

12345678

ETX

BCC

ASCII value

H06

H3041

H72

H5342

H3034

H3132333435363738

03

 

 

 

 

 

 

 

 

 

 

For NAK response after execution of command(PC

MASTER-K120S Main Unit)

 

 

 

 

 

 

 

 

 

 

Format name

Header

Station No>

Command

Command type

Error code

Tail

BCC

Frame (Example)

NAK

H0A

r

SB

Error code (2Byte)

ETX

BCC

ASCII value

H15

H3041

H72

H5342

Error code (4Byte)

H03

 

8-14

Page 204
Image 204
LG Electronics 120S user manual Eot