Example Programs; Section 6 Program Examples - Omron SYSMAC C200H-ASC02 Operation Manual

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

Advertisement

Example Programs

6-1
Example Programs
Example 1a
PC Program
Execution
statement
10300
ASCII busy
Example 1b
80
This section presents examples of data transfer routines written for both the
PC and the ASCII Unit. The examples illustrate how the two programs work
together to transfer data. Some of the examples have two ASCII Unit rou-
tines; the first one runs in conjunction with a PC routine and the second one
runs independently of the PC and does not require a PC program.
Throughout this section, the following is assumed:
Unit no. : 0
Data area of PC: DM
Purpose:
To transfer data from the PC to the ASCII Unit using the PC
READ statement
MOV(21)
#0005
A
101
B
MOV(21)
#0000
C
D
102
10001
A
Number of words to be transferred
C
Transfer base word (DM 0000)
Remarks:
In this example, when the execution statement flag is set, the data stored in
words 0000 to 0004 is written to the ASCII Unit after the WRITE flag (word n
bit 01) has been set.
When the ASCII Unit executes the PC READ statement, five specified words
are read by the BASIC program, converted into BCD and assigned to the
variables A through E. During execution of the PC READ statement, the
ASCII Unit busy flag (word n+3 bit 00) is set. When execution is complete,
the busy flag is cleared.
Purpose:
To use the ASCII Unit PC READ statement to specify and read
data from the PC independently of the PC program
• This example does not require a PC data transfer routine.
specifies the number of
words to be transferred
specifies the base word
for data transfer
WRITE flag
B
Word n+1
D
Word n+2 (where n= 100 +10 x unit no.)
Section 6-1
ASCII Unit Program
PC READ "5I4"; A,B,C,D,E

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents