General-Purpose Communication7-27.1 Overview of Sending Data7.1.1 Overview of Sending DataCommunication with external devices is handled through the data registers. When data to besent is stored in the data register (DT) used as a send buffer, and F159 (MTRN) instruction isexecuted, the data is outputted from the COM port.PLCData register (DT) Send a command aligned to anexternal deviceReceive a response from anexternal deviceSend dataReceive dataRS-232C, RS-485,etc. (commerciallyavailable) Sample programThe following program sends a string “ABCDEFGH (Hex)” to an external device via COM1port.ⓑF95 ASC DT101“ABCDEFGH ”ⓒⓐ①④③②R0K1K8DT100F159 MTRN⑤( )DFR10R10Code Description① Character constant to be sentInput a character constant to be sent. In the case of input using FPWINGR7, select “M” as a device type. On FPWIN GR7, a character constant isbracketed by double quotation marks.② Area that stores send data Specify the starting address of the data register that stores data to be sent.③ Starting area of send buffer Specify the starting address of the data register allocated to a data tablethat contains send data and the number of send data.④ Number of send data bytes Specify the number of send data bytes.⑤ COM port No. Specify a COM port No. for sending data.K0: COM0 port; K1: COM1 port; K2:COM2 portⓐ Sending data instruction Turn ON the internal relay (R10) according to the timing of send conditions(R0).ⓑ Data conversion Convert the string “ABCDEFGH (Hex)” into ASCII code, and write it intoDT101 to DT104.ⓒ Sending data Data in the send buffer is sent from COM1 port.Explanation: 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 of 1) above is sent from COM1 port using an F159 (MTRN) instruction.