Omron SYSMAC C200H-ASC02 Operation Manual page 90

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

Advertisement

Example Programs
Example 2a
PC Program
Execution
statement
10300
ASCII busy
Example 2b
ASCII Unit Program
PC READ "@D,0,5,5I4"; A,B,C,D,E
Remarks:
The above PC READ "@..." statement accesses the PC DM memory area
when the user specifies "@D" as its first argument. When the ASCII Unit ex-
ecutes the above PC READ "@..." statement, five words are read by the BA-
SIC program starting from DM word 0000, converted into BCD and assigned
to the variables A through E. During execution of the PC READ "@..." state-
ment, the busy flag (word n+3 bit 00) is set.
Purpose:
To write data to the PC using the PC WRITE statement
MOV(21)
A
#0003
101
B
MOV(21)
C
#0010
D
102
10002
A
Number of words to be transferred
C
Transfer base word (DM 0010)
Remarks:
In the above program, when the execution statement flag is set, data is writ-
ten to PC DM words 0010, 0011, and 0012 after the READ flag (word n bit
02) is set.
When the ASCII Unit executes the PC WRITE statement, variables P, Q, and
R are converted into BCD and stored in the specified DM addresses.
During execution of the PC WRITE statement, the ASCII busy flag (word n+3
bit 00) is set. When execution is complete, the busy flag is cleared.
The PC WRITE statement is not executed until the PC READ flag is set.
Purpose:
To use the ASCII Unit PC WRITE statement to specify and write
data to the PC DM area independently of the PC program
• This example does not require a PC data transfer routine.
ASCII Unit Program
PC WRITE "@D,10,3,3I4";P,Q,R
Sets the number of words to
be transferred
Sets the base word
number
READ flag
B
Word n+1
D
Word n+2 (where n = 100 +10 x unit no.)
Section 6-1
ASCII Unit Program
PC WRITE "3I4"; P,Q,R
81

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents