Please read and understand this manual before using the product. Please consult your OMRON
representative if you have any questions or comments.
Warranty and Limitations of Liability
WARRANTY
OMRON's exclusive warranty is that the products are free from defects in materials and workmanship for a
period of one year (or other period if specified) from date of sale by OMRON.
OMRON MAKES NO WARRANTY OR REPRESENTATION, EXPRESS OR IMPLIED, REGARDING NONINFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR PARTICULAR PURPOSE OF THE
PRODUCTS. ANY BUYER OR USER ACKNOWLEDGES THAT THE BUYER OR USER ALONE HAS
DETERMINED THAT THE PRODUCTS WILL SUITABLY MEET THE REQUIREMENTS OF THEIR
INTENDED USE. OMRON DISCLAIMS ALL OTHER WARRANTIES, EXPRESS OR IMPLIED.
LIMITATIONS OF LIABILITY
OMRON SHALL NOT BE RESPONSIBLE FOR SPECIAL, INDIRECT, OR CONSEQUENTIAL DAMAGES,
LOSS OF PROFITS OR COMMERCIAL LOSS IN ANY WAY CONNECTED WITH THE PRODUCTS,
WHETHER SUCH CLAIM IS BASED ON CONTRACT, WARRANTY, NEGLIGENCE, OR STRICT
LIABILITY.
In no event shall the responsibility of OMRON for any act exceed the individual price of the product on which
liability is asserted.
IN NO EVENT SHALL OMRON BE RESPONSIBLE FOR WARRANTY, REPAIR, OR OTHER CLAIMS
REGARDING THE PRODUCTS UNLESS OMRON'S ANALYSIS CONFIRMS THAT THE PRODUCTS
WERE PROPERLY HANDLED, STORED, INSTALLED, AND MAINTAINED AND NOT SUBJECT TO
CONTAMINATION, ABUSE, MISUSE, OR INAPPROPRIATE MODIFICATION OR REPAIR.
1
No. 6182
Application Considerations
SUITABILITY FOR USE
OMRON shall not be responsible for conformity with any standards, codes, or regulations that apply to the
combination of products in the customer's application or use of the products.
At the customer's request, OMRON will provide applicable third party certification documents identifying
ratings and limitations of use that apply to the products. This information by itself is not sufficient for a
complete determination of the suitability of the products in combination with the end product, machine,
system, or other application or use.
The following are some examples of applications for which particular attention must be given. This is not
intended to be an exhaustive list of all possible uses of the products, nor is it intended to imply that the uses
listed may be suitable for the products:
• Outdoor use, uses involving potential chemical contamination or electrical interference, or conditions or
uses not described in this manual.
• Nuclear energy control systems, combustion systems, railroad systems, aviation systems, medical
equipment, amusement machines, vehicles, safety equipment, and installations subject to separate
industry or government regulations.
• Systems, machines, and equipment that could present a risk to life or property.
Please know and observe all prohibitions of use applicable to the products.
NEVER USE THE PRODUCTS FOR AN APPLICATION INVOLVING SERIOUS RISK TO LIFE OR
PROPERTY WITHOUT ENSURING THAT THE SYSTEM AS A WHOLE HAS BEEN DESIGNED TO
ADDRESS THE RISKS, AND THAT THE OMRON PRODUCTS ARE PROPERLY RATED AND INSTALLED
FOR THE INTENDED USE WITHIN THE OVERALL EQUIPMENT OR SYSTEM.
PROGRAMMABLE PRODUCTS
OMRON shall not be responsible for the user's programming of a programmable product, or any
consequence thereof.
2
No. 6182
Disclaimers
CHANGE IN SPECIFICATIONS
Product specifications and accessories may be changed at any time based on improvements and other
reasons.
It is our practice to change model numbers when published ratings or features are changed, or when
significant construction changes are made. However, some specifications of the products may be changed
without any notice. When in doubt, special model numbers may be assigned to fix or establish key
specifications for your application on your request. Please consult with your OMRON representative at any
time to confirm actual specifications of purchased products.
DIMENSIONS AND WEIGHTS
Dimensions and weights are nominal and are not to be used for manufacturing purposes, even when
tolerances are shown.
PERFORMANCE DATA
Performance data given in this manual is provided as a guide for the user in determining suitability and does
not constitute a warranty. It may represent the result of OMRON's test conditions, and the users must
correlate it to actual application requirements. Actual performance is subject to the OMRON Warranty and
Limitations of Liability.
ERRORS AND OMISSIONS
The information in this manual has been carefully checked and is believed to be accurate; however, no
responsibility is assumed for clerical, typographical, or proofreading errors, or omissions.
3
iv
Notice:
OMRON products are manufactured for use according to proper procedures by a qualified operator
and only for the purposes described in this manual.
The following conventions are used to indicate and classify warnings in this manual. Always heed the
information provided with them.
DANGERIndicates information that, if not heeded, is likely to result in loss of life or serious injury.
!
WARNINGIndicates
!
CautionIndicates
!
age to the product, or faulty operation.
information that, if not heeded, could possibly result in loss of life or serious injury
information that, if not heeded, could result in relatively serious or
OMRON Product References
All OMRON products are capitalized in this manual. The word “Unit” is also capitalized when it refers
to an OMRON product, regardless of whether or not it appears in the proper name of the product.
The abbreviation “Ch,” which appears in some displays and on some OMRON products, often means
“word” and is abbreviated “Wd” in documentation in this sense.
The abbreviation “PC” means Programmable Controller and is not used as an abbreviation for anything else.
Visual Aids
The following headings appear in the left column of the manual to help you locate different types of
information.
Note Indicates
of the product.
information of particular interest for ef
minor injury
ficient and convenient operation
, dam
.
-
OMRON, 1991
All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any
form, or by any means, mechanical, electronic, photocopying, recording, or otherwise, without the prior written permission of OMRON.
No patent liability is assumed with respect to the use of the information contained herein. Moreover, because OMRON is
constantly striving to improve its high-quality products, the information contained in this manual is subject to change
without notice. Every precaution has been taken in the preparation of this manual. Nevertheless, OMRON assumes no
responsibility for errors or omissions. Neither is any liability assumed for damages resulting from the use of the information contained in this publication.
1, 2, 3...
1. Indicates lists of one sort or another, such as procedures, checklists, etc.
manual describes the installation and operation of the C500-ASC04 ASCII Unit. The ASCII Unit can
be mounted to a C500, C1000H, C2000H, or CV-series PC to control ASCII data I/O through a BASIC
program
and I/O WRITE instructions (READ(88) and WRIT(87) or READ(190) and WRIT(191)).
It has been assumed in the writing of this manual that the reader is already familiar with the hardware,
programming,
should refer to the appropriate OMRON PC manuals for assistance.
stored in the ASCII Unit. The C500-ASC04
and terminology of OMRON PC’
must be used with a PC that supports the I/O READ
s. If a review of this information is necessary
, the
reader
manual contains the following sections. Please read this
This
stand the information provide before attempting to install and operation the ASCII Unit.
Section 7
Section
ASCII Unit and the PC exchange data.
Section
load, save, and run an BASIC program for the ASCII Unit.
Section
commands
ers already proficient in BASIC pay careful attention to this section.
Section 11
Unit’s
Section 12
ented
the PC work together in various applications. Also in this section are several examples used to illustrate
the execution sequence of the hardware during execution of the ASCII Unit and PC programs.
Detailed technical information not immediately necessary for the understanding of a particular section
has
of the appendices, see the table of contents.
NoteIn this manual, ladder diagram instructions are given by mnemonics with the function codes in
explains the external hardware of the ASCII Unit and how it connects to a PC system.
8
explains the format of the PC memory area accessed by the ASCII Unit. This area is where the
9
explains how the ASCII Unit program and the PC program communicate as well as how to write,
10
presents the BASIC programming language used by the ASCII Unit. Since many of the BASIC
are nonstandard and peculiar to an ASCII Unit-PC system, it
explains the
BASIC program. It also explains in detail how to write, edit, and run an assembly language program.
presents programming examples that are meant to bring together all of the concepts pres-
in this manual. Most of the programs deal with data transfer and illustrate
been put into one of the seven appendices and should be used for reference
parentheses
code is for CV-series PCs. For example, in MOV(21/030) (the MOVE instruction), the function
code for C-series PCs is 21; for CV-series PCs, 030.
assembly language programming environment and how it relates to the ASCII
following them. The first function code is for C-series PCs and the second function
manual completely and be sure you under
is recommended that even read
how the ASCII Unit and
when needed. For a list
-
-
!
WARNING Failure to read and understand the information provided in this manual may result in
personal injury or death, damage to the product, or product failure. Please read each
section
and related sections before attempting any of the procedures or operations given.
in its entirety and be sure you understand the information provided
in the section
ix
PRECAUTIONS
This section provides general precautions for using the Programmable Controller (PC) and related devices.
The
information contained in this section is important for the safe and r
this section and understand the information contained before attempting to set up or operate a PC system.
manual is intended for the following personnel, who must also have knowl
edge of electrical systems (an electrical engineer or the equivalent).
• Personnel in charge of installing FA systems.
• Personnel in charge of designing FA systems.
• Personnel in charge of managing FA systems and facilities.
2General Precautions
The
user must operate the product according to the performance specifications
described in the operation manuals.
Before
using the product under conditions which are
or applying the product to nuclear control systems, railroad systems, aviation
systems, vehicles, combustion systems, medical equipment, amusement
machines,
may
your OMRON representative.
Make sure that the ratings and performance characteristics of the product are
sufficient
systems, machines, and equipment with double safety mechanisms.
This
Be
sure
manual close at hand for reference during operation.
safety equipment, and other systems, machines,
have a serious influence on lives and property if
for
manual provides
to read this manual before attempting to use the software and keep this
4Operating Environment Precautions
-
not described in the manual
and equipment that
used improperly
the systems, machines, and equipment, and be sure to provide the
information for programming and operating OMRON PCs.
, consult
WARNING It is extreme important that a PC and all PC Units be used for the specified
!
purpose
directly or indirectly affect human life. You must consult with your OMRON
representative before applying a PC System to the abovementioned
applications.
and under the specified conditions, especially in applications that can
3Safety Precautions
WARNING Do
!
WARNING Do not touch any of the terminals or terminal blocks while the power is being
!
WARNING Do
!
not attempt to take any Unit apart while the power is being supplied. Doing
may result in electric shock.
supplied. Doing so may result in electric shock.
not
attempt to disassemble, repair
may result in malfunction, fire, or electric shock.
, or modify any Units. Any attempt to do so
4Operating Environment Precautions
CautionDo not operate the control system in the following locations:
!
so
xii
• Locations subject to direct sunlight.
• Locations subject to temperatures or humidity outside the range specified in
the specifications.
• Locations
ture.
subject to condensation as the result of severe changes in tempera
-
• Locations subject to corrosive or flammable gases.
• Locations subject to dust (especially iron dust) or salts.
• Locations subject to exposure to water, oil, or chemicals.
• Locations subject to shock or vibration.
5Application Precautions
CautionTake
!
CautionThe
!
appropriate and suf
following locations:
• Locations subject to static electricity or other forms of noise.
• Locations subject to strong electromagnetic fields.
• Locations subject to possible exposure to radioactivity.
• Locations close to power supplies.
operating environment of the PC system can
gevity
and reliability of the system. Improper operating environments can lead to
malfunction,
sure
that the operating environment is within the specified conditions at installa
tion and remains within the specified conditions during the life of the system.
failure,
5Application Precautions
Observe the following precautions when using the PC system.
WARNING Always heed these precautions. Failure to abide by the following precautions
!
could lead to serious or possibly fatal injury.
• Always
necting to a ground of 100 Ω or less may result in electric shock.
• Always
lowing.
shock.
ground the system to 100 Ω or less when installing the Units. Not con
turn OFF the power supply to the PC before attempting any of the fol
Not turning OFF the power supply may result in malfunction or
• Mounting
ply Units, or any other Units.
• Assembling the Units.
• Setting DIP switches or rotary switches.
• Connecting cables or wiring the system.
• Connecting or disconnecting the connectors.
or dismounting I/O Units, CPU Units, Memory Units Power Sup
ficient countermeasures when installing systems in the
have a large ef
and other unforeseeable problems with the PC system. Be
fect on the lon
electric
-
-
-
-
-
CautionFailure
!
PC
cautions.
• Fail-safe measures must be taken by the customer to ensure safety in the
• Always use the power supply voltages specified in this manual. An incorrect
• Take
• Install
to abide by the following precautions could lead to faulty operation of the
or the system, or
of incorrect, missing, or abnormal signals caused by broken signal lines,
event
momentary power interruptions, or other causes.
voltage may result in malfunction or burning.
appropriate measures to ensure that the specified power with the rated
voltage
power
ing
result in burning.
and frequency is supplied. Be particularly careful in places where the
supply is unstable. An incorrect power supply may result in malfunction.
external breakers and take other safety measures against short-circuit
in external wiring. Insuf
could damage the PC or PC Units. Always heed these pre
ficient safety measures against short-circuiting may
-
-
xiii
• Do not apply voltages to the Input Units in excess of the rated input voltage.
Excess voltages may result in burning.
• Do not apply voltages or connect loads to the Output Units in excess of the
maximum switching capacity. Excess voltage or loads may result in burning.
• Disconnect
tests.
• Be sure that all the mounting screws, terminal screws, and cable connector
screws
ing torque may result in malfunction.
• Leave
sult in malfunction if foreign matter enters the Unit.
• Remove
tion. Leaving the label attached may result in malfunction.
• Double-check
ply. Incorrect wiring may result in burning.
• Wire correctly. Incorrect wiring may result in burning.
• Mount Units only after checking terminal blocks and connectors completely.
• Be
sure that the terminal blocks, Memory
items with locking devices are properly locked into place. Improper locking
may result in malfunction.
• Check
Unit. Not checking the program may result in an unexpected operation.
• Confirm
the following. Not doing so may result in an unexpected operation.
• Changing the operating mode of the PC.
• Force-setting/force-resetting any bit in memory.
• Changing the present value of any word or any set value in memory.
• Resume
the DM Area, HR Area, and other data required for resuming operation. Not
doing so may result in an unexpected operation.
• Do
not pull on the cables or bend the cables beyond their natural limit.
either of these may break the cables.
• Do
not place objects on top of the cables or other wiring lines. Doing so may
break the cables.
• Use
crimp terminals for wiring. Do not connect bare stranded wires directly to
terminals. Connection of bare stranded wires may result in burning.
• When
Not doing so may result in malfunction or burning.
• Before
to
discharge any
age.
the functional ground terminal when
Not disconnecting the functional ground terminal may result in burning.
are tightened to the torque specified
the label attached to
the label after the completion of wiring to ensure proper heat dissipa
all wiring and switch settings before turning ON the power sup
the user program for proper execution before actually running it on the
that no adverse ef
operation only after transferring to the new CPU Unit the contents of
replacing parts, be sure to confirm that the
touching a Unit, be sure to first touch a
static built-up. Not doing so may result in malfunction or dam
the Unit when wiring. Removing the label may re
fect will occur in the system before attempting any of
performing withstand voltage
in this manual. Incorrect tighten
Units, expansion cables, and other
Doing
rating of a new part is correct.
grounded metallic object in order
5Application Precautions
-
-
-
-
-
xiv
SECTION 1
Hardware
This
section describes the external hardware of the ASCII Unit. The front and back panels of the ASCII Unit contain switches,
buttons,
Unit’s internal configuration as well as a typical system configuration are also illustrated.
On the front panel of the ASCII Unit, there are six indicator lights, the reset
switch,
the ST
partment.
for setting various control parameters.
PortsThe front panel of the ASCII Unit contains two RS-232C ports. These ports
are used for connecting peripheral I/O devices to the ASCII Unit. Both ports
can be used for communication devices such as printers, terminals, and modems. Only port 1 can be used for uploading or downloading a BASIC program. The standard configuration is a personal computer connected to port 1
and a printer or other I/O device connected to port 2.
SwitchesThe START/STOP switch is a toggle switch and is used for initiating and halt-
ing execution of the ASCII Unit program.
RESET
The
Battery CompartmentThe battery compartment holds the C500-BAT08 Battery.
Front Panel
ART/ST
OP switch, two RS-232C
connectors, and a battery com
In addition, behind the LED Display Panel, is an 8-pin DIP switch used
switch is used for resetting the ASCII Unit.
-
LED display
Indicates the operating
status of the ASCII Unit.
RESET switch
Resets the ASCII Unit
START/STOP switch
Starts/stops BASIC
program execution.
Indicator LEDs
NameIndicationFunction
RUNLit (green)Lit when the ASCII Unit is operating normally. Unlit if an error
T/R for ports 1 and 2Blinking (green)Blinks during data transmission (port 1 and port 2).
ERROR 1 (port 1)
ERROR 2 (port 2)
BASIC
BAT ERRBlinking (red)Blinks when the battery voltage has fallen below the rated level or
4CHLit (green)Lit when the ASCII Unit is set for 4-word mode. Unlit when the
Lit (red)Lit if a reception buffer overflows or an error such as parity error
Lit (green)Lit while the BASIC program is running.
Blinking (green)Blinks when the BASIC program stops, or when the ASCII Unit is
Unlit (green)Unlit when in monitor mode.
The following table describes the ASCII Unit’s indicators.
DIP switch
DIP switch is visible when the
indicator panel is removed.
RS-232C connector port 1
Connects peripheral devices. Is generally
used to input the BASIC program but can be
used for other peripheral devices as well.
RS-232C connector port 2
Connects peripheral devices. Cannot be
used to input a BASIC program. Is generally
used for a printer or other RS-232C devices.
Battery compartment
Holds the C500-BAT08 Battery.
occurs.
occurs (see note), or while the ASCII Unit is waiting for specific
transmission conditions to be satisfied.
waiting for input while the BASIC program is running.
if the battery is not inserted correctly.
ASCII Unit is set for 2-word mode.
2
Front PanelSection 1-1
Front Panel DIP Switch
Note When
a reception buf
is
lit and will not be turned of
overflow
tor, execute the CLOSE instruction or stop the program.
In order to access the front panel DIP switch, the indicator cover must be removed
DIP
before
when mounting the ASCII Unit.
is corrected, because the error log must be kept. To turn of
with a standard screwdriver as shown in the illustration below
switch, the power
the ASCII Unit is mounted to the PC. Make sure the power to the PC is of
fer overflows or transmission error occurs, the red indicator
f even if the transmission error
to the ASCII Unit must be OFF
Standard
Screwdriver
. The DIP switch must be set
or reception buf
fer
f the indica
. T
o set the
-
f
3
Front PanelSection 1-1
DIP Switch Settings
OFFON: 0
: 1
12345678
Start mode
Pin No.1Function
Setting
Automatic program transfer from EEPROM to RAM
Pin No.Function
Setting
0
1
Manual start mode
In this mode, the BASIC program is
not started upon power application.
0
To start the program, either press
the START/STOP switch or issue a
start command from the personal
computer connected to port 1.
Automatic start mode
In this mode, the BASIC program
1
is started automatically on power
application.
2
Set this pin to “0” if only the
RAM is to be used.
Set this pin to “1” to automatically transfer the program
from the EEPROM to RAM on
power application or reset.
Screen size
Pin No.Screen Size
Setting
Pin No.Function5
Setting
678
000
1
00
1
11
00
0
1
11
0
Specifies 2 or 4 word setting for
the Data Section.
Two word setting. Choose this setting
0
to use WRIT(87/191)/READ(88/190)
Four word setting. This setting is used
when the ASCII Unit is mounted to a
1
Slave Rack or when the PC does not
support WRIT(87/191)/READ(88/190).
40 columns x 7 lines
40 columns x 8 lines
40 columns x 15 lines
00
40 columns x 16 lines
0
80 columns x 15 lines
1
80 columns x 16 lines
1
80 columns x 24 lines
80 columns x 25 lines
111
Program No.
These pins select which program will be executed on power
application or reset. The program number can be changed
later with the PGEN command.
Pin No.Function34
Setting
00
10
01
11
No. 1
No. 2
No. 3
4
Back PanelSection 1-2
1-2Back Panel
The back panel of the ASCII Unit houses the PC connector and an 8-pin DIP
switch used for setting the communication parameters.
Back Panel
Mounting Screw
For mounting the ASCII Unit
to the PC Rack
Connector
Connects the ASCII Unit
to the PC
DIP Switch
For setting the communication parameters
Mounting Screw
For mounting the ASCII Unit
to the PC Rack
Back Panel DIP Switch
Baud rate selection for port 1
Pin No.
Setting
123
000
1
1
0
• Pins 1, 2, and 3 are used for setting the baud rate of port 1.
• Pins 4, 5, and 6 are used for setting the baud rate of port 2.
• Pins
7 and 8 are not used but must be set to OFF
. If they are left ON, the Hard
ware Test program will be executed and all RAM data will be lost.
The DIP switch settings are described in more detail in the following diagram.
Common Memory can be accessed using the ASCII Unit’
WRITE
READ(88/190)
statements. It can also be accessed using the PC’
instructions. I/O data can be accessed using the ASCII Unit’
GET, PC PUT, and ON PC statements. It can also be accessed using the
MOV(21/030) instruction.
The following figure illustrates these instructions and their relationship to the
Common Memory and the I/O data.
ASCII Unit
s PC READ or PC
s WRIT(87/191) and
s PC
PC
CPU
LED Indicators
DIP Switches
I/O Bus
Interface
Circuit
Common
Memory
Data
I/O
EEPROM
I/O
CPU
System
Memory
Work
Memory
BASIC
Program
Memory
BASIC Data
Memory
RS-232C
Interface
RS-232C
Interface
RS-232C
Port 1
Connectors
Port 2
RESET
START
/STOP
6
MountingSection 1-5
1-4System Configuration
The ASCII Unit can be mounted to any slot on the CPU Backplane. Before
mounting
er
supply to the PC is turned OFF during installation of the ASCII Unit. A personal
computer
and
connected
tion on peripheral interface connections and timing, refer to
C500/C1000H/C2000HCV SeriesC120
the ASCII Unit, the DIP switches must be set. Make sure that the
used for entering the BASIC program should be connected to Port
other peripheral I/O devices such as a printer or a display terminal can be
to Port 2 (refer to the following diagram). For more detailed informa
Appendix B
C500
Expansion
I/O Rack
pow
.
-
1
-
1-5Mounting
Personal Computer
The ASCII Unit can be mounted to any I/O slot. The control panel must allow
enough space for the connectors, as shown in the figure below.
Bar-code Reader
Plasma Display
*1. Height
*2. Height of the ASCII Unit with an RS-232C con-
of the ASCII Unit including the base (100
mm)
nector attached (approximately 160 to 180 mm)
Printer
7
This section explains the words of the PC used to communicate with the ASCII Unit.
s memory is divided up into many sections, each of which has its own
unique name and purpose. The ASCII Unit can access any of these memory
using
areas
detail
IR data area that are uniquely assigned to each ASCII Unit.
The PC’s memory is organized into units called
stored in word or multiple word units. Each word has a unique address in the
computer memory and can be accessed by specifying its address.
Each
stored
one (OFF or ON). Certain bits can be accessed individually and are used as
flags.
computer or to enable or disable certain operations. Bits can also be set or
cleared
the
CPU.
For
example, when the ASCII Unit program requests data to be sent from the PC
using
that
the ASCII Unit must wait while the PC prepares the data. When the PC has
collected
proceed to read the data.
the BASIC READ and WRITE statements (this is explained in more
in
Section
word contains 16 bits. A bit is the smallest piece of information that can be
or accessed by a computer
A
flag
by the programmer to communicate certain parameters or conditions to
the BASIC GET statement, the PC’
the data,
4 BASIC Programming
is turned ON and OFF by the hardware to indicate some state of the
it turns ON the W
). However
. A bit is always
s W
rite Flag, signaling the ASCII Unit that it may
, there
are words in the PC’
words
. Information is usually
in one of two states: zero or
rite Flag is turned OFF
, indicating
s
2-2Data Configuration
Each
ASCII Unit is assigned a section of memory in the PC. The data has two
configurations,
pin 5 of the front panel
setting
Unit.
The
basic dif
in
two-word mode the WRIT(87/191)/READ(88/190) instructions are supported
for
data transfer while in four-word mode they are not supported. The structure
and application of the words in each of the two modes is explained next.
2-2-1Two-word Configuration
WRIT(87/191)
WRIT(87/191) is the PC’
I/O READ instruction.
When
the PC uses
can be transferred at one time. In order to transfer multiple data words at the
same
time, however
or PC WRITE statements. In addition the A or S formats
Appendix D
The following PCs support WRIT(87/191)/READ(88/190):
C500: 3G2C3-CPU11-EV1
C120: 3G2C4-SC024-EV1
All C1000H, C2000H, CV-series PCs.
When WRIT(87/191)/READ(88/190) are not supported or not used, data is
transferred
used, only one word of data is transferred at a time.
To output (word n) data using the MOV(21/030), set bits 00, 01, 02 and 03 to
zero.
for more information on formats.
using the PC’
two-word
ference between the two-word
and READ(88/190) are supported in the two-word configuration.
and
four-word
DIP switch before power is applied to the ASCII
s I/O WRITE instruction and READ(88/190)
these instructions for data transfer
, the ASCII
Unit must be programmed to use the PC READ
s MOV(21/030) instruction. When
. The data configuration is selected by
and four-word configurations is that
, up to 255 words of data
must be used. Refer to
is the PC’
the MOV(21/030) is
s
Data Bit Definitions
10
The
following table identifies the individual bits in the two words allocated to the
ASCII
Unit. In the following Bit Definition table, entries in the
Bit
column enclosed
Data ConfigurationSection 2-2
in parentheses are reserved for use by WRIT(87/191)/READ(88/190) and are
not available for general programming application.
WordBitFunctionDescription
n(00)PC busyReserved for WRIT(87/191)/READ(88/190)
(01)PC WRITE complete
(02)PC READ complete
03RestartThe ASCII Unit is activated when this bit goes OFF
04 to 07
08 to 15
n+1(00)ASCII busyReserved for WRIT(87/191)/READ(88/190)
(01)PC READ complete
(02)PC WRITE complete
03ASCII errorTurns ON when an error occurs in the ASCII Unit, when the RESET
04Port 1 errorTurns ON when a buffer overflows or transmission error occurs in Port 1.
05Port 2 errorTurns ON when a reception buffer overflows or transmission error occurs in
06Battery errorTurns ON when the battery is low or removed
07BASIC RUNTurns ON when a BASIC program is running
08 to 15
---Not Used
Output data bits 0 to7Data output from the PC to the ASCII Unit. Read by the PC GET statement.
activates, or when the ASCII Unit restarts.
Turns OFF when the CLOSE statement is executed or the program is
stopped.
Port 2. Turns OFF when the CLOSE statement is executed or the program is
stopped.
Input data bits 0 to 7Data output from the ASCII Unit to the PC. Written by the PC PUT
statement.
Program Execution
PC
Application
Program
Note When
the reset switch is turned ON, the data in word n+1 will be $FFF9. Restart
ing can be checked using bit 03 of word n+1.
When the ASCII Unit is restarted, the data of word n+1 will be 0000.
following diagram illustrates how the words and bits allocated to the ASCII
The
Unit relate to program execution.
WRIT(87/191) is executed when the data communication condition for
WRIT(87/191)
is
satisfied and the ASCII busy flag is cleared. If these conditions
are not met, the WRIT(87/191) is treated as a NOP.
READ(88/190)
and
the ASCII busy flag and ASCII write
is executed when the data communication condition is
tions are not met, the READ(88/190) is treated as a NOP.
WRIT(87/191)
(n)
Common
Memory
READ(88/190)
(n+1)
MOV(21/030)/OUTOutput Data
(n) 08 to 15
MOV(21/030)/LD/OR
(n+1) 08 to 15
Write Data in n
PC READ
Read data in n+1
PC WRITE
PC GET
Input DataPC PUT
complete flag are OFF
ASCII Unit
BASIC
Program
satisfied
. If these condi
-
-
Timing
The WRIT(87/191) and READ(88/190) instructions are executed
and the com
mon memory is refreshed every time the PC completes one cycle of the program. I/O data, however, does not use the common memory (see above diagram) and is refreshed when the PC refreshes all the I/O data. Consequently
11
-
Data ConfigurationSection 2-2
there
is a time dif
I/O
data is set. This time dif
paring both the ASCII Unit and PC programs.
ference between when common memory data is set and when
ference must be taken into consideration when pre
-
1 cycle
MOV(21/030) WRIT(87/191)
With WRIT(87/191)
Data set in common
memory
The following diagram illustrates the various timing relationships between the
PC and ASCII Unit during data transfer.
Relationship between READ and WRITE Timing
Application Program
PC busy: n (00)
Write/Read data: n or n+1
PC Unit
PC write complete: n (01)
PC read complete: n (02)
BASIC Program
ASCII busy n+1 (00)
↔ common memory
PC WRITEPC READ
PC
→ ASCII
I/O refresh
Output data set
ASCII
→ PC
time
ASCII read complete: n+1 (01)
Read data
common memory
data
Write
ASCII → common memory
ASCII write complete: n+1 (02)
→ ASCII
Relationship between Output and Input Timing
Output
data
PC → ASCII: n (08 to 15)
Input data
ASCII → PC: n+1 (08 to 15)
2-2-2Four-Word Configuration
In four-word mode, WRIT(87/191) and READ(88/190) instructions cannot be
used.
The ASCII Unit can be
panel DIP switch to ON.
Bit AllocationThe
following two tables identify the individual bits in the four words allocated to
the
ASCII Unit. Notice that words n and n+1 are used for output and words n+2
PC READ
PC → ASCII
ASCII → PC
set to four-word mode by setting pin 5 of the front
PC WRITE
PC → ASCII
ASCII → PC
I/O refresh
12
Data ConfigurationSection 2-2
and n+3 are used for input. In this case, input and output are from the point of
view of the PC.
BitWord n (OUT)Word n+1 (OUT)Word n+2 (IN)Word n+3 (IN)
00
Write Data 00Read Data 00PC busy
01
Write Data 01
02
Write Data 02
Write Data 03
03
Write Data 04
04
Write Data 05
05
Write Data 06
06
Write Data 07
07
Write Data 08
08
Write Data 09
09
Write Data 10
10
Write Data 11
11
Write Data 12
12
Write Data 13
13
Write Data 14
14
Write Data 15
15
PC write complete
PC read complete
Restart
Interrupt No. 00
Interrupt No. 01
Interrupt No. 02
Interrupt No. 03
Output Data 00
Output Data 01
Output Data 02
Output Data 03
Output Data 04
Output Data 05
Output Data 06
Output Data 07
Read Data 01
Read Data 02
Read Data 03
Read Data 04
Read Data 05
Read Data 06
Read Data 07
Read Data 08
Read Data 09
Read Data 10
Read Data 11
Read Data 12
Read Data 13
Read Data 14
Read Data 15
ASCII busy
ASCII read complete
ASCII write complete
ASCII error
Port 1 error
Port 2 error
Battery error
BASIC RUN
Input Data 00
Input Data 01
Input Data 02
Input Data 03
Input Data 04
Input Data 05
Input Data 06
Input Data 07
13
Data ConfigurationSection 2-2
Bit Definitions
WordBitFunctionDescription
n00
n+100PC busySet by the PC program when the PC accesses common memory, and cleared
n+2
n+300ASCII busySet when the ASCII Unit accesses the common memory and cleared when
to 15
01PC write
02PC read
03RestartThe ASCII Unit is activated at the trailing edge of this flag (when the flag goes
04 to 07
08 to 15
00 to 15
01ASCII read
02ASCII write
03ASCII errorSet when an ASCII Unit error occurs, when RESET is activated, or when the
04Port 1 errorSet when a reception buffer overflows or transmission error occurs at Port 1.
05Port 2 errorSet when a reception buffer overflows or transmission error occurs at Port 2.
06Battery errorSet when the battery is low or removed.
07BASIC RUNSet when the BASIC program is running.
08 to 15
Write data bits
00 to 15
complete
complete
Interrupt number
bits 00 to 03
Output data bits
00 to 07
Read data bits
00 to 15
complete
complete
Input data bits
00 to 07
Data that will be written to the common memory from the PC by the MOV(21/030)
and read with the PC READ statement.
when memory access is terminated. The ASCII Unit cannot access the common
memory while this bit is set.
Momentarily set by the PC program when the PC has completed writing data to
the common memory. When this bit goes ON, the ASCII Unit read complete flag
n+3 (01) goes ON as well.
Momentarily set by the PC program when the PC has completed reading data
from the common memory. When this bit goes ON, the ASCII Unit write complete
flag n+3 (02) goes OFF as well.
OFF). A differentiated signal must be used for the Restart signal.
Serves as an interrupt number when the ON PC statement is used.When bits 00
to 03 are converted into hexadecimal 00 to 15, 00 is ignored and 01 to 15 are
used as valid interrupt numbers.
Data output from the PC to the ASCII Unit, written by the MOV and read with the
PC GET statement.
Data that will be written to the common memory from the ASCII Unit with the PC
WRITE statement and read with the MOV.
memory access is terminated. The PC cannot access common memory while this
bit is set.
Momentarily set when the PC write complete flag goes ON enabling the ASCII
Unit to read from common memory. This flag is cleared when the ASCII Unit
terminates the read operation.
Set at the time the ASCII Unit terminates a write operation to the common
memory and cleared when the PC read complete flag goes ON.
ASCII Unit restarts.
Turns OFF when the CLOSE statement is executed or the program is stopped.
Turns OFF when the CLOSE statement is executed or the program is stopped.
Data written with the PC PUT statement and read with the MOV.
14
Note1. Apart
08
to 15 of word n+2 can be used for program control
ting the 8-bit data to the PC.
2. When
starting can be checked using bit 03 of word n+1.
When the ASCII Unit is restarted, the data of word n+1 will be 0000.
from the data used to
read bit 00 to 15 of word n+2, the input data of bit
of the PC by transmit
the reset switch is turned ON, the data in word n+1 will
be $FFF9. Re
-
-
Data ConfigurationSection 2-2
The
Program Execution
following diagram illustrates how the words and bits allocated to the ASCII
Unit relate to program execution.
rite data in n
W
PC READ
Read data in n+2
PC WRITE
PC GET
ASCII Unit
BASIC
Program
PC
Application
Program
MOV(21/030)
MOV(21/030)
MOV/OUTOutput Data
MOV/LD/OR
Common
Memory
n+1 08 to 15
Input DataPC PUT
n+3 08 to 15
TimingThe following diagram illustrates the various timing relationships between the
PC and ASCII Unit during data transfer.
Relationship between READ and WRITE Timing
Application program
PC busy: n+1 (00)
Write/Read data: n or n+2
PC Unit
PC write complete: n+1 (01)
↔ common memory
PC WRITEPC READ
PC
→ ASCIIASCII → PC
PC read complete: n+1 (02)
BASIC Program
ASCII busy n+3 (00)
ASCII read complete: n+3 (01)
Read data: n
common memory
Write data: n+2
→ common memory
ASCII
ASCII write complete: n+3 (02)
→ ASCII
Relationship between Output and Input Timing
Output
data
PC → ASCII: n+1 (08 to 15)
Input data
ASCII → PC: n+3 (08 to 15)
ASCII READ
PC READ
PC → ASCII
ASCII
→ PC
ASCII WRITE
PC WRITE
→ ASCII
PC
ASCII
→ PC
I/O refresh
15
SECTION 3
Programming and Communications
The first part of this section explains how the ASCII Unit and the PC exchange information.
The
second part of this section explains how to transfer programs from one device to another
is written on a personal computer
gram
Unit
program can be permanently stored in the ASCII Unit’
also be transferred back to the personal computer or other storage device.
The last part of this section explains how to run a BASIC program once it has been transferred to the ASCII Unit.
BASIC is needed. A data exchange routine must also be incorporated into the
PC program. The PC data exchange routine must set the number of words to be
transferred,
using the PC’s MOV(21/030) instruction.
There are two ways the ASCII Unit can communicate with the PC. In the first
method,
the PC controls the timing of the data transfer between
The ASCII Unit “requests” access to the PC data memory area using the PC
READ,
respond
performs
PC WRITE, PC GET
by setting either the read or write flag. The PC data exchange routine
the designated operations. When the PC is ready
is set and the ASCII Unit proceeds with the data transfer.
In the second method, the WRIT(87/191) and READ(88/190) instructions are
used
in conjunction with the PC READ, PC WRITE, PC GET
ments to transfer data.
This diagram illustrates the PC and ASCII Unit programs.
Unit in conjunction with the PC, an ASCII Unit program written
the base address, and the specific memory area. This can be done
the two devices.
, or PC
PUT statements, and then waits for the PC to
, the appropriate flag
, and PC PUT
state
-
Write/read
data
exchange
I/O data
exchange
PC program
General Program
General Program
This diagram illustrates the relationship between the PC data exchange code
and the ASCII Unit program.
PC program
MOV(21/030)
MOV(21/030)
MOV(21/030), OUT, etc.
MOV(21/030), OUT, etc.
Data exchange
code
ASCII Unit program
Data exchange
processing or I/O
program
ASCII Unit program
PC READ command
Common
memory
PC WRITE command
PC GET command
I/O
memory
PC PUT command
3-2Program Transfer
PreparationFor
18
the personal computer to communicate with the ASCII Unit, set the comput
er communication software as follows:
Baud rate:same as ASCII Unit
Data length:8 bits
Parity:none
No. stop bits:2
Full duplex, no echo, no XON/XOFF buf
Also:
Set
the ASCII Unit DIP
Hardware
-
fer busy control, no auto line
switches to the desired configuration (refer to
feed.
Section
1
).
Program TransferSection 3-2
Transfer
The ASCII Unit’s BASIC or assembly language program must be written on a
personal computer which is connected to port 1 of the ASCII Unit through an
RS-232C
sonal
interface. A program can be transferred to the ASCII Unit from the per
computer or any other storage device connected to one of the communi
cation ports with the BASIC LOAD command or the S and L commands. Programs can also be transferred from the ASCII Unit’s EEPROM to the ASCII
Unit’s RAM using the LOAD command.
Programs
personal
can be transferred
computer or other storage device connected to one of the communica
from the ASCII Unit’
s RAM to the EEPROM or to a
tion ports using the BASIC SAVE command.
ASCII Unit can be booted on
The
power up by a program stored in the EEPROM.
To do this set pin 2 of the front panel DIP switch on the ASCII Unit to ON.
Note1. During
data transfer
baud
rate settings of the computer and the
overflow
error does occur
, an overflow may occur if
, set either a slower baud rate or specify XON with
the buf
fering capacity of the
ASCII Unit are not matched. If an
the OPEN command.
2. Programs
executing
The
FIT or LSS can be used to back up BASIC programs onto
named with PNAME cannot be transferred. Delete the name
PNAME “ ” if necessary before attempting to transfer a program.
floppy disks, con
sult the FIT or LSS Operation Manual.
The following figure illustrates the direction of data transfer when using the
SAVE and LOAD commands.
-
-
-
by
-
SAVE #1, “COMU:”
LOAD #1, “COMU:”
SAVE #2, “COMU:”
LOAD #2, “COMU:”
Note1. The
Refer to the explanation of the OPEN statement for details on
2.
COMU.
EEPROM’
(1)
Computer or
other peripheral device
(2)
Computer or
other peripheral device
sn lifetime is limited to 5,000 write operations.
19
Loading...
+ 124 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.