Flag operation in serial communication 
Header: No-STX, Terminator: CR 
Receiving data: 
The “reception done” flag, the “transmission done” flag, and the F159 (MTRN) instruction are related as 
follows: 
 
• For general-purpose serial communication, half-duplex transmission must be used. 
• Reception is disabled when the “reception done” flag R9038 or R9048 is on. 
• When F159 (MTRN) is executed, the number of bytes received is cleared, and the address (write 
pointer) in the receive buffer is reset to the initial address. 
• Also, when F159 (MTRN) is executed, the error flag R9037 or R9047, the “reception done” flag R9038 
or R9048 and the “transmission done” flag R9039 or R9049 goes off. 
• Duplex transmission is disabled while F159 (MTRN) is being executed. The “transmission done” flag 
R9039 or R9049 must be observed. 
• Reception stops if the error flag R9037 or R9047 goes on. To resume reception, execute the F159 
(MTRN) instruction, which turns off the error flag. 
 
 Note:  
• Be aware that the “reception done” flag R9038 or R9048 changes even while a scan is in progress 
(e.g., if the “reception done” flag is used multiple times as an input condition, there is a possibility of 
different statuses existing within the same scan.) To prevent multiple read access to the special internal 
relay you should generate a copy of it at the beginning of the program. 
 
 Key Point: 
• The contact numbers in parentheses refer to COM2 port.