Motion Controller (SV13/22SFC) : Type A172SHCPUN, A173UHCPU (-S1), A273UHCPU-S3

Download as pdf or txt
Download as pdf or txt
You are on page 1of 198

MOTION CONTROLLER(SV13/22SFC)Programming Manual, type A172SHCPUN,A173UHCPU(-S1),A273UHCPU-S3

A273UHCPU-S3
Programming Manual
(SV13/22SFC)
MOTION CONTROLLER

type A172SHCPUN, A173UHCPU(-S1),


INTORODUCTION

Thank you for choosing the motion controller.


Before using the equipment, please read this manual carefully to use it to its optimum.
Please forward this manual to the end user.

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.

CAUTION Denotes that incorrect handling may cause hazardous


! CAUTION conditions, resulting in medium or slight injury, or may cause physical
damage only.
CAUTION Denotes that incorrect handling may cause hazardous conditions, resulting in
medium or slight injury, or may cause physical damage only.

−I−
SAFETY PRECAUTIONS

1. For Electric Shock Prevention

! 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.

2. For fire prevention

! 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

To each terminal, apply only the voltage 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 burst,
damage, etc.
Ensure that the cables are connected to the correct terminals. Wrong connection can cause
burst, damage, etc.
Always make sure that polarity is correct. Wrong connection can cause burst, damage, etc.
While power is on or for some time after power-off, do not touch the servo amplifier
radiating fins, regenerative brake resistors, servo motors, etc. as they are hot and you may
get burnt.
Switch power off before touching the servo motor shaft and the machine coupled there. Not
doing so can cause injury.
Stay away from the machine while it is being test-run or taught, for example. Not doing so
can cause injury.

4. Additional Instructions
Also note the following points. Incorrect handling can cause a failure, injury, electric shock or the like.

(1) For system construction

! 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.

(2) For parameter setting and programming

! 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.

(3) For transportation and installation

! 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.

(4) For wiring


! CAUTION

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

Mount the surge suppressing diode to the DC relay


Servo amplifier
designed for control output signal, such as a brake signal,
in correct orientation. If it is mounted in incorrect VIN
(24VDC)
orientation, the signal may not be output due to a failure,
disabling the protective circuit.
Control output
While power is on, do not connect or disconnect the
signal RA
module-to-module connection cables, encoder cables
and PLC extension cables.
Securely tighten the cable connector fixing screws and fixing mechanisms. Insecure fixing
can cause removal during operation.
Do not bundle the power supply wires and cables.

(5) For test operation and adjustment

! 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)

(7) For corrective actions for alarms

! 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

Dispose of this product as general industrial waste.


Do not disassemble the controller, servo amplifier and servo motor parts.
Dispose of the batteries in the method prescribed in the corresponding municipality.

(10) General instruction


All illustrations given in this manual may have been drawn with covers or safety guards removed
to provide in-depth description. Before starting operation of the product, always return the
covers and guards into original positions as specified and operate the equipment in accordance
with this manual.

− 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.

© 2000 Mitsubishi Electric Corporation


CONTENTS

1. OVERVIEW ........................................................................................................................................... 1- 1

1.1 Features ............................................................................................................................................ 1- 1

2. SYSTEM CONFIGURATION ..................................................................................................... 2- 1 to 2- 5

2.1 A273UHCPU-S3 System Overall Configuration................................................................................ 2- 1


2.2 A173UHCPU(-S1) System Overall Configuration ............................................................................. 2- 3
2.3 A172SHCPUN System Overall Configuration ................................................................................... 2- 4
2.4 Software Package List ...................................................................................................................... 2- 5

3. PERFORMANCE SPECIFICATIONS ........................................................................................ 3- 1 to 3- 7

3.1 SFC Performance Specifications ...................................................................................................... 3- 1


3.2 SCPU Performance Specifications ................................................................................................... 3- 2
3.3 PCPU Performance Specifications ................................................................................................... 3- 3
3.3.1 Motion control specifications ...................................................................................................... 3- 3
3.3.2 Operation control/transition control specifications ...................................................................... 3- 4

4. SFC PROGRAMS ..................................................................................................................... 4- 1 to 4-27

4.1 SFC Program Structure..................................................................................................................... 4- 1


4.2 SFC Chart Symbol List...................................................................................................................... 4- 2
4.3 Branch and Coupling Chart List ........................................................................................................ 4- 5
4.4 SFC Program Names........................................................................................................................ 4- 9
4.5 Steps ................................................................................................................................................ 4-10
4.5.1 Motion control step .................................................................................................................... 4-10
4.5.2 Operation control step ............................................................................................................... 4-11
4.5.3 Subroutine call/start step ........................................................................................................... 4-12
4.5.4 Clear step .................................................................................................................................. 4-13
4.6 Transitions........................................................................................................................................ 4-15
4.7 Jump, Pointer ................................................................................................................................... 4-17
4.8 END.................................................................................................................................................. 4-17
4.9 Branches, Couplings ........................................................................................................................ 4-18
4.9.1 Series transition......................................................................................................................... 4-18
4.9.2 Selective branch, selective coupling.......................................................................................... 4-19
4.9.3 Parallel branch, parallel coupling............................................................................................... 4-20
4.10 Y/N Transitions............................................................................................................................... 4-22
4.11 SFC Comments.............................................................................................................................. 4-26

5. OPERATION CONTROL PROGRAMS .................................................................................... 5- 1 to 5-76

5.1 Operation Control Programs ............................................................................................................. 5- 1


5.2 Device Descriptions .......................................................................................................................... 5- 5
5.3 Constant Descriptions ....................................................................................................................... 5- 7
5.4 Binary Operations.............................................................................................................................. 5- 8
5.4.1 Substitution : =............................................................................................................................ 5- 8
5.4.2 Addition : +................................................................................................................................. 5-10
5.4.3 Subtraction : - ............................................................................................................................ 5-11
5.4.4 Multiplication : *.......................................................................................................................... 5-12

−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

6. TRANSITION PROGRAMS ....................................................................................................... 6- 1 to 6- 2

6.1 Transition Programs.......................................................................................................................... 6- 1

7. MOTION CONTROL PROGRAMS ........................................................................................... 7- 1 to 7-12

7.1 Servo Instruction List......................................................................................................................... 7- 1


7.2 Servo Motor/Virtual Servo Motor Shaft Current Value Change......................................................... 7- 5
7.3 Synchronous Encoder Shaft Current Value Change Control (SV22 Only)........................................ 7- 8
7.4 Cam Shaft Within-One-Revolution Current Value Change Control (SV22 Only) ............................. 7-11

8. MOTION DEVICES .................................................................................................................... 8- 1 to 8- 5

8.1 Motion Registers (#0 to #8191) ......................................................................................................... 8- 1


8.2 Coasting Timer (FT) .......................................................................................................................... 8- 4

9. TASK OPERATIONS ................................................................................................................. 9- 1 to 9- 3

9.1 Task Definitions................................................................................................................................. 9- 1


9.2 Task Execution Status ...................................................................................................................... 9- 3

10. PROGRAMMING INSTRUCTIONS ..................................................................................... 10- 1 to 10- 2

10.1 Task Definitions............................................................................................................................. 10- 1


10.2 SET/RST Response Delays of Motion-Dedicated Bit Devices...................................................... 10- 1
10.3 Cancel Start................................................................................................................................... 10- 2
10.4 Indirect Designation using Motion Devices ................................................................................... 10- 2
10.5 Sequence Programs ..................................................................................................................... 10- 2

11. SFC PARAMETERS ............................................................................................................ 11- 1 to 11- 8

11.1 Task Parameters........................................................................................................................... 11- 1


11.2 Program Parameters..................................................................................................................... 11- 3

12. HOW TO RUN SFC PROGRAM.......................................................................................... 12- 1 to 12- 6

12.1 How to Start SFC Program ........................................................................................................... 12- 1


12.1.1 Automatic start........................................................................................................................ 12- 1

− 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

13. SFC PROGRAM CONTROLLING OPERATIONS............................................................... 13- 1 to 13- 3

13.1 Operation Performed at CPU Power-Off or Key-Reset................................................................. 13- 1


13.2 Operation Performed when CPU Is Put in RUN Mode.................................................................. 13- 1
13.3 Operation Performed when CPU Is Switched from RUN to STOP ............................................... 13- 1
13.4 Operation Performed when CPU is set to PAUSE or STEP-RUN ................................................ 13- 1
13.5 Operation Performed when PLC Ready (M2000) Turns OFF/ON ................................................ 13- 2
13.6 Error-Time Operation .................................................................................................................... 13- 3

14. USER FILES ........................................................................................................................ 14- 1 to 14- 2

14.1 Projects ......................................................................................................................................... 14- 1


14.2 User File List ................................................................................................................................. 14- 2

15. ERROR LISTS ..................................................................................................................... 15- 1 to 15- 8

15.1 SFC Program Errors ..................................................................................................................... 15- 1


15.2 SFC Parameter Errors .................................................................................................................. 15- 8

16. LIMIT SWITCH OUTPUT FUNCTION ................................................................................. 16- 1 to 16- 8

16.1 Operations..................................................................................................................................... 16- 1


16.2 Limit Output Setting Data .............................................................................................................. 16- 4

APPENDICES .......................................................................................................................APP- 1 to APP- 8

APPENDIX 1 PROCESSING TIMES ................................................................................................. APP- 1


Appendix 1.1 Operation Control/Transition Instruction Processing Times ..................................... APP- 1
Appendix 1.2 Motion Operation Cycles (msec) .............................................................................. APP- 8

− 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.

(4) The motion-specific transition condition description allows a command to be


given to the servo amplifier immediately after a start condition enables.

(5) The motion-specific transition condition description allows a transition to the


next step to be made after a start, without waiting for positioning completion.

(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).

(8) As a sequence of machine operations can be written in correspondence with


operation steps, the resultant program is easy for anyone to understand,
improving maintainability.

1−1
2. SYSTEM CONFIGURATION

2. SYSTEM CONFIGURATION

2.1 A273UHCPU-S3 System Overall Configuration

The following system configuration assumes use of the A273UHCPU-S3.


Motion slots

supply module
Servo external

Dynamic brake
supply module
Control power

CPU module

Servo power
module
signal
AC motor drive
modules

CPU base unit


(A278B/A275B) A62P A273UH A278 A240 A221 A211 A222AM-20 A230P
CPU-S3 LX DY AM-20 AM-20
Battery
A270BATCBL
MR-J-BAT Regenerative brake resistor
Brake output
A6BAT
BRAKE Three-phase power supply
200V
Emergency DBOUT DB IN+
stop input DBCOM DB IN-
AC100/200V
M M M Max. 16 ADU axes
E E E
PLC slots
Teaching unit M M
A31TU-E/A30TU-E(SV13 only)

Power supply module


E E
PLC extension base connection
RS422 cable(A370C B)

External input signals


Communication cable Upper limit switch
(A270CDCBL M/ Lower limit switch (AC B)
A270BDCBL M) Stop signal ×8
Proximity dog PLC extension base(A68B/A65B/A62B)
Speed-position change PLC extension bases: up to 7 bases
Personal computer(IBM PC/AT) Base number setting: base 1 to base 7
Windows NT/98 MR-H-BN/MR-J2S-B/MR-J2-B
SSCNET4 (Max. 32 axes including those of ADU)
Max. 24 axes
SSC I/F card/board
(A30CD-PCF/A30BD-PCF) SSCNET1 d1 d2 d3 d8
Termination
resistor

M M M M
SSCNET2 E E E E

SSCNET3 Servo amplifier, max. 8 axes/1 network


Motion extension base
connection cable
encoder interface module

Interrupt input module

I/O composite module

(AC B)
Control power supply

Pulse generator/
synchronous

Output module
module

Input module

Motion extension base unit


(A268B) A62P A273 AI61 AX AY AH42
EX A42XY

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

2.2 A173UHCPU(-S1) System Overall Configuration

The following system configuration assumes use of the A173UHCPU(-S1).


Motion slots

Interrupt input module


CPU module

CPU base unit Pulse generator/


A178B-S3 synchronous encoder
/A178B-S2 interface module Extension cable GOT
/A178B-S1 A1SC B: For A1S6 B, A168B
/A17 B A1S NB: For A6 B

Battery A173UHCPU A172S A172S A172S A172S A1S

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

2.3 A172SHCPUN System Overall Configuration

The following system configuration assumes use of the A172SHCPUN.


Output module

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

Battery A172SHCPUN A172S A1S

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)

Communication cable External input signals


(A270CDCBL M/ FLS Upper limit switch
A270BDCBL M) RLS Lower limit switch
×8
Personal computer STOP Stop signal
(IBM PC/AT) DOG/CHANGE Proximity dog/speed-position change
Windows NT/98 TRA Tracking ×1
SSCNET2
Brake output

SSC I/F card/board Motion network cable


(A30CD-PCF/A30BD-PCF)
SSCNET1 d1 d2 d3 d8
Termination resistor

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

2.4 Software Package List

Operating System Software Package Type


Peripheral Programming Software For For For
Application Remarks
Device Package Type A172SHCPUN A173UHCPU(-S1) A273UHCPU-S3
(8-axes feature) (32-axes feature) (32-axes feature)
For
With teaching
conveyor/ IBM PC/AT SW3RN-SV13D SW3RN-SV13B SW3RN-SV13X
function
Assembly
SW3RNC-GSVE
For
Without teaching
automatic IBM PC/AT SW3RN-SV22C SW3RN-SV22A SW3RN-SV22W
function
machinery

(1) Type definition

(Operating System) SW3RN-SV13X


Indicates motion SFC compatibility.

(Programming software) S W 3 R N -GSV13P


OS environment: Windows NT/98
Device: IBM PC/AT 100% compatible
Indicates conventional OS or motion SFC compatibility.

(2) OS type/version display


On the installation screen of the peripheral, the OS type/version of the
connected CPU is displayed as shown below. When the A273UHCPU-S3 is
used, this data is also indicated by the CPU front LEDs by performing an
indicator reset.

