58
5 MODULE DEDICATED INSTRUCTION
5.3 Serial Communication Instruction
Program example
• The following program stores data which are received using the nonprocedural protocol in the devices starting from D10.
(For the Q series C24 whose I/O signals are X/Y00 to X/Y1F)
[Structured ladder/FBD]
[ST]
IF((X3=TRUE) OR (X4=TRUE))THEN
MOVP(TRUE, 1, Var_ControlData[0]); (* Sets receive channel to 1 *)
MOVP(TRUE, 10, Var_ControlData[3]); (* Sets allowable number of words for receive data to 10 words *)
G_INPUT(TRUE, H0, Var_ControlData, D10, Var_Result); (* Receives data *)
END_IF;
IF(Var_Result[0]=TRUE)THEN (* Execution finished *)
IF(Var_Result[1]=FALSE)THEN (* Normal completion *)
MOV(TRUE, Var_ControlData[2], Z2);
BMOV(TRUE, D10, K0Z2, D110); (* Stores receive data *)
ELSE (* Error completion *)
SET(TRUE, Var_Flag_Error); (* Turns error completion flag ON *)
END_IF;
END_IF;
IF(X100=TRUE)THEN
RST(TRUE, Var_Flag_Error); (* Turns error completion flag OFF *)
END_IF;
Sets receive
channel to 1
Sets allowable number
of words for receive data
to 10 words
Receives data
Stores receive data
Turns error completion
flag ON
Turns error completion
flag OFF
Summary of Contents for MELSEC System Q
Page 1: ...MELSEC Q L Structured Programming Manual Special Instructions ...
Page 2: ......
Page 307: ...10 SFC CONTROL INSTRUCTION 10 2 SFC Transition Condition Comment Read 305 10 MEMO ...
Page 309: ...I 307 MEMO ...
Page 315: ......