6-9
6.5 Data Transmissio n F159 (MTRN) Instruction
Communication with external devices is handled through the data registers located in the CPU unit.
Data to be output is stored in the register used as the send
buffer (DT), and when the F159 (MTRN) instruction is
executed, the data is output from the COM port specified
by the MCU installed in the specified slot.
The MCU starts the data transmission within 10 µs right
after the F159 (MTRN) instruction is executed (when
PC(PLC) link is performed, within approx. 500 µs at
maximum).
Sample program for sending data
The following program transmits the characters “ABCDEFGH (Hex)” to an external device using COM
port 1 in the slot 2.
Data table for transmission (send buffer)
The data table is specified using F159 (MTRN) instruction.
The program described above is executed in the following sequence.
1) “ABCDEFGH” is converted to an ASCII code and stored in a data register.
2) The data is sent from COM port 1 using the F159 (MTRN) instruction.
Explanatory diagram