Communication with External DevicesFP2 Serial Data Unit4 − 54.1 Overview of Communication with External Devices4.1.2 Receiving Data from External DeviceOverview of data receptionFP2CPU unit FP2 serial data unitShared memoryData receivingRS232CdeviceData reading usingF150(READ) instruction“Reception completed flag” contact goes onData input from the RS232C port is stored in the received buffer of the shared memory,and the “Reception completed flag” is turned on. This data is then read using the F150(READ) instruction of the ladder program, and is stored in a data register or another areaof the CPU unit.Sample program for data receptionData received through the RS232C port is read to DT100.X1R10DF, K0 , K251 , K5 , DT100R10X1 Y11F150 READSpecifies the FP2 serial data unit inslot no. 0.The contents of 5−word of shared memoryaddresses 251 to 255is read to the data register DT 100 to DT 104.The internal relay (R10) is turnedon at the “Reception Completed(X1)” timing.The data is read from the address251 area of the shared memory(the received buffer of CH1).When reception and reading ofthe data have been completed,Y11 is turned on, and the receivedbuffer is cleared.The program described above is executed in the following sequence.1 Data is received from the RS232C device to the received buffer of the shared memory.2 The “Reception Completed (X1) contact” from the serial data unit is turned on.3 The 5−word of data is read from the address 251 area of the shared memory in the serial dataunit (the received buffer of CH1), to an area which has DT100 of the data register as its startingarea.4 The received buffer is cleared.next page