![background image](http://html1.mh-extra.com/html/omron/sysmac-c200h-asc02/sysmac-c200h-asc02_operation-manual_742429093.webp)
84
Example 6
Purpose:
To direct execution of the ASCII Unit from the PC using the PC
GET statement
Another way to externally control program execution is through polling. Poll-
ing is the process of continuously checking the value of a specified bit or
word. If the value of the bit or word matches a condition set in the program, a
corresponding branch instruction is executed.
In the following program, the ASCII Unit PC GET statement is used to poll a
specific word of the PC.
10
PC GET I, J
20
K = J AND 3
30
IF K = 1 GOTO 100
40
IF K = 2 GOTO 200
50
IF K = 3 GOTO 300
60
GOTO 10
10008
PC Program
ASCII Unit Program
Specification 1
Specification 3
Specification 2
Specification 3
10009
Remarks:
The PC GET statement reads bits 10008 to 10015 of the PC as a word. The
word is logically “ANDed” with 3 (00000011) and the result of this operation is
used to branch the program. When bit 10008 is set, k will be equal to 1 and
the program will branch to line 100. If bit 10009 is set, k will be equal to 2 and
the program will branch to line 200.
Example 7
Purpose:
To control execution of the PC from the ASCII Unit using the PC
PUT statement
Using the PC PUT statement, the ASCII Unit can write data to word n+3 bits
08 through 15 of the PC. If the value of this data matches a condition set in
the PC program, a corresponding branch instruction will be executed.
PC Program
ASCII Unit Program
Execution
statement
10308
10309
10310
Process 1
Process 2
Process 3
10
INPUT A
20
PC PUT A
Remarks:
Example Programs
Section 6-1
Содержание SYSMAC C200H-ASC02
Страница 1: ...Cat No W165 E1 04 ASCII Unit SYSMAC C200H ASC02 ...
Страница 2: ...C200H ASC02 ASCII Unit Operation Manual Revised September 2002 ...
Страница 3: ...iv ...
Страница 5: ...vi ...
Страница 7: ...TABLE OF CONTENTS viii Glossary 159 Index 163 Revision History 165 ...
Страница 122: ...Appendix B Specifications 115 130 35 100 5 ...
Страница 167: ...Cat No W165 E1 04 Note Specifications subject to change without notice Printed in Japan Authorized Distributor ...
Страница 168: ...Cat No W165 E1 04 C200H ASC02 ASCII Unit OPERATION MANUAL ...