Chapter 8 Communication Functions

7) Reading PLC Status(RST)

(1) Introduction

This is a function that reads flag list including operating status of PLC and error information.

(2)

PC request Format

 

 

 

 

 

 

 

 

Format name

 

Header

Station No.

Command

Command type

Tail

Frame check

 

Frame (Example)

 

ENQ

H0A

R(r)

ST

EOT

BCC

 

ASCII value

 

H05

H3041

H52(72)

H5354

H04

 

 

 

 

 

 

 

 

 

 

 

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 ENQ to EOT is converted into ASCII and added to BCC.

 

 

 

 

(3)

Response Format (ACK response)

 

 

 

 

 

Format name

 

 

Header

 

 

Station No.

 

 

Command

 

 

Command

 

 

 

 

 

 

 

 

 

 

type

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Frame (Example)

 

 

ACK

 

 

H0A

 

 

R(r)

 

 

ST

 

 

ASCII value

 

 

H06

 

 

H3041

 

 

H52(72)

 

 

H5354

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PLC status data

(Hex 20 Byte)

Status data Format

[1]

 

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 ACK to ETX is converted into ASCII and added to BCC, and sent.

 

 

 

 

 

 

1 PLC status data: data Format is 20 bytes in hex Format and converted into ASCII code. Its contents are constituted as below table after converting ASCII code into hex data.

1

 

2

 

3

 

4

 

 

5

 

6

 

7

8

 

9

 

10

11

12

13

14

15

16

 

17

18

 

19

 

20

 

 

 

 

Null

 

 

 

CPU

Ver. CPU

null

connection

 

 

 

 

 

Null

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Type

 

No. Mode

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

CPU Type

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

CPU Type

 

K120S

 

 

K80S

 

 

K200SA

K200SB

 

 

K200SC

K300S

 

 

 

K1000S

 

 

 

 

 

Code

 

 

 

42

 

 

 

41

 

 

 

3A

 

3B

 

 

3C

 

 

33

 

 

32

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Version No. Ex) Bit

0

0

0

1

0

0

1

0

 

 

 

 

 

 

 

 

CPU Mode Ex) Bit

-

-

-

0

0

0

0

-

 

 

 

 

 

 

 

 

Version 1.2

Connection Ex) Bit

-

-

-

-

-

-

0

0

 

 

 

 

 

 

 

 

Bit 1

Bit 2

Bit 3

Bit 4

Stop

Run

PAUSE

DEBUG

Mode

Mode

Mode

Mode

Bit 0

Bit 1

Local

Remote

connection

connection

8-26

Page 216
Image 216
LG Electronics 120S user manual Reading PLC StatusRST, Pause Debug, Mode Bit Local Remote Connection