Bit Block Write

This function is to assign PLC device memory directly to write the bit block. The data can be assigned up to 16 pieces repeatedly.

But, The total sum of the word data is not to be over 256 bits.

image-20240325-023716.png

 

 

 

Requested Format (PC -> PLC)

  • Bit Block Write (Master sends.)

  • Cmd – 77h

 

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, 77h(Bit Block Write)

 

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

 

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

 

Data :  (Ex.) ‘The case to write 4 bits as 1, 0, 0, 1 from Y0000D’

Offset(Byte)

Meaning of Data

Ex.

Remarks

0

Main Device Prefix (ASCII)

‘Y’

Assigns the ASCII Prefix of the bit 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 bit address of a corresponding device is used.

3

‘0’

4

‘0’

5

‘0’

6

‘0’

7

‘D’

8

Write Size (Bit)

00h

Number of bits, Value in the range from 0001h to 0100h (1~256)

9

04h

10

Bit Data

‘1’

Bit Value (ASCII, Set=’1’, Reset=’0’)

11

Bit Data

‘0’

Bit Value (ASCII, Set=’1’, Reset=’0’)

12

Bit Data

‘0’

Bit Value (ASCII, Set=’1’, Reset=’0’)

13

Bit Data

‘1’

Bit Value (ASCII, Set=’1’, Reset=’0’)

 

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 responding to ‘Bit Block Write’ that Master requests to write, in case of receiving Master’s request correctly and responding.

Cmd – 41h

 

 

Data Device

Offset(Byte)

Meaning of Data

Ex.

Remarks

0

Error Code

00h

Error Code (Non Error Code)

1

00h

 

 

NACK Response

In case that the service to ‘Bit Block Write’ cannot be given due to 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 Bit Write Data)

1

0Dh