Motion Controller (SV13/22SFC) : Type A172SHCPUN, A173UHCPU (-S1), A273UHCPU-S3
Motion Controller (SV13/22SFC) : Type A172SHCPUN, A173UHCPU (-S1), A273UHCPU-S3
Motion Controller (SV13/22SFC) : Type A172SHCPUN, A173UHCPU (-S1), A273UHCPU-S3
A273UHCPU-S3
Programming Manual
(SV13/22SFC)
MOTION CONTROLLER
Safety Instructions
Do not attempt to install, operate, maintain or inspect this product until you have read through
these safety instructions carefully and can use the equipment correctly. Do not use this product
until you have a full knowledge of the equipment, safety information and instructions.
In this manual, the safety instruction levels are classified into "WARNING" and "CAUTION".
WARNING Denotes that incorrect handling may cause hazardous
! WARNING
conditions, resulting in death or severe injury.
−I−
SAFETY PRECAUTIONS
! WARNING
While power is on or the equipment is running, do not open the front casing and terminal
cover. Doing so can cause an electric shock.
Do not run the equipment with the front casing and terminal cover removed. The exposed
high-voltage terminals and charging part can cause an electric shock.
If power is off, do not remove the front casing and terminal cover except for wiring or
periodic inspection. The controller and servo amplifier insides are charged and can cause
an electric shock.
Before starting wiring or inspection, switch power off, wait for more than 10 minutes, and
check that there are no residual voltages with a tester or the like. Not doing so can cause an
electric shock.
Use the class 3 or higher grounding method to earth the controller, servo amplifiers and
servo motors. In addition, do not share grounding with other equipment.
Any person who is involved in the wiring or inspection of this equipment should be fully
competent to do the work.
Start wiring after installing the controller, servo amplifiers and servo motors. Not doing so
can cause an electric shock or injury.
Operate the switches with dry hands to prevent an electric shock.
Do not subject the cables to scratches, excessive stress, heavy loads or pinching. Doing so
can cause an electric shock.
While power is on, do not touch the terminal blocks of the controller, servo amplifiers and
servo motors. Doing so can cause an electric shock.
Do not touch the internal power supplies, internal grounds and signal wires of the controller
and servo amplifiers. Doing so can cause an electric shock.
! CAUTION
Mount the controller, servo amplifiers, servo motors and regenerative brake resistors to
incombustibles. Mounting them directly or near combustibles can cause a fire.
If the controller or servo amplifier has failed, switch power off on the power supply side of
the servo amplifier. A continuous flow of large current can cause a fire.
When using a regenerative brake resistor, switch power off with an alarm signal. A
regenerative brake transistor failure or the like can overheat the regenerative brake resistor
abnormally, causing a fire.
Provide anti-thermal measures such as flame-retarding treatment for the control box inside
surfaces, where the servo amplifiers and regenerative brake resistors are installed, and the
wires used.
− II −
3. For injury prevention
! CAUTION
4. Additional Instructions
Also note the following points. Incorrect handling can cause a failure, injury, electric shock or the like.
! CAUTION
Install earth leakage breakers for the power supplies of the controller and servo amplifiers.
When the instruction manuals of the servo amplifiers and like used specify that powering-off
magnetic contactors must be installed for error occurrence, install magnetic contactors.
To ensure an immediate operation stop and power-off, install an external emergency stop
circuit.
When using the controller, servo amplifiers, servo motors and regenerative brake resistors,
combine them as specified in the A173UHCPU/A172SHCPUN/A171SHCPUN user's
manual or the A273UHCPU user's manual and the instruction manuals of the products in
use. Not doing so can cause a fire or failure.
When the system using the controller, servo amplifiers and servo motors has safety
standards (e.g. safety rules for robots), the system must satisfy the safety standards.
If the abnormal operations of the controller and servo amplifiers differ from the safety-
direction operation of the system, configure up remedial circuits outside the controller and
servo amplifiers.
Use dynamic brakes with the servo motors if the coasting of the servo motor can cause a
problem at an emergency stop, servo-off or power-off in the system.
Even if dynamic brakes are used, the coasting distance must be taken into consideration in
the system.
If a vertical shaft drop can cause a problem at an emergency stop, servo-off or power-off in
the system, use the dynamic brakes and electromagnetic brakes together.
Use dynamic brakes for only an error which will occur at an emergency stop or servo-off,
and do not use them for normal braking.
− III −
! CAUTION
The brakes (electromagnetic brakes) built in the servo motors are designed for holding. Do
not use them for normal braking.
Configure up the system to ensure that it has such mechanical allowances that the axes
can stop if they pass through stroke end limit switches at maximum speeds.
The wires and cables used should have the wire diameters, heat resistance and flex
resistance conforming to the system.
The wires and cables used should have the lengths specified in the
A173UHCPU/A172SHCPUN/A171SHCPUN user's manual or the A273UHCPU user's
manual and the instruction manuals of the products in use.
The parts (other than the controller, servo amplifiers and servo motors) used with the
system should be compatible in ratings and characteristics with the controller, servo
amplifiers and servo motors.
To ensure that the rotary parts of the servo motors can never be touched during operation,
provide the shafts with covers or the like.
Due to its life or mechanical structure (e.g. when a ballscrew and the servo motor are
coupled via a timing belt), the electromagnetic brake may not provide sufficient holding
force. Install a stopping device to ensure safety on the machine side.
! CAUTION
Set parameter values which meet the controller, servo amplifier, servo motor and
regenerative brake resistor types and system applications. Wrong setting can disable the
protective functions.
Set the regenerative brake resistor type and capacity parameter values which match the
operation mode, servo amplifiers and servo power supply module. Wrong setting can
disable the protective functions.
Set the mechanical brake output and dynamic brake output used/unused parameter values
which meet the system applications. Wrong setting can disable the protective functions.
Set the stroke limit input used/unused parameter values which meet the system
applications. Wrong setting can disable the protective functions.
Set the servo motor encoder type (incremental, absolute position type, etc.) parameter
values which meet the system applications. Wrong setting can disable the protective
functions.
Set the servo motor capacity and type (standard, low inertia, pancake, etc.) parameter
values which meet the system applications. Wrong setting can disable the protective
functions.
Set the servo amplifier capacity and type parameter values which meet the system
applications. Wrong setting can disable the protective functions.
The program instructions used in programs should be used under the conditions specified in
this manual.
− IV −
! CAUTION
Make the sequence function program capacity, device capacity, latch use range, I/O
assignment and error detection-time continued operation enable/disable settings which
meet the system applications. Wrong setting can disable the protective functions.
Some devices used in programs are fixed in applications. Use them under the conditions
specified in this manual.
If communication stops due to a communication error or the like, the input devices and data
registers assigned to a link hold the data right before a communication stop. Always use the
error remedying interlock programs specified in the instruction manuals of the products in
use.
For programs written for the special function modules, always use the interlock programs
specified in the instruction manuals of the special function modules.
! CAUTION
Transport the products in the correct method which meets their weights.
Use the hanger of the servo motor to only transport the servo motor. Do not use it to
transport the servo motor which is being mounted to a machine.
Do not stack the products over the limit.
When transporting the controller or servo amplifier, do not hold its wires and cables
connected.
When transporting the servo motor, do not hold its cables, shaft and detector.
When transporting the controller or servo amplifier, do not hold its front casing. It may drop.
When transporting, installing or removing the controller or servo amplifier, do not hold its
edges.
When installing the equipment, choose the place which will bear their weights and mount
them in accordance with the A173UHCPU/A172SHCPUN/A171SHCPUN user's manual or
the A273UHCPU user's manual and the instruction manuals of the products in use.
Do not stand or rest heavy objects on the product.
Check that the mounting orientation is correct.
Leave the specified clearances between the controller or servo amplifier and the control box
inside surface, between the controller and the servo amplifier, and between the controller or
servo amplifier and the other equipment.
Do not install or operate the controller, servo amplifiers and servo motors if they are
damaged or have parts missing.
Do not block the suction and exhaust ports of the servo motor provided with a cooling fan.
Prevent screws, metal fragments or other conductive bodies or oil or other flammable
substance from entering the controller, servo amplifiers and servo motors.
The controller, servo amplifiers and servo motors are precision machines. Do not drop them
or give them hard impact.
−V−
! CAUTION
Securely fix the controller and servo amplifiers to the machinery in accordance with the
A173UHCPU/A172SHCPUN/A171SHCPUN user's manual or the A273UHCPU user's
manual and the instruction manuals of the products in use. Insecure fixing may lead to
removal during operation.
Always install the servo motor provided with reduction gear in the specified direction. Not
doing so can cause oil leakage.
Store and use the equipment under the following environmental conditions.
Conditions
Environment
Control unit/servo amplifier Servomotor
Ambient 0°C to +55°C 0°C to +40°C
temperature (Non-freezing) (Non-freezing)
As in the instruction manual of the 80%RH or less
Ambient humidity
corresponding product (Non-condensing)
Storage As in the instruction manual of the
−20°C to +65°C
temperature corresponding product
Indoors (no direct sunlight)
Atmosphere
Free from corrosive gas, flammable gas, oil mist, dust and dirt
Altitude Max. 1000mm above sea level
Vibration As in the instruction manual of the corresponding product
When coupling, do not give impact to the shaft end of the synchronous encoder or servo
motor, e.g. do not hit it with a hammer. Doing so can cause a detector failure.
Do not give the servo motor shaft with loading of greater than the permissible. Such loading
can cause the shaft to be broken.
When the equipment will not be used for an extended period of time, remove the power
supply wires from the controller and servo amplifiers.
Store the controller and servo amplifiers in antistatic vinyl bags.
If they have been stored for an extended period of time, consult the service center or service
station.
Wire the equipment correctly and securely. After wiring, recheck for wrong connections,
insufficient terminal screw tightening, etc. Improper wiring can cause the servo motors to
run away.
After wiring, reinstall the protective covers such as terminal covers.
On the output side of the servo amplifier, do not fit a power capacitor, surge suppressor and
radio noise filter (FR-BIF option).
Make correct connections on the output side (terminals U, V, W). Otherwise, the servo
motors will run abnormally.
Do not connect a commercial power supply to the servo motors directly. Doing so can cause
a failure.
− VI −
! CAUTION
! CAUTION
Before starting operation, confirm and adjust the programs and parameters. A failure to do
so may cause some machines to make unexpected motions.
Never make extreme adjustment changes as they will make operations instable.
Always zero the axes when using the absolute position system function, after making a new
startup, or after changing the controller, absolute value-compatible motor or the like.
− VII −
(6) For usage
! CAUTION
If any of the controller, servo amplifiers and servo motors has emitted smoke, unusual
noise, unusual odor or the like, immediately switch power off.
After any program or parameter setting change or maintenance/inspection, always perform
test operation before starting actual operation.
Any person who is involved in the disassembly or repair of this equipment should be fully
competent to do the work.
Do not modify the equipment.
Install noise filters or shield the wiring, for example, to minimize the influence of
electromagnetic interference. Electromagnetic interference may be given to the electronic
equipment used near the controller and servo amplifiers.
As for use with CE mark-compatible installations, refer to the "EMC Installation Guidelines"
(data number IB(NA)-67320) for motion controllers, and to the corresponding EMC guideline
data for other equipment such as servo amplifiers and inverters.
Use the equipment under the following operating conditions.
Item Conditions
As in the specifications of the
Input power A173UHCPU/A172SHCPUN/A273UHCPU
(32-axes feature)
As in the specifications of the
Input frequency A173UHCPU/A172SHCPUN/A273UHCPU
(32-axes feature)
Permissible As in the specifications of the
instantaneous power A173UHCPU/A172SHCPUN/A273UHCPU
failure time (32-axes feature)
! CAUTION
If a self-diagnostic error of the controller or servo amplifier has occurred, confirm the check
items and recover in accordance with this manual and the instruction manuals of the
products in use, and recover from the error.
If it is assumed that a power failure or product failure may result in a hazardous status, use
a servo motor provided with electromagnetic brake or provide an external brake mechanism
for holding purpose to prevent such hazard.
The electromagnetic brake operation circuit
should have a double circuit structure so Shut off by
that the electromagnetic brake will also be Shut off by servo-on signal emergency stop
operated by an external emergency stop OFF, alarm or electromagn signal (EMG)
etic brake signal.
signal. Servo motor RA1 EMG
Restart operation after removing the cause Electromagnetic
of alarm occurrence and ensuring safety. brake
When power is restored after an 24VDC
instantaneous power failure, stay away from
the machine as it may restart suddenly.
(Design the machine so that personal
safety is secured if it restarts.)
− VIII −
(8) For maintenance, inspection and parts replacement
! CAUTION
Perform daily inspection and periodic inspection in accordance with the instruction manuals.
Start maintenance/inspection after backing up the programs and parameters of the
controller and servo amplifiers.
When opening or closing the doors and covers, do not put your hands and fingers into their
gaps.
Change consumables such as batteries periodically in accordance with the
A173UHCPU/A172SHCPUN/A171SHCPUN user's manual or the A273UHCPU user's
manual and the instruction manuals of the products in use.
Do not touch the IC leads and contactor contacts.
Do not place the controller and servo amplifiers on metal which may leak electricity or on
wood, plastic, vinyl or the like charged with static electricity.
Do not test the equipment with a megger (measure insulation resistance) during inspection.
After changing the controller or servo amplifier, make correct settings of the new unit.
After changing the controller or absolute position-compatible motor, zero the axes in either
of the following methods. Not doing so will cause position shifts.
(1) After writing the servo data to the PLC using the peripheral software, switch power off,
then on again and perform zeroing operation.
(2) Using the backup function of the peripheral software, load the before-replacement
backup data.
At the end of maintenance/inspection, check whether the absolute position detecting
function detects positions properly.
Do not short, recharge, overheat, burn or disassemble the batteries.
Since the electromagnetic capacitors emit gas if they fail, keep your face away from the
controller and servo amplifiers.
The electromagnetic capacitors and fans will deteriorate. Change them periodically to
prevent secondary damage. Consult the system service or service station for replacement.
(9) Disposal
! CAUTION
− IX −
Revisions
The manual number is given on the bottom left of the back cover.
Print Date Manual Number Revision
Dec., 2000 IB(NA)-0300022-A First edition
This manual confers no industrial property rights or any rights of any other kind, nor does it confer any patent
licenses. Mitsubishi Electric Corporation cannot be held responsible for any problems involving industrial
property rights which may occur as a result of using the contents noted in this manual.
1. OVERVIEW ........................................................................................................................................... 1- 1
−I−
5.4.5 Division : / .................................................................................................................................. 5-13
5.4.6 Remainder : %........................................................................................................................... 5-14
5.5 Bit Operations................................................................................................................................... 5-15
5.5.1 Bit inversion (complement) : ~ ................................................................................................... 5-15
5.5.2 Bit logical AND : & ..................................................................................................................... 5-16
5.5.3 Bit logical OR : | ......................................................................................................................... 5-17
5.5.4 Bit exclusive OR : ^.................................................................................................................... 5-18
5.5.5 Bit right shift : >>........................................................................................................................ 5-19
5.5.6 Bit left shift : <<.......................................................................................................................... 5-20
5.5.7 Sign inversion (complement of 2) : -.......................................................................................... 5-21
5.6 Standard Functions .......................................................................................................................... 5-22
5.6.1 Sine : SIN .................................................................................................................................. 5-22
5.6.2 Cosine : COS............................................................................................................................. 5-23
5.6.3 Tangent : TAN ........................................................................................................................... 5-24
5.6.4 Arcsine : ASIN ........................................................................................................................... 5-25
5.6.5 Arccosine : ACOS...................................................................................................................... 5-26
5.6.6 Arctangent : ATAN..................................................................................................................... 5-27
5.6.7 Square root : SQRT................................................................................................................... 5-28
5.6.8 Natural logarithm : LN................................................................................................................ 5-29
5.6.9 Exponential operation : EXP...................................................................................................... 5-30
5.6.10 Absolute value : ABS ............................................................................................................... 5-31
5.6.11 Round-off : RND ...................................................................................................................... 5-32
5.6.12 Round-down : FIX.................................................................................................................... 5-33
5.6.13 Round-up : FUP....................................................................................................................... 5-34
5.6.14 BCD→BIN conversion : BIN .................................................................................................... 5-35
5.6.15 BIN→BCD conversion : BCD .................................................................................................. 5-36
5.7 Type Conversions ............................................................................................................................ 5-37
5.7.1 Signed 16-bit integral value conversion : SHORT ..................................................................... 5-37
5.7.2 Unsigned 16-bit integral value conversion : USHORT .............................................................. 5-38
5.7.3 Signed 32-bit integral value conversion : LONG ....................................................................... 5-39
5.7.4 Unsigned 32-bit integral value conversion : ULONG................................................................. 5-40
5.7.5 Signed 64-bit floating-point value conversion : FLOAT ............................................................. 5-41
5.7.6 Unsigned 64-bit floating-point value conversion : UFLOAT....................................................... 5-42
5.8 Bit Device Statuses .......................................................................................................................... 5-43
5.8.1 ON (normally open contact) : (None)......................................................................................... 5-43
5.8.2 OFF (normally closed contact) : ! .............................................................................................. 5-44
5.9 Bit Device Controls........................................................................................................................... 5-45
5.9.1 Device set : SET=...................................................................................................................... 5-45
5.9.2 Device reset : RST= .................................................................................................................. 5-47
5.9.3 Device output : DOUT ............................................................................................................... 5-49
5.9.4 Device input : DIN...................................................................................................................... 5-50
5.10 Logical Operations ......................................................................................................................... 5-51
5.10.1 Logical acknowledgement : (None) ......................................................................................... 5-51
5.10.2 Logical negation : ! .................................................................................................................. 5-52
5.10.3 Logical AND : * ........................................................................................................................ 5-53
5.10.4 Logical OR : +.......................................................................................................................... 5-54
5.11 Comparison Operations ................................................................................................................. 5-55
5.11.1 Equal to : == ............................................................................................................................ 5-55
5.11.2 Not equal to : != ....................................................................................................................... 5-56
− II −
5.11.3 Less than : < ............................................................................................................................ 5-57
5.11.4 Less than or equal to: <=......................................................................................................... 5-58
5.11.5 More than : > ........................................................................................................................... 5-59
5.11.6 More than or equal to: >= ........................................................................................................ 5-60
5.12 Motion-Dedicated Functions (CHGV, CHGT) ................................................................................ 5-61
5.12.1 Speed change request : CHGV ............................................................................................... 5-61
5.12.2 Torque limit value change request : CHGT ............................................................................. 5-66
5.13 Other Instructions........................................................................................................................... 5-68
5.13.1 Event task enable : EI.............................................................................................................. 5-68
5.13.2 Event task disable : DI............................................................................................................. 5-69
5.13.3 No operation : NOP ................................................................................................................. 5-70
5.13.4 Block move : BMOV ................................................................................................................ 5-71
5.13.5 Time to wait : TIME.................................................................................................................. 5-74
5.14 Comment Statement : // ................................................................................................................. 5-76
− III −
12.1.2 Start from SFC program ......................................................................................................... 12- 1
12.1.3 Start from PLC (Sequence instruction SFCS )..................................................................... 12- 2
12.2 How to End SFC Program............................................................................................................. 12- 4
12.3 Clear Step in the SFC Program .................................................................................................... 12- 4
12.4 How to Change from One SFC Program to Another..................................................................... 12- 4
12.5 How to Manage the Running Programs ........................................................................................ 12- 4
12.6 SCPU to PCPU Interrupt Instruction (Sequence instruction ITP ) .............................................. 12- 5
− IV −
1. OVERVIEW
1. OVERVIEW
This is a programming manual for the motion SFC-compatible CPU operating
system software packages "SW3RN-SV13 ", "SW3RN-SV22 " designed to run
SFC programs on the motion CPU side.
Conventionally, a sequence of machine operations were controlled by the PLC
CPU, and motion program start and stop control was exercised by the motion CPU
under the start and stop commands of the PLC. Hence, a delay or variation of one
PLC scan occurred at the worst between when a command condition enabled until
a command was issued, limiting the applications where fast response and short
tact time are pursued.
The motion SFC-compatible CPU operating system allows motion side programs to
be written in SFC (Sequential Function Chart), which conforms to IEC1131-3, to
control a sequence of machine operations. In addition, it also enables event control
which runs a program at an interrupt input from an external sensor. Mainly
performing the processings irrelevant to sequential control, the PLC controls ladder
programs by constant scan execution.
1.1 Features
(1) Since the motion CPU judges whether a transition condition enabled or not to
make a start, there are no response delays or variations affected by PLC scan
time.
(2) The SFC step processing system (only active steps are executed) ensures
rapid processing and fast response.
(3) The motion CPU can perform not only a motion program start but also
numerical operations, device SET/RST, etc., making operations via the PLC
unnecessary and improving tact time.
(6) You can set programs (written in SFC) which run in fast response to external
interrupt inputs (NMI).
(7) You can set programs (written in SFC) which run in a short cycle (1.777ms,
3.555ms, 7.111ms, 14.222ms).
1−1
2. SYSTEM CONFIGURATION
2. SYSTEM CONFIGURATION
supply module
Servo external
Dynamic brake
supply module
Control power
CPU module
Servo power
module
signal
AC motor drive
modules
M M M M
SSCNET2 E E E E
(AC B)
Control power supply
Pulse generator/
synchronous
Output module
module
Input module
Manual pulse
generator ×3 P
(MR-HDP01) Serial absolute
synchronous External interrupt input signals
Serial absolute encoder cable 16 points (I0 to I15)
synchronous encoder ×3 E (MR-HSCBL M)
(MR-HENC)(SV22 only)
External input signal
TRA Tracking ×3
Motion extension base, up to 4 bases SSCNET : Servo System Controller NETwork
(Base number setting: base 1 to base 4)
2−1
2. SYSTEM CONFIGURATION
POINT
(1) I/O assignment
• When no I/O assignment is made, the I/O numbers of the PLC extension
base 1 start from X/Y80.
• When you want to use the PLC extension base 1 at the I/O numbers of
X/Y0 and later, make I/O assignment by setting slots 0 to 7 as "0 free
points".
(2) The motion slots accept up to 256 I/O points.
(3) The I/O numbers of the I/O modules loaded in the motion slots should be
later than the I/O numbers used with the PLC slots.
(4) The motion slots accept one AI61 interrupt input module.
This module is designed for only event/NMI input to the motion CPU and is
irrelevant to PLC interrupt programs.
2−2
2. SYSTEM CONFIGURATION
Power supply
ENC ENC ENC ENC I61
A6BAT
module
Emergency
stop input
PLC extension base
External interrupt input signals For A1S6 B: up to 1 base
AC100/200V 16 points (I0 to I15) For A168B (GOT compatible) : up to 1 base
Teaching unit P For A6 B : up to 1 base
Manual pulse generator × 3
A31TU-E/A30TU-E P
(MR-HDP01)
(SV13 only)
P
E Serial absolute
RS422 synchronous encoder cable
E (MR-HSCBL M)
Communication cable E Serial absolute
(A270CDCBL M/ synchronous encoder × 4
E (MR-HENC)
A270BDCBL M)
Personal computer External input signals
(IBM PC/AT) FLS Upper limit switch
RLS Lower limit switch
Windows NT/98 (Note) ×8
SSCNET4 STOP Stop signal
DOG/CHANGE Proximity dog/speed-position change
SSC I/F card/board TRA Tracking ×1
(A30CD-PCF/A30BD-PCF) Brake output
Motion network cable
MR-H-BN/MR-J2S-B/MR-J2-B
(Note) Servo amplifier, max. 32 axes
Max. 24 axes
SSCNET1 d1 d2 d3 d8
Termination
resistor (Note): The A173UHCPU may be used with 4 channels
of SSCNET.
SSCNET2 M M M M When using the SSC I/F card/board
E E E E (A30CD-PCF/A30BD-PCF), connect it to
SSCNET3
SSCNET4 and connect the servo amplifiers to
SSCNET4 Servo amplifier, max. 8 axes/1 network SSCNET1 to 3.
In this case, up to 24 axes of servo amplifiers
can be connected.
POINT
(1) Use the A168B when using the bus-connection type GOT.
(2) Using the A31TU-E teaching unit provided with deadman switch requires
the exclusively used A31TUCBL03M connection cable between the CPU
module and A31TU-E connector. The A31TU-E will not operate at all if it
is connected directly with the RS422 connector of the CPU, without using
the exclusively used cable.
Also, after disconnecting the A31TU-E, fit the A31SHORTCON short-
circuit connector designed for A31TUCBL.
(3) The motion slots also accept PLC A1S I/O modules.
(4) The motion slots accept one A1SI61 interrupt input module.
This module is designed for only event/NMI input to the motion CPU and
is irrelevant to PLC interrupt programs.
(5) The motion slots accept up to 256 I/O points.
(6) The I/O numbers of the I/O modules loaded in the motion slots should be
later than the I/O numbers used with the PLC slots.
2−3
2. SYSTEM CONFIGURATION
II/O composite
Input module
A1SX48Y18
A1SX48Y58
A1SH42
module
A1SX
A1SY
Motion
slots PLC slots
Interrupt input module
synchronous encoder
interface module
Pulse generator/
CPU module
Power supply
A6BAT ENC I61
module
Extension
Emergency cable
stop input (A1SC B)
CPU base unit(A178B-S1/A17 B) PLC extension base
For A168B : up to 3 bases
AC100/200V External interrupt input signals For A1S6 B: up to 1 base
Manual pulse
Teaching unit P generator × 1 16 points (I0 to I15)
A31TU-E/A30TU-E (MR-HDP01)
(SV13 only) Serial absolute synchronous encoder cable
(MR-HSCBL M)
Serial absolute synchronous encoder × 1
RS422 E (MR-HENC)(SV22 only)
M M M M
E E E E
MR-H-BN/MR-J2S-B/MR-J2-B
Servo amplifier, max. 8 axes
POINT
(1) Use the A168B when setting one or more PLC extension bases.
(2) The motion slots also accept PLC A1S I/O modules.
The motion slots accept up to 256 I/O points.
(Actually, the maximum points is 64-point modules * 2 = 128 points.)
(3) The I/O numbers of the I/O modules loaded in the motion slots should be
later than the I/O numbers used with the PLC slots.
(4) The motion slots accept one A1SI61 interrupt input module.
This module is designed for only event/NMI input to the motion CPU and
is irrelevant to PLC interrupt programs.
2−4
2. SYSTEM CONFIGURATION
(SFC-compatible OS) S V 1 3 W V E R 3 0 0 A U
U : With teaching function
W : A273UH-S3 (32-axes feature) OS version Blank: Without teaching function
C or D: A172SH (8-axes feature)
Indicates motion SFC compatibility.
A or B: A173UH (32-axes feature)
(Conventional OS) S V 1 3 U V E R . 0 0 Z U
2−5
3. PERFORMANCE SPECIFICATIONS
3. PERFORMANCE SPECIFICATIONS
3−1
3. PERFORMANCE SPECIFICATIONS
3−2
3. PERFORMANCE SPECIFICATIONS
S-curve
acceleration/decel- S-curve ratio : 0 to 100%
eration
Backlash
(0 to 65535) × position command unit (0 to 65535 PULSE with unit converted into PULSE)
Compensation compensation
Electronic gear Function to compensate for actual travel error against command value
Not in absolute position system : Proximity dog type or count type can be selected.
Zeroing function
In absolute position system : Data setting type, proximity dog type or count type can be selected.
JOG operation function Available
Three pulse generators can be
One pulse generator can be connected. Three pulse generators can be
connected. One A172SENC is required per connected.
Manual pulse generator operation Up to 3-axes can be operated pulse generator. Up to 3-axes can be operated
function simultaneously. Up to 3-axes can be operated simultaneously.
With smoothing scale factor setting simultaneously. With smoothing scale factor
Input scale factor setting : 1 to 100 With smoothing scale factor setting Input scale factor setting : 1 to 100
Input scale factor setting : 1 to 100
With M-code output function
M-function
With M-code completion waiting function
Skip function Available
Number of output
Limit switch output 32 points
points
function
Watch data Motion control data / word device (16-bit integer, 32-bit integer, 64-bit floating-point)
Max. 11 points(A273EX's TRA input
Number of read Max. 9 points (A172SENC's TRA input (1 point) + one motion slot
(3 points) + one motion slot PLC
Specified data fast- points PLC input module (8 points))
input module (8 points))
read function
Leading edge of TRA input signal
Data latch timing
Within 0.8ms from leading edge of input signal to PLC input module
Made compatible by fitting battery to servo amplifier.
Absolute position system
(Absolute or incremental system can be specified per axis.)
3−3
3. PERFORMANCE SPECIFICATIONS
Table 3.4 PCPU Performance Specification List (Operation Control/Transition Control Specifications)
Item Specifications Remarks
Returns a numeric result.
Calculation expression Expressions for calculating indirectly specified data using constants and D100+1, SIN(D100F), etc.
word devices.
Bit conditional Returns a true or false result. M0, !M0, M1*!M0,
Expression Condi-
expression Expression for judging ON or OFF of bit device. (M1+M2)*(!M3+M4), etc.
tional
Comparison
expres- Expressions for comparing indirectly specified data and calculation D100==100,
conditional
sion expressions using constants and word devices. D10<D102+D10, etc.
expression
• Each device range
Accessibility Usable Tasks Descripti (points) varies with the
Device Symbol on CPU. Refer to "3.2 SCPU
Read Write Normal Event NMI Performance
Example
Specifications".
SBUS X X100
Input
PBUS PX PX180
SBUS Y Y000 • Inputs X/outputs Y on the
Output PLC slot side are
PBUS PY PY1E0
(Note- represented as SBUS and
Internal relay M 1) M20 those on the motion slot
side as PBUS.
Latch relay L L1000 (In the operation control
Link relay B B3FF program/transition
program, they are
Annunciator F F0 automatically represented
Timer contact TT TT10 as PX/PY according to the
Timer coil TC TC10 system setting
information.)
Counter contact CT CT0
Counter coil CC CC0
(Note-
Special M M 1) M9000
CAUTION
<Restrictions on write-enabled bit devices>
1) Write (e.g. SET, RST, OUT) to the same bit device (16 point increments) cannot be performed from *The input response of
both the sequence ladder and motion SFC programs. (Write operation cannot be guaranteed.)
device X and the output
Hence, the side on which write is performed should be managed by the user.
response of Y differ
Minimum increments are 16 points.
2) Write to device X is allowed only within the input card non-loaded range and to the free numbers between the SBUS (PLC
outside the link range. slot) and PBUS (motion
Specifiable PLC devices When the A172SHCPUN is used, note that the following read response delay will occur from slot). For details, refer to
(bit devices) when the SET/RST/DOUT instruction is executed by the motion CPU. the next page.
3) When the I/O control method is the "direct system" (A172SHCPUN only), performing write to
device Y will not provide output to the output card in the PLC slot.
Use the "refresh system" to provide output to the PLC slot.
4) Special M has predetermined applications in the system.
Do not perform write to other than the user-set device.
(Note-1) : SET/RST is disabled in the following device ranges.
3−4
3. PERFORMANCE SPECIFICATIONS
Table 3.4 PCPU Performance Specification List (Operation Control/Transition Control Specifications) (Continued)
Item Specifications Remarks
CAUTION
<Restrictions on write-enabled word devices>
1) Special D has predetermined applications in the system.
Do not perform write to other than the user-set device.
Number of 8192 points (#0 to #8191)
Motion register (#) points (#8000 to #8191 are SFC-dedicated devices)
Data 16 bits/point
Number of
1 point (FT)
Coasting timer (FT) points
Data 32 bits/point (-2147483648 to 2147483647)
A273UH-S3, A173UH(-S1)
Motion device
Accessibility Usable Tasks Description and A172SH have the
(word device) Device Symbol
Read Write Normal Event NMI Example same specifications.
Motion register # #OF
Coasting timer FT FT
CAUTION
1) The motion device cannot be accessed directly from the sequence ladder.
When you want to read, perform read via the PLC device (after assignment).
16-bit integer type (signed) -32768 to 32767
(None) K10, D100, etc.
16-bit integer type (unsigned) 0 to 65535
32-bit integer type (signed) -2147483648 to 2147483647
Data type L 2147283647, W100L, etc.
32-bit integer type (unsigned) 0 to 4294967295
64-bit floating-point type
F IEEE format 1.23, #10F, etc.
(double precision real number type)
Decimal The above data type symbol 'L' or '. (decimal point)' provided at the end
K K-100, H0FFL, etc.
constant
Constant indicates the data type. The constant without the data type is regarded as
Hexadecimal 'K' may be omitted.
H the applicable minimum type.
constant
Binary operation 6
Bit operation 6
Sign 1
Standard function 15
Type conversion 6
Number of instructions Bit device status 2 57 in total
Bit device control 4
Logical operation 4
Comparison operation 6
Motion dedicated function 2
Others 5
Direct read control at instruction
Input response • Input X and output Y of
execution
PBUS the PBUS are always
Refresh is made at instruction
(Input module in motion slot) under direct control,
Read response of input Response to PLC device execution and in normal task
cycle. independently of the
X on motion CPU
PLC's I/O control method.
SBUS Refresh mode Input response 1 sequence scan
(Input module Direct mode
Input response 1 sequence scan CAUTION
in PLC slot) (A172SH only)
• Output Y of the PBUS is
Response to PLC device At instruction execution
write-enabled from only
PBUS Direct write control at
Actual output response the motion CPU.
instruction execution
Write response of Do not perform write from
Response to PLC device At instruction execution
output Y on motion CPU Refresh mode the PLC CPU (output is
Actual output response Refreshed at PLC's END
SBUS not provided to real
Direct mode Response to PLC device At instruction execution output).
(A172SH only) Actual output response Not output
3−5
3. PERFORMANCE SPECIFICATIONS
Number of Basic
Programs
Steps
Comparison
Calculation
expression
expression
expression
expression
conditional
conditional
conditional
transition's
Classification Symbol Function Format
Y/N
Bit
F/FS G
= Substitution (D)=(S) 4
+ Addition (S1)+(S2) 4
Binary - Subtraction (S1)-(S2) 4
operation * Multiplication (S1)*(S2) 4
/ Division (S1)/(S2) 4
% Remainder (S1)%(S2) 4
~ Bit inversion ~(S) 2
(complement)
& Bit logical AND (S1)&(S2) 4
Bit operation | Bit logical OR (S1)|(S2) 4
^ Bit exclusive OR (S1)^(S2) 4
>> Bit right shift (S1)>>(S2) 4
<< Bit left shift (S1)<<(S2) 4
Sign inversion
Sign - -(S) 4
(complement of 2)
SIN Sine SIN(S) 2
COS Cosine COS(S) 2
TAN Tangent TAN(S) 2
ASIN Arcsine ASIN(S) 2
ACOS Arccosine ACOS(S) 2
ATAN Arctangent ATAN(S) 2
SQRT Square root SQRT(S) 2
Standard
LN Natural logarithm LN(S) 2
function
EXP Exponential operation EXP(S) 2
ABS Absolute value ABS(S) 2
RND Round-off RND(S) 2
FIX Round-down FIX(S) 2
FUP Round-up FUP(S) 2
BIN BCD→BIN conversion BIN(S) 2
BCD BIN→BCD conversion BCD(S) 2
Converted into 16-bit
SHORT SHORT(S) 2
integer type (signed)
Converted into 16-bit
USHORT USHORT(S) 2
integer type (unsigned)
Converted into 32-bit
LONG LONG(S) 2
integer type (signed)
Converted into 32-bit
Type
ULONG ULONG(S) 2
integer type (unsigned)
conversion Regarded as signed
data and converted
FLOAT FLOAT(S) 2
into 64-bit floating-
point type
Regarded as unsigned
data and converted
UFLOAT UFLOAT(S) 2
into 64-bit floating-
point type
ON (normally open (Bit conditional
(None) 2
Bit device contact) expression)
status OFF (normally closed !(Bit conditional
! 2
contact) expression)
3−6
3. PERFORMANCE SPECIFICATIONS
Usable
Usable Expressions
Number of Basic
Programs
Steps
Comparison
Calculation
expression
expression
expression
expression
conditional
conditional
conditional
transition's
Classification Symbol Function Format
Y/N
Bit
F/FS G
SET(D) 3
SET Device set SET(D)= (conditional
4
expression)
Bit device RST(D) 3
control RST Device reset RST(D)= (conditional
4
expression)
DOUT Device output DOUT(D),(S) 4
DIN Device input DIN(D),(S) 4
Logical
(None) (Conditional expression) 0
acknowledgement
! Logical negation !(conditional expression) 2
Logical
(Conditional expression) *
operation * Logical AND 4
(conditional expression)
(Conditional expression) +
+ Logical OR 4
(conditional expression)
(Calculation expression)
== Equal to 4
== (calculation expression)
(Calculation expression) !=
!= Not equal to 4
(calculation expression)
(Calculation expression) <
< Less than 4
Comparison (calculation expression)
operation Less than or equal (Calculation expression)
<= 4
to <= (calculation expression)
(Calculation expression) >
> More than 4
(calculation expression)
More than or equal (Calculation expression)
>= 4
to >= (calculation expression)
Speed change
Motion CHGV CHGV((S1),(S2)) 4
request
dedicated
Torque limit value
function CHGT CHGT((S1),(S2)) 4
change request
EI Event task enable EI 1
DI Event task disable DI 1
Others NOP No operation NOP 1
BMOV Block move BMOV(D),(S),(n) 7
TIME Time to wait TIME(S) 7
3−7
4. SFC PROGRAMS
4. SFC PROGRAMS
As shown below, an SFC program consists of START, steps, transitions, END and
others.
Operation Program START: Indicates a program entry.
start name
Preparations Step (operation control step): When active, runs SET Y0=X0+X10
for F0
positioning the specified operation control program. D100=W0+W100
ABS-1
Execution of Step (motion control step): When active, runs
positioning K0 the specified servo program. Axis 1, D100
Speed 10000
When started, the above SFC program performs the following operations.
(1) The step (F0) is activated and the operation specified at the step (F0) is
performed (preparations for positioning). A step in such an active state is called
an active step.
(2) Whether the condition specified at the transition (G0) has enabled or not
(whether the positioning program can be started or not) is checked. When the
condition enables, the active step (F0) is deactivated and the next step (K0) is
activated (servo program K0 is started).
(3) At the transition (G1), whether the step (K0) has completed its operation (servo
program K0 has completed positioning) is checked. When the operation is
completed (condition enables), control transits to the next step.
(4) With the transition of an active step as described in above (1) to (3), control is
exercised and ends at END.
Refer to Chapter 9 Task Operations for details of the run timing of the SFC
program such as above.
POINT
The number of steps which can be active steps simultaneously is up to 256,
with those of all SFC programs combined. Excess of 256 will result in an SFC
program error 16120.
4−1
4. SFC PROGRAMS
Parts acting as SFC program components are shown below. In an SFC program,
these parts are connected by directed lines to represent an operation sequence
and transition control.
Symbol
Classification Name List Representation Function
(Code size (byte))
• Indicates a program entry with a program name.
Program name
• Specify this program name for a subroutine call.
START Program name
• Only one program name may be used with one
(0) program.
Program
start/end • Indicates a program end (exit).
• When a subroutine called is made, execution
END END END returns to the call source program.
• Multiple or no symbols may be set within one
(8)
program.
4−2
4. SFC PROGRAMS
Symbol
Classification Name List Representation Function
(Code size (byte))
• When this transition is preceded by a motion
control step, execution does not wait for
completion of the motion operation, and shifts
to the next step when the transition condition
Gn (G0 to G4095) enables.
• When this transition is preceded by an
Shift
Gn operation control step, execution shifts to the
(Pre-read SFT Gn
next step when the transition condition enables
transition)
(8) after operation has been performed.
• When this transition is preceded by a
subroutine call/start step, execution does not
wait for completion of the subroutine operation,
and shifts to the next step when the transition
condition enables.
• When this transition is preceded by a motion
control step, execution waits for completion of
the motion operation and shifts to the next step
when the transition condition Gn (G0 to G4095)
enables.
• When this transition is preceded by an
operation control step, execution shifts to the
WAIT Gn WAIT Gn next step when the transition condition enables
after operation has been performed (same
(8) operation is performed as in Shift).
• When this transition is preceded by a
subroutine call/start step, execution waits for
completion of the subroutine operation and
shifts to the next step when the transition
condition enables.
• Prepares for starting the next motion control
step, and when the specified bit device turns
Transition ON bit device
ON, issues a command immediately.
WAITON WAITON bit device • Always pair this transition with a motion control
Kn step one-for-one.
(14)
• Prepares for starting the next motion control
step, and when the specified bit device turns
OFF bit device
OFF, issues a command immediately.
WAITOFF WAITOFF bit device • Always pair this transition with a motion control
Kn step one-for-one.
(14)
• When this transition is preceded by a motion
control step, execution does not wait for
completion of the motion operation, and shifts
to the lower step when the transition condition
IFBm Gn (G0 to G4095) enables, or shifts to the right-
IFT1 connected step when the condition does not
(When enable.
condition SFT Gn
• When this transition is preceded by an
does :
not enable) operation control step, execution shifts to the
JMP IFEm low step when the transition condition enables
Shift Y/N Gn
N IFT2 after operation has been performed, or shifts to
(When Y the right-connected step when the condition
condition SFT Gn+?
does not enable.
enables) : • When this transition is preceded by a
JMP IFEm subroutine call/start step, execution does not
IFEm wait for completion of the subroutine operation,
and shifts to the lower step when the transition
condition enables, or shifts to the right-
connected step when the condition does not
enable.
4−3
4. SFC PROGRAMS
Symbol
Classification Name List Representation Function
(Code size (byte))
• When this transition is preceded by a motion
control step, execution waits for completion of the
motion operation, and shifts to the lower step
IFBm when the transition condition Gn (G0 to G4095)
IFT1 enables, or shifts to the right-connected step
(When when the condition does not enable.
condition WAIT Gn
• When this transition is preceded by an operation
does :
not enable) control step, execution shifts to the low step
JMP IFEm when the transition condition enables after
Transition WAIT Y/N Gn
N IFT2 operation has been performed, or shifts to the
(When Y right-connected step when the condition does not
condition SFT Gn+?
enable (same operation as in Shift).
enables) : • When this transition is preceded by a subroutine
JMP IFEm call/start step, execution waits for completion of
IFEm the subroutine operation, and shifts to the lower
step when the transition condition enables, or
shifts to the right-connected step when the
condition does not enable.
• Jumps to the specified pointer Pn (P0 to
Jump Jump Pn JMP Pn P16383) within its own program.
(14)
• Indicates a jump destination pointer (label).
• This pointer can be set at a step, transition,
Pn branch point or coupling point.
Pointer Pointer
• P0 to P16383 can be set in a single program.
(8)
The same numbers may also be used in other
programs.
4−4
4. SFC PROGRAMS
The following are branch and coupling patterns which specify step and transition
sequences in SFC charts.
Name (Code
SFC Symbol List Representation Function
size (byte))
Series • Steps and transitions connected in series
transition are processed in order from top to bottom.
List representation
• Steps and transitions need not be lined up
corresponding to SFC
alternately.
chart symbols shown
(Correspond- • When a transition is omitted, unconditional
in 4.2.
ing symbol shift transition processing is performed.
size)
Selective • After the step or transition preceding a
branch branch is executed, the route whose
CALL Kn transition condition enables first is
IFBm IFBm executed.
IFT1 IFT2 IFT1 • Selective branch destinations should
SFT Gn always be started by transitions, all of
((Number of CALL Fn which must be Shift or WAIT. (Using Shift
branches + 2) : and WAIT together will cause a parallel
× 10) JMP IFEm branch.)
IFT2 • After the route branched by a selective
Selective SFT Gn’ branch has been processed, execution
coupling CALL Fn’ shifts to a coupling point.
: • A coupling may be preceded and followed
(JMP IFEm) by either a step or a transition.
IFEm IFEm
CALL Fn’’
(8)
Parallel branch • Multiple routes (steps) connected in
parallel are executed simultaneously.
SFT Gn
(Number of PABm • Each parallel branch destination may be
PABm
branches × 22 PAT1 PAT2 started by either a step or transition.
PAT1
Basic + number of
CALL Fn
type coupling points
SET Gn’
× 2 + 12)
:
• Execution waits at the coupling point for
Parallel JMP PAEm
executions of the routes branched by a
coupling PAT2
parallel branch to be completed, and shifts
CALL Fn’
to the next when executions of all routes
SET Gn’’
are completed.
:
A coupling may be preceded and followed
PAEm (JMP PAEm)
by either a step or a transition.
PAEm
• When this coupling is preceded by an FS
CALL Fn’’
step, scans are executed during waiting.
:
After waiting is complete, scans are not
(8)
executed.
Jump 1) Normal jump
transition • After the step or transition preceding
<Normal jump> <Coupling jump>
this jump transition is executed,
CALL Fn execution shifts to the pointer Pn
JMP Pn specified within its own program.
• The jump destination may either be a
step or transition.
• When a jump takes place from an FS
step to a transition, scans are executed
during waiting for the transition condition
of the jump destination to enable.
CALL Fn’ 2) Coupling jump
Pn • When a jump to the other route within a
JMP Pn parallel branch takes place after the
(Correspond- parallel branch, a "coupling jump" takes
ing symbol place and execution waits at the jump
size) destination.
4−5
4. SFC PROGRAMS
4−6
4. SFC PROGRAMS
PAEm
SET Gn’’’
:
4−7
4. SFC PROGRAMS
4−8
4. SFC PROGRAMS
Set "SFC program names" to SFC program No. 0 to No. 255 individually. (Make
this setting in the "SFC program management window" on the SFC program edit
screen.)
Set an SFC program name within 16 characters. Specify this SFC program name
for a "subroutine call/start step (GSUB)" and "clear step (CLR)".
SFC programs correspond to No. 0 to No. 255 and saved in a one program-for-one
file format. The preset "SFC program name" is used as the file name of the SFC
program file for user file management. (Refer to Chapter 14 for full information.)
POINT
(1) You can set an SFC program to any of No. 0 to No. 255.
There are no specific programs which have special roles.
(2) You cannot use "$" in the first character of an SFC program name.
(3) You cannot use " / : ; , . * ? “ < > |" in SFC program names.
4−9
4. SFC PROGRAMS
4.5 Steps
[Operations]
(1) The start acceptance flag of the axis specified in the specified servo program
Kn (n = 0 to 4095) turns ON.
(2) The specified servo program Kn (n = 0 to 4095) starts.
Execution timing
Transition condition enables
[Errors]
(1) The absence of the specified servo program Kn will result in an SFC program
error 16200 and stop the SFC program running at the point of error detection.
[Instructions]
(1) To make a current value change in the SFC program, specify the CHGA
instruction in the servo program and call it at the motion control step.
(2) If the servo program has stopped due to a major/minor error which occurred at
or during a start of the servo program specified at the motion control step, the
SFC program continues running. To stop the SFC program at error detection,
provide an error detection condition at the transition (transition condition).
4 − 10
4. SFC PROGRAMS
[Operations]
(1) Once execution type operation control step Fn
Fn runs the specified operation control program Fn (n = 0 to 4095) once.
(2) Scan execution type operation control step FSn
FSn repeats the specified operation control program FSn (n =0 to 4095) until
the next transition condition enables.
[Errors]
(1) The absence of the specified operation control program Fn/FSn will result in an
SFC program error 16201 and stop the SFC program running at the point of
error detection.
[Instructions]
(1) For operation expressions that may be described in operation control programs,
refer to Chapter 5 Operation Control Programs.
(2) The SFC program continues running if an operation or similar error occurs
during execution of the operation control program.
4 − 11
4. SFC PROGRAMS
Subroutine Program name Calls/starts the SFC program of the specified program
call/start step name.
(2) Control varies with the type of the transition coupled next to the subroutine
call/start step.
(a) For WAIT
A subroutine call is performed. When the subroutine call step is executed,
control shifts to the specified program as shown below, and when END of
the called program is executed, control returns to the call source program.
3) 3)
SUB 2) SUB 2)
END END
For WAIT For other than WAIT
[Errors]
(1) The absence of the specified SFC program at a subroutine call/start will result
in an SFC program error 16005 and stop the call/start source SFC program
running at the point of error detection.
(3) Calling/starting its own program at a subroutine call/start will result in an SFC
program error 16110 and stop the call/start source SFC program running at the
point of error detection.
4 − 12
4. SFC PROGRAMS
[Instructions]
(2) For a subroutine start, the start source SFC program continues processing if
the start destination SFC program stops due to an error.
(3) For a subroutine call, the call source SFC program stops running as soon as
the call destination SFC program stops due to an error.
[Operations]
(1) Stops the specified SFC program running.
(2) After stopped, the clear-specified SFC program will not start automatically if it
has been set to start automatically.
(4) If the specified program is being subroutine called, the subroutine program
called is also stopped. (See below)
MAIN SUB If the program has been "subroutine called" as shown on the left
When the main program (MAIN) is cleared
Even if the subroutine (SUB) is running, both the main
SUB program(MAIN) and subroutine (SUB) stop running.
When the subroutine (SUB) is cleared
WAIT END If the subroutine (SUB) is running, the subroutine (SUB) stops
running and execution returns to the main program (MAIN).
END
(5) When the specified program has been subroutine started, the subroutine
program started continues processing. (See below)
MAIN SUB If the program has been "subroutine started" as shown on the left
When the main program (MAIN) is cleared
Even if the subroutine (SUB) is running, the main program
SUB (MAIN) stops running but the started subroutine (SUB)
continues processing.
When the subroutine (SUB) is cleared
Shift END If the subroutine (SUB) is running, only the subroutine (SUB)
stops running.
END
4 − 13
4. SFC PROGRAMS
(6) When the servo program started from the specified program is starting, the
servo program continues processing.
[Errors]
(1) The absence of the SFC program specified at the clear step will result in an
SFC program error 16203.
[Instructions]
(1) When the SFC program specified at the clear step is not starting, an error does
not occur specifically and this step is ignored.
(2) If the SFC program running is stopped by the clear step, the output is held.
4 − 14
4. SFC PROGRAMS
4.6 Transitions
4 − 15
4. SFC PROGRAMS
[Instructions]
• Always pair a transition with a motion control step one-for-one. If the step
following WAITON/WAITOFF is not a motion control step, an SFC program
error 16102 will occur and the SFC program running will stop at the point of
error detection.
• An error will not occur if the jump destination immediately after
WAITON/WAITOFF is a motion control step. (Left below)
• A pointer may exist immediately after WAITON/WAITOFF. (Right below)
ON M0 ON M0
Pn
Pn
Kn
Pn
Kn
• If a servo program specified at a motion control step could not be started due to
a major/minor error, an SFC program continues running and execution shifts to
the next, independently of the WAITON/WAITOFF bit device status. To stop the
SFC program at error detection, provide an error detection condition at the next
transition (transition condition).
4 − 16
4. SFC PROGRAMS
Pn Pn
Jump Pointer
[Operations]
• Setting a jump will cause a jump to the pointer Pn specified in its own program.
• You can set pointers at steps, transitions, branch points and coupling points.
• You can set pointers Pn, P0 to P16383, in a single program.
[Instructions]
• You cannot make a jump setting which will exit from within parallel branch-parallel
coupling. (Bad example 1 given below)
• You cannot make a jump setting from outside parallel branch-parallel coupling to
within parallel branch-parallel coupling. (Bad example 2 given below)
• You cannot make a setting where a label and a jump will continue. (Bad example
3 given below)
Bad example 1 Bad example 2 Bad example 3
Pn
Pn Pn Pn
Pn
Pn
4.8 END
END
[Operations]
• Ends a program.
• Making a subroutine call will return to the call source SFC program.
[Instructions]
• END may be set a multiple number of times within a single program.
• END cannot be specified between a parallel branch and a parallel coupling.
• The output is held after the SFC program is ended by END.
4 − 17
4. SFC PROGRAMS
(1) To start a servo program or subroutine and shift execution to the next without
waiting for operation completion
Set Shift at a transition.
In this case, the transition (shift) may be omitted.
When you omitted the transition, an unconditional shift transition is performed.
POINT
When a subroutine start is made, it own program and a subroutine program
are processed in parallel.
(2) To start a servo program or subroutine and proceed to the next step on
operation completion
Set WAIT at a transition.
POINT
(1) The above start acceptance flag of the axis started in the next servo
program K2 is not included in interlocks.
To use it as an interlock, the user should set it in the transition condition
G1.
(2) WAIT must be set to proceed to the next step on operation completion.
However, when there are specifically no conditions to be set as
interlocks, set "NOP (No Operation)" in the transition program (Gn).
4 − 18
4. SFC PROGRAMS
POINT
(1) Transition condition judgment is not always executed from left to
right.
(2) Using Shift and WAIT together will cause a parallel branch.
IFB1
4 − 19
4. SFC PROGRAMS
G0 WAIT GO
POINT
"Shift" or "WAIT" can be set to a transition preceding a parallel branch.
"WAITON" and "WAITOFF" cannot be set.
G1
PAB1 Parallel branch point
K2 K4 F10
Coupling jump
ON M100 G11
K3 F1
K100
PAE1 Parallel coupling point
K5
4 − 20
4. SFC PROGRAMS
POINT
The number of parallel branches need not match that of couplings at a
parallel coupling point.
(In the example of the diagram in Section 4.9.3 (2), the number of parallel
branches is 3 and that of couplings is 2.)
When a WAIT transition is set right after a parallel coupling, the stop completions
of the axes are not included in the waiting conditions if the parallel coupling is
preceded by motion control steps. To perform a parallel coupling on stop
completions, set WAIT transitions before a parallel coupling.
( )
K2 K3 K4 K5
Parallel coupling
G1 If this is WAIT, stop completions of axes started in K2 to K5 are not included in
waiting conditions.
( )
4 − 21
4. SFC PROGRAMS
When you want to branch to routes when a transition condition enables and does
not enable, "Shift Y/N transition" or "WAIT Y/N transition" will be useful.
Name Symbol Function
(When condition
does not enable) • When a transition condition set at Gn enables,
Shift Y/N
Gn execution shifts to the lower step. When that
N
transition (When condition Y
enables) condition does not enable, execution shifts to the
right-connected step.
(When condition
does not enable) • Differences between "Shift Y/N" and "WAIT Y/N"
WAIT Y/N Gn
N are the same as those between "Shift" and
transition (When condition Y
enables) "WAIT".
IFB1
G0 G1 [G 0] [G 1] [G 0] [G 1]
M0 !M0 D0!=K100 D0==K100
IFB1
G0 G1
4 − 22
4. SFC PROGRAMS
POINT
• For the instructions usable in the conditional expressions of "Shift Y/N" or
"WAIT Y/N" transition programs, refer to "Section 3.3.2 (1) Operation
control/transition instruction list".
4 − 23
4. SFC PROGRAMS
• "Shift Y/N" used as selective branch • "WAIT Y/N" used as selective branch
• "Shift Y/N" and "WAIT Y/N" used as • "Shift (or WAIT) Y/N" used with other
parallel branch step/transition as parallel branch or
selective branch
(b) When a coupling precedes "Shift Y/N" or "WAIT Y/N: Provide "coupling-
branch continuation" in between.
4 − 24
4. SFC PROGRAMS
P1 P2
END
• Continuation from "Shift Y/N" or "WAIT Y/N" to "Shift Y/N" or "WAIT Y/N"
(selective branch-selective branch)
END
• When there are two or more connection lines from Y/N side of "Shift Y/N" or
"WAIT Y/N", selective branch→selective branch or parallel branch continues.
4 − 25
4. SFC PROGRAMS
Program name
START
Program
Comment setting cannot be made.
start/end
END
END
Subroutine call/start
Program
step
CLR
Clear step Program name
WAIT Gn
Transition
Shift Y/N Gn
WAIT Y/N Gn
Jump Jump Pn
Max. 64 characters
Displayed in 16 characters × 4 lines
Pointer Pointer Pn
4 − 26
4. SFC PROGRAMS
POINT
(1) SFC comments are stored into the CPU code area.
The CPU code area stores the SFC chart codes, operation control (F/FS)
program codes, transition (G) program codes and SFC comments.
Be careful not to set too many comments to avoid code area overflow.
(Refer to "3.1 SFC Performance Specifications" for the code area sizes.)
(2) You cannot use "," in comment statements.
4 − 27
5. OPERATION CONTROL PROGRAMS
(b) You can set multiple blocks in a single operation control program.
(c) There are no restrictions on the number of blocks that may be set in a single
operation control program. However, one program is within 64k bytes.
Comment
5−1
5. OPERATION CONTROL PROGRAMS
The instruction and data parts are used for the following purposes.
• Instruction part.......... Indicates the function of that instruction.
• Data part................... Indicates the data used in the instruction.
"Assignment: =" structure example
D0 = #0
Bit data
Logical data
5−2
5. OPERATION CONTROL PROGRAMS
b63 (1 bit)
Sign bit field
5−3
5. OPERATION CONTROL PROGRAMS
#100F=SQRT(#200F)
#300F=#100F*#100F
#200F==#300F
Bit data
Logical data
Bit data
Example 2
RST M5 = !X10 * M100
Logical data
Bit data
Logical data
5−4
5. OPERATION CONTROL PROGRAMS
(a) For differentiation, the 32-bit floating-point type is ended by L and the 64-bit
floating-point type by F (:F for the link register).
(b) The timer current value T and counter current value C may be used only as
a 16-bit integer type.
(c) For the 32-bit integer type and 64-bit floating-point type, specify the device
number with an even number. (You cannot use an odd number for setting).
(d) The coasting timer FT is incremented per 888µs. (The coasting timer is a
32-bit integer type.)
(a) When using the device in DIN or DOUT as batch bit data, specify n as a
multiple of 16.
5−5
5. OPERATION CONTROL PROGRAMS
2) You cannot use the word device with which the device number was
specified indirectly.
3) Only one operator may be used.
(Description examples)
D0=SHORT(ASIN(#0F))
W0=#(D0)
5−6
5. OPERATION CONTROL PROGRAMS
The constant descriptions of the 16-bit integer type, 32-bit integer type and 64-bit
floating-point type are indicated below.
(1) The 32-bit integer type is ended by L and the 64-bit floating-point type is
provided with a decimal point and exponent part (E) to denote their data types
explicitly.
(2) The constant without the data type is regarded as the applicable minimum type.
5−7
5. OPERATION CONTROL PROGRAMS
5.4.1 Substitution : =
(3) Functions
(a) The data value specified at (S) is assigned to the specified word device.
(b) When (S) and (D) differ in data type, the data at (S) is converted into the
data type of (D) and the resultant data is assigned.
(When (D) is a 16- or 32-bit integer type and (S) is a 64-bit floating-point
type, the fraction part of (S) is discarded.)
(4) Errors
(a) An operation error will occur if:
1) The data at (S) is outside the data type range of (D); or
2) (D) or (S) is an indirectly specified device and its device number is
outside the range.
#0 123 D0 123
5−8
5. OPERATION CONTROL PROGRAMS
The 64-bit floating-point type is converted into the 32-bit integer type and the
result is assigned.
123
W0 579 +
#0 456
5−9
5. OPERATION CONTROL PROGRAMS
5.4.2 Addition : +
(3) Functions
(a) The data specified at (S2) is added to the data specified at (S1).
(b) When (S1) and (S2) differ in data type, the data of the smaller data type is
converted into that of the greater type before operation is performed.
(4) Errors
(a) An operation error will occur if:
1) (S1) or (S2) is an indirectly specified device and its device number is
outside the range.
123
W0 579 +
#0 456
(b) Program which assigns the result of adding #0F and #10 to D0L
D0L = #0F + #10
#3 #2 #1 #0
D1 D0 1 2 3 4 5.7 8 9
12468.789
DOL 12468 +
#10 1 2 3
The 64-bit floating-point type data are used for addition, and the result is
converted into the 32-bit integer type and then assigned.
5 − 10
5. OPERATION CONTROL PROGRAMS
5.4.3 Subtraction : -
(3) Functions
(a) The data specified at (S2) is subtracted from the data specified at (S1).
(b) When (S1) and (S2) differ in data type, the data of the smaller data type is
converted into that of the greater type before operation is performed.
(4) Errors
(a) An operation error will occur if:
1) (S1) or (S2) is an indirectly specified device and its device number is
outside the range.
123
W0 -333 -
#0 456
(b) Program which assigns the result of subtracting #10 from #0F to D0L
D0L = #0F - #10
#3 #2 #1 #0
D1 D0 1 2 3 4 5.7 8 9
12222.789
D0L 12222 -
#10 1 2 3
The 64-bit floating-point type data are used for subtraction, and the result is
converted into the 32-bit integer type and then assigned.
5 − 11
5. OPERATION CONTROL PROGRAMS
5.4.4 Multiplication : *
(3) Functions
(a) The data specified at (S1) is multiplied by the data specified at (S2).
(b) When (S1) and (S2) differ in data type, the data of the smaller data type is
converted into that of the greater type before operation is performed.
(4) Errors
(a) An operation error will occur if:
1) (S1) or (S2) is an indirectly specified device and its device number is
outside the range.
123
W0 56088 *
#0 456
(b) Program which assigns the result of multiplying #0F by #10 to D0L
D0L = #0F * #10
#3 #2 #1 #0
D1 D0 1 2 3 4 5.7 8 9
1518532.047
D0L 1518532 *
#10 1 2 3
The 64-bit floating-point type data are used for multiplication, and the result
is converted into the 32-bit integer type and then assigned.
5 − 12
5. OPERATION CONTROL PROGRAMS
5.4.5 Division : /
(3) Functions
(a) The data specified at (S1) is divided by the data specified at (S2) to find a
quotient.
(b) When (S1) and (S2) differ in data type, the data of the smaller data type is
converted into that of the greater type before operation is performed.
(4) Errors
(a) An operation error will occur if:
1) (S2) is 0; or
2) (S1) or (S2) is an indirectly specified device and its device number is
outside the range.
456
W0 3 /
#0 123
(b) Program which divides #0F by #10 and assigns a quotient to D0L
D0L = #0F / #10
#3 #2 #1 #0
D1 D0 1 2 3 4 5.7 8 9
100.3722683
D0L 100 /
#10 1 2 3
The 64-bit floating-point type data are used for division, and the quotient is
converted into the 32-bit integer type and then assigned.
5 − 13
5. OPERATION CONTROL PROGRAMS
5.4.6 Remainder : %
(3) Functions
(a) The data specified at (S1) is divided by the data specified at (S2) to find a
remainder.
(b) When (S1) and (S2) differ in data type, the data of the smaller data type is
converted into that of the greater type before operation is performed.
(4) Errors
(a) An operation error will occur if:
1) (S2) is 0; or
2) (S1) or (S2) is an indirectly specified device and its device number is
outside the range.
456
W0 87 %
#0 123
5 − 14
5. OPERATION CONTROL PROGRAMS
(3) Functions
(a) The bit inverted value of the data specified at (S) is found.
(4) Errors
(a) An operation error will occur if:
1) (S) is an indirectly specified device and its device number is outside the
range.
b15 b0 b15 b0
D0 1 1 0 1 1 0 1 0 1 1 0 0 1 0 1 1 #0 0 0 1 0 0 1 0 1 0 0 1 1 0 1 0 0
5 − 15
5. OPERATION CONTROL PROGRAMS
(3) Functions
(a) The bit-by-bit logical product of the data specified at (S1) and the data
specified at (S2) is found.
(b) When (S1) and (S2) differ in data type, the data of the smaller data type is
converted into that of the greater type before operation is performed. At this
time, note that signed data is converted.
(4) Errors
(a) An operation error will occur if:
1) (S1) or (S2) is an indirectly specified device and its device number is
outside the range.
b15 b0
#0 0 0 1 0 0 1 0 1 0 0 1 1 0 1 0 0
b15 b0
D0 0 0 1 0 0 0 0 1 0 0 1 0 0 1 0 0 &
b15 b0
#1 0 0 1 0 1 0 0 1 0 0 1 0 0 1 0 0
5 − 16
5. OPERATION CONTROL PROGRAMS
(3) Functions
(a) The bit-by-bit logical add of the data specified at (S1) and the data specified
at (S2) is found.
(b) When (S1) and (S2) differ in data type, the data of the smaller data type is
converted into that of the greater type before operation is performed. At this
time, note that signed data is converted.
(4) Errors
(a) An operation error will occur if:
1) (S1) or (S2) is an indirectly specified device and its device number is
outside the range.
5 − 17
5. OPERATION CONTROL PROGRAMS
(3) Functions
(a) The bit-by-bit exclusive logical add of the data specified at (S1) and the data
specified at (S2) is found.
(b) When (S1) and (S2) differ in data type, the data of the smaller data type is
converted into that of the greater type before operation is performed. At this
time, note that signed data is converted.
(4) Errors
(a) An operation error will occur if:
1) (S1) or (S2) is an indirectly specified device and its device number is
outside the range.
b15 b0
#0 0 0 1 0 0 1 0 1 0 0 1 1 0 1 0 0
b15 b0
D0 0 0 0 0 1 1 0 0 0 0 0 1 0 0 0 0 ^
b15 b0
#1 0 0 1 0 1 0 0 1 0 0 1 0 0 1 0 0
5 − 18
5. OPERATION CONTROL PROGRAMS
(3) Functions
(a) The data specified at (S1) is shifted to the right by the number of times
specified at (S2).
(b) If the most significant bit of (S1) is 1, 1 enters the most significant bit of the
right shift result.
If the most significant bit of (S1) is 0, 0 enters the most significant bit of the
right shift result.
(c) When (S1) is a 16-bit integer type and (S2) is a negative number or not less
than 16, the result is 0.
(d) When (S1) is a 32-bit integer type and (S2) is a negative number or not less
than 32, the result is 0.
(4) Errors
(a) An operation error will occur if:
1) (S1) or (S2) is an indirectly specified device and its device number is
outside the range.
b15 b0 b15 b0
D0 0 0 0 0 1 0 0 1 0 1 0 0 1 1 0 1 #0 0 0 1 0 0 1 0 1 0 0 1 1 0 1 0 0
5 − 19
5. OPERATION CONTROL PROGRAMS
(3) Functions
(a) The data specified at (S1) is shifted to the left by the number of times
specified at (S2).
(b) 0 enters the least significant bit of the left shift result.
(c) When (S1) is a 16-bit integer type and (S2) is a negative number or not less
than 16, the result is 0.
(d) When (S1) is a 32-bit integer type and (S2) is a negative number or not less
than 32, the result is 0.
(4) Errors
(a) An operation error will occur if:
1) (S1) or (S2) is an indirectly specified device and its device number is
outside the range.
b15 b0 b15 b0
D0 0 1 0 0 1 0 1 0 0 1 1 0 1 0 0 0 #0 0 0 1 0 0 1 0 1 0 0 1 1 0 1 0 0
5 − 20
5. OPERATION CONTROL PROGRAMS
(3) Functions
(a) The sign-inverted value of the data specified at (S) is found.
(4) Errors
(a) An operation error will occur if:
1) (S) is an indirectly specified device and its device number is outside the
range.
D0 -123 #0 123
5 − 21
5. OPERATION CONTROL PROGRAMS
(3) Functions
(a) SIN (sine) operation is performed on the data specified at (S).
(4) Errors
(a) An operation error will occur if:
1) (S) is an indirectly specified device and its device number is outside the
range.
5 − 22
5. OPERATION CONTROL PROGRAMS
(3) Functions
(a) COS (cosine) operation is performed on the data specified at (S).
(4) Errors
(a) An operation error will occur if:
1) (S) is an indirectly specified device and its device number is outside the
range.
5 − 23
5. OPERATION CONTROL PROGRAMS
(3) Functions
(a) TAN (tangent) operation is performed on the data specified at (S).
(4) Errors
(a) An operation error will occur if:
1) (S) is an indirectly specified device and its device number is outside the
range; or
2) (S) is 90+(180*n). (n is an integer)
5 − 24
5. OPERATION CONTROL PROGRAMS
(3) Functions
-1
(a) SIN (arcsine) operation is performed on the SIN value data specified at (S)
to find an angle.
(b) The SIN value specified at (S) must be within the range -1.0 to 1.0.
(4) Errors
(a) An operation error will occur if:
1) (S) is outside the range -1.0 to 1.0; or
2) (S) is an indirectly specified device and its device number is outside the
range.
5 − 25
5. OPERATION CONTROL PROGRAMS
(3) Functions
-1
(a) COS (arccosine) operation is performed on the COS value data specified
at (S) to find an angle.
(b) The COS value specified at (S) must be within the range -1.0 to 1.0.
(4) Errors
(a) An operation error will occur if:
1) (S) is outside the range -1.0 to 1.0; or
2) (S) is an indirectly specified device and its device number is outside the
range.
5 − 26
5. OPERATION CONTROL PROGRAMS
(3) Functions
-1
(a) TAN (arccosine) operation is performed on the TAN value data specified at
(S) to find an angle.
(4) Errors
(a) An operation error will occur if:
1) (S) is an indirectly specified device and its device number is outside the
range.
5 − 27
5. OPERATION CONTROL PROGRAMS
(3) Functions
(a) The square root of the data specified at (S) is found.
(4) Errors
(a) An operation error will occur if:
1) (S) is a negative number; or
2) (S) is an indirectly specified device and its device number is outside the
range.
5 − 28
5. OPERATION CONTROL PROGRAMS
(3) Functions
(a) The base e natural logarithm of the data specified at (S) is found.
(4) Errors
(a) An operation error will occur if:
1) (S) is 0 or a negative number; or
2) (S) is an indirectly specified device and its device number is outside the
range.
5 − 29
5. OPERATION CONTROL PROGRAMS
(3) Functions
(a) Exponential operation is performed on the base e data specified at (S).
(4) Errors
(a) An operation error will occur if:
1) (S) is an indirectly specified device and its device number is outside the
range.
5 − 30
5. OPERATION CONTROL PROGRAMS
(3) Functions
(a) The absolute value of the data specified at (S) is found.
(4) Errors
(a) An operation error will occur if:
1) (S) is an indirectly specified device and its device number is outside the
range.
5 − 31
5. OPERATION CONTROL PROGRAMS
(3) Functions
(a) The rounded-off fractional portion value of the data specified at (S) is found.
(b) If (S) is a negative number, the absolute value of (S) is found and its
fractional portion is rounded off and signed.
(c) If (S) is an integer type, its value is returned unchanged, with no conversion
processing performed.
(4) Errors
(a) An operation error will occur if:
1) (S) is an indirectly specified device and its device number is outside the
range.
(b) Program which finds the rounded-off fractional portion value of D4F and
assigns the result to #0F (when D4F is a negative number)
#0F = RND(D4F)
#3 #2 #1 #0 D7 D6 D5 D4
-33.0 -33.44
5 − 32
5. OPERATION CONTROL PROGRAMS
(3) Functions
(a) The largest integer not greater than the data specified at (S) is found.
(b) If the (S) value is positive, the absolute value will be smaller, and if it is
negative, the absolute value will be greater.
(c) If (S) is an integer type, its value is returned unchanged, with no conversion
processing performed.
(4) Errors
(a) An operation error will occur if:
1) (S) is an indirectly specified device and its device number is outside the
range.
(b) Program which finds the rounded-down fractional portion value of D4F and
assigns the result to #0F (when D4F is a negative number)
#0F = FIX(D4F)
#3 #2 #1 #0 D7 D6 D5 D4
-34.0 -33.54
5 − 33
5. OPERATION CONTROL PROGRAMS
(3) Functions
(a) The smallest integer not less than the data specified at (S) is found.
(b) If the (S) value is positive, the absolute value will be greater, and if it is
negative, the absolute value will be smaller.
(c) If (S) is an integer type, its value is returned unchanged, with no conversion
processing performed.
(4) Errors
(a) An operation error will occur if:
1) (S) is an indirectly specified device and its device number is outside the
range.
(b) Program which finds the rounded-up fractional portion value of D4F and
assigns the result to #0F (when D4F is a negative number)
#0F = FUP(D4F)
#3 #2 #1 #0 D7 D6 D5 D4
-33.0 -33.54
5 − 34
5. OPERATION CONTROL PROGRAMS
(3) Functions
(a) The BCD data specified at (S) is converted into BIN data.
(4) Errors
(a) An operation error will occur if:
1) A value other than 0 to 9 is in any digit of (S); or
2) (S) is an indirectly specified device and its device number is outside the
range.
5 − 35
5. OPERATION CONTROL PROGRAMS
(3) Functions
(a) The BIN data specified at (S) is converted into BCD data.
(4) Errors
(a) An operation error will occur if:
1) The data is other than 0 to 9999 when (S) is a 16-bit integer type;
2) The data is other than 0 to 99999999 when (S) is a 32-bit integer type; or
3) (S) is an indirectly specified device and its device number is outside the
range.
5 − 36
5. OPERATION CONTROL PROGRAMS
(3) Functions
(a) The data specified at (S) is converted into a signed 16-bit integral value.
(c) When (S) is a 64-bit floating-point type, its fractional portion is rounded
down before conversion is made.
(d) If (S) is a 16-bit integer type, its value is returned unchanged, with no
conversion processing performed.
(4) Errors
(a) An operation error will occur if:
1) The (S) data is outside the range -32768 to 32767; or
2) (S) is an indirectly specified device and its device number is outside the
range.
5 − 37
5. OPERATION CONTROL PROGRAMS
(3) Functions
(a) The data specified at (S) is converted into an unsigned 16-bit integral value.
(c) When (S) is a 64-bit floating-point type, its fractional portion is rounded
down before conversion is made.
(d) If (S) is a 16-bit integer type, its value is returned unchanged, with no
conversion processing performed.
(4) Errors
(a) An operation error will occur if:
1) The (S) data is outside the range 0 to 65535; or
2) (S) is an indirectly specified device and its device number is outside the
range.
5 − 38
5. OPERATION CONTROL PROGRAMS
(3) Functions
(a) The data specified at (S) is converted into a signed 32-bit integral value.
(c) When (S) is a 64-bit floating-point type, its fractional portion is rounded
down before conversion is made.
(d) If (S) is a 32-bit integer type, its value is returned unchanged, with no
conversion processing performed.
(4) Errors
(a) An operation error will occur if:
1) The (S) data is outside the range -2147483648 to 2147483647; or
2) (S) is an indirectly specified device and its device number is outside the
range.
5 − 39
5. OPERATION CONTROL PROGRAMS
(3) Functions
(a) The data specified at (S) is converted into an unsigned 32-bit integral value.
(c) When (S) is a 64-bit floating-point type, its fractional portion is rounded
down before conversion is made.
(d) If (S) is a 32-bit integer type, its value is returned unchanged, with no
conversion processing performed.
(4) Errors
(a) An operation error will occur if:
1) The (S) data is outside the range 0 to 4294967295; or
2) (S) is an indirectly specified device and its device number is outside the
range.
5 − 40
5. OPERATION CONTROL PROGRAMS
(3) Functions
(a) The data specified at (S) is converted into a signed 64-bit floating-point value.
(b) If (S) is a 64-bit floating-point type, its value is returned unchanged, with no
conversion processing performed.
(4) Errors
(a) An operation error will occur if:
1) (S) is an indirectly specified device and its device number is outside the
range.
5 − 41
5. OPERATION CONTROL PROGRAMS
(3) Functions
(a) The data specified at (S) is converted into an unsigned 64-bit floating-point
value.
(b) If (S) is a 64-bit floating-point type, its value is returned unchanged, with no
conversion processing performed.
(4) Errors
(a) An operation error will occur if:
1) (S) is an indirectly specified device and its device number is outside the
range.
5 − 42
5. OPERATION CONTROL PROGRAMS
(3) Functions
(a) True is returned when the bit device specified at (S) in a bit conditional
expression is ON (1), or false is returned when that bit device is OFF (0).
(4) Errors
(a) An operation error will occur if:
1) (S) is an indirectly specified device and its device number is outside the
range.
M0 0 (False)
(True)
M100 1 +
X0 1 (True)
5 − 43
5. OPERATION CONTROL PROGRAMS
(3) Functions
(a) True is returned when the bit device specified at (S) in a bit conditional
expression is OFF (0), or false is returned when that bit device is ON (1).
(4) Errors
(a) An operation error will occur if:
1) (S) is an indirectly specified device and its device number is outside the
range.
5 − 44
5. OPERATION CONTROL PROGRAMS
(3) Functions
(a) If the data specified at (S) is true, the bit data specified at (D) is set.
(c) When this instruction is set as a transition condition in the last block of a
transient program, whether the data specified at (S) is true or false is
returned as logical type data.
In this case, (S) cannot be omitted.
(4) Errors
(a) An operation error will occur if:
1) (D) or (S) is an indirectly specified device and its device number is
outside the range.
M0 0
M100 1 + (True)
X0 1
5 − 45
5. OPERATION CONTROL PROGRAMS
#0 100
M100 1 == (True)
D0 100
Y0 1
5 − 46
5. OPERATION CONTROL PROGRAMS
(3) Functions
(a) If the data specified at (S) is true, the bit data specified at (D) is reset.
(c) When this instruction is set as a transition condition in the last block of a
transient program, whether the data specified at (S) is true or false is
returned as logical type data.
In this case, (S) cannot be omitted.
(4) Errors
(a) An operation error will occur if:
1) (D) or (S) is an indirectly specified device and its device number is
outside the range.
M0 0
M100 0 + (True)
X0 1
5 − 47
5. OPERATION CONTROL PROGRAMS
#0 100
M100 0 != (True)
D0 200
Y0 0
5 − 48
5. OPERATION CONTROL PROGRAMS
(3) Functions
(a) The data specified at (S) is output to the bit data specified at (D).
(b) Specify a multiple of 16 as the device number of the bit data specified at
(D).
(c) If the type of (S) is a 16-bit integer type, 16 points of the (S) data, starting at
the least significant bit, are output in order to the bit devices headed by the
one specified at (D).
(d) If the type of (S) is a 32-bit integer type, 32 points of the (S) data, starting at
the least significant bit, are output in order to the bit devices headed by the
one specified at (D).
(4) Errors
(a) An operation error will occur if:
1) (D) or (S) is an indirectly specified device and its device number is
outside the range.
2) (D) is an indirectly specified device and its device number is not a
multiple of 16.
YF Y0 b15 b0
0 0 1 0 0 1 1 1 0 0 0 0 1 1 1 1 D0 0 0 1 0 0 1 1 1 0 0 0 0 1 1 1 1
5 − 49
5. OPERATION CONTROL PROGRAMS
(3) Functions
(a) The bit data specified at (S) is input to the data specified at (D).
(b) Specify a multiple of 16 as the device number of the bit data specified at (S).
(c) If the type of (D) is a 16-bit integer type, 16 points of the (D) data, starting at
the least significant bit, are input in order to the bit devices headed by the
one specified at (S).
(d) If the type of (D) is a 32-bit integer type, 32 points of the (D) data, starting at
the least significant bit, are input in order to the bit devices headed by the
one specified at (S).
(4) Errors
(a) An operation error will occur if:
1) (D) or (S) is an indirectly specified device and its device number is
outside the range.
2) (S) is an indirectly specified device and its device number is not a
multiple of 16.
b15 b0 YF Y0
D0 0 0 1 0 0 1 1 1 0 0 0 0 1 1 1 1 0 0 1 0 0 1 1 1 0 0 0 0 1 1 1 1
5 − 50
5. OPERATION CONTROL PROGRAMS
(3) Functions
(a) Whether the logical type data specified at (S) is true or false is returned
unchanged. (Logical acknowledgement)
(4) Errors
(a) An operation error will occur if:
1) (S) is an indirectly specified device and its device number is outside the
range.
M0 0 (False)
(True)
M100 1 +
X0 1 (True)
5 − 51
5. OPERATION CONTROL PROGRAMS
(3) Functions
(a) The data specified at (S) is logically negated.
(4) Errors
(a) An operation error will occur if:
1) (S) is an indirectly specified device and its device number is outside the
range.
M0 0 (False)
(True) ! (False)
M100 1 +
X0 0 (False)
5 − 52
5. OPERATION CONTROL PROGRAMS
(3) Functions
(a) The data specified at (S1) and the data specified at (S2) are ANDed.
(4) Errors
(a) An operation error will occur if:
1) (S) is an indirectly specified device and its device number is outside the
range.
M0 1
M100 1 * (True)
X0 1
5 − 53
5. OPERATION CONTROL PROGRAMS
5.10.4 Logical OR : +
(3) Functions
(a) The data specified at (S1) and the data specified at (S2) are ORed.
(4) Errors
(a) An operation error will occur if:
1) (S1) or (S2) is an indirectly specified device and its device number is
outside the range.
M0 0
M100 1 + (True)
X0 1
5 − 54
5. OPERATION CONTROL PROGRAMS
5.11.1 Equal to : ==
(3) Functions
(a) The data specified at (S1) and the data specified at (S2) are compared, and
the result is true if they are equal.
(b) When (S1) and (S2) differ in data type, the data of the smaller data type is
converted into that of the greater type before comparison is performed.
(4) Errors
(a) An operation error will occur if:
1) (S1) or (S2) is an indirectly specified device and its device number is
outside the range.
#0 100
== (True)
D0 100
5 − 55
5. OPERATION CONTROL PROGRAMS
(3) Functions
(a) The data specified at (S1) and the data specified at (S2) are compared, and
the result is true if they are not equal.
(b) When (S1) and (S2) differ in data type, the data of the smaller data type is
converted into that of the greater type before comparison is performed.
(4) Errors
(a) An operation error will occur if:
1) (S1) or (S2) is an indirectly specified device and its device number is
outside the range.
#0 100
!= (True)
D0 20
5 − 56
5. OPERATION CONTROL PROGRAMS
(3) Functions
(a) The result is true if the data specified at (S1) is less than the data specified
at (S2).
(b) When (S1) and (S2) differ in data type, the data of the smaller data type is
converted into that of the greater type before comparison is performed.
(4) Errors
(a) An operation error will occur if:
1) (S1) or (S2) is an indirectly specified device and its device number is
outside the range.
#0 10
< (True)
D0 20
5 − 57
5. OPERATION CONTROL PROGRAMS
(3) Functions
(a) The result is true if the data specified at (S1) is less than or equal to the
data specified at (S2).
(b) When (S1) and (S2) differ in data type, the data of the smaller data type is
converted into that of the greater type before comparison is performed.
(4) Errors
(a) An operation error will occur if:
1) (S1) or (S2) is an indirectly specified device and its device number is
outside the range.
#0 10
<= (True)
D0 20
5 − 58
5. OPERATION CONTROL PROGRAMS
(3) Functions
(a) The result is true if the data specified at (S1) is greater than the data
specified at (S2).
(b) When (S1) and (S2) differ in data type, the data of the smaller data type is
converted into that of the greater type before comparison is performed.
(4) Errors
(a) An operation error will occur if:
1) (S1) or (S2) is an indirectly specified device and its device number is
outside the range.
#0 400
> (True)
D0 20
5 − 59
5. OPERATION CONTROL PROGRAMS
(3) Functions
(a) The result is true if the data specified at (S1) is greater than or equal to the
data specified at (S2).
(b) When (S1) and (S2) differ in data type, the data of the smaller data type is
converted into that of the greater type before comparison is performed.
(4) Errors
(a) An operation error will occur if:
1) (S1) or (S2) is an indirectly specified device and its device number is
outside the range.
#0 400
>= (True)
D0 20
5 − 60
5. OPERATION CONTROL PROGRAMS
(3) Functions
(a) A speed change is made in the following procedure.
1) The speed changing flag (M2021 to M2028/M2061 to M2092)
corresponding to the axis specified at (S1) is turned ON.
2) The speed of the axis specified at (S1) is changed to the speed specified
at (S2).
3) The speed changing flag is turned OFF.
(b) The axis number that may be set at (S1) is within the following range.
A173UHCPU(-S1)/
A172SHCPUN
A273UHCPU-S3(32-axis feature)
1 to 8 1 to 32
(c) Operation varies with the sign of the specified speed set at (S2).
Sign of Specified Speed Operation
Positive Speed change
0 Temporary stop
Negative Return
5 − 61
5. OPERATION CONTROL PROGRAMS
(d) The specified speed that may be set at (S2) is within the following range.
1) Real mode
mm inch degree PULSE
Setting range Unit Setting range Unit Setting range Unit Setting range Unit
-2 -3 -3
Speed change 0 to ×10 0 to ×10 0 to ×10 0 to
PLS/s
request 600000000 mm/min 600000000 inch/min 2147483647 degree/min 10000000
-2 -3 -3
-1 to ×10 -1 to ×10 -1 to ×10 -1 to
Return request PLS/s
-600000000 mm/min -600000000 inch/min -2147483647 degree/min -10000000
2) Virtual mode
PULSE
Setting range Unit
Speed change
0 to 10000000 PLS/s
request
Return request -1 to -10000000 PLS/s
(e) Specifying a negative speed and making a speed change request during
starting allows the axis to start deceleration at that point and return in the
opposite direction upon completion of deceleration.
Operation varies with the servo instruction as described below.
Control Mode Servo Instruction Operation
ABS-1 INC-1
ABS-2 INC-2 On completion of deceleration, the axis reverses its
Linear control
ABS-3 INC-3 moving direction, returns to the positioning starting
ABS-4 INC-4 point at the absolute value of the specified speed,
Circular and stops (waits) there.
interpolation ABS circular INC circular For circular interpolation, the axis returns in the
control circular path.
Fixed-pitch feed FEED-1 FEED-2 FEED-3
On completion of deceleration, the axis reverses its
Constant-speed CPSTART1 CPSTART2 moving direction, returns to the preceding point at
control CPSTART3 CPSTART4 the absolute value of the specified speed, and stops
(waits) there.
Speed control (I) VF VR On completion of deceleration, the axis reverses its
moving direction at the absolute value of the specified
Speed speed.
VVF VVR
control (II) The axis does not stop until a stop command is input.
Speed/position
VPF VPR VPSTART
control The axis cannot return.
Position follow- The speed change request is regarded as a normal
PFSTART
up control speed change request.
Speed change Minor error 305 will occur and the axis will be
VSTART
control controlled at the speed limit value.
JOG operation
High-speed A speed change cannot be made. Minor error 310
OSC
oscillation will occur.
A speed change cannot be made. Minor error 301
Zeroing ZERO
will occur.
Reference) Minor error 301: A speed change was made during zeroing.
Minor error 305: The preset speed is outside the range 0 to speed limit value.
Minor error 310: A speed change was made during high-speed oscillation.
5 − 62
5. OPERATION CONTROL PROGRAMS
[Controls]
(a) If a speed change is made to a negative speed, control varies with the
control mode during starting as indicated in the table in Section 5.12.1(3)(e).
(b) The returning command speed is the absolute value of a new speed.
(4) Errors
(a) An operation error will occur and a speed change will not be made if:
1) The specified axis number at (S1) is outside the range; or
2) (S2) is an indirectly specified device and its device number is outside the
range.
(b) A minor error will occur and a speed change will not be made if:
1) The axis specified at (S1) is zeroing; or
2) The axis specified at (S1) is decelerating (minor error 303).
(c) A minor error will occur and the axis to be controlled at the speed limit value
if:
1) The absolute value of the speed specified at (S2) is greater than the
speed limit value.
(Minor error 305)
POINT
If, during constant-speed control, the absolute value of a negative new speed
is higher than the speed specified in the servo program, return control is
exercised at the speed specified in the program (speed clamp control for a
speed change during constant-speed control).
At this time, an error will not occur.
5 − 63
5. OPERATION CONTROL PROGRAMS
(b) Return program which changes the positioning speed of axis 1 to a negative
value
CHGV(K1,K-1000)
CPSTART2 Axis 2
Axis 1
Axis 2
Speed 1000
ABS-2 P2 P3
P1 Axis 1, 10000
Axis 2, 0
ABS-2
P2 Axis 1, 10000
Axis 2, 10000 Negative speed change
ABS-2
P3 Axis 1, 20000 Starting point P1 Axis 1
Axis 2, 10000
CPEND
Start acceptance
M200n
Speed change
request CHGV
Combined speed
Command in-position
(OFF)
Speed change "0"
accepting flag
5 − 64
5. OPERATION CONTROL PROGRAMS
POINT
Speed changing instructions
(1) A speed change may be invalid if it is made from when a servo program
start request is made until the "positioning start completion signal" status
changes to ON. When making a speed change at almost the same timing
as a start, always create a program which will execute the speed change
after the "positioning start completion signal" has turned ON.
(2) A return request, which is made while the axis is at a stop waiting for FIN
using the M code FIN waiting function during constant-speed control, will
be ignored.
(3) In the above example, if a return
request is given right before P2
and the axis passes through P2
during deceleration, the axis will Axis 2
return to P2. P2 P3
(4) The speed change "0" acceptance Return request
flag is not available for the posi- was given here.
tioning-dedicated devices on the
A172SHCPUN.
(5) There will be a delay of time
equivalent to an operation cycle at Starting point P1 Axis 1
the maximum in the response
time from when the CHGV
instruction is executed until the
speed begins to change actually.
5 − 65
5. OPERATION CONTROL PROGRAMS
(3) Functions
(a) The torque limit value of the axis specified at (S1) is changed to the torque
limit value axis specified at (S2).
(b) In the real mode, any axis that has completed a servo startup can be
changed in torque limit value any time, independently of the status, starting,
stopping, servo ON or servo OFF.
(c) The axis number that may be set at (S1) is within the following range.
A173UHCPU(-S1)/
A172SHCPUN
A273UHCPU-S3(32-axes feature)
1 to 8 1 to 32
(d) The torque limit value that may be set at (S2) is within the range 1 to 500[%].
(e) The torque limit value specified here and the one specified in the servo
program have the following relationships.
At start
At a normal start, the torque limit value is given to the servo of the start axis
according to "P. torque" set in the servo program or the "torque limit value"
of the specified parameter block.
For an interpolation start, the torque limit value is given to the number of
axes to be interpolated.
↓
Executing the CHGT instruction gives the preset torque limit value to only
the specified axis.
↓
Thereafter, the torque limit value given to the servo at a servo program start
or JOG start is made valid only when it is lower than the torque limit value
specified in CHGT.
This torque limit value clamp processing is performed per axis.
5 − 66
5. OPERATION CONTROL PROGRAMS
During start
1) If the following torque limit value has been set, it will not be changed to
higher than the torque limit value specified in the CHGT instruction.
• Torque limit value at a midway point in constant-speed control or speed
change control
• Torque limit value at the point of switching to position control in speed/
position changing control
• Torque limit value in speed control II
2) The CHGT instruction accepts a torque limit value which is higher than
the torque limit value set in the servo program or parameter block.
(4) Errors
(a) An operation error will occur and a torque limit value change will not be
made if:
1) The specified axis number at (S1) is outside the range; or
2) (S2) is an indirectly specified device and its device number is outside the
range.
(b) A minor error will occur and a torque limit value change will not be made if:
1) The torque limit value specified at (S2) is outside the range 1 to 500[%]
(minor error 311); or
2) The CHGT instruction is executed for any axis that has not yet been
started (minor error 312).
POINT
(1) In the virtual mode, the CHGT instruction is invalid (ignored).
When changing the torque limit value during operation in the virtual mode,
set the "torque limit value setting device" in the output module parameter
of the machine mechanism program.
(2) There will be a delay of time equivalent to an operation cycle at the
maximum in the response time from when the CHGT instruction is
executed until the torque limit value is changed actually.
5 − 67
5. OPERATION CONTROL PROGRAMS
(3) Functions
(a) The execution of an event task is enabled.
(4) Errors
(a) An operation error will occur if:
1) This instruction is used with other than a normal task.
5 − 68
5. OPERATION CONTROL PROGRAMS
(3) Functions
(a) The execution of an event task is disabled.
(e) The DI status is established at power-on or when a reset is made with the
RUN/STOP switch.
(4) Errors
(a) An operation error will occur if:
1) This instruction is used with other than a normal task.
5 − 69
5. OPERATION CONTROL PROGRAMS
(3) Functions
(a) This is a no-operation instruction and does not affect the preceding
operations.
(4) Errors
(a) There are no operation errors for no operation: NOP.
5 − 70
5. OPERATION CONTROL PROGRAMS
(3) Functions
(a) n words of data in word devices, starting with the one specified at (S), are
batch-transferred to n words of word devices, starting with the one specified
at (D).
(b) Data can be transferred if the word devices of the transfer source and
destination overlap.
Data are transferred from the devices, starting with the one at (S), for
transfer of data from devices of larger numbers to those of smaller
numbers, or starting with the one at (S)+(n-1) for transfer of data from
devices of smaller numbers to those of larger numbers.
5 − 71
5. OPERATION CONTROL PROGRAMS
• Transfer of data to the cam data area is also executed during cam
operation.
Be careful not to perform write while operation is being performed with the
same cam number.
At cam data read
• The cam data in the currently set status are read.
(d) The word devices that may be set at (D), (S) and (n) are as indicated below.
Cam Number
Word Devices
Data to Be Set Designation
Dn Wn #n Nn
(D)
(S)
(n)
(Note) • Nn indicates the cam number.
• You cannot use T, C and special D.
• You cannot specify the device numbers indirectly.
(e) The cam number that may be set as Nn is within the following range.
A173UHCPU(-S1)
A172SHCPUN
/A273UHCPU-S3
1 to 64
101 to 164
1 to 64
201 to 264
301 to 364
(4) Errors
(a) An operation error will occur if:
1) The cam data of the cam number specified at (D) or (S) are not yet
registered to the motion controller;
2) The resolution of the cam number specified at (D) or (S) differs from the
number of transferred words specified at (n);
3) The PCPU memory address specified at (D) or (S) is outside the SRAM
range;
4) (S) to (S)+(n-1) is outside the device range; when (n) specified is a
5) (D) to (D)+(n-1) is outside the device range; or word device
6) (n) is 0 or a negative number.
5 − 72
5. OPERATION CONTROL PROGRAMS
#10 12 D0 12
#11 34 Batch transfer D1 34
#12 56 D2 56
#13 78 D3 78
#14 90 D4 90
(b) Program which batch-transfers 2048 words of data in devices, starting with
#0, to the data area of cam No. 2 (resolution 2048)
BMOV N2,#0,K2048
5 − 73
5. OPERATION CONTROL PROGRAMS
(3) Functions
(a) A wait state continues for the time specified at (S).
The result is false when the elapsed time is less than the preset time, or the
result is true and execution transits when the preset time has elapsed.
(b) When a 16-bit integer type word device is used to specify any of 32768 to
65535ms at (S), convert it into an unsigned 16-bit integral value with
USHORT. (Refer to the program example.)
(4) Errors
(a) An operation error will occur if:
1) (S) is an indirectly specified device and its device number is outside the
range; or
2) Data (device data when device is indirectly specified) at (S) is outside the
range 0 to 2147483647.
(b) Program for a case where there may be a wait of 32768 to 65535ms for 16-
bit integer type indirect designation (#0)
TIME USHORT(#0)
(c) Program which SETS (RSTs) a bit device when the specified time has
elapsed
SET M100 = TIME K60000
5 − 74
5. OPERATION CONTROL PROGRAMS
POINT
(1) When the waiting time setting is indirectly specified with a word device, the
value imported first is used as the device value for exercising control.
The set time cannot be changed if the device value is changed during a
wait state.
(2) The TIME instruction is equivalent to a conditional expression, and
therefore may be set on only the last line of a transition (G) program.
(3) When the transition program (Gn) of the same number having the TIME
instruction setting is used in multiple SFC programs, avoid running them at
the same time. (If they are run simultaneously, the waiting time in the
program run first will be illegal.)
5 − 75
5. OPERATION CONTROL PROGRAMS
(3) Functions
(a) A character string from after // to a block end is a comment.
(4) Errors
(a) There are no operation errors for comment: //.
5 − 76
6. TRANSITION PROGRAMS
6. TRANSITION PROGRAMS
(c) There are no restrictions on the number of blocks that may be set in a
single transition program.
Note that one program is within 64k bytes.
(e) You must set a transition condition in the last block of a transition program.
The transition program is repeated until the transition condition enables,
and when the transition condition has enabled, it shifts to the next step. The
transition condition may be set only in the last block.
(f) As a special transition program, you can create a program where only no
operation (NOP) is set in one block.
Use this program when you want to proceed to the next step on completion
of a servo program run and there are no special conditions to be set as
interlocks. For more information, refer to "4.9 Branches, Couplings".
A transition program example is given below.
1 block
What can be set as a transition condition in the last block are bit conditional
expressions, comparison conditional expressions and device set (SET=)/device
reset (RST=) which return logical data values (true/false). In the case of device set
(SET=)/device reset (RST=), whether the bit or comparison conditional expression
specified at (S) is true or false is a transition condition, and when the transition
condition enables, device set/reset is carried out and execution shifts to the next
step.
Transition condition description examples are given below.
6−1
6. TRANSITION PROGRAMS
POINT
(1) A transition program differs from an operation control program in that a
transition condition is set in the last block.
Other settings are the same as those of the operation control program.
(2) When setting device set (SET=)/device reset (RST=) in the last block as a
transition condition, you cannot omit the bit or comparison conditional
expression to be specified at (S).
(3) You cannot set only the bit or comparison conditional expression in other
than the last block. You can set device set (SET=)/device reset (RST=) in
other than the last block.
6−2
7. MOTION CONTROL PROGRAMS
Positioning Data
Common Circular OSC Parameter block Others
Number of Steps
FIN acceleration/deceleration
Positioning Control
Repeat condition
Positioning
S-pattern ratio
Auxiliary point
Starting angle
Central point
Program No.
Command speed
(constant speed)
Control unit
permissible range
Frequency
Dwell time
Amplitude
M code
Radius
Cancel
processing
Pitch
Start
Skip
Axis
Virtual enable
Number of Steps 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 2 2 2 2 1
*2 *2
Number of indirect
words 1 2 2 1 1 1 2 2 2 2 1 2 1 1 1 1 1 1 1 1 2 1 1 1 2 1(B) 1(B) 1
Absolute 1-axis
ABS-1 positioning
1 axis 1 axis
4 to17
Incremental 1-axis
INC-1 positioning
ABS-2
5` 20
C ƒ
ƒ “ ƒ
N ƒ
Š 2² Ê̂ u
’ Œ ‚¢
ˆ ß › › › ¢ ¢ ¢ ¢ ¢ ¢ ¢ ¢ ¢ ¢ ¢
1) 2)
Number Description
Instruction symbol Gives the servo instructions usable in servo programs.
1)
Processing Gives the processing outlines of the servo instructions.
(1) Indicates positioning data which can be set in servo instructions.
(a) : Item which must be set (if this data is not set, servo instruction cannot be executed)
(b) : Item which is set when required (when this data is not set, default value is used for control)
(2) Allows direct or indirect designation (except axis number)
(a) Direct designation: Set with numerical value.
(b) Indirect designation: Set with word device (D, W).
2) • Servo program run is controlled using the preset word device contents.
• Each setting item may either be 1- or 2-word data.
• For 2-word data, set the first device number.
(3) Number of steps
As there are more setting items, there are more number of instruction steps. (The number of steps is displayed when a
servo program is created.)
(The instruction + item comprise the minimum steps, and one item increases the number of steps by 1.)
3) Items common to the servo instructions
4) Items set in circular interpolation starting servo programs
5) Items set for high-speed oscillation
Set when changing the parameter block (default value when not set) data set in the servo program to exercise control.
6)
(The parameter block data are not changed.)
7) Setting items other than the common, circular and parameter block items (Items to be set vary with the servo instruction.)
8) Indicates the number of steps of each servo instruction.
7−1
7. MOTION CONTROL PROGRAMS
Frequency
range
STOP input-time deceleration
WAIT-ON/OFF
S-pattern ratio
Command speed
Dwell time
M code
Starting angle
Acceleration time
Central point
Pitch
Amplitude
Repeat condition
Skip
Parameter block No.
Program No.
Start
Axis
Deceleration time
Cancel
Address/travel
FIN acceleration/deceleration
Positioning Control
Number of Steps
Processing
Instruction
Symbol
Virtual enable
Number of steps 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 2 2 1 2 1 2
*2 *2
Number of indirect words 1 2 2 1 1 1 2 2 2 1 2 2 2 1 1 2 1 1 1 1 1 2 1 1(B) 2 1(B) 1(B) 1 B
1/
4 to 17
INC-1 Incremental 1-axis positioning
ABS-2 interpolation
Linear control
5 to 20
Incremental 2-axis linear
INC-2 interpolation
Absolute 3-axis linear
3 axes
ABS-3 interpolation
7 to 21
Incremental 3-axis linear
INC-3 interpolation
Absolute 4-axis linear
4 axes
ABS-4 interpolation
8 to 22
Incremental 4-axis linear
INC-4 interpolation
point-specified
Absolute radius-specified
ABS circular interpolation CCW 180°
or more
Incremental radius-specified
6 to 21
INC circular interpolation less than
CW 180°
Incremental radius-specified
INC circular interpolation CW 180°
or more
Incremental radius-specified
INC circular interpolation less than
CCW 180°
Incremental radius-specified
INC circular interpolation CCW 180°
or more
Absolute central point-specified
ABS
Central point-specified
circular interpolation CW
Absolute central point-specified
ABS circular interpolation CCW
Incremental central point- 7 to 22
INC specified circular interpolation
CW
Incremental central point-
INC specified circular interpolation
CCW
: Item which must be set, : Item which is set when required
*1 Only when reference axis speed is specified.
*2 (B) indicates a bit device.
7−2
7. MOTION CONTROL PROGRAMS
Frequency
range
STOP input-time deceleration
WAIT-ON/OFF
S-pattern ratio
Command speed
Dwell time
M code
Pitch
Starting angle
Amplitude
Acceleration time
Repeat condition
Skip
Parameter block No.
Auxiliary point
Central point
Program No.
Start
Axis
Radius
Deceleration time
Cancel
Address/travel
FIN acceleration/deceleration
Positioning Control
Number of Steps
Processing
Instruction
Symbol
Virtual enable
Number of steps 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 2 2 1 2 1 2
*2 *2
Number of indirect words 1 2 2 1 1 1 2 2 2 1 2 2 2 1 1 2 1 1 1 1 1 2 1
1/
1(B) 2 1(B) 1(B) 1 B
1 axis
Fixed-pitch feed
3 to 15
Reverse
rotation
Speed-position control
VPF forward rotation start
4 to 18
Speed-position control
VPR reverse rotation start
Restart
ABS-1 4 to 9
Speed switching control
ABS-3 7 to 12
INC-1 4 to 9
Travel up to speed switching
INC-2 control end point 5 to 10
INC-3 7 to 12
Speed switching point
VABS absolute designation
4 to 6
Speed switching point
VINC incremental designation
Position follow-up
control
start
3-axis constant-speed control
CPSTART3
start
4 to 17
4-axis constant-speed control
CPSTART4
start
7−3
7. MOTION CONTROL PROGRAMS
Frequency
range
STOP input-time deceleration
WAIT-ON/OFF
S-pattern ratio
Command speed
Dwell time
M code
Pitch
Starting angle
Amplitude
Acceleration time
Speed limit value
Repeat condition
Skip
Parameter block No.
Program No.
Start
Axis
Central point
Radius
Deceleration time
Cancel
Address/travel
FIN acceleration/deceleration
Sudden stop deceleration time
Positioning Control
Number of Steps
Processing
Instruction
Symbol
Virtual enable
Number of steps 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 2 2 1 2 1 2
*2 *2
Number of indirect words 1 2 2 1 1 1 2 2 2 1 2 2 2 1 1 2 1 1 1 1 1 2 1 1(B) 2 1(B) 1(B) 1 B
1/
ABS-1 2 to 10
ABS-2 3 to 11
ABS-3 4 to 12
ABS-4 5 to 13
ABS 5 to 14
Constant-speed control
ABS passing point absolute
designation
ABS
4 to 13
ABS
ABS
Constant-speed control
ABS
5 to 14
ABS
INC-1 2 to 10
INC-2 3 to 11
INC-3 4 to 12
INC-4 5 to 13
INC 5 to 14
Constant-speed control
INC passing point incremental
designation
INC
4 to 13
INC
INC
ABS
5 to 14
INC
Constant-speed control
CPEND 1 to 2
end
control, constant-speed control)
Repetition of same control
FOR-TIMES
(used in speed switching
FOR-OFF
High-speed oscillation
OSC 5 to 10
start
Current value change
Servo/virtual servo
Servo CHGA
current value change
Enco Encoder current value
CHGA-E 3
der change
Cam shaft current value
Cam CHGA-C
change
: Item which must be set, : Item which is set when required
*1 Only when reference axis speed is specified.
*2 (B) indicates a bit device.
7−4
7. MOTION CONTROL PROGRAMS
In the real mode, the current value of the specified axis is changed.
In the virtual mode, the current value of the specified virtual servo motor shaft is
changed.
Deceleration time
S-pattern ratio
Cancel
Address/travel
processing
Auxiliary point
permissible range
Parameter block No.
Control unit
Start
Axis
Radius
Central point
Speed Change
Number of
Servo Positioning
Control
Instruction Method
Axes
(2) In the real mode, the current value of the specified axis is changed.
(3) In the virtual mode, the current value of the specified virtual servo motor shaft
is changed.
(4) The axis number used can be set within the following range.
A173UHCPU(-S1)/
A172SHCPUN
A273UHCPU-S3(32-axis feature)
Axis 1 to axis 8 Axis 1 to axis 32
[Program example]
A program for exercising current value change control in the real mode will be
described under the following conditions.
(1) System configuration
The current value change control of axis 2 is performed.
A172SHCPUN A172S A1S
ENC X10
A172B
7−5
7. MOTION CONTROL PROGRAMS
(2) In the real mode, the current value of the specified axis is changed.
(a) The current value change control conditions are indicated below.
Item Setting
Servo program number No.10
Control axis Axis 2
New address 50
CHGA instruction
(4) The axis number used can be set within the following range.
<K 10>
CHGA Current value change control
Axis 2, 50 Used axis .......... Axis 2
New address ..... 50
7−6
7. MOTION CONTROL PROGRAMS
POINT
(1) Current value changing instructions
• When PLC ready (M2000) or PCPU ready (M9074) is OFF, a minor error
100 occurs and a current value change is not made.
• This change is made only during a stop. If a current value change is
made while the specified axis is starting, a minor error 101 (start
acceptance signal of the corresponding axis is ON) occurs and the
current value change is not made.
• If the servo of the corresponding axis is not READY, a major error 1004
occurs and the current value change is not made.
• If the corresponding axis is in a servo error, a major error 1005 occurs
and the current value change is not made.
For SV22
• Set the virtual servo motor shaft's current value change program within
the virtual mode program number range set in "program mode
assignment".
• Set the servo motor (output) shaft's current value change program within
the real mode program number range.
• If a virtual servo motor shaft current value change is executed in the real
mode, a servo program error 903 occurs and the current value change is
not made.
• If a servo motor (output) shaft current value change is executed in the
virtual mode, a servo program error 904 occurs and the current value
change is not made.
• If a current value change is made during mode changing, a servo
program error 907 (real→virtual changing) or 908 (virtual→real switching)
occurs and the current value change is not made.
7−7
7. MOTION CONTROL PROGRAMS
7.3 Synchronous Encoder Shaft Current Value Change Control (SV22 Only)
The current value of the synchronous encoder shaft specified in the virtual mode is
changed.
Deceleration time
S-pattern ratio
Cancel
Address/travel
Auxiliary point
processing
permissible range
Parameter block No.
Control unit
Start
Axis
Radius
Central point
Speed Change
Number of
Servo Positioning
Control
Instruction Method
Axes
(2) The axis number used can be set within the following range.
A273UHCPU-S3
A172SHCPUN A173UHCPU(-S1)
(32-axes feature)
Axis 1 Axis 1 to axis 4 Axis 1 to axis 12
[Program example]
A program for exercising the current value change control of the synchronous
encoder shaft will be described under the following conditions.
P1 axis
7−8
7. MOTION CONTROL PROGRAMS
CHGA-E instruction
Synchronous encoder
shaft current value
changing flag
Current value change
completion
<K 10>
CHGA-C Cam shaft within-one-revolution
Axis 2, 0 current value change control
Output shaft number ..... 1
New address ................. 0
7−9
7. MOTION CONTROL PROGRAMS
POINT
(1) Synchronous encoder current value changing instructions
• The current value change of a synchronous encoder is executed if
operation is being performed in the virtual mode (during pulse input from
the synchronous encoder).
When the current value is changed, the feed current value of the
synchronous encoder continues from the new value.
• The current value change of the synchronous encoder does not affect the
current value of the output module.
• Set the synchronous encoder shaft's current value change program within
the virtual mode program number range set in "program mode
assignment".
• When PLC ready (M2000) or PCPU ready (M9074) is OFF, a minor error
100 occurs and a current value change is not made.
• If a synchronous encoder current value change is executed in the real
mode, a servo program error 903 or 905 occurs and the current value
change is not made. (903 when the current value change servo program
is set to within the virtual mode program number range, or 905 when it is
set to within the real mode program number range.)
• If a current value change is made during mode changing, a servo
program error 907 (real→virtual changing) or 908 (virtual→real switching)
occurs and the current value change is not made.
7 − 10
7. MOTION CONTROL PROGRAMS
7.4 Cam Shaft Within-One-Revolution Current Value Change Control (SV22 Only)
Acceleration time
Speed limit value
Deceleration time
S-pattern ratio
Cancel
Address/travel
Auxiliary point
processing
permissible range
Parameter block No.
Start
Axis
Radius
Central point
Control unit
Speed Change
Number of
Servo Positioning
Control
Instruction Method
Axes
(3) The axis number used can be set within the following range.
A173UHCPU(-S1)/
A172SHCPUN
A273UHCPU-S3(32-axes feature)
Axis 1 to axis 8 Axis 1 to axis 32
[Program example]
A program for exercising the within-one-revolution current value change control of
the cam shaft will be described under the following conditions.
7 − 11
7. MOTION CONTROL PROGRAMS
POINT
(1) Cam shaft within-one-revolution current value changing instructions
• If a new within-one-revolution current value is outside the range 0 to (one-
revolution pulse count - 1), a minor error 6120 occurs and a current value
change is not made.
• Set the cam shaft within-one-revolution current value change program
within the virtual mode program number range set in "program mode
assignment".
• When PLC ready (M2000) or PCPU ready (M9074) is OFF, a minor error
100 occurs and a current value change is not made.
• If a cam shaft within-one-revolution current value change is executed in
the real mode, a servo program error 903 or 905 occurs and the current
value change is not made. (903 when the current value change servo
program is set to within the virtual mode program number range, or 905
when it is set to within the real mode program number range.)
• If a current value change is made during mode changing, a servo
program error 907 (real→virtual changing) or 908 (virtual→real switching)
occurs and the current value change is not made.
7 − 12
8. MOTION DEVICES
8. MOTION DEVICES
The motion registers (#0 to #8191) and coasting timer (FT) are available as motion
CPU (PCPU)-dedicated devices.
They can be used in operation control (F/FS) programs or transition (G) programs.
They cannot be accessed directly from the PLC. When using them on the PLC
side, assign them to the PLC devices.
#8000
Cleared at power-on or key-reset only.
(66 points)
SFC dedicated devices
#8066 (192 points)
Not cleared
(126 points)
#8191
POINT
The motion registers (#) cannot be set as indirectly specified devices of
mechanical system programs.
8−1
8. MOTION DEVICES
8−2
8. MOTION DEVICES
Description
NO. Signal Name
SFC control errors Conventional errors
Error SFC
0 to 255 : SFC program number in error
+0 program -1
-1 : Independent of SFC program
number
3: Minor/major error
(Output module in real mode/virtual mode (SV22 only))
4: Minor/major error (virtual servo motor shaft) (SV22 only)
1 :F/FS 5: Minor/major error (synchronous encoder shaft) (SV22 only)
2 :G 6: Servo error
1 Error type -2 :SFC chart 7: Servo program error
-1 :K or other 8: Mode change error (SV22 only)
(not any of F/FS, G and SFC chart) 9: Manual pulse generator axis setting error
10: Test mode request error
11: PCPU WDT error
12: Personal computer link communication error
0 to 4095 : Servo program number when error type is "3 (in
0 to 4095 : F/FS, G, K program number real mode)", "4" or "7"
Error program
2 0 to 255 : GSUB program number -1 : Others (including no start, JOG, manual pulse
number
-1 : Independent of F/FS, G, K, GSUB generator or test mode zeroing/servo startup/servo
diagnostic start)
0 to 8191 : F/FS or G program's block number
Error block (line number) when error type is "1"
number/SFC or "2" 1 to 32 : Corresponding axis number when error type is any of
3 list line 0 to 8188 : SFC list line number when error "3" to "6"
number/axis type is "-2" -1 : Others
number -1 : Independent of block when error
type is "-1" or error type is "1" or "2"
• Conventional error code (less than 16000) when error type is
any of "3" to "6"
• Error code stored in D9190 when error type is "7"
16000 and later • Error code stored in D9193 (A273UH-S3)/D9195 (A172SH)
4 Error code
(Refer to "15. Error List".) when error type is "8"
• -1 when error type is "9" or "10"
• Error code stored in D9184 when error type is "11"
• Error code stored in D9196 when error type is "12"
Year
5
Error /month
occurr Day/ The PLC clock data (D9025, D9026, D9027) are set.
6
ence hour (BCD code, year in its lower 2 digits)
time Minute/
7
second
8−3
8. MOTION DEVICES
In the user program, when the "SFC error detection signal (M2039)" turns ON,
read the error history, and then reset the "SFC error detection signal (M2039)".
After that, at occurrence of a new error, "SFC error detection signal (M2039)"
turns ON again.
POINT
• Resetting the "SFC error detection signal (M2039)" will not reset (clear to
zero) the "SFC error history devices (#8000 to #8063)".
After power-on, they always manage the error history continuously.
• Set the clock data and clock data read request (M9028) in the user program.
8−4
9. TASK OPERATIONS
9. TASK OPERATIONS
When to execute SFC program processing can be set only once in the program
parameter (refer to Chapter 11 SFC Parameters) per program.
These processing timing brackets are called tasks.
Roughly classified, there are the following three different tasks.
[Points]
(a) The SFC program which includes motion control steps should be set to a
normal task.
(b) During execution of an event or NMI task, the execution of the normal task
is suspended.
Note that since the normal task allows the event task disable instruction
(DI) to be described in an operation control step, the event task can be
disabled in the area enclosed by the event task disable instruction (DI) and
event task enable instruction (EI).
9−1
9. TASK OPERATIONS
[Points]
(a) You can set plural events to one SFC program. However, you cannot set
plural fixed cycles.
(b) Multiple SFC programs can be run by one event.
(c) Motion control steps cannot be executed during the event task.
(d) The event task cannot be executed when it is disabled by the normal task.
The event that occurred during event task disable is executed the moment
the event task is enabled.
[Errors]
An attempt to execute a motion control step in an SFC program set to the
event task will result in an SFC program error 16113 and stop the SFC
program that is running.
[Points]
(a) Among the normal, event and NMI tasks, the NMI task has the highest
priority.
(b) If the event task is disabled (DI) by the normal task, the interruption of the
NMI task is executed, without being masked.
[Errors]
During an NMI task, a motion control step cannot be executed.
Presence of a motion control step during an NMI task will result in an SFC
program error 16113 and stop the SFC program which is running.
9−2
9. TASK OPERATIONS
The following example gives how the SFC programs run by multiple tasks are
executed.
3.5ms NMI interrupt NMI interrupt
When there are programs which are run by the NMI task, 3.5ms fixed-cycle even
task and normal task,
(1) The 3.5ms fixed-cycle event task run its program at intervals of 3.5ms;
(2) The NMI task runs its program with the highest priority when an NMI interrupt is
input; and
(3) The normal task runs its program at free time.
as shown above.
[Points]
A single SFC program can be run partially by another task by setting the area to
be executed by another task as a subroutine and setting a subroutine running task
as another task.
Example) No. 0 Main SFC program Normal task
No. 1 Subroutine Event task (3.5ms cycle)
9−3
10. PROGRAMMING INSTRUCTIONS
Note the following points when SET/RST/DOUT of the bit devices which are
enabled for SET/RST/DOUT from a sequence program, e.g. M devices, is
executed in an SFC program.
(1) The bit devices which are SET/RST/DOUT in an SFC program should not be
SET/RST/OUT in a sequence program.
(2) Reversely, the bit devices which are SET/RST/OUT in a sequence program
should not be SET/RST/DOUT in an SFC program.
(3) The above exclusive control should be exercised for each bit device in
increments of consecutive 16 points, starting with the device number which
begins with a multiple of 16.
[Points]
(1) The user should predetermine how to use bit devices, e.g.
M112 to M127: SET/RST executed on the SFC program side
M128 to M143: SET/RST executed on the sequence program side
(2) Care should be taken since the first command device of each axis does not
begin with a multiple of 16.
When command devices among the following motion-dedicated bit devices are
SET/RST in an SFC program, there will be a delay in refresh time as indicated
below.
There will also be a refresh delay when devices are SET/RST in an SFC program
and their results are used in the SFC program.
10ms END(Note)
A172SHCPUN M2000 to M2015 M2016 to M2047
A173UHCPU(-S1)
M2000 to M2047 M2048 to M2095
A273UHCPU-S3(32-axes feature)
(Note): END indicates a "sequence program scan time".
10 − 1
10. PROGRAMMING INSTRUCTIONS
When a cancel start has been set in the setting items of the servo program which
was started at the motion control step of an SFC program, the cancel of the
running servo program is valid but the servo program specified to start after a
cancel is ignored, without being started.
The following example shows an SFC program which exercises control equivalent
to a cancel start.
K0 Selective branch
(1) You cannot use the SVST, CHGV, CHGA and CHGT (DSFRP and DSFLP also
included when the A172SHCPUN is used) motion-dedicated instructions in
sequence programs.
Doing so will cause an error (INSTRUCT CODE ERR.) in the PLC.
(2) When reading and using 2-word monitor data, such as a feed current value, or
2-word data written with an SFC program, always import it into a user device
once using the "DMOV(P)" instruction, and perform magnitude comparison or
similar operation using the device that imported the data.
10 − 2
11. SFC PARAMETERS
[Description]
With "execution of active step → judgment of next transition condition →
transition processing performed when condition enables (transition of active
step)" defined as a single basic operation of SFC program running control in the
execution cycle of the corresponding task, this operation is performed for the
number of active steps to terminate processing once.
The same operation is then repeated in the next cycle to perform processing.
In this case, the transition destination step is executed in the next cycle when
the transition condition enables.
POINT
Set the number of consecutive transitions to each of the SFC programs run by
event and NMI tasks.
[Errors]
These parameters are imported and checked when PLC ready (M2000) turns
from OFF to ON.
When the value that was set is outside the setting range, the following SFC
error is set and the initial value is used to exercise control.
Error Factor
Error Code Error Processing Corrective Action
Name Definition
Normal task The normal task's consecutive The initial value of 3 is used Turn PLC ready (M2000)
consecutive transition count of the SFC for control. OFF, make correction to set
17000
transition count program run by the normal task is the value of within the range,
error outside the range 1 to 30. and write it to the CPU.
11 − 1
11. SFC PARAMETERS
[Description]
Set whether 16 interrupt input points (I0 to I15) of the AI61 interrupt input
module loaded in the motion slot are used as NMI or event task inputs.
Setting can be made freely per point.
All points default to event tasks.
[Errors]
None.
11 − 2
11. SFC PARAMETERS
11 − 3
11. SFC PARAMETERS
[Description]
The following control is governed by "automatically started or not" setting.
11 − 4
11. SFC PARAMETERS
[Errors]
None.
POINT
When you want to automatically restart the program run by the normal task
from the initial step at end of a single cycle operation, write the program so
that it is not ended by END but it returns to the starting step by a jump.
11 − 5
11. SFC PARAMETERS
[Description]
Set the timing (task) to run a program.
Specify whether the program will be run by only one of the "normal task (main
cycle), event task (fixed cycle, external interrupt, SCPU interrupt) and NMI task
(external interrupt)".
When you have set the event task, you can set multiple events out of the "fixed
cycle, external interrupt (for event task) and SCPU interrupt".
Note that multiple fixed cycles cannot be set to a single SFC program.
Example) Interrupt setting: Inputs for event task I6, I7, I8, I9, I10, I11, I12, I13,
I14 and I15
SFC program No. 10 - event: Fixed cycle (3.5ms)
SFC program No. 20 - event:
Fixed cycle (1.7ms) + external interrupt (I6)
SFC program No. 30 - event:
External interrupts (I7, I15) + SCPU interrupt
When you have set the NMI task, you can set multiple interrupt inputs out of the
external interrupts (for NMI task).
Example) Interrupt setting: Inputs for NMI task I0, I1, I2, I3, I4, I5
SFC program No. 10 - NMI: I0
SFC program No. 20 - NMI: I1 + I2
SFC program No. 30 - NMI: I5
[Errors]
This parameter is imported when PLC ready (M2000) turns from OFF to ON,
and is checked at an SFC program start (automatic start, start from PLC or
subroutine start).
When the value is unauthorized, either of the following SFC errors is set and
the initial value is used for control.
Error Factor
Error Code Error Processing Corrective Action
Name Definition
Among the normal, event and
Executed task
17010 NMI tasks, more than one or none
setting is illegal Turn PLC ready (M2000) OFF,
of them has been set. The initial value (normal task)
make correction, and write a
Executed task is used for control.
Two or more fixed cycles of the correct value to the CPU.
17011 setting is illegal
event task have been set.
(event)
POINT
(1) Since the executed task setting can be made per SFC program number,
multiple programs need not be written for single control (machine
operation) to divide execution timing-based processings.
For example, this can be achieved easily by subroutine starting the areas
to be run in fixed cycle and to be run by external interrupt partially in an
SFC program run by the normal task.
(2) The executed task of the subroutine called program is controlled like that
of the call source program.
Hence, this setting is invalid but it is recommended to make the same
setting as the call source program.
11 − 6
11. SFC PARAMETERS
[Description]
Set the number of consecutive transitions to each program run by the event or
NMI task.
Refer to Section 11.1 for the "number of consecutive transitions".
[Errors]
This parameter is imported when PLC ready (M2000) turns from OFF to ON,
and is checked at an SFC program start (automatic start, start from PLC or
subroutine start).
When the value is unauthorized, either of the following SFC errors is set and
the initial value is used for control.
Error Factor
Error Code Error Processing Corrective Action
Name Definition
Event task The set number of consecutive
consecutive transitions of the SFC program
17001
transition count started by the event task is Turn PLC ready (M2000)
error outside the range 1 to 10. The initial value of 1 is used OFF, make correction to set
NMI task for control. the value within the range,
consecutive NMI task consecutive transition and write it to the CPU.
17002
transition count count error
error
POINT
The number of consecutive transitions of the subroutine called program is the
same as that of the call source program.
Hence, this setting is invalid but it is recommended to make the same setting
as the call source program.
[Description]
Set the operation to be performed at execution of the END step to the program
run by the event or NMI task.
This varies the specifications for the following items.
POINT
The END operation of the subroutine called program is controlled as an "end".
11 − 7
11. SFC PARAMETERS
• Automatically started
• Executed task = event 3.5ms
• Number of consecutive transitions = 2
• END operation "Continued"
F2
2) Program is run in 3.5ms cycle 5) Program is run in 3.5ms cycle
(second time). (fifth time).
F3
11 − 8
12. HOW TO RUN SFC PROGRAM
[Operations]
An automatic start is made by turning PLC ready M2000 ON.
[Operations]
A start is made by executing a subroutine call/start step in the SFC program.
For details of the subroutine call/start step, refer to Chapter 4 SFC Programs.
12 − 1
12. HOW TO RUN SFC PROGRAM
The SFC program can be started by executing the following instruction in the
sequence program.
Usable Devices
Carry
Digit Designation
Number of Steps
Const Point Error Flag
Bit devices Bit devices Level Flag
-ants -ers
Subset
Index
A A M M M
X Y M L S B F T C D W R Z V K H P I N
0 1 9012 9010 9011
(D)
13
N
Sequence program
[Execution condition]
SFCS n
Execution command
[Controls]
A request to start the specified SFC program is given on the leading edge
(OFF→ON) of the SFCS instruction execution command in the sequence program.
The SFC program to be started may be run by any of the normal task, event task
and NMI task.
(1) This instruction is always valid in any of the real mode, virtual mode and mode
changing status.
Execution instruction
SFCS instruction
12 − 2
12. HOW TO RUN SFC PROGRAM
[Errors]
At occurrence of any of the following errors, an SFC error is set to the SFC-
dedicated devices "SFC error history devices (#8000 to #8039)" and SFC error
detection M2039, and the SFC program is not started.
Error Factor
Error Code Error Factor Corrective Action
Corrective Action Definition
At a start made by SFCS , PLC Provide ON of PLC ready
PLC ready OFF
16000 ready (M2000) or PCPU ready (M2000) and PCPU ready
(SFCS)
(M9074) is OFF. (M9074) as start interlocks.
At an SFC program start made by Check the SFC program
SFC program
SFCS , the SFC program number, and correct it to a
16001 number error
number specified is outside the correct sequence program.
(SFCS)
range 0 to 255.
At an SFC program start made by The specified SFC program Check the SFC program
SFCS , the specified SFC number, and correct it to a
No SFC program does not start.
16002 program does not exist. correct sequence program, or
(SFCS)
create an SFC program not
yet created.
At an SFC program start made by Double start should be
SFCS , the same SFC program managed on the user side.
Double start error
16003 is already starting. Provide the user's starting
(SFCS)
signal as a start interlock in
the sequence program.
12 − 3
12. HOW TO RUN SFC PROGRAM
[Operations]
[Points]
(1) Multiple ENDs can be set in a single SFC program.
Executing the clear step set in the SFC program stops the run of the SFC program
specified in the clear step.
Use a subroutine start to stop the SFC program which is running and switch it to
another SFC program.
SFC program changing example using subroutine start
MAIN
SUB
END
There are no specific information that indicates which SFC program is running. Use
a user program (SFC program/sequence program) to manage the running
program.
12 − 4
12. HOW TO RUN SFC PROGRAM
Usable Devices
Carry
Digit Designation
Number of Steps
Cons Point- Error Flag
Bit devices Bit devices Level Flag
-tants ers
Subset
Index
A A M M M
X Y M L S B F T C D W R Z V K H P I N
0 1 9012 9010 9011
(D)
13
N
Sequence program
[Execution condition]
ITP
Execution command
[Controls]
An interruption to the motion CPU (PCPU) is generated on the leading edge
(OFF→ON) of the ITP instruction execution command in the sequence program.
When an interruption is generated by the SCPU, the motion CPU processes the
active step of the SFC program to be executed at a "PLC interrupt".
(1) This instruction is always valid in any of the real mode, virtual mode and mode
changing status.
Execution instruction
ITP instruction
IT to PCPU generated Event task executed
(2) When the motion side is in the DI (interrupt disable) status, event processing
stands by until the EI (interrupt enable) instruction is executed.
12 − 5
12. HOW TO RUN SFC PROGRAM
[Errors]
At occurrence of the following error, an SFC error is set to the SFC-dedicated
devices "SFC error history devices (#8000 to #8039)" and SFC error detection
M2039, and the SFC program's active step to be executed at a "PLC interrupt" is
not processed.
Error Factor
Error Code Error Processing Corrective Action
Name Definition
ITP was executed with PLC ITP was executed with PLC ITP was executed with PLC
PLC ready OFF
16004 ready (M2000) or PCPU ready ready (M2000) or PCPU ready (M2000) or PCPU
(ITSP)
(M9074) OFF. ready (M9074) OFF. ready (M9074) OFF.
12 − 6
13. SFC PROGRAM CONTROLLING OPERATIONS
When the CPU is powered off or a key reset operation is performed, SFC
programs run as described below.
(1) When the CPU is powered off or a key reset operation is performed, SFC
programs stop running.
(2) At CPU power-off or key-reset, the contents of the motion registers #0 to #7999
are held. Initialize them in SFC programs as required.
(3) After CPU power-on or key reset processing, SFC programs run as described
below.
• The SFC programs set to start automatically are run from the beginning by
turning PLC ready M2000 ON in the sequence program.
• The other SFC programs are also run from the beginning when started.
When the CPU is set to the RUN mode, the following operation is performed.
(1) When the CPU is placed in the STOP mode, SFC programs stop.
(2) When SFC programs are stopped in the STOP mode, all outputs turn OFF.
13 − 1
13. SFC PROGRAM CONTROLLING OPERATIONS
[M2000 OFF→ON]
If there is no fault when PLC ready (M2000) turns from OFF to ON, the PCPU
ready flag M9074 turns ON.
When this PCPU ready flag M9074 turns ON, SFC programs can be run.
[M2000 ON→OFF]
When PLC ready (M2000) turns OFF, SFC programs stop running and the PCPU
ready flag M9074 turns OFF.
Since outputs are held, turn OFF necessary outputs in the sequence program after
the PCPU ready flag M9074 has turns OFF.
[Points]
(1) While the PCPU ready flag M9074 is ON, the outputs Y of the PBUS do not
provide data to actual outputs if write is performed from the sequence program.
However, while the PCPU ready flag M9074 is OFF, the outputs Y of the PBUS
provide data to actual outputs when write is performed from the sequence
program.
POINT
When the PLC ready signal M2000 turns OFF, SFC programs stop but
outputs Y in the SFC programs do not turn OFF.
Turn them OFF as required in the sequence program.
13 − 2
13. SFC PROGRAM CONTROLLING OPERATIONS
ERROR
Processing for
Processing for P0 SFC program B
SFC program A
Whether error occurred in corresponding SFC program
G0 G1 or not is judged by SFC error detection signal M2039
and #8056 (latest error SFC program number).
P0
At SCPU WDT ERROR occurrence, all SFC programs running stop and all outputs
turn OFF.
13 − 3
14. USER FILES
POINT
(1) Set the "project name" on the project management screen.
(2) The "project name" is restricted to 256 characters in length.
(3) The "project path name" + "project name" are restricted to 256 characters
in length.
((Example) "C: Usr ...... project name ")
14 − 1
14. USER FILES
* (13) System setting data file svsystem.bin System setting data information file
High speed read setting file svlatch.bin
(15) Mechanical system svedtda1.bin Mechanical system program edit information file (pages 1 to 8)
program editing file svedtda2.bin(Note) Mechanical system program edit information file (pages 9 to 16)
(Note): For 32-axes feature Mechanical system program edit information file (pages 17 to 24)
svedtda3.bin(Note)
only
svedtda4.bin(Note) Mechanical system program edit information file (pages 25 to 32)
* (16) Mechanical system svmchprm.bin File after conversion of mechanical system program edit For
program conversion file information file svedtdan.bin into internal codes SV22
only
* (17) Cam data conversion file svcamprm.bin Cam data file of cam No. 1 to No. 64
svcamprm3.bin(Note) Cam data file of cam No. 201 to No. 264
(Note): For 32-axes feature Cam data file of cam No. 101 to No. 164
svcamprm2.bin(Note)
only
svcamprm4.bin(Note) Cam data file of cam No. 301 to No. 364
(18) Backup data file svbackup.bin Information file 1 for backup and load
svbackup2.bin Information file 2 for backup and load
14 − 2
15. ERROR LISTS
15 − 1
15. ERROR LISTS
15 − 2
15. ERROR LISTS
15 − 3
15. ERROR LISTS
15 − 4
15. ERROR LISTS
15 − 5
15. ERROR LISTS
15 − 6
15. ERROR LISTS
15 − 7
15. ERROR LISTS
Table 15.6 SFC Program Start Errors (Error Code 17010 to 17019)
15 − 8
16. LIMIT SWITCH OUTPUT FUNCTION
16.1 Operations
(1) The limit switch output function provides an ON output to an output device while
the watch data value is in the ON output region set with (ON Value) and (OFF
Value).
(a) The (ON Value), (OFF Value) and watch data value are handled as signed
data.
The ON output region where an ON output is provided to the output device
is governed by the magnitude relationship between (ON Value) and (OFF
Value) as indicated below.
OFF Value
ON region setting
ON Value
ON Value
ON region setting
OFF Value
16 − 1
16. LIMIT SWITCH OUTPUT FUNCTION
(b) The limit switch outputs are controlled on the basis of each watch data in
the PCPU ready status (M9047: ON) after PLC ready (M2000) has turned
from OFF to ON.
When the PCPU ready flag (M9047) turns OFF, all points turn OFF.
When (ON Value) and (OFF Value) are specified with word devices, the
word device contents are imported to the internal area when PLC ready
(M2000) turns from OFF to ON.
Thereafter, in each motion operation cycle, the word device contents are
imported to control the limit switch outputs.
(c) You can set multiple outputs (up to 32 points) to one piece of watch data.
In each setting, the output device may be the same.
If multiple ON region settings have been made to the same output device,
the logical add of the output results in the regions is output.
OFF Value
ON region setting No. 2
ON Value
OFF Value
ON region setting No. 1
ON Value
(2) You can set an output enable/disable bit to enable/disable the limit switch
outputs point-by-point.
Limit switch output control is exercised when the output enable/disable bit is
ON, and the output is OFF when it is OFF.
When there is no setting, the outputs are always enabled.
(3) You can set a forced output bit to forcibly provide (turn ON) the limit switch
outputs point-by-point.
The output is ON when the forced output bit is ON.
This setting overrides OFF (disable) of the "output enable/disable bit".
When there is no setting, no forced outputs are always provided.
16 − 2
16. LIMIT SWITCH OUTPUT FUNCTION
(4) When multiple pieces of watch data, ON region, output enable/disable bit and
forced output bit are set to the same output device, the logical add of the output
results of the settings is output.
M9074 ON
OFF Value
ON region setting
ON Value
Enable/disable bit
Output ON
(Forced output)
16 − 3
16. LIMIT SWITCH OUTPUT FUNCTION
Import Refresh
No. Item Setting Range Remarks
Cycle Cycle
Operation
1 Output device Bit device (X, Y, M, L, B)
cycle
Motion control data/
word device (D, W, #, absolute address) Operation
2 Watch data
(16-bit integer type/32-bit integer type/ cycle
64-bit floating-point type)
Operation
ON Value Word device (D, W, #)/constant (K, H)
ON region cycle
3
setting Operation
OFF Value Word device (D, W, #)/constant (K, H)
cycle
ON: Enable
Output enable/disable Bit device (X, Y, M, L, B, F, TT, TC, CT, CC, special M)/ Operation
4 OFF: Disable
bit none (default) cycle
None: Always enable
None: No forced
Bit device (X, Y, M, L, B, F, TT, TC, CT, CC, special M)/ Operation
5 Forced output bit output always provided
none (default) cycle
(OFF status)
16 − 4
16. LIMIT SWITCH OUTPUT FUNCTION
(Nore-2): Note the following points when setting Y as the output device.
• When Y is set, response will be as indicated below.
Y Classification Response
PLC device
PBUS Motion operation cycle
Actual output
PLC device Motion operation cycle
Refresh system
Actual output Motion operation cycle + PLC scan time
SBUS Direct system PLC device Motion operation cycle
(A172SHCPUN
Actual output Not provided
only)
• When the STOP→RUN time output mode of the PLC is set to "before
operation", performing the following operation to change the output device
setting may cause the ON/OFF status of the previously set output device to be
output continuously, resulting in an unexpected output status.
If such operation must be performed, set the STOP→RUN time output mode of
the PLC to "after 1 scan run".
(Note-3): As the output devices, M2001 to M2032 cannot be used with the
A173UHCPU
(-S1)/A273UHCPU-S3, and M2001 to M2008 with the A172SHCPUN.
While PCPU ready (M9074) is ON, do not perform write from the
sequence ladder to the 16-point range which begins with a multiple of 16,
including the output device.
Such write operation will not be guaranteed.
The other devices in this range should be used in motion SFC operation
control/transition control programs (SET/RST/DOUT).
(Device range example: When the output device is M10, M0 to M15 are in
the corresponding range.)
16 − 5
16. LIMIT SWITCH OUTPUT FUNCTION
*1 If the specified absolute address is outside the SRAM range of the motion
controller, limit switch output control for the corresponding watch data is not
exercised.
3) When you have set any device data, specify the following data type as
the data type to be compared.
16 − 6
16. LIMIT SWITCH OUTPUT FUNCTION
16 − 7
16. LIMIT SWITCH OUTPUT FUNCTION
16 − 8
APPENDICES
APPENDICES
APP − 1
APPENDICES
A172SHCPUN/
A273UHCPU-S3
Classification Symbol Instruction Operation Expression A173UHCPU(-S1)
Unit (µs)
Unit (µs)
#0=#1^#2 21.2 25.2
D0=D1^D2 29.4 32.7
^ Bit exclusive OR
#0L=#2L^#4L 30.3 36.2
D0L=D2L^D4L 45.7 59.7
#0=#1>>#2 21.4 25.6
D0=D1>>D2 30.2 33.2
Bit operation >> Bit right shift
#0L=#2L>>#4L 30.8 37.7
D0L=D2L>>D4L 46.9 61.8
#0=#1<<#2 21.8 25.6
D0=D1<<D2 30.5 33.2
<< Bit left shift
#0L=#2L<<#4L 31.7 36.8
D0L=D2L<<D4L 47.4 59.8
#0=−#1 18.5 22.4
D0=−D12 26.4 29.4
Sign inversion #0L=−#2L 26.1 31.8
Sign −
(Complement of 2) D0L=−D2L 41.5 53.3
#0F=−#4F 27.8 35.5
D0F=−D4F 44.6 59.2
#0F=SIN (#4F) 59.6 68.1
SIN Sine
D0F=SIN (D4F) 76.4 92.2
#0F=COS (#4F) 61.2 88.5
COS Cosine
D0F=COS (D4F) 77.9 111.1
#0F=TAN (#4F) 90.7 98.1
TAN Tangent
D0F=TAN (D4F) 108.0 121.0
#0F=ASIN (#4F) 86.2 72.3
ASIN Arcsine
D0F=ASIN (D4F) 103.5 95.9
#0F=ACOS (#4F) 89.5 75.1
ACOS Arccosine
D0F=ACOS (D4F) 107.0 100.3
#0F=ATAN (#4F) 70.9 86.9
ATAN Arctangent
D0F=ATAN (D4F) 88.9 110.5
#0F=SQRT (#4F) 45.1 70.0
SQRT Square root
D0F=SQRT (D4F) 62.2 94.0
#0F=LN (#4F) 55.8 78.3
LN Natural logarithm
D0F=LN (D4F) 73.8 102.0
#0F=EXP (#4F) 47.0 85.3
Standard function EXP Exponential operation
D0F=EXP (D4F) 65.3 108.7
#0F=ABS (#4F) 30.0 37.6
ABS Absolute value
D0F=ABS (D4F) 47.0 62.0
#0F=RND (#4F) 41.1 53.5
RND Round-off
D0F=RND (D4F) 59.1 77.9
#0F=FIX (#4F) 31.3 46.1
FIX Round-down
D0F=FIX (D4F) 48.4 70.6
#0F=FUP (#4F) 30.2 48.2
FUP Round-up
D0F=FUP (D4F) 46.7 71.7
#0=BIN (#1) 21.1 25.0
DO=BIN (D1) 29.0 33.5
BIN BCD→BIN conversion
#0L=BIN (#2L) 29.2 35.5
D0L=BIN (D2L) 44.9 56.8
#0=BCD (#1) 31.6 55.4
DO=BCD (D1) 39.4 63.9
BCD BIN→BCD conversion
#0L=BCD (#2L) 45.6 106.1
D0L=BCD (D2L) 62.5 128.7
APP − 2
APPENDICES
A172SHCPUN/
A273UHCPU-S3
Classification Symbol Instruction Operation Expression A173UHCPU(-S1)
Unit (µs)
Unit (µs)
#0=SHORT (#2L) 22.8 26.9
Conversion into 16-bit integer #0=SHORT (#4F) 31.0 47.5
SHORT
type (signed) D0=SHORT (D2L) 33.5 39.9
D0=SHORT (D4F) 42.2 57.7
#0=USHORT (#2L) 23.3 27.0
Conversion into 16-bit integer #0=USHORT (#4F) 30.4 47.1
USHORT
type (unsigned) D0=USHORT (D2L) 33.9 39.9
D0=USHORT (D4F) 41.5 57.2
#0L=LONG (#2) 24.4 28.5
Conversion into 32-bit integer #0L=LONG (#4F) 35.4 50.4
LONG
type (signed) D0L=LONG (D2) 40.6 50.2
D0L=LONG (D4F) 52.2 74.5
Type conversion
#0L=ULONG (#2) 25.9 28.8
Conversion into 32-bit integer #0L=ULONG (#4F) 47.2 62.9
ULONG
type (unsigned) D0L=ULONG (D2) 41.6 50.1
D0L=ULONG (D4F) 55.9 72.0
#0F=FLOAT (#4) 26.6 32.2
Conversion into 64-bit #0F=FLOAT (#4L) 29.3 35.7
FLOAT
floating-point type (signed) D0F=FLOAT (D4) 42.6 55.9
D0F=FLOAT (D4L) 45.7 58.8
#0F=UFLOAT (#4) 26.8 32.3
Conversion into 64-bit #0F=UFLOAT (#4L) 29.3 36.5
UFLOAT
floating-point type (unsigned) D0F=UFLOAT (D4) 43.4 54.7
D0F=UFLOAT (D4L) 45.8 60.1
SET M1000 = M0 39.5 39.7
ON (normally open contact)
(None) SET M1000 = X100 39.8 42.0
(when condition enables)
SET M1000 = PX0 50.8 44.5
Bit device status
OFF (normally closed SET M1000 = !M0 41.3 41.3
! contact) (when condition SET M1000 = !X100 42.1 43.6
enables) SET M1000 = !PX0 47.7 46.1
SET M1000 28.3 33.2
SET Device set SET Y100 29.9 34.5
SET PY0 28.6 31.9
RST M1000 28.4 32.5
RST Device reset RST Y100 29.5 33.3
RST PY0 27.6 31.6
DOUT M0, #0 29.6 33.9
DOUT M0, #0L 34.5 37.9
DOUT Y100, #0 31.7 35.3
Bit device control DOUT Device output
DOUT Y100, #0L 38.3 40.4
DOUT PY0, #0 36.4 38.8
DOUT PY0, #0L 45.7 49.1
DIN #0, M0 26.8 30.8
DIN #0L, M0 32.5 33.9
DIN #0, X0 16.7 15.3
DIN Device input
DIN #0L, X0 30.5 34.1
DIN #0, PX0 34.1 36.1
DIN #0L, PX0 42.2 45.9
APP − 3
APPENDICES
A172SHCPUN/
A273UHCPU-S3
Classification Symbol Instruction Operation Expression A173UHCPU(-S1)
Unit (µs)
Unit (µs)
SET M1000 = M0 M1 52.5 55.4
Logical AND SET M1000 = X100 X101 53.7 58.1
SET M1000 = PX0 PX1 47.2 63.4
Logical operation
SET M1000 = M0+M1 53.1 55.4
+ Logical OR SET M1000 = X100+X101 55.5 58.1
SET M1000 = PX0+PX1 47.4 63.4
SET M1000 = #0==#1 40.1 40.5
SET M1000 = D0==D1 41.1 42.3
Equal to SET M1000 = #0L==#2L 43.3 45.3
==
(when condition enables) SET M1000 = D0L==D2L 45.6 51.3
SET M1000 = #0F==#4F 45.9 49.4
SET M1000 = D0F==D4F 49.4 57.3
SET M1000 = #0!=#1 39.5 40.5
SET M1000 = D0!=D1 41.9 42.3
Not equal to SET M1000 = #0L!=#2L 43.5 45.3
!=
(when condition enables) SET M1000 = D0L!=D2L 45.8 51.3
SET M1000 = #0F!=#4F 46.2 49.4
SET M1000 = D0F!=D4F 49.7 57.3
SET M1000 = #0<#1 39.9 40.5
SET M1000 = D0<D1 41.2 42.2
Less than SET M1000 = #0L<#2L 43.4 45.3
<
(when condition enables) SET M1000 = D0L<D2L 45.3 51.3
SET M1000 = #0F<#4F 46.6 49.4
Comparison SET M1000 = D0F<D4F 49.0 57.3
operation SET M1000 = #0<=#1 39.8 40.5
SET M1000 = D0<=D1 41.3 42.3
Less than or equal to SET M1000 = #0L<=#2L 42.3 45.3
<=
(when condition enables) SET M1000 = D0L<=D2L 45.2 51.3
SET M1000 = #0F<=#4F 44.9 49.4
SET M1000 = D0F<=D4F 48.9 57.3
SET M1000 = #0>#1 38.7 40.5
SET M1000 = D0>D1 41.1 42.3
More than SET M1000 = #0L>#2L 42.4 45.3
>
(when condition enables) SET M1000 = D0L>D2L 44.8 51.4
SET M1000 = #0F>#4F 44.7 49.9
SET M1000 = D0F>D4F 49.1 57.3
SET M1000 = #0=>#1 39.7 40.5
SET M1000 = D0=>D1 41.0 42.3
More than or equal to SET M1000 = #0L=>#2L 43.5 45.3
=>
(when condition enables) SET M1000 = D0L=>D2L 45.0 51.3
SET M1000 = #0F=>#4F 45.7 49.4
SET M1000 = D0F=>D4F 49.5 57.8
CHGV (K1, #0) 18.4 22.9
CHGV (K1, D0) 21.0 27.6
CHGV Speed change request
CHGV (K1, #0L) 20.0 25.3
Motion-dedicated CHGV (K1, D0L) 28.7 37.4
function CHGT (K1, #0) 17.9 22.1
Torque limit value change CHGT (K1, D0) 20.5 24.7
CHGT
request CHGT (K1, #0L) 20.8 26.0
CHGT (K1, D0L) 30.1 38.1
APP − 4
APPENDICES
A172SHCPUN/
A273UHCPU-S3
Classification Symbol Instruction Operation Expression A173UHCPU(-S1)
Unit (µs)
Unit (µs)
EI Event task enable EI 5.3 7.6
DI Event task disable DI 5.5 6.8
NOP No operation NOP 1.5 1.7
BMOV #0, #100, K10 25.5 29.4
BMOV D0, D100, K10 33.8 38.4
Others
BMOV #0, #100, K100 71.6 85.4
BMOV Block move
BMOV D0, D100, K100 138.1 168.0
BMOV N1, #0, K512 54.3 64.5
BMOV N1, D0, K512 53.5 64.7
TIME Time to wait
APP − 5
APPENDICES
APP − 6
APPENDICES
(3) Processing time taken when F and G are combined (program described in F/G is NOP)
CLR P
F G F SUB
G P
(Note) (Note)
A172SHCPUN
µs 48 40 51 103 48 37
A173UHCPU(-S1)
A273UHCPU-S3 µs 43 35 48 109 48 37
F F F F F F F
G G G G G G G
G G G G G G G
F F F F F F F
A172SHCPUN
µs 142 185
A173UHCPU(-S1)
A273UHCPU-S3 µs 163 227
POINT
Long processing time may cause a PCPU WDT error or servo fault.
Especially for SFC programs run by event/NMI tasks, take care so that the
processing time will not be too long.
APP − 7
APPENDICES
APP − 8
HEAD OFFICE:MITSUBISHI DENKI BLDG MARUNOUCHI TOKYO 100 TELEX: J24532 CABLE MELCO TOKYO
NAGOYA WORKS : 1-14 , YADA-MINAMI 5 , HIGASHI-KU , NAGOYA , JAPAN
IB (NA) 0300022-A (0012) MEE Printed in Japan Specifications subject to change without notice.