OMRON products are manufactured for use according to proper procedu res by a qualified operator
and only for the purposes described in this manual.
The following conventions are used to indicate and classify precautions in this manual. Always heed
the information provided with them. Failure to heed precautions can result in injur y to p eople or damage to property.
!DANGER
!WARNING
!Caution
Indicates an imminently hazardous situation which, if not avoided, will result in death or
serious injury.
Indicates a potentially hazardous situation which, if not avoided, could result in death or
serious injury.
Indicates a potentially hazardous situation which, if not avoided, may result in minor or
moderate injury, or property damage.
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 a s 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 information of par ticular interest for efficient and convenient opera-
tion of the product.
1,2,3...Indicates lists of one sort or another, such as procedures, checklists, etc.
OMRON, 2001
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 conta ined in this publication.
This manual describes the installation and operation of the C200HW-MC402-E Motion Control Unit
(MC Unit) and includes the sections described below.
Please read this manual carefully and be sure you understand the information provided before
attempting to install or operate the MC Unit. Be sure to read t he precautions p rovided in the following
section.
Precautions provides general precautions for using the MC Unit, Programmable Controller (PC), and
related devices.
Section 1
to its operation. Also the specifications and the comparison with previous C200HW-MC402-UK is
shown.
Section 2
Section 3
between the MC Unit and the CPU Unit.
Section 4
which programs are managed for the MC Unit.
Section 5
cation using the MC Unit. All BASIC system, task and axis statements that determine the various
aspects of program execution and MC Unit operation are presented.
Section 6
tor and debug motion based applications for the MC Unit.
Section 7
Section 8
Unit operating in optimum cond ition. It also i ncludes proper procedures when replacing an MC Unit or
battery.
The Appendices provide a guide for upgrading from the C200HW-MC402-UK Unit and the PC Interface Lists. Furthermore, some convenient programming examples are given for the user.
describes the function of the C 200HW-MC402-E Motion Cont rol Unit and concepts related
describes information required for hardware setup and installation.
describes the IR/CIO area allocation and presents the di fferent methods of dat a exchange
gives an overview of the fundamentals of multitasking BASIC programs and the methods by
describes the commands and parameters required for programing the motion control appli-
provides an overview of software package Motion Perfect, which is used to program, moni-
provides procedures on troubleshooting problems that may arise with the MC Unit.
explains the maintenance and inspec tion procedures that must be followed to keep the M C
!WARNING
Failure to read and understand the information provided in this manual may result in personal injury ordeath, damage to the product , or product failure. Please read eachsection
in its entirety and be sure you understand the information provided in the section and
related sections before attempting any of the procedures or operations given.
ix
PRECAUTIONS
This section provides general precautions for using the Motion Control Unit and related devices.
The information contained in this section is important for the safe and reliable application of the Motio n Control
Unit. You must read this section and understand the information contained before attempting to set up o r o perate
a Motion Control Unit and PC system.
This manual is intended for the following personnel, who must also have
knowledge 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 prod uct according to the performance specifications described in the operation manuals.
Before using the product under conditions which are not described in the
manual or applying the product to nuclear control systems, railroad systems,
aviation systems, vehicles, combustion systems, medical equipment, amusement machines, safety equipment, and other systems, machines, and equipment that may have a serious influence on lives and property if used
improperly, consult your OMRON representative.
Make sure that the ratings and performance characteristics of the product are
sufficient for the systems, machines, and equipment, and be sure to provide
the systems, machines, and equipment with double safety mechanisms.
This manual provides information for installing and operating OMRON Motion
Control Units. Be sure to read this manual before operation and keep this
manual close at hand for reference during operation.
!WARNING
It is extremely important that Motion Control Units and related devices be
used for the specified pur pose a nd under t he specified c onditions, especia lly
in applications that can directly or indirectly affect human life. You must consult with your OMRON representative before applying Motion Control Units
and related devices to the above mentioned applications.
3Safety Precautions
!WARNING
!WARNING
!WARNING
Never attempt to disassemble any Units while power is being supplied. Doi ng
so may result in serious electrical shock or electrocution.
Never touch any of the terminals while power is being supplied. Doing so may
result in serious electrical shock or electrocution.
Provide safety measures in external circuits (i.e., not in the Programmable
Controller or MC Unit) to ensure safety in the system if an abnormal ity occurs
due to malfunction of the PC, malfunction of the MC Un it, or external factors
affecting the operation of the PC or MC Unit. Not providing sufficient safety
measures may result in serious accidents.
• Emergency stop circuits, interlock circuits, limit circuits, and similar safety
measures must be provided in external control circuits.
• The PC or MC Unit outputs may remain ON or OFF due to deposits on or
burning of the output relays, or destruction o f the output transistors. As a
counter-measure for such problems, external safety measures must be
provided to ensure safety in the system.
• When the 24-VDC output (service power supply to the PC) is overloaded
or short-circuited, the voltage may drop and result in the outputs bei ng
turned OFF. As a countermeasure for such problems, external safety
measures must be provi d e d to ensure safety in the system.
xii
Operating Environment Precautions4
• It is the nature of high speed motion control and motion control language
programming and multi-tasking systems, that it is not always possible for
the system to validate the inputs to the func tions. It is the responsibility of
the programmer to ensure that various BASIC s tatements are called c orrectly with the correct number of inputs and that the values are correctly
validated prior to the actual calling of the various functions.
!Caution
!Caution
!Caution
Connect the ENABLE output (drivers enable signal) to the Servo Drivers. Otherwise, the motor may run when the power is turned ON or OFF or when an
error occurs in the Unit.
Do not save data into the flash memor y duri ng me mor y operation or while the
motor is running. Otherwise, unexpected operation may be caused.
Do not reverse the polarity of the 24-V power supply. The polarity must be
correct. Otherwise, the motor may star t running unexpectedly and may not
stop.
4Operating Environment Precautions
!Caution
!Caution
Do not operate the control system in the following locations:
• Locations subject to direct sunlight.
• Locations subject to temperatures or humidity outside the range specified
in the specifications.
• Locations subject to condensation due to radical temperature changes.
• Locations subject to corrosive or inflammable gases.
• Locations subject to dust (especially iron dust) or salts.
• Locations subject to vibration or shock.
• Locations subject to exposure to water, oil or chemicals.
Take appropriate and sufficient countermeas ures when installing systems in
the following locations:
• Locations subject to static electricity or other sources of noise.
• Locations subject to strong electromagnetic fields.
• Locations subject to possible exposure to radiation.
• Locations near power supply lines.
!Caution
The operating environment of the P C System c an have a large effect on the
longevity and reliability of the system. Improper operating environments can
lead to malfunction, failure, and other unforeseeable problems with the PC
System. Be sure that the operating environment is within the specified conditions at installation and rema ins within the spec ified conditions dur ing the life
of the system.
5Appli c a tion Precau tions
Observe the following precautions when using the Motion Control Unit or the
PC System.
!WARNING
Failure to abide by the following precautions could lead to serious or possibly
fatal injury. Always heed these precautions.
• Always ground the system to 100 Ω or le ss whe n in sta lling the system to
protect against electrical shock.
xiii
Application Precautions5
• Always turn OFF the power supply to the PC before attempting any of the
following. Not turning OFF the power supply may result in malfunction or
electric shock.
• Mounting or dismounting the MC Unit or any other Units.
• Assembling the Units.
• Setting rotary switches.
• Connecting cables or wiring the system.
• Connecting or disconnecting the connectors.
!Caution
Failure to abide by the following precautions could lead to faulty operation of
the PC, the MC Unit or the system, or could damage the PC or MC Unit.
Always heed these precautions.
• Maximum 12 of the digital inputs (I0 to I15) should be switched on at any
one time to ensure that the Unit remains within internal temperature specifications. Failure to meet this condition may lead to degradation of performance or damage of components.
• After development of the application programs, be sure to save the program data in flash memory within the MC Unit (using the EPROM command in BASIC). The program data will remain in the S-RAM during
operation and power down, but considering possible battery failure it is
advised to store the data in flash memory .
• It is strongly recommended to store dynamic application data, which can
not be initiated in program, in the PC Unit’s memory considering possible
battery failure.
• Do not turn OFF the power supply to the Unit while data is being written to
flash memory. Doing so may cause problems with the flash memory.
• Confirm that no a dverse effect will occur in the system before attempting
any of the following. Not doing so may result in unexpected operation.
• Changing the operating mode of the PC.
• Changing the present value of any word or any set value in memory.
• Force-setting/force-resetting any bit in memory
• Install external breakers and take other safety measures against short-cir-
cuiting in external wiring. Insufficient safety measures against shor t-circuiting may re s ult in burning.
• Be sure that all mounting screws, terminal screws, and cable connector
screws are tightened securely. Incorrect tightening may result in malfunction.
• Before touching the Unit, be sure to first touch a gro unded m etall ic object
in order to discharge any static built-up. Not doing so may result in malfunction or damage.
• Check the pin numbers before wiring the connectors.
• Be sure that the connectors, terminal blocks, I/O cables, cables between
drivers, and other items with locking devices are properly locked into
place. Improper locking may result in malfunction.
• Always use the power supply voltages specified in this manual. An incorrect voltage may result in malfunction or burning.
• Take appropriate measures to ensure that the specified power with the
rated voltage and frequency is supplied. Be pa rticular ly careful in places
where the power supply is unstable. An incorrect power supply may result
in malfun c tion.
• Use crimp terminals for wiring. Do not connect bare stranded wires
directly to terminals. Connection of bare stranded wires may result in
burning.
xiv
Conformance to EC Directives6
• Leave the label attached to the Unit when wiring. Removing the label may
result in malfunction if foreign matter enters the Unit.
• Remove the label after the completion of wiring to ensure proper heat dissipation. Leaving the label attached may result in malfunction.
• 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 Out put Units in excess of
the maximum switching capacity. Excess voltage or loads may result in
burning.
• Disconnect the functional ground terminal when performing withstand
voltage tests. Not disconnecting the functional ground terminal may result
in burning.
• Double-check all wiring and switch settings before turning ON the power
supply. Incorrect wiring may result in burning.
• Do not pull on the cables or bend the cables beyond their natural limit.
Doing either of these may break the cables.
• Do not place objects on t op of the cables or other wir ing lines. Doing so
may break the cables.
• Resume operation only after transferring to the new MC Unit the contents
of the parameters, position data, and other data required for resuming
operation. Not doing so may result in an unexpected operation.
• Resume operation only after transferring to the new CPU Unit the contents of the DM Area, HR Area, and other data required for resuming
operation. Not doing so may result in an unexpected operation.
• Confirm that set parameters and data operate properly .
• Carefully check the user program before actually running it on the Unit.
Not checking the program may result in an unexpected operation.
• Do not attempt to take any Units apart, to repair any Units, or to modify
any Units in any way.
• Perform wiring according to specified procedures.
6Conformance to EC Directives
6-1Applicable Directives
• EMC Directives
• Low Vol tage Directiv e
6-1-1Concepts
EMC Directives
OMRON devices that comply with EC Directives also conform to the related
EMC standards so that they can be more easily built into other devices or machines. The actual products have been checked for conformity to EMC standards (see the following note). Whether the products conform to the standards in the system used by the customer, however, must be checked by the
customer. EMC-related performance of the OMRON devices that comply with
EC Directives will vary depending on the c onfiguration, wiring, and other conditions of the equipment or control panel in which the OMRON devices are
installed. The customer must, therefore, perform final checks to confirm that
devices and the over-all machine conform to EMC standards.
Note Applicable EMC (Electromagnetic Compatibility) standards are as follows:
Always ensure that devices operating at voltages of 50 to 1,000 VAC or 75 to
1,500 VDC meet the required safety standards for the PC (EN61131-2).
6-1-2Conformance to EC Directives
The C200HX/HG/HE ser ies and CS1 ser ies PCs comply with E C Directives.
To ens ure that the machine or device in which a PC is used complies with EC
directives, the PC must be installed as follows:
1,2,3...1. The PC must be installed within a control panel.
2. Reinforced insulation or double insulation must be used for the DC power
supplies used for the communications and I/O power supplies.
3. PCs complying with EC Directives also conform to the Common Emission
Standard (EN50081-2). When a PC is built into a machine, however , noise
can be generated by switching devices using relay outputs and cause the
overall machine to fail to meet the Standards. If this occurs, surge killers
must be connected or other measures taken external to the PC.
The following methods represent typical methods for reducing noise, and
may not be sufficient in all cases. Required countermeasures will vary depending on the devices connected to the control panel, wiring , the configuration of th e system, a n d othe r conditions.
xvi
SECTION 1
Features and System Configuration
This section des cribes the feature s and system conf igur ation of the C200HW-MC402-E Motion Control Unit and co ncepts
related to its operation. It also indi cates the diff erence with the previous C200HW-MC402-UK Unit.
The C200HW-MC402-E Motion Control (MC) Unit is a Special I/O Unit that
can perform
Unit’s multi-tasking BASIC motion control language provides an easy to use
tool for programming advanced motion control applications.
Three types of motion control are possible: point-to-point, continuous path
and electronic gearing.
advanced MC operations on up to four axes simultaneously. The
Point-to-point ControlPoint-to-point (PTP) control enables positioning independently for each axis.
Axis specific parameters and c ommands are us ed to determi ne the p aths for
the axes.
Continuous Path ControlContinuous path (CP) control enables the user not only to control the start and
end positions, but also the path between those points. Possible multi-axis
paths are linear interpolation, circular interpola tion, helical interpolation. Also
user defined paths can be realized with the CAM control.
Electronic GearingElectronic gearing (EG ) enables controlling an axis as a direct li nk to another
axis. The MC Units supports electronic gear boxing, linked moves and CAM
movements and adding all movements of one axis to another.
The MC Unit can be used in many applications. The following areas have
been identified as applicable areas for the MC Unit.
• Packaging
• Automotive welding
• Coil winding
• Web control
• Cut to length
• Drilling
• Electronic component assembly
• Glue laying
• Flying shears
• Laser guidance
• Milling
• Palletisation
• Tension control
There are many other types of machines that can be controlled by the MC
Unit.
2
FeaturesSection 1-1
1-1-2Descr ip tio n of Feat ures
The MC Unit provides the following features.
Easy Programming with
BASIC Motion Control
Language
A multi-task BASIC motion control language is used to program the MC Unit.
A total of 14 program s can be held i n the Unit an d up to 5 ta sks can be r un
simultaneously. Programs can read a nd writ e to the PC mem ory areas us ing
simple commands from BAS IC or the IORD/IOWR instructions f rom the PC ’s
ladder program.
Windows-based
Programming Software
The MC Unit is programmed using a Windows-based application called
1
Motion Perfect. Motion Perfect allows extremely flexible programming and
debugging.
Virtual AxesThe MC Unit contains a total of 8 axes, which consists of 4 servo axes and 4
virtual axes. The virtual axes acts as a perfect servo axes and are used for
computational pur poses for creating profiles. They can be linked directly to
the servo axes.
PC Data ExchangeThe coordination of the MC Unit with the CPU Unit is largely improved by
modifying the PC Data Exchange interface. The PC Data Exchange interface
now even more allows a centralized control from the PC. The MC Unit uses
the full functionality of the C200HX/HG/HE or CS1 PC. It is now capable of
both exchanging fast control bits via the IR/CIO area as exchanging large
position profile data directly to the MC Unit’s Table array.
Hardware-based
Registration Inputs
There is a high-speed registration input for each axis. On the rising or falling
edge of a registration input, the MC Unit will store the current position in a register. The registered position can then be used by the BASIC program as
required. The registered positions are captured in hardware.
General-purpose Input
and Output Signals
Starting, st opping, limit switching, origin sea rches and many other f unctions
can be controlled without the use of PC I/O. The time required to switch an
output or read an input is thus not dependant on the cycle time. The general
I/O are freely allocable to the different functions.
Reduced Machine WearThe traditional trapezoidal speed profile is provided to generate smooth star t-
ing and stopping. The trapezoidal corners can be rounded off to S-curves.
Trapezoidal Speed Profile
with Square Corners
Time
Trapezoidal S pee d Profil e
with S-curve Corners
SpeedSpeed
Time
1.Motion Perfect is a product of Trio Motion Technology Limited.
3
System ConfigurationSection 1-2
1-2System Configuration
Basic System
Configuration
The basic system configuration of the MC Unit is shown below. The diagram
shows the basic physical components of a coordinated mot ion control application.
Power Supply Unit
Computer running
• Motion Perfect
• CX-Programmer
or Syswin
Power supply (24-V) for I/O
Power supply (5/24-V) for Axes
Servo Drivers
Termin al
Block
I/O Cable
MC Unit
CPU Unit
Axis Cable
General
Purpose
I/O
The equipment and models which can be used in the system configuration
are shown in the following table.
DeviceModel
Motion Control UnitC200HW-MC402-E
CPU UnitPossible models:
Motion PerfectVersion 2.0 or later
Servo DriverR88D-UA, -UT, -W series
ServomotorR88M-UA, -UT, -W series
Inverter3G3FV in Flux Vector Control
Note1. The MC Unit cannot be mounted to a C200H PC.
2. The C200HS CPU Units do not support the IORD/IOWR instructions. The
MC Unit can only communicate with a C200HS CPU Unit using the
PLC_READ and PLC_WRITE commands.
3. The MC Unit cannot be mounted to a SYSMAC BUS Slave Rack.
4. The MC Unit can be mounted next to the CPU Unit on the CPU Rack, but
care must be taken to first deter mine the mounting locations of certain
Communications Unit and other Units that require bus connections to the
CPU Unit.
IBM Pers onal Computer or 100% compatible
Cables to be supplied by
the user
The following standard cables are available. A cable can also be prepared by
the user.
ItemModel
R88A-CMX001S-EI/O Connection Cabl e fro m MC Unit to Terminal Block (1m)
R88A-CMX001J1-EAxis Connection Cable fr om MC Unit to Terminal Block
(1m)
R88A-CMU001J2-EConnection from Ter minal Block to UA Servo Driver (1m)
R88A-CMUK001J3-EConnection from Terminal Block to UT Servo Driver (1m)
R88A-CMUK001J3-E2 Connection from Terminal Block to UT/W Servo Driver (1m)
R88A-CCM002P4-EConnection Cable RS-232C from MC Unit to computer (2m)
1-3Motion Control Concepts
The MC Unit offers the following types positioning control operations.
1. Point-to-point control
2. Continuous Path control
3. Electronic Gearing
This section will introduce some of the commands and parameters as use d in
the BASIC programming of the motion control application. Refer to
SECTION 5 BASIC Motion Control Pro g ramming Language for details.
Coordinate SystemPositioning operations performed by the MC Unit are based on an axis coordi-
nate system. The MC Unit conver ts the encoder edges and pulses from t he
encoder into an internal absolute coordinate system.
The engineering unit which specifies the distanc es of travelling can be freely
defined for each axis separately. The conversion is performed through the
use of the unit conversion factor, which is defined by the UNITS axis parameter. The origin point of the coordinate system can be deter mined using the
DEFPOS command. This com mand re-defines th e current position to zero or
any other value.
A move is defined in either absolute or relative terms. An absolute move takes
the axis to a specific predefined position with respect to the origin point. A relative move takes the axis from the current position to a position that is defined
relative to this current position. The following diagram shows gives an exam-
5
Motion Control ConceptsSection 1-3
ple of relative (command MOVE) and absolute (command M OVEABS) linear
moves.
MOVEABS(30)
MOVE(60)
MOVEABS(50)
MOVE(50)
MOVE(30)
0
50100
Axis position
Axis TypesThe MC Unit has 8 axes in tota l, which can be used for different motion con-
trol purposes depending on the application. Th e type of each axis is determined by the ATYPE axis parameter. The following table lists the different
available axis types.
Axis
type
ATYPE
value
Description
Virtual0A virtual axis is used for computational purposes to cre-
ate a move profile without physical movement on any
actual Servo Driver. All move commands and axis
parameters available for the servo axis are also available for the virtual axis and the v ir t ual axis behaves like
a perfect servo axis (demanded po sition is eq ual to the
actual position).
Possible application for the virtual axis is having a virtual move profile added to a servo axis or to test a
developed application before controlling the actual
motors.
Axis range: [0, 7]
Servo2The servo axis controls the connected Servo Driver.
Based on the calculated movement profile and the
measured position feedback of the Servomotor the
proper speed reference is outputted to the Servo Driver.
Axis range: [0, 3]
Encoder 3The encoder axis defines an axis which provides an
encoder input without the servo control speed reference
output to the system. An encode r can be c onnected for
measurement, registration and/or synchron ization functions.
Axis range: [0, 3]
Refer to 1-4 Control System for details on the servo system and encoder
feedback signals. Axes 0 to 3 are servo axes by default and axes 4 to 7 are
fixed as virtual axes.
6
Motion Control ConceptsSection 1-3
1-3-1PTP-control
In point-to-point positioning, each axi s is moved independently of the other
axis. The MC Unit supports the following operations.
• Relative move
• Absolute mo ve
• Continuous move forward
• Continuous move reverse
Relative and Absolute Moves
To m ove a single axis either the command MOVE for a relative move or the
command MOVEABS for an absolute move is used. Each axis has its own
move characteristics, which are defined by the axis parameters.
Suppose a control program is executed to move from the origin to an axis
no. 0 coordinate of 100 and axis no. 1 coordinate of 50. If the speed parameter is set to be the s ame for both axes and the acceleration and dec eleration
rate are set sufficiently high, the m ovements for axis 0 and axis 1 will be as
illustrated below.
Axis 1
50
MOVEABS(100) AXI S(0)
MOVEABS(50) AXIS(1)
0
50
100
Axis 0
At start, both the axis 0 and axis 1 will move to a coordinate of 50 over the
same duration of time. At this point, axis 1 will stop and the axis 0 will continue to move to a coordinate of 100.
Relevant Axis ParametersAs mentioned before the move of a certain axis is determined by the axis
parameters. Some relevant parameters are given in the next table.
ParameterDescription
UNITSUnit conver sion factor
ACCELAcceleration rate of an axis in units/s
DECELDeceleration rate of an axis in units/s
SPEEDDemand speed of an axis in units/s.
2
.
2
.
Defining movesThe speed profile below shows a simple MOVE operation. The UNITS param-
eter for this axis has been defined for example as meters. The required m aximum speed has been set to 10 m/s. In order to reach this speed in one
second and also to decelerate to zero speed again in one second, both the
acceleration as the deceleration rate have been set to 10 m/s
2
. The total distance travelled is the sum of distances travelled during the acceleration, constant speed and deceleration segm ents. Suppose the distanc e moved by the
7
Motion Control ConceptsSection 1-3
MOVE command is 40 m, the speed profile will be given by the following
graph.
Speed
ACCEL=10
10
DECEL=10
SPEED=10
MOVE(40)
0
12345
6
Time
The following two speed profiles show the same movement with an acceleration time respectively a deceleration time of 2 seconds.
Speed
ACCEL=5
6
DECEL=10
SPEED=10
MOVE(40)
Time
ACCEL=10
DECEL=5
SPEED=10
MOVE(40)
10
Speed
10
0
12345
0
12345
6
Time
8
Motion Control ConceptsSection 1-3
D
Vad
Move CalculationsThe following equations a re used to calculate the total time for the motion of
the axes. Consider the moved distance for the MOVE command as , the
demand speed as , the acceleration rate and deceleration rate .
Acceleration time
V
---=
a
2
Acceleration dist a nc e
V
------=
2a
Deceleratio n time
V
---=
d
2
Deceleration distance
V
------=
2d
Continuous Moves
1-3-2CP-control
Constant speed distance
V2ad+()
D=
-----------------------–
2ad
D
Total time
The FORWARD and REVERSE commands can be used to start a continuous
movement with constant speed on a cert ain axis. The FORWARD command
will move the axis in positive direction and the REVERSE comman d in negative direction. For these commands also the axis parameters ACCEL and
SPEED apply to specify the acceleration rate and demand speed.
Both movements can be canceled by using either the CANCEL or RAPIDSTOP command. The CANCEL command will cancel the m ove for one axis
and RAPIDSTOP will cancel moves on all axes.
Continuous Path control enables to control a specif ied p ath bet ween t he st art
and end position of a movement for one or multiple axes. The MC Unit supports the following operations.
• Linear interpolation
• Circular interpolation
• Helical interpolation
• CAM control
Va d+()
--- -=
---------------------+
V
2ad
Linear Interpolation
In applications it can be required for a set of motors to perform a move operation from one position to another in a straight line. Linearly interpolated moves
can take place among several axes. The commands MOVE and MOVEABS
are also used for the linear interpolati o n. I n t his c a s e the comma nds will h ave
9
Motion Control ConceptsSection 1-3
multiple arguments to specify the relative or absolute move for each axis.
Consider the following three axis move in a 3-dimensional plane.
MOVE(50,50,50)
Axis 2
Axis 1
Axis 0
Speed
Time
The speed profile of the motion along the pa th is given in the diagram. T he
three para meters SPEED, AC CEL a n d DECEL w h ich determine the multi axis
movement are taken from the corresponding parameters of the base axis.
The MOVE command computes the various component s of speed demand
per axis.
Circular Interpolation
It may be required that a tool travels from the starting point to the end point in
an arc of a circle. In this instance the motion of two axes is related via a circular interpolated move using the MOVECIRC command. Consider the following
diagram.
Helical Interpolation
MOVECIRC(-100,0,-50,0,0)
-50
Axis 1
0
50
50
Axis 0
The centre point and desired end po int of the trajectory relative to the start
point and the direction of movement are specified. The MOVECIRC command
computes the radius and the angle of rotation. Like the linearly inter polated
MOVE command, the ACCEL, DECEL and SPEED variables associated with
the base axis determine the speed profile along the circular move.
Helical interpolation performs a helical movement on three axes. The motion
control c ommand MHELICA L will perform a circular interpo lation to two axis
and will add a linear move to the third axis. Positioning is performed by again
specifying the centre point, end point and direction for the circular distance
10
Motion Control ConceptsSection 1-3
and the distance for the third axis. The diagram shows helical interpolation in
a three dimensional plane for axes 0 to 2.
MHELICAL(0,0,0,50,0,150)
Axis 0
Axis 2
Axis 1
CAM Control
Additional to the standard move profiles the MC Unit also provides a way to
define a position profile for the axis to move. The CAM command will move an
axis according to position values stored in the MC Unit Table array. The
speed of travelling through the profile is determ ined by the axis pa rameter s of
the axis.
1-3-3EG-Control
CAM(0,99,100,20)
Position
Time
Electronic Gearing control allows you to create a direct gearbox link or a
linked move between two axes. The MC Unit supports the following operations.
1. Electronic gearbox
2. Linked CAM
3. Linked move
4. Adding axes
11
Motion Control ConceptsSection 1-3
Electronic Gearbox
The MC Unit is able to have a gearbox link from one axis to another as if there
is a physical gearbox connecting them. This can be done using the CONNECT command in the program. In the command the ratio and the axis to link
to are specified.
CONNECT Axis
2:1
AxesRatioCONNECT command
01
1:1CONNECT(1,0) AXIS(1)
2:1CONNECT(2,0) AXIS(1)
1:1
1:2
Master Axis
Linked CAM control
1:2CONNECT(0.5,0) AXIS(1)
Next to the standard CAM profiling tool the MC Unit also provides a tool to link
the CAM profile to another axis. The command to create the link is called
CAMBOX. The travelling speed through the profile is not deter mined by the
axis parameters of the a xis but by the position of t he linked axis. This is like
connecting two axes through a cam.
CAMBOX(0,99,100,20,0) AXI S(1)
CAMBOX Axis (1) Position
Master Axis (0) Position
12
Motion Control ConceptsSection 1-3
Linked Move
The MOVELINK command provides a way to link a specified move to a master axis. The move is divided into an acceleration, dece leration and constant
speed part and they are specified in master link distances. This can be particularly useful for synchronizing two axes for a fixed period.
MOVELINK(50,60,10,10,0) AXIS(1)
Speed
Master Ax is (0)
Synchronized
MOVELINK Axis (1)
Time
Adding Axes
It is very useful to be able to add all movements of one axis to another. One
possible application is for instance changing the offset between two axes
linked by an electronic gearbox. The MC Unit provides this possibility by using
the ADDAX command. The movements of the linked axis will cons ists of all
movements of the actual axis plus the additional movements of the master
axis.
Canceling MovesIn normal operation or in case of emergency it can be necessary to cancel the
current movement from the buffers. When the CANCEL or RAP IDSTOP commands are g iven, the selected axis respe ctively all axes will canc el thei r current move.
Origin SearchThe encoder feedback for controlling the position of the motor is incremental.
This means that all movement must be defined with respect to an origin point.
The DATUM command is used to set up a procedure whereby the MC Unit
13
Control SystemSection 1-4
goes through a sequence and searches for the origin based on digital inputs
and/or Z-marker from the encoder signal.
Print RegistrationThe MC Unit can capture t he position of an axis in a regi ster when an event
occurs. The event is referred to as the print registration input. On the risin g or
falling edge of an input signal, which is either the Z-marker or an input, the MC
Unit captures the position of an axis in hardware. This position can then be
used to correct possible error between the actual position and the desired
position. The print registration is set up by using the REGIST command.
The position is captured in hardware, and therefore there is no software overhead and no interrupt service routines, eliminating the nee d to deal with the
associated timing issues. Each servo axis has one registration input.
Merging Move sIf the MERGE axis parameter is set to 1, a movement will always be followed
by a subsequent movement without stopping. The following illustrations will
show the transitions of two moves with MERGE value 0 and value 1.
Speed
MERGE=0
Time
Speed
MERGE=1
Time
JoggingJogging moves the axes at a constant speed forward or reverse by manual
operation of the digital in puts. Different speeds are also selectable by input.
Refer to the FWD_JOG, REV_JOG and FAST_JOG axis parameters.
1-4Control System
1-4-1Feedback Pulses
The MC Unit is designed to comply with the standard O MRON Servomotors
which have an incremental encoder output. In this section, the signals produced by an incremental optical quadrature encoder are discussed. Incremental encoders are available in linear as well as the more common rot ary
types.
Incremental Encoders
The incremental encoder are e ncoders for which the output pos ition information is relative to a starting position and only the distance moved is measured.
The main components of the rotary incremental encoder are an encoder disk,
light source and photodete ctors, plus an amplification circuitry to “square-up”
the photodetector output. The encoder disk is im printed with marks or slots
evenly spaced around its perimeter. As the disk rotates, light strikes the photodetector at the passing of each slot or mark. Amplifiers then convert the
photodetector output to square wave form.
Quadrature signals are produced by using two photodetectors, one positioned
precisely one half a slot, or marker width, from the other. So quadrature refers
to two periodic functions separated b y a quarter cycle or 90 .
With this arrangement, the direction of rotation can be easily detected by
monitoring the relative phase of bo th signals. For example, if channel A leads
channel B, then counterclockwise (CCW) movement could be indicat ed. Con-
°
14
Control Sy st emSection 1-4
versely, if channel B leads channel A, then clockwise (CW) movement would
be indicated.
Ty pically, rotary encoders also provide an additional Z-mar ker or slot on the
disk used to produce a reference pulse. By properly decoding and counting
these signals, the direction of motion, speed, and relative position of the
encoder can be determined.
The number of output pu lses produced per revolution per channel is equivalent to the number of marks around the disk. This position information is
decoded in encoder edges, which is actually the number of pulses multiplied
by four. The resolution is multiplied because the circuit generates a pulse at
any rising or falling edge of either of the two phase signals.
Decoding
Understanding how the signals generated by a quadrature encoder are
decoded will help considerably when applying the quadrature decoder feature
in an actual situation.
The basic task of the decoder is to provide two counter input lines: one that
produces clock pulses when CCW motion is detected and another that produces clock pulses when CW motion is detected. These clock pulses are supplied to counters in the MC Unit, one for CW counts and one for CCW counts.
The contents of the counters can be compared w ith each ot her by software,
and the relative position of the rotary device can be determined f rom the difference.
One advantage of this approach is that the actual counting is done by hardware devices, freeing the MC Unit for other operations. The MC Unit has only
to periodically read the counter values and to make a quick subtraction.
Decoder Th eory of
Operation
Forward Rotati on
Re vers e Rotat ion
A closer look at the quadrature signals will be helpful. In this example, the
direction of rotation is CCW if phase A leads ph ase B, and CW if phase A
leads phase B.
The decoder circuit detects a transition and generates a pulse on the appropriate counter input channel depending on wheth er the transition is in the CW
or CCW direction. Although time is plotted on the horizontal axis, it is not necessarily linear. The mechanical device may be changing speed as well as
direction.
Phase A
Phase B
Phase A
Phase B
Standard OMRON Servomotors are designed for an advanced A-phase for
forward rotation and an advanced B-phase for reverse rotation. The MC Unit
is designed to comply with this phase advancement, allowing OMRON Ser vo
Driver Connecting Cables to be used without modification.
15
Control SystemSection 1-4
For typical OMRON Servo Drivers, there are 1,000 pulses per revolution. This
implies that there are 4,000 edges per revolution. So there will b e a Z pu lse
every 4,000 edges.
The signals A, B and Z appear physically as A and /A, B and /B and Z and /Z.
These appear as differential signals on twisted-pair wire inputs, ensuring that
common modes are rejected and that the noise level is kept to a minimum.
When using Servomotors by other makers, check carefully the encoder specification for phase advancement. If the definition differs from the ones given
above, reverse the B-phase wiring between the MC Unit and the Servo Driver.
In most case, this should resolve the problem.
1-4-2Servo System Principles
The servo system used by and the internal operation of the MC Unit are
briefly described be low. Refer to 2-4 Servo System Precautions for precautions related to servo system operation.
Inferred Closed Loop
System or Semi-closed
Loop System
Internal Operation of the
MC Unit
1,2,3...1. The MC Unit performs actual position control. It receives encoder pulses
The servo system of the MC Unit uses an inferred closed loop system. This
system detects actual machine movements by the rotation of the motor in
relation to a target value. It calculates the error between the target value and
actual movement, and reduces the error through feedback.
Inferred closed loop systems occupy the mainstream i n modern servo systems applied to positioning devices for industrial applications. Commands to
the MC Unit, speed control voltages to the Servo Drivers, and feedback signals from the encoder are described in the next few pages.
Desired
position
MC Unit
123
Error
counter
D/A
Converter
Speed
reference
voltage
Servo System
Speed
Control
Motor
4
Speed
feedback
Encoder
Position
feedback
and calculates the required speed reference from the di fference between
the actual position and the desired position.
2. The calculated desired spee d is directly converted by the D/A converter
into an analogue sp eed reference voltage, which is provided to the Servo
Driver.
3. The Servo Driver controls the rotational speed of the Ser vomotor corresponding to the speed reference input.
4. The rotary encod er will generate the feedback pulses for both the spe ed
feedback within the Servo Driver speed loop and the position feedback
within the MC Unit position loop.
Motion Control AlgorithmThe servo system controls the motor by continuously adjusting the voltage
output that serves as a spee d reference to the Ser vo Dr iver. The speed reference is calculated by com paring the measured position of the axis from the
encoder with the demand position generated by the MC Unit.
16
Control Sy st emSection 1-4
The axis parameters MPOS, DPOS and FE contain the value of respectively
the measured position, demand position and the following error. The following
error is the difference between the demanded and measured position. MC
Unit uses five gain values to control how the servo function generates the voltage output from the following error.
The control algorithm for the motion con trol system of the MC Unit is sho wn in
the diagram below. The five gains are described below.
K
∆
vff
K
p
K
ov
Output
signal
∆
Measured
position
Demand
position
Proportional GainThe proportional gain creates an output that is proportional to the
foll owing er ror .
O
All practical systems use proportional gain. For many just using this gain
parameter alone is sufficient. The proportional gain axis parameter is called
P_GAIN.
Integral GainThe integral gain creates an output t hat is propor tional to the sum of
the following errors that have occurred during the system operation.
O
Integral gain can cause overshoot and so is usually used only on systems
working at constant speed o r with slow accelerations. The integral gain axis
parameter is called I_GAIN.
KpE⋅=
p
K
i
Following
error
+
K
Σ
K
i
∆
d
-
K
p
++
O
p
E
K
i
O
i
E
E
⋅=
i
å
Derivative GainThe derivative gain produces an output that is proportional to the
change in the following error and speeds up the response to changes in
error while maintaining the same relative stability.
O
Derivative gain may create a smoother response. High values may lead to
oscillation. The derivative gain axis parameter is called D_GAIN.
Output Speed GainThe output speed gain produces an output that is proportional to
the change in the measured position and increases system damping.
O
The output speed gain can be us eful for smoothing motions but will gene rate
high following errors. The output speed gain axis parameter is called
OV_GAIN.
d
ov
K
K
d
ov
K
d
E
E∆⋅=
K
ov
P
m
Pm∆⋅=
O
d
O
ov
17
SpecificationsSection 1-5
Speed Feedforward GainThe speed feedforward gain produces an output that is propor-
tional to the change in dem and position and minimizes the following error
K
vff
O
P
d
vff
at high speed.
O
vff
K
vff
Pd∆⋅=
The parameter can be set to minimise the following error at a constant
machine speed after ot her gai ns have been set. Th e speed feed forward gain
axis parameter is called VFF_GAIN.
Default ValuesThe default settings are given below along with the resulting profiles. Frac-
tional values are allowed for gain settings.
GainDefault
Proportional Gain1.0
Integral Gain0.0
Der iva tive Gai n0.0
Output Speed Gain0.0
Speed Feedforward Gain0.0
1-5Specifications
General Specifications
General specifications other than those shown below conform to those for the
SYSMAC C200HS/C200HX/C200HG/C200HE PCs.
ItemSpecifications
Power supply voltage5 VDC (from Backplane)
24 VDC (from external power supply)
Voltage fluctuation tolerance4.75 - 5.25 VDC (from Backplane)
21.6 - 26.4 VDC (from external power supply)
Internal current consu mp tion600 mA or less for 5 VDC
50 mA or less for 24 VDC
Weight (Connectors excluded)500 g max.
External Dimensions130.0 x 35 x 100.5 mm (H x W x D)
Functional Specifications
Type of UnitC200H Special I/O Unit
Applicable PCC200HX/HG/HE and CS1
Backplanes on which MC Unit can be
mounted
Method for data
transfer to CP U
Unit
External connected devicesPer sonal computer with Motion Perfect Programming
Controlled Servo DriversAnalogue (speed) input Servo Driver s
ControlControl meth odInferr ed closed loop with incremental encoder and with
18
ItemContents
CPU Backplane
Words allocated in
IR/CIO area
PC and MC Unit
instructions
Maximum No. of axes 8
Maximum No. of
interpolated axes
Maximum No. of
servo axes
Maximum No. of vir-
tual axes
10 words per unit (S ee note 1.)
Any number of words modified by ladder program or
BASIC program instruction
Software
PID , output speed and speed f eed forward gains
8
4
8
SpecificationsSection 1-5
µ
µ
µ
µ
ItemContents
Speed controlSpeed control of up to 4 axes
Measurement UnitsUser definable
Pos itioning opera-
tions
Encoder interfaceLine receiver input; maximum response frequency:
Accelerat ion/deceleration curvesTrapezoidal or S-curve
External
I/O
Power supply f or general and axis I/OPr ovided external ly
Task program man-
agement
Linear interpolationLinear interpolation for any number of axes
Circular interpolation Circular interpolation for any two axes
Helical interpolati onHelical interpolation for any three axes
CAM profileCAM profile movement for any axis
Electronic gearboxElectronic gearbox link between any two axes
Linked CAMLinked CAM profile mov em ent for any two axes
Linked moveLinked mo ve for any two axes
Adding axesAdding any two axes
250 kp/s (before multiplication)
1 M counts/s (afte r multiplication)
Serial Communication ports
EncoderLine receive inputs:
Servo Driver relationship
General Purpose I/O Up to 16 digital inputs and 8 out puts can be wired to
Registration inputsEach servo axis has a registration input which capture
Programming language
Number of tasksUp to 5 tasks running simultaneously plus the Com-
Max . nu m ber of pr ograms
Data storage capacity 251 (VR) + 16000 (Table) max.
Data transfer to PC
Unit
One RS-232C port for connection to computer wit h the
Motion P erfect software.
One RS-232C port for general purpose.
For four axes (250 kp/s, before mul tiplication)
The foll owing signals are provided.
Inputs:
Driver Alarm Signal (each axis)
Outputs:
Driver Enab le ( all axes)
Speed Reference Voltage (each axis)
Driver Alarm Reset (all axes)
control MC Unit functions. These can include limit
switches, emergency stop switches and proximity
inputs.
the position in hardware. Timing specification (see
note 2):
Digital Input (rising edge):10 s (max.)
Digital Input (falling edge):200 s (max.)
Z-marker (rising edge):2
Z-marker (falling edge):2
BASIC
mand Line Interface task
14
PLC_READ and PLC_WRITE command in BASIC program, IORD and IOWR instructions in ladder program
in C200HX/HG/HE PCs
s (max.)s (max.)
19
Comparison with C200HW-MC402-UKSection 1-6
ItemContents
Saving program
data
Self diagnostic functionsDetection of memory corruption via checksum
MC UnitBattery-backed RAM with flash memory backup.
(See note 3.)
External devi cesMotion Perfect softw are manages a backup on the
hard disk of the personal computer.
Detection of error counter over run
Note1. The number of MC Units that can be moun ted under on e CPU Unit must
be determined b ased on the maximum number of Special I/O Units that
can be allocated words in the CPU Units, the power supply capacity on the
CPU or Expansion Rack, and the current consumption of the Units mounted to the Rack. Refer to the CPU Unit’s operation manual for details on calculation methods.
2. This specification is the time between the edge in the input signal and the
capture of the position data.
3. The service life for the flash memory is 100,000 writing operations.
1-6Comparison with C200HW-MC402-UK
The following table shows a comparison between the C200HW-MC402-E Unit
and the previously released C200HW-MC402-UK Unit.
!Caution
The C200HW-MC402-E is not fully backward compatible with the C200HWMC402-UK. Please check Appendix A Upgrading from C200HW-MC402-UK
carefully before upgrading to the C200HW-MC402-E.
ItemC200HW-MC402-UKC200HW-MC402-E
Applicable PCsC200HS,C200HX/HG/HE
(HX up to CPU 6 4 )
Supported axes4 (4 servo)8 (4 servo and 4 virtual)
Allocated IR/CIO area words6 words (6 input)10 words (8 input,
Compatible softwareMotion Perfect 1.24 and 2.0Motion Perfect 2.0
Serial Port AUsed for Motion Perfect con-
nection and user-defined
communication.
Cyclic Servo PeriodSet by SERVO_PERIOD
Commands and
instructions
PLC_READ/
PLC_WRITE
IORD/ IOWRYes
CLEAR_BIT/
SET_BIT/
READ_BIT
param e ter (d efault 1 ms)
YesYes
Read/write to MC Unit’s VR
array in one-word format
NoYes
C200HS,C200HX/HG/HE
and CS1
2 output).
- Transfer input and output
words
- General stat us bits shifted
- Modified origin search bits
- Added PC Transfer Error bit
See notes 1 and 2.
Dedicated to Motion Perf ect
connection
Fixed to 1 ms
Also reads/writes al located
IR/CIO area words
Yes
Read/write to MC Unit’s VR
and Table array and oneword and three-word format
supported
Enables bit operation for VR
variables
20
Comparison with C200HW- M C402-UKSection 1-6
ItemC200HW-MC402-UKC200HW-MC402-E
Commands and
instructions
INPUT/ KEY/
LINPUT
PROCNoYes.
INDEVICE/
OUTDEVICE
CLEAR/ RESETNoYes
APPENDPROG/
AXISVALUES/
EX/
INPUTS0/
INPUTS1/
LOADSYSTEM/
MPE/
STORE
WAIT LOADED/
LIST
NoYes
Added functionality for serial
communications
Allows a process parameter
of a particular task to be
read/written
YesNo
Port 0 is def ault port fo r serial
communication
Commands to clear memory
YesCommands reserved for
Motion Perfect: descriptions
have been removed from
manual
NoYes
Added functionality
Note1. The allocation of the IR/C IO area bits has been modi fied in comparison
with the C200HW-MC402-UK. Please refer to 3-1 IR/CIO Area Allocation
and Appendix A Upgrading fr om C200HW-MC402-UK for more information.
2. The names of some IR/CIO area bits have been modified. Unless otherwise indicated, the functionality has not changed. T he names of th e connection pins have been modified without any change in function.
21
SECTION 2
Installation
This sectio n des cribes the MC Unit componen ts and provides the information required for installing the MC Unit.
The following diagram shows the main components of the MC Unit.
MC402-E
RUNDISABLE
4
Indicators
0
5
1
6
2
7
3
Indicators
TOOL
MACHINE No.
Axis Connector
DRV 0,1,2,3
I/O Connector
I/O
Communication
Ports: RS-232C
Unit No. switch
The following table describes the indicators on the front of the MC Unit.
Indicator ColorStatusMeaning
RUNGreenONThe MC Unit is operating normally.
OFFThe MC Unit is not recognized by the PC at ini-
tialization or is malfunctioning.
Flashing alone The battery voltage is low.
Flashing with
DISABLE
DISABLE RedONThe axes have been disabled. The Servo
OFFThe axes are enabled.
Flashing alone The following error has exceeded the li mit. The
Flashing with
RUN
0 to 7Orange ONThese indicat ors can be control led from the pro-
OFF
An error occurred in the communication
between MC Unit and CPU Unit.
Enable Output is not ON.
Servo Drives ha ve been disabled.
An error occurred in the communication
between MC Unit and CPU Unit.
gram s. R ef e r t o 5-3-53 DISPLAY for details.
Unit No. Switch
24
!Caution
Set the number the unit number between 0 and F.
CPU UnitUnit No. setting range
C200HS-CPU01-E/21-E/31-E/03-E/23-E/33-E
0 to 9
C200HE-CPU11-E/32-E/42-E/11-ZE/32-ZE/42-ZE,
C200HG-CPU33-E/43-E/33-ZE/43-ZE,
C200HX-CPU34-E/44-E/34-ZE/44-ZE
C200HG-CPU53-E/63-E/53-ZE/63-ZE,
0 to F
C200HX-CPU54-E/64-E/54-ZE/64-ZE/85-ZE
CS1H-CPU66-E/65-E/64-E/63-E
CS1G-CPU45-E/44-E/43-E/42-E
Do not change the unit number while power is being supplied to the Unit.
InstallationSection 2-2
2-2Installation
2-2-1Installation Method
1,2,3...1. Attach the hooks on the upper section of the MC Unit onto the Backplane.
2. Insert the MC Unit connector into the Backplane connector.
!Caution
Do not mount the MC Unit while the power is turned ON to the Rack.
When removing the MC Uni t, lift it out while pressing down on the lock lever
with a screwdriver, as shown in the following illustration.
25
WiringSection 2-3
2-2-2Dimensions
The basic dimensions of the MC Unit are shown below.
2-3Wiring
2-3-1Connector Pin Assignments
I/O Connector
The I/O Connector is used for wiring to external I/O. All I/O are general purpose and functions like limit inputs and origin proximity inputs can be allocated. Inputs I0 / R0 to I3 / R3 can also be used as the Registration Inputs for
axi s 0 to 3. Refer to 2-3-2 I/O Specifications for electrical specifications.
Recommended Connector
and Cable
Connector pin
arrangement
The 3M model numbers are listed below.
ConnectorIDC plug connector s with
26-pin MDR10126-6000EC or
10126-6000EL
10326-A200-00
The IDC or soldered connectors can be used with various types of cables.
The following 3M cable is recommended for the MC Unit.
10V_DRV0V common for control si gnals
2/ALARM_0Alarm input for axis 0
3/ALARM_1Alarm input for axis 1
4/ALARM_2Alarm input for axis 2
5A_0Encoder phase A axis 0
6/A_0Encoder phase /A axis 0
7B_0Encoder phase B axis 0
8/B_0Encoder phase /B axis 0
9Z_0Encoder phase Z axis 0
10/Z_0Encoder phase /Z axis 0
11VREF_0Speed reference signal axis 0
120V_ENC0V common for encoder signal s
13A_1Encoder phase A axis 1
14/A_1Encoder phase /A axis 1
15B_1Encoder phase B axis 1
16/B_1Encoder phase /B axis 1
17Z_1Encoder phase Z axis 1
18/Z_1Encoder phase /Z axis 1
19VREF_1Speed reference signal axis 1
200V_REF0V comm on for reference signals
21/ALARM_3Alarm input for axis 3
22ALARMRSTDrivers alarm reset signal
23ENABLEDr ivers enable signal
2424V_DRV24V supply for driver control signals
25A_2Encoder phase A axis 2
26/A_2Encoder phase /A axis 2
27B_2Encoder phase B axis 2
28/B_2Encoder phase /B axis 2
29Z_2Encoder phase Z axis 2
30/Z_2Encoder phase /Z axis 2
31VREF_2Speed reference signal axis 2
320V_ENCGround encoder signals
33A_3Encoder phase A axis 3
34/A_3Encoder phase /A axis 3
35B_3Encoder phase B axis 3
36/B_3Encoder phase /B axis 3
28
WiringSection 2-3
PinSignal
NameFunction
37Z_3Encoder phase Z axis 3
38/Z_3Encoder phase /Z axis 3
39VREF_3Speed reference signal axis 3
400V_REF0V common for speed reference signals
Note The 0V_REF and 0V_ENC pins are connected inside the MC Unit.
2-3-2I/O Specifications
The following tables provide specifications and circuits for the Axis and I/O
connections.
Digital Inputs
I/O inputs: I0 to I15
ItemSpecificationCircuit Configuration
TypePNP
Maximum voltage
Input curren t3.2 mA at 24 VDC
24 VDC + 10
%
Motion Control Unit
6.8kΩ
I0/R0 10
ON voltage12 V min.
OFF voltage5 V max.
ON response time
(see note)
OFF response time
(see note)
1.8 ms (max.)
2.1 ms (max.)
Note The given response time is the time between the chan ge in the input voltage
!Caution
External power
supply 24V
0V_IO 13
0V common for I/O circuits
910Ω
and the corresponding change in the IN variable. This time includes the physical delays in the input circuit.
Maximum 12 of the digi tal inp uts (I0 to I 15) s hou ld be switched on at any o ne
time to ensure that the Unit remains within internal temperature specifications.
Failure to meet this condition may lead to degradation of performance or damage of components.
Please refer to 1-5 Specifications for timing specification on print registration
using inputs I0/R0 to I3/R3.
29
WiringSection 2-3
Axis inputs: ALARM (axis 0 to 3)
ItemSpecificationCircuit Configuration
TypeNPN
Maximum voltage
24 VDC + 10
%
Motion Control Unit
Input current3.2 mA at 24 VDC
ON voltage12 V min.
OFF voltage5 V max.
ON response time
1.8 ms (max.)
(see note)
OFF response time
2.1 ms (max.)
(see note)
Note The given response time is the time between the chan ge in the input voltage
and the corresponding change in the IN variable. This time includes the physical delays in the input circuit.
Digital Outputs.
ItemSpecificationCircui t Confi guration
TypePNP
Current capacity100 mA each output
(800 mA total for
group of 8)
Maximum voltage24 V + 10%
ON response time
(see note)
OFF response time
(see note)
ProtectionOver current, over
1.3 ms (max.)
1.4 ms (max.)
temperature and 2 A
fuse on common
24V_DRV
External power
supply 24V
I/O outputs: O0 to O7
Equivalent
circuit
isolated from system)
Internal Circuitry (glavanically
To other output circuits
24
910Ω
6.8kΩ
2/ALARM_0
24V for Drive control signals
Motion Control Unit
2A Fuse
1
2
13
24V_IO
O0
0V_IO
LOAD
External power
supply 24V
ItemSpecificationCircuit Configur ation
TypeNPN
Current capacity80 mA each output
Maximum voltage24 V + 10%
ON response time
1.3 ms (max.)
(see note)
OFF response time
1.4 ms (max.)
(see note)
Note The given response time is the time between a chan ge in the OP o r WDOG
variable and the corresponding change in the digital output signal. This time
includes the physical delays in the output circuit.
30
Axis outputs: ENABLE, ALARMRST
Motion Control Unit
Equivalent
from system)
circuit
Internal Circuitry (glavanically isolated
To other Drive
control circuits
24 24V_DRV
ALARMRST
22
23 ENABLE
0V_DRV
1
LOAD
External power
supply 24V
WiringSection 2-3
Encoder Input
ItemSpecificationCircuit Configuration
Signal levelEIA RS-422-A Stan-
dards
Input impedance48 k min.
Ω
Response frequency250 kp/s
TerminationNone
(see note)
Note Termination res istors can be m ounted on the Terminal Block if required (see
Analogue Output
ItemSpecificationCircuit Configuration
Output Voltage0 to ±10 V
section 2-5 Wiring Precautions).
A_0
/A_0
B_0
/B_0
C_0
/C_0
5
6
7
8
9
10
120V_ENC
+5V
Phase A axis 0
0V
+5V
Phase B axis 0
0V
+5V
Phase Z axis 0
0V
Line receiver
System 0V
Motion Control Unit
Resolution12-bit
Output impedance100
Load impedance10 k min.
Ω
Ω
System 0V
2-3-3Serial Port Connections
The MC Unit has two ser ial RS-232C ports for communication with external
devices. Port A is the programming port of the unit, connect this port to the
computer to configure the Unit using the Motion Perfect software package.
Port B can be used for connection to other external devices.
The table below shows the connector on the MC Unit (8-pin mini-DIN) and the
pin allocation for both RS-232C ports.
You can use the following connection cable for connection to the computer.
ProductDescription
R88A-CCM002P4-EConnection cable RS-232C (2m)
The connections to the computer are shown below.
2-3-4Terminal Block
Personal Computer
2RD
3SD
5GND
7RTS
8CTS
ShellFG
D-sub 9-pin
MC Unit
3SD-A
5RD-A
4SG-A
mini-DIN 8-pin
The Terminal Block (Quick Conne ct Kit) can be used t o facilitate the connec tions to the Servo Drivers and other devices. The Terminal Block can be
mounted on a DIN rail.
10987
80 mm
123456
205 mm
The table below shows the various items on the unit.
ItemDescriptionConnection Type
1Axis 0 encoder output 9-pin D-sub (female)
2Axis 0 Servo Driver connection15-pin D-sub (female)
3Axis 1 Servo Driver connection15-pin D-sub (female)
4Axis 2 Servo Driver connection15-pin D-sub (female)
5Axis 3 Servo Driver connection15-pin D-sub (female)
6I/O connectionsScrew terminals
724V and 5V supply for Axis connectionsScrew terminals
8Axis connection to MC Unit40-pin MDR socket (female)
924V supply for I/O connectionsScrew terminals
10I/O connection to MC Unit26-pin MDR socket (female)
32
WiringSection 2-3
DimensionsThe unit’s dimensions are 205mm x 80mm x 57 mm (L x H x D) without the
cables connected.
Cable and Connector
Parts
The available ready-made cables together with the Terminal Block are shown
in the next table.
ProductDescription
R88A-TC04-ETerminal Block
R88A-CMX001S-EI/O connection cable from MC Unit to Terminal Block (1m)
R88A-CMX001J1-EAxis connection cable from MC Unit to Terminal Block (1m)
R88A-CMU001J2-EConnection from Ter minal Block to UA Servo Driver (1m)
R88A-CMUK001J3-EConnection from Terminal Block to UT Servo Driver (1m)
R88A-CMUK001J3-E2 Connection from Ter minal Block to UT/W Servo Driver (1m)
Pin Allocations
Axis D-sub 15-PinThe pin layout of the15-pin D-sub connectors, which are used for item 2 to 5,
is shown in the next table.
PinSignal
NameFunction
10V_DRV0V common for control signals
2/ALARMAlarm input for axis
3ALARMRSTDrive alarm reset signal
40V_ENC0V common for encoder signal s
5AEncoder phase A
6BEncoder phase B
7ZEncoder phase Z
8VREFSpeed reference signal
924V_DRV24V power suppl y for control signal s
10ENABLEDriver enable signal
115V_ENC5V power supply for encoder
12/AEncoder phase /A
13/BEncoder phase /B
14/ZEncoder phase /Z
150V_REF0V common for refer ence signal
Axis D-sub 9-PinThe Terminal Block has a second 9-pin D-sub conne ction for Axis 0 (item 1)
to enable the encoder signals of this axis to be outputted. This can be used to
cascade the signals through to another MC Unit with Terminal Block.
PinSignal
NameFunction
10V_DRV0V common for control signals
2AEncoder phase A
3BEncoder phase B
4ZEncoder phase Z
5- 6/AEncoder phase /A
7/BEncoder phase /B
8/ZEncoder phase /Z
9- -
33
WiringSection 2-3
I/O Connec ti o nsThe order of the pins for the I/O connections (item 6) is as follows. Refer to
2-3-1 Connector Pin Assignments for the pin descriptions.
I15I13 I11I9I7I5R3R1O7O5O3O1
I14I12I10I8 I6 I4 R2R0O6O4O2O0
Power SuppliesThere are 2 sets of terminals for supplying power to the interface unit
1. The 24V and optional 5V supply for the Axes part (item 7).
2. The 24V supply for the I/O connections to the unit (item 9).
The 24V power supply to the Axis connection and the I/O connec tion should
in principle be separate. This will ensure 500V RMS galvanic isolation
between the two circuits.
The 5V power supply is used to supply power an Omron FV Driver or a standalone line driver encoder feedback is used.
Terminating resistorsImmediately next to each item 1-5 there is a 6 pin through-hole connection
that allows placement of terminating resistors on the encoder A, B and Z signals. These resistors will have to be soldered onto the sites by competent personnel. The resistor pack recommended for this operation is the 220 Ω / 0.2
W resistors e.g. Bourns 4306R-102-221, which contains 6 isolated resistors in
one package.
4Alarm reset
11 Seq. input common
19 Fault output (NC)
20 Fault output common
13 Freq. ref. input
17 Freq. ref. common
3G3FV-PPGX2 (TA2 Terminal)
1A-phase +
2A-phase -
3B-phase +
4B-phase -
5Z-phase +
6Z-phase -
MY4-24VDC (Reset Relay)
9/10/11/12 2A/2B/2C/2D
5/6/7/81A/1B/1C/1D
13Co il 14Co il +
MY4-24VDC (Enable Relay)
9/10/11/12 2A/2B/2C/2D
5/6/7/81A/1B/1C/1D
13Co il 14Co il +
35
Servo System Precaution sSection 2-4
2-4Servo System Precautions
The following precautions are directly related to the operation of the servo
system. Ref e r to 1-4-2 Servo System Principles for a description of servo sys-
tem operation.
Motor Run awayIn a servo system employing a Servomotor, faulty or disconnected wiring may
cause the Servomotor to run out of control. Therefore, careful attention must
be paid to preventing faulty or disconnected wiring.
When the wiring is correct, the Ser vomoto r will maint ain the st opped position
through corrective operations as long as a position loop is formed and servolock is in effect.
If the motor rotates in the CW direction due to a factor such as temperature
drift, it is detected by the encoder and the internal error counter of the MC Unit
is notified of the direction and amount of rotation by means of feedback signals output by the encoder.
The count of the error counter is ordinarily zero unless otherwise designated.
When the motor moves in the CW direction, the feedback signal t ransfers the
direction and amount of movement as a count to the error counter. In
response, the MC Unit outputs a control voltage to rotate the motor in the
CCW direction to zero the error count.
The control voltage is output to the Ser vo Driver, and the Servomotor rotates
in the CCW direction. If the motor rotates in this CCW direction, the encoder
detects the direction and amount of movement and no tifies the error counter
in the MC Unit with feedback signals to subtract and zero the count again.
The position loop subtracts the count in the error counter to zero it.
The analogue ground is comm on among all axes, preventing the reversal of
axes by swapping the wires. The reversal can easily be achieved in software
inside the Servo Driver using the PP_STEP command.
Runaway Caused by
Faulty Wiring
MC Unit
Servo
Control
AG
Control voltage
(2)
0 V
(1)
Servo
driver
Phase A
Phase B
Servomotor
Encoder
If the phase-A and phase-B feedback input lines are wired in rev erse (crossed
dotted lines at 1 in the figure), the servolock will not be effective and the motor
will run out of control.
1,2,3...1. If the phase-A and phase-B feedback input lines are wired in reverse, the
error counter will receive the information as a rotation in the CCW direction.
2. If the motor rotates in t he CW di rection due t o drift or some o ther cause,
the encoder will detect the direction and amount of movement and transmit
feedback signals to the error counter in the MC Unit.
36
Servo System PrecautionsSection 2-4
3. As a result, the error counter having a count in the CCW direc tion will attempt to zero the count by outputting a control voltage to the Servo Driver
in the CW direction.
4. The Servomotor will rotate in the CW direction, repeating the above steps
1 to 3, causing the motor to run out of control.
Runaway can occur not only from reversed wiring of phases A and B of the
feedback inputs, but also from reversed wiring of the speed control voltage
and the ground lines (crossed dotted lines at 2 in the figure above).
Runaway Caused by
Disconnected Wiring
The Ser vomotor will run out of c ontrol not only when the pos ition loop is not
correctly formed, but also when the position loop is i nterr upt ed due to disconnected wiring.
MC Unit
Servo
Control
AG
Control voltage
0 V
1,2,3...1. Wire Breakage with Servomotor Rotating:
While the Servomotor is rotating, the speed control voltage is not 0 V because of the signal from the error counter. If the feedback line is broken,
no feedback signals will be given to the error counter and the speed control
voltage remains unchanged from the value that existed before the line
breakage, causing motor runaway.
2. Wire Breakage with Servomotor Stopped:
If the feedback line is broken while the Servomotor is stopped and correct
feedback signals cannot be returned, the speed control voltage will remain
at zero without changing. Therefore, the Servomotor will also remain
stopped. In fact, however, the motor may move in one direction without
stopping.
This is caused by a discrepancy between the 0 V of the MC Unit’s control voltage and the 0 V of the Ser vo Driver’s voltage input. When the two 0 voltages
do not match, an el ectr ic pot ent ial difference is generate d, resulting in a false
control voltage. This in turn causes the Ser vomotor to move in one direction
without stopping.
To prevent this, repair the wiring or adjust the 0 V of either the M C Unit or the
Servo Driver so that the 0 V levels match.
Servo
driver
Phase A
Phase B
Servomotor
Encoder
Following Error Li m it
Setting
While following a motion profile, the servo system will generally follow the set
profile but not exactly. There will be a following error. The following error limit
can be set according to operating conditions using the axis parameter
FE_LIMIT. If for any reason the following error exceeds this limit, the servo
enable output will reset and the Servo Driver will be disabled, causing the
motor to come to a sudden halt. T he user must m ake sure that this doe s not
have an adverse effect on the machine. See 5-3-66 FE_LIM IT for details.
37
Wiring PrecautionsSection 2-5
External Limit SwitchesAnother fail-safe condition must normal ly be set up us ing monitorin g sensors
installed at the edges of the workpiece’s range of movement to detect abnormal workpiece movement and stop operation if a runaway occurs. This can be
done by mapping the address of FWD_IN and REV_IN to the relevant digital
inputs. See 5-3-75 FW D_IN and 5-3-143 REV_IN for details.
Monitoring sensors are installed outside of the limit inputs. If the workpiece
reaches one of the sensors, the appropriate bit in the axis status will be turned
ON. The enable signal to the Servo Driver will be turned OFF and then the
dynamic brake will be applied to stop the motor.
2-5W iring Precau ti ons
Electronically controlled equipment may malfunction bec ause of noise generated by power supply lines or external loads. Such malfunctions are difficult to
reproduce, and determining the cause often requires a great deal of time. The
following precautions will aid in avoiding noise malfunctions and improving
system reliability .
• Use electrical wires and cables of the designated sizes as specified in the
operation manual for the Servo Driver. Use larger size cables for FG lines
of the PC or the Servo Driver and ground them over the shorte st possible
distances.
• Separate power cables (AC power supply lines and motor power supply
lines) from control cables (pulse output lines and external input signal
lines). Do not group power cables and control cables together or place
them in the same conduit.
• Use shielded cables for control lines.
• Use the Terminal Block and the ready -ma de cables design ed for MC Unit
to reduce connectivity problems.
• Connect a surge absorbing diode or surge absorber close to relays. Use a
surge-absorbing diode with a voltage tolerance of at least five times
greater than the circuit voltage.
DC relay
+
DC
-
RY
Surge
absorbing
diode
AC relay
AC
RY
Surge
absorber
Solenoid
SOL
Surge
absorber
• Noise may be generated on the power supply line if the same p ower supply line is used for an electric welder or electri ca l discharge unit. Connect
38
Wiring PrecautionsSection 2-5
an insulating transformer and a line filter in the power supply section to
rem ove such no ise.
• Use twisted-pair cables for power supply lines. Use adequate grounds
2
(i.e., to 100 or less) with wire cross sections of 1.25 mm
• Use twisted-pair shielded cables for control voltage output signals, input
signals and feedback signals.
• Use wires of maximum 2 m between the MC Unit and the Servo Driver for
control voltage output signals.
• If the distance of the encoder from the MC Unit is more than 10 m, terminating resistors should be place d on the Ter minal Block. The maximum
distance for the encoder position signal from the encoder to the MC Unit
must not exceed 20 m.
• The input terminals that operate th e 24 V system are isolated with optical
couplers to reduce external noise effects on the control sy stem. Do not
connect the analogue voltage ground and the 24 V system ground.
Ω
or greater.
39
SECTION 3
PC Data Exchange
This secti on describes the IR/CIO area al location and pre sents th e differe nt methods of da ta excha nge between the MC Unit
and the CPU Unit.
3-3-2Data Transfer by CPU Unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
3-3-3Data Transfer by MC Unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
41
IR/CIO Area AllocationSection 3-1
3-1IR/CIO Area Allocation
3-1-1Overview
Each MC Unit is allocated 10 words in the Special I/O Unit Areas of the CPU
Unit’s IR or CI O area. The words t hat are allocated depend on the Unit No . set
on the rotary switch on the f ront panel of the MC Unit. The cont ents of the
allocated 10 words is exchanged automatically between the CPU Unit and the
MC Unit ev ery time the CPU Unit refres hes I/O.
Input and Ou tput WordsThe words allocated to the MC Unit are classified as input and ou tput words.
The input and output directions are defined from the CPU Unit’s perspective.
Data Exchange for the C200HX/HG/HE, C200HS
CPU UnitMC Unit
IR 100
IR 101
IR 102
IR 109
IR 110
IR Area
Unit 0
}
Unit 1
Automatic data
exchange during
I/O Refresh
Unit 0
2 words
}
8 words
}
}
IR 119
Special I/O Area Allocation for C200HX/HG/HE, C200HS
Unit no. Allocated words Unit no. Allocated words Unit no. Allocated words Unit no. Allocated words
0IR 100 to IR 1094I R 140 to IR 1498IR 180 to IR 189CIR 420 to IR 429
1IR 110 to IR 1195I R 150 to IR 1599IR 190 to IR 199DIR 430 to IR 439
2IR 120 to IR 1296I R 160 to IR 169AIR 400 to IR 409
(See no te.)
3IR 130 to IR 1397I R 170 to IR 179BIR 410 to IR 419
(See no te.)
EIR 440 to IR 449
FIR 450 to IR 459
(See note.)
(See note.)
(See note.)
(See note.)
42
Note For C200HG-CPU53-E/63-E/53-ZE/63-ZE and C200HX-
CPU54-E/64-E/54-ZE/64-ZE/65-ZE/85-ZE CPU Units only.
IR/CIO Area AllocationSection 3-1
Data Exch an g e for the CS1 Series
CPU UnitMC Unit
CIO 2000
CIO 2001
CIO 2002
CIO 2009
CIO 2010
CIO Area
Unit 0
}
Unit 1
Automatic data
exchange during
I/O Refresh
Unit 0
2 words
}
8 words
}
}
CIO 2019
Special I/O Area Allocation for CS1 Series
Unit no. Allocated words Unit no. Allocated words Unit no. Allocated words Unit no. Allocated words
0CIO 2000 to
CIO 2009
1CIO 2010 to
CIO 2019
2CIO 2020 to
CIO 2029
3CIO 2030 to
CIO 2039
4CIO 2040 to
CIO 2049
5CIO 2050 to
CIO 2059
6CIO 2060 to
CIO 2069
7CIO 2070 to
CIO 2079
8CIO 2080 to
CIO 2089
9CIO 2090 to
CIO 2099
ACIO 2100 to
CIO 2109
BCIO 2110 to
CIO 2119
CCIO 2120 to
CIO 2129
DCIO 2130 to
CIO 2139
ECIO 2140 to
CIO 2149
FCIO 2150 to
CIO 2159
3-1-2Overview of IR/CIO Area Allocations
The following tables show the data which is automatically exchanged during
the I/O refresh period. The first word allocated t o the MC Unit in the IR/CIO
area is specified as “n” (refer to the previous section). The value of “n” can be
calculated from the unit number using the following equation.
• C200HX/HG/HE, C200HS
Unit numbers 0 to 9:n = 100 + 10 x Unit number
Unit numbers A to F:n = 400 + 10 x (Unit number - 10)
• CS1 Series
Unit numbers 0 to F:n = 2000 + 10 x Unit number
OutputsThe outputs consists of two transfer output words, which are used for data
exchange from the CPU Unit to the MC Unit. More details can be found in the
next section.
Output
word
n00 to 15 Output Word 1First transf er output word.
n + 100 to 15Output Word 2Second transfer output wor d.
InputsThe inputs consists of the status flags of the MC Unit and transfer input
BitNameFunction
words. The transfer input data are two words, which are used for data
exchange from the MC Unit to the CPU Unit. More details can be found in the
next section.
43
IR/CIO Area AllocationSection 3-1
Input wordBitNameFunction
n + 200Unit Operating FlagOFF: MC Unit is not operating.ON: MC Unit is operating.
01Motion Error FlagOFF: No error.ON: A m otion error has occurred.
02Task 1 FlagOFF: Task1 is inactive.ON: Task 1 is active.
03Task 2 FlagOFF: Task 2 is inactive.ON: Task 2 is active.
04Task 3 FlagOFF: Task 3 is inactive.ON: Task 3 is active.
05Task 4 FlagOFF: Task 4 is inactive.ON: Task 4 is active.
06Task 5 FlagOFF: Task 5 is inactive.ON: Task 5 is active.
07PC Transfer Busy FlagON: The MC Unit is exchanging data with the PC Unit.
08 to 15Digital Input Stat us Flags Indicate the status of digital inputs 0 to 7.
n + 300 to 15 Digital Input Status Flags Indicate the status of the digital inputs 8 to 23.
n + 400 to 15 Digital Output Status
Flags
n + 500Axis 0 Following Error
Warning Limit Flag
01Axis 0 Forward Limit Flag ON: A forward limit is set for axis 0.
02Axis 0 Reverse Limit Flag ON: A rever se lim it is set for axis 0.
03Axis 0 Origin Search Flag ON: An origin search is in progress for axis 0.
04Axis 0 Feedhold FlagON: A feedhold is set for axis 0.
05Axis 0 Following Error
Limit Flag
06Axis 0 Software Forward
Limit Flag
07Axis 0 Software Reverse
Limit Flag
08Axis 1 Following Error
Warning Limit Flag
09Axis 1 Forward Limit Flag ON: A forward limit is set for axis 1.
10Axis 1 Reverse Limit Flag ON: A rever se lim it is set for axis 1.
11Axis 1 Origin Search Flag ON: An origin search is in progress for axis 1.
12Axis 1 Feedhold FlagON: A feedhold is set for axis 1.
13Axis 1 Following Error
Limit Flag
14Axis 1 Software Forward
Limit Flag
15Axis 1 Software Reverse
Limit Flag
Indicate the stat us of digital outputs 8 to 23.
ON: The warning limit was exceeded for the following error for axis 0.
ON: The limit was exceeded for the following error for axis 0.
ON: The software forward limit was exceeded for axis 0.
ON: The software reverse limi t was exceeded for axis 0.
ON: The warning limit was exceeded for the following error for axis 1.
ON: The limit was exceeded for the following error for axis 1.
ON: The software forward limit was exceeded for axis 1.
ON: The software reverse limi t was exceeded for axis 1.
44
IR/CIO Area AllocationSection 3-1
Input wordBitNameFunction
n + 600Axis 2 Following Error
Warning Limit Flag
01Axis 2 Forward Limit Flag ON: A forward limit is set for axis 2.
02Axis 2 Reverse Limit Flag ON: A rever se lim it is set for axis 2.
03Axis 2 Origin Search Flag ON: An origin search is in progress for axis 2.
04Axis 2 Feedhold FlagON: A feedhold is set for axis 2.
05Axis 2 Following Error
Limit Flag
06Axis 2 Software Forward
Limit Flag
07Axis 2 Software Reverse
Limit Flag
08Axis 3 Following Error
Warning Limit Flag
09Axis 3 Forward Limit Flag ON: A forward limit is set for axis 3.
10Axis 3 Reverse Limit Flag ON: A rever se lim it is set for axis 3.
11Axis 3 Origin Search Flag ON: An origin search is in progress for axis 3.
12Axis 3 Feedhold FlagON: A feedhold is set for axis 3.
13Axis 3 Following Error
Limit Flag
14Axis 3 Software Forward
Limit Flag
15Axis 3 Software Reverse
Limit Flag
n + 700Task 1 BASIC Error Flag ON: An error occurred in the BASIC program in task 1.
01Task 2 BASIC Error Flag ON: An error occurred in the BASIC program in task 2.
02Task 3 BASIC Error Flag ON: An error occurred in the BASIC program in task 3.
03Task 4 BASIC Error Flag ON: An error occurred in the BASIC program in task 4.
04Task 5 BASIC Error Flag ON: An error occurred in the BASIC program in task 5.
05Low Battery FlagON: The volt age of the backup battery is lo w.
06Not used--07PC Transfer Error FlagON: An error has occurred during data transfe r between MC Unit and
08 to 15Indicator ModeContains the value of the DISPLAY system parameter, which deter-
n + 800 to 15 Input Word 1First transfer input word.
n + 900 to 15 Input Word 2Second transfer input word.
ON: The warning limit was exceeded for the following error for axis 2.
ON: The limit was exceeded for the following error for axis 2.
ON: The software forward limit was exceeded for axis 2.
ON: The software reverse limi t was exceeded for axis 2.
ON: The warning limit was exceeded for the following error for axis 3.
ON: The limit was exceeded for the following error for axis 3.
ON: The software forward limit was exceeded for axis 3.
ON: The software reverse limi t was exceeded for axis 3.
PC Unit.
mines the displ ay mode of the bank of the 8 LED indicator s on the
front panel. Ref er to 5-3-53 DISPLAY for details.
45
Overview of Data ExchangesSection 3-2
3-2O vervi ew of Data Exchanges
3-2-1Data Exchange Methods
The MC Unit is able to exchange data with the CPU Unit the following three
ways.
Data Words in IR/CIO AreaThe MC Unit and the CPU Unit both have access to their own allocated words
in memory. These transfer I/O words allocated in the MC Unit memory and in
the CPU Unit’s IR/CIO Area are exchanged during the I/O refresh period. The
MC Unit accesses the words by using the BASIC commands PLC_READ and
PLC_WRITE.
CPU UnitMC Unit
No program
required
Allocated Words
I/O Refresh
PLC_READ
PLC_WRITE
VR Array
Allocated Words
Data Transfer by CPU UnitThe CPU Unit is able to read/write directly into both the VR and Table mem-
ory areas of the MC Unit by using the ladder instructions IORD and I OWR.
BASIC programming in the MC Unit is not required.
CPU Unit
IORD
IOWR
MC Unit
No program
required
46
I/O Memory
Table/VR Array
Overview of Data ExchangesSection 3-2
Data Transfer by MC UnitThe MC Unit can initiate data trans fer to and from the CPU Unit usin g the
PLC_READ and PLC_WRITE commands. The CPU Unit’s user program is
not required and the transfer will be executed at the next I/O refresh.
CPU UnitMC Unit
No program
required
I/O Memory
Next I/O
refresh
PLC_WRITE
PLC_READ
VR Array
3-2-2Data formats
The data transfers commands of t he PC Unit and the MC Uni t support two
data format types.
One-word formatThe data is transferred word by word from each PC memory location to each
variable in the MC unit and vice versa. The value in the MC Unit is always the
integer equivalent of the hexadecimal value in the PC (no 2's complement).
From the floating-point data in the MC uni t only the intege r par t will be transferred. The valid range is [0,65535].
Three-word formatThe data in the PC is represented by three memo ry elements, in total three
words. The following is the configuration of a BCD position data item.
Example 1: The three-word format of value 56143 is given by
j+00000
j+16143
j+20005
Example 2: The three-word format of value -48.89 is given by
j+00002
j+14889
j+28000
One data item uses three words. Therefore the total words for data transfers
should be the amount of data transferred multiplied by three.
47
Details of the Data Exchange MethodsSection 3-3
3-3D etails of the Data Exchange Met hod s
3-3-1Data Words in IR/CIO Area
Data is read/written during the I/O refresh from either the MC Unit or the CPU
Unit.
• The amount of data is two words output and two words input.
• The data is copied between the VR area and the allocated words in the
MC Unit by using the PLC_READ and PLC_WRITE commands.
Transfer Output
The two words output data present in the CPU Unit is copied at every I/O
refresh to the allocated words within the MC Unit. When a PLC_READ command is given, the contents of the allocated words (n, n +1) will be copied to
the specified VR variables in the MC Unit.
The following example is for a C200HX/HG/HE PC.
CPU UnitMC Unit
Transfer Input
None
IR Area
n0110101010001111
n+1 0000000000001111
I/O Refresh
PLC_READ(PLC_REFRESH, 0, 2, 0)
VR(0)27279
VR(1)15
At PLC_READ
n0110101010001111
n+1 0000000000001111
After the PLC_WRITE command is given, the content of the specified VR variables will b e copied to th e allocated wo rds in the MC Un it. On the next I/O
refresh, this data will be copied to the a llocated words (n+8, n+9) in t he IR/
CIO area of the CPU Unit.
The following example is for a C200HX/HG/HE PC.
CPU Unit
None
PLC_WRITE(PLC_REFRESH, 0, 2, 10)
MC Unit
48
IR Area
n+8 0000000000101101
n+9 0000000101001101
I/O Refresh
VR(10) 45
VR(11) 333
At PLC_WRITE
n+8 0000000000101101
n+9 0000000101001101
Details of the Data Exchange MethodsSection 3-3
3-3-2Data Transfe r by CPU Unit
The CPU Unit is able to independently read and write to the MC Unit’s Table
and VR array.
• The maximum amount of data transferred is 128 words.
• The data transfer is synchronous with the ladder program.
IORD Instruction
The IORD instruction can be used in the following way to read data from the
MC Unit. Refer to the Operation Manual of your PC Unit for furthe r details on
using this instruction.
IORD
CC: Control code
SS: Sourc e Information
DD: First destination word
C:
Val ue (hex)Details
❏❏❏
#A
❏❏❏
#B
❏❏❏❏
#
VR (one-word format): Data i s tr ansferred from
the first VR variable as specified b y
Range (BCD): 000 to 250.
VR (three-word format): Data is transferred from
the first VR variable as specified b y
Range (BCD): 000 to 250.
Table ( three-word format): Data is tr ansferred
from the first Table variable as specified by
❏❏❏.
❏❏❏.
❏❏❏❏ multiplied by factor 1 0.
Range (BCD): 0000 to 1599.
C200HX/HG/HE
S:
Val ue (hex)Details
❏❏❏
#n
CS1 SeriesS: left most 4 digits
S+1: right most 4 digits
S:
Val ue (hex)Details
#000n
S+1:
Val ue (hex)Details
❏❏❏❏The no. of transfer words is specif ied by ❏❏❏❏.
#
D:First destinati on word in CPU Unit’s memory.
Value n is the unit number of the MC Unit.
Range: 0 to F.
The amount of data is specifi ed by
Range: (BCD): 001 to 128.
Value n is the unit number of the MC Unit.
Range: 0 to F.
Range: 0000 to 0080 Hex
.
❏❏❏.
49
Details of the Data Exchange MethodsSection 3-3
Data
ItemDetail
PCC200HX/HG/HE
OperandD
IR Area 1IR 000 to IR 235
SR Area 1SR 236 to SR 252
SR Area 2SR 256 to SR 299
IR Area 2IR 300 to IR 511
HR AreaHR 00 to HR 99
AR AreaAR 00 to AR 27
LR AreaLR 00 to LR 63
TC AreaTC 000 to TC 511
TR Area- -DM AreaDM 0000 to DM 6143
EM Area--Indire ct DM
addresses
Constants---
Data
ItemDetail
PCCS1
OperandD
CIO AreaCIO 0000 to CIO 6143
Work AreaW000 to W511
Holding Bit AreaH000 to H511
Auxilia ry Bit AreaA000 to A959
Timer AreaT0000 to T4095
Counter AreaC0000 to C4095
DM AreaD00000 to D32767
EM Area without
bank
EM Area with bankEn_00000 to En_32767 (n = 0 to C)
Indirect DM/EM
addresses in binary
Indirect DM/EM
addresses in BCD
Constants--Data Registers--Directly addressing
Index Regist ers
Indirect addr essing
using Index Registers
*DM 0000 to DM 6655
E00000 to E32767
@D00000 to @D32767
@E00000 to @E32767
@En_00000 to @En_32767 (n = 0 to C)
*D00000 to *D32767
*E00000 to *E32767
*En_00000 to *En_32767 (n = 0 to C)
---
,IR0 to , IR15
-2048 to +2047 ,IR0 to ,IR15
DR0 to 15, IR0 to IR15
,IR0 to , IR15+(++)
-(--) IR0 to IR15
50
Details of the Data Exchange MethodsSection 3-3
Flags
Value
(see note)
Instruction Exe cution Error Flag
(ER) (25503)
Carry Flag
(CY) (25504)
Greater Than Flag
(GR) (25505)
Equals Flag
(EQ) (25506)
Less Than Flag
(LE) (25507)
Overflow Flag
(OF) (25404)
Underflow Flag
(UF) (25405)
Negative Flag
(N) (25402)
• The number of transfer
words is not in BCD, or it is
0 words or is greater than
128 words.
• The indirectly addressed
DM address is greater than
6656 or not BCD.
• The destination Unit No. is
outside the range 0 to F, or
is on a SYSMAC BUS
slave rack.
• The number of transfer
words is not BCD.
------
------
Reading was correct ly completed.
------
------
------
------
ONOFF
C., S., and D. settings are correct.
Reading was not corre ctl y
completed.
Note SR A rea addresses for the C200HX/HG/HE, C200 H, and C200HS are g iven
in parentheses.
Value ONOFF
PC Transfer E rro r
Flag
(IR n+7 bit 07)
• The control code is not
valid for the MC Un it.
• The amount of words is not
a multiple of three for
three-word format transfer.
• The MC Unit’s Table or VR
address in combination
with the amount of data is
invalid.
• There is an overflow of
IORD/IOWR and
PLC_READ/PLC_WRITE
transfers.
None of the errors has
occurred.
Note The user should be aware that t he MC Unit does not check if the MC Unit data
is in the range of the three-word format.
51
Details of the Data Exchange MethodsSection 3-3
Transfer example for
C200HX/HG/HE PC
IOWR Instruction
In the following example, 20 words from VR(123) to VR(142) is t ransferred
from the MC Unit wi th unit num ber s et t o 0 t o addresses DM0000 to D M00 19
in one-word format.
001.00
IORD
#A123
#0020
DM0000
The IOWR instruction can be used in the following way to write data to the MC
Unit. Refer to the Operation Manual of your PC Unit for further details on
using this instruction.
IOWR
CC: Control code
SS: First source word
DD: Destination information
C:
Val ue (hex)Details
❏❏❏
#A
❏❏❏
#B
❏❏❏❏
#
VR (one-word format): Data i s tr ansferred to the
first VR variable as specified by
(BCD): 000 to 250.
VR (three-word format): Data is transferred to
the first VR variable as specified b y
Range (BCD): 000 to 250.
Table ( three-word format): Data is tr ansferred to
the first Table variable as specified by
multiplied by factor 10. Range (BCD): 0000 to
1599.
❏❏❏. Range
❏❏❏.
❏❏❏❏
S:First source word in CPU Unit’s me mory.
C200HX/HG/HE
D:
Val ue (hex)Details
❏❏❏
#n
CS1 SeriesD: left most 4 digits
D+1: right most 4 digits
D:
Val ue (hex)Details
#000nValue n is the unit number of the MC Unit.
D+1:
Val ue (hex)Details
❏❏❏❏The no. of transfer words is specif ied by ❏❏❏❏.
#
Value n is the unit number of the MC Unit.
Range: 0 to F.
The amount of data is specifi ed by
Range: (BCD): 001 to 128.
Range: 0 to F.
Range: 0000 to 0080 Hex.
❏❏❏.
52
Details of the Data Exchange MethodsSection 3-3
Data
ItemDetail
PCC200HX/HG/HE
OperandS
IR Area 1IR 000 to IR 235
SR Area 1SR 236 to SR 255
SR Area 2SR 256 to SR 299
IR Area 2IR 300 to IR 511
HR AreaHR 00 to HR 99
AR AreaAR 00 to AR 27
LR AreaLR 00 to LR 63
TC AreaTC 000 to TC 511
TR Area- -DM AreaDM 0000 to DM 6655
EM Area--Indire ct DM
addresses
Constants---
Data
ItemDetail
PCCS1
OperandS
CIO AreaCIO 0000 to CIO 6143
Work AreaW000 to W511
Holding Bit AreaH000 to H511
Auxilia ry Bit AreaA000 to A959
Timer AreaT0000 to T4095
Counter AreaC0000 to C4095
DM AreaD00000 to D32767
EM Area without
bank
EM Area with bankEn_00000 to En_32767 (n = 0 to C)
Indirect DM/EM
addresses in binary
Indirect DM/EM
addresses in BCD
Constants#0000 to #FFFF (binary)
Data Registers--Directly addressing
Index Regist ers
Indirect addr essing
using Index Registers
*DM 0000 to DM 6655
E00000 to E32767
@D00000 to @D32767
@E00000 to @E32767
@En_00000 to @En_32767 (n = 0 to C)
*D00000 to *D32767
*E00000 to *E32767
*En_00000 to *En_32767 (n = 0 to C)
---
,IR0 to , IR15
-2048 to +2047 ,IR0 to ,IR15
DR0 to 15, IR0 to IR15
,IR0 to , IR15+(++)
-(--) IR0 to IR15
53
Details of the Data Exchange MethodsSection 3-3
Clea r i ng P C Transf e r E rr o r
in MC Unit
C:
Val ue (hex)Details
#EC00
S:Use any sour ce address
C200HX/HG/HE
D:
Val ue (hex)Details
#n001
CS1 Series
D:
Val ue (hex)Details
#000nValue n is the unit number of the MC Unit.
D+1:
Val ue (hex)Details
#0001The amount of data should always be 0001.
The PC transfer error flag in IR/CIO area is
cleared.
Value n is the unit number of the MC Unit. The
amount of data should always be 001.
Range: 0 to F.
Flags
Value
(see note)
Instruction Exe cution Error Flag
(ER) (25503)
Carry Flag
(CY) (25504)
Greater Than Flag
(GR) (25505)
Equals Flag
(EQ) (25506)
Less Than Flag
(LE) (25507)
Overflow Flag
(OF) (25404)
Underflow Flag
(UF) (25405)
Negative Flag
(N) (25402)
ONOFF
• The number of transfer
words is not in BCD, or it is
0 words or is greater than
128 words.
• The indirectly addressed
DM address is greater than
6656 or not BCD.
• The Unit No. of the MC
Unit is outside the range
0 to F, or is on a SYSMAC
BUS slave rack.
• The number of transfer
words is not BCD.
• The instruction was not
correctly compl eted.
------
------
Writing was correctly completed.
------
------
------
------
C., S., and D. settings are correct.
Writing was not correctly completed.
54
Details of the Data Exchange MethodsSection 3-3
Note SR A rea addresses for the C200HX/HG/HE, C200 H, and C200HS are g iven
in parentheses.
Value ONOFF
PC Transfer E rro r
Flag
(IR n+7 bit 07)
• The control code is not
valid for the MC Un it.
• The amount of words is not
a multiple of three for
three-word format transfer.
• The MC Unit’s Table or VR
address in combination
with the amount of data is
invalid.
• There is an overflow of
IORD/IOWR and
PLC_READ/PLC_WRITE
transfers.
Note The user sh ould b e aware that the MC Uni t doe s not che ck if the PC mem ory
data complies to the three-word format.
Transfer exampleIn the following example, 60 words from DM0100 to DM0159 is transferred in
three words format from the PLC Unit to TABLE(10100) to TABLE(10119) of
the MC Unit with unit number set to 5.
001.00
IOWR
#1010
DM0100
#5060
None of the errors has
occurred.
3-3-3Data Transfe r by MC Unit
The MC Unit is able to independently read and write from the MC Unit’s VR
array to the CPU Unit’s I/O memory by using the PLC_READ and
PLC_WRITE commands.
• The maximum amount of data transferred is 127 words.
• The commands only support the one-word format.
• The data is transferred at the end of the CPU scan cycle during I/O
refresh.
• The BASIC program will be paused until c om plet ion of the transfer.
Refer to the 5-3-122 PLC_READ and 5-3-124 PLC_WRITE for more details
on the commands.
PLC_READ Command
The following BASIC program will read 50 words from the CPU Unit’s DM 0 to
DM 49 to VR variables 100 to 149 in one-word format. A PC u ser program is
not required.
BASIC program:
PLC_READ(PLC_DM,0,50,100)
PLC_WRITE Command
The following BASIC program will write 50 words from the MC Unit’s VR variables 0 to 99 from the CPU Unit’s EM 200 to EM 299 to in one-word format. A
PC user program is not required.
BASIC program:
PLC_WRITE(PLC_EM,200,100,0)
55
Details of the Data Exchange MethodsSection 3-3
Restrictions for CS1-series PCs
When the MC Unit is used with a CS1-series PC, there are some addressing
restrictions for the data transfer using the PLC_READ and PLC_WRITE commands. Note that the other two methods do not have these restrictions and
should be used for accessing data outside this range.
The addresses shown in the following table can be specified for PLC_REA D
and PLC_WRITE.
AreaCS1 addressDesignation method
PC_areaFirst word address
DM areaD00000 to D06655PLC_DM0 to 6655
CIO areaCIO 0000 to CIO 0511PLC_IR0 to 511
Data Link area (in
CIO area)
Holding Bit area,
part 1
Holding Bit area,
part 2
Timer areaT0000 to T0511PLC_TC0 to 511
EM area, bank 0E0_00000 to E0_06143 PLC_EM0 to 6143
CIO 1000 to CIO 1063PLC_LR0 to 63
H000 to H099PLC_HR0 to 99
H100 to H127 (except
H101)
PLC_AR0 to 27
56
SECTION 4
Multitasking BASIC Programming
This section gives an overview of the fundamentals of multitasking BASIC programs and the methods by which programs
are managed for the MC Unit.
The C200HW-MC402 Motion Control Unit features a multitasking version of
the BASIC programming language. The motion control language is largely
based upon a tokenised BASIC and the programs are compiled into th e tokenised form prior to their execution.
Multitasking is simple to set up and use and allows very complex machines to
be programmed. Multitasking gives the MC Unit a significant advantage over
equivalent single task systems. It allows modular applications where the logically connected processes can be grouped together in the same task program, thus simplifying the code architecture and design.
The MC Unit can hold up to 14 programs if mem ory s ize permits. A total of 5
tasks can be allocated to the programs. The execution of the programs is user
controlled using BASIC.
The BASIC commands, functions and parameters presented here can be
found in SECTION 5 BASIC Motion Control Programming Language.
4-2BASIC Programming
The BASIC language consists among others of commands, functions and
parameters. These BASIC statements are the building blocks provided to
control the MC Unit operation.
CommandsCommands are words recognized by the processor that perform a certain
action but do not return a value. For example, PRINT is a recognized word
that will cause the value of the following functions or variables to be printed on
a certain output device.
FunctionsFunctions are words recognized by the processor that perform a certain
action and return a value related to that action. For example, ABS will take the
value of its parameter and return the absolute value of it to be u sed by some
other function or command. For example ABS(-1) will return the value 1,
which can be used by the PRINT command, for example, to generate a string
to be output to a certain device.
ParametersParameters are words recognized by the processor that contain a certain
value. This value can be read and, if not read only, written. Parameters are
used to determine and monitor the behavior of the system. For example,
ACCEL determines the acceleration rate of a movement for a certain axis.
4-2-1Axis, System and Task Statements
The commands, functions an d parameters apply either to (one of) the axes,
the tasks running or the general system.
Axis StatementsThe motion control commands and the axis parameters apply to one or more
axes. Axis parameters determine and monitor how an axis reacts on commands given and how it reacts to the outside world. Every axis has a set of
parameters, so that all axes can work independently of each other. The
motion control commands are able to control one or more of the axes simultaneously, while every axis has its own behavior.
The axis parameters are reset to their default values either when the power to
the MC Unit is turned ON, the MC Unit is restarted from Motion Perfect, the
MC Unit is restarted using the Restar t Bit in the CPU Unit or the INITIALISE
command is executed.
The commands and param eters work on some base axis or group of axes,
specified by the BASE command. The BASE command is used to change this
base axis group and every task has its own group which can be changed at
any time. The default base axis is 0.
58
BASIC ProgrammingSection 4-2
Individual axis dependent commands or parameters can also be programmed
to work on a temporary base axis by including the AXIS function as a modifier
in the axis dependent c ommand. A temporary base axis is effective only for
the command or parameter after which AXIS appears.
Task StatementsThe task parameters apply to a sin gle task. The task parameters monitor the
task for example for error handling. The PROC modifier allows the user to
access a parameter of a certain task. Without PROC the current task is
assumed. The BASE command (see above) is task specific and can be used
with the PROC modifier.
System StatementsThese statements govern the overall system features, which are basically all
statements which do not belong to the first two groups.
4-2-2Data Structures and Variables
BASIC programs can store numerical data in various types of variables. Some
variables have predefined functions, such as the axis parameters and system
parameters; other variables are available for the programmer to define as
required in programming. The MC Unit’s Table, global and local variables are
explained in this section. Furthermore also the use of labels will be specified.
Table
The Table is an array structure that contains a series of numbers. These numbers are used for instance to specify positions in the profile for a CAM or
CAMBOX command. They can also be used to store data for later use, for
example to store the parameters used to define a workpiece to be processed.
The Table is common to all tasks o n th e MC Un it , i.e., the values written to th e
Table f rom one task can be read from ot her tasks. The Table is backed up by
a battery and will ma intain it s content s whe n power is tur ned OFF.
Table values can be wr itten and read using the TABLE command. The maximum length of the array is 16000 elements, from TA BLE (0) to TABLE(15999).
The Table array is initialized up to the highest defined element.
Global Variables
!Caution
The global va ria bles, also called VR variables, are comm on to all ta sks o n the
MC Unit. This means that if a program running on task 2 sets VR(25) to a certain value, then any other program running on a different task can read that
same value from VR(25). This is very useful for synchronizing two or more
tasks, but care must be taken to avoid more than one program wr iting to the
same variable at the same time. The controller has 251 global variables,
VR(0) to VR(250). The variables are read and written using the VR command.
The VR variables maintain their values when power is turne d OFF to the M C
Unit. They are stored in RAM backed up by battery in the MC Unit.
If the voltag e of t he ba ckup batt ery drops, Table and glob al data will be l ost.
This can happen when the power to the MC Unit is turned OF F for a long
period of time. Th e user should be very aware of t his an d s hou ld take the following precautions:
• Initialize variables from a program at power up as much as possible.
• Store dynamic application data, which can not be defined in programs, inthe PC Unit’s memory as much as possible.
• Update the data from the PC Unit at each power up before operation.
The Low Batter y f lag w ill tur n ON when the voltage of t he backup bat tery has
dropped. Also the BATTERY_LOW system parameter will become TRUE. For
detailed information , refer to 3-1-2 Overview of IR/CIO Area Allocations and
5-3-28 BATTERY_LOW.
59
BASIC ProgrammingSection 4-2
Local Variables
Named variables or local variables can be de clared in programming and are
local to the task. This means that two or more programs running on different
tasks can use the same variable name, but their values can be different. Local
variables cannot be read from any task except for the one in which they are
declared. Local variables are always cleared when a program is st arted. The
local variables can be cleared by using either the CLEAR or the RESET command. Undefined local variables will retur n zero. Local variables cannot be
declared on the command line.
A maximum of 255 local variables can be declared. Only the first 16 characters of the name are significant.
Labels
BASIC programs are normally executed in descending order through the
lines. Labels can be used to alter this execution flow using the BA SIC commands GOTO and GOSUB. To define a label it must appear as the first statement on a line and it must be end ed by a colon (:). Labels c an be character
strings of any length, but only the first 15 characters are significant.
Using Variables and Labels
Each task has its own local labels and local variables. For example, consider
the two programs shown below:
start:
FOR a = 1 to 100
MOVE(a)
WAIT IDLE
NEXT a
GOTO start
start:
a=0
REPEAT
a = a + 1
PRINT a
UNTIL a = 300
GOTO start
These two programs when run simultaneously in different tasks and have
their own version of variable “a” and label “start”. Note that undefined local
variables will also return zero and not generate an error message.
If you need to hold data in common between two or more programs, VR variables should be used, or alter natively, if a large amount of data is to be held,
the Table can be used.
To m ake a program more readable when using a VR variable, a named local
variable can be used as a constant in the VR variable. The constant, however,
must be declared in each program using the variable. In the example below,
VR(3) is used to hold a length parameter.
start:
GOSUB initial
VR(length) = x
...Body of program
initial:
length = 3
RETURN
start:
GOSUB initial
MOVE(VR(length))
PRINT VR(length)
...Body of program
initial:
length = 3
RETURN
4-2-3Mathematical Specifications
Number formatThe MC Unit ha s two main formats for numeric values: single pre cision float-
ing point and single precision integer.
60
Motion Control ApplicationSection 4-3
The single precision floating point format is internally a 32 bit value. It has an
8 bit exponent field, a sig n bi t and 23 bit fraction field with an i mplicit 1 as the
24th bit. Floating point numbers have a valid range of to
3.4±10
38
.
⋅
5.9±10
Integers are essentially floating point numbers with a zero exponent. This
implies that the integers are 24 bits wide. The integer range is therefore given
from -16777216 to 16777215. Numeric values outside this range will be floating point.
39–
⋅
!WARNING
All mathematical calculations are done in floating point format. This implies
that for calculations of/with larger values the results may have limited accuracy. The user should be aware of this when developing the motion control
application.
PositioningFor positioning, the Unit will round up if the fractional encod er edge distance
calculated exceeds 0.9. Otherwise the fractional value will be rounded down.
Floating point comparisonThe comparison functions considers small difference between values as
equal to avoid unexpected comparison results. Therefore any two values for
which the difference is less than are considered equal.
1.19 10
6–
⋅
PrecedenceThe precedence of the operators is given below:
Unary Minus, NOT
^
/ *
MOD
+ = <> > >= <= <
AND OR XOR
Left to Right
The best way to ensure the precedence of various operators is through the
use of parentheses.
4-3Moti on Control Application
Initialisation
For setting up a motion application with the MC Unit, the following parameters
need to be considered.
ParameterDescription
WDOGThe WDOG parameter contai ns the software switch used to con-
trol the enable rel ay contact, whi ch enables all drivers.
SERVOThe SERV O parameter determines whether the base axis runs
under servo control (ON) or open loop (OFF). When in open loop
the output speed reference voltage is determined by the DAC
parameter.
DACThe DAC paramet er contains the voltage value which is applied
directly to the Servo Driver when the base axis is in open loop.
P_GAINThe P_GAIN parameter contains the proportional gain for the
axis.
I_GAINThe I_GAIN parameter con tai ns the integral gain for the axis.
D_GAINThe D_GAIN parameter conta ins the derivative gain for the axis .
VFF_GAINThe VFF_GAIN par am eter contains the speed f eed forward gain
for the axis.
OV_GAINThe OV_GAIN parameter contains the output speed gai n for the
axis.
61
Motion Control ApplicationSection 4-3
In the following example a simple motion application including ini tialisation for
a single axis is shown.
Every task on the MC Unit has a set of buffers that holds the information from
the motion commands given. The motion com mands include MOVE, MOVEABS, MOVEMODIFY, MOVECIRC, MHELICAL, FORWARD, REVERSE,
MOVELINK, CONNECT, CAM and CA MBOX. Refer to 5-2-1 Motion ControlCommands for details on specific commands.
Motion GeneratorThe motion generator, a background process that prepares and runs moves,
has a set of two motion buffers for each axis. One buffer holds the Actual
Move, which is the move currently executing on the axis. The MTYPE axis
parameter contains the identity number of this move. For example the MTYPE
will have value 10 if currently the FORWARD move is executed. The other
buffer holds the Next Move, which is executed after the Actual Move has finished. The NTYPE axis parameter contains the identity number of this next
move.
The BASIC programs are separate from the motion generator program, which
controls moves for the axes. The motion generator h as separat e func tions for
each axis, so each axis is capable of being programmed w ith its own axis
parameters (for example speed, acceleration) and moving independently and
simultaneously or they can be linked together using special commands.
When a move command is processed, the motion generator waits until the
move buffers for the required axes are empty and then loads these buffers
with the move information.
Note If the task buffers are full, the program execution is paused until buffers are
available again. This also applies to the command line task and no commands can be given for that period. Motion Perfect will disconnect in such a
62
Motion Control ApplicationSection 4-3
case. The PMOVE task parameter will be set t o TRUE when the task buffers
are full and will be reset to FALS E when the task buffers are available again.
Task buffers
Task 1
MOVECI RC(..) AXIS (0)
FORWAR D AXIS(1)
Task 2
Task 3
Task 4
MOVE(. .) AXIS(0)
Task 5
Move buffers
Axis012..7
Next Move (NTYPE)MOVE (1)FORWARD (10) IDLE (0).. IDLE (0)
Actual Move (MTYPE) MOVECIRC (4) MOVECIRC (4) IDLE (0).. IDLE (0)
SequencingOn each servo interrupt every millisecond (see 4-5-3 Program Execution), the
motion generator examines the NTYPE buffers to see if any of them are available. If there are any available then it checks the task buffers to see if there is
a move waiting to be loaded. If a move can be loaded, then the data for all the
specified axes is loaded from the ta sk buffers into the NTYP E buffers and the
corresponding task buffers are marked as idle. This process is called
sequencing.
Motion
Generator
Sequencing
Move
Loading
Move LoadingOnce sequencing has been completed, the MTYPE buffers are checked to
see if any moves can be loaded. If the required MTYPE buffers are available,
then the move is loaded from the NTYPE buffers to the MTYPE buffers and
the NTYPE buffers are marked as idle. This process is called move loading.
If there is a valid move in the MTYPE buffers, then it is processed. When the
move has been completed, the MTYPE buffers are marked as idle.
Accessing I/O
The MC Unit has three different types of I/O. These are the physical I/O, the
driver I/O and the virtual I/O. The inputs and outputs are accessi ble by using
the IN and OP commands in BASIC and within Motion Perfect using the I/O
status window. Refer to 5-3-83 IN, 5-3-115 OP and 6-6-6 I/O St atus W indow
for further details.
63
Motion Control ApplicationSection 4-3
The different types of inputs are explained here.
Input typeRange
(amount)
Physical0 - 15 (16) The physical inputs are freely allocable to the dif-
ferent functions. Some of the functions are origin
search, limit switches, jog inputs and so on. The
MC Unit uses axis parameters to allocate a certain
function to an input.
The first four inputs R0 to R3 are used as registration inputs for axis 0 to 3. These inputs can also be
used for any other purpose.
The relat ed BASIC command and axi s par amete rs
are
REGISTRegistr ation Command
DATUM_INSelection of origin switch input
FAST_JOGSelection of fast jog input
FHOLD_INSelection of feedhold input
FWD_INSelection of forward limit input
FWD_JOGSelection of forward jog input
REV_INSelection of reverse limit input
REV_JOGSelection of reverse jog input
Driver16 - 19 (4) The four driver inputs nr. 16 to 19 correspond to
the four alarm inputs from the drivers of axis 0 to 3.
Virtual20 - 31
(12)
The virtual inputs are only present inside the MC
Unit and are used for computational purposes only.
The virtual inputs and outputs are bi-directional.
The inputs are controlled by the outputs. All functions which can be used on physical inputs can
also by these used for these virtu al inputs.
Description
The different types of outputs are explained here.
Output
type
Physical8 - 15 (8)The physical outputs are freely allocable to any
Driver16 (1)The single driver output is the driver alarm reset for
Virtual20 - 31
Range
(amount)
(12)
Description
user defined functions. An output can be set and
reset depending on the current axis position by
using the command PSWITCH.
Note that the physical output connections O0 to O7
are corresponding to the internal outputs 8 to 15.
all drivers.
The v irtual outputs are onl y present i nside the M C
Unit and are used for computational purposes only.
The virtual inputs and outputs are bi-directional.
The inputs are controlled by the outputs.
64
Command Line InterfaceSection 4-4
4-4Command Line Inter face
The Command Line Interface provides a direct interface for the user to give
commands and access parameters on the system. There are two options to
use the command line interface:
• Use the Terminal Window within Motion Perfect and the MC Unit connected. See SECTION 6 Programming Environment for details.
• Use a VT100 Terminal to co nnect to the MC Unit. This is s imilar to using
the Terminal Window within Motion Perfect when the MC Unit is disconnected.
The MC Unit puts the last 10 commands given on the command line in a
buffer. Pressing the Up and Down Cur sor Key will cycle through the buffer to
execute the command again.
4-5BASIC Programs
The MC Unit can store up to 14 programs in memory, provided the capacity of
memory is not exceeded. The MC Unit suppor ts simple file-handling instruc tions for managing these program files rather like the DOS filing system on a
computer.
The Motion Perfect software package is used to store and load programs to
and from a computer for archiving, printing and editing. It also has several
controller monitor and debugging facilities. Refer to SECTION 6 ProgrammingEnvironment for details on Motion P erf ect .
4-5-1Managing Programs
Motion Perfect automatically creates a project which contains the programs to
be used for an application. The programs of the project are kept both in the
controller as on the computer. Whenever a program is created or edited,
Motion Perfect edits both copies in order to always have an accurate backup
outside the controller at any time. Motion Perfect checks that the two versions
of the project are ide ntical using a cyclic redundancy check. If the two dif fer,
Motion Perf ect allows copyi ng the MC Unit version to disk or vice versa.
Programs on the computer are stored in ASCII text files. They may therefore
be printed, edited and copied using a simple text editor. The source programs
are held in the MC Unit in a tokenised form and as a result, the sizes of the
programs will be less on the MC Unit com pared t o the s am e program s on t he
computer.
Stor ing ProgramsPrograms on the MC Unit are held in battery-backed RAM or flash EPROM
when power is turned OFF. At start-up before operation either the programs
present in RAM are us ed or the program s in flas h EPROM w ill be cop ied first
to RAM. These two options are selectable by using the POWER_UP system
parameter.
The current programs in RAM can be copied to flash EPROM by using t he
EPROM command. Both the POWER_UP parameter as the EPROM command are also provided by Motion Perfect with buttons on the control panel
and commands under the Program and Controller menus.
Note After development of the application programs, be sure to save the data in
flash memory within the MC Unit. The data will remain in the S-RAM during
operation and power down, but considering possible battery failure it is
advised to store the data in flash memory .
65
BASIC ProgramsSection 4-5
Program CommandsThe M C Uni t has a number of BASIC comm ands to al low cr eation, m anipu la-
tion and deletion of programs. Motion Perfect provides buttons which also
perform these operations.
CommandFunction
SELECTSelects a program for editing, deleting etc.
NEWDeletes the current selected program, a specified
program or all programs.
DIRLists the directory of all programs.
COPYDuplicates a specified program.
RENAMERenames a specified program.
DELDeletes the current selected program or a specified
program.
LISTLists the current selected program or a specified
program.
4-5-2Program C omp ila tio n
The MC Unit system compiles programs automatically when required. It is not
normally required to force the MC Unit to compile programs, but programs
can be compiled under the Program Menu in Motion Perfect.
The MC Unit automatically compiles programs at the following times.
• The selected program is compiled before it is executed if it has been
edited.
• The selected program is compiled if it has been edited before switching
the selected program to another program.
• The selected program is compiled by using the COMPILE command.
The program syntax and structure are checked during compilation. If compilation is unsuccessful, a message will be p rovided and no program cod e will be
generated. A red cross will appear in the Motion Perfect directory box.
Programs cannot be run whe n comp ilation errors o ccur. The errors should be
corrected and the program recompiled.
The compilation process also includes the following:
• Removing comments.
• Compiling numbers into the internal processor format.
• Converting expressions into reverse Polish Notation format for execution.
• Precalculating variable locations.
• Calculating and embedding loop structure destinations.
4-5-3Progra m Execu tio n
The timing of the execution for the different tasks and the refreshing of the I/O
of the Unit revolves around the servo period of the system. For the MC Unit
the servo period is set to 1 m s. The servo period is not synchronised with the
PC scan time.
I/O RefreshThe I/O st atus of the MC Unit is refresh ed at the beginning of every ser vo
cycle.
• The captured status of the digital inputs is transferred to the IN system
input variable. Note that this is the status captured in the previous ser vo
cycle.
• The analogue outputs for the speed references are updated.
• The digital outputs are upda ted conform the s t atus of the OP sy stem out -
put variable.
• The status of the digital inputs is captured.
66
BASIC ProgramsSection 4-5
Note that no automatic processing of the I/O signals is taking place, except for
registration. This implies that all actions must be programmed in the BASIC
programs.
Program TasksThis servo period is split into three equal segments. These three slots are
partly taken up by respectively servo control, the background communications
and the basic house keeping tasks. The rema ining period in ea ch of the time
slots is available for the BASIC tasks.
The multi-tasking executive operates as follows. There are 6 tasks available
for execution. Tasks 1 to 5 are user tasks, which are used to run BASIC programs simultaneously, one program p er t ask. E ach program can be al located
to a specific task or priority, which implies more or less execution time (see
Program Execution Priority below). It is important to know that the BASIC program execution is not synchronised with the servo cycle. The command line
always uses the system task 0. This task is used for the raw terminal communications and Motion Perfect communications.
Relevant commandsMotion Perfect provides several ways of executing, pausing and stopping the
programs using buttons on the control panel and the editing windows. The following commands can be given on the command line to control t he execution.
CommandFunction
RUNRun the current selected program or a specified pro-
gram, optionally on a specified task number.
STOPStop the current selected program or a specified
program.
HALTStop all programs on the system
PROCESSDisplays all running tasks.
Setting Prog ram s to R un
at Start-up
Program Exec utio n
Priority
The user can explicitly allocate the task priority on which th e BASIC program
is expected to run. When a user program is run without explicit task allocation,
it is assigned the highest available task priority. Tasks 5 and 4 have high priority and tasks 3,2 and 1 have low priority.
Programs can be set to run automatically at different priorities when power is
turned ON. If required , the computer can be left connected as an operator
interface or may be removed and the programs run “stand-alone”.
Programs are set in Motion Perfect to run automatically at star t-up using the
Set Power Up Mode… selection under the Program Menu. This operation
sets which program to run automatically and at which priority. This can also
be accomplished by the RUNTYPE parameter. The current status can be
seen with the DIR command.
The programs given task no. 5 and 4 have high priority and programs given
task 3, 2 and 1 have low prior ity. Task 0, which is t he com m and line task, has
also low priority. When both high and low priority tasks are running , the high
priority tasks are divided over two slot and the low priority task are divided
over one slot. If all tasks have the same priority the tasks will be divided
equally over the three slots. Tasks with the same priority will be allocated to
the slots in such a way that over multiple servo period s that they will have
equal execution time.
The real-time executive operates in a round-robin schedule.
Example 2: Tasks 1, 2 & 3 and command line task 0 running
Servo Cycle (n)Servo Cycle (n+1)
Servo
Control
Task 0Task 1Task 2T ask 3Task 0Task 1
The real-time executive allocates the time slots to tasks 0, 1, 2 & 3 in turn.
Example 3: Tasks 1 & 4 and command line task 0 running
Servo
Control
Task 4Task 4Task 0Task 4Tas k 4T ask 1
The real-time executive invokes task 4 as a high priority task every servo
cycle. The remaining tasks fit in the remaining slot in turn.
Example 4: Tasks 1, 2, 4 & 5 and command line task 0 running
Servo
Control
Task 5Task 4Task 0Task 5Tas k 4T ask 1
House
Keeping
Ser vo C ycle (n)Ser vo C ycle (n+1)
House
Keeping
Ser vo C ycle (n)Ser vo C ycle (n+1)
House
Keeping
CommsServo
Control
CommsServo
Control
CommsServo
Control
House
Keeping
House
Keeping
House
Keeping
Comms
Comms
Comms
Servo
Control
Task 5Task 4Task 2
The real-time executive invokes task 5 and task 4 as a high priority tasks
every servo cycle. Note that the high priority tasks take up both high priority
slots. The remaining tasks fit in the remaining slot in turn. If task 3 was also
added to above scenario it will be executed in the third slot alongside tasks 0,
1 & 2.
4-6Error Processing
For the safety of the application it is very impor tant that proper safety measures are taken for the different problems which may occur in the system. For
safe operation at all times the user must make use of the several options to
check for these errors in both the MC Unit or in the PC Unit.
It is advisable to have the master control of the application within the PC Unit,
not the MC Unit. The PC Unit can monitor the status of the MC Unit and of the
other Units, manage emergen cy shut-downs for the application, control the
data flows from and to the MC Unit, and so on.
As for the MC Unit, the BASIC programming language provide the programmer with the freedom to i nc lude a lot of safety measures or not. This requires
a sensible solution, which covers all possible behaviour of the system.
This section will present the possible errors that may occur and suggest the
way to detect them. For a full description of the error handli ng refer to section
7-3 Error Handling and for the IR/CIO area description section 3-1-2 Overview
of IR/CIO Area Allocations.
Servo Cycle ( n+2)
House
Keeping
Comms
68
!Caution
The PC or MC Unit outputs may have undefined status due to deposits on or
burning of the output relays, or destruction of the output transistors. As a
counter-measure for such problems, external safety measures must be provided to ensure safety in the system.
Error ProcessingSection 4-6
BASIC ErrorsIf a BASIC error is ge nerated during the execution of a B ASIC command in
some task, the program will be halted immediately or the user can define a
specific error routine structur e to stop the system. The error routine can stop
the driver, put the digital I/O in a safe status and notify the PC Unit of the
error. Please refer to section 5-3-27 BASICERROR on the way to include an
error subro u tine in a BASIC progr a m. T he BASIC error is also in dica ted in the
PC’s IR/CIO area.
Motion E r rorIn case a motion error occurs, the MC Unit will disable the control of the driver
automatically. The user has the ability to decide for each axis which motion
errors will disable the driver by using the ERRORMASK parame ter (see section 5-3-61 ERRORMASK). After detection of the motion error the user is free
to program the necessar y counter measures for the other axes and t he complete system. The PC’s IR/CIO area also indicates the axis on which the error
has occurred and the type of error.
PC Interface ErrorIn c ase of an error in the P C transfer using IORD and IOWR instruction, t he
PC Interfac e E r ro r fl ag ( n+7 bit 07) in t he I R / C IO ar e a will be se t . Th is bit can
be checked in the PC program to deal with any unforeseen event for PC
transfers.
Please refer to Appendix C Programming Examples to find an example of
implementing the control of the application including error checking. Example
no. 12 shows a master program which is dedicated to the c ontrol of th e appl ication by running t he appropriate programs and is c ontinuously checking for
any error event which may occur. This program should be set to run at startup of the MC Unit. It is strongly recommended to use this program or a similar
program within every application.
69
SECTION 5
BASIC Motion Control Programming Language
This section de scri bes t he commands and param eters re quired for progra ming t he moti on cont rol appl icati on usi ng the MC
Unit. A ll BAS IC sy stem , t ask an d axi s st atem ents th at d eterm in e the var ious asp ec ts of p rogr am execu tion a nd M C Un it
operation are presented.
This section describes the notation used in describing command s, functions,
and parameters. The section n ame gives the nam e of t he com m and, f unction
or parameter. The descriptions within the section are divided into the following
parts. Individual par ts are omitted when they are not applicable.
Type:The classification is given for command, function or parameter.
Syntax:Standard BASI C nota tion is used to show command or function syntax.
Text that must be typed exactly as given is in typewriter font.
The names of arguments are given in italic font with underscores_f or_s pac es.
Replace these with the actual arguments.
Items in square brackets “[ ]” in the syntax notation are optional and can be
omitted. Repetition is denoted by “{ }” brackets. Items enclosed in these
brackets are repeated zero or more times.
Alternative:Any alternative form of a command, function or parameter is given.
Description:This field descri bes the pur pose an d application of the command, func tion or
parameter.
Precautions:Specific precautions related to programming are provided.
Arguments:The name of each a rgume nt is given in bold i talic font followed by a descr ip-
tion of the argument.
See also:In this field the related commands, functions and parameters are given.
Example:One or more application examples is given for most commands, functions,
and parameters.
5-2Classifications and Outlines
The table below describes the groups into which commands, functions, and
parameters are divided.
Groups
Motion Control Commands
I/O Commands and Functions
Loop and Conditional Structures
Program Commands and Funct ions
System Commands and Parameters
Mathematical Funct ions
Constants
Motion Perfect Commands and Parameters
Axis Parameters
Task Functions and Param eters
PC Data Exchange Commands
The rest of the tables in the following sections outline the commands, functions and parameters used for the MC Unit.
75
Classifications and OutlinesSection 5-2
5-2-1Motion Control Commands
The table below outlines the motion control commands. Refer to the specified
pages for details.
NameSyntaxDescriptionPage
ADDAXADDAX(axis) ADDAX sets a link to a superimposed axi s. All
demand position movements for the superimposed
axis will be added to any moves that are currently
being executed.
BASE is used to set the base axis to the axis specified with axis.
CAM moves an axis acc ording to values of a movement profile stored in the Table array.
CAMBOX mo ves an axis according to values of a
movement profile stored in the Table array. The
motion is linked to the measured motion of another
axis to form a continuously variab le software gearbox.
CANCEL cancels the move on an axis.95
CONNECT connects the demand position of an axis
to the measured movements of the axis specified for
driving_axis to produce an electronic gearbox.
to position an axis t o an absolute position or DATUM
reset following errors.
DEFPOS defines the cur rent position as a new absolute position.
FORWARD m oves an axis continuously for ward at
the speed set in the SPEED parameter.
MHELICAL performs an interpolate d helical mo ve by
moving 2 orthogonal ax es in a circular arc with a
simultaneous l inear move on a third ax is.
MOVE moves one or more axes at the demand
speed, acceleration and deceleration to the position
specified as increment from the current posit ion.
MOVEABS moves one or more axes at the demand
speed, acceleration and deceleration to the position
specified a s absol ute pos iti on, i.e ., in re fer enc e to t he
origin.
MOVECIRC interpolates 2 orthogonal axes in a circular arc.
MOVELINK creates a linear move on the base axis
linked via a software gearbox to the measured position of a link axis.
MOVEMODIFY chang es t he abs olute e nd posit ion of
the current single-axis linear mov e (MOVE or MOVEABS).
88
91
93
94
97
100
101
108
117
119
120
121
122
125
76
Classifications and OutlinesSection 5-2
NameSyntaxDescriptionPage
RAPIDSTOPRAPIDSTOP
RS
REVERSEREVERSEREVERSE moves an axis continuously in reverse at
RAPIDSTOP cancels the current move on all axes.137
142
the speed set in the SPEED parameter.
5-2-2I/O Commands and Functions
The table below outlines the I/O commands and f unctions. Refer to the specified pages for details.
NameSyntaxDescriptionPage
GETGET#n, variableGET waits for the arrival of a singl e character and
ININ(input_number
[,final_input_number])
INPUTINPUT#n, vari able{, .. .. .}INPUT waits for a string to be received and assigns
KEYKEY#nKEY returns TRUE/FALSE depending on character
LINPUTLINPUT#n, vr_variableLINPUT waits for a string and puts it in VR variables. 115
OPOP(output_number,value)
assigns the ASCII code of the character to variable.
IN returns the value of di gital inputs.112
the nu m eric a l value to variable.
received.
OP sets one or more outputs or re turns t he state of
the fi r st 24 output s.
PRINT outputs a series of characters to a serial port. 134
PSWITCH turns ON an output when a predefined
position is reac hed, a nd t urns OFF t he output when a
second position is reached.
tion input or the Z mark on the encoder is det ected.
SETCOM sets the serial communi cations. 146
109
113
114
128
136
138
5-2-3Loop and Conditional Structures
The table below outlines the loop and conditional structure comm ands. Refer
to the specified pages for details.
NameSyntaxDescriptionPage
FOR TO STEP
NEXT
GOSUB RETURNGOSUB label ... RETURNGOSUB jumps to a subroutine at the li ne just after
GOTOGOTO labelGOT O jum ps to t he line containing the label.110
IF THEN ELSE
ENDIF
ON GOSUB or
GOTO
FOR variable= startTO end [STEP
increment]
<commands>
NEXT variable
IF condition THEN
<commands>
[ELSE
<commands>]
ENDIF
IF condition THEN <commands>
ON expression GOSUB label{, label}
ON expression GOTO label{,label}
FOR ... NEXT loop allows a program segment to be
repeated with increasing/decreasing variable.
label. The program execut ion returns to the next
instruction after a RETURN is given.
IF controls the flo w of t he program base on the
results of the condition.
ON GOSUB or ON GOTO enables a conditional
jump to one of several labels.
107
110
111
127
77
Classifications and OutlinesSection 5-2
NameSyntaxDescriptionPage
REPEAT UNTILREPEAT
<commands>
UNTIL condition
WHIL E WENDWHILE condition
<commands>
WEND
The REPEAT ... UNTIL loop allo ws the program segment to be repeated until the condition becomes
TRUE.
The WHILE ... WEND loop allows the program segment to be repeated until the condition becomes
FALSE.
141
155
5-2-4Program Commands and Functions
The table below outlines commands used for general programming purposes.
Refer to the specified pages for details.
NameSyntaxDescriptionPage
Statement separator <statement>:<statement>The statement separator enables more stat em ents
Comment field‘ [<Comment field>]The single quot e enables a line not to be executed.87
AUTORUNAUTORUNA UTORUN starts all the programs that have been
COMPILECOMPILECOMPILE compiles the current program.97
COPYCOPY “program_name”
“new_program_name”
DELDEL [“program_name”]
RM [“program_name”]
DIRDIRDIR displays a list of the programs held in memory,
EDITEDIT[line_number]
ED[line_number]
EPROMEPROMEPROM stores the BASIC programs in the MC Unit
FREEFREEFREE returns the amount of avai lable memory. 109
HALTHALTHALT stops execution of all programs currently run-
LISTLISTLIST prints the lines of a program.115
NEWNEWNEW deletes all the program lines i n MC Unit mem-
PROCESSPROCESSPROCESS returns the running status and task num-
RENAMERENAME “old_program_name“
“new_program_name“
RUN RUN [“program_name“
[,task_number]]
RUNTYPERUNTYPE “program_name“,
auto_run[,step_number]
SELECTSELECT “program_name“SELECT specif ies the current program.145
STEPLINESTEPLINE [“program_name”
[, task_number]]
STOPSTOP [“program_name”
[, task_number]
TROFFTROFF [“program_name”]TROFF suspends a trace at the current line and
TRONTRONTRON creates a breakpoi nt in a program.150
on one line.
set to run at start-up.
COPY copies an existing program in memory to a
new program.
DEL deletes a program from memo ry.102
their size and their RUNTYPE.
EDIT allows a progr am to be modifi ed using a VT10 0
Terminal.
in the flash EPROM.
ning.
ory.
ber for each current task.
RENAME changes the nam e of a program in the MC
Unit directory.
RUN ex ecutes a program.142
RUNTYPE determines if a pr ogram i s run at start-up,
and which task it is to run on.
STEPLINE executes a single line in a program.148
STOP halts program execution.148
resumes normal program execution.
87
90
98
103
104
104
111
126
136
140
143
150
5-2-5System Commands and Parameters
The table below outlines the system com ma nds and parameters. Refer to the
specified pages for details.
78
Classifications and OutlinesSection 5-2
NameSyntaxDescriptionPage
AXISAXIS(axis_number)AXIS sets the axis for a command, axis parameter
read, or assignment to a particular axis.
BASICERRORBASICERRORUsed to run a routine when an error occurs in a a
BASIC command.
BATTERY_LOWBATTERY_LOWBATTERY_LOW returns the status of the battery.93
CHECKSUMCHECKSUMCHECKSUM contains the checksum for the RAM.96
CLEARCLEARCLEAR clears all global variables and the local vari-
CLEAR_BITCLEAR_BIT(bit_number,
vr_number)
COMMSERRORCOMMSERRORCOMMSERROR contains all th e comm unications
CONTROLCONTROLCONTROL contains the type of MC Unit in the sys-
DISPLAYDISPLAYDISPLAY contains a code indicating the application
ERROR_AXISERROR_AXISERROR_AXIS contains t he n umber of the axi s whic h
INITIALISEINITIALISEINITIALISE set all axis paramet ers to their defaul t
LAST_AXISLAST_AXISLAST_AXIS contains the num ber of the last axis pro-
LOCKLOCK(code)
UNLOCK(code)
MOTION_ERRORMOTION_ERRORMOTION_ERROR contains an error fl ag for axis
NIONIONIO contains the number of inputs and outputs con-
PLC_TYPEPLC_TYPEPLC_TYPE contains the PC CPU Unit model that the
POWER_UPPOWER_UPPOWER_UP contains the locati on of programs to be
READ_BITREAD_BIT(bit_number,
vr_number)
RESETRESETRESET resets all local variables on a task.141
SET_BITSET_BIT(bit_number,
vr_number)
TABLETABLE(address, value{, value})
TABLE(address)
TSIZETSIZETSIZE returns the size of the currently defined table. 151
VERSIONVERSIONVERSION returns the version number of the BASIC
VRVR(expression)VR calls the value of or assigns a value to a global
WAWA(time)WA holds program ex ecution for the num ber of milli-
WAIT IDLEWAIT IDLEWAI T IDLE suspends progr am execution until the
WAIT LOADEDW AI T LO ADEDWAIT LOADED suspends program execution until
ables on the current task.
CLEAR_BIT clears the specif ied bit of the specified
VR variable.
errors that have occurred since the last time that it
was initia lis e d .
tem.
of the bank of 8 indicator s on the front panel of the
MC Unit.
caused the enable WDOG relay to open when a fol-
lowing error exceeded its limit.
values
cessed by the system.
LOCK prev ents the programs fro m being vi ewed or
modified.
motion errors.
nected to the syste m.
MC402-E is connected to on t he backplane.
used at start-up.
READ_BIT returns the value of the specified bit in
the specified VR variable.
SET_BIT command sets the specifi ed bit in the s pec-
ified VR variable to one.
TABLE loads and reads data to the Table array.148
language installed in the MC Unit.
numbered variable.
seconds specifi ed.
base axis has finished execut ing its current move
and any buffered move.
the base axis has no moves buffered ahead other
than the currently executing move.
90
92
96
96
97
98
103
104
113
114
116
118
126
132
134
138
146
152
152
153
154
154
79
Classifications and OutlinesSection 5-2
WAIT UNTILWAIT UN TI L conditionWAIT UNTIL repeatedly evaluat es the condition unt il
TRUE.
WDOGWDOGWDOG contains a software switch use d to control
the enable relay contact used to enable all drivers.
154
155
5-2-6Mathematical and Logical Fun ctions
The table below outlines the mathematical and logical functions. Refer to the
specified pages for details.
NameSyntaxDescriptionPage
Multiply: *expression_1 * expression_2* m ultiplies an y two valid expressions.84
Power: ^expression_1 ^ expression_2^ takes the power of an y two valid expressions84
Add: +expression_1 + expression_2+ adds any two valid e xpressions.84
Subtract: –expression_1 - expression_2– subtracts any two vali d expressions.85
Divide: /expression_1 / expression_2/ divides any two valid expres sions. 85
Is Less Than: <expression_1 < expression_2< returns TRUE if expression_1 is less than
Is Less Than Or
Equal To: <=
Is Not Equal To: <>expression_1 <> expression_2<> returns TRUE if expression_1 is not equal to
Is Equal To: =expression_1 = expression_2= returns TRUE if expression_1 is equal to
Is Greater Than: >expression_1 > expression_2> returns TRUE if expression_1 is greater than
Is Greater Than or
Equal To: >=
ABSABS(expression)ABS returns the absolute value of expression.87
ACOSACOS(expression)ACOS returns the arc-cosine of expression.87
ANDexpression_1ANDexpression_2AND performs an AND operation on corresponding
ASINASIN(expression)ASIN returns the arc-sine of expression.89
ATANATAN(expression)ATAN returns the arc-tangent of expression.89
ATAN2ATAN2(expression_1,
COSCOS(expression)COS returns the cosine of expression.98
EXPEXP(expression)EXP returns the exponential value of expression.105
FRACFRAC(expression)FRAC returns the fractional part of expression.108
INTINT(expression)INT returns the integer part of expression.113
LNLN(expression)LN returns the natural logarithm of expression.116
MODexpression_1 MOD expression_2MOD returns the expression_2 modulus of an
NOTNOT(expression)NOT performs an NOT operation on corres ponding
ORexpression_1 OR expression_2OR performs an OR operation between correspond-
SGNSGN(expression)SGN returns the sign of expression.146
SINSIN(expression)SIN returns the sine of expression.147
SQRSQR(expression)SQR returns the square root of expression. 147
TANTAN(expression)TAN returns the tangent of expression.149
XORexpression_1 XOR expression_2XOR performs an XOR function between corre-
expression_1 <= expression_2<= returns TR UE if expression_1 is less than or
expression_1 >= expression_2>= returns TR UE if expression_1 is greater than or
expression_2)
expression_2, otherwise FALSE.
equal to expression_2, otherwise FALSE.
expression_2, otherwise FALSE.
expression_2, otherwise FALSE.
expression_2, otherwise FALSE.
equal to expression_2, otherwise FALSE.
bits of the integer parts of two valid BASIC expres-
sions.
ATAN2 returns the arc-tangent of the ratio
expression_1/ expression_2.
expression_1.
bits of the integer part of the e xpression.
ing bits of the integer parts of two valid BASIC
expressions.
sponding bits of the integer parts of two valid BASIC
expressions.
85
85
86
86
86
86
88
89
118
126
129
156
80
Classifications and OutlinesSection 5-2
5-2-7Constants
The table below outlines the constants. Refer to the specified pages for
details.
NameDescriptionPage
FALSEFALSE returns the numerical value 0.106
OFFOFF returns the numerical value 0.127
ONON returns the numerical value 1.127
PIPI returns the numerical value 3.1416.130
TRUETRUE returns the num eri cal value -1.151
5-2-8Motion P erfect Commands, Functions and Parameters
The table below outlines the Motion Perfect commands, functions, and
parameters. Refer to the specified pages for details.
NameSyntaxDescriptionPage
SCOPESCOPE(ON/OFF_control, period,
table_start, table_stop, P0[, P1
[, P2[, P3]]])
SCOPE_POSSCOPE_POSSCOPE_POS contains the current Table position at
TRIGGERTRIGGERTRIGGER starts a previous ly set SCOPE command. 150
SCOPE programs the system to automatically store
up to 4 parameters every sample period.
which the SCOPE command is currently storing i ts
first parameter.
144
145
5-2-9Axis Parameters
The table below outlines the axis parameters. Refer to the specified pages for
details.
ACCELACCEL contains the axis acceler ation rate. The rat e
ATYPEATYPE contains the axi s type.90
AXISSTATUSAXISSTATUS contains the axis status.91
CLOSE_WINCLOSE_WIN defines the end of the window in which
CREEPCREEP contains the creep speed on the current
D_GAIND_GAIN contains the derivative gain for the axis.99
DACDAC contains a voltage appl ied directly to a servo
DAC_OUTDAC_OUT contains the voltage being applied to the
DATUM_INDATUM_IN contains the input number to be used as
DECELDECEL contains the axis deceleration rate in
DEMAND_EDGESDEMAND_EDGES contains the current value of the
DPOS DPOS contains the demand position, in user units,
ENCODER ENCODER contains a raw copy of the encoder or
ENDMOVEENDMOVE holds the position of the end of the cur-
NameDescriptionPage
is in units/s
a registration mark is expected.
base axis.
axis.
servo.
the origin input. The numbe r can be between 0 and
15.
units/s
DPOS axis parameter in edge units.
generated by the move commands.
resolver har dware register.
rent mov e in user units.
2
.
2
.
87
96
99
99
100
101
101
102
103
104
104
81
Classifications and OutlinesSection 5-2
NameDescriptionPage
ERRORMASKERRORMASK contains a mask value that is ANDed
bit by bit with the AXISSTA TUS axis parameter on
every servo cycle to determine if a runtime error
should turn OFF the enable (WDOG) relay.
F AST_JO GFAST_JOG contains the input num ber to be used as
the fast jog input . The numbe r can be between 0 and
15.
FEFE is the position error in use r uni ts, and is equal to
the demand position in the DPOS axis parameter
minus the measured position in the MPOS axis
parameter.
FE_LIMITFE_LIMIT contai ns the maximum allowable following
error in user units.
FE_RANGEFE_RANGE contains the following error report
range.
FHOLD_INFHOLD_IN contains the input number to be used as
the feedhold input. The number can be between 0
and 31.
FHSPEEDFHSPEED contains the feedhold speed.107
FS_LIMITFS_LIMIT contains t he absolute position of the for-
ward software limit in user units.
FWD_INFWD_IN contains the input number to be used as a
forward limit input. The number can be between 0
and 31.
FWD_JOGFW D_JOG contains the input number to be used as
a jog forwar d input. The number can be between 0
and 31.
I_GAINI_GAIN contains the integral gain.111
JOGSPEEDJOGSPEED sets the slow jog speed in us er units for
an axis to run at when performing a slow jog.
MARKMARK contains TRUE when a registrati on event has
occurred to indicate that the value in the REG_POS
axis parameter is valid.
MERGEMERGE is a software switch that can be used to
enable or disable the merging of consecutive moves.
MPOSMPOS is the position of the axis in user units as
measured by the encoder or resolver.
MSPEEDMSPEED represents the change in the measured
position in user units/s in the last servo period.
MTYPE MTYPE contains the type of move currently being
executed.
NTYPE NTYPE contains the type of the move in the Next
Move buffer.
OFFPOS OFFPOS contains an offset tha t wil l be ap plied to the
demand position without affecti ng the move in any
other way.
OPEN_WINOPEN_WIN defines the positions fo r the REGIST
command.
OUTLIMITOUTLIMIT contai ns an output limit that restric ts the
voltage outp ut f rom the MC Unit.
OV_GAINOV_GAIN contains the output velocity gain.130
P_GAINP_GAIN contains the proportiona l gai n.130
PP_STEPPP_STEP contains an integer value that scale s the
incoming raw encoder count.
REG_POSREG_POS stores the position in user units at which
a registration event occurred.
105
106
106
106
106
106
109
109
109
114
116
116
125
125
125
127
127
129
130
134
138
82
Classifications and OutlinesSection 5-2
NameDescriptionPage
REMAIN REMAIN is the distance remaining t o the end of the
current move.
REP_DISTREP_DIST contai ns the repeat dist ance , whi ch is the
allowable range of movement for an axis before the
demand position and measured position are corrected.
REP_OPTIONREP_OPTION controls the application of the
REP_DIST axis parameter.
REV_INREV_IN contains the in put number to be used as a
reverse limit input. The number can be between 0
and 31.
REV_JOGREV_JOG contains t he inpu t number t o b e used a s a
jog reverse input. The input can be between 0 and
31.
RS_LIMITRS_LIMIT contains the absolute posi ti on of the
reverse software limit in user units.
SERVOSERVO determines whether the axi s runs under
servo control or open loop.
SPEEDSPEED contains the demand speed in units/s.147
SRAMPSRAMP contains the S-curve factor.147
UNITSUNITS contains the unit con version factor.151
VFF_GAINVFF_GAIN contains the speed feed forward gain.152
VP_SPEEDVP_SPEED contains the speed profile speed in user
units/s.
139
140
140
142
142
142
145
152
5-2-10Task Commands and Parameters
The table below outlines the task commands and parameters. Refer to the
specified pages for details.
NameDescriptionPage
ERROR_LINEERROR_LINE contains the number of t he line which
caused the last BASIC progr am err or.
PMOVEPMOVE will contain 1 if the task buff ers are occu-
pied, and 0 if they are empty.
PROCPROC allows a process parameter from a particular
process to be read or set.
PROCNUMBERPROCNUMBER contains the number of the task in
which the currently selected program is running.
RUN_ERRORRUN_ERROR contains the number of the last
TICKSTICKS contains the current count of the tas k clock
BASIC error that occurr ed on the specified task.
pulses.
5-2-11PC Data Exchange Commands
The table below outlines the PC Data Exchange Commands. Refer to the
specified pages for details.
NameSyntaxDescriptionPage
PLC_READPLC_READ(PC_area,offset,
length,vr_number)
PLC_WRITEPLC_WRITE(PC_Area,offset,
length,vr_number)
PLC_READ requests a data transfer from the CPU
Unit of the PC to the MC Unit at the end of the next
CPU Unit execution cycle.
PLC_WRITE requests a data transfer from the MC
Unit to the CPU Unit of the PC at the end of the next
CPU Unit execution cycle.
105
133
136
136
143
150
131
132
83
Command, function and parameter descriptionSection 5-3
5-3Command, function and parameter description
This section describes the comman ds, functions and parameters which are
used in the BASIC programming language.
!WARNING
5-3-1Multiply: *
Type:Arithmetic Operation
Syntax:expression_1 * expression_2
Description:The multiply operator “*” multiplies any two valid expressions.
Arguments:
Example:factor = 10*(2.1+9)
5-3-2Power: ^
Type:Arithmetic Operation
Syntax:expression_1 ^ expression_2
Description:The power operator “^” raises expression_1 to the power of expression_2.
It is the responsibility of the programmer to ensure that the motion functions are invoked correctly, with the correct number of parameters and
values. Failure to do so may result in unexpected behavior, loss or damage to the machinery.
expression_1
Any valid BASIC expression.
expression_2
Any valid BASIC expression.
The parentheses are evaluated first, and then the result, 11.1, is multiplied by
10. Therefore, factor would contain the value 111
!WARNING
Arguments:expression_1
Example:thirtytwo = 2^5
5-3-3Add: +
Type:Arithmetic Operation
Syntax:expression_1 + expression_2
Description:The add operator “+” adds any two valid expressions.
Arguments:expression_1
Example:result = 10+(2.1*9)
This operation uses floating poin t algorithms and may give small deviations
for integer calculations.
Any valid BASIC expression.
expression_2
Any valid BASIC expression.
This sets the variable thirtytwo to 32.
Any valid BASIC expression.
expression_2
Any valid BASIC expression.
The parentheses are evaluated first, and the result, 18.9, is added to 10.
Therefore, result would contain the value 28.9.
84
Command, function and parameter descriptionSection 5-3
5-3-4Subtract: –
Type:Arithmetic Operation
Syntax:expression_1 - expre ssion_2
Description:The subtract operator “–” subtracts any two valid expressions.
Arguments:expression_1
Any valid BASIC expression.
expression_2
Any valid BASIC expression.
Example:VR(0) = 10-(2.1*9)
The parentheses are evaluated first, and the result, 18.9, is subtracted from
10. Therefore, VR(0) would contain the value –8.9.
5-3-5Divide: /
Type:Arithmetic Operation
Syntax:expression_1 / expression_2
Description:The divide operator “/” divides any two valid expressions.
Arguments:expression_1
Any valid BASIC expression.
expression_2
Any valid BASIC expression.
Example:a = 10/(2.1+9)
The parentheses are evaluated first, and then 10 is divided by the result, 11.1.
Therefore, a would contain the value 0.9009
5-3-6Is Less Th an : <
Type:Logical Operation
Syntax:expression_1 < expression_2
Description:The less than operator “<“ returns TRUE if expression_1 is less than
expression_2, otherwise it returns FALSE.
Arguments:expression_1
Any valid BASIC expression.
expression_2
Any valid BASIC expression.
Example:IF VR(1) < 10 THEN GOSUB rollup
If the value returned from VR(1) is less than 10, then subroutine ”rollup” would
be executed.
5-3-7Is Less Than Or Equal To: <=
Type:Logical Operation
Syntax:expression_1 <= expression_2
Description:The less than or equal to operator “<=” returns TRUE if expression_1 is less
than or equal to expression_2, otherwise it return s FALSE.
Arguments:expression_1
Any valid BASIC expression.
expression_2
Any valid BASIC expression.
Example:maybe = 1 <= 0
85
Command, function and parameter descriptionSection 5-3
In the above line, 1 is not less than or equal to 0 and, therefore, variable
maybe would contain the value 0 (FALSE).
5-3-8Is Not Equal To: <>
Type:Logical Operation
Syntax:expression_1 <> express ion_2
Description:The not equal to operator “<>” retur ns TRUE if expression_1 is not equal to
expression_2, otherwise it returns FALSE.
Arguments:expression_1
Any valid BASIC expression.
expression_2
Any valid BASIC expression.
Example:IF MTYPE <> 0 THEN GOTO 3000
If the base axis is not idle (MTYPE=0 indicates an axis idle), then a jump
would be made to label 3000.
5-3-9Is Equal To: =
Type:Logical Operation
Syntax:expression_1 = expression_2
Description:The equal to operator “=” returns TRUE if expression_1 is equal to
expression_2, otherwise it returns FALSE.
Arguments:expression_1
Any valid BASIC expression.
expression_2
Any valid BASIC expression.
Example:IF IN(7) = ON THEN GOTO label
If input 7 is ON, then program execution will continue at line starting “label:”.
5-3-10Is Greater Than: >
Type:Logical Operation
Syntax:expression_1 > expression_2
Description:The greater than op erator “>” returns TRUE if expression_1 is g reate r than
expression_2, otherwise it returns FALSE.
Arguments:expression_1
Any valid BASIC expression.
expression_2
Any valid BASIC expression.
Examples:Exam ple 1
VR(0) = 1 > 0
In the above line, 1 is greater than 0 and, therefore, VR(0) would contain the
value –1
Example 2
WAIT UNTIL MPOS > 200
Program execution w ill wai t un t il th e mea s ur e d p os it io n is greater th an 20 0.
5-3-11Is Greater Than or Equal To: >=
Type:Logical Operation
Syntax:expression_1 >= express ion_2
86
Command, function and parameter descriptionSection 5-3
Description:The greater than or equ al to operator “>=” returns TRUE if expression_1 is
greater than or equal to expression_2, otherwise it returns FALSE.
Arguments:expression_1
Any valid BASIC expression.
expression_2
Any valid BASIC expression.
Example:IF target >= 120 THEN MOVEABS(0)
If the variable target holds a value greater than or equal to 120, then the base
axis will move to an absolute position of 0.
5-3-12Statement separator: “:”
Type:Program comma n d
Syntax:<statement>:<statement>
Description:The statement separator, represented by the colon “:”, can be used to s epa-
rate BASIC statements on a multi-statement line. This separator can be used
both on the command line as in programs.
Example:PRINT "THIS LINE": GET low : PRINT "DOES THREE THINGS"
5-3-13Comment field: ‘
Type:Program comma n d
Syntax:‘ [<Comment field >]
Description:The single quot e “ ‘ “ can be used in a program to m ark a line as b eing com-
Example:‘ This line will not be printed.
5-3-14ABS
Type:Ma thematical Fu nc tion
Syntax:ABS(expression)
Description:ABS converts a negative number into its positive equal. Positive numbers are
Arguments:expression
Example:IF ABS(VR(0)) > 100 THEN PRINT "VR(0) Outside ±100"
5-3-15ACCEL
Type:Axis paramete r
Description:ACCEL contains the axis acceleration rate. The rate is in units/s
See also:AXIS, DECEL, UNITS
ment which will not be executed. The single quote can be put at the beginning
of a line or after any valid statement.
Command, function and parameter descriptionSection 5-3
Syntax:ACOS(expression)
Description:ACOS returns th e arc-cosine of the expression. The expression valu e must
be between –1 and 1. The result in radians will be between 0 and PI. Input
values outside the range will return zero.
Arguments:expression
Any valid BASIC expression.
Example:>> PRINT ACOS(-1)
3.1416
5-3-17ADDAX
Type:Motion Control Command
Syntax:ADDAX(axis)
Description:The ADDAX command takes the demand position changes from the supe rim-
posed axis as specified by the axis argument and adds them to any movement running on the a xis to which the comman d is issued. After the ADDAX
command has been issued the link between the two axes remains until broken. Use ADDAX(-1) to cancel the axis link.
ADDAX works on the default basis axis (set with BASE) unless AXIS is used
to specify a temporary base axis.
ADDAX allows an axis to perform the moves specified for 2 axes added
together. Combinations of more than two axes can be made by applying
ADDAX to the superimposed axis as well.
!WARNING
Arguments:axis
See also:AXIS
Example:Pieces are placed onto a continuously moving belt and furt her along the line
5-3-18AND
Beware that giving several ADDAX commands in a system can create a dangerous loop when for instance one axis is linked to another and vice versa.
This may cause instability in the system.
The axis to be set as a super impos ed axis. Set the argument to –1 to cancel
the link and return to normal operation.
are picked up. A detection system gives an indication as to whether a piece is
in front of or behind its nominal position, and how far.
In the example below, axis 0 is assumed to be the base axis and it executes a
continuous forward movement and a super impos ed move on axis 2 is used to
apply offsets according to the offset calculated in a subroutine.
FORWARD ’Set continuous move
ADDAX(4)’Add axis 4 for correction
REPEAT
GOSUB getoffset ’Get offset to apply
MOVE(offset) AXIS(2)
UNTIL IN(2) = ON’Until correction is done
Type:Logical Operator
88
Syntax:
Description:AND performs an AND operation on the corresponding bits of the integer
expression_1
parts of two valid BASIC expressions.
The AND operation between two bits is defined as follows:
AND
expression_2
Command, function and parameter descriptionSection 5-3
Bit 1Bit 2Result
000
010
100
111
Arguments:expression_1
Any valid BASIC expression.
expression_2
Any valid BASIC expression.
Examples:Exam ple 1
VR(0) = 10 AND (2.1*9)
The parentheses are evaluated first, but only the integer part of the result, 18,
is used for the AND operation. Therefore, this expression is equivalent to the
following:
VR(0) = 10 AND 18
The AND is a bit operator and so the binary action is as follows:
Therefore, VR(0) will contain the value 2.
01010
AND10010
00010
5-3-19ASIN
Syntax:ASIN(expression)
Description:ASIN retur ns the arc-sine of the expression. The expression value must be
Arguments:expression
Example:>> PRINT ASIN(-1)
5-3-20ATAN
Syntax:ATAN(expression)
Description:ATAN returns the arc-tangent of the expression. ATAN can have any value
Arguments:expression
Example 2
IF MPOS AXIS(0) > 0 AND MPOS AXIS(1) > 0 THEN GOTO cycle1
Type:Ma thematical Fu nc tion
between –1 and 1. The re sult in radians will be b etween –PI/ 2 and P I/2 . Input
values outside the range will return zero.
Any valid BASIC expression.
-1.5708
Type:Ma thematical Fu nc tion
and the result will be in radians.
Any valid BASIC expression.
Example:>> PRINT ATAN(1)
5-3-21ATAN2
Type:Ma thematical Fu nc tion
Syntax:ATAN2(expression_1,expression_2)
0.7854
89
Command, function and parameter descriptionSection 5-3
Description:ATAN2 returns the arc-tangent of the nonzero complex number
(expression_2, expression_1), which is equivalent to the angle between a
point with coordinate (expression_1, expression_2) and the x-axis. If
expression_2 >= 0, the result is equal to the value of ATAN (expression_1 /expression_2). The re sult in radians w ill be be t we e n –PI and PI.
Arguments:expression_1
Any valid BASIC expression.
expression_2
Any valid BASIC expression.
Example:>> PRINT ATAN2(0,1)
0.0000
5-3-22ATYPE
Type:Axis paramete r
Description:ATYPE contains the axis type. The following values can be set:
0V irtual axis
2Servo axis
3Encoder axis
The ATYPE parameters are set by the system at star t-up to the default value
of the axis. The user is able to change the type of the axis at any time. The
default for axes 0 to 3 are 2 (servo axis) and for ax es 4 t o 7 are 0 (virtual axis).
Refer to 1-3 Motion Control Concepts for more details on the different axis
types.
Note Only the axes with t he supported hardware, which are axis 0 to 3 can be oper-
ating as servo axis or a encoder axis.
See also:AXIS
Example:>> PRINT ATYPE AXIS(2)
5-3-23AUTORUN
Type:Program Comma n d
Syntax:AUTORUN
Description:AUTORUN starts all the programs that have been set to run at start-up.
See also:RUNTYPE
5-3-24AXIS
Type:System Command
Syntax:AXIS(
Description:The AXIS m odifier set s t he axis for a single motion command or a s ingle ax is
Arguments:axis_number
2.0000
The above command line and response show that axis 2 is operating as a
servo axis.
axis_number
parameter read/write to a particular axis. AXIS is e ffective only for the command line in which it is programmed. Use the BASE command to change the
base axis for all following command lines.
Any valid BASIC expression specifying the axis number.
)
90
Precautions:The AXIS com mand can be used to modify any axis parameter expression
and the following axis dependent commands: ADDAX, CAM, CAMBOX, CANCEL, CONNECT, DATUM, DEFPOS, FORWARD, MOVEABS, MOVECIRC,
Command, function and parameter descriptionSection 5-3
MHELICAL, MOVELINK, MOVE, MOVEMODIFY and REVERSE. Other commands for which AXIS is used are: REGIST, WAIT IDLE and WAIT LOADED.
See also:BASE
Examples:Exam ple 1
PRINT MPOS AXIS(3)
Example 2
MOVE(300) AXIS(2)
Example 3
REPDIST AXIS(3) = 100
5-3-25AXISSTATUS
Type:Axis Parameter
Description:AXISSTATUS contains the axis status. The meaning of each bit is as follows:
Description:BASE is used to set the default base axis or to set a specified axis sequence
Note This paramete r is read-only.
Type:Motion Control Command
BASE
BA
group. All subsequent motion command s and axis parameters will apply to
the base axis or the specified axis group unless the AXIS command is used to
specify a temporary base axis. The base axis is effective until it is changed
again with BASE.
Each BASIC process can have its own axis group and eac h program can set
its own axis group independently. Use the PROC modifier to access the
parameter for a cer tain task.
The BASE order grouping can be set by explicitly assigning the order of axes.
This order is used for interpolation pur po ses in multi-axes linear, circular and
helical moves. The default for the base axis group is (0,1,2,3,4,5,6,7) at startup or when a program starts running on a task.
91
Loading...
+ 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.