F159 Mtrn] Serial Data Send / Receive Instruction - Panasonic FP0H User Manual

Programmable controller
Hide thumbs Also See for FP0H:
Table of Contents

Advertisement

Instruction References

8.2.8 [F159 MTRN] Serial Data Send / Receive Instruction

 Instruction format
R0
DF
 Devices that can be specified (indicated by ●)
Operands
WX
WY
S
n
D
(*1): A character constant cannot be specified.
 Operands
Items
Settings
S
Starting area (data register) of the data table
Area storing the number of bytes of data to be sent, or constant data
- Add the terminator (end code) during transmission when the value is positive.
n
- Do not add the terminator (end code) during transmission when the value is negative.
- In the case of H8000, the purpose of COM port is switched.
D
COM port No. for sending data (K0 / K1 / K2)
 Outline of operation
Data is sent or received with an external device connected to the COM port. F159 (MTRN)
instruction has the following three functions.
Items
Description
In the data register starting with [S], data to be sent to an external device is set as a table in
Send
advance. By executing the [F159 MTRN] instruction, data of [n] bytes is sent from the COM
port to an external device.
Data sent to COM port is stored in the receive buffer (data register DT) specified by the
system register. Once the reception is done, the "reception done flag" turns on, and disables
Receive
further reception. When the [F159 MTRN] instruction is executed, the "reception done flag"
turns OFF, and enables reception. The F159 (MTRN) instruction is used to turn OFF the
reception done flag for general-purpose communication (i.e. to enable reception).
Operation
Operation mode of COM port can be switched between "general-purpose communication
mode switching
mode" and "computer link mode".
 System register settings
• Using the system register, it is required to set to "general-purpose communication mode" in
COM port.
• Using the system register, it is required to align the baud rate and transmission format with
an external device.
• To secure an area for storing receive data in the data register (DT), it is required to specify
"Receive buffer starting number in general-purpose communication" and "Receive buffer
capacity in general-purpose communication" using the system register.
8-16
F159 MTRN DT100
WR
WL
SV
EV
K8
S
DT
LD
I
K1
n
D
Constant Index modifier
(*1)
K
H

Advertisement

Table of Contents
loading

Table of Contents