Word Block Write

This function is to assign PLC device memory directly to read according to memory data type. The data can be assigned up to 16 pieces repeatedly. The total sum of the word data should be not over 512 words.

 

image-20240325-023437.png

 

 

 

Requested Format (PC -> PLC)

  • Word Block Read (Master sends.)

  • Cmd – 52h

ID

Frame No.

Cmd

Res.

Length

Data

Check Sum

 

ID : This is a 9-byte string like "KDT_PLC_M".

 

FrameNo : This, a 1-byte data with the range from 0 to 127, is the number of the frame controlled by Master party.

 

Cmd : 1 Byte, 52h(Word Block Read)

 

Res : 1 byte of the reserved device (00h)

 

Length : Total number of the bytes of a frame data device

 

Data : (Ex.) The case to read 128 words from ‘Y00000’

Offset (Byte)

Meaning of Data

Ex.

Remarks

0

Main Device Prefix (ASCII)

‘Y’

Assigns the ASCII Prefix of the word device supported from a PLC.

1

Sub-Device Prefix

or ‘0’ (ASCII)

‘0’

Sub-Prefix in case of the 2-character prefix device

2

Device Address

(ASCII)

‘0’

The word address or the card number of a corresponding device is used. That is, in case of bit device such as X/Y, the last number should be ‘0’.

3

‘0’

4

‘0’

5

‘0’

6

‘0’

7

‘0’

8

Read Size (Word)

00h

Value in the range from 0001h to 0200h (1~512)

9

80h

 

Check Sum : This is 2-byte value. After the entire frame is binary-summed by the byte, the lower 2-byte in the result value is used.

 

 

Responded Format

 

ACK Response

This is the frame sending the data of the word block that Master requests to read, in case of receiving Master’s request correctly and responding.

Cmd – 52h

 

 

Data Device:

Offset (Byte)

Meaning of Data

Ex.

Remarks

0 ~ 9

Block Address

 

The first 10 bites of the data in the block assigned to a Master frame are copied and stored.

10

Word Data #0

 

The first word data of Read Block

11

 

12

Word Data #1

 

The second word data of Read Block

13

 

......

m-1

Word Data #n

 

The last word data of Read Block

m

 

 

 

NACK Response

In case that the service to ‘Word Block Read’ cannot be given due to an error in a system or other reason,

Cmd – 41h

In the case of responding to Error Code (Refer to the Error Code table for the Exclusive Service.)

 

 

Data Device

Offset (Byte)

Meaning of Data

Ex.

Remarks

0

Error Code

00h

Error Code (Error in the size of a requested data)

1

04h