![NAiS FP2 Technical Manual Download Page 72](http://html2.mh-extra.com/html/nais/fp2/fp2_technical-manual_3062214072.webp)
6-8
6.4 Communication w ith External Devices
6.4.1 Programming Example of General-purpose Serial Communication
The F159 (MTRN) and F161 (MRCV) instructions are used to send and receive data via the specified
COM port.
F150 (READ) nor F151 (WRT) instruction which is effective with the serial data unit (AFP2460) is not
available with MCU.
Transmission of data
The amount of data specified by “n” is sent to the external device from among the data stored in the data
table, starting with the area specified by “S”, through the COM port specified by “D”. Data can be sent
with the start code and end code automatically attached. A maximum of 2048 bytes can be sent. When
the program below is run, the eight bytes of data contained in DT101 to DT104 and stored in the send
buffer starting from DT100 are sent from COM port 1.
MCU starts the transmission within 10 µs normally (within a maximum of 500 µs approx. in the PC(PLC)
link mode) right after the execution of the instruction.
Reception of data
The data received in the communication port of MCU in the slot No. specified by “S” is read and stored in
the data table saved by the specifications from “D1” to “D2”.
A maximum of 2048 bytes can be received.
In the program below, when X30 (reception done flag) (including the terminator data) turns on, the
received data in the COM. 1 port of the MCU located in the slot 3 is stored from DT1 specified for the
receive buffer.
The number of received bytes is stored in DT0.
Summary of Contents for FP2
Page 2: ......
Page 8: ......
Page 9: ...Chapter 1 Functions and Restrictions of the Unit...
Page 14: ...1 6...
Page 15: ...Chapter 2 Specifications and Functions...
Page 29: ...Chapter 3 Installation and Wiring of Communication Blocks...
Page 35: ...Chapter 4 Communication Function...
Page 36: ...4 2...
Page 44: ...4 10 4 4 4 Flow Chart...
Page 46: ...4 12...
Page 47: ...Chapter 5 Communication Function PC PLC Link...
Page 65: ...Chapter 6 Communication Function General purpose Serial communication...
Page 94: ...6 30...
Page 95: ...Chapter 7 Communication Function Computer link...
Page 108: ...7 14...
Page 109: ...Chapter 8 Applications...
Page 118: ...8 10...
Page 119: ...Chapter 9 Specifications...
Page 139: ...Chapter 10 Dimensions and Sample Programs...
Page 141: ...10 3 10 1 2 Communication Blocks FP2 CB232 AFP2803 FP2 CB422 AFP2804 FP2 CB485 AFP2805...
Page 142: ...10 4...