Chapter 8 Communication Functions

3) Individual writing of device(W(w)SS)

(1) Introduction

This is a function that writes the PLC device memory directly specified in accord with memory data type.

(2) PC request format

 

Format name

 

 

Header

 

 

Station No.

 

 

Command

 

 

Command

 

 

Number of

 

 

Device

 

 

 

 

 

 

 

 

 

 

type

 

 

blocks

 

 

Length

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Frame (Example)

 

 

ENQ

 

 

H20

 

 

W(w)

 

 

SS

 

 

H01

 

 

H06

 

 

ASCII

 

 

H05

 

 

H3230

 

 

H57(77)

 

 

H5353

 

 

H3031

 

 

H3036

 

 

value

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Tail

 

 

Frame

 

Device Name

 

 

Data

 

 

.....

 

 

 

 

 

 

 

 

 

 

 

check

 

 

 

 

 

 

 

 

 

 

 

 

 

%MW100

 

 

H00E2

 

 

 

 

EOT

 

 

BCC

 

H254D5731

 

 

H30304

 

 

H04

 

 

 

 

3030

 

532

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1 block(setting can be repeated up to max. 16 blocks)

 

 

 

 

 

 

 

 

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.

 

 

 

 

 

 

 

 

 

 

This specifies how much of the blocks composed of "[device length][device name]" are in

 

 

Number of blocks

 

 

this request Format. This can be set up to 16. Therefore, the value of [Number of blocks]

 

 

 

 

 

must be set between H01(ASCII value:3031)-H10(ASCII value:3030).

 

 

Device

 

 

This indicates the number of name's characters that means device, which is allowable up to

 

 

length(Name

 

 

16 characters. This value is one of ASCII converted from hex type, and the range is from

 

 

length of device)

 

 

H01(ASCII value:3031) to H10(ASCII value:3130).

 

 

device

 

 

Address to be actually read is entered. This must be ASCII value within 16 characters, and

 

 

 

 

in this name, digits, upper/lower case, and '%' only are allowable to be entered.

 

 

 

 

 

 

 

 

 

 

If the value to be written in %MW100 area is H A, the data Format must be H000A. If the

 

 

Data

 

 

value to be written in %MW100 area is H A, the data Format must be H000A. In data area,

 

 

 

 

 

the ASCII value converted from hex data is entered.

 

Ex.1

If type of data to be currently written is WORD, the data is H1234, ASCII code converted value of this is "31323334" and this content must be entered in data area. Namely, most significant value must be sent first, least significant value last.

Remark

1)Device data types of each block must be the same.

2)If data type is Bit, the data to be written is indicated by bytes of hex. Namely, if Bit value is 0, it must be indicated by H00(3030), and if 1, by H01(3031).

8-15

Page 205
Image 205
LG Electronics 120S user manual Individual writing of deviceWwSS, Blocksetting can be repeated up to max blocks Explanation