Chapter 8 Communication Functions

8.2.3 Instruction

1) User defined communication instruction(SNDCOM)

SNDCOM

User defined communication instruction

 

Instruction

 

 

 

 

Available Device

 

 

 

No. of

 

Flag

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

steps

 

 

 

 

M

P

K

L

F

T

C

S

D

#D

integer

Error

Zero

Carry

 

 

 

 

 

(F110)

(F111)

(F112)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Ch

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

7

 

 

 

 

n1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

D

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Flag Set

Error

Error flag turns on when designating area is

(F110)

over and the instruction isn’t executed

 

 

Designation

Ch

Designated communication channel

 

 

n1

Frame lists which is designated at parameter

 

 

D

Device which the communication status is stored

 

 

SNDCOM Ch n1 D

(1)Function

When the execution condition is on, the communication starts with protocol at parameter which is designated early.

‘Ch’ is communication channel and ‘n’ is a frame number at parameter which is designated

‘D’ is a device which the communication status is stored.

(2)example of program

When input condition is on, channel 1 stars communication with protocol at user defined parameter rnumber 3.

The communication state is stored M000 and the format of M000 Iis as below

bit 15

 

 

 

 

 

 

bit 8

 

 

 

 

 

 

bit 1 bit 0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Error code (1 byte)

Error bit

Done bit

Done bit : When transfer is completed normally, this bit turns on during 1 scan.

Error bit : When communication error occurs, ,this bit turns on.

Error code : When error bit turns on, the error code is stored.

8-47

Page 237
Image 237
LG Electronics 120S Communication Functions Instruction, User defined communication instructionSNDCOM, Example of program