(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

U : A273UH (32-axes feature)


C or D: A172SH (8-axes feature)
Indicates conventional OS.
A or B: A173UH (32-axes feature)

2−5
3. PERFORMANCE SPECIFICATIONS

3. PERFORMANCE SPECIFICATIONS

3.1 SFC Performance Specifications

Table 3.1 SFC Performance Specification List


A173UHCPU(-S1)/A273UHCPU-S3
Item A172SHCPUN
32-axes feature
Code total
287k bytes
(SFC chart + operation control + transition)
Text total
Program capacity 224k bytes
(operation control + transition)
Motion control program
52k bytes Approx. 56k bytes
(servo program)
Program storage Code • motion control program PCPU SRAM
area Text PCPU SRAM
Number of motion SFC programs 256 (No.0 to 255)
Number of motion SFC steps/all programs Max. approx. 7.5k steps
(1 step+1 transition) (varies with the number of operation control program/transition program steps)
16 bytes (16 characters)
Motion SFC program name/ program
(SFC program name is used as SFC file name)
Motion Motion SFC chart size/ program Max. 64k bytes (Motion SFC chart comments included)
SFC program Motion SFC steps/ program Max. 4094 steps
Number of selective branches/ branch 255
Number of parallel branches/ branch 255
Parallel branch nesting Up to 4 levels
Subroutine call nesting No restrictions
Motion SFC chart comments Max. 80 characters/ symbol
Number of operation Once execution type 4096(F0 to F4095) 4096 with F and FS combined
control programs Scan execution type 4096(FS0 to FS4095) (F/FS0 to F/FS4095)
Number of transition programs 4096 (G0 to G4095)
Code size/ program Max. approx. 64k bytes (32766 steps)
Text size/ program Max. approx. 64k bytes
Max. 8192 blocks
Operation control Number of blocks (lines)/ program
(in the case of 4 steps (minimum)/ block)
program(F/FS)
Number of characters/ block (line) Max. 128 characters (comments included)

Max. 64
Transition program Number of operand/ block
(Operand : constants, word devices and bit devices)
(G)
( ) nesting/ block Up to 32 levels
Indirect device designation nesting Up to 2 levels
Separation of one block CR + LF
Descriptive Operation control program Calculation expression / bit conditional expression
expression Transition program Calculation expression/bit conditional expression/comparison conditional expression
Comment statement Part after ‘//’ is regarded as a comment.
Number of servo programs 4096 (K0 to K4095)
Program steps/all programs 13312 14334
Motion control
Max. 13312 steps/ program
program Program steps/1 program
(for constant-speed control/speed change control)
Positioning points Approx. 800 points/ axis Approx. 400 points/ axis
Number of multi executed programs Max. 256 programs
Number of multi active steps Max. 256 steps/all programs
Normal task Executed in motion main cycle
Fixed cycle (1.7ms, 3.5ms, 7.1ms, 14.2ms)
16 external interrupt points (inputs from AI61 interrupt input module installed in motion slot)
Executed Event task Executed when 1 interrupt point is provided from PLC.
specifications (PLC dedicated instruction ITP is executed)
Executed task
Execution can be masked.
16 external interrupt points (inputs from AI61 interrupt input module installed in
motion slot)
NMI task
16 points with event tasks and NMI tasks combined (use SFC parameters to set
tasks)

3−1
3. PERFORMANCE SPECIFICATIONS

3.2 SCPU Performance Specifications

Table 3.2 SCPU Performance Specification List


Item A172SHCPUN A173UHCPU(-S1) A273UHCPU-S3
Control method Repeated operation using stored program
Refresh mode / direct mode Refresh mode
I/O control method
selectable (direct mode can be used partially in accordance with the instruction)
Programming language Sequence control-dedicated language (relay symbol language, logic symbolic language, MELSAP II (SFC))
Sequence instructions 26 22
Basic instructions 131
249
Number of Application instructions 102
instructions Dedicated instructions  204
Motion-dedicated
2
instructions
Processing speed Direct mode 0.25 to 1.9µs/step 
(PLC instruction) Refresh mode 0.25µs/step 0.15µs/step
Real I/O points 2048 (X/Y0 to X/Y7FF) 8192 (X/Y0 to X/Y1FFF)
2048 (X/Y0 to X/Y7FF)
Number of actual I/O points 1024 (X/Y0 to X/Y3FF) (within the range of one extension base)
2048 (X/Y0 to X/Y7FF)
Watchdog timer (WDT) 10 to 2000ms 200ms
Stand 192k bytes
ard (A3NMCA-24 equivalent)
Memory capacity (built-in RAM) 192k bytes 
768k bytes
-S1
(A3NMCA-96 equivalent)
Main sequence Max. 30k steps
Program capacity Sub sequence  Max. 30k steps
Microcomputer program Max. 58k steps 
7144
1000
Internal relay (M) points (Note-1) (M0 to M999)
(M0 to M999)
Total 2048 (M2048 to M8191)
Total 8192
1048 (set in 1048
Latch relay (L) points (set in parameters)
(M1000 to M2047) parameters) (M1000 to M2047)
0 points 0
Step relay (S) points
(defaults to none) (defaults to none)
Link relay (B) points 1024 (B0 to B3FF) 8192 (B0 to B1FFF)
Annunciator (F) points 256 (F0 to F255) 2048 (F0 to B2047)
Number of points 256 2048
Timer (T) 100ms timer T0 to T199 (setting time: 0.1 to 3276.7s)
Specifica-
tions

(set in 10ms timer T200 to T255 (setting time: 0.01 to 327.67s)


parameters) 100ms retentive timer Defaults to none (setting time: 0.1 to 3276.7s)
Devices

Extended timer  T256 to T2047 (setting time: Depends on D, W, R)


Number of points 256 2048
Counter (C) Normal counter C0 to C255 (setting range: 1 to 32767)
Specifica-
tions

(set in Interrupt program


C244 to C255 (defaults to none) (setting range: 1 to 32767)
parameters) counter
Extended counter  C256 to C1023 (count value setting: Depends on D, W, R)
Data register (D) points (Note-1) 1024 (D0 to D1023) 8192 (D0 to D8191)
Link register (W) points 1024 (W0 to W3FF) 8192 (W0 to W1FFF)
File register (R) points Max. 8192 (R0 to R8191) (set in parameter)
Accumulator (A) points 2 (A0, A1)
Index register (V/Z) points 2 (V, Z) 14 (V, V1 to V6, Z, Z1 to Z6)
Pointer (P) points 256 (P0 to P255)
Interrupt pointer (I) points 32 (I0 to I31)
Special relay (M) points 256 (M9000 to M9255)
Special register (D) points 256 (D9000 to D9255)
Stand Max. 10 blocks(vary with
Max. 47 blocks
Max. 10 blocks ard memory capacity setting)
Number of extended file register blocks (vary with memory cassette and
(vary with memory capacity setting) Max. 47 blocks(vary with
-S1 memory capacity setting)
memory capacity setting)
Number of comment points Max. 4032 (64k bytes) 1 point = 16 bytes (set in increments of 64)
Number of extended comment points (Note-2) Max. 3968 (63k bytes) 1 point = 16 bytes (set in increments of 64)
Self-diagnostic function Detection of watchdog timer, memory, CPU, I/O, battery and other errors
Error-time operation mode Selection of stop or continue
Output mode switching at STOP→RUN Selection of before-STOP computation status re-output (default) or after-computation output
Clock function Year, month, day, hour, minute, second, day of week (automatic leap year judgment)
(Note-1) : The positioning-dedicated device range varies with the OS.
(Note-2) : Extended comments are not stored into the internal memory of the CPU.

3−2
3. PERFORMANCE SPECIFICATIONS

3.3 PCPU Performance Specifications

3.3.1 Motion control specifications

Table 3.3 PCPU Performance Specification List (Motion Control Specifications)


A273UHCPU-S3
Item A172SHCPUN A173UHCPU(-S1)
32-axis feature
8 axes (2 to 4 multi axes, 8
Number of control axes 32 axes (2 to 4 multi axes, 32 independent axes)
independent axes)
Interpolation function Linear interpolation (max. 4 axes), circular interpolation (2 axes)
PTP (Point To Point), speed control, speed-position control, fixed-pitch feed, constant-speed control,
Control method
position follow-up control, speed change control, high-speed oscillation control, current value change
Control unit mm, inch, degree, PULSE
Programming language Dedicated instructions (servo program)
PTP : Absolute method / incremental method selection
Speed-position control / fixed-pitch feed : Incremental method
Method
Constant-speed control / speed change control : Absolute method / incremental method may be mixed
Position follow-up control / current value change : Absolute method
Can be selected per axis.
Control Unit Command Unit Address Setting Range Travel Setting Range
-1
mm × 10 µm
-5 -2147483648 to 2147483647
Position command inch × 10 inch
-5 0 to ± 2147483647
Positioning degree × 10 degree 0 to 35999999
PULSE × 1 PULSE -2147483648 to 2147483647

Control Unit Speed Setting Range


mm 0.01 to 6000000.00 (mm/min)
Speed command
inch 0.001 to 600000.000 (inch/min)
(command unit)
degree 0.001 to 2147483.647 (degree/min)
PULSE 1 to 10000000 (PLS/s)

Automatic trapezoidal Time-Fixed


Automatic
acceleration/deceleration Acceleration/Deceleration
trapezoidal
Acceleration time: 1 to 65535ms Acceleration/deceleration time
acceleration/decel-
Acceleration/decel- : 1 to 5000ms(Enabled for
eration Deceleration time: 1 to 65535ms
eration control constant-speed control only)

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

3.3.2 Operation control/transition control 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.

Read CPU Response Delay Remarks


Do not use for such applications where
ON/OFF judgment will be made by the
Motion CPU 1 PLC scan
motion CPU right after the SET/RST/
DOUT instruction is executed.
PLC CPU None

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.

CPU SET/RST Disable Range Remarks


A172SHCPUN M2001 to M2008
A173UHCPU(-S1) Start accepting device
M2001 to M2032
/A273UHCPU-S3
• DOUT output is disabled in the following device ranges.
DOUT Output Disable
CPU Remarks
Range
Designation including
Dedicated device
A172SHCPUN M2000 to M2047
M9000 to M9255 Special M
Designation including
A173UHCPU(-S1) Dedicated device
M2000 to M2127
/A273UHCPU-S3
M9000 to M9255 Special M

3−4
3. PERFORMANCE SPECIFICATIONS

Table 3.4 PCPU Performance Specification List (Operation Control/Transition Control Specifications) (Continued)
Item Specifications Remarks

Accessibility Usable Tasks Descrip-


Device Symbol tion
Read Write Normal Event NMI
Example
Data register D D0L
Link register W W1F:F
Specifiable PLC device Timer current value T T0
(word device) Counter current value C C10
Special D D D9000

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

(1) Operation control/transition instruction list


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

= 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     

(2) Rough calculation expression for operation control/transition program's single-


program code size

2 + (1 + total number of basic steps in 1 block


+ number of 32-bit constants/1 block × 1
+ number of 64-bit constants/1 block × 3) × number of blocks (steps)
(1 step = 2 bytes)

3−7
4. SFC PROGRAMS

4. SFC PROGRAMS

4.1 SFC Program Structure

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

Positioning Transition (shift): Indicates the condition to shift


ready check G0 control to the next step. Y0*M100

ABS-1
Execution of Step (motion control step): When active, runs
positioning K0 the specified servo program. Axis 1, D100
Speed 10000

Positioning Transition (WAIT): Indicates the condition to


completion G1 shift control to the next step. !X0
check

Operation END: Indicates a program end.


end END

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

4.2 SFC Chart Symbol List

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.

Motion control Kn CALL Kn • Starts a servo program Kn (K0 to K4095).


step
(8)
Once
execution Fn • Runs an operation control program Fn (F0 to
CALL Fn
operation F4095) once.
control step (8)
Scan
• Repeats an operation control program FSn
execution type FSn
CALL FSn (FS0 to FS4095) until the next transition
operation
condition enables.
control step (8)
• GSUB followed by WAIT performs a
"subroutine call" and shifts control to the
specified program. When END is executed,
control returns to the call source program.
Step Subroutine Program name
GSUB program name • GSUB followed by other than WAIT performs a
call/start step "subroutine start", starts the specified program,
(8) and shifts execution to the next (lower part).
The start source and destination programs are
run at the same time, and when END is
executed, the call destination program ends.
• Stops and ends the specified program being
run. After an end, restarting the program starts
it from the initial (start step).
• When the specified program is being
"subroutine called", the subroutine program
CLR being run is also stopped.
Program name
Clear step CLR program name • After the specified program has been
"subroutine started", the subroutine program
(8)
being run is not stopped.
• When clear is performed on the "subroutine
called" subroutine, the specified subroutine
being run is stopped, and execution returns to
the call source program and shifts to the next.

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

4.3 Branch and Coupling Chart List

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

Combining the basic type branches/couplings provides the following application


types, which are defined as in the basic types.
Name SFC Symbol List Representation Function
CALL Kn • After a selective branch, a parallel branch
IFBm can be performed.
IFT1
Selective SFT Gn
branch IFBm PABm
IFT1 IFT2
| PABm PAT1
PAT1 PAT1
Parallel branch CALL Fn
:
JMP PAEm
PAT2
CALL Fn’ • The selective coupling point can be the
: same as the coupling point of a parallel
(JMP IFEm) coupling for selective branch→parallel
PAEm branch. Note that in an SFC chart, this
Parallel JMP IFEm type is displayed in order of a parallel
coupling coupling → a selective coupling, as shown
| PAEm IFT2 on the left.
IFEm
Selective SET Gn’ • In this case, you cannot set a pointer (Pn)
coupling CALL Fn’’ between the parallel coupling point
: (PAEm) and the selective coupling point
(JMP IFEm) (IFEm).
IFEm
SET Gn’’
Appli- SFT Gn • After a parallel branch, a selective branch
cation PABm can be performed.
type PAT1
CALL Fn
IFBm
Parallel branch PABm
PAT1 PAT2
IFT1
|
IFBm SET Gn’
Selective IFT1 IFT1
CALL Fn’
branch
:
JMP IFEm
IFT2
SFT Gn’’
CALL Fn’’
: • The parallel coupling point can be the
(JMP IFEm) same as the coupling point of a selective
IFEm coupling for parallel branch→selective
JMP PAEm branch.
Selective Note that in an SFC chart, this type is
coupling PAT2 displayed in order of a selective coupling
| IFEm CALL Fn’’’ → a parallel coupling, as shown on the
PAEm
Parallel : left.
coupling CALL Kn • In this case, you cannot set a pointer (Pn)
(JMP PAEm) between the selective coupling point
(IFEm) and the parallel coupling point
PAEm (PAEm).
SET Gn’’’

4−6
4. SFC PROGRAMS

Name SFC Symbol List Representation Function


CALL Kn • After a selective branch, a selective
IFBm branch can be performed.
IFT1
SFT Gn
Selective IFBm+1
branch IFBm IFT1
| IFT1 IFT2
IFBm+1 SET Gn’
Selective IFT1 IFT2
:
branch JMP IFEm+1
IFT2
SFT Gn’’
:
(JMP IFEm+1)
• The two selective coupling points for
IFEm+1
selective branch→selective branch can be
JMP IFEm
the same.
Note that in an SFC chart, this type is
Selective IFT2
displayed in order of a selective coupling
coupling SFT Gn’’’
→ a selective coupling, as shown on the
| CALL Fn’
IFEm+1 left.
Selective IFEm :
• In this case, you cannot set a pointer (Pn)
coupling (JMP IFEm)
between the selective coupling point
(IFEm+1) and the selective coupling point
IFEm
(IFEm).
SET Gn’’’’
Appli-
:
cation
SFT Gn • After a parallel branch, a parallel branch
type
PABm can be performed.
PAT1 • A parallel branch can be nested up to four
CALL Fn levels.
PABm+1
Parallel branch PABm
PAT1 PAT2 PAT1
| PABm+1
PAT1 PAT2 CALL Fn’
Parallel branch :
JMP PAEm+1
PAT2
CALL Fn’’
:
(JMP PAEm+1)
• The two parallel coupling points for parallel
PAEm+1
branch→parallel branch can be the same.
JMP PAEm
Note that in an SFC chart, this type is
displayed in order of a parallel coupling →
Parallel PAT2
a parallel coupling, as shown on the left.
coupling CALL Fn’’’
• In this case, you cannot set a pointer (Pn)
| :
PAEm+1 between the parallel coupling point
Parallel PAEm CALL Kn
(PAEm+1) and the parallel coupling point
coupling JMP PAEm
(PAEm).

PAEm
SET Gn’’’
:

4−7
4. SFC PROGRAMS

Name SFC Symbol List Representation Function


: • The selective coupling point and parallel
(JMP IFEm) branch point can be the same.
IFEm Note that in an SFC chart, this type is
PABm displayed in order of a selective coupling
PAT1 → a parallel branch, as shown on the left.
Selective CALL Fn • In this case, you cannot set a pointer (Pn)
coupling IFEm : between the selective coupling point
| PABm JMP PAEm (IFEm) and the parallel branch point
PAT1 PAT2
Parallel branch PAT2 (PABm).
CALL Fn’
:
(JMP PAEm)
PAEm
:
: • The parallel coupling point and selective
JMP PAEm branch point can be the same.
PAEm Note that in an SFC chart, this type is
IFBm displayed in order of a parallel coupling →
IFT1 a selective branch, as shown on the left.
Parallel
SET Gn • Execution waits at the parallel coupling
coupling
PAEm : point and shifts to the selective branch.
| IFBm JMP IFEm • In this case, you cannot set a pointer (Pn)
Selective IFT1 IFT2
IFT2 between the parallel coupling point
branch
SET Gn’ (PAEm) and the selective branch point
: (IFBm).
(JMP IFEm)
Appli- IFEm
cation :
type : • The selective coupling point and selective
(JMP IFEm) branch point can be the same.
IFEm Note that in an SFC chart, this type is
IFBm+1 displayed in order of a selective coupling
Selective IFT1 → a selective branch, as shown on the
coupling SET Gn left.
| IFEm : • In this case, you cannot set a pointer (Pn)
Selective IFBm+1 JMP IFEm+1 between the selective coupling point
IFT1 IFT2
branch IFT2 (IFEm) and the selective branch point
SET Gn’ (IFBm+1).
:
(JMP IFEm+1)
IFEm+1
: • The parallel coupling point and parallel
(JMP PAEm) branch point can be the same.
PAEm Note that in an SFC chart, this type is
PABm+1 displayed in order of a parallel coupling →
PAT1 a parallel branch, as shown on the left.
Parallel CALL Fn • Execution waits at the parallel coupling
coupling : point and shifts to the parallel branch.
| PAEm JMP PAEm+1 • In this case, you cannot set a pointer (Pn)
PABm+1
Parallel branch PAT1 PAT2 PAT2 between the parallel coupling point
CALL Fn’ (PAEm) and the parallel branch point
: (PABm+1).
(JMP PAEm+1)
PAEm+1
:

4−8
4. SFC PROGRAMS

4.4 SFC Program Names

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

4.5.1 Motion control step

Name Symbol Function

Motion control Kn Starts a servo program Kn.


step Specifying range: K0 to K4095

[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

Start acceptance flag (M200n)

[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

4.5.2 Operation control step

Name Symbol Function

Operation Fn/FSn Runs an operation control program Fn/FSn.


control step Specifying range: F0 to F4095/FS0 to FS4095

[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

4.5.3 Subroutine call/start step

Name Symbol Function

Subroutine Program name Calls/starts the SFC program of the specified program
call/start step name.

(1) Calls/starts the SFC program of the specified program 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.

(b) For other than WAIT


A subroutine start is performed. When the subroutine start step is executed,
control starts the specified program and then shifts to the next as shown
below. Hence, the start source and destination SFC programs are run in
parallel. The started program ends when END is executed.

MAIN 1) SUB MAIN 1) SUB

3) 3)
SUB 2) SUB 2)

WAIT 5) END Shift 2) END


4)

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.

(2) If the called/started SFC program is already starting at a subroutine call/start,


an SFC program error 16006 will occur and the call/start source SFC program
running is stopped 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) When the subroutine to be called/started at a subroutine call/start in the SFC


program 2 which was called/started from the SFC program 1 is the SFC program
1 (main program), an SFC program error 16111 will occur and the call/start
source SFC program 2 running is stopped at the point of error detection.

4 − 12
4. SFC PROGRAMS

[Instructions]

(1) There are no restrictions on the depth of subroutine call/start nesting.

