![NAiS FP2 Скачать руководство пользователя страница 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.
Содержание FP2
Страница 2: ......
Страница 8: ......
Страница 9: ...Chapter 1 Functions and Restrictions of the Unit...
Страница 14: ...1 6...
Страница 15: ...Chapter 2 Specifications and Functions...
Страница 29: ...Chapter 3 Installation and Wiring of Communication Blocks...
Страница 35: ...Chapter 4 Communication Function...
Страница 36: ...4 2...
Страница 44: ...4 10 4 4 4 Flow Chart...
Страница 46: ...4 12...
Страница 47: ...Chapter 5 Communication Function PC PLC Link...
Страница 65: ...Chapter 6 Communication Function General purpose Serial communication...
Страница 94: ...6 30...
Страница 95: ...Chapter 7 Communication Function Computer link...
Страница 108: ...7 14...
Страница 109: ...Chapter 8 Applications...
Страница 118: ...8 10...
Страница 119: ...Chapter 9 Specifications...
Страница 139: ...Chapter 10 Dimensions and Sample Programs...
Страница 141: ...10 3 10 1 2 Communication Blocks FP2 CB232 AFP2803 FP2 CB422 AFP2804 FP2 CB485 AFP2805...
Страница 142: ...10 4...