74
5 MODULE DEDICATED INSTRUCTION
5.3 Serial Communication Instruction
Program example
The following program changes the send buffer area of the CH1 side interface. (For the Q series C24 whose I/O signals are X/
Y00 to X/Y1F)
• Sets send buffer to C00H to FFFH.
• Sets receive buffer to 600H to 7FFH.
[Structured ladder/FBD]
[ST]
IF(Var_Flag_Inst=TRUE)THEN
FMOVP(TRUE,0,112, Var_ControlData[0]); (* Resets D0 to D111 to 0 *)
MOVP(TRUE, 0, Var_ControlData[0]); (* Sets execution type *)
MOVP(TRUE, 1, Var_ControlData[2]); (* Sets request type *)
MOVP(TRUE, 1, Var_ControlData[3]); (* Sets word/byte unit to word *)
MOVP(TRUE, H400, Var_ControlData[4]); (* Sets on-demand start address *)
MOVP(TRUE, 0, Var_ControlData[5]); (* Sets on-demand buffer size *)
MOVP(TRUE,H0C00, Var_ControlData[6]); (* Sets send buffer start address *)
MOVP(TRUE, H400, Var_ControlData[7]); (* Sets send buffer size *)
MOVP(TRUE, H600, Var_ControlData[8]); (* Sets receive buffer start address *)
MOVP(TRUE, H200, Var_ControlData[9]); (* Sets receive buffer size *)
ZP_CSET(TRUE, "U0", 1, Var_ControlData, Var_Dummy, Var_Result); (* Performs initialization *)
END_IF;
IF(Var_Result[0]=TRUE)THEN (* Execution finished *)
IF(Var_Result[1]=FALSE)THEN (* Normal completion *)
SET(TRUE, Var_Flag_Normal); (* Turns normal completion flag ON *)
ELSE (* Error completion *)
SET(TRUE, Var_Flag_Error); (* Turns error completion flag ON *)
END_IF;
END_IF;
Clears D0 to D111
to 0
Sets execution
type
Sets request type
Sets word/byte
unit to word
Sets on-demand
start address
Sets on-demand
buffer size
Sets send buffer
start address
Sets send buffer
size
Sets receive buffer
start address
Sets receive buffer
size
Performs
initialization
Turns normal
completion flag ON
Turns error
completion flag ON
Содержание MELSEC System Q
Страница 1: ...MELSEC Q L Structured Programming Manual Special Instructions ...
Страница 2: ......
Страница 307: ...10 SFC CONTROL INSTRUCTION 10 2 SFC Transition Condition Comment Read 305 10 MEMO ...
Страница 309: ...I 307 MEMO ...
Страница 315: ......