Omron SYSMAC C200H-ASC02 Operation Manual page 93

Ascii unit
Hide thumbs Also See for SYSMAC C200H-ASC02:
Table of Contents

Advertisement

Example Programs
Example 6
Example 7
84
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.
PC Program
Specification 1
Specification 3
Specification 2
Specification 3
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.
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
Execution
statement
10308
10309
10310
Remarks:
ASCII Unit Program
10
10008
20
30
40
50
60
10009
ASCII Unit Program
Process 1
10
20
Process 2
Process 3
Section 6-1
PC GET I, J
K = J AND 3
IF K = 1 GOTO 100
IF K = 2 GOTO 200
IF K = 3 GOTO 300
GOTO 10
INPUT A
PC PUT A

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents