8. Rotation and Shift Design Examples Control Program: X0 Send the Room No. 101 to D10 X1 Send the Room No. 102 to D10 X2 Send the Room No. 103 to D10 X3 Send the Room No. 104 to D10 X4 Send the Room No. 105 to D10 X0 Send the value in D10 to registers specified by D0 (D1~D5) X1 X2 X3 X4 X5 Display the value (Room NO.) according to registers specified by D0 (D1~D5) X6 When X6 is activated, the value in D0~D5 and D11 will be cleared. Program Description: z By using API38 SFWR instruction together with API39 SFRD instruction, the program performs data stack writing and reading control in FIFO(first in, first out) principle. In this example, the room number first called will be first checked.
z When Call buttons are pressed, the numbers of the five rooms will be stored in D10 first and then sent to data stack D1~D5 according to the time order. z When CHECK is pressed, the room number first called will be read to D11 first and the amount of calling will be decreased corresponding to D0. In addition, by using Delta TP04, the system can easily monitor the value of D0 (Amount of calling) and D11 (Displaying Room No.) z The program clears D0~D5 and D11 by ZRST and RST instructions, which means Amount of calling and Room number displayed on TP04 will be 0.
DVP-PLC Application Examples 8-9 MOV K101 D10 MOV K102 D10 MOV K103 D10 MOV K104 D10 MOV K105 D10 SFWR D10 D0 K6 SFRD D0 D11 K6 ZRST D0 D5 RST D11