(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.

4.5.4 Clear step

Name Symbol Function

CLR Stops the running SFC program of the specified program


Program name
Clear step
name.

[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.

(3) The specified program may be its own program.

(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

You can describe conditional and operation expressions at transitions. The


operation expression described here is repeated until the transition condition
enables, as at the scan execution type operation step.
For the conditional/operation expressions that can be described in transition
conditions, refer to Chapter 6 Transition Programs.
(1) Combinations with motion control steps
(a) Motion control step + shift
[Operations]
Kn • Does not wait for the servo program Kn started at
the motion control step to complete its operation,
Gn and shifts to the next step when the transition
condition Gn enables.

(b) Motion control step + WAIT


[Operations]
• Waits for the servo program Kn started at the
motion control step to complete its operation, and
shifts to the next step when the transition condition
Kn
Gn enables.
• The operation completion condition of the servo
Gn
program Kn is not needed in the transition condition
Gn.
• An error stop of the started servo program Kn
at/during a start is also regarded as an operation
completion.
(c) WAITON/WAITOFF + motion control step
[Operations]
• Prepares for the start of the motion control step
next to WAITON/WAITOFF, and makes a start
immediately when the specified bit turns ON/OFF.
When the motion control step is executed without
ON M0 OFF M0
being used with WAITON/WAITOFF, preparations
for a start are made after the transition condition
Kn Kn
preceding the motion control step enables. This will
cause a variation of delay/starting time between
when the transition condition enables and when a
start is made, but a combination with
WAITON/WAITOFF can eliminate the variation of
the above delay/starting time.
• Specifiable bit devices
A173UHCPU(-S1)/
A172SHCPUN
A273UHCPU-S3
X X0 to X7FF X0 to X1FFF
Y Y0 to Y7FF Y0 to Y1FFF
M M0 to M2047 M0 to M8191
Special M M9000 to M9255 M9000 to M9255
L L0 to L2047 L0 to L8191
B B0 to B3FF B0 to B1FFF
F F0 to F255 F0 to F2047
TC (timer coil) TC0 to TC255 TC0 to TC2047
TT (timer contact) TT0 to TT255 TT0 to TT2047
CC (counter coil) CC0 to CC255 CC0 to CC1023
CT (counter contact) CT0 to CT255 CT0 to CT1023

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).

(2) Combination with operation control step


[Operations]
• At an operation control step, both Shift and
Fn Fn WAIT perform the same operation, and after
an operation control program Fn is run,
Gn Gn execution shifts to the next step when the
transition condition Gn enables.

(3) Combination with subroutine call/start step


Refer to the section of 4.5 (3) Subroutine call/start step.

4 − 16
4. SFC PROGRAMS

4.7 Jump, Pointer

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

4.9 Branches, Couplings

4.9.1 Series transition

Shifts execution to the subsequent step or transition connected in series.

(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.

K1 Starts servo program K1.

Without waiting for servo program K1 to complete operation,


G1 shifts to next when condition set at transition G1 enables.

K2 Starts servo program K2.

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.

K1 Starts servo program K1.

Shifts to next when start axis in servo program K1 stops


G1 (start acceptance flag turns OFF) and condition set at transition
G1 enables.

K2 Starts servo program K2.

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

4.9.2 Selective branch, selective coupling

(1) Selective branch


Executes only the route whose condition was judged to have enabled first
among the conditions of multiple transitions connected in parallel.
Transitions must be all Shifts or WAITs.

(Example) For WAIT

K1 Starts servo program K1.

After start axis in servo program


G1 G2 G3 G255 K1 has stopped (start acceptance
flag has turned OFF), conditions
of transitions G1 to G255 are
K2 K3 K4 K255 judged, and execution shifts to
route whose condition enables.

Max. number of selective branches = 255

POINT
(1) Transition condition judgment is not always executed from left to
right.
(2) Using Shift and WAIT together will cause a parallel branch.

(2) Selective coupling


Recoupling of routes into a single route after their processing completions
following a selective branch will be a selective coupling. However, you can also
make a setting where no coupling will be made as shown below.

IFB1

Jump transition (normal jump)

END Program END


IFE1

4 − 19
4. SFC PROGRAMS

4.9.3 Parallel branch, parallel coupling

(1) Parallel branch


Simultaneously executes multiple steps connected in parallel. A parallel branch
destination may be started by either a step or a transition.

G0 WAIT GO

K2 K3 F1 F10 After operation completion of preceding step, steps


K2 to F10 connected in parallel are executed when
condition set at transition G0 enables. Thereafter,
routes are executed simultaneously up to parallel
G1 G2 G3 G255 coupling point.

Max. number of parallel branches = 255

POINT
"Shift" or "WAIT" can be set to a transition preceding a parallel branch.
"WAITON" and "WAITOFF" cannot be set.

(2) Parallel coupling


A parallel branch must be coupled by a parallel coupling.
A jump setting to another branch route can be made within parallel branch-
parallel coupling.
In this case, a jump destination is a midway parallel coupling point (coupling
jump).
You cannot set a jump to exit from within parallel branch-parallel coupling.

G1
PAB1 Parallel branch point
K2 K4 F10
Coupling jump
ON M100 G11

K3 F1

ON M100 G12 After servo program K3 has completed


stopping, execution waits until condition set at
transition G3 enables and servo program K4
completes starting.
F12 On completion of waiting, execution shifts to
the next (lower part).

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.

( )

K2 K3 K4 K5 When you want to perform a coupling


on stop completions of axes started in
K2 to K5, set WAIT transition in
each route to make parallel coupling.
G2 G3 G4 G5
Parallel coupling
G1

4 − 21
4. SFC PROGRAMS

4.10 Y/N Transitions

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".

A Y/N transition is designed to describe the following two-route selective branch


program easily.
•G0 and G1 programs should be different only in
<Conventional description> acknowledgement/negation of the conditional
expressions.
(Example 1) (Example 2)

IFB1
G0 G1 [G 0] [G 1] [G 0] [G 1]
M0 !M0 D0!=K100 D0==K100

<New description> • As a G0 program, set the G0 program shown in


above (Example 1) or (Example 2).
• The SFC program list codes after conversion
are the same as in the conventional description
(different only in SFC chart representation).
Therefore, "automatic search for free G number
→ automatic generation of program whose
conditional expression part is logically negated"
is performed during program editing to occupy
two G programs.
IFB1 Using "Program editor" to delete a Y/N transition
G0 does not delete the automatically generated G
program (G1 below). Use "Program use list" to
delete that program.

IFB1
G0 G1

4 − 22
4. SFC PROGRAMS

(1) Automatic free G number search feature


(a) When not set to automatic numbering
Searches for a free number forward, starting with the "set G number + 1" at
the "Shift Y/N" or "WAIT Y/N" symbol.
When no free numbers are found after a search up to 4095, a search is
made from 0 to the "set G number - 1".

(b) When set to automatic numbering


Searches for a free number forward (or backward) in the automatic
numbering range, starting with the "automatically numbered G number + 1
(or -1)" at the "Shift Y/N" or "WAIT Y/N" symbol. (The searching method is
as in the automatic numbering setting.)

(2) Automatic logical NOT program generation feature


Automatically generates a program which logically negates the conditional
expression block (last block) of the transition program set at "Shift Y/N" or
"WAIT Y/N".
The basic is as described below.
<Set program (conditional expression block)>

Conditional expression//(bit conditional expression or comparison conditional expression)

<Logically negated, automatically generated program (conditional expression block)>

!Conditional expression//(bit conditional expression or comparison conditional expression)

Examples are given below.


<Set program (conditional expression block)>
(Example 1)
M0 //Bit device ON
(Example 2)
D0!=K100 //Data register D0 is not K100

<Logically negated, automatically generated program (conditional expression block)>


(Example 1)
!(M0) //Bit device OFF
(Example 2)
!(D0!=K100) //Data register D0 is K100

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

(3) Instructions for SFC charts


Any SFC chart that will be meaningless to or conflict with the definition of Y/N
transitions will result in an error at the time of editing (or SFC chart conversion).
Their patterns and instructions will be given below.
(a) When "Shift Y/N" or "WAIT Y/N" is connected as a selective branch or
parallel branch: Error

• "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.

• Direct coupling with "Shift Y/N" or • "Provide "coupling-branch


"WAIT Y/N" is not allowed. continuation" in between.

4 − 24
4. SFC PROGRAMS

(c) The following patterns may be set.


• End (END) from "Shift Y/N" or "WAIT • Jump from "Shift Y/N" or "WAIT Y/N"
Y/N"

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

4.11 SFC Comments

A comment can be set to each symbol of the step/transition in an SFC chart.


Comments are shown in an SFC chart by changing the display mode to "Comment
display" on the SFC program edit screen.
Since SFC comments are stored into the CPU code area, performing read from
PLC displays the SFC chart with comments.
Classification Name Symbol Comment Setting

Program name
START
Program
Comment setting cannot be made.
start/end
END
END

Motion control step Kn

Once execution type


Fn
operation control step

Scan execution type


Step FSn
operation control step

Subroutine call/start
Program
step

CLR
Clear step Program name

Shift (preread Max. 80 characters


Gn
transition) Displayed in 20 characters × 4 lines

WAIT Gn

WAITON ON bit device

Transition

WAITOFF OFF bit device

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

5. OPERATION CONTROL PROGRAMS

5.1 Operation Control Programs

(1) Operation control programs


(a) In operation control programs, you can set assignment operation express-
ions, motion-dedicated functions and bit device control commands.

(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.

(d) The maximum number of characters in one block is 128.

(e) You cannot set transition conditions.


Transition conditions may be set only in transition programs.

An operation control program example is given below.


1 block

#0=D0+(D1+D2) * #5//Assignment expression (four arithmetic operations)


W0:F=SIN(#10F)//Assignment expression (standard function)
CHGV(K2,K10)//Motion-dedicated function
1 program
SET M100=M0+X0//Bit device control (SET=)
RST M10=!X0//Bit device control (RST=)
DIN D0,X0//Bit device control (DIN)

Comment

(2) Priorities of operators and functions


Operators and functions have the following priorities.
Using parentheses allows an operation sequence to be specified freely.

Priority Item (Operator, Function)


Calculation within parentheses ((...))
Standard function (SIN, COS, etc.),
High
Type conversion (USHORT, LONG, etc.)
Bit inversion (~), logical negation (!), sign inversion (-)
Multiplication (*), division (/), remainder (%)
Addition (+), subtraction (-)
Bit left shift (<<), bit right shift (>>)
Comparison operators: Less than (<), less than or equal to (<=),
more than (>), more than or equal to (>=)
Comparison operators: Equal to (==), not equal to (!=)
Bit logical AND (&)
Bit exclusive OR (^)
Bit logical OR (|)
Low
Logical AND (*)
Logical OR (+)
Assignment (=)

5−1
5. OPERATION CONTROL PROGRAMS

(3) Instruction structure


Many of the instructions usable in operation control programs can be divided
into instruction and data parts.

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

Data part: Source (S)


Instruction part
Data part: Destination (D)

(a) Source (S)


1) The source is the data used in an operation.
2) It varies with the device specified in each instruction, as described below.
• Bit or word device
Specify the device which stores the data used in operation.
The data must have been stored in the specified device until the
operation is executed.
Changing the data stored in the specified device during program run
allows changing the data used in that instruction.
• Constant
Specify the numerical value used in an operation.
As the constant is set during program creation, it cannot be changed
during program run.

(b) Destination (D)


1) As the destination data, after-operation data is stored.
2) To the destination data, always set the device for storing the data.

(4) How to specify data


There are the following six different data usable in each instruction.
Data usable in each instruction Numerical data Integer data 16-bit integer type data

32-bit integer type data

64-bit floating-point type data

Bit data

Batch bit data

Logical data

5−2
5. OPERATION CONTROL PROGRAMS

(a) 16-bit integer type data


The 16-bit integer type data is 16-bit integral value data.
Word devices are used in increments of 1 point.
Data ranges are as indicted below.

Decimal Representation Hexadecimal Representation


Data range K-32768 to K32767 H0000 to HFFFF

(b) 32-bit integer type data


The 32-bit integer type data is 32-bit integral value data.
Word devices are used in increments of 2 points: (specified device
number), (specified device number+1). Data ranges are as indicted below.

Decimal Representation Hexadecimal Representation


Data range K-2147483648L to K2147483647L H00000000L to HFFFFFFFFL

(c) 64-bit floating-point type data


The 64-bit floating-point type data is IEEE-formatted, 64-bit floating-point
value data.
Word devices are used in increments of 4 points: (specified device
number), (specified device number+1), (specified device number+2),
(specified device number+3).
1) The internal bit locations are as shown below.
(+3) (+2) (+3) (Specified device number+0)
b63b62 b52b51 b0

b51 to b0 (52 bits)


Decimal field

b62 to b52 (11 bits)


Bias exponent field

b63 (1 bit)
Sign bit field

2) The represented value is as follows. (The bias value is H3FF.)


(-1)[Sign bit field]*(1.0+[decimal field]) *2([Bias exponent field]-[bias value])

3) Data ranges are as indicted below.

Decimal Representation Hexadecimal Representation


H0000000000000000,
K-1.79E+308 to K-2.23E-308,
H0010000000000000 to H7FE1CCF385EBC89F,
Data range K0.0,
H8000000000000000,
K2.23E-308 to K1.79E+308
H8010000000000000 to HFFE1CCF385EBC89F

5−3
5. OPERATION CONTROL PROGRAMS

4) A round-off error may be produced in a 64-bit floating-point type data


operation. Especially when using 64-bit floating-point type data in a
comparison operation, note that a round-off error may cause an intended
operation.
Example) In the following transition program, the result of the comparison
operation may not become true depending on the value of #200F
due to a round-off error.

#100F=SQRT(#200F)
#300F=#100F*#100F
#200F==#300F

(d) Bit data


The bit data is the data where a contact/coil or similar device is handled in
increments of 1 bit. It is used in device set (SET=) and device reset (RST=).
Example
SET M0

Bit data

(e) Batch bit data


The batch bit data is the data where bit data is handled in increments of
16/32 points. It is used in device input (DIN) and device output (DOUT).
As indicated below, whether the bit data is handled in increments of 16 or
32 points is governed by the data type of the word device used as an input
destination/output source.

Increments of 16 Points Increments of 32 Points


DIN #0, M0 DIN #0L, M0
Program example
DOUT M0, D0 DOUT M0, DOL
(Specified device number) to (Specified device number) to
(specified device number+15) (specified device number+31)
Used devices
M0 to M15 in the above program M0 to M31 in the above program
example example

(f) Logical data


The logical data is a value returned by a bit or comparison conditional
expression and indicates whether the result is true or false.
Normally, it is used in the conditional expression of a transition program. In
an operation control program, the logical data is used in a bit conditional
expression set to device set (SET=) or device reset (RST=).
Example 1
SET M0 = X10

Logical data
Bit data
Example 2
RST M5 = !X10 * M100

Logical data
Bit data

Example 3 (transition program)


D0 == K100

Logical data

5−4
5. OPERATION CONTROL PROGRAMS

5.2 Device Descriptions

Word and bit device descriptions are indicated below.

(1) Word device descriptions


Device Descriptions Device Number (n) Specifying Ranges
64-bit floating-point
32-bit integer type A173UHCPU(-S1)
16-bit integer type type A172SHCPUN
(n is even number) /A273UHCPU-S3
(n is even number)
Data register Dn DnL DnF 0 to 1023 0 to 8191
Link register Wn WnL Wn:F 0 to 3FF 0 to 1FFF
Timer current value Tn   0 to 255 0 to 2047
Counter current value Cn   0 to 255 0 to1023
Special register Dn DnL DnF 9000 to 9255
Motion device #n #nL #nF 0 to 8191
Coasting timer  FT  

(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.)

(2) Bit device descriptions


Device Number (n) Specifying Ranges
Device Description A173UHCPU(-S1)
A172SHCPUN
/A273UHCPU-S3
Input relay Xn/PXn 0 to 7FF 0 to 1FFF
Output relay Yn/PYn 0 to 7FF 0 to 1FFF
Internal relay Mn 0 to 2047 0 to 8191
Latch relay Ln 0 to 2047 0 to 8191
Link relay Bn 0 to 3FF 0 to 1FFF
Annunciator Fn 0 to 255 0 to 2047
Timer contact TTn 0 to 255 0 to 2047
Timer coil TCn 0 to 255 0 to 2047
Counter contact CTn 0 to 255 0 to 1023
Counter coil CCn 0 to 255 0 to 1023
Special relay Mn 9000 to 9255

(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

(3) Indirect designation of device numbers


In the above word/bit device descriptions, device numbers (n) can be specified
indirectly.
(a) Using word device to specify device number (n) indirectly
1) You cannot use the word device with which the device number was
specified indirectly.
2) You can use the 16- and 32-bit integer type word devices for indirect
designation.
You cannot use the 64-bit floating-point type.
(Description examples)

Good Example Bad Example


#(D10) #(D(D5))
D(#10L)F D(#4F)

(b) Using operation expression to specify device number indirectly


1) Device numbers can be specified indirectly by calculation expressions
which use the following data and operators.

16-bit integer type word device


32-bit integer type word device
Usable data
16-bit integer type constant
32-bit integer type constant
Addition: +
Subtraction: -
Multiplication: *
Usable operators
Division: /
Remainder: %
Sign inversion: -

2) You cannot use the word device with which the device number was
specified indirectly.
3) Only one operator may be used.
(Description examples)

Good Example Bad Example


