Mitsubishi Electronics MELSEC Q series MELSEC L series Home Theater Server User Manual


 
5-86
5.3 Serial Communication
5.3.8 BUFRCVS instruction
Z_BUFRCVS
Receive Data
Program Example
The following program receives data with an interrupt program.
[Structured ladder/FBD]
[ST]
(* Set the normal/error confirmation flag for the main program *)
(* The main program resets flags *)
SET(DX3, Var_Flag_Normal); (* Turns normal completion flag ON *)
SET(DX4, Var_Flag_Error); (* Turns error completion flag ON *)
(* Receives data from CH1 and stores the data in devices starting from D200 *)
Z_BUFRCVS(SM400, "00", 1, D200); (* Executes interrupt receive program *)
Device Item Setting data Setting range Setting side
+0
Receive data length
The number of data read from the number of receive
data storage area is stored.
0 or more System
+1
Receive data
Data read from the receive data storage area are
stored in ascending address order.
Systemto
+n
d
d
d
Turns normal completion
flag ON
Turns error completion
flag ON
Executes interrupt
receive program