MEWTOCOLMaster/Slave Communication5-45.3 MEWTOCOL-COM Master Communication (RECV)5.3.1 Read Data from an External Device InstructionsIn master communication, PLC has the sending right, and executes communication bysending commands to devices that support MEWTOCOL, and receiving responses.Messages in accordance with the protocol are automatically generated by PLC. In the userprogram, reading and writing can be done simply by specifying the station no. and memoryaddress and executing SEND/RECV commands.External device supportingMEWTOCOL-COM%01#RD0040000401 (BCC) C R%01$RD64000000 (BCC) C RCommand messageResponse message・・・・・・・・・・・・・・・・・・・・・・・・・・・・0DT101100DT100・・・・・・・・・・・・・・・・・・・・・・・・・・・・0DT00401100DT00400PLCSpecify and read station no. and address based on RECV command Sample program Send commands from the COM1 port of the CPU unit, read data from the data area of anexternal device (station no. 1) DT400 - DT401, and write the content into PLC's data registerDT100 - DT101. Confirm that the unit is in the master mode (XC), and that the sending process is not inprogress for the same port (YC), and start up the SEND command. In the UNITSEL command, specify the slot No. (U0) and the COM. port No. (U1). In the RECV command, specify and execute the partner station no. (U1), initial address(DT400), No. of data (U2), and initial address on the PLC side to save data (DT100).R0Clear to sendmastercommunication flagR100UNITSEL U0 U1RECV.US DT0U2 DT100U1 DT400XC YCSending mastercommunication flagR100ExecuteRECVSettings for communication portS1: Slot 0S2: COM1Starting conditions for RECVexecutionClear to send flag: ONSending flag: OFFRECV processingS1: Partner station no. (U1)S2: Data address (DT400)n: No. of data (U2)D1: Data saving area (DT100)D2: Execution result code (DT0)( )DFS1 S2S1 S2 n D1 D2Phone: 800.894.0412 - Fax: 888.723.4773 - Web: www.clrwtr.com - Email: info@clrwtr.com