#(D10-K5) #(D(D5)F+K20)
D(#10L%H6L)F D(#4L<<K2)
(Note) : When you want to use the result of calculation other than the
above to specify the device number indirectly, describe it in two
blocks as shown below.

D0=SHORT(ASIN(#0F))
W0=#(D0)

5−6
5. OPERATION CONTROL PROGRAMS

5.3 Constant Descriptions

The constant descriptions of the 16-bit integer type, 32-bit integer type and 64-bit
floating-point type are indicated below.

16-Bit Integer Type 32-Bit Integer Type 64-Bit Floating-Point Type


K-1.79E+308 to K-2.23E-308,
Decimal
K-32768 to K32767 K-2147483648L to K2147483647L K0.0,
representation
K2.23E-308 to K1.79E+308
Hexadecimal
H0000 to HFFFF H00000000L to HFFFFFFFFL 
representation

(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.

(3) The constant in decimal representation is headed by K and the one in


hexadecimal representation by H.
K can be omitted.

(4) The 64-bit floating-point type cannot be represented in hexadecimal.

5−7
5. OPERATION CONTROL PROGRAMS

5.4 Binary Operations

5.4.1 Substitution : =

F/FS G Format Number of Basic Steps


(D)=(S) 4

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
(S)   
(D)        
(Note): T and C are write-disabled and cannot be used at (D).

(2) Data to be set


Data to be Set Description Data Type of Result
Word device/constant/calculation
(S)
expression to be assigned
Data type of (D)
Word device which will store
(D)
the operation result

(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.

(5) Program examples


(a) Program which assigns the D0 value to #0
#0 = D0

#0 123 D0 123

5−8
5. OPERATION CONTROL PROGRAMS

(b) Program which assigns K123456.789 to D0L


D0L = K123456.789
D1 D0
D0L 123456 123456.789

The 64-bit floating-point type is converted into the 32-bit integer type and the
result is assigned.

(c) Program which assigns the result of adding K123 and #0 to W0


W0 = K123 + #0

123
W0 579 +
#0 456

5−9
5. OPERATION CONTROL PROGRAMS

5.4.2 Addition : +

F/FS G Format Number of Basic Steps


(S1)+(S2) 4

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
(S1)   
(S2)   

(2) Data to be set


Data to be Set Description Data Type of Result
(S1) Augend data Data type of (S1) or
(S2) Addend data (S2) which is greater

(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.

(5) Program examples


(a) Program which assigns the result of adding K123 and #0 to W0
W0 = K123 + #0

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 : -

F/FS G Format Number of Basic Steps


(S1)-(S2) 4

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
(S1)   
(S2)   

(2) Data to be set


Data to be Set Description Data Type of Result
(S1) Minuend data Data type of (S1) or (S2)
(S2) Subtracted data which is greater

(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.

(5) Program examples


(a) Program which assigns the result of subtracting #0 from K123 to W0
W0 = K123 - #0

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 : *

F/FS G Format Number of Basic Steps


(S1)*(S2) 4

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
(S1)   
(S2)   

(2) Data to be set


Data to be Set Description Data Type of Result
(S1) Multiplicand data Data type of (S1) or (S2)
(S2) Multiplier data which is greater

(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.

(5) Program examples


(a) Program which assigns the result of multiplying K123 by #0 to W0
W0 = K123 * #0

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 : /

F/FS G Format Number of Basic Steps


(S1)/(S2) 4

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
(S1)   
(S2)   

(2) Data to be set


Data to be Set Description Data Type of Result
(S1) Dividend data Data type of (S1) or (S2)
(S2) Divisor data which is greater

(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.

(5) Program examples


(a) Program which divides K123 by #0 and assigns a quotient to W0
W0 = K123 / #0

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 : %

F/FS G Format Number of Basic Steps


(S1)%(S2) 4

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
(S1)     
(S2)     

(2) Data to be set


Data to be Set Description Data Type of Result
(S1) Dividend data Data type (integer type)
of (S1) or (S2) which is
(S2) Divisor data greater (Integer type)

(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.

(5) Program examples


(a) Program which divides K123 by #0 and assigns a remainder to W0
W0 = K123 % #0

456
W0 87 %
#0 123

5 − 14
5. OPERATION CONTROL PROGRAMS

5.5 Bit Operations

5.5.1 Bit inversion (complement) : ~

F/FS G Format Number of Basic Steps


~ (S) 2

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
(S)     

(2) Data to be set


Data to be Set Description Data Type of Result
Data type of (S)
(S) Data whose bits will be inverted
(Integer type)

(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.

(5) Program examples


(a) Program which finds the bit inverted value of #0 and assigns the value to D0
D0 = ∼ #0

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

5.5.2 Bit logical AND : &

F/FS G Format Number of Basic Steps


(S1)&(S2) 4

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
(S1)     
(S2)     

(2) Data to be set


Data to be Set Description Data Type of Result
(S1) Data type of (S1) or (S2)
Data which will be ANDed bit-by-bit which is greater (Integer
(S2) type)

(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.

(5) Program examples


(a) Program which ANDs #0 and #1 and assigns the result to D0
D0 = #0 & #1

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

5.5.3 Bit logical OR : |

F/FS G Format Number of Basic Steps


(S1) | (S2) 4

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
(S1)     
(S2)     

(2) Data to be set


Data to be Set Description Data Type of Result
(S1) Data type of (S1) or (S2)
Data which will be ORed bit-by-bit which is greater (Integer
(S2) type)

(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) Program examples


(a) Program which ORs #0 and #1 and assigns the result to D0
D0 = #0 | #1
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 1 1 0 1 0 0 1 1 0 1 0 0 |
b15 b0
#1 0 0 1 0 1 0 0 1 0 0 1 0 0 1 0 0

5 − 17
5. OPERATION CONTROL PROGRAMS

5.5.4 Bit exclusive logical OR : ^

F/FS G Format Number of Basic Steps


(S1)^(S2) 4

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
(S1)     
(S2)     

(2) Data to be set


Data to be Set Description Data Type of Result
(S1) Data type of (S1) or (S2)
Data which will be
which is greater
(S2) EXCLUSIVE ORed bit-by-bit
(Integer type)

(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.

(5) Program examples


(a) Program which EXCLUSIVE ORs #0 and #1 and assigns the result to D0
D0 = #0 ^ #1

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

5.5.5 Bit right shift : >>

F/FS G Format Number of Basic Steps


(S1) >> (S2) 4

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
(S1)     
(S2)     

(2) Data to be set


Data to be Set Description Data Type of Result
(S1) Data to be right-shifted Data type of (S1)
(S2) Number of right shifts (Integer type)

(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.

(5) Program examples


(a) Program which shifts #0 two bit positions to the right and assigns the result
to D0
D0 = #0 >> K2

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

5.5.6 Bit left shift : <<

F/FS G Format Number of Basic Steps


(S1) << (S2) 4

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
(S1)     
(S2)     

(2) Data to be set


Data to be Set Description Data Type of Result
(S1) Data to be left-shifted Data type of (S1)
(S2) Number of left shifts (Integer type)

(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.

(5) Program examples


(a) Program which shifts #0 one bit position to the left and assigns the result to
D0
D0 = #0 << K1

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

5.5.7 Sign inversion (complement of 2) : -

F/FS G Format Number of Basic Steps


- (S) 2

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
(S)   

(2) Data to be set


Data to be Set Description Data Type of Result
(S) Data whose sign will be inverted Data type of (S)

(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.

(5) Program examples


(a) Program which assigns the sign-inverted value of #0 to D0
D0 = - #0

D0 -123 #0 123

5 − 21
5. OPERATION CONTROL PROGRAMS

5.6 Standard Functions

5.6.1 Sine : SIN

F/FS G Format Number of Basic Steps


SIN(S) 2

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
(S)   

(2) Data to be set


Data to be Set Description Data Type of Result
Angle data on which SIN (sine)
(S) Floating-point type
operation will be performed

(3) Functions
(a) SIN (sine) operation is performed on the data specified at (S).

(b) The data specified at (S) is in an angle (degree) unit.

(c) If (S) is an integer type, it is converted into a floating-point type before


operation is 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) Program examples


(a) Program which performs the SIN operation of D0 and assigns the result to
#0F
#0F = SIN(D0)
#3 #2 #1 #0
0.70710678118655 D0 45

5 − 22
5. OPERATION CONTROL PROGRAMS

5.6.2 Cosine : COS

F/FS G Format Number of Basic Steps


COS(S) 2

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
(S)   

(2) Data to be set


Data to be Set Description Data Type of Result
Angle data on which COS (cosine)
(S) Floating-point type
operation will be performed

(3) Functions
(a) COS (cosine) operation is performed on the data specified at (S).

(b) The data specified at (S) is in an angle (degree) unit.

(c) If (S) is an integer type, it is converted into a floating-point type before


operation is 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) Program examples


(a) Program which performs the COS operation of D0 and assigns the result to
#0F
#0F = COS(D0)
#3 #2 #1 #0
0.5 D0 60

5 − 23
5. OPERATION CONTROL PROGRAMS

5.6.3 Tangent : TAN

F/FS G Format Number of Basic Steps


TAN(S) 2

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
(S)   

(2) Data to be set


Data to be Set Description Data Type of Result
Angle data on which TAN (tangent)
(S) Floating-point type
operation will be performed

(3) Functions
(a) TAN (tangent) operation is performed on the data specified at (S).

(b) The data specified at (S) is in an angle (degree) unit.

(c) If (S) is an integer type, it is converted into a floating-point type before


operation is 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; or
2) (S) is 90+(180*n). (n is an integer)

(5) Program examples


(a) Program which performs the TAN operation of D0 and assigns the result to
#0F
#0F = TAN(D0)
#3 #2 #1 #0
0.57735026918963 D0 30

5 − 24
5. OPERATION CONTROL PROGRAMS

5.6.4 Arcsine : ASIN

F/FS G Format Number of Basic Steps


ASIN(S) 2

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
(S)   

(2) Data to be set


Data to be Set Description Data Type of Result
-1
SIN value data on which SIN (arcsine)
(S) Floating-point type
operation will be performed

(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.

(c) The operation result is in an angle (degree) unit.

(d) If (S) is an integer type, it is converted into a floating-point type before


operation is performed.

(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) Program examples


-1
(a) Program which performs the SIN (arcsine) operation of D0 and assigns the
result to #0F
#0F = ASIN(D0)
#3 #2 #1 #0
90.0 D0 1

5 − 25
5. OPERATION CONTROL PROGRAMS

5.6.5 Arccosine : ACOS

F/FS G Format Number of Basic Steps


ACOS(S) 2

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
(S)   

(2) Data to be set


Data to be Set Description Data Type of Result
-1
COS value data on which COS (arccosine)
(S) Floating-point type
operation will be performed

(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.

(c) The operation result is in an angle (degree) unit.

(d) If (S) is an integer type, it is converted into a floating-point type before


operation is performed.

(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) Program examples


-1
(a) Program which performs the COS (arccosine) operation of D0F and
assigns the result to #0F
#0F = ACOS(D0F)
#3 #2 #1 #0 D3 D2 D1 D0
60.0 0.5

5 − 26
5. OPERATION CONTROL PROGRAMS

5.6.6 Arctangent : ATAN

F/FS G Format Number of Basic Steps


ATAN(S) 2

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
(S)   

(2) Data to be set


Data to be Set Description Data Type of Result
-1
TAN value data on which TAN (arctangent)
(S) Floating-point type
operation will be performed

(3) Functions
-1
(a) TAN (arccosine) operation is performed on the TAN value data specified at
(S) to find an angle.

(b) The operation result is in an angle (degree) unit.

(c) If (S) is an integer type, it is converted into a floating-point type before


operation is 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) Program examples


-1
(a) Program which performs the TAN (arctangent) operation of D0F and
assigns the result to #0F
#0F = ATAN(D0F)
#3 #2 #1 #0 D3 D2 D1 D0
45.0 1.0

5 − 27
5. OPERATION CONTROL PROGRAMS

5.6.7 Square root : SQRT

F/FS G Format Number of Basic Steps


SQRT(S) 2

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
(S)   

(2) Data to be set


Data to be Set Description Data Type of Result
Data on which square root
(S) Floating-point type
operation will be performed

(3) Functions
(a) The square root of the data specified at (S) is found.

(b) Only a positive number may be specified at (S). (Operation cannot be


performed with a negative number.)

(c) If (S) is an integer type, it is converted into a floating-point type before


operation is performed.

(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) Program examples


(a) Program which finds the square root of D0F and assigns the result to #0F
#0F = SQRT(D0F)
#3 #2 #1 #0 D3 D2 D1 D0
3.0 9.0

5 − 28
5. OPERATION CONTROL PROGRAMS

5.6.8 Natural logarithm : LN

F/FS G Format Number of Basic Steps


LN(S) 2

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
(S)   

(2) Data to be set


Data to be Set Description Data Type of Result
Data on which natural logarithm
(S) Floating-point type
operation will be performed

(3) Functions
(a) The base e natural logarithm of the data specified at (S) is found.

(b) Only a positive number may be specified at (S). (Operation cannot be


performed with a negative number.)

(c) If (S) is an integer type, it is converted into a floating-point type before


operation is performed.

(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) Program examples


(a) Program which finds the natural logarithm of D0F and assigns the result to
#0F
#0F = LN(D0F)
#3 #2 #1 #0 D3 D2 D1 D0
2.3025850929940 10.0

5 − 29
5. OPERATION CONTROL PROGRAMS

5.6.9 Exponential operation : EXP

F/FS G Format Number of Basic Steps


EXP(S) 2

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
(S)   

(2) Data to be set


Data to be Set Description Data Type of Result
Data on which exponential
(S) Floating-point type
operation will be performed

(3) Functions
(a) Exponential operation is performed on the base e data specified at (S).

(b) If (S) is an integer type, it is converted into a floating-point type before


operation is 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) Program examples


(a) Program which performs exponential operation of D0F and assigns the
result to #0F
#0F = EXP(D0F)
#3 #2 #1 #0 D3 D2 D1 D0
442413.39200892 13.0

5 − 30
5. OPERATION CONTROL PROGRAMS

5.6.10 Absolute value : ABS

F/FS G Format Number of Basic Steps


ABS(S) 2

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
(S)   

(2) Data to be set


Data to be Set Description Data Type of Result
Data on which absolute value
(S) Data type of (S)
conversion will be performed

(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) Program examples


(a) Program which finds the absolute value of D0F and assigns the result to
#0F
#0F = ABS(D0F)
#3 #2 #1 #0 D3 D2 D1 D0
33.0 -33.0

5 − 31
5. OPERATION CONTROL PROGRAMS

5.6.11 Round-off : RND

F/FS G Format Number of Basic Steps


RND(S) 2

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
(S)   

(2) Data to be set


Data to be Set Description Data Type of Result
Data whose fractional portion
(S) Data type of (S)
will be rounded off

(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.

(5) Program examples


(a) Program which finds the rounded-off fractional portion value of D0F and
assigns the result to #0F
#0F = RND(D0F)
#3 #2 #1 #0 D3 D2 D1 D0
34.0 33.54

(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

5.6.12 Round-down : FIX

F/FS G Format Number of Basic Steps


FIX(S) 2

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
(S)   

(2) Data to be set


Data to be Set Description Data Type of Result
Data whose fractional portion
(S) Data type of (S)
will be rounded down

(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.

(5) Program examples


(a) Program which finds the rounded-down fractional portion value of D0F and
assigns the result to #0F
#0F = FIX(D0F)
#3 #2 #1 #0 D3 D2 D1 D0
33.0 33.54

(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

5.6.13 Round-up : FUP

F/FS G Format Number of Basic Steps


FUP(S) 2

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
(S)   

(2) Data to be set


Data to be Set Description Data Type of Result
Data whose fractional
(S) Data type of (S)
portion will be rounded up

(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.

(5) Program examples


(a) Program which finds the rounded-up fractional portion value of D0F and
assigns the result to #0F
#0F = FUP(D0F)
#3 #2 #1 #0 D3 D2 D1 D0
34.0 33.54

(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

5.6.14 BCD→BIN conversion : BIN

F/FS G Format Number of Basic Steps


BIN(S) 2

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
(S)     

(2) Data to be set


Data to be Set Description Data Type of Result
BCD data which will be Data type of (S)
(S)
converted into BIN data (Integer type)

(3) Functions
(a) The BCD data specified at (S) is converted into BIN data.

(b) If (S) is a 16-bit integer type, the data range is 0 to 9999.

(c) If (S) is a 32-bit integer type, the data range is 0 to 99999999.

(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) Program examples


(a) Program which converts the BCD data of D0 into BIN data and assigns the
result to #0
#0 = BIN(D0)

BIN 9999 BCD 9999


b15 b0 b15 b0
#0 0 0 1 0 0 1 1 1 0 0 0 0 1 1 1 1 D0 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1

Thousands Hundreds Tens Units

5 − 35
5. OPERATION CONTROL PROGRAMS

5.6.15 BIN→BCD conversion : BCD

F/FS G Format Number of Basic Steps


BCD(S) 2

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
(S)     

(2) Data to be set


Data to be Set Description Data Type of Result
BIN data which will be Data type of (S)
(S)
converted into BCD data (Integer type)

(3) Functions
(a) The BIN data specified at (S) is converted into BCD data.

(b) If (S) is a 16-bit integer type, the data range is 0 to 9999.

(c) If (S) is a 32-bit integer type, the data range is 0 to 99999999.

(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) Program examples


(a) Program which converts the BIN data of D0 into BCD data and assigns the
result to #0
#0 = BCD(D0)

BCD 9999 BIN 9999


b15 b0 b15 b0
#0 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 D0 0 0 1 0 0 1 1 1 0 0 0 0 1 1 1 1

Thousands Hundreds Tens Units

5 − 36
5. OPERATION CONTROL PROGRAMS

5.7 Type Conversions

5.7.1 Signed 16-bit integral value conversion : SHORT

F/FS G Format Number of Basic Steps


SHORT(S) 2

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
(S)   

(2) Data to be set


Data to be Set Description Data Type of Result
Data which will be converted
(S) 16-bit integer type
into signed 16-bit integral value

(3) Functions
(a) The data specified at (S) is converted into a signed 16-bit integral value.

(b) The data range of (S) is -32768 to 32767.

(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) Program examples


(a) Program which converts the data of D0L into a signed 16-bit integral value
and assigns the result to #0
#0 = SHORT(D0L)
D1 D0
#0 K-30000 K-30000L
(H8AD0) (HFFFF8AD0)

5 − 37
5. OPERATION CONTROL PROGRAMS

5.7.2 Unsigned 16-bit integral value conversion : USHORT

F/FS G Format Number of Basic Steps


USHORT(S) 2

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
(S)   

(2) Data to be set


Data to be Set Description Data Type of Result
Data which will be converted
(S) 16-bit integer type
into unsigned 16-bit integral value

(3) Functions
(a) The data specified at (S) is converted into an unsigned 16-bit integral value.

(b) The data range of (S) is 0 to 65535.

(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) Program examples


(a) Program which converts the data of D0L into an unsigned 16-bit integral
value and assigns the result to #0
#0 = USHORT(D0L)
D1 D0
#0 K-5536 K60000L
(HEA60) (H0000EA60)

Unsigned value is K60000

5 − 38
5. OPERATION CONTROL PROGRAMS

5.7.3 Signed 32-bit integral value conversion : LONG

F/FS G Format Number of Basic Steps


LONG(S) 2

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
(S)   

(2) Data to be set


Data to be Set Description Data Type of Result
Data which will be converted
(S) 32-bit integer type
into signed 32-bit integral value

(3) Functions
(a) The data specified at (S) is converted into a signed 32-bit integral value.

(b) The data range of (S) is -2147483648 to 2147483647.

(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) Program examples


(a) Program which converts the data of D0 into a signed 32-bit integral value
and assigns the result to #0L
#0L = LONG(D0)
#1 #0
K-1L D0 K-1
(HFFFFFFFF) (HFFFF)

5 − 39
5. OPERATION CONTROL PROGRAMS

5.7.4 Unsigned 32-bit integral value conversion : ULONG

F/FS G Format Number of Basic Steps


ULONG(S) 2

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
(S)   

(2) Data to be set


Data to be Set Description Data Type of Result
Data which will be converted
(S) 32-bit integer type
into unsigned 32-bit integral value

(3) Functions
(a) The data specified at (S) is converted into an unsigned 32-bit integral value.

(b) The data range of (S) is 0 to 4294967295.

(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) Program examples


(a) Program which converts the data of D0 into an unsigned 32-bit integral
value and assigns the result to #0L
#0L = ULONG(D0)
#1 #0
K65535L D0 K-1
(H0000FFFF) (HFFFF)

Unsigned value is K65535

5 − 40
5. OPERATION CONTROL PROGRAMS

5.7.5 Signed 64-bit floating-point value conversion : FLOAT

F/FS G Format Number of Basic Steps


FLOAT(S) 2

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
(S)   

(2) Data to be set


Data to be Set Description Data Type of Result
Data which will be converted
(S) 64-bit floating-point type
into signed 64-bit floating-point value

(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) Program examples


(a) Program which converts the data of D0L into a signed 64-bit floating-point
value and assigns the result to #0F
#0F = FLOAT(D0L)
#3 #2 #1 #0 D1 D0
K - 1.0 K-1L
(HFFFFFFFF)

5 − 41
5. OPERATION CONTROL PROGRAMS

5.7.6 Unsigned 64-bit floating-point value conversion : UFLOAT

F/FS G Format Number of Basic Steps


UFLOAT(S) 2

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
(S)   

(2) Data to be set


Data to be Set Description Data Type of Result
Data which will be converted into
(S) 64-bit floating-point type
unsigned 64-bit floating-point value

(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) Program examples


(a) Program which converts the data of D0L into an unsigned 64-bit floating-
point value and assigns the result to #0F
#0F = UFLOAT(D0L)
#3 #2 #1 #0 D1 D0
K4294967295.0 K-1L
(HFFFFFFFF)

Unsigned value is K4294967295

5 − 42
5. OPERATION CONTROL PROGRAMS

5.8 Bit Device Statuses

5.8.1 ON (normally open contact) : (None)

F/FS G Format Number of Basic Steps


(S) 2

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
(S)          

(2) Data to be set


Data to be Set Description Data Type of Result
Bit device used in bit
(S) Logical type (true/false)
conditional expression

(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.

(5) Program examples


(a) Program which sets M100 when either of M0 and X0 is ON (1)
SET M100 = M0 + X0

M0 0 (False)
(True)
M100 1 +
X0 1 (True)

5 − 43
5. OPERATION CONTROL PROGRAMS

5.8.2 OFF (normally closed contact) : !

F/FS G Format Number of Basic Steps


!(S) 2

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
(S)          

(2) Data to be set


Data to be Set Description Data Type of Result
Bit device used in bit
(S) Logical type (true/false)
conditional expression

(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) Program examples


(a) Program which resets M100 when M0 is OFF (0)
RST M100 = !M0

M100 0 !M0 0 (True)

5 − 44
5. OPERATION CONTROL PROGRAMS

5.9 Bit Device Controls

5.9.1 Device set : SET=

F/FS G Format Number of Basic Steps


SET(D)=(S) 4

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
(D)          
(S)        
(Note) • PX, TT and CT are write-disabled and cannot be used at (D).
• At (D), you cannot use M2001 to M2032 with the A273UH-S3 or M2001 to M2008 with the
A172SH.

(2) Data to be set


Data to be Set Description Data Type of Result
(D) Bit data for device set
Bit logical type
Condition data which determines whether
(S) (true/false)
device set will be performed or not

(3) Functions
(a) If the data specified at (S) is true, the bit data specified at (D) is set.

(b) (S) can be omitted.


At this time, the format is "SET(D)" and device set is made unconditionally.

(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.

(5) Program examples


(a) Program which sets M100 when either of M0 and X0 is 1
SET M100 = M0 + X0

M0 0
M100 1 + (True)
X0 1

5 − 45
5. OPERATION CONTROL PROGRAMS

(b) Program which sets M100 when #0 is equal to D0


SET M100 = #0 = = D0

#0 100
M100 1 == (True)
D0 100

(c) Program which sets Y0 unconditionally


SET Y0

Y0 1

5 − 46
5. OPERATION CONTROL PROGRAMS

5.9.2 Device reset : RST=

F/FS G Format Number of Basic Steps


RST(D)=(S) 4

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
(D)          
(S)        
(Note) • PX, TT and CT are write-disabled and cannot be used at (D).
• At (D), you cannot use M2001 to M2032 with the A273UH-S3 or M2001 to M2008 with the
A172SH.

(2) Data to be set


Data to be Set Description Data Type of Result
(D) Bit data for device reset
Bit logical type
Condition data which determines whether
(S) (true/false)
device reset will be performed or not

(3) Functions
(a) If the data specified at (S) is true, the bit data specified at (D) is reset.

(b) (S) can be omitted.


At this time, the format is "RST(D)" and device reset is made
unconditionally.

(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.

(5) Program examples


(a) Program which resets M100 when either of M0 and X0 is 1
RST M100 = M0 + X0

M0 0
M100 0 + (True)
X0 1

5 − 47
5. OPERATION CONTROL PROGRAMS

(b) Program which resets M100 when #0 is equal to D0


RST M100 = #0 != D0

#0 100
M100 0 != (True)
D0 200

(c) Program which resets Y0 unconditionally


RST Y0

Y0 0

5 − 48
5. OPERATION CONTROL PROGRAMS

5.9.3 Device output : DOUT

F/FS G Format Number of Basic Steps


DOUT(D), (S) 4

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
(D)          
(S)     
(Note) • PX, TT, CT and special M cannot be used at (D).
• At (D), you cannot use the range including M2000 to M2127 with the A273UH-S3 or the range
including M2000 to M2047 with the A172SH.

(2) Data to be set


Data to be Set Description Data Type of Result
(D) Output destination bit data
Batch bit
(S) Output source data

(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.

(5) Program examples


(a) Program which outputs the data of D0 to Y0-YF
DOUT Y0, D0

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

5.9.4 Device input : DIN

F/FS G Format Number of Basic Steps


DIN(D), (S) 4

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
(D)         
(S)          
(Note) : T and C are write-disabled and cannot be used at (D).

(2) Data to be set


Data to be Set Description Data Type of Result
(D) Input destination data Data type of (D)
(S) Input source bit data (Integer type)

(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.

(5) Program examples


(a) Program which inputs the data of X0-XF to D0
DIN D0, X0

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

5.10 Logical Operations

5.10.1 Logical acknowledgement : (None)

F/FS G Format Number of Basic Steps


(S) 

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
(S)        

(2) Data to be set


Data to be Set Description Data Type of Result
(S) Data which will be logically acknowledged Logical type (true/false)

(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.

(5) Program examples


(a) Program which sets M100 when either of M0 and X0 is ON (1)
SET M100 = M0 + X0

M0 0 (False)
(True)
M100 1 +
X0 1 (True)

5 − 51
5. OPERATION CONTROL PROGRAMS

5.10.2 Logical negation : !

F/FS G Format Number of Basic Steps


! (S) 2

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
(S)        

(2) Data to be set


Data to be Set Description Data Type of Result
(S) Data which will be logically negated Logical type (true/false)

(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.

(5) Program examples


(a) Program which sets M100 when "either of M0 and X0 is not ON (1)" (i.e.
when M0 and X0 are both OFF (0))
SET M100 = !(M0 + X0)

M0 0 (False)
(True) ! (False)
M100 1 +
X0 0 (False)

5 − 52
5. OPERATION CONTROL PROGRAMS

5.10.3 Logical AND : *

F/FS G Format Number of Basic Steps


(S1)*(S2) 4

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
(S1)        
(S2)        

(2) Data to be set


Data to be Set Description Data Type of Result
(S1)
Data which will be ANDed Logical type (true/false)
(S2)

(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.

(5) Program examples


(a) Program which sets M100 when M0 and X0 are both 1
SET M100 = M0 * X0

M0 1
M100 1 * (True)
X0 1

5 − 53
5. OPERATION CONTROL PROGRAMS

5.10.4 Logical OR : +

F/FS G Format Number of Basic Steps


(S1)+(S2) 4

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
(S1)        
(S2)        

(2) Data to be set


Data to be Set Description Data Type of Result
(S1)
Data which will be ORed Logical type (true/false)
(S2)

(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.

(5) Program examples


(a) Program which sets M100 when either of M0 and X0 is 1
SET M100 = M0 + X0

M0 0
M100 1 + (True)
X0 1

5 − 54
5. OPERATION CONTROL PROGRAMS

5.11 Comparison Operations

5.11.1 Equal to : ==

F/FS G Format Number of Basic Steps


(S1)==(S2) 4

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
(S1)   
(S2)   

(2) Data to be set


Data to be Set Description Data Type of Result
(S1)
Data which will be compared Logical type (true/false)
(S2)

(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.

(5) Program examples


(a) Program which compares whether #0 and D0 are equal or not
#0 = = D0

#0 100
== (True)
D0 100

5 − 55
5. OPERATION CONTROL PROGRAMS

5.11.2 Not equal to : !=

F/FS G Format Number of Basic Steps


(S1)!=(S2) 4

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
(S1)   
(S2)   

(2) Data to be set


Data to be Set Description Data Type of Result
(S1)
Data which will be compared Logical type (true/false)
(S2)

(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.

(5) Program examples


(a) Program which compares whether #0 and D0 are unequal or not
#0 != D0

#0 100
!= (True)
D0 20

5 − 56
5. OPERATION CONTROL PROGRAMS

5.11.3 Less than : <

F/FS G Format Number of Basic Steps


(S1)<(S2) 4

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
(S1)   
(S2)   

(2) Data to be set


Data to be Set Description Data Type of Result
(S1)
Data which will be compared Logical type (true/false)
(S2)

(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.

(5) Program examples


(a) Program which compares whether #0 is less than D0 or not
#0 < D0

#0 10
< (True)
D0 20

5 − 57
5. OPERATION CONTROL PROGRAMS

5.11.4 Less than or equal to: <=

F/FS G Format Number of Basic Steps


(S1)<=(S2) 4

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
(S1)   
(S2)   

(2) Data to be set


Data to be Set Description Data Type of Result
(S1)
Data which will be compared Logical type (true/false)
(S2)

(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.

(5) Program examples


(a) Program which compares whether #0 is less than or equal to D0 or not
#0 <= D0

#0 10
<= (True)
D0 20

5 − 58
5. OPERATION CONTROL PROGRAMS

5.11.5 More than : >

F/FS G Format Number of Basic Steps


(S1)>(S2) 4

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
(S1)   
(S2)   

(2) Data to be set


Data to be Set Description Data Type of Result
(S1)
Data which will be compared Logical type (true/false)
(S2)

(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.

(5) Program examples


(a) Program which compares whether #0 is greater than D0 or not
#0 > D0

#0 400
> (True)
D0 20

5 − 59
5. OPERATION CONTROL PROGRAMS

5.11.6 More than or equal to: >=

F/FS G Format Number of Basic Steps


(S1)>=(S2) 4

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
(S1)   
(S2)   

(2) Data to be set


Data to be Set Description Data Type of Result
(S1)
Data which will be compared Logical type (true/false)
(S2)

(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.

(5) Program examples


(a) Program which compares whether #0 is greater than or equal to D0 or not
#0 >= D0

#0 400
>= (True)
D0 20

5 − 60
5. OPERATION CONTROL PROGRAMS

5.12 Motion-Dedicated Functions (CHGV, CHGT)

5.12.1 Speed change request : CHGV

F/FS G Format Number of Basic Steps


CHGV((S1), (S2)) 4

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
(S1)          
(S2)      

(2) Data to be set


Data to be Set Description Data Type of Result
Axis number to which speed
(S1)
change request will be given 
(S2) Specified speed

(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

For interpolation control, set any one of the interpolation axes.


When linear interpolation control is exercised, a speed change varies as
described below with the positioning speed designation method set in the
servo program.
Positioning Speed
Operation
Designation Method
Combined speed A speed change is made so that the combined speed becomes
designation the speed specified at (S2).
Longest axis A speed change is made so that the longest axis speed becomes
designation the speed specified at (S2).
Reference axis speed A speed change is made so that the reference axis speed becomes
designation the speed specified at (S2).

(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.

(c) When the axis is waiting at the return position


1) Signal states
• Start acceptance (M200n) ON
(unchanged from before execution
of CHGV execution)
• Positioning start completion (M16m0) ON
(unchanged from before execution
of CHGV execution)
• Positioning completion (M16m1) OFF
• In-position (M16m2) ON
• Command in-position (M16m3) OFF
• Speed change "0" accepting flag (-) ON
2) Make a speed change to a positive speed for a restart.
3) Turn ON the stop command to terminate positioning.
4) A negative speed change made again will be ignored.

(d) While the axis is returning in the speed control mode


1) Make a speed change to a positive speed to change the moving direction
again.
2) Turn ON the stop command to make a stop.
3) A speed change is made in the opposite direction if a negative speed
change is made again.

(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

(5) Program examples


(a) Program which changes the positioning speed of axis 2
CHGV(K2,K10)

(b) Return program which changes the positioning speed of axis 1 to a negative
value
CHGV(K1,K-1000)

The following operation will be performed when a return request is made in


constant-speed control.

[Servo program] [Locus]

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 request SVST

Start acceptance
M200n
Speed change
request CHGV

New speed -1000 1000

Combined speed

Return operation to point P1 Waiting at point P1

Command in-position
(OFF)
Speed change "0"
accepting flag

If a speed change to a negative speed is made during execution of position-


ing to P2 as shown above, the axis returns to P1 along the program-
specified locus and waits at P1.

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

5.12.2 Torque limit value change request : CHGT

F/FS G Format Number of Basic Steps


CHGT((S1), (S2)) 4

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
(S1)          
(S2)      

(2) Data to be set


Data to be Set Description Data Type of Result
Axis number to which torque limit
(S1)
value change request will be given 
(S2) Specified torque limit value

(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).

(5) Program examples


(a) Program which changes the torque limit value of axis 2
CHGT(K2,K10)

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

5.13 Other Instructions

5.13.1 Event task enable : EI

F/FS G Format Number of Basic Steps


EI 1

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
           

(2) Data to be set


There are no data to be set.

(3) Functions
(a) The execution of an event task is enabled.

(b) This instruction is usable with a normal task only.

(4) Errors
(a) An operation error will occur if:
1) This instruction is used with other than a normal task.

(5) Program examples


(a) Enables the execution of an event task.
EI

5 − 68
5. OPERATION CONTROL PROGRAMS

5.13.2 Event task disable : DI

F/FS G Format Number of Basic Steps


DI 1

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
           

(2) Data to be set


There are no data to be set.

(3) Functions
(a) The execution of an event task is disabled.

(b) If an external interrupt or PLC interrupt occurs after execution of the DI


instruction, the corresponding event task is executed once at the execution
of the EI instruction. (If two or more external interrupts or PLC interrupts
occur during DI, the corresponding event task is executed only once at the
execution of the EI instruction.)

(c) During DI, a fixed-cycle event task is not executed.

(d) The execution of an NMI task cannot be 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) Program examples


(a) Program which disables the execution of an event task.
DI

5 − 69
5. OPERATION CONTROL PROGRAMS

5.13.3 No operation : NOP

F/FS G Format Number of Basic Steps


NOP 1

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
           

(2) Data to be set


There are no data to be set.

(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

5.13.4 Block transfer : BMOV

F/FS G Format Number of Basic Steps


BMOV(D), (S), (n) 7

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
(D)         
(S)         
(n)         
(Note) : When a 32-bit integer type constant is specified at (D) or (S), the number specified is the
absolute address of the PCPU memory. Specify the absolute address with an even number.

(2) Data to be set


Data to be Set Description Data Type of Result
(D) Transfer destination device starting number
(S) Transfer source device starting number 
(n) Number of words to be transferred

(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.

(c) Specifying Nn (cam number) at (D) or (S) enables batch-transfer of cam


data.
In the motion controller, the cam data of the same cam number must
already have been registered.
The number of transferred words specified at (n) should match the
resolution of the specified cam number.
Operations performed at write and read of cam data are as described
below.
At cam data write
• For A172SHCPUN
The cam data storage area is rewritten.
• For A173UHCPU(-S1)/A273UHCPU-S3
The cam data is stored into the extended file register (block 10 and later)
but this instruction rewrites the cam data import area in the PCPU. The
extended file register contents are not changed.
Therefore, turning the cam data/limit switch output data batch-change
request flag (M2056) OFF, then ON, or powering on the controller and
resetting it with the key returns the cam data import area to the extended
file register contents.

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.

(b) When conversion is made in program editing of the peripheral software, an


error will occur if:
1) (S) to (S)+(n-1) is outside the device range;
when (n) specified is a
2) (D) to (D)+(n-1) is outside the device range;
constant
3) (n) is 0 or a negative number; or
4) The 32-bit integer type constant (PCPU memory absolute address
specified) specified at (D) or (S) is an odd number.

5 − 72
5. OPERATION CONTROL PROGRAMS

(5) Program examples


(a) Program which batch-transfers 5 words of data in devices, starting with D0,
to 5 words of devices, starting with #10
BMOV #10,D0,K5

#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

Cam data of cam No. 2


0th stroke ratio H0000 #0 H0000
Batch
First stroke ratio H0005 transfer #1 H0005
Second stroke ratio H000A #2 H000A
: : : :
2047th stroke ratio H0000 #2047 H0000

5 − 73
5. OPERATION CONTROL PROGRAMS

5.13.5 Time to wait : TIME

F/FS G Format Number of Basic Steps


 TIME(S) 7

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
(S)       

(2) Data to be set


Data to be Set Description Data Type of Result
(S) Waiting time (0 to 2147483647)ms Logical type (true/false)

(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.

(5) Program examples


(a) Program which sets a wait of 60 seconds (when constant is specified)
TIME K60000

(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

5.14 Comment Statement : //

F/FS G Format Number of Basic Steps


// 

(1) Usable data


Usable Data
Word device Constant
Data to Compar-
64-bit 16-bit 32-bit 64-bit Bit
16-bit 32-bit Calculation ison
be Set Bit device floating- Coasting integer integer floating- expression
conditional
conditional
integer integer expression
point timer type type point expression
type type(L)
type(F) (K/H) (K/H,L) type (K)
           

(2) Data to be set


There are no data to be set.

(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) Program examples


(a) Example which has commented an assignment program
D0=D1//Assigns the D0 value (16-bit integer data) to D1.

5 − 76
6. TRANSITION PROGRAMS

6. TRANSITION PROGRAMS

6.1 Transition Programs

(1) Transition programs


(a) In transition programs, you can set assignment operation expressions,
motion-dedicated functions, bit device control commands and transition
conditions.

(b) You can set multiple blocks in a single transition program.

(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.

(d) The maximum number of characters in one block is 128.

(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

#0=D0+(D1+D2)*#5//Assignment expression (four arithmetic operations)


W0:F=SIN(#10F)//Assignment expression (standard function)
CHGV(K2,K10)//Motion-dedicated function
SET M100=M0+X0//Bit device control (SET=) 1 program
RST M10=D100>K10//Bit device control (RST=)
DIN D0,X0//Bit device control (DIN)
D0>K100//Standby until transition condition enables

Comment Transition condition

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.

Classification Description Example


M0
Bit conditional expression
!M0+X10*M100
Comparison conditional
(D0>K100)+(D100L!=K20L)
expression
Device set (SET=) SET Y0=M100
Device reset (RST=) RST M10=D0==K100

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

7. MOTION CONTROL PROGRAMS

7.1 Servo Instruction List

Table 7.2 lists servo instructions used in servo programs.


Refer to Sections 7.2 to 7.4 for details of the present value change control (CHGA,
CHGA-E, CHGA-C) which are newly available.
For other servo instructions, refer to the "Motion Controller (SV13/SV22)
Programming Manual (Real Mode)".

(1) Guide to servo instruction list

Table 7.1 Guide to Servo Instruction List


3) 4) 5) 6) 7) 8)

Positioning Data
Common Circular OSC Parameter block Others

*1 Reference axis No.

Number of Steps
FIN acceleration/deceleration
Positioning Control

Parameter block No.

Sudden stop deceleration time

STOP input-time deceleration


Instruction Symbol

Torque limit value

Torque limit value


Deceleration time
Acceleration time
Command speed

Speed limit value

Repeat condition
Positioning

Circular interpolation error


Address/travel

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

(2) Servo instruction list


Table 7.2 indicates the servo instructions available for servo programs and the
positioning data set in servo instructions.

Table 7.2 Servo Instruction List


Positioning Data
Common Circular OSC *1 Parameter block Others

Frequency

range
STOP input-time deceleration

Circular interpolation error permissible

WAIT-ON/OFF
S-pattern ratio
Command speed
Dwell time
M code

Starting angle

Acceleration time
Central point
Pitch

Amplitude

Speed limit value

Repeat condition

Skip
Parameter block No.

Reference axis No.


Control unit

Torque limit value


processing

Program No.

Start
Axis

Torque limit value


Auxiliary point
Radius

Deceleration time

Command speed (constant speed)

Cancel
Address/travel

Sudden stop deceleration time

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/

ABS-1 Absolute 1-axis positioning


1 axis

4 to 17
INC-1 Incremental 1-axis positioning

Absolute 2-axis linear


2 axes

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 auxiliary point-


ABS
Auxiliary

specified circular interpolation


7 to 22
Incremental auxiliary point-
INC specified circular interpolation
Absolute radius-specified
ABS circular interpolation less than
CW 180°
Absolute radius-specified
ABS circular interpolation CW 180°
or more
Absolute radius-specified
ABS circular interpolation less than
CCW 180°
Radius-specified
Circular interpolation control

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

Table 7.2 Servo Instruction List (Continued)


Positioning Data
Common Circular OSC *1 Parameter block Others

Frequency

range
STOP input-time deceleration

Circular interpolation error permissible

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

Reference axis No.


Control unit
Speed limit value

Torque limit value


processing

Program No.

Start
Axis

Torque limit value

Radius

Deceleration time

Command speed (constant speed)

Cancel
Address/travel

Sudden stop deceleration time

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

FEED-1 1-axis fixed-pitch feed start 4 to 17


2 axes

2-axis linear interpolation


FEED-2 fixed-pitch feed start 5 to 19
3 axes

3-axis linear interpolation


FEED-3 fixed-pitch feed start 7 to 21
Speed control (I)
Forward
rotation

Speed control (I) forward


VF rotation start

3 to 15
Reverse
rotation

Speed control (I) reverse


VR rotation start
Speed-position control Speed control (II)
Forward
rotation

Speed control (II) forward


VVF rotation start
3 to 16
Reverse
rotation

Speed control (II) reverse


VVR rotation start
Reverse Forward
rotation rotation

Speed-position control
VPF forward rotation start
4 to 18
Speed-position control
VPR reverse rotation start
Restart

VPSTART Speed-position control restart 2 to 4

VSTART Speed switching control start 1 to 13

VEND Speed switching control end 1

ABS-1 4 to 9
Speed switching control

Speed switching control end


ABS-2 point address 5 to 10

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

PFSTART Position follow-up control start 4 to 16

1-axis constant-speed control


CPSTART1
start 3 to 15
Constant-speed

2-axis constant-speed control


CPSTART2 3 to 17
control

start
3-axis constant-speed control
CPSTART3
start
4 to 17
4-axis constant-speed control
CPSTART4
start

: 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−3
7. MOTION CONTROL PROGRAMS

Table 7.2 Servo Instruction List (Continued)


Positioning Data
Common Circular OSC *1 Parameter block Others

Frequency

range
STOP input-time deceleration

Circular interpolation error permissible

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.

Reference axis No.


Control unit

Torque limit value


processing

Program No.

Start
Axis

Torque limit value


Auxiliary point

Central point
Radius

Deceleration time

Command speed (constant speed)

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-ON Repeat range start setting 2

FOR-OFF

NEXT Repeat range end setting 3


Simultaneous
start

START Simultaneous start 2 to 3

Zeroing ZERO Zeroing start 2


High-speed
oscillation

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

7.2 Servo Motor/Virtual Servo Motor Shaft Current Value Change

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.

Items Set on Peripheral Device


Common Circular Parameter block Others

Sudden stop deceleration time


Acceleration time
Command speed
Dwell time
M code

Speed limit value

Deceleration time

Torque limit value


Torque limit value

S-pattern ratio
Cancel
Address/travel

processing
Auxiliary point

permissible range
Parameter block No.

Control unit

STOP input-time deceleration

Start
Axis

Radius
Central point

Circular interpolation error

Speed Change
Number of
Servo Positioning
Control
Instruction Method
Axes

CHGA-C Absolute 1 Disable

: Item which must be set


: Item which is set when required
[Controls]
Control using CHGA instruction
(1) Executing the CHGA instruction changes the current value in the following
procedure.
(a) The start acceptance flag (M2001 to M2008/M2001 to M2032)
corresponding to the specified axis is turned ON.
(b) The current value of the specified axis is changed to the specified address.
(c) Start acceptance is turned OFF on completion of the current value change.

(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

MR- -B MR- -B MR- -B MR- -B MR- -B MR- -B MR- -B MR- -B


Axis 1 Axis 2 Axis 3 Axis 4 Axis 5 Axis 6 Axis 7 Axis 8
M M M M M M M M

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

(3) Operation timing

CHGA instruction

Start acceptance flag

Current value change completion

(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.

Items Set on Peripheral Device


Common Circular Parameter block Others

Sudden stop deceleration time


Acceleration time
Command speed
Dwell time
M code

Speed limit value

Deceleration time

Torque limit value


Torque limit value

S-pattern ratio
Cancel
Address/travel

Auxiliary point

processing

permissible range
Parameter block No.

Control unit

STOP input-time deceleration

Start
Axis

Radius
Central point

Circular interpolation error

Speed Change
Number of
Servo Positioning
Control
Instruction Method
Axes

CHGA-E Absolute 1 Disable

: Item which must be set


: Item which is set when required
[Controls]
Control using CHGA-E instruction
(1) Executing the CHGA-E instruction changes the current value of the
synchronous encoder shaft in the following procedure.
(a) The synchronous encoder shaft current value changing flag (M2031/M2101
to M2112) corresponding to the specified synchronous encoder shaft is
turned ON.
(b) The current value of the specified synchronous encoder shaft is changed to
the specified address.
(c) The synchronous encoder shaft current value changing flag is turned OFF
on completion of the current value change.

(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.

(1) System configuration


The current value change control of the synchronous encoder P1 axis is
performed.
A172SHCPUN A172S A1S
ENC X10
A172B

P1 axis

MR- -B MR- -B MR- -B MR- -B MR- -B MR- -B MR- -B MR- -B


Axis 1 Axis 2 Axis 3 Axis 4 Axis 5 Axis 6 Axis 7 Axis 8
M M M M M M M M

7−8
7. MOTION CONTROL PROGRAMS

(2) Current value change control conditions


(a) The current value change control conditions are indicated below.
Item Setting
Servo program number No.10
Control axis. 1
Indirect designation
New address
using D10, D11

(3) Operation timing

CHGA-E instruction

Synchronous encoder
shaft current value
changing flag
Current value change
completion

(4) Servo program

<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)

Items Set on Peripheral Device


Common Circular Parameter block Others

Sudden stop deceleration time


Command speed
Dwell time
M code

Acceleration time
Speed limit value

Deceleration time

Torque limit value


Torque limit value

S-pattern ratio
Cancel
Address/travel

Auxiliary point

processing

permissible range
Parameter block No.

STOP input-time deceleration

Start
Axis

Radius
Central point
Control unit

Circular interpolation error

Speed Change
Number of
Servo Positioning
Control
Instruction Method
Axes

CHGA-C Absolute 1 Disable

: Item which must be set


: Item which is set when required
[Controls]
Control using CHGA-C instruction
(1) Executing the CHGA-C instruction changes the within-one-revolution current
value of the specified cam shaft to the specified address.

(2) The cam shaft may be starting.

(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.

(1) Current value change control conditions


(a) The current value change control conditions are indicated below.
Item Setting
Servo program number No.10
Output shaft number 2
New address 0

7 − 11
7. MOTION CONTROL PROGRAMS

(2) Servo program


<K 10>
CHGA-C Cam shaft within-one-revolution
Axis 2, 0 current value change control
Output shaft number ..... 1
New address ................. 0

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.

8.1 Motion Registers (#0 to #8191)

Motion Device Item A172SHCPUN/A173UHCPU(-S1)/A273UHCPU-S3


Number of points 8192 points (#0 to #8191)
Data size 16 bits/point
Latched with the exception of SFC-dedicated devices.
Motion register (#) Latch
(All points are cleared by latch clear operation.)
Usable tasks Normal, event, NMI
Access Read and write enabled in whole range

(1) Motion register list


(a) Common to all Operating Systems.
Device Number Application Remarks
#0
User devices
Cleared by latch clear.
(8000 points)

#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

(2) SFC-dedicated devices (#8000 to #8191)


The SFC-dedicated devices are indicated below.
The device's refresh cycle is indicated when the signal direction is "status", or
its import cycle when the signal direction is "command".
Device Signal Direction
Signal Name Refresh Cycle Import Cycle
Number Status Command
Seventh error information in past
#8000
(Oldest error information)
#8008 Sixth error information in past
#8016 Fifth error information in past SFC error history
At error
#8024 Fourth error information in past (8 errors)  
occurrence
#8032 Third error information in past (64 points)
#8040 Second error information in past
#8048 First error information in past
#8056 Latest error information
#8064
User unusable
(128 points)
#8191

8−2
8. MOTION DEVICES

(3) SFC error history devices


The error information which occurred after power-on of the CPU is stored as a
history of up to eight past errors. The latest error is stored in #8056 to #8063.
All errors, including the SFC control errors and the conventional minor, major,
servo, servo program and mode changing errors, have been integrated into this
history.
At error occurrence, the "SFC error detection signal M2039" is also set.
The error information is as indicated below.

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

(4) SFC error detection signal (M2039)


(Refresh cycle UH: 10ms, SH: PLC scan time)
The SFC error detection signal (M2039) turns ON when any of the errors detected
by the motion CPU occurs.
At error occurrence, data are set to the error devices in the following procedure.
(a) The error code is set to the corresponding axis or error devices.
(b) The error detection signal of the corresponding axis or error is turned ON.
(c) Error information is set to the above "SFC error history devices (#8000 to
#8063)".
(d) The SFC error detection signal (M2039) is turned ON.

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.2 Coasting Timer (FT)

Motion Device Item A273UHCPU-S3/A172SHCPUN


Number of points 1 point (FT)
Data size 32 bits/point (-2147483648 to 2147483647)
Latch No latch. Cleared to zero at power-on or key-reset.
Coasting timer (FT) Usable tasks Normal, event, NMI
Access Read only enabled
888µs timer
Timer specifications
(Current value (FT) is incremented by 1 per 888µs.)

8−4
9. TASK OPERATIONS

9. TASK OPERATIONS

9.1 Task Definitions

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.

Task Type Description


Normal task Executed in motion main cycle (free time).
Event task 1. Executed in fixed cycle (1.7ms, 3.5ms, 7.1ms, 14.2ms).
2. Executed when the input set to the event task factor among external interrupts
(16 points of AI61) turns ON.
3. Executed by an interrupt from the PLC.
NMI task Executed when the input set to the NMI task factor among external interrupts (16
points of AI61) turns ON.

(1) Normal task


[Operations]
An SFC program is run in the main cycle (free time) of the motion side CPU
(PCPU) processing.
The processing is outlined as follows.
Normal task execution cycle

SFC program running cycle

SFC program run SFC program run

System main control

PBUS's X (PX) is refreshed to PLC device.

PBUS's actual X (PX) read


PBUS's actual Y (PY) write

[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

(2) Event task


[Operations]
An event task runs an SFC program at occurrence of an event.
There are the following events.
(a) Fixed cycle
An SFC program is run periodically in any of 1.7ms, 3.5ms, 7.1ms and
14.2ms cycles.
(b) External interrupt (16 points of I0 to I15)
Among 16 points of the AI61 (16-point interrupt module) loaded in the
motion slot, an SFC program is run when the input set for an event task
turns ON.
(c) PLC interrupt
An SFC program is run when the ITP instruction is executed in the
sequence program.

[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.

(3) NMI task


[Operations]
An SFC program is run as soon as the input set to the NMI task factor among
the external interrupts (16 points of the AI61) turns ON.

[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

9.2 Task Execution Status

The following example gives how the SFC programs run by multiple tasks are
executed.
3.5ms NMI interrupt NMI interrupt

NMI task-run program

3.5ms event task-run program

Normal task-run program

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

10. PROGRAMMING INSTRUCTIONS

10.1 Task Definitions

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.

10.2 SET/RST Response Delays of Motion-Dedicated Bit Devices

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

10.3 Cancel Start

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

G0 G1 Providing transition G1 with cancel device condition specified in


servo program K0 will cancel run of servo program K0 and allow
servo program K1 to start.
K1

10.4 Indirect Designation using Motion Devices

The motion registers #0 to #8191 cannot be used to make indirect designation in


servo and mechanical system programs.
When using the motion register values in servo or mechanical system programs,
assign them to PLC devices.

10.5 Sequence Programs

(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

11. SFC PARAMETERS


Two different SFC parameters are available: "task parameters" designed to control
the tasks (normal task, event task, NMI task) and "program parameters" to be set
per SFC program.
Their details will be explained below.

11.1 Task Parameters

No. Item Setting Item Initial Value Remarks


Number of These parameters are imported when PLC
1 consecutive Normal task 1 to 30 3 ready (M2000) turns from OFF to ON and
transitions used for control thereafter.
Set whether the event task When setting/changing the values of these
or NMI task is used for parameters, turn PLC ready (M2000) OFF.
2 Interrupt setting Event task
external interrupt inputs
(I0 to I15).

(1) Number of consecutive transitions

[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.

Consecutive transition control indicates that transition destination steps are


executed one after another in the same one execution cycle when their
transition conditions have enabled (single basic operation is performed
consecutively).
Set the number of consecutive transitions in this case.
Control exercised is common to the SFC programs run by normal tasks.

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

(2) Interrupt setting

[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.2 Program Parameters

Set the following parameters per SFC program.

No. Item Setting Range Initial Value Remarks


1 Start setting Automatically started or not Not These parameters are
imported when PLC ready
Only one of normal, event and NMI tasks Normal task (M2000) turns from OFF to
When you have set the event task, further set the event ON and used for control
which will be enabled. thereafter.
Always set any one of the following 1 to 3. When setting/changing the
1. Fixed cycle values of these parameters,
One or none of 1.7ms, 3.5ms, 7.1ms and 14.2ms. turn PLC ready (M2000) OFF.
2. External interrupt (make selection from those set to
event task) POINT
More than one interrupt can be set from among I0, The settings of "executed
I1, I2, I3, I4, I5, I6, I7, I8, I9, I10, I11, I12, I13, I14 task", "number of consecutive
and I15. transitions" and "END
2 Executed task 3. PLC interrupt
None operation" are invalid for the
OR may also be used to set 1 to 3. subroutine called program.
The same event may be shared among multiple SFC For the subroutine called
programs. program, "executed task" and
When you have set the NMI task, further set the interrupt "number of consecutive
input which will be enabled. transitions" depend on the call
1. External interrupt (make selection from those set to source program setting.
NMI task) "END operation" is controlled
More than one interrupt can be set from among I0, as "end".
I1, I2, I3, I4, I5, I6, I7, I8, I9, I10, I11, I12, I13, I14
and I15.
Number of 1 to 10
3 consecutive Set the number of consecutive transitions to the program 1
transitions set to the event or NMI task.
END End/continue
4 Set the operation mode of the END step to the program End
operation set to the event or NMI task.

11 − 3
11. SFC PARAMETERS

(1) Start setting

[Description]
The following control is governed by "automatically started or not" setting.

• Program run by normal task

No. Item When "automatically started" When "not automatically started"


In the main cycle after PLC ready (M2000) has turned The program is started by the SFC start instruction
from OFF to ON, the program is run from the initial
( SFCS ) from the PLC or by a subroutine call/start
(first) step in accordance with the normal task's
consecutive transition count. ( GSUB ) made from within the SFC program.
• When started by the SFCS instruction
In the main cycle after execution of the SFCS
instruction, the program is run from the initial (first)
step in accordance with the normal task's
consecutive transition count.
• When subroutine started
1 Start control In the (next) main cycle after execution of GSUB ,
the program is run from the first step in accordance
with the normal task's consecutive transition count.
• When subroutine called
The program is run in the same cycle from the first
step.
After that, in the motion main cycle, the program is run continuously by the number of consecutive transitions of
the normal task.
(The settings of "executed task" and "number of consecutive transitions" of the subroutine called program are
invalid. The normal task is used for control.)
Ends its own program.
End The program is started when it is started again by the SFC start instruction ( SFCS ) from the PLC or by a
2
control subroutine call/start ( GSUB ) made from within the SFC program.

• Program run by event task


No. Item When "automatically started" When "not automatically started"
At occurrence of a valid event after PLC ready (M2000) The program is started by the SFC start instruction
has turned from OFF to ON, the program is run from ( SFCS ) from the PLC or by a subroutine call/start
the initial (first) step in accordance with the number of ( GSUB ) made from within the SFC program.
consecutive transitions of the corresponding program. • When started by the SFCS instruction
At occurrence of a valid event after execution of the
SFCS instruction, the program is run from the initial
(first) step in accordance with the number of
consecutive transitions of the corresponding program.
• When subroutine started
1 Start control At occurrence of a valid event after execution of
GSUB, the program is run from the first step in
accordance with the number of consecutive
transitions of the corresponding program.
• When subroutine called
The program is run immediately from the first step.
After that, at occurrence of a valid event, the program is run continuously by the number of consecutive
transitions of the corresponding program.
(The subroutine called program is controlled in accordance with the "executed task" and "number of consecutive
transitions" of the call source program.)
End
2 As specified for END operation.
control

11 − 4
11. SFC PARAMETERS

• Program run by NMI task


No. Item When "automatically started" When "not automatically started"
At occurrence of a valid event after PLC ready (M2000) The program is started by the SFC start instruction
has turned from OFF to ON, the program is run from ( SFCS ) from the PLC or by a subroutine call/start
the initial (first) step in accordance with the number of ( GSUB ) made from within the SFC program.
consecutive transitions of the corresponding program. • When started by the SFCS instruction
At occurrence of a valid event after execution of the
SFCS instruction, the program is run from the initial
(first) step in accordance with the number of
consecutive transitions of the corresponding program.
• When subroutine started
1 Start control At occurrence of a valid event after execution of
GSUB , the program is run from the first step in
accordance with the number of consecutive
transitions of the corresponding program.
• When subroutine called
The program is run immediately from the first step.
After that, at occurrence of a valid event, the program is run continuously by the number of consecutive
transitions of the corresponding program.
(The subroutine called program is controlled in accordance with the "executed task" and "number of consecutive
transitions" of the call source program.)
End
2 As specified for END operation.
control

[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

(2) Executed task

[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

(3) Number of consecutive transitions

[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.

(4) END operation

[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.

NO. Item When "Ended" When "Continued"


Control at END Ends the run of its own program with the
1 Ends its own program.
execution event/interrupt made this time.
Restarted at occurrence of the next valid
event/interrupt, and run from the initial (first) step
in accordance with the number of consecutive
Started by the SFC start instruction ( SFCS ) from transitions of the corresponding program.
Restart after END
2 the PLC again or started by a subroutine call/start ( Thereafter, at occurrence of a valid event/interrupt,
execution
GSUB ) made from within the SFC program. the program is controlled in accordance with the
number of consecutive transitions of the
corresponding program.
Restart after end by Started by the SFC start instruction ( SFCS ) from the PLC again or started by a subroutine call/start (
3
clear step CLR GSUB ) made from within the SFC program.

POINT
The END operation of the subroutine called program is controlled as an "end".

11 − 7
11. SFC PARAMETERS

• The following operation example assumes that the END operation is


"continued".
Program parameters

• Automatically started
• Executed task = event 3.5ms
• Number of consecutive transitions = 2
• END operation "Continued"

F20 1) After M2000 has turned from OFF


to ON, program is run at 3.5ms
intervals (first time) following event 4) Program is run in 3.5ms cycle
task enable. (fourth time).
F1

F2
2) Program is run in 3.5ms cycle 5) Program is run in 3.5ms cycle
(second time). (fifth time).
F3

F4 3) Program is run in 3.5ms 6) Program is run in 3.5ms


cycle (third time). cycle (sixth time).
END

11 − 8
12. HOW TO RUN SFC PROGRAM

12. HOW TO RUN SFC PROGRAM

12.1 How to Start SFC Program

An SFC program runs while PLC ready M2000 is ON.


An SFC program may be started by any of the following three methods.
(1) Automatic start
(2) Start from SFC program
(3) Start from PLC
Set the starting method in the program parameter per SFC program.
Refer to Chapter 11 SFC Parameters for parameter setting.

12.1.1 Automatic start

[Operations]
An automatic start is made by turning PLC ready M2000 ON.

12.1.2 Start from SFC program

[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

12.1.3 Start from PLC (Sequence instruction SFCS )

The SFC program can be started by executing the following instruction in the
sequence program.

• SFC program start request instruction (SFCS)

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

Settings Setting Range


SFC program
number to be 0 to 255
started
A173UHCPU
SFC program number to be
n A172SHCPUN (-S1)
started When specified
/A273UHCPU-S3
indirectly
D0 to D1023 D0 to D8191
(1 word)
W0 to W3FF W0 to W1FFF
R0 to R8191 R0 to R8191

[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.

<SFC error history devices>


Error SFC program Started SFC program SFC error
#8056 M2039 (ON)
number number detection signal
#8057 Error type -1
#8058 Error program number -1
#8059 Error block number -1
#8060 Error code * (indicated below)
#8061 Year/month ??
Error
#8062 Day/hour ??
occurrence
Minute/
#8063 time ??
second

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

12.2 How to End SFC Program

[Operations]

(1) The SFC program is ended by executing END set in itself.


(2) The SFC program is stopped by turning OFF the PLC ready signal M2000.
(3) The program can be ended by the clear step.
For details of the clear step, refer to the section of the clear step in Chapter 4
SFC Programs.

[Points]
(1) Multiple ENDs can be set in a single SFC program.

12.3 Clear Step in the SFC Program

Executing the clear step set in the SFC program stops the run of the SFC program
specified in the clear step.

12.4 How to Change from One SFC Program to Another

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

12.5 How to Manage the Running Programs

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

12.6 SCPU to PCPU Interrupt Instruction (Sequence instruction ITP )

Executing the following instruction in a sequence program generates an


interruption to the motion CPU.

• PCPU interrupt instruction (ITP)

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.

<SFC error history devices>


SFC error
#8056 Error SFC program number -1 M2039 (ON)
detection signal
#8057 Error type -1
#8058 Error program number -1
#8059 Error block number -1
#8060 Error code * (indicated below)
#8061 Year/month ??
Error
#8062 Day/hour ??
occurrence
Minute/
#8063 time ??
second

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

13. SFC PROGRAM CONTROLLING OPERATIONS

13.1 Operation Performed at CPU Power-Off or Key-Reset

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.

13.2 Operation Performed when CPU Is Put in RUN Mode

When the CPU is set to the RUN mode, the following operation is performed.

(1) When PLC ready M2000 is ON


• The SFC programs set to start automatically run from the initial step.
• The output states are governed by the PLC side "STOP→RUN time output
mode" parameter setting.

(2) When PLC ready M2000 is OFF


• The SFC programs do not run until M2000 is turned ON.
• The output states are governed by the PLC side "STOP→RUN time output
mode" parameter setting.

13.3 Operation Performed when CPU Is Switched from RUN to STOP

(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.4 Operation Performed when CPU is set to PAUSE or STEP-RUN

When the CPU is set to PAUSE or STEP-RUN, SFC programs continue


processing without stopping.

13 − 1
13. SFC PROGRAM CONTROLLING OPERATIONS

13.5 Operation Performed when PLC Ready (M2000) Turns OFF/ON

[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.

(2) SFC program run governed by RUN/STOP and M2000 ON/OFF

PLC Ready M2000 Is ON PLC Ready M2000 Is OFF


SFC programs Run SFC programs stop
RUN Turn ON/OFF according to
Outputs Outputs held
program
SFC programs SFC programs stop ←
STOP
Outputs All outputs turn OFF ←
SFC programs set to start
STOP SFC programs automatically restart from SFC programs remain stopped
↓ beginning
RUN As set in sequence parameter As set in sequence parameter
Outputs
"STOP→RUN time output mode" "STOP→RUN time output mode"

13 − 2
13. SFC PROGRAM CONTROLLING OPERATIONS

13.6 Error-Time Operation

Outputs are held if SFC programs stop due to error occurrence.


To turn OFF outputs at error occurrence, run the following SFC program.

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).

F0 F1 Outputs which must be turned OFF are turned OFF.


SFC error detection signal M2039 is turned OFF.

P0

At SCPU WDT ERROR occurrence, all SFC programs running stop and all outputs
turn OFF.

13 − 3
14. USER FILES

14. USER FILES


This chapter provides a user file list and directory structure.
14.1 Projects

User files are managed on a "project" basis.


When you set a "project name", a "project name" folder is created as indicated on
the next page, and under that, sub folders (SFC, GLIST, GCODE, FLIST, FCODE)
classified by file types are created.
Also, under the SFC sub folders, initial files of the "project file (project name.prj)"
and an editing folder (temp) are created.

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

14.2 User File List

A user file list is indicated below.

* : Indicates the file (data) stored in CPU memory.


: Indicates a new file. (The other files are the same as in the conventional structure.)

Project name folder Folder of user-set "project name"


Sub folders (fixed)
SFC
(1) Project file Project file name.prj ( × 1 pc.)
Information file of correspondence between SFC program numbers (0 to 255) and SFC program names (SFC files)
(2) SFC chart file SFC program name.sfc ( × 256 pcs.)
SFC chart edit information and comment information file of one SFC program
(3) SFC list file SFC program name.txt ( × 256 pcs.)
Text file after conversion of SFC chart of one SFC program into list
(4) SFC code file SFC program name.cod ( × 256 pcs.)
File after conversion of list file of one SFC program into internal codes (including comment information)
GLIST
(5) G list file g0000.bin to g4095.bin
List file of transition programs (G0 to G4095)
GCODE
(6) G code file g0000.cod to g4095.cod
File after conversion of transition program (G0 to G4095) list file fn.bin (0 ≤ n ≤ 4095) into internal codes
FLIST
(7) F/FS list file f0000.bin to f4095.bin
List file of operation control programs (F/FS0 to F/FSG4095)
FCODE
(8) F/FS code file f0000.cod to f4095.cod
File after conversion of operation control program (F/FS0 to F/FS4095) list file fn.bin (0 ≤ n ≤ 4095) into internal codes

* (9a) SFC program conversion file (control code) sfcprog.cod


File where SFC code, G code and F/FS code files are combined and converted into CPU's SFC program code memory
storage format

* (9b) SFC program conversion file (text) sfcprog.bin


File where G list and F/FS list files are combined and converted into CPU's SFC program text memory storage format
(Note) The above two files are always updated simultaneously.

* (10) SFC parameter file sfcprm.bin


SFC control parameter setting information file

* (11) K code file svprog.bin


Servo program (K0 to K4095) internal code file (file size is fixed in length)

(12) PLC type file gsvp.cnf CPU type information file

* (13) System setting data file svsystem.bin System setting data information file
High speed read setting file svlatch.bin

* (14) Servo data file svdata.bin Parameter information file


svls.bin Limit switch setting data information file

(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

(19) Motion device file modevice.bin #0 to #8191 read file (16KB)


For write, only user device range (#0 to #7999) is written.
temp Program editing temporary directory

14 − 2
15. ERROR LISTS

15. ERROR LISTS


Eight errors that occurred in the past during SFC control are stored into the "error
history devices (#8000 to #8039)" of the motion registers.
The "error codes" in them indicate the following definitions.
The conventional minor errors, major errors, servo errors, servo program errors,
mode change errors (SV22 only) and similar errors remain unchanged.

15.1 SFC Program Errors

Table 15.1 SFC Program Start Errors (16000 to 16099)

Error Error Factor


Error Processing Corrective Action
Code Name Definition
At a start made by SFCS , PLC The specified SFC Provide ON of PLC ready (M2000)
16000 PLC ready OFF (SFCS) ready (M2000) or PCPU ready program does not start. and PCPU ready (M9074) as start
(M9074) is OFF. interlocks.
At an SFC program start made by Check the SFC program number,
SFC program number error SFCS , the SFC program number and correct it to a correct sequence
16001
(SFCS) specified is outside the range 0 to program.
255.
At an SFC program start made by Check the SFC program number,
SFCS , the specified SFC program and correct it to a correct sequence
16002 No SFC program (SFCS)
does not exist. program, or create an SFC program
not yet created.
At an SFC program start made by Double start should be managed on
SFCS , the same SFC program is the user side. Provide the user's
16003 Double start error (SFCS)
already starting. starting signal as a start interlock in
the sequence program.
ITP was executed with PLC ready The SFC program's Provide ON of PLC ready (M2000)
(M2000) or PCPU ready (M9074) active step to be and PCPU ready (M9074) as
16004 PLC ready OFF (ITSP) OFF. executed at a "PLC ITP execution interlocks.
interrupt" is not
processed.
At an SFC program start made by The specified SFC Check the SFC program number,
automatic start setting or GSUB , program does not start. and correct it to a correct program,
16005 No SFC program
the specified SFC program does When started by or create an SFC program not yet
not exist. GSUB , the start created.
At an SFC program start made by source SFC program Double start should be managed on
automatic start setting or GSUB , being run also stops. the user side.
16006 Double start error
the same SFC program is already Provide the user's starting signal as
starting. a transition condition.

15 − 1
15. ERROR LISTS

Table 15.2 SFC Interpreter Detection Errors (16100 to 16199)

Error Error Factor


Error Processing Corrective Action
Code Name Definition
The code exists but is The corresponding SFC The SFC program code is
grammatically erroneous. program No. being run corrupted.
• Though not within branch- stops. Turn PLC ready (M2000) OFF and
16100 coupling, a label/jump code within For the subroutine write the SFC program again, or
selective branch-coupling or a called program, the call change the battery (A6BAT) if it has
label/jump code within parallel source program being reached the end of its life.
branch-coupling exists. run also stops.
• Selective branch destinations are
SFC program error
16101 all headed by other than SFT or
(grammatical error)
WAIT transitions.
• WAITON/WAITOFF is not
followed by a motion control step.
16102
(However, this is permitted to a
pointer (Pn) or jump (Pn).)
• A parallel branch is followed by an
16103 END step without a parallel
coupling.
• An impossible code is used.
16104 SFC code error
The internal code is corrupted.
• Internal code (list code) error in
16105 Jump code error 1
jump destination information
• Internal code (label information)
16106 Jump code error 2 error in jump destination
information
• Internal code (label number) error
16107 Jump code error 3
in jump destination information
• Internal code (label address) error
16108 Jump code error 4
in jump destination information
• The specified pointer does not
16109 Jump destination error
exist at the jump destination.
• Its own program was GSUB cannot call its own or main
16110 GSUB setting error 1
called/started by GSUB. program.
• The main program was Correct the SFC program.
16111 GSUB setting error 2
called/started by GSUB.
• Nesting of parallel branches The nesting of parallel branch is up
within a parallel branch route to four levels.
Parallel branch nesting
16112 exceeded four levels. Subroutine the branch destination
excess
processing and correct the
program.
• An attempt was made to execute Motion control steps cannot be set
a motion control step K with an in SFC programs run by the event
event or NMI task. and NMI tasks.
16113 Executed task error
Correct the SFC program or change
the "executed task" setting of the
SFC parameter to a normal task.
• The number of simultaneously The max. number of simultaneously
Simultaneously active step
16120 active steps exceeded 256 during active steps is 256.
count excess
execution. Reexamine the SFC program.

15 − 2
15. ERROR LISTS

Table 15.3 SFC Program Run Errors (16200 to 16299)

Error Error Factor


Error Processing Corrective Action
Code Name Definition
The servo program (Kn) specified The corresponding SFC Create the specified servo program.
16200 No specified program (Kn) at the motion control step does not program being run
exist. stops.
The program (Fn/FSn) specified at For the subroutine Create the specified operation
No specified program
16201 the operation control step does not called program, the call control program.
(Fn/FSn)
exist. source program being
The program (Gn) specified at the run also stops. Create the specified transition
16202 No specified program (Gn)
transition does not exist. program.
The SFC program specified at the Correct the specified SFC program
No specified program
16203 clear step does not exist. name or create the specified SFC
(SFC)
program.
No setting of operation The program (Gn) specified at the Always set a conditional expression
16204 expression/conditional transition does not have a in the last block of the transition
expression conditional expression setting. program.
Internal code error in the operation The SFC program code is
16205 Fn/FSn program code error
program (Fn/FSn) corrupted.
Internal code error in the transition Turn PLC ready (M2000) OFF and
program (Gn) write the SFC program again, or
16206 Gn program code error
change the battery (A6BAT) if it has
reached the end of its life.

15 − 3
15. ERROR LISTS

Table 15.4 Operation Control/Transition Execution Errors (16300 to 16599)

Error Error Factor


Error Processing Corrective Action
Code Name Definition
Event task enable was executed in The block processing in Event task enable may be executed
Event task enable (EI)
16301 other than the normal task. execution is stopped in the normal task only. Correct the
execution error
and the next block is program.
Event task disable was executed in executed. Event task disable may be
Event task disable (DI)
16302 other than the normal task. executed in the normal task only.
execution error
Correct the program.
The cam data of the cam No. Correct the program so that cam
specified at (D) or (S) is not yet data is that of the already
registered to the motion controller. registered cam No.
The resolution of the cam No. Correct the program to match (n)
specified at (D) or (S) differs from with the cam resolution.
the number of transferred words Correct the program to specify the
specified at (n). PCPU memory address with an
Block transfer (BMOV)
16303 The PCPU memory address even number.
execution error
specified at (D) or (S) is outside the Change (n) so that the block
SRAM range. transfer range is within the device
(S) to (S)+(n-1) is outside the range.
device range. Change (n) to a positive number.
(D) to (D)+(n-1) is outside the
device range.
(n) is 0 or a negative number.
The device number which indirectly Correct the program so that the
specifies (S) is illegal. device number which indirectly
Time to wait (TIME) The (S) data is outside the range 0 specifies (S) is proper.
16304
execution error to 2147483647. Correct the program so that the (S)
data is within the range 0 to
2147483647.
Speed change request The specified axis number is Correct the program so that the
16308
(CHGV) execution error outside the range. specified axis number is within the
Torque limit value change range.
16309 request (CHGT) execution
error
The (S) data is outside the range of Correct the program so that the (S)
the data type of (D). data is within the range of the data
Assignment (=) execution The device number which indirectly type of (D).
16316
error specifies (D) is illegal. Correct the program so that the
device number which indirectly
specifies (D) is proper.
16320 Operation (/) execution error The divisor is 0. Correct the program so that the
Remainder (%) execution divisor is other than 0.
16321
error
Device set (SET) execution The device number which indirectly Correct the program so that the
16332
error specifies (D) is illegal. device number which indirectly
Device reset (RST) (D) is a device which is write- specifies (D) is proper.
16333
execution error disabled. Correct the program to set a write-
Device set (SET=) enabled device at (D).
16334
execution error
Device reset (RST=)
16335
execution error
Device output (DOUT)
16336
execution error

15 − 4
15. ERROR LISTS

Table 15.4 Operation Control/Transition Execution Errors (16300 to 16599) (Continued)

Error Error Factor


Error Processing Corrective Action
Code Name Definition
The device number which indirectly The block processing in Correct the program so that the
Device input (DIN)
16337 specifies (D) is illegal. execution is stopped device number which indirectly
execution error
and the next block is specifies (D) is proper.
Signed 16-bit integral value The (S) data is outside the signed executed. Correct the program so that the (S)
16380 conversion (SHORT) 16-bit integral value range. data is within the signed 16-bit
execution error integral value range.
Unsigned 16-bit integral The (S) data is outside the Correct the program so that the (S)
16381 value conversion unsigned 16-bit integral value data is within the unsigned 16-bit
(USHORT) execution error range. integral value range.
Signed 32-bit integral value The (S) data is outside the signed Correct the program so that the (S)
16382 conversion (LONG) 32-bit integral value range. data is within the signed 32-bit
execution error integral value range.
Unsigned 32-bit integral The (S) data is outside the Correct the program so that the (S)
16383 value conversion (ULONG) unsigned 32-bit integral value data is within the unsigned 32-bit
execution error range. integral value range.
Tangent (TAN) execution (S) is 90+(180*n). Correct the program so that (S) is
16398
error (n is an integer) not 90+(180*n). (n is an integer)
Arcsine (ASIN) execution (S) is outside the range -1.0 to 1.0. Correct the program so that (S) is
16399
error within the range -1.0 to 1.0.
Arccosine (ACOS)
16400
execution error
Square root (SQRT) (S) is a negative number. Correct the program so that (S) is a
16402
execution error positive number.
BCD→BIN conversion Any digit of (S) has a value other Correct the program so that each
16403
(BIN) execution error than 0 to 9. digit of (S) is 0 to 9.
The (S) value is outside the range Correct the program so that the (S)
BIN→BCD conversion
16404 where BIN data can be converted value is within the range.
(BCD) execution error
into BCD data.
Natural logarithm (LN) (S) is 0 or a negative number. Correct the program so that (S) is a
16405
execution error positive number.
Indirectly specified 16-bit The indirectly specified device Correct the program so that the
16462 motion device (#(n)) read number is outside the range. indirectly specified device number
error is proper.
Indirectly specified 32-bit The indirectly specified device
16463 motion device (#(n)L) read number is outside the range or an
error odd number.
Indirectly specified 64-bit
16464 motion device (#(n)F) read
error
Indirectly specified 16-bit The indirectly specified device
16465 data register (D(n)) read number is outside the range.
error
Indirectly specified 32-bit The indirectly specified device
16466 data register (D(n)L) read number is outside the range or an
error odd number.
Indirectly specified 64-bit
16467 data register (D(n)F) read
error

15 − 5
15. ERROR LISTS

Table 15.4 Operation Control/Transition Execution Errors (16300 to 16599) (Continued)

Error Error Factor


Error Processing Corrective Action
Code Name Definition
Indirectly specified 16-bit The indirectly specified device The block processing in Correct the program so that the
16468 link register (W(n)) read number is outside the range. execution is stopped indirectly specified device number
error and the next block is is proper.
Indirectly specified 32-bit The indirectly specified device executed.
16469 link register (W(n)L) read number is outside the range or an
error odd number.
Indirectly specified 64-bit
16470 link register (W(n):F) read
error
Indirectly specified 16-bit The indirectly specified device
16471 timer present value (T(n)) number is outside the range.
read error
Indirectly specified 16-bit
16472 counter present value
(C(n)) read error
Indirectly specified input
16486
relay (X(n)) read error
Indirectly specified output
16487
relay (Y(n)) read error
Indirectly specified
16488 internal/latch relay
(M(n)/L(n)) read error
Indirectly specified link
16489
relay (B(n)) read error
Annunciator (F(n)) read
16490
error
Timer contact (TT(n)) read
16491
error
16492 Timer coil (TC(n)) read error
Counter contact (CT(n))
16493
read error
Counter coil (CC(n)) read
16494
error
Indirectly specified 16-bit The indirectly specified device
16516 batch input relay (X(n)) read number is outside the range or is
error not a multiple of 16.
Indirectly specified 32-bit
16517 batch input relay (X(n)) read
error
Indirectly specified 16-bit
16518 batch output relay (Y(n))
read error
Indirectly specified 32-bit
16519 batch output relay (Y(n))
read error
Indirectly specified 16-bit
16520 batch internal/latch relay
(M(n)/L(n)) read error

15 − 6
15. ERROR LISTS

Table 15.4 Operation Control/Transition Execution Errors (16300 to 16599) (Continued)

Error Error Factor


Error Processing Corrective Action
Code Name Definition
Indirectly specified 32-bit The indirectly specified device The block processing in Correct the program so that the
16521 batch internal/latch relay number is outside the range or is execution is stopped indirectly specified device number
(M(n)/L(n)) read error not a multiple of 16. and the next block is is proper.
Indirectly specified 16-bit executed.
16522 batch link relay (B(n)) read
error
Indirectly specified 32-bit
16523 batch link relay (B(n)) read
error
Indirectly specified 16-bit
16524 batch annunciator (F(n))
read error
Indirectly specified 32-bit
16525 batch annunciator (F(n))
read error
Indirectly specified 16-bit
16526 batch timer contact (TT(n))
read error
Indirectly specified 32-bit
16527 batch timer contact (TT(n))
read error
Indirectly specified 16-bit
16528 batch timer coil (TC(n))
read error
Indirectly specified 32-bit
16529 batch timer coil (TC(n))
read error
Indirectly specified 16-bit
16530 batch counter contact
(CT(n)) read error
Indirectly specified 32-bit
16531 batch counter contact
(CT(n)) read error
Indirectly specified 16-bit
16532 batch counter coil (CT(n))
read error
Indirectly specified 32-bit
16533 batch counter coil (CC(n))
read error

15 − 7
15. ERROR LISTS

15.2 SFC Parameter Errors

Table 15.5 PLC Ready (M2000) OFF→ON Errors (17000 to 17009)

Error Error Factor


Error Processing Corrective Action
Code Name Definition
The normal task's consecutive The initial value of 3 is Turn PLC ready (M2000) OFF,
Normal task consecutive transition count of the SFC program used for control. make correction to set the value
17000
transition count error started by the normal task is within the range, and write it to the
outside the range 1 to 30. CPU.
The set number of consecutive The initial value of 1 is
Event task consecutive transitions of the SFC program used for control.
17001
transition count error started by the event task is outside
the range 1 to 10.
The set number of consecutive
NMI task consecutive transitions of the SFC program
17002
transition count error started by the NMI task is outside
the range 1 to 10.

Table 15.6 SFC Program Start Errors (Error Code 17010 to 17019)

Error Error Factor


Error Processing Corrective Action
Code Name Definition
Among the normal, event and NMI The initial value Turn PLC ready (M2000) OFF,
Executed task setting is
17010 tasks, more than one or none of (normal task) make correction, and write a correct
illegal
them has been set. is used for control. value to the CPU.
Executed task setting is Two or more fixed cycles of the
17011
illegal (event) event task have been set.

15 − 8
16. LIMIT SWITCH OUTPUT FUNCTION

16. LIMIT SWITCH OUTPUT FUNCTION


The limit switch output function is designed to output the ON/OFF signal
corresponding to the data range of the watch data set per output device.
You can set up to 32 points of output devices.

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.

Relationship between (ON Value) and


ON Output Region
(OFF Value)
(ON Value) < (OFF Value) (ON Value) (watch data value) < (OFF Value)
(ON Value) (watch data value)
(ON Value) > (OFF Value)
(Watch data value) < (OFF Value)
(ON Value) = (OFF Value) Output OFF in whole region

1) If (ON Value) < (OFF Value)

Output device OFF ON OFF

OFF Value
ON region setting
ON Value

Watch data value


(ON Value) ≤ (watch data value) < (OFF Value)

2) If (ON Value) > (OFF Value)

Output device ON OFF ON

ON Value
ON region setting
OFF Value

Watch data value


(Watch data value) < (OFF Value) (ON Value) ≤ (watch data value)

16 − 1
16. LIMIT SWITCH OUTPUT FUNCTION

3) If (ON Value) = (OFF Value)

Output device ON Value OFF in whole region

ON region setting ON Value OFF Value

Watch data value

(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.

Output device OFF ON OFF ON

OFF Value
ON region setting No. 2
ON Value

OFF Value
ON region setting No. 1
ON Value

Watch data 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

Without output enable/disable bit and forced output bit settings


Output device

OFF Value
ON region setting
ON Value

Watch data value

With output enable/disable bit and forced output bit settings


Output device

Output OFF Output control based on Output ON Output OFF


ON Value and OFF Value (Forced output)

Enable/disable bit

Output OFF Output control based on Output OFF


ON Value and OFF Value
Forced output bit

Output ON
(Forced output)

(5) The conventional limit output function cannot be used.


The following settings and devices are all invalid.

• "Limit output module" in system settings


• "Limit output used/unused" setting in fixed parameters
• "Limit switch output enable" of each axis command device
• Limit switch output disable setting registers
A172SHCPUN : D1008 to D1011
A173UHCPU (-S1) : D760 to D775
A273UHCPU-S3 : D760 to D775
• Limit switch output status registers
A172SHCPUN : D9180 to D9183
A173UHCPU (-S1) : D776 to D791
A273UHCPU-S3 : D776 to D791
• "Limit switch output used/unused" setting in mechanical system output
module parameters

16 − 3
16. LIMIT SWITCH OUTPUT FUNCTION

16.2 Limit Output Setting Data

Limit output data are listed below.


You can set up to 32 points of output devices.
(The following items No. 1 to No. 6 are set together as one point.)

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)

(1) Output device


(a) Set the bit device which outputs the ON/OFF signal in response to the
preset watch data.
(b) As the output device, you can use the following devices.

Device Number Setting Range


Item A173UHCPU (-S1)
A172SHCPUN
/A273UHCPU-S3
(Note-1)
Input relay X0 to X7FF X0 to X1FFF
(Note-2)
Output relay Y0 to Y7FF Y0 to Y1FFF
(Note-3)
Internal relay M0 to M2047 M0 to M8191
(Note-3)
Latch relay L0 to L2047 L0 to L8191
Link relay B0 to B3FF B0 to B1FFF

(Note-1): As PX is write-disabled, it cannot be used as the output device.


For X, only the free numbers within the input card non-loading range and
outside the link range may be used.
Note that when the A172SHCPUN is used, there will be a read response
delay as indicated below.

Read CPU Response Delay


Motion CPU 1 sequence scan
PLC CPU None

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".

Key switch RUN¨ STOP

Limit output setting data


rewritten on peripheral device

Key switch STOP¨ 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

(2) Watch data


(a) This data is used to perform the limit switch output function.
This data is comparison data to output the ON/OFF signal.
The output device is ON/OFF-controlled according to the ON region setting.
(b) As the watch data, motion control data or any word device data can be
used.
1) Motion control data

Axis Number Setting Range


Data
Item Unit A173UHCPU (-S1)
Type A172SHCPUN
/A273UHCPU-S3
Feed current value Position
32-bit
command
Real current value integer
unit
type
Deviation counter value PULSE
16-bit
Motor current 0.1%
integer
(Command output voltage: ACF) (0.01V) 1 to 8 1 to 32
type
Motor speed 0.1r/min
Cam shaft within-one-revolution
current value
Feed current value (temporary) 32-bit
After-differential current value integer
PULSE
(temporary) type
After-differential encoder current
value 1 1 to 12
Encoder current value

2) Word device data

Device Number Setting Range


Item A173UHCPU (-S1)
A172SHCPUN
/A273UHCPU-S3
Data register D0 to D1023 D0 to D8191
Link register W0 to W3FF W0 to W1FFF
Motion device #0 to #8191 #0 to #8191
Absolute
H0 to HFFFFFFFF H0 to HFFFFFFFF
address *1

*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.

Data Type Remarks


16-bit integer type Specify the absolute address as an even number.
Specify the device number as an even number.
32-bit integer type
Specify the absolute address as a multiple of 4.
Specify the device number as an even number.
64-bit floating-point type
Specify the absolute address as a multiple of 8.

16 − 6
16. LIMIT SWITCH OUTPUT FUNCTION

(3) ON region setting


(a) Set the data range where the output device is turned ON/OFF in response
to the watch data.
(b) The following devices can be used as the ON Value and OFF Value of the
data range.
The data type of the device/constant to be set is the same as the type of the
watch data.

Device Number Setting Range


Item A173UHCPU (-S1)
A172SHCPUN
/A273UHCPU-S3
Data register D0 to D1023 D0 to D8191
Link register W0 to W3FF W0 to W1FFF
Motion device #0 to #8191 #0 to #8191
Constant Hn/Kn Hn/Kn

(4) Output enable/disable bit


(a) Set the status of the output enable/disable bit when you want to disable the
limit switch outputs during operation.
1) The following control is exercised.

Output Enable/Disable Bit Status Control


Without setting (always enable) Limit switch outputs are turned ON/OFF on the
basis of the ON region setting (ON Value, OFF
ON (enable)
With setting Value).
OFF (disable) Limit switch outputs are turned OFF.

(b) Usable devices

Device Number Setting Range


Item A173UHCPU (-S1)
A172SHCPUN
/A273UHCPU-S3
Input relay X0 to X7FF X0 to X1FFF
Output relay Y0 to Y7FF Y0 to Y1FFF
Internal relay M0 to M2047 M0 to M8191
Latch relay L0 to L2047 L0 to L8191
Link relay B0 to B3FF B0 to B1FFF
Annunciator F0 to F255 F0 to F2047
Timer contact TT0 to TT255 TT0 to TT2047
Timer coil TC0 to TC255 TC0 to TC2047
Counter contact CT0 to CT255 CT0 to CT1023
Counter coil CC0 to CC255 CC0 to CC1023
Special relay M9000 to M9255 M9000 to M9255

16 − 7
16. LIMIT SWITCH OUTPUT FUNCTION

(5) Forced output bit


(a) Set the "forced output bit" when you want to forcibly provide the limit switch
outputs during operation.
This setting overrides OFF (disable) of the above "output enable/disable bit".
1) The following control is exercised.

Forced Output Bit Control


Without setting Limit switch outputs are turned ON/OFF on the
basis of the "output enable/disable bit" and ON
ON (enable)
With setting region setting (ON Value, OFF Value).
OFF (disable) Limit switch outputs are turned ON.

(b) Usable devices

Device Number Setting Range


Item A173UHCPU (-S1)
A172SHCPUN
/A273UHCPU-S3
Input relay X0 to X7FF X0 to X1FFF
Output relay Y0 to Y7FF Y0 to Y1FFF
Internal relay M0 to M2047 M0 to M8191
Latch relay L0 to L2047 L0 to L8191
Link relay B0 to B3FF B0 to B1FFF
Annunciator F0 to F255 F0 to F2047
Timer contact TT0 to TT255 TT0 to TT2047
Timer coil TC0 to TC255 TC0 to TC2047
Counter contact CT0 to CT255 CT0 to CT1023
Counter coil CC0 to CC255 CC0 to CC1023
Special relay M9000 to M9255 M9000 to M9255

16 − 8
APPENDICES

APPENDICES

APPENDIX 1 PROCESSING TIMES

Appendix 1.1 Operation Control/Transition Instruction Processing Times

(1) Operation instructions


A172SHCPUN/
A273UHCPU-S3
Classification Symbol Instruction Operation Expression A173UHCPU(-S1)
Unit (µs)
Unit (µs)
#0=#1 16.9 20.9
D0=D1 24.6 27.9
#0L=#2L 24.3 30.1
= Substitution
D0L=D2L 38.9 51.6
#0F=#4F 26.0 32.0
D0F=D4F 42.9 55.7
#0=#1+#2 21.3 25.4
D0=D1+D2 30.1 33.0
#0L=#2L+#4L 30.5 37.1
+ Addition
D0L=D2L+D4L 45.8 60.9
#0F=#4F+#8F 37.3 41.7
D0F=D4F+D8F 55.8 68.3
#0=#1−#2 21.2 25.4
D0=D1−D2 30.1 33.0
#0L=#2L−#4L 30.6 36.5
− Subtraction
D0L=D2L−D4L 45.3 59.5
#0F=#4F−#8F 37.6 41.7
Binary operation
D0F=D4F−D8F 55.6 67.6
#0=#1 #2 21.1 25.4
D0=D1 D2 30.2 33.0
#0L=#2L #4L 30.9 36.5
Multiplication
D0L=D2L D4L 46.8 59.5
#0F=#4F #8F 38.0 41.7
D0F=D4F D8F 56.7 67.6
#0=#1/#2 25.4 32.7
D0=D1/D2 34.1 41.7
#0L=#2L/#4L 34.8 44.9
/ Division
D0L=D2L/D4L 51.1 69.0
#0F=#4F/#8F 43.7 44.3
D0F=D4F/D8F 61.1 70.1
#0=#1%#2 24.0 32.5
D0=D1%D2 32.9 40.1
% Remainder
#0L=#2L%#4L 34.2 43.6
D0L=D2L%D4L 51.0 66.7
#0=~#1 18.8 22.6
~ D0=~D1 26.7 31.1
Bit inversion (complement)
#0L=~#2L 26.4 32.4
D0L=~D2L 41.8 54.9
#0=#1&#2 20.8 25.2
D0=D1&D2 28.5 32.7
Bit operation & Bit logical AND
#0L=#2L&#4L 30.6 36.2
D0L=D2L&D4L 46.1 59.2
#0=#1|#2 20.8 25.2
D0=D1|D2 29.1 32.7
| Bit logical OR
#0L=#2L|#4L 30.0 36.2
D0L=D2L|D4L 45.5 59.2

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

(2) Transition conditional expressions


A172SHCPUN/
A273UHCPU-S3
A173UHCPU(-S1)
Single Operation
Single Operation
Classification Symbol Instruction Operation Expression Expression
Expression
Processing Time
Processing Time
(µs)
(µs)
M0 24.7 20.7
ON (normally open contact)
(None) X100 22.3 17.7
(when condition enables)
PX0 25.9 17.5
Bit device status
OFF (normally closed !M0 26.4 22.4
! contact) (when condition !X100 24.1 19.3
enables) !PX0 27.6 19.5
M0 M1 31.8 26.7
Logical AND X100 X101 29.9 23.8
PX0 PX1 36.2 23.4
Logical operation
M0+M1 31.8 27.1
+ Logical OR X100+X101 30.0 24.0
PX0+PX1 36.2 24.0
#0==#1 9.5 8.8
D800==D801 19.2 16.6
Equal to #0L==#2L 25.0 19.1
==
(when condition enables) D800L==D802L 38.4 29.3
#0F==#4F 29.7 22.2
D800F==D804F 44.3 33.4
#0!=#1 9.5 8.8
D800!=D801 19.2 16.2
Not equal to #0L!=#2L 25.0 19.3
!=
(when condition enables) D800L!=D802L 38.4 29.6
#0F!=#4F 29.9 22.0
D800F!=D804F 44.5 33.2
#0<#1 9.5 8.8
D800<D801 19.2 16.4
Less than #0L<#2L 25.0 19.1
<
(when condition enables) D800L<D802L 38.4 29.3
#0F<#4F 29.9 22.0
Comparison D800F<D804F 44.5 33.1
operation #0<=#1 9.5 8.8
D800<=D801 19.2 16.5
Less than or equal to #0L<=#2L 25.0 19.3
<=
(when condition enables) D800L<=D802L 38.4 29.3
#0F<=#4F 29.9 22.2
D800F<=D804F 44.5 33.3
#0>#1 9.5 8.8
D800>D801 19.2 16.1
More than #0L>#2L 25.0 19.1
>
(when condition enables) D800L>D802L 38.6 29.1
#0F>#4F 29.9 22.1
D800F>D804F 44.5 33.3
#0>=#1 9.5 8.8
D800>=D801 19.2 16.1
More than or equal to #0L>=#2L 25.0 19.3
>=
(when condition enables) D800L>=D802L 38.4 29.2
#0F>=#4F 29.9 22.2
D800F>=D804F 44.5 33.0

APP − 6
APPENDICES

(3) Processing time taken when F and G are combined (program described in F/G is NOP)

F Alone G Alone F+G GSUB CLR JMP/Coupling

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

Parallel Branch (2 Pcs.) Parallel Branch (5 Pcs.)

F F F F F F F

G G G G G G G

At branch At coupling At branch At coupling


A172SHCPUN
µs 111 75 232 140
A173UHCPU(-S1)
A273UHCPU-S3 µs 118 80 252 152

Selective Branch (2 Pcs.) Selective Branch (5 Pcs.)

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

(Note) Varies greatly with the started/cleared program.

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

Appendix 1.2 Motion Operation Cycles (msec)

CPU A172SHCPUN A173UHCPU(-S1) A273UHCPU-S3


OS type SV13 SV22 SV13 SV22 SV13 SV22
Set axis 18 to 30 to 11 to 19 to 11 to 22 to 14 to
count 1 to 8 1 to 6 7 to 8 1 to 17 1 to 10 1 to 10 1 to 6 7 to 13
29 32 18 32 21 32 32
Operation
cycle 3.5ms 3.5ms 7.1ms 3.5ms 7.1ms 14.2ms 3.5ms 7.1ms 14.2ms 3.5ms 7.1ms 14.2ms 3.5ms 7.1ms 14.2ms

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.

You might also like