Chapter 8 Communication Functions

(4) Response format (NAK response)

Format name

Header

Station No.

Command

Command type

 

 

 

 

 

Ex. of frame

NAK

H20

R(r)

SS

ASCII value

H15

H3230

H52(72)

H5353

 

 

 

 

 

Error code

(Hex 2 Byte)

H1132

H31313332

Tail

Frame check

 

 

ETX

BCC

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.

 

 

 

 

 

 

Error code

 

 

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

 

 

 

codes.

 

 

 

 

 

(5) Example

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

K120S main unit

This example supposes when 1 WORD from M20 and 1 WORD from P001 address of station No.1 are read and BCC value is checked. Also it is supposed that H1234 is entered in M20, and data of H5678 is entered in P001.

Computer request format (PC MASTER-K120S main Unit)

Format name

Header

Station No.

Command

Command

Number of

Variable

type

blocks

length

 

 

 

 

Ex. of frame

ENQ

H01

r

SS

H02

H05

ASCII value

H05

H3031

H72

H5353

H3032

H3035

 

 

 

 

 

 

 

Format

name

%MW20

H254D57

3230

Device

Format name

Tail

Frame

length

check

 

 

H06

%PW001

EOT

BCC

H3036

H25505730

H04

 

3031

 

 

 

 

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

Format name

Header

Station No.

Command

Command

Number of

Number of

Data

Number of

Data

Tail

Frame

type

blocks

data

data

check

 

 

 

 

 

 

 

Ex. of frame

ACK

H01

r

SS

H02

H02

H1234

H02

H5678

ETX

BCC

ASCII value

H06

H3031

H72

H5353

H3032

H3032

H31323334

H3032

H35363738

H03

 

8-11

Page 201
Image 201
LG Electronics 120S user manual Response format NAK response