Toshiba AS311 user manual Operation Procedure

Models: AS311

1 66
Download 66 pages 63.98 Kb
Page 43
Image 43
Manual background

5. Operation Procedure

In this sample program, the following devices/registers are used.

R0100 AS311 status (ON when ready) - Refer to section 5.4

R0200 Receiving normal complete (comes ON when receiving is complete normally) R0300 Receiving error complete (comes ON when receiving error has occurred)

X0006 Receive complete flag

X0007 Read ready flag

X0005 Receive error flag

Y0027 Read start flag

D0000 - D0063 Received message is stored here

D3000Receiving error information is stored here

D4000 - D4001 Parameters for READ instruction

This sample program works as follows.

Main program

-Rung 1: Calls Subroutine No. 0 when the AS311 is normal and both R0200 and R0300 are OFF.

-Rung 2: When R0200 comes ON (normal receiving), performs the necessary operation for the received message, then resets R0200 to OFF.

-Rung 3: When R0300 comes ON (receiving error has occurred), performs the error processing, then resets R0300 to OFF.

Subroutine No. 0

-Rung 1: Indicates the entry of Subroutine No. 0.

-Rung 2: Reads XW000 and XW001 from the AS311 by direct I/O instruction.

-Rung 3: Sets Y0027 (Read start flag) to ON if X0006 (Receive complete flag) is ON.

-Rung 4: When X0007 (Read ready flag) comes ON, reads the received message from the AS311’s buffer memory, 64 words starting with address 128, by READ instruction, and stores it into D0000 and after. Then resets Y0027 (Read start flag) to OFF, and sets R0200 to ON.

When X0005 (Receive error flag) comes ON, reads the error information from the AS311’s buffer memory, 1 word of address 16, by READ instruction, and stores it into D3000. Then resets Y0027 (Read start flag) to OFF, and sets R0300 to ON.

-Rung 5: Writes YW002 and YW003 into the AS311 by direct I/O instruction.

-Rung 6: Indicates the return of Subroutine No. 0.

User’s Manual 41

Page 43
Image 43
Toshiba AS311 user manual Operation Procedure