XGT XGK Manual
XGT XGK Manual
XGT XGK Manual
XGT Series
User’s Manual
http://eng.lsis.biz
Safety Instruction
For your safety and effective operation, please read the safety instructions
thoroughly before using the product.
Moreover, even classified events under its caution category may develop into
serious accidents depending on situations. Therefore we strongly advise users
to observe all precautions in a proper way just like warnings.
► The marks displayed on the product and in the user’s manual have the
following meanings.
After reading this user’s manual, it should be stored in a place that is visible
to product users.
Revision History
version Date Remark Revised position
※ The number of User’s manual is indicated right part of the back cover.
ⓒ 2006 LS Industrial Systems Co., Ltd All Rights Reserved.
About User’s Manual
The Use’s Manual describes the product. If necessary, you may refer to the following description and order
accordingly. In addition, you may connect our website(http://eng.lsis.biz/) and download the information as a
PDF file.
Title Description
XGK/XGB Series
It is the user’s manual for programming to explain how to use
Instructions & Programming
commands that are used PLC system with XGK CPU and XGB.
User’s Manual
◎ Contents ◎
Chapter 2 Function.......................................................................................................................2-1~2-56
Chapter 5 SFC...............................................................................................................................5-1~5-10
Chapter 6 ST .................................................................................................................................6-1~6-22
1.1 Summary
This manual describes performance, function and available instructions of CPU module designed to use PLC
XGT series.
1.2 Characteristics
1) Easy programming tool supported (XG5000).
2) Program modification available during run mode.
3) Open network intended by international standard of communication protocol adopted.
4) Modification available simultaneously with monitoring during run mode.
5) Various special modules completely provided to enlarge the PLC application range.
6) Various instructions of about 758 kinds supported including floating point operation and string type operation.
Notes
1) I/O area and data register (D) area are different from each other, based on CPU module.
Refer to Device Area (2.3) to change programs
2) The existing program should be made back-up prior to change to a compatible program.
3) Parameters can not be converted.
1-1
Chapter 2 Function
Chapter 2 Function
Specification
Item Remarks
XGK-CPUE XGK-CPUS XGK-CPUA XGK-CPUH XGK-CPUU
Number of Basic 40 -
Instructions Application 717 (232 types) -
LD 0.084 ㎲/Step 0.028 ㎲/Step -
Processing
MOV 0.252 ㎲/Step 0.084 ㎲/Step -
Speed
(Basic ±: 1.442 ㎲(S), 2.87 ㎲(D) ±: 0.602 ㎲(S), 1.078 ㎲(D) S: Single Real
Instruction) Real number
x: 1.948 ㎲(S), 4.186 ㎲(D) x: 1.106 ㎲(S), 2.394 ㎲(D) D: Double Real
operation
÷: 1.974 ㎲(S), 4.2 ㎲(D) ÷: 1.134 ㎲(S), 2.66 ㎲(D) number
Program Memory Capacity 16 ksteps 32 ksteps 32 ksteps 64 ksteps 128 ksteps -
I/O Point
1,536 3,072 3,072 6,144 -
(Installation Available)
P P00000 ~ P2047F (32,768) -
M M00000 ~ M2047F (32,768) -
K K00000 ~ K2047F (32,768) -
L L00000 ~ L11263F (180,224) -
F F00000 ~ F2047F (32,768) -
Area
100ms: T0000 – T0999
changeable
10ms : T1000 – T1499
T according to
1ms : T1500 – T1999
parameter
0.1ms: T2000 – T2047
setting
Data
Area C C0000 ~ C2047 -
S S00.00 ~ S127.99 -
N N00000 ~ N21503 -
1 block:
R 1 block 2 blocks 32 Kword
(R0 ~ R32767)
R device can be
Flash Area 2Mbyte, 32 blocks
controlled
2-1
Chapter 2 Function
Specification
Item Remarks
XGK-CPUE XGK-CPUS XGK-CPUA XGK-CPUH XGK-CPUU
Total
256 -
programs
Initialization
1 -
Program task
Configuration Time-driven
32 -
task
Internal point
32 -
task
Operation mode Run, Stop, Debug -
Detection of operation delay, memory error, I/O error, battery error, power
Self-diagnostic function -
error, etc
Modbus slave
Program port RS-232C (1CH), USB (1CH) Supported by RS-
232C port
Data retention
Latch area setting in basic parameter -
at power failure
Maximum expansion stage 2 4 4 8 15m in total length
Internal current
940mA 960mA -
consumption
Weight 0.12kg -
2-2
Chapter 2 Function
In case of XGB series, performance specifications of standard CPU module (XBM-DR16S, XBM-DN16S,
XBM-DN32S) are as follows;
Specification
Item Remarks
XBM-DR16S XBM-DN16S XBM-DN32S
Cyclic operation, Time-driven operation,
Operation Method -
Interrupt operation, Fixed period operation
Scan synchronized batch processing method (refresh method)
I/O Control Method -
Direct method by instruction
Ladder Diagram
Program Language -
Instructions List
Number of Basic 28 -
Instructions Application 677 -
Processing Speed
0.16 ㎲/Step -
(Basic Instruction)
Program Memory Capacity 10ksteps -
S S00.00 ~ S127.99 -
2-3
Chapter 2 Function
Specification
Item Remarks
XBM-DxxxS
• Internal/external preset
Additional • Latch counter
-
function • Comparison output
• The number of rotation per unit time
JOG
Setting speed range: 1 ~ 100,000pps (High-speed/Low-speed)
operation
External device
Pulse width: 50 ㎲ 8 points (P0000 ~ P0007) -
interrupt
2-4
Chapter 2 Function
Bit data displays On/Off with 1 bit like contact or coil, or is processed by 1 bit unit inside the memory
without I/O. In order to set the bit of bit device or word device, the bit data can be used.
1) Bit device
It can be saved or read in bit unit (P, M, L, K, F, T, C and S are available. Refer to 2.3 Device Area for
details). In order to access bit data, bit unit should be specified. And the lowest place should be
marked in hexadecimal, which will make word data easily displayed in bit through the bit device.
P0000 0
Expression Expression of Bit
of Word (Hexadecimal)
P00000 M00000
M00000’s 1 bit
Here, Word device number is displayed in decimal and bit number in hexadecimal. For example, in
order to express D0010’s bit number 1, let it set D0010.1. D0011’s b10 bit is to be specified as
D0011.A.
2-5
Chapter 2 Function
th
D00010’s 10 bit
D00010.A M00000
b15 b0
D00010 F E D C B A 9 8 7 6 5 4 3 2 1 0
Remark
1) Bit device can be also processed in word unit like word device. However, such expression as P0010.1 is
unavailable differently from word device.
2-6
Chapter 2 Function
Nibble and byte as newly added types of data to XGT are used in instructions with 4 or 8 attached at
the back of the name of each instruction.
Nibble and byte can be used with start bit input. And from input contact to 4/8 bits will be the data to
process.
1) Expression range
Nibble: 0~15 (4 bits)
Byte: 0~255 (8 bits)
2) How to use
(1) Bit device (P,M,K,F,L) : takes 4 or 8 bits from bit device’s contact used as operand. When 4
or 8 bits is taken, the bit which exceeds the applicable bit device’s area only will be processed as 0.
If the operand is the destination specified, the data of the exceeded area will be lost.
b15 b4 b0
P0000
(WORD)
b15 b4 b0
The operand with 4 or 8 P0001
attached at the back of (WORD)
instruction will be Nibble
and Byte data. P00010's Nibble data
(2) Word device: takes 4 or 8 bits from word device’s bit contact used as operand. When
specified bit contact is used as the source and 4 or 8 bits is taken from specified contact,
the bit which exceeds the applicable word unit will be processed as 0. As similarly as above, if
specified bit contact is used as the destination, the data exceeding the word will disappear.
b15 b4 b0
D00010
(WORD)
If the bit’s position is C with Byte data to
D00010.C’
take the upper 4 bits will be processed
Byte data
as 0 since exceeding the word range.
MOV 8 D00010.C D00100.4
0 0 0 0
b15 b0
The operand with 4 or 8 D00100
b4
(WORD)
attached at the back of
instruction will be Nibble
and Byte data.
Remark
1) Since T and C are used as bit or word data based on the instruction applied, which may cause confusion, T
and C devices can not be used in nibble & byte instructions.
2-7
Chapter 2 Function
Word data is 16-bit numeric data. It can be expressed in decimal and hexadecimal. If data is to be
expressed in hexadecimal, H should be added in front of the number.
1) Word device
Word device is specified in 1 point (word) unit.
P00010
MOV D10 D20
2) Bit device
The bit device is expressed with its lowest digit (Digits expressed in hexadecimal – position to display
bit) taken out and will be designated as word data.
P00010
MOV H1234 P0000
b15 b0
F E D C B A 9 8 7 6 5 4 3 2 1 0
P0000 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0
1 2 3 4
Remark
1) XGK instructions are based on signed operation. U will be added to instructions based on unsigned
operation.
Example) ADD : Signed operation
ADDU: Unsigned operation
2-8
Chapter 2 Function
Double word data is 32-bit numeric data. It can be expressed in decimal and hexadecimal. If data is to
be expressed in hexadecimal, H should be added in front of the number.
· Decimal : -2,147,483,648 ~ 2,147,483,647 (Signed operation) or
0 ~ 4,294,967,295 (Unsigned operation)
· Hexadecimal : H0 ~ HFFFFFFFF
Double word data can be expressed through word device or bit device.
1) Word device
It specifies device number applicable to lower 16-bit data among 32-bit data.
Data of (Specified device number) and (Specified device number + 1) is used as double word data.
P00010
DMOV 1234 D21
2) Bit device
Like the expression of word data, the bit device is expressed with its lowest digit taken out, using the
data of (Specified device number) and (Specified device number + 1) as double word data.
P00010
DMOV 1234 P0001
2-9
Chapter 2 Function
Real data is 32bit/64bit floating decimal point data, where 32bit floating decimal point data is called Single
Real, and 64-bit floating decimal point data is called Double Real.
Expression is available only in decimal format (decimal point displayed). And both word device and bit
device are available.
※ Floating decimal point operation error : Exception (operation error) supported in IEEE754 standard
2-10
Chapter 2 Function
Remark
1) Expression of real data meets IEEE754 format. However, its direct input with the format is impossible.
2) In case of XGB, even though it is satisfied to operation error condition, flag applied isn’t set.
2-11
Chapter 2 Function
Among application instructions, string related instructions use the data type of number, alphabet,
special sign, etc. to save in ASCII code. In addition, Korean and Chinese letters which need 16-bit
code also can be used.
String data up to NULL code (h00) is regarded as one string row. And the maximum length of a string
row is 32 bytes (including NULL). In other words, up to 31 letters are available in English only, and up
to 15 letters are available in Korean only. And mixing them is also available.
If directly input string’s size exceeds the maximum limit, a warning message will be displayed in the
programming tool of XG5000 to keep such string from input. Data of maximum string input is of 31
bytes + NULL (1 byte).
Example)
2-12
Chapter 2 Function
1) Bit device
(1) Available to express the bit without a ‘.’ (dot) when used in basic instructions as LOAD or OUT.
(2) P, M, K, F, T (bit contact), C (bit contact), L, S
(3) When index function used: If index function is used in bit device, it indicates the bit with the bit
position to which index register’s value is added. However, if bit device is used in application
instruction and the instruction’s operand is of word data, its operation will be in word.
Example) LOAD P00001[Z1] Æ If Z1=8, LOAD P(1+8) = LOAD P00009
MOV P00001[Z1] D10 Æ If Z1=8, MOV P00009 D00010
2) Word device
(1) Basic expression of device is in word unit.
(2) A ‘.’ (dot) is used to specify the device number’s desired bit position .
Example) D10’s BIT4 will be expressed as D10.4.
(3) Applicable device: D, R, U, T (present value area), C (present value area), Z
(4) When index function used: Indexing will be in word unit. And if index is used in operand which
expresses word device in bit, its indexing will be in word unit too. For example, if Z10 is to be used
in operand, its expression will be as D10[Z10].4 with the meaning identical to D(10+Z10’s value).4.
2-13
Chapter 2 Function
S00.00 ~ S00.00 ~
S 128 Word 128 Word Unavailable Unavailable
S127.99 S127.99
L000000 ~ L00000 ~ L00000 ~ L0000 ~
L 180,224 points 20,480 points
L11263F L1279F L11263 L1279
N00000 ~
N 21K Word 3,936 Word Unavailable Unavailable Unavailable
N21503
D00000.0 ~ D0000.0 ~ D00000 ~ D0000 ~
D 32K Word 5,120 Word
D32767.F D5119.F D32767 D5119
R00000.0 ~ R00000 ~
R 32K Word n ∗3) - - -
R32767.F R32767
ZR00000 ~
ZR *4) (32K n) Word - Unavailable - -
ZR65535
Warning
In case of XGK
1) For N area, other than the area used for P2P in communication module is only available.
2) If P2P is used, assigning to N area is available up to 1~8 for P2P number, P2P No.1 consist of 00~63
blocks and for 1 block 41-word N area from N00000 to N00040 is automatically assigned for P2P
service.
3) This may cause operation error when programmed as duplicated with service area. So program with other
area than assigned for P2P service.
In case of XGB
1) In case of XGB, N area can be monitored only.
2) XGB standard type doesn’t support R, ZR area.
∗1)
The word data in timer represents the bit contact’s present value.
∗2)
The word data in counter represents applicable bit contact’s current value.
∗3)
‘n’ expression is a block number, If XGK-CPUH, XGK-CPUA, ‘n=2’ and XGK-CPUS, XGK-CPUE, ‘n=1’. 32K words are 1
block size, available bit contact to display is R00000.0 ~ R32767.F. In addition, word data can be also expressed only up
to R00000 ~ R32767. Refer to 2.3.13 for more details.
*4)
‘n’ expression is a block number, ZR expression range is different according to the size of the ‘n’. Refer to 2.3.13 for
details.
2-14
Chapter 2 Function
2.3.3 I/O P
I/O P, as the area equivalent to external equipment is composed of push button used as input device,
input section to receive signals of switch or limit switch, solenoid used as output device, and output
section to deliver operation result to motor and lamp.
As for input section P, since input status is kept in PLC’s internal memory, contact A and B are available
to use. And as for output section P, contact A and B are also available. Other sections than used for I/O
in P area can be used just like the auxiliary relay M. According to instructions applied, it can be used in
word unit.
2-15
Chapter 2 Function
As shown in Fig. 2.2, P area has sections correspondent 1:1 to each contact of I/O module, which
performs operation with CPU’s internal memory (P area) status regardless of I/O module’s contact
status while PLC is scanning (operating), wholly outputs the content of the internal memory P area
correspondent to output contact after the operation, and then saves the input module’s contact status
in the internal memory P area for the next operation.
Be careful input and output’s contact are assigned all to P area regardless of the status, which may
cause error due to confusion between input P area and output P area when programming.
Remark
1) Refer to the content of View Flag in Variable/comment in XG5000 Software for details on P2P and High-
speed link flag used for L area, or the manual of applicable communication module.
2-16
Chapter 2 Function
2.3.7 Timer T
4 types of basic cycle available are 0.1ms(XGB not available), 1ms, 10ms and 100ms, whose
operation method is different respectively based on 5 kinds of instructions (TON, TOFF, TMR, TMON,
TRTG).
Maximum setting value is available up to hFFFF (65535) in decimal or in hexadecimal. Timer types
and Operation methods are as shown below in (Figure2.3).
Timer Instruction
Integration On
TMR Addition
Delay t1 t2
Output t = Setting Value
(t1+t2)
Input Retriggerable
t
TRTG Retriggerable Subtraction
Output t = Setting Value
2-17
Chapter 2 Function
2.3.8 Counter C
The count starts at Rising Edge (Off → On) of input condition and stops if reset input then to eliminate
the present value to 0 or to replace it with setting value.
Operation methods are different from each other based on 4 kinds of instructions (CTU, CTD, CTUD,
CTR), with maximum setting value available up to hFFFF. Counter types and Operation Methods are as
shown below in Fig. 2.4.
Type of
Detail Operation Time Chart
Counters
Reset
Count
Pulse Setting Value
Up
CTU Addition
Counter Present
Value
Output
Reset
Count
Pulse Setting Value
Down
CTD Subtraction Present
Counter Value
Output
Reset
Addition
Pulse
Subtraction
Pulse
Up/Down Addition/ Setting Value
CTUD
Counter Subtraction Present
Value
Output
Reset
Count
Pulse
Setting Value
Ring
CTR Addition Present
Counter Value
Output
b15 b0
D00020 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1
F E D C B A 9 8 7 6 5 4 3 2 1 0
D00020.A
MOV h00F3 P00004
2-19
Chapter 2 Function
As a relay used to control step, it is divided into Last-input preferred and sequence control, based on
instructions (OUT, SET) applied.
When power is On or RUN starting, other areas than specified by parameter will be all eliminated to
the first step of 0.
Refer to the section of chapter 4 OUT Sxx.xx, SET Sxx.xx for more details
2-20
Chapter 2 Function
This relay provide for information of System. It can be Read up to F0000~F1023 (F199 in case of XGB).
It is provide for overall information of PLC current status, O/S information, RTC data and System clock
etc.
Next area of F1024 (F200 in case of XGB) word is possible limited Write use of private instruction.
This area can be use inspection of external device Warning and Error. Refer to CPU user’s manual
Chapter 6.7.(in case of XGB, Chapter 6.6)
This register is used to read data from special module installed on slot.
Data of special module installed by back-plain controller will be automatically updated in refresh area.
32 words per slot are assigned to U area.
Thus, U area is made up of 4,096 words in total (8 bases * 16 slots * 32 words = 4,096 words). In
XGB case, 256 words in total (1 base * 8 slots * 32 words = 256 words).
U area value used per slot is fixed regardless of slot which module is installed on or which is empty.
b15 b0 b15 b0
U00.00 Slot no. 0 U00.00 Slot no. 0
U00.31 U00.31
U01.00 Slot no. 1 U01.00 Slot no. 1
U01.31 U01.31
U7F.00 U07.00
Slot no. 127 Slot no. 7
U7F.31 U07.31
XGK XGB
Basic expression of U area is in Uxy.z, where x is for base number 0~ 7, y is for slot number 0 ~ F,
and z is for internal memory’s word number of special module.
U area is also expressed in bit with U3A.12.x (x: Bit position, in hexadecimal).
If no special module is installed on the actually specified slot, or effective data area specified is
exceeded, the specified area’s value will be 0 with no error found.
For example, if the refresh area of the special module installed on slot No.1 of base No. 1 are
effective only up to 4 words (No.0 ~ No.3), the word No.4 (U31.04) will be read as 0. Thus, h00F3 will
be saved in D00004.
P00052
ADD h00F3 U31.04 D00004
Use PUT(P) or GET(P) instruction to read or write value in other area than refresh area of the special
module installed.
Refer to Information about area of each module with special module user’s manual.
If the data is written in U area of D/A conversion module installed, It is refreshed at Scan End and it is
outputted.
Data can be written in specified position only with D/A conversion module.
If an instruction is used to save data in position on which other module than D/A conversion module is
installed, it is processed by NOP instruction. In this case, no error may occur.
2-21
Chapter 2 Function
2.3.13 File register R(in case of XGB standard type, not available)
File register is exclusively used for internal flash memory. Flash memory can not save the data when
processing scan program, since it takes a little time to save the data. So scan program using the flash
memory data move to the file register. If need to save the data, save to the flash memory again.
1) Characteristics
(1) As an exclusively used register for internal flash memory, it is used to read or write a block of internal
flash to the file register.
(2) The size of one block*1) is 32K word, identical to that of the block of internal flash memory.
(3) Write the data of file register in flash memory with EBWRITE instruction to keep the data permanently.
(4) File register operates same as latch area 1. Namely, Data is eliminated by Overall reset with reset
switch, reset with D.CLR and reset with XG5000.
(5) It will need several scans to read or write the block of file register to the block of flash memory.
Completion state can be checked via the bit of applicable block of F160 (_RBLOCK_RD_FLAG) and
F162 (_RBLOCK_WR_FLAG).
(6) Both index function and indirect setting are available. At this time, indirect setting range for ZR is up to
ZR0~ZR32767 words, and Index function ([Z]) range available is -32768~32767 among device
number of ZR. As for R, both indirect setting and index function are all available in the specified block
range. If applicable block range is exceeded, index-exceeded error occurred.
2) Size
*1)
Only one block (block 0) of the file register is provided for XGK-CPUS, XGK-CPUE and XGB Compact type(XBC-DxxH).
And 2 blocks are provided for XGK-CPUU, XGK-CPUH and XGK-CPUA. In XGK PLC the internal flash memory have 32
blocks in total and in XGB compact type have 2blocks.
※ In case of XGB standard type, file register (R) is not available.
2-22
Chapter 2 Function
3) How to express
(1) R - File register block unit expression (32K word fixed per block)
(2) ZR – Whole file register expression (range depends on unit type )
(3) Flash area has no device name, accessible by exclusive instruction.
Word
Device Bit expression
Write Read # [Z] Data preserved
Name expression (including
DW)
R O O O O O O Level of latch 1 area
ZR X O O O O O Level of latch 1 area
Internal Exclusive Exclusive
X X X X Permanently
Flash instruction instruction
4) Error flag
Number Size Designation Description Remarks
F158 Word Flag of block No. Displays presently used block No.
Representative flag of flash
F1590 BIT ON if any flash block Read flag is ON
block Read
Representative flag of flash
F1591 BIT ON if any flash block Write flag is ON
block Write
Representative flag of flash
F1592 BIT ON if any flash block Write error flag is ON
block Write error
F1600
BIT Flag of flash block n Read ON if data is read in block n 32
~ F161F
F1620
BIT Flag of flash block n Write ON if data is written in block n 32
~ F163F
ON if Write data in block n fails.
F1640 Flag of flash block n Write
BIT If error occurs, both applicable Write flag and Write 32
~ F165F error
representative flag keep ON state.
Note
(1) R, ZR device is not supported at XGB standard type. So reading/writing flash is not supported and
error flag is not supported.
2-23
Chapter 2 Function
Communication register is exclusively used for P2P register which is available for P2P service setting
when communication module of Cnet, FEnet, FDEnet and the others are installed on slot. P2P setting is
available with Network Manager (XG-PD) and private instructions. Communication register N used for
P2P setting with instructions.
Private instructions for P2P setting refer to ‘chapter 4. Details of instructions’. (XGB is not supported.)
It can be set 64 blocks (0~63) per P2P service (P2P 1~ P2P 8). And one block can assign 1 word station
number, 4 read areas and 4 save areas (1~4). Also, there are device name save area of 4 words and
variable number save area each read and save area.
Remark
(1) It can remove only [Online]-[Clear PLC] menu on XG5000 since XGK N area is always latched.
(2) N20992~N21503 area not used in P2P service can be used for Data register(D). But, it is basically
latched area different from D.
(3) XGB’s N area is only available to be monitored.
2-24
Chapter 2 Function
XGK/XGB instructions are widely classified into basic instructions, application instructions and special
instructions.
1) Basic instructions
Basic instructions are composed of contact /coil related instruction such as LOAD/OUT,
timer/counter, master control and step control instruction.
2) Application instructions
Application instructions are almost the others than basic instructions. According to functions of
instructions, they can be classified as described in 3.4. In this chapter, they will be classified based on
operand types so to understand XGK/XGB instructions without difficulty.
Operand types are bit, nibble/byte, word/double word, real, string, etc.
2-25
Chapter 2 Function
2-26
Chapter 2 Function
1) Data Type
① None : Word
② D : Double word
③ R : Single Real number
④ L : Double Real number
⑤ $ : String
⑥ 4 : Nibble
⑦ 8 : Byte
⑧ B : Bit
2) Other Expressions
① G : Group
② P : Pulse type instruction
③ B : Data in BCD format
④ U : Unsigned data
Even if with some exceptions, the instructions derivable from one instruction will confirm to the
regulations specified below;
Only one letter can be positioned in front of the basic instruction, and 2 or more letters at the back.
Example) DADDBP
ADD
D 4
R 8
L B
$ P
G U
B
<Exceptions >
In Input Terminal Compare Instruction, the data type is positioned at the back of instruction.
All the instructions with prefix or suffix in front or at the back are not always derived instructions.
2-27
Chapter 2 Function
1) Operation instruction
① Signed operation instructions: ADD, SUB, MUL, DIV, DADD, DSUB, DMUL, DDIV, INC, DEC, DINC,
DDEC.
② Unsigned operation instructions: ADDU, SUBU, MULU, DIVU, DADDU, DSUBU, DMULU, DDIVU, INCU,
DECU, DINCU, DDECU.
③ Difference: Signed operation dose not set CY, Z flag according to operation result. Namely,
if the program is prepared to add 1 to h7FFF with ADD instruction, its result will be
h8000 (-32768) with no flag set. On the other hand, unsigned operation instruction sets CY,
Z flag according to operation result.
2) Compare instructions
① Signed instructions : LOAD X, AND X, OR X, LOADR X, ANDR X, ORR X, LOAD$ X, AND$ X,
OR$ X, LOAD3 X, AND3 X, OR3 X, etc.
② Unsigned instructions: CMP, DCMP, CMP4, CMP8, TCMP, GCMP, etc.
③ Since Compare instructions have no flag (CY, Z) generated, the difference only is between
Signed and Unsigned compared.
Example)
2-28
Chapter 2 Function
Remark
1) Each device’s indirect setting range available is as follows;
P area, M area, L area, K area : respectively 0 ~ 2047
D area : 0 ~ 32767
R area : 0 ~ 32767
ZR area : 0 ~ 65535 (Limited by CPU type)
2) If the device value indirectly specified exceeds applicable device area, Operation Error Flag (F110) will be
Set. If the Error operation setting is set by ‘Continue running when an arithmetic error occurs’, Operation Error
Flag will be Set and the instruction will be skip. If it is not, Operation Error Flag becomes Set and CPU module
error is occurred and operation is stop concurrently.
1) Characteristics
① With device setting through index register, use index function in sequence program to let the used
device positioned with directly specified device number plus index register value. For example, if Z1 is
5 with P10 [Z1] used, P (10+5)=P15 will be the object to use.
② Index register Z0 ~ Z127 (128)
③ Setting range of the value available : -32768~32767
④ Index function of word/bit device
⑤ Available in indirect setting: #D00100[Z12]
⑥ If index result area is exceeded, operation error flag will be set (F110). If the Error operation setting is
‘Continue running when an arithmetic error occurs’, operation error flag will be set and instruction will be skip.
2) Devices available
① Bit device : P, M, L, K, F, T, C
② Word device : Present value of U, D, R, N, T, present value of C
Example) MOV T1 [Z1] D10 : If Z1’s value is 5, T(1+5) Æ T6’s present value is transferred to D10.
③ How to use index for U device : Index is unavailable for slot number like U10.3 [Z10], but only
available for channel. However, based on index value, different slot’s channel can be specified.
3) How to use
① Attach [] at the back of the operand to use.
② Example of bit device : Based on types of operands (bit/word) used for applicable instruction, its
indexing will be in bit/word unit.
Example.1) LOAD P10 [Z1]: If Z1’s value is 5, LOAD P (10+5) Æ LOAD P15 (bit).
Example.2) MOV P10 [Z1] D10: Where, since P10 means word, P10 [Z1] will be as P (10+5) =
P15word.
③ Example of word device: Indexing will be only in word unit. Absolute bit unit indexing is unavailable.
Example) LOAD D10[Z1].5 : If Z1’s value is 5, LOAD P(10+5).5 Æ LOAD P15.5 (bit).
Caution) Expression such as LOAD D10.5 [Z1] can not be used.
④ The index function can be helpfully used in variable with the meaning of arrangement, to take the
variable value designated as index or to save the value in the specified variable.
⑤ Indirectly specified index formula is also available.
Description: Process #D00010 first. In other words, if D00010’s value is 100, it means #D00010 Æ
D00100. Then process D00100 [Z010].
Application: It can be applied as the arrangement notion of structure as shown below. Namely, it can
be set the start position D00100, D00200, D00300 etc. use of indirect designation. Then using the
function of Index, find the specified position.
2-29
Chapter 2 Function
#D00010[Z10]
Program Example)
P00020
D00100 #D00010
MOV [Z010] [Z003]
D00103 D00200[Z003]
D00205
Z10 3 Z003 5
D00010 200
D00100 h0042
D00200
D00103 h1234
D00205 h1234
2-30
Chapter 2 Function
String data is not inspected. If data value is unavailable to express when applicable device value is monitored
in XG5000, its expression may be abnormal.
And the real data if exceeding the expression range available will cause operation error (F110).
2-31
Chapter 2 Function
This function used for operating the PLC program by Fixed period operation mode. It is available to set
1ms~999ms in Fixed operation time mode. The time should be less than the value of Watchdog timer
and longer than Scan time. If value of Fixed operation time is set more than value of the Watchdog timer,
PLC do not operate normally since Watchdog timer error will be occur.
The way of checking status of Fixed period operation is menu [Online]-[PLC Information] on XG5000.
The status ‘(Fixed Period: 10ms)’ will be expressed on the PLC information window.
In case of current Scan time means execution of real program time that is not execution cycle time. The
reason is to show the spare time of Scan time when program Add/Delete, As providing real Scan time of
current program.
Maximum Scan time indicates Fixed Period time. If time exceed the Fixed Period time, Scan time will be
shown real exceeded Scan time.
2-32
Chapter 2 Function
Remark
(1) If Scan time is longer than ‘Fixed time operation’ setting time, ‘_CONSTANT_ER [F0005C]’ flag is
‘ON’. And CHK LED is blinking. Also, Scan time is recorded in maximum Scan time.
Each slot can designates sharing points of I/O in 16, 32 or 64 unit to specify special/communication module
if applicable. Empty slot shares 64 points at Fixed type and 16 points at Variable type.
Assignment of I/O number is divided into Fixed type and Variable type (XGB is not supported) available based
on basic parameter setting.
X Slot no. 0 1 2 3 4 5 6 7 8 9 10 11
G P C In- In- In- In- Out- Out- Out- Out- In- Out- Out- Out-
W P put put put put put put put put put put put put
K 32 64 16
R U 16 16 32 32 64 32 16 32 32
P0 P40 P80 P120 P160 P200 P240 P280 P320 P360 P400 P440
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
P3F P7F P11F P15F P19F P23F P27F P31F P35F P39F P43F P47F
Assignment of
I/O number • All modules is allocated per 64 points.(including special, communication)
(Fixed type)
Slot no. 0 1 2 3 4 5 6 7
Main
Out-put 32
Special
Special
Input 16
Input 16
Input 64
Comm.
Unit
X
G P0 P40 P80 P120 P160 P200 P240 P280
B ~ ~ ~ ~ ~ ~ ~ ~
P3F P7F P11F P15F P19F P23F P27F P31F
In case of setting module type by I/O parameter and real module type is different, module
mismatch error occurs and Run is not possible. Main unit
2-33
Chapter 2 Function
• Based on installed module specified per slot, points will be assigned thereto;
- Specified points will be assigned if installed module specified by I/O parameter.
- To the slot not specified by I/O parameter, points will be automatically assigned according to
actually installed module.
(Caution: 16 points will be assigned to 8-point module)
- 16 points will be assigned to empty slot which is not specified by I/O parameter
• Points only available to specify without module specified by I/O parameter.
• 16 points will be assigned to special module and slot with communication module
Assignment of I/O installed
• For example, assignment of I/O number to 12-slot base will be as follows;
number (Variable
type) Slot No. 0 1 2 3 4 5 6 7 8 9 10 11
P C In- In- In- In- Out- Out- Out- Out- In- Out- Out- Out-
W P put put put put put put put put put put put put
R U 16 16 32 64 16 32 32 64 32 16 32 32
P00 P10 P20 P40 P80 P90 P110 P130 P170 P190 P200 P220
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
P0F P1F P3F P7F P8F P10F P12F P16F P18F P19F P21F P23F
Remark
In case of XGK
1) Assignment type of I/O number is specified in basic parameter.
2) Base number of main base is '0' fixed, and a switch to specify base number is installed on the
expansion base.
3) If module type is specified by I/O parameter, it should be identical to the type of actually installed
module to start operation.
4) Fixed type assigns of I/O number in expansion step 1 first slot of 10 points Output module at
P00640~P0064F, Variable type assigns P00240~P0024F. Assigning I/O number of expansion
base can be certificated on System Monitor in XG5000.
5) Function of reserving module points to draw up a program without changing I/O number when
module replace with alternative device expansion or malfunctioning.
6) Refer to 2.3 Basic System in CPU manual for details. (The setting has to set in advance.)
It provides a function of output in debugging, maintaining output when error occurring, maintaining
output when Run changed to Stop, maintaining output when Stop changed to Run, deleting except for
latch area when error occurring as part of setting the output control on PLC operation status.
2-34
Chapter 2 Function
2.6.5 Setting of timer area
Time setting (100ms, 10ms, 1 ms, 0.1ms) follows the timer number.
XGK XGB
Classification
Setting available Setting available
If not set (Default) If not set (Default)
area area
100ms T0000 ~ T2044 T0000 ~ T0999 T0000 ~ T253 T000 ~ T191
① After power is On (Reset), during [Program (Stop) mode Æ RUN mode] or [RUN mode Æ Program
(Stop) mode], it specifies latch area to keep present data. Devices with such a latch area available to
set are D, M, S, C, T, etc. K, L, N and R devices will be latched even if latch is not specified for a
latch device.
② Latch area can be set in device setting with latch area 1 and 2 as divided.
③ Latch area 1 and 2 can not be duplicated.
④ Both latch area 1 and 2 have latch function to keep data even if reset. The difference between the
two is that data of latch area 1 is deleted if overall reset in XG5000 while data of latch area 2 is being
preserved.
⑤ In order to delete data of latch area 2, keep Data Clearing Switch On for 3 seconds or more while
PLC is in Stop mode.
Latch area 2 Data kept Data kept Data kept Data cleared
K, L, R devices Data kept Data kept Data cleared Data cleared
Remark
(1) XGB doesn’t have data clear key. So latch area 2 is deleted only by Online -> Clear PLC.
2-35
Chapter 2 Function
① Operation in set
Operation error flag is changed to Set, Error Step is recorded in F0048 (DWORD) when operation
error is occurred. In the case of Error information is recorded in System Log, PLC operation status
is continued Run status. Also, CHK LED is blinking until operation error is removed.
② Operation in cancellation
PLC operation status is immediately changed on error status when operation error is occurred.
Operation error flag is changed to Set, Error Step is recorded in F0048 (DWORD). In the case of
should be remove operation error and execute Run again.
2) Continue running when a floating point error occurs (XGB not available)
It determines whether operation will continue or not by error occurred when floating point operation
instruction is executed. Set/Cancellation operation is identical with ‘Continue running when an
arithmetic error occurs’.
4) Continue running when a I/O module error occurs (XGB not available)
It is not possible control at CPU by malfunctioning I/O module installed, it determines whether
operation will continue or not.
5) Continue running when a special module error occurs (XGB not available)
It is not possible control at CPU by malfunctioning special module installed, it determines whether
operation will continue or not.
6) Continue running when a communication module error occurs (XGB not available)
It is not possible control at CPU by malfunctioning communication module installed, it determines
whether operation will continue or not.
Remark
If module need to change the reason of 3), 4), 5), 6), it can be change in running status using [Online]-
[Module Changing Wizard] at XG5000.
2-36
Chapter 2 Function
(1) Function
It tentatively stops scan program’s operation to process internal/external signals produced regularly or
irregularly and then deal with applicable functions according to priority which is available from 2 to 7.
Remark
2-37
Chapter 2 Function
1) Input refresh
It reads data from input module before program is executed to save wholly in specified data memory’s
input (P) area.
2) Output refresh
It outputs data in data memory’s output (P) area wholly to output module after END instruction is
executed.
Remark
1) Scan: It is a series of operations to read contact status from input module to save in P area (input refresh) and
then perform instructions from 0000 step to END in cyclic sequence based on the previous process to deal
with self-diagnosis, timer and counter, and write the value changed by program executed in output module
(output refresh).
2-38
Chapter 2 Function
1) Run mode
Communication service/other
internal process
2-39
Chapter 2 Function
2) Stop mode
It is the mode in Stop status without program operation. Program transfer is available only in remote STOP mode
via XG5000.
3) Debug mode
This mode is used to search for program defects and to trace operation process. Changing to this mode is only
available in STOP mode, where details of program execution status and each data can be checked to inspect
the program.
2-40
Chapter 2 Function
XGK XGB
Operation mode Remote
XG5000 command
switch allowable Operation mode Operation mode
switch
RUN X X RUN Local RUN (RUN)
Remote RUN
RUN On Remote RUN
(RUN)
② In case of XGK, operation mode can be changed to remote mode only if in status of ‘Remote Allowable:
On’, ‘Mode Switch: STOP’.
In case of XGB, operation mode can be changed to remote mode if in status of ‘Mode Switch: STOP’
③ To change ‘RUN’ to ‘STOP’ with the switch, let the switch positioned at
(Stop) Æ Run Æ Stop.
Remark
1) If operation mode is changed to RUN mode by using switch in remote RUN mode, PLC will
keep on running without interruption.
2) Though modification during RUN is available in Local RUN mode, the operation of the mode
change via XG5000 is limited. Let it set to Local RUN mode only not to allow mode to change in
remote area.
2-41
Chapter 2 Function
How to set XG5000 of XGT programming S/W will be described below simply to help understand interrupt
function. (Refer to XG5000 manual for details on XG5000.)
Scan Program
Interrupt 1
Interrupt 1 found (Program 1)
Interrupt 2
Interrupt 2 found (Program 2)
Interrupt 3
(Program 3)
Interrupt 2 found
Interrupt 3 found
Interrupt 2
(Program 2)
Interrupt 4
Interrupt 4 found
(Program 4)
END
Remark
2-42
Chapter 2 Function
1) Interrupt programming
Create the task in the XG5000’s project window as below and add the program for each task to execute.
Refer to XG5000 manual for more details.
2) Types of tasks
Detection
Max. 0.2 ms delayed Delayed as much as max. scan time
delayed time
Specified in the range Specified in the range Specified in the range Specified in the range
Task
of 0~31 by user not to of 0~7 by user not to of 64~95 by user not to of 16~23 by user not to
number
be duplicated be duplicated be duplicated range be duplicated
Common processing method and precautions for task program will be described.
· For example, if timer and counter are used for cyclic cycle task program with a cycle of 10 seconds,
tolerance of the timer can be maximum 10 seconds. And since the counter checks its input status every
10 seconds, any input changed within 10 seconds will not be counted.
2-43
Chapter 2 Function
. If cyclic cycle execution task and external contact task occur at the same time, the external
contact task will be executed first.
. Priority of task programs shall be specified in consideration of characteristics, importance and requested
execution-related emergency of program.
(4) Initialization and Relation between scan program and task program
. User defined task dose not start when initialization task program is executed.
. Since scan program’s priority is the lowest, task program will be preferably processed with the scan
program stopped if task occurs. Thus, if tasks occur frequently during 1 scan or are concentrated
intermittently, scan time may increases abnormally, which needs precautions against when setting
condition of task.
. Insert ‘DI’ application instruction in the start position to protect or ‘EI’ application instruction in the position
to cancel the protection. Initialization task will not be under the influence of ‘DI’ or ‘EI’ application
instruction.
When task program’s task (operation condition) is set to cyclic cycle, its processing is as described below.
2-44
Chapter 2 Function
. If the same task program is requested to operate with cyclic cycle task program presently executed or
standing by, the newly generated task will be ignored.
. Only in Run mode, timer that requests execution of cyclic cycle task program will be added. Power
failure time will be all ignored.
. When setting cyclic cycle task program’s execution cycle, consider that execution request of several
cyclic cycle task programs may occur at a time.
If 4 cyclic cycle task programs are used with a cycle of 2, 4, 10 and 20 seconds, execution request of 4
cyclic cycle task programs will occur at a time every 20 seconds, causing a problem to increase the
scan time in a moment.
When execution range of task program’s task (operation condition) is extended from the contact to device,
the extended internal device task program will be processed as described below.
. Specify device’s condition and priority which will be the operation condition of the task program to
execute. And check task number to manage task.
. If devices’ conditions which will be operation condition of internal device task program are identical
according to priority after scan program is executed completely in CPU module, it will start to execute.
. Internal device task program starts to execute when the moment of scan program is completed. Thus,
even if internal device task program’s execution conditions are produced in the scan program or task
program, its execution will be allowed not instantly but the moment scan program is completed.
. Execution request of internal device task program inspects the execution conditions when the moment
scan of program is completed. Thus, internal device task’s execution conditions if once produced and
lost for 1 scan by scan program or task program will not execute the task because the execution can not
be detected at the time when execution conditions are inspected.
Timer device (RTC) is built in CPU module. RTC keeps timer operation with battery back-up despite power
off or momentary power failure.
RTC’s timer data can be used to manage system running history or error record. Present time of RTC is
renewed every scan in Flag (F0053, F0054, F0055, F0056) related with timer.
Refer to CPU user’s manual 6.2 more details about function of timer.
2-45
Chapter 2 Function
(1) Watch-dog timer is used to detect operation delayed due to user program error. Detection time of
Watch-dog timer is set in XG5000’s basic parameter.
(2) Watch-dog timer monitors scan progressing time during operation, and when the specified detection
time if exceeded is detected, it will stop PLC operation immediately and then make all output off.
(3) If detection time of delayed operation (Scan Watch-dog Time) is expected to be exceeded in
processing specific area of user program while being executed (with FOR ~ NEXT instruction, CALL
instruction used), use ‘WDT’ instruction to clear the timer. ‘WDT’ instruction will initialize the elapsed
time of the detection timer of delayed operation and restart to measure the time starting from 0.
(4) In order to delete the Watch-dog error status, let it powered back on, operate manual reset switch, or
change the mode to STOP.
WDT 0 1 2 3 ….. …8 9 0 1 2 … 0 1 2 … …6 7 0 1 2 …
Count (ms)
Remark
2-46
Chapter 2 Function
(1) In case a module is installed different from specified in parameter or in error at start, or
(2) In case I/O module is displaced or in error during run,
Applicable error will be detected with warning lamp (ERR) on in front of CPU module and CPU will stop
running.
If module installation error is detected, applicable bit in F area will be respectively ON as described below;
3) Checking battery voltage used for memory back-up (Not supported in XGB standard type)
It is used to detect the battery voltage lower than the memory back-up voltage and inform the user of the
status. The warning lamp (BAT) will be on in front of CPU module.
Please refer to 4.3.3 Battery durability in CPU manual for details on action to take.
2-47
Chapter 2 Function
(1) The number of JMPs is 512 available for XGK, 128 for XGB in the whole program. If used JMPs exceed
512(XGK) or 128(XGB), no program will be downloaded. And JMP can not be used as duplicated with the
same label.
With JMP conditions satisfied to jump to applicable label, all instructions between JMP instruction and
LABEL will not be operated.
(2) JMP instruction without label can not be downloaded as checked when downloading program. In addition,
in case there is label inside SBRT – RET block, which is regarded error too, no program will be
downloaded.
M00020
JMP XXX_SKIP
END
SBRT function 1
(3) Please refer to Chapter 4.30.1 JMP, LABEL about the JMP-LABEL for more details.
2-48
Chapter 2 Function
2.9.2 CALL-SBRT/RET
(1) The number of CALLs is 512 available in the whole program. CALL instruction can be used as
duplicated, but SBRT/RET can not be duplicated. If CALL instruction used, SBRT/RET instruction
should be surely used.
M00020
CALL function 1
END
Application Error :”Function 1" no
subroutine
(3) In addition, the subroutine should be finished by RET instruction. If SBRT and RET are used only
without CALL, it can be set as Warning/Error in Inspect Program menu in XG5000.
(4) Refer to Chapter 4.30.2 CALL, CALLP, SBRT, RET instruction about the CALL-SBRT/RET for more
details.
2-49
Chapter 2 Function
2.9.3 MCS-MCSCLR
(1) Interlock with higher priority will be first performed, and its cancellation in reverse order.
MCS 0 : High
MCS 7 : LOW
(2) If an interlock with higher priority is cancelled, interlocks with lower priority will be cancelled too.
MCS 0
MCS 1
(3) Stand Alone or END, RET instruction included block will be processed as error.
MCS 0
END
MCSCLR 0 : Error
(4) Refer to Chapter 4.4.1 MCS, MCSCLR about the MCS-MCSCLR for more details.
2-50
Chapter 2 Function
LOAD P0000
FOR 1 : Normal
FOR 2
FOR 3
NEXT
NEXT
NEXT
END
LOAD P0001
FOR 20
NEXT
NEXT : Error
END
LOAD P0002
FOR 20 : Error (Stand Alone)
END
NEXT : Error
END
(4) Please refer to chapter 4.31 Loop Instruction about the FOR-NEXT/BREAK for more details.
2-51
Chapter 2 Function
2.9.5 END/RET
In case there is no END instruction to complete 1 scan or no RET instruction to finish subroutine in the
program, it will be regarded as error.
LOAD P0012
JMP 10
JMP 10
: Missing END
END
SBRT
LOAD P0000
LOAD P0000
OUT M0000
Remark
1) Item available for setting warning or error in XG5000
- Solely used label (without JMP)
- Solely used subroutine ( without CALL)
- Duplicated coil processed
The item above can be processed with warning or error selected in Check Program menu of Menu - View in
XG5000.
2-52
Chapter 2 Function
If operation error is found during Run (indirectly specified address exceeded, BCD operation error, etc.),
to keep running or not will be decided in Error Operation Setup (depends on setting of ‘Continue running
when an arithmetic error occurs’) of XG5000 basic parameter settings item.
If ‘Continue running when an arithmetic error occurs’ is set PLC status keeps Run mode and PLC history
record ‘Continue running, arithmetic error, error step: XX, error code: XX’ in System Log. If ‘Continue
running when an arithmetic error occurs’ is not set the error information window will be pop-up and PLC is
changed to Stop mode when error is occurred. ‘Continue running when an arithmetic error occurs’ is a
default setting in basic parameter settings.
F0110 checks for error whenever each instruction is executed to display ON (if abnormal) and OFF (if
normal). However, instructions which are not under the influence of error will keep the previous status.
F0115 if once error occurs will be latched as kept ON. Thus, if an error is found in previous instruction and
no error found in present instruction, F0110 will be OFF and F0115 will be ON.
Remark
In case of CPU module error, please refer to 4.2 Part Names and Functions in CPU manual for details on
LED display.
2-53
Chapter 2 Function
Operation
Code Cause Action (Restart mode after action) LED status Diagnosis Stage
status
If error repeated after power is ON again, Whole
2 Data Bus abnormal Error Power ON
contact Customer Service Center LEDs blink
If error repeated after power is ON again, in regular
3 Data RAM abnormal Error order Power ON
contact Customer Service Center
If error repeated after power is ON again,
4 Time IC(RTC) error Error ERR : ON Power ON
contact Customer Service Center
Program memory If error repeated after power is ON again,
6 Error ERR : ON Power ON
abnormal contact Customer Service Center
If error repeated after power is ON again,
10 USB IC error Error ERR : ON Power ON
contact Customer Service Center
If error repeated after power is ON again,
11 Back-up RAM error Error ERR : ON Power ON
contact Customer Service Center
If error repeated after power is ON again,
12 Back-up Flash error Error ERR : ON Power ON
contact Customer Service Center
If error repeated after power is ON again, Power ON
13 Base information error STOP ERR : ON
contact Customer Service Center Convert to Run mode
2-54
Chapter 2 Function
Operation
Code Cause Action (Restart mode after action) LED status Diagnosis Stage
status
Rerun after module replaced by
Normal access checking for slot position where
unavailable to access error found via XG5000 STOP ERR : ON
34 Scan Ended
special/link module’s (based on parameter) (RUN) (P.S. : ON)
data during run Reference flag : special/link module
interface error
Abnormal system shot down due to
noise or hardware error
PLC CPU malfunction 1) If error repeated after power is ON RUN: ON
39 STOP At ordinary times
or abnormal end again, contact Customer Service ERR : ON
Center
2) Take action against noise
Program’s scan time
exceeds range of Rerun after checking delayed scan
RUN: ON While program
40 delayed scan time time specified by parameter to modify STOP
ERR : ON executed
detection specified by parameter or program as applicable
parameter during run
Operation error while Eliminate operation error -> Reload RUN: ON While program
41 STOP
user program executed program -> Rerun ERR : ON executed
Stack exceeds normal
RUN: ON While program
42 range while program Rerun STOP
ERR : ON executed
executed
2-55
Chapter 2 Function
Indirect setting Run/Stop based on If operand with indirect setting or index Modify applicable step’s indirect
16
index error parameter setting used exceeds applicable device’s range setting/index area
Group
instruction Run/Stop based on If N value to set group range in group
17 Modify N value
range check parameter setting instructions exceeds device’s range
error
Run/Stop based on If divisor is 0, when Divide instructions Change the value of divisor to
18 0-division error
parameter setting (except RDIV, LDIV) executed other than 0
BCD convert Run/Stop based on If BCD related instruction’s operand Modify data to be within BCD
19
error parameter setting value exceeds BCD format displayed range
If bank setting value in file related
File bank Run/Stop based on
20 instructions exceeds the max. bank Modify bank setting value
setting error parameter setting
range
FPU operation Run/Stop based on If an error occurs when real operation
21 Modify data
related error parameter setting instruction is used
If available data size to display is
Data format Run/Stop based on
22 different when converting data format Modify data
convert error parameter setting
(Real<->Integer)
Run/Stop based on If BMOV instruction’s setting value
23 BMOV error Modify setting value
parameter setting exceeds 16
DECO/ENCO Run/Stop based on With DECO, ENCO instruction used if
24 Modify setting value
error parameter setting range setting value exceeds 8
Run/Stop based on With DIS/UNI instruction used if N value
25 DIS/UNI error Modify N value
parameter setting exceeds 4
Data control Run/Stop based on If data control related instruction’s range
26 Modify range
related error parameter setting is exceeded
Time Run/Stop based on
27 Time related instruction error Modify time data
data error parameter setting
Run/Stop based on MUX/DMUX instruction setting value
28 MUX error Modify setting value
parameter setting error
Data table
Run/Stop based on FIINS, FIDEL instruction setting value
29 instruction Modify setting value
parameter setting error
error
Run/Stop based on If the number to be converted among
30 SEG error Modify setting value
parameter setting formats specified exceeds 4
ASCII value Run/Stop based on
31 ASCII data related instruction error Modify data
error parameter setting
Position
If 3 or more axes are set with position
module Run/Stop based on
32 module instruction used Modify axis setting value
Setting axis parameter setting
(check only for 3 or more unconditionally)
error
String
Run/Stop based on String process related instruction error
33 processing Modify based on instructions
parameter setting Refer to Instructions List
error
Run/Stop based on
34 SORT error SORT/DSORT instruction setting error Modify setting value
parameter setting
FOR nesting Run/Stop based on If the number of FOR instruction’s
35 Modify program
error parameter setting nesting exceeds 16
Task Run/Stop based on
36 If the task number is 96 or higher Modify task number
number error parameter setting
Device range Run/Stop based on If the device area settings exceeds
37 Modify device area
check error parameter setting instruction specification
Data related
Run/Stop based on If the setting related with P2P instruction
38 P2P setting Modify data
parameter setting exceeds the range
error
2-56
Chapter 3 Instruction List
Chapter 3 Instruction List
3.1 Classification of Instructions
Classification Instructions Details Remarks
Contact Point Instruction LOAD, AND, OR related Instructions
Unite Instruction AND LOAD, OR LOAD, MPUSH, MLOAD, MPOP
Reverse Instruction NOT
Master Control Instruction MCS, MCSCLR
OUT, SET, RST, 1 Scan Output Instruction, Output Reverse
Output Instruction
Basic Instruction (FF)
Instructions Sequence/Last-input
Step Control Instruction ( SET Sxx.xx, OUT Sxx.xx )
Preferred Instruction
End Instruction END
Non-Process Instruction NOP
Timer Instruction TON, TOFF, TMR, TMON, TRTG
Counter Instruction CTD, CTU, CTUD, CTR
4/8/64 Bits
Data Transfer Instruction Transfers specified Data, Group, String
available
4/8 Bits
Conversion Instruction Converts BIN/BCD of specified Data & Group
available
Data Type Conversion
Converts Integer/Real Number
Instruction
Output Terminal Compare Compare to
Saves compared results in special relay
Instruction Unsigned
Input Terminal Compare Saves compared results in BR. Compares Real Number, Compare to
Instruction String & Group. Compares 3 Operands Signed
Increase/Decrease 4/8 Bits
Increases or decreases specified data 1 by 1
Instruction available
Rotates specified data to the left and right, 4/8 Bits
Rotate Instruction
including Carry available
Moves specified data to the left and right, word by word, bit 4/8 Bits
Move Instruction
by bit available
Exchanges between devices, higher & lower byte, group
Exchange Instruction
data
Addition, Subtraction, Multiplication & Division for Integer/
BIN Operation Instruction Real Number, Addition for String, Addition & Subtraction for
Group
BCD Operation Instruction Addition, Subtraction, Multiplication, Division.
Application Logic Multiplication, Logic Addition, Exclusive OR, Exclusive
Instructions Logic Operation Instruction
NOR, Group Operation
Error Display, WDT Initialize, Output Control, Operation
System Instruction
Stop, etc.
Encode, Decode, Data Disconnect/Connect, Search, Align,
Data Process Instruction
Max., Min., Total, Average, etc.
Data Table Process
Data Input/Output of Data Table
Instruction
String related Convert, Comment Read, String Extract,
String Process Instruction
ASCII Convert, HEX Convert, String Search, etc.
Special Function Trigonometric Function, Exponential/Log Function, Angle/
Instruction Radian Convert, etc.
Data Control Instruction Max/Min Limit Control, Dead-zone Control, Zone Control
Time related Instruction Date Time Data Read/Write, Time Data Adjust & Convert
Diverge Instruction JMP, CALL
Loop Instruction FOR/NEXT/BREAK
Flag related Instruction Carry Flag Set/Reset, Error Flag Clear
Special/Communication
Data Read/Write by BUSCON Direct Access
related Instruction
Interrupt related Instruction Interrupt Enable/Disable
Sign Reverse Instruction Reverse Integer/Real Signs, Absolute Value Operation
3-1
Chapter 3 Instruction List
Basic
Classification Designations Symbol Description
Steps
MOV MOV S D 2
16 Bits
transfer (S) (D)
MOVP MOVP S D 3
32 Bits 2
DMOV DMOV S D
(S+1,S) (D+1,D )
transfer
DMOVP S D
DMOVP 3
Double Real LMOV
RMOV S D (S+3,S+2,S+1,S) 2
Number
transfer (D+3,D+2,D+1,D)
LMOVP 3
① ② ③ ④ ⑤
3-2
Chapter 3 Instruction List
A
OR LOAD A,B Block Parallel-Connected 1
B
Remark
1) The number of Basic Steps means the case that indirect specification, index formula and direct
variable input were not used. In other words, it represents the minimum number of the steps of the
applicable instruction.
2) The number of steps depends on indirect specification, index formula and pulse application used.
3-3
Chapter 3 Instruction List
3-4
Chapter 3 Instruction List
Input
TON TON T t t 2
T
Input
TOFF TOFF T t t 2
T
Input t1+t2 = t
TMR TMR T t ←
2
Timer t1→ ← t2 →
T
Input
t
TMON TMON T t 2
T
Input
TRTG TRTG T t t 2
T
Reset
Count
Pulse Setting
CTD CTD C c 2
Present
Output
Reset
Count
Pulse Setting
CTU CTU C c 2
Present
Output
Counter Reset
Increased
Pulse
Decreased
Pulse
CTUD CTUD C U D c 4
Setting
Present
Output
Reset
Count
Pulse Setting
CTR CTR C c 2
Present
Output
3-5
Chapter 3 Instruction List
MOV MOV S D 2
16 bits
Transfer (S) (D)
MOVP MOVP S D 3
DMOV DMOV S D 2
32 bits
Transfer (S+1,S) (D+1,D )
DMOVP DMOVP S D 3
b1 b
BMOV BMOV S D Z (S) 5 0
Specified Bits … 4
Transfer (D)
BMOVP BMOVP S D Z * Z: Control Word
(S) b15 b0
GBMOV GBMOV S D Z N : N 4
Specified Bits (S+N)
(D)
…
Group Transfer
:
GBMOVP GBMOVP S D Z N 5
(D+N)
* Z: Control Word
3-6
Chapter 3 Instruction List
$MOV $MOV S D 2
String String started from (S)
Transfer String started from (D)
$MOVP $MOVP S D 3
BCD4 Sb Db
(Sb):Bit, BIN(0~9)
BCD4 b15 b0
3
To 4bit BCD
BCD4P BCD4P Sb Db 4
4/8 Bits (Db): Bit
BCD
Conversion (Sb):Bit, BIN(0~99)
BCD8 BCD8 Sb Db 3
b15 b0
To 8bit BCD
BCD8P BCD8P Sb Db 4
(Db):Bit
BIN BIN S D To BIN 2
(S) (D)
BINP BINP S D BCD( 0~9999 ) 3
BIN
Conversion DBIN S D
DBIN To BIN 2
(S+1,S) (D+1,D )
DBINP DBINP S D 3
BCD( 0~99999999 )
To 4bit BIN
BIN4P BIN4P Sb Db 4
4/8 Bits (Db):Bit
BIN
Conversion (Sb):Bit, BCD(0~99)
BIN8 BIN8 Sb Db 3
b15 b0
To bit BIN
BIN8P BIN8P Sb Db 4
(Db):Bit
GBCD GBCD S D N
Data (S) to N converted to BCD,
and (D) to N saved 4
Group GBCDP GBCDP S D N
BCD,BIN
Conversion GBIN GBIN S D N
Data (S) to N converted to BIN, and
(D) to N saved 4
GBINP GBINP S D N
3-7
Chapter 3 Instruction List
I2LP S D
Int( -32768~32767 )
I2LP 3
To INT
L2I L2I S D (S+3,S+2,S+1,S) 2
(D)
Whole Double Real Range
Long L2IP L2IP S D 3
Real/Integer
Conversion L2D L2D S D
To DINT
(S+3,S+2,S+1,S) (D+1,D)
2
3-8
Chapter 3 Instruction List
Remark
1) In case of XGK, Integer value and Real value will be saved respectively in quite different format. For such
reason, Real Number Data should be converted as applicable before used for Integer Operation.
3-9
Chapter 3 Instruction List
Basic
Classification Designations Symbol Description
Steps
CMP CMP S1 S2 2
CMP(S1,S2) and applicable Flag Set
Unsigned
(S1, S2 is Word)
Compare CMPP CMPP S1 S2 3
with Special
Relay DCMP DCMP S1 S2 2
CMP(S1,S2) and applicable Flag Set
used
(S1, S2 is Double Word)
DCMPP DCMPP S1 S2 3
CMP4 CMP4 S1 S2 3
CMP(S1,S2) and applicable Flag Set
(S1, S2 is Nibble)
CMP4P CMP4P S1 S2 4
4/8 Bits
Compare
CMP8 CMP8 S1 S2 3
CMP(S1,S2) and applicable Flag Set
(S1, S2 is Byte)
CMP8P CMP8P S1 S2 4
TCMP S1 S2 D
CMP(S1,S2))
TCMP :
CMP(S1+15,S2+15) 4
Table TCMPP TCMPP S1 S2 D Result:(D) ~ (D+15), 1 if identical
Compare
DTCMP DTCMP S1 S2 D CMP((S1+1,S1),(S2+1,S2))
:
CMP((S1+31,S1+30),(S2+31,S2+30)) 4
DTCMPP DTCMPP S1 S2 D Result:(D) ~ (D+15)
GEQ GEQ S1 S2 D N
4
GEQP GEQP S1 S2 D N
GGT GGT S1 S2 D N
4
GGTP GGTP S1 S2 D N
GLT GLT S1 S2 D N
Compares S1 data to S2 data word 4
Group GLTP GLTP S1 S2 D N by word, and saves its result in
Compare Device (D) bit by bit from the lower
(16 Bits) GGE GGE S1 S2 D N bit
( N ≤ 16 ) 4
GGEP GGEP S1 S2 D N
GLE GLE S1 S2 D N
4
GLEP GLEP S1 S2 D N
GNE GNE S1 S2 D N
4
GNEP GNEP S1 S2 D N
Remark
1) CMP(P), DCMP(P), CMP4(P), CMP8(P), TCMP(P) & DTCMP(P) Instructions all process the results of
Unsigned Compare. All the other Compare Instructions will perform Signed Compare.
3-10
Chapter 3 Instruction List
Basic
Classification Designations Symbol Description
Steps
GDEQ GDEQ S1 S2 D N
4
GDEQP GDEQP S1 S2 D N
GDGT GDGT S1 S2 D N
4
GDGTP GDGTP S1 S2 D N
GDLT GDLT S1 S2 D N
Compares S1 data to S2 data 2 by 4
Group GDLTP GDLTP S1 S2 D N 2 words, and saves its result in
Compare Device (D) bit by bit from the lower
(32 Bits) GDGE GDGE S1 S2 D N bit
( N ≤ 16 ) 4
GDGEP GDGEP S1 S2 D N
GDLE GDLE S1 S2 D N
4
GDLEP GDLEP S1 S2 D N
GDNE GDNE S1 S2 D N
4
GDNEP GDNEP S1 S2 D N
3-11
Chapter 3 Instruction List
Basic
Classification Designations Symbol Description
Steps
LOAD= = S1 S2
LOAD> > S1 S2
16 Bits
LOAD< < S1 S2 Compares (S1) to (S2), and saves
Data
its result in Bit Result(BR) (Signed 2
Compare >= S1 S2
LOAD>= Operation)
(LOAD)
LOAD<= <= S1 S2
LOAD<> <> S1 S2
AND= = S1 S2
AND> > S1 S2
16 Bits Performs AND operation of (S1) &
AND< < S1 S2
Data (S2) Compare Result and Bit Result
2
Compare AND>= >= S1 S2
(BR), and then saves its result in
(AND) BR (Signed Operation)
AND<= <= S1 S2
AND<> <> S1 S2
OR= = S1 S2
OR> > S1 S2
OR<= <= S1 S2
OR<> <> S1 S2
LOADD= D= S1 S2
LOADD> D> S1 S2
32 Bits
LOADD< D< S1 S2 Compares (S1) to (S2), and saves
Data
its result in Bit Result(BR) (Signed 2
Compare D>= S1 S2
LOADD>= Operation)
(LOAD)
LOADD<= D<= S1 S2
LOADD<> D<> S1 S2
3-12
Chapter 3 Instruction List
Basic
Classification Designations Symbol Description
Steps
ANDD= D= S1 S2
ANDD> D> S1 S2
Performs AND operation of (S1) &
32 Bits
ANDD< D< S1 S2 (S2) Compare Result and Bit Result
Data
(BR), and then saves its result in 2
Compare D>= S1 S2
ANDD>= BR (Signed Operation)
(AND)
ANDD<= D<= S1 S2
ANDD<> D<> S1 S2
ORD= D= S1 S2
ORD> D> S1 S2
ORD<= D<= S1 S2
ORD<> D<> S1 S2
LOADR= R= S1 S2
LOADR> R> S1 S2
Performs OR operation of (S1) &
Short LOADR< R< S1 S2 (S2) Compare Result and Bit Result
Real Number
(BR), and then saves its result in 2
Compare
LOADR>= R>= S1 S2 BR (Signed Operation)
(LOAD)
LOADR<= R<= S1 S2
LOADR<> R<> S1 S2
ANDR= R= S1 S2
ANDR> R> S1 S2
ANDR<= R<= S1 S2
ANDR<> R<> S1 S2
3-13
Chapter 3 Instruction List
Basic
Classification Designations Symbol Description
Steps
ORR= R= S1 S2
ORR> R> S1 S2
ORR<= R<= S1 S2
ORR<> R<> S1 S2
LOADL= L= S1 S2
LOADL> L> S1 S2
LOADL<= L<= S1 S2
LOADL<> L<> S1 S2
ANDL= L= S1 S2
ANDL> L> S1 S2
ANDL<= L<= S1 S2
ANDL<> L<> S1 S2
3-14
Chapter 3 Instruction List
Basic
Classification Designations Symbol Description
Steps
ORL= L= S1 S2
ORL> L> S1 S2
ORL<= L<= S1 S2
ORL<> L<> S1 S2
LOAD$= $= S1 S2
LOAD$> $> S1 S2
LOAD$<= $<= S1 S2
LOAD$<> $<> S1 S2
AND$= $= S1 S2
AND$> $> S1 S2
AND$< $< S1 S2
Performs AND operation of (S 1)
String
& (S2) Starting String Compare
Compare 2
Result and Bit Result(BR), and
(AND) AND$>= $>= S1 S2
then saves its result in BR
AND$<= $<= S1 S2
AND$<> $<> S1 S2
3-15
Chapter 3 Instruction List
Basic
Classification Designations Symbol Description
Steps
OR$= $= S1 S2
OR$> $> S1 S2
OR$<= $<= S1 S2
OR$<> $<> S1 S2
LOADG= G= S1 S2 N
LOADG> G> S1 S2 N
Compares (S1), (S1+1), …,
16 Bits LOADG< G< S1 S2 N (S1+N) to (S2), (S2+1), … ,
Data (S2+N) 1 to 1, and then saves
4
Group Compare LOADG>= G>= S1 S2 N 1 in Bit Result(BR) if each
(LOAD) value compared meets given
condition
LOADG<= G<= S1 S2 N
LOADG<> G<> S1 S2 N
ANDG= G= S1 S2 N
ANDG> G> S1 S2 N
Performs AND operation of
16 Bits ANDG< (S1), (S1+1), …, (S1+N) &
G< S1 S2 N
Data (S2), (S2+1), … , (S2+N) 1 to
4
Group Compare 1 Compare Result and Bit
(AND) ANDG>= G>= S1 S2 N Result (BR), and then saves its
result in BR
ANDG<= G<= S1 S2 N
ANDG<> G<> S1 S2 N
ORG= G= S1 S2 N
ORG> G> S1 S2 N
ORG<= G<= S1 S2 N
ORG<> G<> S1 S2 N
3-16
Chapter 3 Instruction List
Basic
Classification Designations Symbol Description
Steps
LOADDG= DG= S1 S2 N
LOADDG> DG> S1 S2 N
Compares (S1), (S1+1), …,
32 Bits
LOADDG< DG< S1 S2 N (S1+N) to (S2), (S2+1), … ,
Data
(S2+N) 1 to 1, and then saves
Group 4
LOADDG>= DG>= S1 S2 N 1 in Bit Result(BR) if each
Compare value compared meets given
(LOAD) condition
LOADDG<= DG<= S1 S2 N
LOADDG<> DG<> S1 S2 N
ANDDG= DG= S1 S2 N
ANDDG> DG> S1 S2 N
Performs AND operation of
32 Bits
ANDDG< (S1), (S1+1), …, (S1+N) &
Data DG< S1 S2 N
(S2), (S2+1), … , (S2+N) 1 to
Group 4
1 Compare Result and Bit
Compare ANDDG>= DG>= S1 S2 N Result(BR), and then saves its
(AND) result in BR
ANDDG<= DG<= S1 S2 N
ANDDG<> DG<> S1 S2 N
ORDG= DG= S1 S2 N
ORDG> DG> S1 S2 N
Performs OR operation of
32 Bits
ORDG< DG< S1 S2 N (S1), (S1+1), …, (S1+N) &
Data
(S2), (S2+1), … , (S2+N) 1 to
Group 4
1 Compare Result and Bit
Compare DG>= S1 S2 N Result(BR), and then saves its
ORDG>=
(OR) result in BR
ORDG<= DG<= S1 S2 N
ORDG<> DG<> S1 S2 N
3-17
Chapter 3 Instruction List
Basic
Classification Designations Symbol Description
Steps
LOAD3= =3 S1 S2 S3
LOAD3> >3 S1 S2 S3
LOAD3<= <=3 S1 S2 S3
LOAD3<> <>3 S1 S2 S3
AND3= =3 S1 S2 S3
AND3> >3 S1 S2 S3
Performs AND operation of (S1),
Three 16-Bit AND3< <3 S1 S2 S3 (S2), (S3) Compare Result by
Data Compare given condition and Bit Result 2
(AND) AND3>= >=3 S1 S2 S3 (BR), and then saves its result in
BR
AND3<= <=3 S1 S2 S3
AND3<> <>3 S1 S2 S3
OR3= =3 S1 S2 S3
OR3> >3 S1 S2 S3
OR3<= <=3 S1 S2 S3
OR3<> <>3 S1 S2 S3
LOADD3= D=3 S1 S2 S3
LOADD3> D>3 S1 S2 S3
LOADD3<= D<=3 S1 S2 S3
LOADD3<> D<>3 S1 S2 S3
3-18
Chapter 3 Instruction List
Basic
Classification Designations Symbol Description
Steps
ANDD3= D=3 S1 S2 S3
ANDD3> D>3 S1 S2 S3
Performs AND operation of (S1+
Three 32-Bit ANDD3< D<3 S1 S2 S3 1,S1), (S2+1,S2), (S3+1,S3) Compare
Data Compare Result by given condition and Bit 4
(AND) ANDD3>= D>=3 S1 S2 S3 Result(BR), and then saves its
result in BR
ANDD3<= D<=3 S1 S2 S3
ANDD<> D<>3 S1 S2 S3
ORD3= D=3 S1 S2 S3
ORD3> D>3 S1 S2 S3
ORD3<= D<=3 S1 S2 S3
ORD3<> D<>3 S1 S2 S3
LOAD4= 4= S1 S2
LOAD4> 4> S1 S2
LOAD4<= 4<= S1 S2
LOAD4<> 4<> S1 S2
3-19
Chapter 3 Instruction List
Basic
Classification Designations Symbol Description
Steps
AND4= 4= S1 S2
AND4> 4> S1 S2
Performs compare operation of (S1),
4-Bit AND4< 4< S1 S2 (S2) as Nibble unit, after AND
Data Compare operation of its result and Bit 3
(AND) AND4>= 4>= S1 S2 Result(BR), and then save BR
(Unsigned operation)
AND4<= 4<= S1 S2
AND4<> 4<> S1 S2
OR4= 4= S1 S2
OR4> 4> S1 S2
OR4<= 4<= S1 S2
OR4<> 4<> S1 S2
LOAD8= 8= S1 S2
LOAD8> 8> S1 S2
LOAD8<= 8<= S1 S2
LOAD8<> 8<> S1 S2
3-20
Chapter 3 Instruction List
Basic
Classification Designations Symbol Description
Steps
AND8= 8= S1 S2
AND8> 8> S1 S2
Performs compare operation of (S1),
8-Bit AND8< 8< S1 S2 (S2) as Byte unit, after AND
Data Compare operation of its result and Bit 3
(AND) AND8>= 8>= S1 S2 Result(BR), and then save BR
(Unsigned operation)
AND8<= 8<= S1 S2
AND8<> 8<> S1 S2
OR8= 8= S1 S2
OR8> 8> S1 S2
OR8<= 8<= S1 S2
OR8<> 8<> S1 S2
ULOAD= U= S1 S2
ULOAD> U> S1 S2
ULOAD<= U<= S1 S2
ULOAD<> U<> S1 S2
3-21
Chapter 3 Instruction List
UAND= U= S1 S2
UAND> U> S1 S2
UAND<= U<= S1 S2
UAND<> U<> S1 S2
UOR= U= S1 S2
UOR> U> S1 S2
UOR<= U<= S1 S2
UOR<> U<> S1 S2
3-22
Chapter 3 Instruction List
ULOADD= UD= S1 S2
ULOADD> UD> S1 S2
ULOADD<= UD<= S1 S2
ULOADD<> UD<> S1 S2
UANDD= UD= S1 S2
UANDD> UD> S1 S2
UANDD<= UD<= S1 S2
UANDD<> UD<> S1 S2
UORD= UD= S1 S2
UORD> UD> S1 S2
UORD<= UD<= S1 S2
UORD<> UD<> S1 S2
3-23
Chapter 3 Instruction List
Basic
Classification Designations Symbol Description
Steps
INC INC D
(D)+1 (D) 2
INCP INCP D
DINC DINC D
BIN Data (D+1,D)+1 (D+1,D) 2
Increase DINCP DINCP D
/
Decrease DEC DEC D
(Signed) (D)-1 (D) 2
DECP DECP D
DDEC DDEC D
(D+1,D)-1 (D+1,D) 2
DDECP DDECP D
INCU INCU D
(D)+1 (D)
2
INCUP INCUP D
DINCU DINCU D
(D+1,D)+1 (D+1,D)
BIN Data 2
Increase DINCUP DINCUP D
/
Decrease DECU DECU D
(D)-1 (D)
(Unsigned) 2
DECUP DECUP D
DDECU DDECU D
(D+1,D)-1 (D+1,D)
2
DDECUP DDECUP D
3-24
Chapter 3 Instruction List
Basic
Classification Designations Symbol Description
Steps
ROL ROL D n 2
b15 b0
CY D
ROLP ROLP D n 3
Rotate to Left
DROL DROL D n b31 b15 b0 2
CY D+1 D
DROLP DROLP D n 3
ROR ROR D n 2
b15 b0
D CY
RORP RORP D n 3
Rotate to Right
DROR DROR D n b31 b15 b0 2
D+1 D CY
DRORP DRORP D n 3
b+3 b
ROR4 ROR4 Db n D CY 3
ROR4P ROR4P Db n 4
4/8 Bits
Rotate to Right b+7 b
ROR8 ROR8 Db n D CY 3
ROR8P ROR8P Db n 4
RCL RCL D n 2
b15 b0
CY D
Rotate to Left RCLP RCLP D n 3
(including
Carry) DRCL DRCL D n b31 b15 b0 2
CY D+1 D
DRCLP DRCLP D n 3
b+3 b
RCL4 RCL4 Db n CY D 3
4/8 Bits
RCL4P RCL4P Db n 4
Rotate to Left
(including b+7 b
RCL8 RCL8 Db n CY D 3
Carry)
RCL8P RCL8P Db n 4
RCR RCR D n 2
b15 b0
Rotate D CY
RCRP RCRP D n 3
to Right
(including
DRCR DRCR D n b31 b15 b0 2
Carry) D+1 D CY
DRCRP DRCRP D n 3
b+3 b
RCR4 RCR4 Db n D CY 3
4/8 Bits
RCR4P RCR4P Db n 4
Rotate to Right
(including b+7 b
RCR8 RCR8 Db n D CY 3
Carry)
RCR8P RCR8P Db n 4
3-25
Chapter 3 Instruction List
Basic
Classification Designations Symbol Description
Steps
St Ed
BSFT BSFT St Ed b15 b0 3
Bits Move
BSFTP BSFTP St Ed 4
0
b15 b0
BSFL BSFL D n 2
(D)
BSFLP BSFLP D n CY 0 3
Move to Higher
Bit b31 b0
DBSFL DBSFL D n 2
(D+1, D) … …
DBSFLP DBSFLP D n CY 0 3
b+3 b
BSFL4 BSFL4 Db n
D
3
Move to Higher BSFL4P BSFL4P Db n CY 0
Bit within 4/8
b+7 b
Bits range BSFL8 BSFL8 Db n
D
3
BSFL8P BSFL8P Db n CY 0
b15 b0
BSFR BSFR D n (D) 2
0
BSFRP BSFRP D n CY 3
Move to Lower
Bit b31 b0
DBSFR DBSFR D n 2
(D+1, D) … …
0 CY
DBSFRP DBSFRP D n 3
b+3 b
BSFR4 BSFR4 Db n D
3
0 CY
Move to Lower BSFR4P BSFR4P Db n
Bit within 4/8 b+7 b
Bits range BSFR8 BSFR8 Db n D
3
BSFR8P BSFR8P Db n 0 CY
3-26
Chapter 3 Instruction List
3-27
Chapter 3 Instruction List
Basic
Classification Designations Symbol Description
Steps
XCHG XCHG D1 D2 2
(D1) (D2)
XCHGP XCHGP D1 D2 3
Data
Exchange
DXCHG DXCHG D1 D2 2
(D1+1, D1) (D2+1, D2)
DXCHGP DXCHGP D1 D2 3
b15 b0
SWAP SWAP D (D) Upper Byte Lower Byte
Higher/Lower
Byte 2
Exchange SWAPP D (D) Lower Byte Upper Byte
SWAPP
GSWAP GSWAP D N 2
Group
Exchanges Higher/Lower
Byte
Byte of Words N starting from D
Exchange GSWAPP GSWAPP D N 3
3-28
Chapter 3 Instruction List
Basic
Classification Designations Symbol Description
Steps
ADD ADD S1 S2 D
(S1)+(S2) (D) 4
ADDP ADDP S1 S2 D
Integer Addition
(Signed)
DADD DADD S1 S2 D
(S1+1,S1)+(S2+1,S2)
4
(D+1,D)
DADDP DADDP S1 S2 D
SUB SUB S1 S2 D
(S1)-(S2) (D) 4
Integer SUBP SUBP S1 S2 D
Subtraction
(Signed) DSUB DSUB S1 S2 D (S1+1,S1)-(S2+1,S2)
4
(D+1,D)
DSUBP DSUBP S1 S2 D
MUL MUL S1 S2 D
(S1)×(S2) (D+1,D) 4
Integer MULP MULP S1 S2 D
Multiplication
(Signed) DMUL DMUL S1 S2 D (S1+1,S1)×(S2+1,S2)
4
(D+3,D+2,D+1,D)
DMULP DMULP S1 S2 D
ADDU ADDU S1 S2 D
(S1)+(S2) (D)
4
ADDUP ADDUP S1 S2 D
Integer Addition
(Unsigned)
DADDU DADDU S1 S2 D (S1+1,S1)+(S2+1,S2)
(D+1,D) 4
DADDUP DADDUP S1 S2 D
SUBU SUBU S1 S2 D
(S1)-(S2) (D)
4
Integer SUBUP SUBUP S1 S2 D
Subtraction
(Unsigned) DSUBU DSUBU S1 S2 D (S1+1,S1)-(S2+1,S2)
(D+1,D) 4
DSUBUP DSUBUP S1 S2 D
MULU MULU S1 S2 D
(S1)×(S2) (D+1,D)
4
Integer MULUP MULUP S1 S2 D
Multiplication
(Unsigned) DMULU DMULU S1 S2 D (S1+1,S1)×(S2+1,S2)
(D+3,D+2,D+1,D) 4
DMULUP DMULUP S1 S2 D
3-29
Chapter 3 Instruction List
Basic
Classification Designations Symbol Description
Steps
DIVU DIVU S1 S2 D
(D) Quotient
(S1)÷(S2) 4
(D+1) Remainder
DIVUP DIVUP S1 S2 D
Integer Division
(Unsigned) (S1+1,S1)÷(S2+1,S2)
DDIVU DDIVU S1 S2 D
(D+1,D) Quotient 4
DDIVUP DDIVUP S1 S2 D (D+3,D+2) Remainder
$ADD $ADD S1 S2 D
String Connects S1 String with S2 String
4
Addition to save in D
$ADDP $ADDP S1 S2 D
3-30
Chapter 3 Instruction List
Basic
Classification Designations Symbol Description
Steps
ADDB ADDB S1 S2 D
(S1)+(S2) (D) 4
ADDBP ADDBP S1 S2 D
BCD Addition
DADDB DADDB S1 S2 D (S1+1,S1)+(S2+1,S2)
4
(D+1,D)
DADDBP DADDBP S1 S2 D
SUBB SUBB S1 S2 D
(S1)-(S2) (D) 4
SUBBP SUBBP S1 S2 D
BCD Subtraction
DSUBB DSUBB S1 S2 D
(S1+1,S1)-(S2+1,S2)
4
(D+1,D)
DSUBBP DSUBBP S1 S2 D
MULB MULB S1 S2 D
(S1)×(S2) (D+1,D) 4
MULBP MULBP S1 S2 D
BCD
Multiplication
DMULB DMULB S1 S2 D (S1+1,S1)×(S2+1,S2)
(D+3,D+2,D+1,D) 4
DMULBP DMULBP S1 S2 D
3-31
Chapter 3 Instruction List
Basic
Classification Designations Symbol Description
Steps
WOR WOR S1 S2 D
Word OR 4
WORP WORP S1 S2 D (S1) | (S2) (D)
Logic Addition
DWOR DWOR S1 S2 D DWord OR
(S1+1,S1) | (S2+1,S2) (D+1,D) 4
DWORP DWORP S1 S2 D
WXNR WXNR S1 S2 D
Word Exclusive NOR
4
(S1) ^ (S2) (D)
WXNRP WXNRP S1 S2 D
Exclusive
NOR
DWXNR DWXNR S1 S2 D
DWord Exclusive NOR 4
(S1+1,S1) ^ (S2+1,S2) (D+1,D)
DWXNRP DWXNRP S1 S2 D
GWAND GWAND S1 S2 D N 4
(S1) (S2) (D)
& = N
GWANDP GWANDP S1 S2 D N 5
3-32
Chapter 3 Instruction List
3-33
Chapter 3 Instruction List
Basic
Classification Designations Symbol Description
Steps
b15 b0
BSUM BSUM S D S 2
1’s number
BSUMP BSUMP S D D 3
Bit Check
b31 b15 b0
DBSUM DBSUM S D S+1 S 2
1’s number
DBSUMP DBSUMP S D D 3
BRST BRST D N
Bit Reset Resets N Bits (starting from D) to 0 2
BRSTP BRSTP D N
S D
ENCO ENCO S D N
... ...
Encode 4
N bits
ENCOP ENCOP S D N 2N bits 2binary
S D
DECO DECO S D N
... ...
Decode 4
N bits
DECOP DECOP S D N 2binary 2N bits
Disconnect &
Connect D ...
UNI UNI S D N
D+1
D+N-1
.. ...
S 4
... ...
UNIP UNIP S D N
S Lower D
WTOB WTOB S D N Higher Lower
.. h00
h00 Higher D+1
S+N-1 Higher Lower h00 Lower
4
Word/ WTOBP WTOBP S D N h00 Higher
Byte
Conversion BTOW BTOW S D N D
D+1
h00
h00
Lower
Higher
Higher Lower
.. S
SCH SCH S1 S2 D N 4
SCHP SCHP S1 S2 D N
Finds S1 value within S2 ~ N range 5
Data and saves the first identical valued
Search position in D and S1’s identical valued
DSCH DSCH S1 S2 D N 4
total number in D+1
DSCHP DSCHP S1 S2 D N 5
MAX MAX S D n
Saves the max value in D among N
4
words starting from S
MAXP MAXP S D n
Max. Value
Search
DMAX DMAX S D n
Saves the max value in D among N
4
double words starting from S
DMAXP DMAXP S D n
3-34
Chapter 3 Instruction List
Basic
Classification Designations Symbol Description
Steps
MIN MIN S D n
Saves the min value in D among N
4
words starting from S
MINP MINP S D n
Min. Value
Search
DMIN DMIN S D n
Saves the min value in D among N
4
double words starting from S
DMINP DMINP S D n
SUM SUM S D n
Adds up N words starting from S to
4
save in D
SUMP SUMP S D n
Sum
DSUM DSUM S D n
Adds up N double words starting
4
from S to save in D
DSUMP DSUMP S D n
AVE AVE S D n
Averages N words starting from S
4
to save in D
AVEP AVEP S D n
Average
DAVE DAVE S D n
Averages N double words starting
4
from S to save in D
DAVEP DAVEP S D n
DMUXP DMUXP S1 S2 D N 5
3-35
Chapter 3 Instruction List
Basic
Classification Designations Symbol Description
Steps
Basic
Classification Designations Symbol Description
Steps
SEG SEG S D Z
7 Segment Converts S Data to 7-Segment as
4
Display adjusted in Z Format so to save in D
SEGP SEGP S D Z
3-36
Chapter 3 Instruction List
Basic
Classification Designations Symbol Description
Steps
BCDDA BCDDA S D 2
Converts S of 1-word BCD to ASCII
Convert BCD Cord to save in starting D
BCDDAP BCDDAP S D 3
to Decimal
ASCII
DBCDDA DBCDDA S D 2
Cord Converts S of 2-word BCD to ASCII
Cord to save in starting D
DBCDDAP DBCDDAP S D 3
DABIN DABIN S D 2
Converts S S+2,S+1,S’s Decimal
ASCII Cord to BIN to save in D
Convert DABINP DABINP S D 3
Decimal ASCII
to BIN DDABIN DDABIN S D Converts S+5~S’s Decimal ASCII 2
Cord to BIN value to save in D+1 &
DDABINP DDABINP S D D 3
HABIN HABIN S D 2
Converts S+1,S’s Hexadecimal ASCII
Cord to BIN value to save in D
Convert HABINP HABINP S D 3
Hexadecimal
ASCII to BIN DHABIN DHABIN S D 2
Converts S+3~S’s Hexadecimal ASCII
Cord to BIN to save in D
DHABINP DHABINP S D 3
DABCD DABCD S D 2
Converts S+1,S’s Decimal ASCII
Cord to BCD to save in D
Convert DABCDP DABCDP S D 3
Decimal ASCII
to BCD DDABCD DDABCD S D 2
Converts S+3~S’s Decimal ASCII
Cord to BCD to save in D
DDABCDP DDABCDP S D 3
LEN LEN S D 2
String Saves String Length with S starting
Length Detect in D
LENP LENP S D 3
3-37
Chapter 3 Instruction List
Basic
Classification Designations Symbol Description
Steps
STR STR S1 S2 D
Adjusts S2 saved word
data to S1 saved place
4
number to convert to String
STRP STRP S1 S2 D
Convert BIN16/32 to and save in D
String Adjusts S2 saved double
DSTR DSTR S1 S2 D
word data to S1 saved
4
place number to convert to
DSTRP DSTRP S1 S2 D
String and save in D
VAL VAL S D1 D2
Adjusts S saved string to
number to save in word
4
D1 and saves the place
VALP VALP S D1 D2
Convert String to number in D2
BIN16/32 Adjusts S saved string to
DVAL DVAL S D1 D2
number to save in double
4
word D1 and saves the
DVALP DVALP S D1 D2
place number in D2
Adjusts Floating decimal
RSTR RSTR S1 S2 D
point point Real Number
Data (S1: number, S2: 4
RSTRP RSTRP S1 S2 D places) to String format to
Convert Real Number to save in D
String Adjusts Floating decimal
LSTR LSTR S1 S2 D
point point Double Real
Number Data (S1:number, 4
LSTRP LSTRP S1 S2 D S2:places) to String format
to save in D
STRR STRR S D Converts String S to Floating
decimal point point Real 2
Convert String to Real STRRP STRRP S D Number Data to save in D
Number
STRL STRL S D
Converts String S to
Floating decimal point
2
point Double Real Number
STRLP STRLP S D
Data to save in D
ASC ASC S D cw
Converts BIN Data to
ASCII in Nibble unit,
ASCII Conversion 4
based on cw’s format from
ASCP ASCP S D cw
S to save in D
Converts 2N ASCII saved
HEX HEX S D N
in N words from S in byte
HEX Conversion unit to Nibble unit of 4
HEXP HEXP S D N Hexadecimal BIN so to
save in D
RIGHT RIGHT S D N Extracts N string from S
String Extract from
string’s final letter to save 4
Right
RIGHTP RIGHTP S D N in starting D
MID MID S1 S2 D
Extracts string which
conforms to S2 condition
String Random Extract 4
among S1 string to save in
MIDP MIDP S1 S2 D
starting D
3-38
Chapter 3 Instruction List
Basic
Classification Designations Symbol Description
Steps
RBCD RBCD S1 S2 D
Adjusts Floating decimal point
point Real Number Data S1 to
4
S2 place to convert to BCD,
RBCDP RBCDP S1 S2 D
Parse Real and then to save in D
Number to BCD Adjusts Floating decimal point
LBCD LBCD S1 S2 D
point Double Real Number
4
Data S1 to S2 place to convert
LBCDP LBCDP S1 S2 D
to BCD, and then to save in D
BCDR BCDR S1 S2 D
Adjusts BCD Data S1 to S2
Convert BCD
place to convert to Floating
Data to Real 4
decimal point point Real
Number BCDRP BCDRP S1 S2 D
Number, and then to save in D
BCDFormat 을 BCDL Adjusts BCD Data S1 to S2
BCDR S1 S2 D
단장형 Real place to convert to Floating
decimal point point Double 4
Number 로 Real Number, and then to
BCDLP BCDLP S1 S2 D
Convert save in D
3-39
Chapter 3 Instruction List
Basic
Classification Designations Symbol Description
Steps
SIN SIN S D 2
SIN Operation SIN(S+1,S) (D+1,D)
SINP SINP S D 3
COS COS S D 2
COS
COS(S+1,S) (D+1,D)
Operation
COSP COSP S D 3
TAN TAN S D 2
TAN(S+1,S) (D+1,D)
TAN Operation TANP TANP S D 3
ATANP ATANP S D 3
SQRT SQRT S D 2
Square Root (S+1,S) (D+1,D)
SQRTP SQRTP S D 3
Operation
LNP LNP S D 3
3-40
Chapter 3 Instruction List
Basic
Classification Designations Symbol Description
Steps
LIMIT LIMIT S1 S2 S3 D 4
If S1 < S2, then
LIMITP LIMITP S1 S2 S3 D D = S2 5
Limit If S2 < S1 < S3, then
Control D = S1
DLIMIT DLIMIT S1 S2 S3 D If S3 < S1, then 4
D = S3
DLIMITP DLIMITP S1 S2 S3 D 5
DZONE DZONE S1 S2 S3 D 4
If S1 < -S2, then
DZONEP DZONEP S1 S2 S3 D D = S1+S2-S2(S3/100) 5
Dead-zone If –S2 < S1 < S2, then
Control D = (S3/100)S1
DDZONE DDZONE S1 S2 S3 D If S1 < S2, then 4
D = S1-S2+S2(S3/100)
DDZONEP DDZONEP S1 S2 S3 D 5
VZONE VZONE S1 S2 S3 D 4
If S1 < -S2(S3/100), then
VZONEP VZONEP S1 S2 S3 D D = S1-S2+S2(S3/100) 5
Vertical-zone If –S2(S3/100) <S1< S2(S3/100), then
Control D = (100/S3)S1
DVZONE DVZONE S1 S2 S3 D If S1 < S2(S3/100), then 4
D = S1+S2-S2(S3/100)
DVZONEP DVZONEP S1 S2 S3 D 5
3-41
Chapter 3 Instruction List
Basic
Classification Designations Symbol Description
Steps
ADDCLK ADDCLK S1 S2 D
Adds S1 ~ S1+2 & S2 ~ S2+2 Time
Time Data
Data to save in D ~ D+2 in Time 4
Increase
ADDCLKP S1 S2 D
Data format (Hr/Mn/Sd)
ADDCLKP
SUBCLK SUBCLK S1 S2 D
Extracts S2 ~ S2+2’s Time Data from
Time Data
S1 ~ S1+2 to save in D ~ D+2 in 4
Decrease
SUBCLKP S1 S2 D
Time Data format (Hr/Mn/Sd)
SUBCLKP
SECOND SECOND S D 2
Converts Time Data S ~ S+2 to
seconds to save in double word D
SECONDP SECONDP S D 3
Time Data
Format
Conversion HOUR HOUR S D 2
Converts the seconds saved in
double word S to Hr/Mn/Sd to save
HOURP S D
in D ~ D+2
HOURP 3
Basic
Classification Designations Symbol Description
Steps
3-42
Chapter 3 Instruction List
Basic
Classification Designations Symbol Description
Steps
FOR FOR N 2
Operates FOR~NEXT section n times
Loop
NEXT NEXT 1
Instruction
BREAK BREAK Escapes from FOR~NEXT section 1
Basic
Classification Designations Symbol Description
Steps
Basic
Classification Designations Symbol Description
Steps
Self Diagnosis
Error Display FALS FALS n 2
(Error Display )
On during n1 Scan, Off during n2
Scan Cluck DUTY DUTY D n1 n2 4
Scan
WDT WDT
WDT
Watch Dog Timer Clear 1
Initialize
WDTP WDTP
Basic
Classification Designations Symbol Description
Steps
3-43
Chapter 3 Instruction List
Basic
Classification Designations Symbol Description
Steps
NEG NEG D
Saves D value again in D with 2’s
2
complement taken
NEGP NEGP D
2’s
complement
DNEG DNEG D
Saves (D+1,D) value again in (D+1,D)
2
with 2’s complement taken
DNEGP DNEGP D
RNEG RNEG D
Reverses D Real Number Sign then
2
to save again
Real Number RNEGP RNEGP D
Data Sign
Reverse LNEGR LNEG D
Reverses D Double Real Number
2
Sign then to save again
LNEGP LNEGP D
ABS ABS D
Converts D highest Bit to 0 2
ABSP ABSP D
Absolute Value
Operation
DABS DABS D
Converts (D+1,D)
2
highest Bit to 0
DABSP DABSP D
Basic
Classification Designations Symbol Description
Steps
RSET RSET S
Block Changes Block Number of file register
2
Conversion to S Number
RSETP RSETP S
EMOV EMOV S1 S2 D
Flash
Transfers S2 word data in S1 Block
Word Data 4
to D
Transfer EMOVP EMOVP S1 S2 D
3-44
Chapter 3 Instruction List
Basic
Classification Designations Symbol Description
Steps
Basic
Classification Designations Symbol Description
Steps
Make Nth bit at Device D area a
LOADB B D N 2
present operation result
Reverse Nth bit at Device D area and
LOADBN BN D N 2
set it a present operation result
B D N
Perform AND Operation of Nth bit at
ANDB Device D area and a present 2
operation result
BN D N Reverse Nth bit at Device D area and
ANDBN perform AND Operation of it and a 2
present operation result
Loop Perform OR Operation of Nth bit at
instruction B D N
ORB Device D area and a present 2
operation result
Reverse Nth bit at Device D area and
ORBN B D N perform OR Operation of it and a 2
present operation result
Output Nth bit at Device D area as a
BOUT BOUT D N 2
present operation result
If it meets a condition, set Nth bit at
BSET BSET D N 2
Device D area
If it meets a condition, reset Nth bit at
BRESET BRESET D N 2
Device D area
3-45
Chapter 3 Instruction List
Basic
Classification Designations Symbol Description
Steps
Sets opposite station No. for P2P
Station No. Set P2PSN P2PSN n1 n2 n3 Communication. n1:P2P No., n2:Block, 4
n3:Station No.
Sets word data Read Area
Read Area Set n1:P2P No., n2:Block, n3:Variable
P2PWRD P2PWRD n1 n2 n3 n4 n5 5
(WORD) sequence, n4:Variable Size,
n5:Device
Basic
Classification Designations Symbol Description
Steps
GET GET sl S D N 4
Reads data of special module
memory is installed on
GETP GETP sl S D N 5
Special
Module
Read/Write PUT PUT sl S1 S2 N 4
Writes data on special module
memory is installed on
PUTP PUTP sl S1 S2 N 5
Basic
Classification Designations Symbol Description
Steps
3-46
Chapter 3 Instruction List
Basic
Classification Designations Symbol Description
Steps
Instructions Positioning Module’s ax
Return to Origin ORG
ORG sl ax axis installed on sl slot to return to 2
Point XORG
Origin Point
Instructions Positioning Module’s ax
Floating Origin FLT
FLT sl ax axis installed on sl slot to set 2
Point XFLT
Floating Origin Point
Instructions Positioning Module’s ax
axis installed on sl slot to start
DST
Direct Start DST sl ax n1 n2 n3 n4 n5 directly with Target Position(n1), 8
XDST
Target Speed(n2), Dwell Time(n3),
M Code(n4) & Control Word(n5)
Instructions Positioning Module’s ax
IST
Indirect Start IST sl ax n axis installed on sl slot to start n 4
XIST
step indirectly
3-47
Chapter 3 Instruction List
Basic
Classification Designations Symbol Description
Steps
Present
PRS Instructions Positioning Module’s ax axis to
Position PRS sl ax n 4
XPRS change present position to n
Change
3-48
Chapter 3 Instruction List
Basic
Classification Designations Symbol Description
Steps
Resets Error originated from
CLR
Error Reset CLR sl ax n Positioning Module’s ax axis 4
XCLR
installed on sl slot
Error Deletes Error History originated
ECLR
History ECLR sl ax from Positioning Module’s ax axis 2
XECLR
Reset installed on sl slot
Performs Point Operation of
Point PST
PST sl ax n Positioning Module’s ax axis 4
Operation XPST
installed on sl slot
Changes n2 to n1 among basic
Basic Parameter TBP
TBP sl ax n1 n2 parameters of Positioning Module’s 4
Teaching XSBP
ax axis installed on sl slot
3-49
Chapter 3 Instruction List
Basic
Classification Designations Symbol Description
Steps
Instructs Positioning Module’s ax
CAM axis installed on sl slot to execute
XCAM X CAM sl ax n1 n2 4
operation CAM operation with CAM data of n2
with n1 designated as main axis
Instructs Positioning Module’s ax
Ellipse axis installed on sl slot to execute
XELIN X ELI N sl ax n1 n2 n3 4
interpolation Ellipse interpolation with n1 step, n2
rate and n3 anlge.
3-50
-
LOAD S
LOAD NOT S
LOADP S P
LOADN S N
[Area Setting]
Operand Description Data Type
S Bit device’s contact / Word device’s bit contact BIT
2) LOADP, LOADN
(1) LOADP is Operation Start Instruction at Rising edge of pulse. Operation result is On when specified contact
changes Off to On (Rising edge of pulse), and only when applicable bit value changes 0 to 1 in case of D area
bit specified.
(2) LOADN is Operation Start Instruction at Falling edge of pulse. Operation result is On when specified contact
changes On to Off (Falling edge of pulse), and only when applicable bit value changes 1 to 0 in case of D area
bit specified.
Remark
(1) S area’s bit specified is displayed in Hexadecimal. Namely, Dxxxxx.0 ~ Dxxxxx.F available.
For example, D00010.A means 10th Bit of word applicable to D10.
(2) For LOAD/AND/OR Instruction, index formula is available for Operand.
- LOAD P1[Z2] stands for LOAD P (1+[Z2] value) and LOAD D10[Z1].5 for LOAD D (10+[Z1]).5
- What is different is that index formula is added to bit value since P device is of bit, while index
formula is
added to word value since D device is of word.
(3) LOAD/LOAD NOT Instruction if used with index formula increases the number of steps by 1. And the
number of steps becomes 2 steps.
(4) It influences Error flag (F110) when Index formula is used in contact instruction.
4-1
Chapter 4 Details of Instructions
3) Program Example
(1) Where if Input Condition P00020 is On, P00060 Output will be On, and at the same time P00061 Output will
be Off. And while D00020.3 changes 0Æ1 for 1 scan, P00062 Output will be On, and while D00020.3 changes
1Æ0 for 1 scan, P00063 Output will be On.
[ Ladder Program]
P00020 P00060
0 ( )
P00020 P00061
2 ( )
D00020.3 P00062
4 P ( )
D00020.3 P00063
6 N ( )
b15 b3 b0
D20 1/0
[Mnemonic Program]
[Time Chart]
4-2
-
AND S
AND NOT S
ANDP S P
ANDN S N
[Area Setting]
Operand Description Data Type
S Bit device’s contact / Word device’s bit contact BIT
2) ANDP, ANDN
(1) ANDP is A contact series-connected instruction at Rising Pulse, and ANDN is B contact series-connected
instruction at Falling Pulse.
(2) When applicable contact changes, in other words, when ANDP is at Rising Pulse and ANDN is at Falling
Pulse, AND or AND NOT operation of previous operation result and specified contact(S) is regarded as its result.
3) Program Example
(1) Where after Input Condition P00020 and P00021 is AND operated, its result and P00022 is AND NOT
operated, whose result will be output in P00060, and D00020.3 value and P00023 is ANDP operated, whose
result and P00024 is ANDN operated to output its result in P00061.
Remark
(1) AND/AND NOT Instruction if used with index formula increases the number of steps by 1.
4-3
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.1.3 OR, OR NOT, ORP, ORN
Area Available Flag
Instruction Cons Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
t. (F110) (F111) (F112)
OR
S O O O O O O - O O - O - - - 1/2 - - -
OR NOT
ORP
S O O O O O O - O O - O - - - 2 - - -
ORN
OR S
OR NOT S
ORP S
P
ORN S
N
[Area Setting]
Operand Description Data Type
S Bit device’s contact / Word device’s bit contact BIT
1) OR, OR NOT
(1) OR is 1 contact’s A contact parallel-connected instruction, and OR NOT is B contact parallel-connected
instruction.
(2) OR or OR NOT operation of previous operation result and specified contact (S) is regarded as its result.
2) ORP, ORN
(1) ORP is A contact parallel-connected instruction at Rising Pulse, and ORN is B contact parallel-connected
instruction at Falling Pulse.
(2) When applicable contact changes, in other words, when ORP is at Rising Pulse and ORN is at Falling Pulse,
OR or OR NOT operation of previous operation result and specified contact (S) is regarded as its result.
3) Program Example
(1) Where even if one input condition between P020 and P021 contacts is On, P061 is Output.
OR P00021
Remark
(1) OR/OR NOT Instruction if used with index formula increases the number of steps by 1.
4-4
-
1) Operation
Press instant contact push button PB1 to rotate motor clockwise, or PB2 to rotate motor counterclockwise.
Rotation direction can be changed even if the motor is not stopped. Press instant contact push button PB0 to
stop the motor.
2) System Diagram
3) Program Example
[Ladder Program]
12 END
[Mnemonic Program]
P00031 P00060
Remark
(1) P00031 if On makes Output P00060 On, which makes self-used input a contact P00060 On and
keeps the On state till P00030 signal is input. Such a circuit is called Self Holding Circuit.
4-6
-
AND LOAD
A Block B Block
1) Function
(1) It performs AND Operation of A Block and B Block.
(2) If AND LOAD is continuously used, normal operation is not available when the max. usable number is
exceeded.
(3) Up to 15 times (16 blocks) available if continuously used.
2) Program Example
(1) Where Input Condition P00020, P00024 or P00020, P00025 or P00022, P00026 is On, P00060 is Output.
[Time Chart]
P00020 OFF ON
OFF ON
P00022
OFF ON
P00026
OFF ON
P00060
4-7
Chapter 4 Details of Instructions
3) References
In case Circuit Block is series-connected continuously, program input is of 2 types as follows.
END
Remark
1) In XG5000, the program above if made by Ladder and displayed by Mnemonic will be of unlimited
application times of AND LOAD.
4-8
-
A block
OR LOAD
B block
1) OR LOAD
(1) Performs OR operation of A Block and B Block to get the result.
(2) If OR LOAD is continuously used, normal operation is not available when the maximum usable number is
exceeded.
(3) Up to 15 times (16 blocks) available if continuously used.
2) Program Example
(1) Where Input condition P00020, P00025 or P00024, P00025 is On, P00060 and P00061 is output
[Time Chart]
OFF ON
P00020
OFF ON
P00024
OFF ON
P00025
OFF ON
P00060
OFF ON
P00061
4-9
Chapter 4 Details of Instructions
3) References
In case Circuit Block is series-connected continuously, program input is of 2 types as follows.
M00002 M00003
M00004 M00005
M00006 M00007
M00008 M00009
16 END
If used continuously, up to 15
OR LOAD times unlimited instructions (16 blocks) available
Remark
1) In XG5000, the program above if made by Ladder and displayed by Mnemonic will be of unlimited application
times of OR LOAD.
4-10
-
XGK XGB
○ ○
4.2.3 MPUSH, MLOAD, MPOP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
MPUSH
MLOAD - - - - - - - - - - - - - - 1 - - -
MPOP
MPUSH
MLOAD
MPOP
M00002 P00061
②
M00003 P00062
③
M00004 P00063
④
① MPUSH: saves M00000 state in PLC’s internal memory. Used as first divergence.
② MLOAD: reads saved M00000 state and performs next operation. Used as divergence’s relay.
③ MLOAD: reads saved M00000 state and performs next operation.
④ MPOP: reads saved M00000 in PLC’s internal memory and performs operation and resetting.
Used as divergence end.
4-11
Chapter 4 Details of Instructions
2) References
[Ladder Program]
P00020 P00021 P00022 P00023 P00024 P00060
00000
P00025 P00061
P00026 P00062
P00027 P00063
P00028 P00064
P00029 P00065
P0002A P00066
00027 END
[Mnemonic Program]
4-12
-
NOT
1) NOT
(1) NOT reverses the previous result.
(2) If Reverse Instruction(NOT) is used, A contact circuit is reversed to B contact circuit, B contact circuit to A
contact circuit, and series-connected circuit is reversed to parallel-connected circuit, parallel-connected circuit to
series-connected circuit for the left circuit of Reverse Instruction.
2) Program Example
Program ① and ② outputs the same result.
[Program ①]
[Program ②]
P00020 P00060
P00021
P00022
P00023
P00024
4-13
Chapter 4 Details of Instructions
MCS MCS n
MCSCLR MCSCLR n
[Area Setting]
Operand Description Data Type
n Up to 0~15 available to set integer and n(Nesting). WORD(0~15)
1) MCS, MCSCLR
(1) If MCS’s input condition is On, up to MCSCLR identical to MCS number will be executed. And if input
condition is Off, nothing will be executed.
(2) Priority is that MCS number 0 is the highest, 15 the lowest, which should be used in priority sequence.
Clearing will be to the contrary.
(3) MCSCLR clearing of high priority data will also clear MCS Block with low priority.
(4) MCS or MCSCLR should be used in priority sequence.
2) Program Example
Where 2 MCS Instructions are used and “0” with high priority is used for MCSCLR Instruction.
Remark
1) If MCS’s On/Off Instruction is Off, MCS ~ MCSCLR’s operation result will as follows; Be careful when using
MCS (MCSCLR) Instruction.
· Timer Instruction: Not Processed. Identical Process to contact Off
· Counter Instruction: Not Processed (Present value kept)
· OUT Instruction: Not Processed
· SET, RST Instruction: Result Kept
4-14
-
[Relay Circuit]
4-15
Chapter 4 Details of Instructions
OUT D
OUT NOT D /
OUTP D P
OUTN D N
[Area Setting]
Operand Description Data Type
D Contact to be On/Off / Word device’s bit contact. BIT
2) OUTP, OUTN
(1) As for OUTP, when up to OUTP Instruction operation result changes Off → On, specified contact is On for 1
scan and the others than that, it will be Off. If specified contact is of word device’s bit contact, applicable bit will
be 1 only for 1 scan and the others than that, it will be 0.
(2) As for OUTN, when up to OUTN Instruction operation result changes On Æ Off, specified contact is On for 1
scan and the others than that, it will be Off. If specified contact is of word device’s bit contact, applicable bit will
be 1 only for 1 scan and the others than that, it will be 0.
(3) Master-K’s D, D NOT Instruction is the Instruction changed.
4-16
-
3) Program Example
(1) OUTP Example: performs OUTP Instruction when input contact P00032 changes Off to On.
[Time Chart]
OFF ON
P00032
1 Scan On
OFF ON
M00002
1 Scan On
OFF ON
P00060 Dotted line is P00060 output part via self-holding
(2) OUTN Example: performs D Instruction when input contact P00032 changes Off to On.
·
[Time Chart]
P00033
ON OFF
-> <-
OFF ON 1 Scan On
M00003
-> <- 1 Scan On
ON
P00061 OFF
Dotted line is P00061 output part via self-holding
Remark
1) Since OUTP, OUTN Instructions are On only for1 scan based on applicable input condition, Output to P area
needs careful attention.
4-17
Chapter 4 Details of Instructions
(1) Operation
Press instant contact push button PB0 to make Output On first, and press again to make Output Off.
Whenever PB0 is pressed, Output is repeatedly On and Off.
1 1
Program
2 2
3 .
. .
. .
. .
[Time Chart]
OFF ON
P00000
OFF ON
P00060
4-18
-
SET S
[Area Setting]
Operand Description Data Type
D Contact to keep On state / Word device’s bit contact BIT
1) SET
(1) If input condition is On, output is kept On although specified output contact is kept On to make Input Off. If
specified output contact is of Word device’s bit contact, its applicable bit should be 1.
(2) Contact if On by SET Instruction can be Off by RST Instruction.
(3) Refer to 4.6 Subsequent Input Sequence Preferred Instruction for details on SET Syy.xx.
2) Program Example
(1) Where the state of P00060 & P00061 is checked when input contact P00020 changes Off Æ On.
[Time Chart]
OFF ON
P00020
OFF ON
P00060
OFF ON
P00061
4-19
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.5.3 RST
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
RST D O - O O O - - O - - O - - - 1 - - -
RST R
[Area Setting]
Operand Description Data Type
D Contact to keep Off state / Word device’s bit contact BIT
1) RST
(1) If input condition is On, output is kept Off although specified output contact is kept Off to make Input Off. If
specified output contact is of Word device’s bit contact, its applicable bit should be 0.
2) Program Example
(1) Where the output state of P00060 & P00061 is checked and P00061 output is made Off when input
condition P00020 changes On Æ Off.
[Time Chart]
OFF ON
P00020
OFF ON
P00021
OFF ON
P00060
OFF ON
P00061
4-20
-
K00000 K00000
(2) Differences in operation between Input/Output Relay(P) and Keep Relay(K) areas at SET/RST Instruction
Set/Reset Instructions have Self-Keep function to keep the state once when Output is set (On) till “Off” input
comes in. However, because of differences between Input/Output Relay(P) Area and Keep Relay(K) Area, the
operation after power recovered will be different.
4-21
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.5.4 FF
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
FF D O - O - - - - O O - O - - - 1 - - -
FF FF D
[Area Setting]
Operand Description Data Type
1) FF
(1) Reverses specified device’s state when input contact changes Off Æ On by Bit Output Reverse Instruction.
2) Program Example
(1) Where P0060 state is reversed when input contact P0020 is changed from Off to On.
[Ladder Program]
P00020
0 FF P00060
2 END
[Mnemonic Program]
0 LOAD P00020
1 FF P00060
2 END
[Time Chart]
P00020 OFF ON
P00060 OFF ON
4-22
-
[Area Setting]
Operand Description Data Type
As S device contact, yy is for group number, xx for step number.
Syy.xx BIT
Group Number is available 0~127, and step number 0~99
2) Program Example
RESET
(2) Sequence Control will be output if the previous step is On and its own condition contact is On.
[Time Chart]
P00030
P00031
P00032
Input condition contact to clear S01
S01.01
S01.02
4-23
Chapter 4 Details of Instructions
[Ladder Program]
[Time Chart]
OFF ON
Start
S00.01 OFF ON
Process OFF ON
1 End
S00.02 OFF ON
Process OFF ON
2 End
ON
S00.03 OFF
Process
OFF ON
3 End
Emergent OFF ON
stop
S00.00
ON OFF
4-24
-
[Area Setting]
Operand Description Data Type
As S device contact, yy is for group number, xx for step number.
Syy.xx BIT
Group Number is available 0~127, and step number 0~99
2) Program Example
P00020 S02.01
Step Mnemonic Operand
0 LOAD P00020
P00021 S02.23 1 OUT S02.01
2 LOAD P00021
P00022 S02.99 3 OUT S02.23
4 LOAD P00022
5 OUT S02.98
P00023 S02.00 6 LOAD P00023
7 OUT S02.00
END
2 On On Off Off On
3 On On On Off On
4 On On On On On
4-25
Chapter 4 Details of Instructions
END END
1) END
(1) Displays Program End.
(2) Returns to 0000 Step to process after END Instruction is processed.
(3) END Instruction should be surely input last in program. If not input, Missing End Error will occur.
Remark
What is 1 scan?
As shown below; A cycle of Input Refresh Æ User Program ExecutedÆ Self Diagnosis Æ Output Refresh is 1 scan.
Input Refresh
1scan
Self-diagnosis
Output refresh
4-26
-
1) NOP
(1) It means No Operation Instruction which has no effect on operation result of applicable circuit till then.
(2) Only used in Mnemonic Program.
(3) NOP is used to debug sequence program and to clear instruction while keeping the number of steps
temporarily.
2) Program Example
(1) Where steps are increased if Mnemonic Program is changed to Ladder Program with NOP Instruction used.
[Mnemonic Program]
0 LOAD P00020
1 AND P00021
2 NOP
3 OUT P00060
4 LOAD P00022
5 OUT P00061
6 END
[Ladder Program]
Remark
1) Instruction process time of NOP Instruction differs based on unit type. However, the program process time Scan
time) can be reduced by clearing the instruction which needs time to process.
2) NOP Instruction can not be input from Ladder, and NOP registered in Mnemonic will not be displayed on the
Ladder screen but the number of steps displayed as included.
4-27
Chapter 4 Details of Instructions
(3) Up to 2,048 Timers can be used regardless of its type, and the setting value range available is 0~65, 535.
Repeated use of the same timer number is impossible. If the same timer number is used repeatedly regardless of
index used, it will be processed as repeated use, which makes Program Download unavailable.
(4) Timer value setting available device (Operand available) is integers of P, M, K, U, D, R, etc. with index functions
available. However, at this moment available index range is Z0 ~ Z3.
(5) In order to reset Timer, turn input contact OFF or use reset coil. While reset coil is ON, Timer dose not operate.
(6) If Reset Instruction is used to reset Timer, be sure to input in the same format as used in Timer format as shown
below; If TON T0001[Z000] D00010[Z003] is used, Timer format used in reset coil should be T0001[Z000], or
program error will occur in XG5000 to make Program Download unavailable.
(7) Timer makes present value updated and contact ON/OFF after END Instruction executed. Thus, Timer Instruction
may make operational error. Refer to Appendix 2. Measurement and Precision of Timer for details.
4-28
-
Remark
1) Due to index function, timers with different characteristics if operated at a time will be executed individually to
produce abnormal operation. If index function is to be used, pay attention to this.
4-29
Chapter 4 Details of Instructions
XGK XGB
4.9.2 TON ○ ○
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
T - - - O - - - - - - - - - -
TON 2/3 - - -
t O - - - - - - - - O O - O O
Input Condition
TON TON T t
[Area Setting]
Operand Description Data Type
T Timer Contact to use WORD
stands for Timer’s setting value. Integer or word device available
t WORD
Setting Time = Basic cycle (100ms, 10ms, 1ms or 0.1ms) x setting value (t)
Input signal ← t →
Timer contact
point output (Increased)
2) Program Example
(1) In 20 sec after P00020 is On, when Timer’s present value is the same as setting, T0097 will be On, and
P00065 is On.
(2) If input condition is Off before present value reaches setting value, present value will be “0”. If P00021 is On,
T0097 will be Off and present value “0”.
P00020
0 TON T0097 200 Step Mnemonic Operand
0 LOAD P00020
T0097 P00065 1 TON T0097 200
3 3 LOAD T0097
4 OUT P00065
P00021 T0097
5 LOAD P00021
5 R
6 RST T0097
[Time Chart]
P00020
← t = 20 sec →
P00065
4-30
-
[System Diagram]
[Time Chart]
P00002
T0 T1
P00060
[Program]
4-31
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.9.3 TOFF
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
T - - - O - - - - - - - - - -
TOFF 2/3 - - -
t O - - - - - - - - O O - O O
[Area Setting]
Operand Description Data Type
T Timer Contact to use WORD
Input signal
← t →
Timer contact
point output
(Dcreased)
2) Program Example
(1) If input P00020 contact is On, T0000 contact is On at the same time and Output P00065 is On.
(2) After input P00020 is Off, Timer starts to decrease. And if present value is “0”, Timer Contact will be Off.
(3) If P00022 is On, present value will be “0”.
[Ladder Program]
[Time Chart]
P00020
t=5
P00065
4-32
-
(1) Operation
It makes several conveyers operate (A → B → C) and stop (C → B → A) in applicable sequence.
[System Diagram]
[Ladder Program]
END
[Time Chart]
Operation OFF ON
(P00020)
T0000
A(P00060) OFF ON T0000 : 5 sec.
T0000 T0001 : 10 sec.
OFF ON
B(P00061) T0010 : 10 sec.
T0011
T0001
OFF ON T0011 : 5 sec.
C(P00062)
4-33
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.9.4 TMR
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
T - - - O - - - - - - - - - -
TMR 2/3 - - -
t O - - - - - - - - O O - O O
[Area Setting]
Operand Description Data Type
T Timer Contact to use WORD
Input Signal
Present
accumulated time
t1 t2
Timer contact
point output (Increased)
Setting time (t) = t1 + t2
2) Program Example
(1) Where contact P0020 is repeatedly On, Off and On then to make T0096 On and Output contact P0061 On
(t1 + t2 = 30sec).
(2) If Reset Signal P0023 is On, present value will be “0” and P0061 Off.
[Ladder Program]
[Time Chart]
P00023
P00020
Setting
T0096
(Present) t = 10
t = 20
P00061
4-34
-
(1) Operation
It measures application time of tool such as machining center and outputs alarm to exchange tools.
Address Description
P00020 Drill Downward Detected
P00021 Drill Exchange Compete
P00060 Tools’s Life Alarm
T0000 Tools’s Life Setting Timer
[Ladder Program]
The Accumulating Timer shown above is recommended to be of the type in non-volatile area.
(Timer used here is in volatile area)
4-35
Chapter 4 Details of Instructions
XGK XGB
4.9.5 TMON ○ ○
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
T - - - O - - - - - - - - - -
TMON 2/3 - - -
t O - - - - - - - - O O - O O
[Area Setting]
Operand Description Data Type
T Timer Contact to use WORD
Input Signal
2) Program Example
(1) If P00020 is On, contact T0000 will be promptly On and Timer decreases.
(2) While P00020 is repeatedly On and Off it will keep decreasing.
(3) If Reset Signal P00023 is On, present value will be “0” and Output Off.
[Ladder Program]
[Time Chart]
4-36
-
(1) Operation
It keeps from vibration of passing signal of object with irregular speed (limit switch) so to get stable signal.
Address Description
P00020 Limit switch used to detect position
M00020 Specific Time Output Relay
T0000 Vibration-proof Timer
(3) Program
4-37
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.9.6 TRTG
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
T - - - O - - - - - - - - - -
TRTG 2/3 - - -
t O - - - - - - - - O O - O O
[Area Setting]
Operand Description Data Type
T Timer Contact to use WORD
Input signal
t
t
Timer contact
point output
(Decreased)
2) Program Example
(1) If P00020 is On, contact T0096 is On at the same time, and if Timer decreases to “0”, P00065 is Off.
(2) If P00020 input condition is allowed before “0” is reached, present value will be setting value and will
decrease again.
(3) If Reset Signal P00023 is On, present value will be “0” and Output Off.
[Ladder Program]
[Time chart]
P00020
t=5 sec
t
P00065
(Decreased)
4-38
-
(1) Operation
It detects error of Returning Equipment with product provided at regular intervals
(3) Program
Detected ( P00020)
Signal
Timer ( T0005)
T
Normal ( M00100)
4-39
Chapter 4 Details of Instructions
(1) Counter increases/decreases present value whenever rising edge of pulse is input. And if setting value is
reached, it makes Output On.
(2) Counter has 4 instructions based on operation characteristics.
(3) Up to 2,048 Counters can be used regardless of its type, and the setting value range available is
0~65,535. Repeated use of the same counter number is impossible. If the same counter number is used
repeatedly regardless of index used, it will be processed as repeated use, which makes Program
Download unavailable.
(4) Counter value setting available device (Operand available) is integers of P, M, K, U, D, R, etc. with index
functions available. However, at this moment available index range is Z0 ~ Z3.
(5) If Reset Instruction is used to reset Counter, be sure to input in the same format as used in Counter format
as shown below; If CTU C0010[Z000] P0010[Z003] is used,
Counter format used in reset coil shall be C0010[Z000], or program error will occur in XG5000 to make
Program Download unavailable.
4-40
-
(6) As for CTUD Instruction, input contact shall be off in other than reset coil in order to reset counter.
(7) As for CTU & CTUD Instructions, even if setting value is exceeded, counter value will keep increasing with
UP counter pulse continuously input. However, no more than 65535 will be increased. Thus, use RST
Instruction to initialize CTU & CTUD Instructions’ value to 0.
Remark
1) Due to index function, counters with different characteristics if operated at a time will be executed individually to
produce abnormal operation. If index function is to be used, pay attention to this.
4-41
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.10.2 CTD
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
C - - - - O - - - - - - - - -
CTD 2/3 - - -
N O - - - - - - - - O O - O O
Count Input
CTD CTD C N
Reset Signal
R
[Area Setting]
Operand Description Data Type
C Counter contact to use WORD
N Set Value (0 ~ 65535) WORD
1) Function
(1) It decreases by 1 from setting value whenever rising edge of pulse is input. And if “0” is reached, Output will
be On.
(2) If Reset Signal is On, Output will be Off and present value will be setting value.
[Time Chart]
2) Program Example
(1) If P00030 contact is On 5 times, P00060 Output will be On when present value is counted down to “0”.
(2) If P00031 contact is On, Output will be Off and present value will be setting value.
[Ladder Program]
P00030
CTD C0010 5
P00031 C0010
(R )
C0010 P00060
( )
[Time Chart]
4-42
-
Reset Signal
R
[Area Setting]
Operand Description Data Type
C Counter contact to use WORD
N Setting value (0 ~ 65535) WORD
1) Function
(1) It increases present value by 1 whenever Rising edge of the pulse is input. And if present value exceeds
setting value, Output will be On and maximum counter (65,535) will be counted.
(2) If Reset Signal is On, Output will be Off and present value will be “0”.
[Time Chart]
2) Program Example
(1) If counted up to P00030 contact with present value identical to setting value, P00060 Output will be On.
(2) If P00031 contact is On, Output will be Off and present value will be initialized to “0”.
[Ladder Program]
P00030
CTU C0010 10
P00031 C0010
( R )
C0010 P00060
( )
[Time Chart]
P00031
P00030
Setting value
C0010
P00060
4-43
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.10.4 CTUD
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
C - - - - O - - - - - - - - -
CTUD U O O O O O - - O O - O - - - 2/3 - - -
D O O O O O - - O O - O - - -
N O - - - - - - - - O O - O O
Count Input
CTUD CTUD C U D N
Reset Signal
(R)
[Area Setting]
Operand Description Data Type
C Counter contact to use WORD
U Increases present value by 1 (+1) BIT
D Decreases present value by 1 (-1) BIT
N Setting Value (0 ~ 65,535) WORD
1) Function
(1) It increases present value by 1 whenever Rising edge of the pulse is input in U device. And if present value
exceeds setting value, Output will be On and maximum counter (65,535) will be counted.
(2) It decreases present value by 1 whenever Rising edge of the pulse is input in D device.
(3) If Reset Signal is On, present value will be “0”.
(4) If U & D device’s pulse are On at the same time, present value will not change.
(5) Up-Down Counter operates when Count Input Signal remained On status.
[Time Chart]
Reset Signal
Incr Pulse
Decr Pulse
Setting
Present
Counter contact
point output
4-44
-
2) Program Example
(1) If present value is the same as setting value with count up to P00030 contact, P00060
Output will be On.
(2) It will be counted Down due to P00031 contact’s Rising edge of the pulse.
(3) If Reset Condition is met, Output will be Off and counter’s present value “0”.
(4) Increment and Decrement Counter is possible by F00099 (Always On status) of Counter Enabled signal.
[Ladder Program]
FOOO99
CTUD C0000 P00030 P00031 20
P00032 C0000
( R )
C0000 P00060
( )
[Time Chart]
4-45
Chapter 4 Details of Instructions
(1) Operation
As for 4 motors to be controlled, press instant contact push button PB1 to increase operation motor number by 1, and
press PB2 to decrease by 1. When 4 motors are operated, press PB1 to stop all the motors. When 1 motor is
operated, press PB2 to make no motor operate.
(3) Program
FOOO99
CTUD C0001 P00030 P00031 1
C0005 C0001
( R )
FOOO99
CTUD C0002 P00030 P00031 2
C0005 C0002
( R )
FOOO99
CTUD C0003 P00030 P00031 3
C0005 C0003
( R )
FOOO99
CTUD C0004 P00030 P00031 4
C0005 C0004
( R )
FOOO99
CTUD C0005 P00030 P00031 5
C0005 C0005
( R )
C0001 P00060
( )
C0002 P00061
( )
C0003 P00062
( )
C0004 P00063
( )
4-46
-
Count Input
CTR CTR C N
Reset Signal
(R)
[Area Setting]
Operand Description Data Type
C Counter contact to use WORD
N Setting value (0 ~ 65,535) WORD
1) Function
(1) It increases present value by 1 whenever riseing edge of the pulse is input. And if present value reaches
setting value and then input signal changes Off→On, present value will be On.
(2) If present value reaches setting value, Output will be On.
(3) If present value is lower than setting value or reset condition is On, Output will be Off.
[Time Chart]
Reset Signal
Count Pulse
Setting
Present
Counter contact
point output
2) Program Example
(1) If present value is the same as setting value due to count up by rising edge of the pulse of P00030 contact,
P00060 Output will be On.
(2) If P00030 contact is On at 11th time, P00060 Output will be Off and present value will be reset to 0.
[Ladder Program]
P00030
CTR C0010 10
P00031 C0010
R
C0010 P00060
[Time Chart]
P00031
P00030 Setting
C0005
P00060
4-47
Chapter 4 Details of Instructions
MOV, DMOV S D
MOVP, MOVP
P S D
means MOV/DMOV
[Area Setting]
Operand Description Data Type
S Data to transfer or device number data is saved in WORD/DWORD
D Device number to save data transferred WORD/DWORD
1) MOV (Move)
It transfers specified S device’s word data to D.
1word
S 0 1 0 0 1 0 0 1 0 0 1 0 1 0 1 1
D 0 1 0 0 1 0 0 1 0 0 1 0 1 0 1 1
3) Program Example
(1) Whenever P00020 is on, h00F3 data is moved to P0004 word by MOVP instruction
h00F3 0 0 0 0 0 0 0 0 1 1 1 1 0 0 1 1
P0004 0 0 0 0 0 0 0 0 1 1 1 1 0 0 1 1
4-48
-
P0002 P0001
1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 1 1 1 1 0 0 1 1 0 0 1 1
P0006 P0005
1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 1 1 1 1 0 0 1 1 0 0 1 1
Remark
1) If Timer or Counter is used by MOV instruction’s operand, applicable timer or counter’s present value (1 word) can be
read or changed.
4-49
Chapter 4 Details of Instructions
XGK XGB
4.11.2 MOV4, MOV4P, MOV8, MOV8P ○ ○
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
MOV4(P) S O - O - - - - O O O O - - -
3~5 - - -
MOV8(P) D O - O - - - - O O - - - - -
MOV4, MOV8 S D
MOV4P, MOV8P P S D
means MOV4/MOV8
[Area Setting]
Operand Description Data Type
S Data to transfer or bit position of device number data is saved in NIBBLE/BYTE
D Bit position of device number to save data transferred NIBBLE/BYTE
(1) Function
It transfers 4-bit or 8-bit data S to D.
MOV4(P) transfers higher 4-bit data from specified S bit to applicable area to higher 4-bit data from D.
MOV8(P) transfers higher 8-bit data from specified S bit to applicable area to higher 8-bit data from D. As for
integers to transfer, only the data as big as applicable instruction will be transferred with the other disregarded.
(2) Precautions
According to devices of Bit (P, M, L, K) and Word (D, R, U), Data will be differently processed. Bit device
takes other bits from the next word if Source S is out of word range during Instruction executed. If Destination
D’s area for saving exceeds the word, other bits will be saved also in the next word. If bit device’s last word has
been specified and instruction is to be executed including the next word, the process should be as described in
word device.
Word device if out of word range when Sourced S follows instruction, will fill the area exceeded with 0. And if
Destination D exceeds word, the exceeded data will not be processed.
4-50
-
4) Program Example
Where 4-Bit Data from P00004 is transferred to D0.2 ~ D0.5 by MOV4P Instruction whenever Input Signal
P00020 is On.
P00020
MOV4P P00004 D00000.2
Remark
1) Dxxx.x Rxxx.x Uxx.xx.x areas are not transferred to D+1 area but disregarded if MOV4, MOV8 instruction results
exceed the area.
4-51
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.11.3 CMOV, CMOVP, DCMOV, DCMOVP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
CMOV(P) S O O O O O - O - - O O O O O
2~4 O - -
DCMOV(P) D O - O O O - O - - - O O O O
CMOV, DCMOV S D
CMOVP, DCMOVP P S D
means CMOV/DCMOV
[Area Setting]
Operand Description Data Type
S Data to transfer or device number data is saved in WORD/DWORD
D Device number to save data transferred WORD/DWORD
S 0 1 0 0 1 0 0 1 0 0 1 0 1 0 1 1 Before
D 1 1 0 1 0 1 1 1 0 1 0 1 0 1 0 0 After
1word 1word
0 1 0 0 1 0 0 1 0 0 1 0 1 0 1 1 0 1 0 0 1 0 0 1 0 0 1 0 1 0 1 1 Before
S+1 S
After
1 1 0 1 0 1 1 1 0 1 0 1 0 1 0 0 1 1 0 1 0 1 1 1 0 1 0 1 0 1 0 0
D+1 D
4-52
-
3) Program Example
(1) If Input P00020 is On, it takes P00002 word data’s 1’s complement to transfer to P0006.
P00020
CMOV P0002 P0006
1 Word
S 0 1 1 0 1 0 1 1 0 0 1 0 1 0 1 1
( P0002)
D 1 0 0 1 0 1 0 0 1 1 0 1 0 1 0 0
CMOV execution ( P0006)
4-53
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.11.4 GMOV, GMOVP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
S O O O O O - O - - O O O O O
GMOV(P) D O - O O O - O - - - O O O O 4~6 O - -
N O - O - - - O - - O O O O O
GMOV GMOV S D N
GMOVP GMOVP S D N
[Area Setting]
Operand Description Data Size
S Data to transfer or device number data is saved in WORD
D Device number to save data transferred WORD
N Number to transfer in group (0 ~ 65536) WORD
[Flag Set]
Flag Description Device Number
To be set, if N’s range exceeds specified area. Applicable instruction result is not
Error F110
processed.
S h0002 D h0002
S+1 h0007 Group D+1 h0007
. h007F transfortation . h007F
N N
. .
. .
S+N-1 h005A D+N - 1 h005A
Word value
2) Program Example
(1) If Input Signal P00020 is On, D00000, D00001, D00002 word data is saved in P00004, P00005, P00006.
S(Source) D(Destination)
GMOV
D00000 h0001 h0001 P00004
Execute
D00001 h0004 h0004 P00005
N
D00002 h005F h005F P00006
(Before) (After)
4-54
-
FMOV FMOV S D N
FMOVP FMOVP S D N
[Area Setting]
[Flag Set]
2) Program Example
Whenever Input Signal P00020 is On, D00002 word data is saved in P0004, P0005, P0006.
FMOVP execution
D00002 h0098 h0098 P0004
Word h0098 P0005
Value
h0098 P0006
4-55
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.11.6 BMOV, BMOVP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
S O O O O O - O - - O O O O O
BMOV(P) D O - O O O O - - - O O O O O 4~6 O - -
Z - - - - - - O - - - O O O O
BMOV BMOV S D N
BMOVP BMOVP S D N
[Area Setting]
[Flag Set]
b15 b8 b0
0 1 0 0 1 0 0 1 0 0 0 0 0 1 1 0 h4906
S’s start bit D’s start bit Transmission number (Hex.: 10 -> h0A)
2) Program Example
Whenever Input Signal P00030 is On, 4-bit from the 0th bit in P0002 area will be saved in P0006 starting from
P0063 bit.
4-56
-
GBMOV GBMOV S D Z N
GBMOVP GBMOVP S D Z N
[Area Setting]
[Flag Set]
b15 b8 b0
0 0 0 1 0 0 1 1 0 0 0 0 0 1 0 0 h130A
S’s start bit D’s start bit Transmission number (Hex.: 10->h0A)
(2) If Z is h130A, it transmits S’s 10-bit data from the No.1 bit will be moved to D’s No.3 bit in regular order in
group.
(3) If area exceeded while executed, set Error Flag.
2) Program Example
(1) In case of D10000=h2408 and P1200=4 which is saved , If Intput contact P00000 is on, GBMOV instruction
will be executed.
(2) This example shows the group bit transmission. The transmitted data are sequentially saved in the 8-bit
data area of P1100 and bit 4 of P1100 receives bit 2 (b02) of P1000 first. 4 word data in the range of
P1000 to P1003 are moved to the range of P1100 to P1103 area in the same method.
P00000
GBMOV P1000 P1100 D10000 P1200
4-57
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.11.8 RMOV, RMOVP, LMOV, LMOVP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
RMOV(P) S O O O O O - O - - O O O O O
2~5 O - -
LMOV(P) D O - O O O - O - - - O O O O
RMOV, LMOV S D
RMOVP, LMOVP P S D
means RMOV/LMOV
[Area Setting]
Operand Description Data Type
S Data to transfer or device number data is saved in REAL/LREAL
D Device number to save data transferred REAL/LREAL
3) Program Example
(1) If input contact point P00000 is On, Long Real data 1.234 is saved in D1000 by Long Real data.
4-58
-
$MOV $MOV S D
$MOVP $MOVP S D
[Area Setting]
Operand Description Data Size
S String to transfer or device’s head number string is saved in STRING
D Device’s head number to save string transferred STRING
[Flag Set]
Flag Description Device Number
Error If out of S or D device’s range. F110
If NULL is saved in S+n’s lower byte, 0x00 will be saved in D+n’s higher byte.
b15 b8 b7 b0 b15 b8 b7 b0
S h42(B) h41(A) S h42(B) h41(A)
S+1 h44(D) h43(C) D+1 h44(D) h43(C)
h46(F) h00 D+2 h00 h00
S+2
Higher byte is not transferred. Higher byte of 0x00 is saved.
2) Program Example
(1) If input contact point P00000 is On, ‘string Data’ is saved in D2000.
4-59
Chapter 4 Details of Instructions
BCD, DBCD S D
BCDP, DBCDP S D
means BCD/DBCD
[Area Setting]
[Flag Set]
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
S: h270F 0 0 1 0 0 1 1 1 0 0 0 0 1 1 1 1
Convert to BCD
3 2 1 0 3 2 1 0 3 2 1 0 3 2 1 0
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
D: BCD 9999 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1
3 2 1 0
X10 X10 X10 X10
4-60
-
3) Error
(1) If BIN Data after converted to BCD exceeds the range displayed, it sets Error Flag(F110).
4) Program Example
(1) Where ‘h1111’ data which is saved in D00001 after converted to BCD is output to P0005 if Input Signal
P00020 is On.
P00020
BCD D00001 P0005
4-61
Chapter 4 Details of Instructions
[Example 4.12] Counter’s (Timer) External Output of Present Value [BCD, BMOV]
(1) Operation
If the warehouse keeps 30 products in stock, conveyer will stop and the number kept in stock will be displayed
out.
· 6
y 7
· Digital
Counter Adjusting S/W Output
· ·
(P00032) Counter Unit
· F
1 8 0
·
·
F
(3) Program
F00099
CTUD C0000 P00030 P00031 30
P00032 C0000
( R )
C0000 P0006F
( )
F00099
BCD C0000 M0000
4-62
-
BCD4, BCD8 S D
BCD4P, BCD8P P S D
means BCD4/BCD8
[Area Setting]
[Flag Set]
1) BCD4
(1) It converts specified S device’s 4-bit BIN data to (0~9) BCD4 and saves in specified D device area.
(2) Error Flag (F110) will be set if S value is other than (0~9).
2) BCD8
(1) It converts specified S device’s 8-bit BIN data to (0~9) BCD8 and saves in specified D device area.
(2) Error Flag (F110) will be set if S value is other than (0~99).
3) Program Example
(1) If P00000 is On, ‘9’s Nibble data will be BCD converted to ‘h9’ from P0200’s No. 4 bit.
(2) If P00001 is On, ‘99’s Byte data will be BCD converted to ‘h99’ from P0400’s No. 8 bit.
4-63
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.12.3 BIN, BINP, DBIN, DBINP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
BIN(P) S O O O O O - O - - O O O O O
2~4 O - -
DBIN(P) D O - O O O - O - - - O O O O
BIN, DBIN S D
BINP, DBINP S D
means BIN/DBIN
[Area Setting]
Operand Description Data Type
S Area Number or BCD Data BCD Data is saved in WORD/DWORD
D Area data converted to BIN is saved in WORD/DWORD
[Flag Set]
Flag Description Device Number
As for BIN(P), S’s data is other than BCD format (0~9999)
Error F110
As for DBIN(P), S+1,S’s data is other than BCD format (0~99999999)
1) BIN (Binary)
(1) It converts specified S device’s BCD data (0~9999) to BIN data and it is saved in D.
3 2 1 0 3 2 1 0 3 2 1 0 3 2 1 0
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
S: BCD 9999 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1
3 2 1 0
X 10 X 10 X 10 X 10
Convert to BIN
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
D: 0x270F 0 0 1 0 0 1 1 1 0 0 0 0 0 1 1 1
4-64
-
S : BCD 99999999
S+1 (Higher 4 places) S (Lower 4 places)
3 2 1 0 3 2 1 0 3 2 1 0 3 2 1 0
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1
7 6 5 4 3 2 1 0
x10 x10 x10 x10 x10 x10 x10 x10
Covert to BIN
31 16 15 3 2 1 0
2 2 2 2 2 2 2
0 0 0 0 0 1 0 1 1 1 1 1 0 1 0 1 1 1 1 0 0 0 0 0 1 1 1 1 1 1 1 1
3) Program Example
Where P0000 BCD data after converted to BIN data is saved in D0002 if Input Signal P00020 is On.
3 2 1 0 3 2 1 0 3 2 1 0 3 2 1 0
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
P0000 0 0 1 0 0 1 1 1 0 0 0 0 1 0 0 1 h2709
3 2 1 0
x10 x10 x10 x10
Convert to BIN
D0002 0 0 0 0 1 0 1 0 1 0 0 1 0 1 0 1 h0A95
4-65
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.12.4 BIN4, BIN4P, BIN8, BIN8P
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
BIN4(P) S O - O - - - - O O O O - - -
3~5 O - -
BIN8(P) D O - O - - - - O O - - - - -
BIN4, BIN8 S D
BIN4P, BIN8P P S D
means BIN4/BIN8
[Area Setting]
Operand Description Data Type
S Data to convert or bit position of device number data is saved in NIBBLE/BYTE
D Bit position of device number to save data converted NIBBLE/BYTE
[Flag Set]
Flag Description Device Number
As for BIN4(P), S’s device value is other than BCD format (0~9)
Error F110
As for BIN8(P), S’s device value is other than BCD format (0~99)
1) BIN4
(1) It converts specified S device’s 4-bit BCD data (0~9) to BIN4 and saves in D.
(2) Error Flag (F110) will be set if S’s value is other than BCD format (0~9).
2) BIN8
(1) It converts specified S device’s 8-bit BCD data (0~99) to BIN8 and saves in D.
(2) Error Flag (F110) will be set if S value is other than BCD format (0~99)
3) Program Example
(1) If Input signal P00000 is On, BCD data is converted and saved from P0200’s No.4 bit.
If Input signal P00001 is On, BCD data is converted and saved from P0400’s No.8 bit.
P00000
BIN4 h9 P02004
P00001
BIN8 h99 P04008
4-66
-
GBCD GBCD S D N
GBCDP GBCDP S D N
[Area Setting]
Operand Description Data Type
S Data to convert to BCD or Device number data is saved in WORD
D Device number to save BCD data converted WORD
N Total number of data to convert to BCD WORD
[Flag Set]
Flag Description Device Number
If one value among N data is other than 0~9999(h270F)
Error F110
To be Set if N’s range exceeds specified area
2) Program Example
(1) If Input signal P00000 is On, 5 word data from P1000~P1004 is Group BCD converted respectively
and saved in P1100~P1104 area.
Remark
1) In Basic Parameter with ‘Continue running when an arithmetic error occurs’, if 1 value among N data is other
than 0~9999, other data will not be converted to BCD nor operated.
4-67
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.12.6 GBIN, GBINP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
S O O O O O - - - - O O O O O
GBIN(P) D O - O O O - - - - - O O O O 4~6 O - -
N O - O O O - - - - O O O O O
GBIN GBIN S D N
GBINP GBINP S D N
[Area Setting]
Operand Description Data Type
S BCD Data to convert to BIN or Device number data is saved in WORD
D Device number to save BIN data converted WORD
N Total number of data to convert to BIN WORD
[Flag Set]
Flag Description Device Number
If one value among N data is other than BCD 0~9999.
Error F110
To be set if N’s range exceeds specified area
2) Program Example
(1) If Input signal P00000 is On, 5 word BCD data from P1000 to P1004 is Group BCD respectively
converted and saved in from P1100 to P1104 area.
P00000
GBIN P1000 P1100 5
Remark
1) In Basic Parameter with ‘Continue running when an arithmetic error occurs’, if any value among specified S’s
N datas is other than BCD format, all the n datas will not be operated.
4-68
-
I2R, I2L S D
I2RP, I2LP P S D
means I2R/I2L
[Area Setting]
Operand Description Data Type
S Area Number where Integer Data is saved, or Integer Data INT
D Device Position to save data converted to Real Data Format REAL/LREAL
3) Program Example
(1) If Input signal P0000 is On, It converts Integer ‘1234’ to Real and save in 2 word data area from D1200
to D1201.
P00000
12R 1234 D1200
4-69
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.13.2 D2R, D2RP, D2L, D2LP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
D2R(P) S O O O O O - - - - O O O O O
2~4 - - -
D2L(P) D O - O O O - - - - - O O O O
D2R, D2L S D
D2RP, D2LP P S D
means D2R/D2L
[Area Setting]
Operand Description Data Type
S Area Number where Double Integer Data is saved, or Double Integer Data DINT
D Device Position to save data converted to Real Data Format REAL/LREAL
3) Program Example
(1) In case of Double Integer data ‘812121’ is saved in 2 Word data area from P1000 to P1001, If Input
signal P00000 is On, Double Integer data ‘812121’ is converted to Real data in 2 Word area from P1100 to
P1101.
P00000
D2R P1000 P1100
.
4-70
-
R2I, R2D S D
R2IP, R2DP P S D
means R2I/R2D
[Area Setting]
Operand Description Data Type
S Area Number where Real number is saved, or Real number REAL
D Device Position to save data converted to Real Data Format INT/DINT
[Flag Set]
Flag Description Device Number
When R2I Instruction used and S specified Single Real Number is out of
-32,768~32,767 range.
Error F110
When R2D Instruction used and S specified Single Real Number is out of
-2,147,483,648 ~2,147,483,647 range.
(2) If S+1,S specified Real Number value exceeds -32,768~32,767 range, operation error occurs.
At this moment, the result of 32,767 will be saved if input value is bigger than 32,767, and -32,768 will be
saved if input value is smaller than -32,768.
(3) Value of below decimals is will be omitted after rounding off the nearest integer.
(2) If S+1,S specified Real Number’s value exceeds -2,147,483,648~2,147,483,647 range, operation error
occurs. At this moment, the result of 2,147,483,647 will be saved if Real value is bigger than 2,147,483,647, and
-2,147,483,648 will be saved if Real value is smaller than -2,147,483,648.
(3) Value of below decimals is will be omitted after rounding off the nearest integer.
4-71
Chapter 4 Details of Instructions
3) Error
(1) When R2I Instruction used and S specified Single Real Number is out of -32,768~32,767 range, operation error
occurs.
(2) When R2D Instruction used and S specified Single Real Number is out of -2,147,483,648~2,147,483,647 range,
operation error occurs.
4) Program Example
(1) If Input signal P00000 is On, Real data ‘45688.8123’ is converted to Interger data of ‘45689’ in 2 Word
from P1100 to P1101.
P00000
R2D 45688.8123 P1100
4-72
-
L2I, L2D S D
L2IP, L2DP P S D
means L2I/L2D
[Area Setting]
Operand Description Data Type
S Area Number where Long Real Data is saved, or Long Real Data LREAL
D Device Position to save data converted to IntegerData Format INT/DINT
[Flag Set]
Flag Description Device Number
In case of L2I Instruction used and S specified Real Number is out of -32,768~32,767
range.
Error F110
In case of L2D Instruction used and S specified Real Number is out of -2,147,483,648
~2,147,483,647 range.
(2) If S+3,S+2,S+1,S specified Long Real Number’s value exceeds -32,768 ~ 32,767 range, operation error
occurs. At this moment, the result of 32,767 will be saved if input value is bigger than 32,767, and -32,768 will
be saved if input value is smaller than -32,768.
(3) Value of below decimals is will be omitted after rounding off the nearest integer.
(2) If S+3,S+2,S+1,S specified Real Number’s value exceeds -2,147,483,648 ~ 2,147,483,647 range, operation
error occurs. At this moment, the result of 2,147,483,647 will be saved if Real value is bigger than
2,147,483,647, and -2,147,483,648 will be saved if Real value is smaller than -2,147,483,648.
(3) Value of below decimals is will be omitted after rounding off the nearest integer.
4-73
Chapter 4 Details of Instructions
3) Program Example
(1) In case of Long Real data from D1000~D1003=13456.6 is saved, If Input signal P0000 is On, Integer
data of 13457 is converted and it is saved in P1100.
P00000
L2I D1000 P1100
4-74
-
R2L S D
R2LP P S D
means R2L
[Area Setting]
Operand Description Data Type
S Area Number where Real Data is saved, or Long Real Data REAL
D Area Number where Long Real Data is saved, or Long Real Data LREAL
[Flag Set]
Flag Description Device Number
To be set, in case of FPU operation error flag F0057E, F0057C, F0057B, F0057A are
Error F110
Set.
2) Error
It doesn’t occur operation errors except input data is not Real number.
3) Program Example
4-75
Chapter 4 Details of Instructions
XGK XGB
○ X
4.13.6 L2R, L2RP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
S O O O O O - - - - O O O O O
L2R(P) 2~4 O - -
D O - O O O - - - - - O O O O
L2R S D
L2RP P S D
means L2R
[Area Setting]
Operand Description Data Type
S Area Number where Long Real Data is saved, or Long Real Data LREAL
D Area Number where Real Data is saved, or Long Real Data REAL
[Flag Set]
Flag Description Device Number
To be set, in case of FPU operation error flag F0057E, F0057C, F0057B, F0057A are
Error F110
Set.
2) If S+3,S+2,S+1,S specified Long Real Number’s value exceeds Real Number’s range, operation error
occurs. Long Real Number’s range is | 2-1022 to 21023 | , Real Number’s range is | 2-126 to 2127 |.
3) Program Example
(1) In case of Long Real data from D1000~D1003=13456.6 is saved, If Input signal P0000 is On, Real data of
13456.6 is converted and it is saved in P1100.
4-76
-
XGK XGB
○ X
4.13.7 U2R, U2RP, U2L, U2LP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
U2R(P) S O O O O O - - - - O O O O O
2~4 - - -
U2L(P) D O - O O O - - - - - O O O O
COMMAND
U2R, U2L
COMMAND
U2RP, U2LP P
means U2R/U2L
[Area Setting]
Operand Description Data type
S Area number where unsigned integer data is saved, or unsigned inter data UINT
3) Program example
Input signal P00000 is on, unsigned data of 1234 is converted to real data and it is saved in
D1200~D1201.
4-77
Chapter 4 Details of Instructions
XGK XGB
4.13.8 UD2R, UD2RP, UD2L, UD2LP ○ X
COMMAND
UD2R, UD2L S D
COMMAND
UD2RP, UD2LP P
means UD2R/UD2L
[Area Setting]
Operand Description Data type
S Area number where double unsigned integer data is saved, or unsigned inter data UDINT
D Area number where changed real data is saved REAL/LREAL
3) Program example
In case ‘812121’ is saved in P1000~P1001, if input signal P0000 is on, converted real data is saved in
P1100~P1101.
4-78
-
COMMAND
R2UP, R2UDP P S D
means R2U/R2UD
[Area Setting]
Operand Description Data type
S Area number where real data is saved, or real data REAL
D Area number where converted unsigned integer data is saved UINT/UDINT
[Flag setting]
Device
Flag Description
number
In case of using R2U, when short real data set by S exceeds 0~65,535
Error F110
In case of using R2UD, when short real data set by S exceeds 0~4,294,967,295
(2) In case short real data set by S+1, S exceeds 0~65,535, operation error occrs. At this time, in case result
value is larger than 65,535, 65,535 is saved and in case result value is smallter than 0, 0 is saved.
(3) The value under decimal point is ignored
(2) In case short real data set by S+1, S exceeds 0~4,294,967,295, operation error occurs. At this time, in case
result value is larger than 65,535, 65,535 is saved and in case result value is smallter than 0, 0 is saved.
(3) The value under decimal point is ignored
4-79
Chapter 4 Details of Instructions
3) Error
(1) In case of using R2U, when short real data set by S exceeds 0~65,535, operation error (F110) occurs.
(2) In case of using R2UD, when short real data set by S exceeds 0~4,294,967,295, operation error (F110)
occurs.
4) Program example
If input signal P00000 is on, converts real data ‘45688.8123’ to interger data and saves ‘45689’ in P1100~P1101.
4-80
-
[Area Setting]
Operand Description Data type
S Area number where long real data is saved, or long real data LREAL
D Area number where converted unsigned data is saved UINT/UDINT
[Flag setting]
Device
Flag Description
number
In case of using L2U, when long real data set by S exceeds 0~65,535
Error F110
In case of using L2UD, when long real data set by S exceeds 0~4,294,967,295
(2) In case short real data set by S+3, S+2, S+1, S exceeds 0~65,535, operation error occrs. At this time, in
case result value is larger than 65,535, 65,535 is saved and in case result value is smallter than 0, 0 is saved.
(3) The value under decimal point is ignored
(2) In case short real data set by S+3, S+2, S+1, S exceeds 0~4,294,967,295, operation error occrs. At this time,
in case result value is larger than 65,535, 65,535 is saved and in case result value is smallter than 0, 0 is saved.
(3) The value under decimal point is ignored
3) Program example
In case D1000~D1003=13456.6 long real type data is saved, if input signal P00000 is on, 13457 integer data is
saved in P1100.
4-81
Chapter 4 Details of Instructions
CMP, DCMP S1 S2
CMPP, DCMPP P S1 S2
means CMP/DCMP
[Area Setting]
Operand Description Data Type
S1 Data or Data address to compare with S2 WORD/DWORD
S2 Data or Data address to compare with S1 WORD/DWORD
1) CMP (Compare)
(1) It compares S1 with S2 in size to set applicable flag of 6 special relays as its result.
(Unsigned Operation)
2) Program Example
(1) In case of P1000=100 and P1100=10, If Input signal P00000 is On, F123 is set because P1000 is
bigger than P1100 (P1000>P1100).
P00000
CMP P1000 P1100
4-82
-
XGK XGB
4.14.2 CMP4, CMP4P, CMP8, CMP8P ○ ○
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
CMP4(P) S1 O - O - - - - O O O O - O O
2~4 - - -
CMP8(P) S2 O - O - - - - O O O O - O O
CMP4, CMP8 S1 S2
CMP4P, CMP8P P S1 S2
means CMP4/CMP8
[Area Setting]
Operand Description Data Type
S1 Data to compare or device’s start bit to compare NIBBLE/BYTE
S2 Data to compare or device’s start bit to compare NIBBLE/BYTE
3) Program Example
(1) In case of P01004=10 and P02008=15, If Input signal P00000 is On, F120 of Flag is set because P01004
is smaller than P02008.
(2) Range possible to compare is a unit of Nibble, so Setting is available from 0 to 15.
(3) It is only compare the value which is saved from No. 4 bit of P0100 to the value which is saved from No. 8
of P0200.
P00000
CMP4 P01004 P02008
4-83
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.14.3 TCMP, TCMPP, DTCMP, DTCMPP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
S1 O O O O O - O O O O O O O O
TCMP(P)
S2 O O O O O - O O O - O O O O 4~6 O - -
DTCMP(P)
D O - O O O - O O O - O O O O
TCMP, DTCMP S1 S2 D
TCMPP, DTCMPP P S1 S2 D
means TCMP/DTCMP
[Area Setting]
Operand Description Data Type
S1 Data or Data address to compare with S2 WORD/DWORD
S2 Data address to compare with S1 WORD/DWORD
D Area (1 Word) to save the result of compared S1 and S2 WORD/DWORD
[Flag Set]
Flag Description Device Number
Error The value of ‘S2 area + 15 (WORD/DWORD)’ is exceeded range of applicable device. F110
2) Program Example
(1) If Input Signal P00020 is On, It is compare Data ‘h0057’ saved in D0000 to 16-word data from D0002.
And compared result ‘5’ is saved in P0006.
4-84
-
[Area Setting]
Operand Description Data Type
S1 Data or Data address to compare with S2 WORD
S2 Data address to compare with S1 WORD
D Device area to save the result (1 word) WORD
N Number to execute Compare Instruction (0 ~ 16) WORD
[Flag Set]
Flag Description Device Number
Error If N value exceeds applicable device’s area. F110
S1+(N-2) 1234
S1+(N-1) 5678
2) Program Example
Operation Result
D1000 1234 D1100 1234 D1200 h00FF
D1001 5678 D1101 5678
D1002 5000 D1102 5000
8 = 8
If Input signal P0000 is On, it compare 8-word data and compared result h00FF is saved in D1200.
P00000
GEQ D1000 D1100 D1200 8
4-85
Chapter 4 Details of Instructions
LOAD(D) X S1 S2
means LOAD(D) X
[Area Setting]
Operand Description Data Type
S1 Data or Data address to compare with S2 INT/DINT
S2 Data or Data address to compare with S1 INT/DINT
(2) Comparison of S1 and S2 is executed by Signed Operation. Thus, the result will be as follows;
h8000( -32768) ~ hFFFF( -1) < 0 ~ h7FFF( 32767) .
(2) Comparison of S1 and S2 is executed by Signed Operation. Thus, the result will be as follows;
h80000000(-2147483648) ~ hFFFFFFFF( -1) < 0 ~ h7FFFFFFF(2147483647).
3) Program Example
(1) In case of D1000=10 and D2000=10, Compare Input Signal is On and then h1500 is saved in P0160
area.
4-86
-
AND(D) X S1 S2
means AND(D) X
[Area Setting]
Operand Description Data Type
S1 Data or Data address to compare with S2 INT/DINT
S2 Data or Data address to compare with S1 INT/DINT
(2) Comparison of S1 and S2 is executed by Signed Operation. Thus, the result will be as follows;
h8000( -32768) ~ hFFFF( -1) < 0 ~ h7FFF( 32767) .
3) Program Example
(1) In case of D1000=10 and D2000=10, If Input Signal P00000 is On, AND logic operation will be operated with the
compared result of ‘On’ status of Compare Input Signal and then ‘1500’ is saved in P1600 area.
P00000
= D1000 D2000 MOV 1500 P1600
4-87
Chapter 4 Details of Instructions
XGK XGB
4.15.3 OR X, ORD X ○ ○
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
OR X S1 O O O O O - O - - O O O O O
2~3 - - -
ORD X S2 O O O O O - O - - O O O O O
OR(D) X
S1 S2
means OR(D) X
[Area Setting]
Operand Description Data Type
S1 Data or Data address to compare with S2 INT/DINT
S2 Data or Data address to compare with S1 INT/DINT
3) Program Example
(1)If Input Signal P00000 becomes On or ‘=’ Compare Input Signal becomes On because D1000=10 and D2000=10,
1500 is saved in P1600.
P00000
MOV 1500 P1600
= D1000 D2000
4-88
-
LOADR X S1 S2
LOADL X
means LOADR X / LOADL X
[Area Setting]
Operand Description Data Type
S1 Real Number Data to compare or Device Number to specify Real Number Data REAL/LREAL
S2 Real Number Data to compare or Device Number to specify Real Number Data REAL/LREAL
(1) It compares S1 with S2. And if identical to X Condition, present operation result will be On.
X Condition Condition Operation result
= S1 = S2 On
<= S1 ≤ S2 On
>= S1 ≥S2 On
<> S1 ≠ S2 On
< S1 < S2 On
> S1 > S2 On
S1 and S2 as long floating decimal real number will be compared for operation based on X Condition.
Be sure that X Condition R= used. The value of floating decimal real number depends on accuracy.
3) Program Example
(1) In case of D1000=1.5 and D2000=1.5, Real ‘=’ Compare Input Signal is On and then 1234 is saved in
P1600.
4-89
Chapter 4 Details of Instructions
XGK XGB
4.15.5 ANDR X, ANDL X ○ ○
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
ANDR X S1 O O O O O - O - - O O O O O
2~5 - - -
ANDL X S2 O O O O O - O - - O O O O O
ANDR X S1 S2
ANDL X
means ANDR X / ANDL X
[Area Setting]
Operand Description Data Type
S1 Real Number Data to compare or Device Number to specify Real Number Data REAL/LREAL
S2 Real Number Data to compare or Device Number to specify Real Number Data REAL/LREAL
3) Program Example
(1) If Real ‘=’ Compare Input Signal is On since Input signal P00000 becomes On and D1000=1.5 and
D2000=1.5, the result of AND operation becomes On and then 1234 is saved in P1600.
P00000
R = P1000 P2000 MOV 1234 P1600
4-90
-
ORR X
ORL X
S1 S2
3) Program Example
(1) If Real ‘=’ Compare Input Signal is On since Input signal P00000 becomes On and D1000=1.21 and
D2000=1.21, 1234 is saved in P1600.
P00000
MOV 1234 P1600
R = D1000 D2000
4-91
Chapter 4 Details of Instructions
XGK XGB
4.15.7 LOAD$ X ○ ○
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
S1 O O O O O - O - - O O O O O
LOAD$ X 2~17 - - -
S2 O O O O O - O - - O O O O O
LOAD$ X S1 S2
means LOAD$ X
[Area Setting]
Operand Description Data Type
S1 String to compare or Device Number string is saved in STRING
S2 String to compare or Device Number string is saved in STRING
(1) Refer to below table, The compare results becomes On when character code is identical.
b15 b8 b7 b0 b15 b8 b7 b0
S1 42H (B) 41H (A) S2 42H (B) 41H (A)
S1+1 44H (D) 43H (C) = S2+1 44H (D) 43H (C)
S1+2 00H 45H (E) S2+2 00H 45H (E)
"ABCDE" "ABCDE"
(2) Character code is compared with Hexadecimal number. According to the compared result, the status will be
changed On or Off.
(However, front place of string and length is preferred potentially)
2) Program Example
(1) In case of the string which is respectively saved D1000=‘English’ and D2000=‘English’, string Compare
Input Signal becomes On, ‘3456’ is saved in P1600.
4-92
-
AND$ X S1 S2
means AND$ X
[Area Setting]
Operand Description Data Type
S1 String to compare or Device Number string is saved in STRING
S2 String to compare or Device Number string is saved in STRING
b15 b8 b7 b0 b15 b8 b7 b0
S1 42H (B) 41H (A) S2 42H (B) 41H (A)
S1+1 44H (D) 43H (C) = S2+1 44H (D) 43H (C)
S1+2 00H 45H (E) S2+2 00H 45H (E)
"ABCDE" "ABCDE"
(2) Character code is compared with Hexadecimal number. According to the compared result, the status will be
changed On or Off.
(However, front place of string and length is preferred potentially)
(3) And its result and present operation result will be AND operated to lead to a new operation result.
2) Program Example
(1) In case of P00000 becomes On and saved string is respectively D1000=’English’ and D2000=’English’,
string Compare Input Signal becomes On and AND operation calculates and then 1567 is saved in
P1600.
P00000
$ = D1000 D2000 MOV 1567 P1600
4-93
Chapter 4 Details of Instructions
XGK XGB
4.15.9 OR$ X ○ ○
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
S1 O O O O O - O - - O O O O O
OR$ X 2~17 - - -
S2 O O O O O - O - - O O O O O
OR$ X
S1 S2
means OR$ X
[Area Setting]
Operand Description Data Type
S1 String to compare or Device Number string is saved in STRING
S2 String to compare or Device Number string is saved in STRING
b15 b8 b7 b0 b15 b8 b7 b0
S1 42H (B) 41H (A) S2 42H (B) 41H (A)
S1+1 44H (D) 43H (C) = S2+1 44H (D) 43H (C)
S1+2 00H 45H (E) S2+2 00H 45H (E)
"ABCDE" "ABCDE"
2) Program Example
(1) Input Signal P00000 becomes On or saved string becomes respectively D1000=‘English2’ and
D2000=‘English2’ string Compare Input Signal becomes On and then ‘1234’ is saved in P1700.
P00000
MOV 1234 P1700
$ = D1000 D2000
4-94
-
LOADG X LOADGX S1 S2 N
[Area Setting]
Operand Description Data Type
S1 Data or Data address to compare with S2 INT/DINT
S2 Data or Data address to compare with S1 INT/DINT
N Number of groups to compare WORD
[Flag Set]
Flag Description Device Number
Error If N value exceeds applicable device’s area. F110
(1) It compares S1 with S2 for the number of N. And if all identical to X Condition, present operation result will be On.
Comparison of S1 and S2 is executed by Signed Operation. Thus, the result will be as follows; h8000( -32768) ~
hFFFF( -1) < 0 ~ h7FFF( 32767) .
(1) It compares S1 with S2 for the number of N. And if all identical to X Condition, present operation result will be On.
Comparison of S1 and S2 is executed by Signed Operation. Thus, the result will be as follows; h80000000(-
2147483648) ~ hFFFFFFFF( -1) < 0 ~ h7FFFFFFF(2147483647).
4-95
Chapter 4 Details of Instructions
3) Program Example
(1) It compares the 8-word data from D1000 to D1007 with 8-word data from D1100 to D1107 in the group.
And if identical to operation result, Compare Input Signal becomes On and the 1300 is saved in P1400.
(2) In case of comparison of group, If only one is not identical in operation result, Compare Input Signal will
not become On.
4-96
-
ANDG X ANDGX S1 S2 N
[Area Setting]
Operand Description Data Type
S1 Data or Data address to compare with S2 INT
S2 Data or Data address to compare with S1 INT
N Number of groups to compare WORD
[Flag Set]
Flag Description Device Number
Error If N value exceeds applicable device’s area. F110
3) Program Example
(1) Input Signal becomes On and then P1000=10,P1001=20, P2000=5 and P2001=10, It compares 2-
word data by group and if result of comparison is On, 1500 saved in P1600.
P00000
G > P1000 P2000 2 MOV 1500 P1600
4-97
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.15.12 ORG X, ORDG X
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
S1 O O O O O - O - - O O O O O
ORG X
S2 O O O O O - O - - O O O O O 4/5 O - -
ORDG X
N O - O O O - O - - O O O O O
ORG X
ORGX S1 S2 N
means ORG X
[Area Setting]
Operand Description Data Type
S1 Data or Data address to compare with S2 INT
S2 Data or Data address to compare with S1 INT
N Number of groups to compare WORD
[Flag Set]
Flag Description Device Number
Error If N value exceeds applicable device’s area. F110
P00000
MOV P1500 P1600
4-98
-
LOAD(D)3 X S1 S2 S3
means LOAD(D)3 X
[Area Setting]
Operand Description Data Type
S1 Data to compare or Device Number to specify Data to compare INT
S2 Data to compare or Device Number to specify Data to compare INT
S3 Data to compare or Device Number to specify Data to compare INT
3) Program Example
(1) In case of D1000=100, _D1200=100 and _D1300=100, All three data of word data is identical so
Compare Input Signal becomes On and then 1,234 is saved in P1500.
4-99
Chapter 4 Details of Instructions
XGK XGB
4.15.14 AND3 X, ANDD3 X ○ ○
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
S1 O O O O O - O - - O O O O O
AND3 X
S2 O O O O O - O - - O O O O O 4/5 - - -
ANDD3 X
S3 O O O O O - O - - O O O O O
AND(D)3 X S1 S2 S3
means AND(D)3 X
[Area Setting]
Operand Description Data Type
S1 Data to compare or Device Number to specify Data to compare INT
S2 Data to compare or Device Number to specify Data to compare INT
S3 Data to compare or Device Number to specify Data to compare INT
3) Program Example
(1) Input Signal P00000 becomes On and D1000=100, _D1200=100 and _D1300=100, three data of word data is
identical so Compare Input Signal becomes On and then 1,234 is saved in P1500.
P00000
3 = D1000 D1200 D1300 MOV 1234 P1500
4-100
-
OR3(D) X
S1 S2 S3
means OR3(D) X
[Area Setting]
Operand Description Data Type
S1 Data to compare or Device Number to specify Data to compare INT
S2 Data to compare or Device Number to specify Data to compare INT
S3 Data to compare or Device Number to specify Data to compare INT
3) Program Example
(1) Input Signal P00000 becomes On or Word data becomes D1000=100, _D1200=100, _D1300=100 and then if
Word data is identical, Compare Input Signal becomes On and then 1234 is saved in P1600.
P00000
MOV 1234 P1600
4-101
Chapter 4 Details of Instructions
[Area setting]
Operand Description Data Type
S1 Data or data address to compare with S2 NIBBLE/BYTE
S2 Data or data address to compare with S1 NIBBLE/BYTE
3) Program example
(1) In case of D01000.0=10, D02000.0=10, compare input signal is turned On and it saves h1500 at P0160 area.
(2) In case of D01000.0=255, D02000.0=255, compare input signal is turned On and it saves h0015 at P0160
area.
4-102
-
[Area Setting]
Operand Description Data Type
S1 Data or data address to compare with S2 NIBBLE/BYTE
S2 Data or data address to compare with S1 NIBBLE/BYTE
3) Program example
(1) In case of D01000.5=10, D02000.5=10, if input signal P00000 is turned On, it takes AND operation of
compare input on result and save 1500 at P1600 area
(2) In case of D01000.5=255, D02000.5=255, if input signal P00000 is turned On, it takes AND operation of
compare input on result and save 1500 at P1600 area
4-103
Chapter 4 Details of Instructions
[Area Setting]
Operand Description Data Type
S1 Data or data address to compare with S2 NIBBLE/BYTE
S2 Data or data address to compare with S1 NIBBLE/BYTE
(2) In case of D01000.5=255, D02000.5=255, if input signal P00000 is turned On, it takes OR operation of
compare input on result and save 1500 at P1600 area
4-104
-
ULOAD(D) X S1 S2
means ULOAD(D) X
[Area Setting]
Operand Description Data type
S1 Data or Data address to compare with S2 UINT/UDINT
S2 Data or Data address to compare with S1 UINT/UDINT
3) Program example
In case of D1000=10 and D2000=10, Compare Input Signal is On and then h1500 is saved in P0160
area.
4-105
Chapter 4 Details of Instructions
XGK XGB
4.15.20 UAND X, UANDD X ○ X
Command
UAND(D) X S1 S2
means UAND(D) X
[Area Setting]
Operand Description Data type
S1 Data or data address to compare with S2 UINT/UDINT
S2 Data or data address to compare with S1 UINT/UDINT
3) Program example
In case of D1000=10 and D2000=10, If Input Signal P00000 is On, AND logic operation will be operated with the
compared result of ‘On’ status of Compare Input Signal and then ‘1500’ is saved in P1600 area.
P00000
U== D1000 D2000 MOV 1500 P1600
4-106
-
Command
UOR(D) X
means UOR(D) X
[Area Setting]
Operand Description Data type
S1 Data or Data address to compare with S2 UINT/UDINT
S2 Data or Data address to compare with S1 UINT/UDINT
3) Program example
If Input Signal P00000 becomes On or ‘=’ Compare Input Signal becomes On because D1000=10 and D2000=10,
1500 is saved in P1600.
P00000
MOV 1500 P1600
U == D1000 D2000
4-107
Chapter 4 Details of Instructions
Command
INC, DINC D
Command
INCP, DINCP P D
means INC/DINC
[Area Setting]
Operand Description Data Type
D Data address to perform operation. INT
1) INC (Increment)
(1) It saves the result of D plus 1 again in D.
(2) It performs Signed Operation.
3) Flag Process
(1) As for INC/DINC Instruction, no flag will be processed by operation result.
4) Program Example
(1) If Input Signal P00001 Off status is changed to On status, 5678 adds 1 and then 5679 which is added
result saved in P1100. When P00001 is repeated Off and On status, the value saved in P1100 is increased
one.
(5678 -> 5679 -> 5680 -> 5681, ...)
P1100 P1100
b15 b0 b15 b0
5678 +1 5679
4-108
-
Command
INC4, INC8 D
Command
INC4P, INC8P P D
means INC4/INC8
[Area Setting]
Operand Description Data Type
D Data address to perform operation. NIBBLE/BYTE
3) Flag Process
(1) As for INC/DINC Instruction, no flag will be processed by operation result. Carry Flag (F112) is not generated
when Maximum value is increased 1.
4) Program Example
(1) If Input Signal P00000 is changed On from Off status, the result 2 which is the saved value 1 from No. 4 Bit of
P0100 plus 1 is saved in No.4 Bit of P0100 by Nibble unit. When P00001 is repeated On from Off status the value
which is saved in P0100 is increased 1 (h0015 -> h0025 -> h0035 -> h0045).
P0100 P0100
b15 b0 b15 b0
h0015 +1 h0025
P00000
INC4P P01004
4-109
Chapter 4 Details of Instructions
XGK XGB
4.16.3 DEC, DECP, DDEC, DDECP ○ ○
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
DEC(P)
D O - O O O - O - - - O O O O 2/3 - - -
DDEC(P)
Command
DEC, DDEC D
Command
DECP, DDECP P D
means DEC/DDEC
[Area Setting]
Operand Description Data Type
D Data address to perform operation. INT
1) DEC (Decrement)
(1) It saves the result of D minus 1 again in D.
(2) D is processed as Signed Integer.
b15 b0 b15 b0
DEC
S 1 2 3 4 -1
S 1 2 3 3
3) Flag Process
(1) As for INC/DINC Instruction, no flag will be processed by operation result. Carry Flag (F112) is not generated
when Minimum value is decreased 1.
4) Program Example
(1) If Input Signal P00000 is changed to On from Off status, the result 1233 of 1234 minus 1 is saved in P1000.
When P00000 is repeated On from Off status the value which is saved in P1000 is decreased 1 (1234->1233-
>1232->1231->1230…..).
P0100 P0100
b15 b0 b15 b0
1234 -1 1233
P00000
DECP P1000
4-110
-
Command
DEC4, DEC8 D
Command
DEC4P, DEC8P P D
means DEC4/DEC8
[Area Setting]
Operand Description Data Type
D Data address to perform operation. NIBBLE/BYTE
3) Flag Process
(1) As for INC/DINC Instruction, no flag will be processed by operation result. Carry Flag (F112) is not generated
when Minimum value is decreased 1.
4) Program Example
(1) If Input Signal P00000 is changed On from Off status, the result 6 of the value 7 which is saved from No. 4
Bit in P0100 minus 1 is saved from No.4 Bit in P0100. When P00000 is repeated On from Off status the value
which is saved in P1000 is decreased 1. (h0075 -> h0065 -> h0055 -> h0045 -> h0035…).
P0100 P0100
b15 b0 b15 b0
h0075 -1 h0065
P00000
DEC4P P01004
4-111
Chapter 4 Details of Instructions
XGK XGB
4.16.5 INCU, INCUP, DINCU, DINCUP ○ ○
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
INCU(P)
D O - O O O - O - - - O O O O 2/3 O O O
DINCU(P)
Command
INCU, DINUC D
Command
INCUP, DINCUP P D
means INCU/DINCU
[Area Setting]
Operand Description Data Type
D Data address to perform operation. WORD
[Flag Set]
Flag Description Device Number
To be set if INCU(P) is executed when D is 32767(h7FFF).
Error F110
To be set if DINCU(P) is executed when D is 2147483647(h7FFFFFFF).
Zero To be set if (D)INCU(P) is executed when D is –1(FFFF or FFFFFFFF). F111
Carry To be set if (D)INCU(P) is executed when D is –1(FFFF or FFFFFFFF). F112
1) INCU (Increment)
(1) It saves the result of D plus 1 again in D.
(2) It performs Unsigned Operation.
(3) If INCU(P) is executed when D’s value is 65,535 (h7FFF), 0(h0000) will be output and Zero Flag and Carry Flag
will be set.
3) Program Example
(1) In case of P1000=100, When Input Signal P00000 is changed to On from Off status, the value saved in P1000 is
increased 1.
P00000
INCUP P1000
Remark
(1) INC(P), DINC(P), DEC(P), DDEC(P) Instructions used in MK series to perform Unsigned Operation have been
changed in XGK as shown below. If Increase/Decrease Instructions have been used in previous program
version of XGK, see below to modify the data.
INC(P) Æ INCU(P) DEC(P) Æ DECU(P)
DINC(P) Æ DINCU(P) DDEC(P) Æ DDECU(P)
4-112
-
Command
DECU, DDECU D
Command
DECPU, DDECUP P D
means DECU/DDECU
[Area Setting]
Operand Description Data Type
D Data address to perform operation. WORD
[Flag Set]
Flag Description Device Number
Zero To be set if (D)DEC(P) is executed when D is 1. F111
Carry To be set when D is 0 ~ hFFFF. F112
1) DECU (Decrement)
(1) It saves the result of D minus 1 and it save in D again.
(2) D is processed as Unsigned operation.
(3) If DECU(P) is executed when D is 0(h0000), 65,535(hFFFF) will be output and Carry Flag will be set.
(4) If (D)DECU(P) is executed when D is 1, 0 will be output and Zero Flag will be set.
3) Program Example
(1) If P1000=100, When Input Signal P00000 is repeated changing to On from Off status, the saved value in P1000 is
decreased 1.
P00000
DECUP P1000
4-113
Chapter 4 Details of Instructions
Command
ROL, DROL D n
Command
ROLP, DROLP P D n
means ROL/DROL
[Area Setting]
Operand Description Data Type
D Data address to perform operation. WORD/DWORD
n Number of bits to rotate to the left. WORD
[Flag Set]
Flag Description Device Number
Carry If Carry is caused during rotation, Carry Flag will be set. F112
0 0 0 0 0 0 0 0 0 0 1 0 1 1 0 0 1
Rotation to the left
3) Program Example
(1) In case of P1000=h1234, when Input signal P00000 is changed to On from Off status, It rotates 4 bits to
the left bit by bit and then h2341 will be saved in P1000.
P00000
ROLP P1000 4
4-114
-
Command
ROL4, ROL8 D n
Command
ROL4P, ROL8P P D n
means ROL4/ROL8
[Area Setting]
Operand Description Data Type
D Data address to perform operation. NIBBLE/BYTE
n Number of bits to rotate to the left. WORD
[Flag Set]
Flag Description Device Number
Carry If Carry is caused during rotation, Carry Flag will be set. F112
3) Program Example
(1) In case of P01004~P01007=h3, when Input Signal P00000 is changed to On from Off status, It rotates 2 bits to
the left bit by bit, and then ‘hc’ will be saved in P01004~P01007.
P00000
ROL4P P01004 2
4-115
Chapter 4 Details of Instructions
XGK XGB
4.17.3 ROR, RORP, DROR, DRORP ○ ○
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
ROR(P) D O - O O O - O - - - O O O O
2~4 - - O
DROR(P) n O - O O O - O - - O O O O O
Command
ROR, DROR D n
Command
RORP, DRORP P D n
means ROR/DROR
[Area Setting]
Operand Description Data Type
D Data address to perform operation. WORD/DWORD
n Number of bits to rotate to the left. WORD
[Flag Set]
Flag Description Device Number
Carry If Carry is caused during rotation, Carry Flag will be set. F112
0 0 0 0 0 0 0 0 0 1 0 1 1 0 0 1 0
Rotation to the right
3) Program Example
(1) In case of P1000=h1234, Input Signal P00000 is changed to On from Off status, It rotates 4 bits to the right bit by
bit and then h4123 is saved in P1000.
P00000
RORP P1000 4
4-116
-
Command
ROR4, ROR8 D n
Command
ROR4P, ROR8P P D n
means ROR4/ROR8
[Area Setting]
Operand Description Data Type
D Data address to perform operation. NIBBLE/BYTE
n Number of bits to rotate to the left. WORD
[Flag Set]
Flag Description Device Number
Carry If Carry is caused during rotation, Carry Flag will be set. F112
3) Program Example
(1) In case of P01004=h00C3, Input Signal P00000 is changed to On from Off status, It rotates 2 Bits to the
right bit by bit and then h0033 is saved in P01004.
P00000
ROR4P P01004 2
4-117
Chapter 4 Details of Instructions
XGK XGB
4.17.5 RCL, RCLP, DRCL, DRCLP ○ ○
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
RCL(P) D O - O O O - O - - - O O O O
2~4 - - O
DRCL(P) n O - O O O - O - - O O O O O
Command
RCL, DRCL D n
Command
RCLP, DRCLP P D n
means RCL/DRCL
[Area Setting]
Operand Description Data Type
D Data address to perform operation. WORD/DWORD
n Number of bits to rotate to the left. WORD
[Flag Set]
Flag Description Device Number
Carry If Carry is caused during rotation, Carry Flag will be set. F112
0 0 0 0 0 0 0 0 0 0 1 0 1 1 0 0 1
Rotation to the right
3) Program Example
(1) In case of P1000=hF000, when Input Signal is changed to On from Off status, It rotates 4 bits to the left bit
by bit and then hE00 is saved in P1000 and Carry Flag will be set.
P00000
RCLP P1000 4
4-118
-
Command
RCL4, RCL8 D n
Command
RCL4P, RCL8P P D n
means RCL4/RCL8
[Area Setting]
Operand Description Data Type
D Data address to perform operation. NIBBLE/BYTE
n Number of bits to rotate to the left. WORD
[Flag Set]
Flag Description Device Number
Carry If Carry is caused during rotation, Carry Flag will be set. F112
3) Program Example
(1) In case of P0100c~P0100F=’hF’, Input Signal P00000 is changed to On from Off status, It rotates 4 bits to the left.
hE000 will be saved in P0100 and Carry Flag will be set.
P00000
RCL4P P0100C 4
4-119
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.17.7 RCR, RCRP, DRCR, DRCRP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
RCR(P) D O - O O O - O - - - O O O O
2~4 - - O
DRCR(P) n O - O O O - O - - O O O O O
Command
RCR, DRCR D n
Command
RCRP, DRCRP P D n
means RCR/DRCR
[Area Setting]
Operand Description Data Type
D Data address to perform operation. WORD/DWORD
n Number of bits to rotate to the right. WORD
[Flag Set]
Flag Description Device Number
Carry If Carry is caused during rotation, Carry Flag will be set. F112
0 0 0 0 0 0 0 0 0 1 0 1 1 0 0 1 0
Rotation to the right
(F112)
b31 b30 b29 b28 b27 b18 b17 b16 b15 b14 b5 b4 b3 b2 b1 b0
3) Program Example
(1) In case of P1000=hF, When Input Signal P00000 is changed to On from Off status, It rotates 4 bits to the right bit
by bit and then h0000 will be saved in P1000 and Carry Flag will be set.
P00000
RCRP P1000 4
4-120
-
Command
RCR4, RCR8 D n
Command
RCR4P, RCR8P P D n
means RCR4/RCR8
[Area Setting]
Operand Description Data Type
D Data address to perform operation. NIBBLE/BYTE
n Number of bits to rotate to the right. WORD
[Flag Set]
Flag Description Device Number
Carry If Carry is caused during rotation, Carry Flag will be set. F112
3) Program Example
(1) In case of P01000~P01003=hF, When Input Signal P00000 is changed to On from Off status, It rotates 4 bits to
the right and then h000E will be saved in P01000 and Carry Flat will be set.
P00000
RCR4P P01000 4
4-121
Chapter 4 Details of Instructions
Command
BSFT St Ed
Command
BSFTP P St Ed
means BSFT
[Area Setting]
Operand Description Data Type
St Start bit of BSFT Operation BIT
Ed End bit of BSFT Operation BIT
2) Program Example
(1) In case of P0070=h8000, when Input Signal P00000 is changed to On from Off status, It shifts to the right from
Start bit P0070F to End bit P00704 bit by bit because P0070F is larger than P00704 (P0070F > P00704).
P00000
BSFTP P0070F P00704
4-122
-
Command
BSFL, DBSFL D n
Command
BSFLP, DBSFLP P D n
means BSFL/DBSFL
[Area Setting]
Operand Description Data Type
D Device Number to shift bits. WORD/DWORD
n Number of times to shift word data S to the left bit by bit. WORD
[Flag Set]
Flag Description Device Number
Carry Carry Flag will be On/Off based on the bit cut away last. F112
CY When N=2
D 1 1 0 0 1 0 1 1 1 0 0 1 0 0 0 0 After
0 0
2) DBSFL (Double Bit Shift Left)
It shifts D+1,D’s double word data’s individual bit to the left for the number of N bit by bit.
D+1 D
b31 b15 b0
1 0 1 1 0 1 1 0 1 1 1 0 0 1 0 1 1 0 1 1 0 0 1 0 1 1 1 0 0 1 0 1 Before
CY When N=2
D 1 0 1 1 1 0 0 1 0 1 1 0 1 1 0 0 1 0 1 1 1 0 0 1 0 1 0 0 0 0 0 0 After
Filled with 0
3) Program Example
(1) In case of P1000=’h000F’, When P00000 is changed to On from Off status, it rotates 4 bit to the left bit
by bit and ‘h00F0’ is saved in P1000’.
P00000
BSFL P1000 4
4-123
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.18.3 BSFL4, BSFL4P, BSFL8, BSFL8P
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
BSFL4(P) D O - O - - - - O O - - - - -
3~5 - - O
BSFL8(P) n O - O O O - O - - O O O O O
Command
BSFL4, BSFL8 D n
Command
BSFL4P, BSFL8P P D n
means BSFL4/BSFL8
[Area Setting]
Operand Description Data Type
D Start bit position of BSFL Operation NIBBLE/BYTE
n Number of bits among 4/8 bits to shift to the left from specified D bit position. WORD
[Flag Set]
Flag Description Device Number
Carry Carry Flag will be On/Off based on the bit cut away last. F112
3) Program Example
(1) In case of P0100=‘h00F0’, it shifts 4 bits from No. 4 bit to the left and ‘h03C0’ will be saved in P0100.
P00000
BSFL4 P01004 2
4-124
-
Command
BSFR, DBSFR D n
Command
BSFRP, DBSFRP P D n
means BSFR/DBSFR
[Area Setting]
Operand Description Data Type
D Device Number to shift bits WORD/DWORD
n Number of times to shift word data S to the right bit by bit. WORD
[Flag Set]
Flag Description Device Number
Carry Carry Flag will be Set/Reset based on the bit cut away last. F112
3) Program Example
(1) In case of D01000=’h001F’, if Input Signal P00000 is changed to On from Off status, it rotates bits to the right for
4 times and then ‘h0001’ will be saved in D01000 and Carry Flag will be set.
P00000
P BSFR D01000 4
4-125
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.18.5 BSFR4, BSFR4P, BSFR8, BSFR8P
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
BSFR4(P) D O - O - - - - O O - - - - -
3/4 - - O
BSFR8(P) n O - O O O - O - - O O O O O
Command
BSFR4(P) D n
Command
BSFR8(P) P D n
means BSFL
[Area Setting]
Operand Description Data Type
D Start bit position of BSFR Operation NIBBLE/BYTE
n Number of bits among 4/8 bits to shift to the right from specified D bit position. WORD
[Flag Set]
Flag Description Device Number
Carry Carry Flag will be Set/Reset based on the bit cut away last. F112
3) Program Example
(1) In case of P0100=’h00F0’, If Input Signal is changed to On from Off status, it rotates bits to the right from No.4 bit
by bit for 4 times and then ‘h000F’ will be saved in P0100.
P00000
BSFR4 P01004 4
4-126
-
Command
WSFT St Ed
Command
WSFTP P St Ed
means WSFT
[Area Setting]
Operand Description Data Type
St Address of Start word data of WSFT Operation WORD
Ed Address of End word data of WSFT Operation WORD
b15 b0 b15 b0
Start word 1234 Start word 0 Shift word
2345 1234 by word
3456 2345
If St < Ed
4567 3456
End word 5678 End word 4567
2) Program Example
(1) If Input Signal P00000 is changed to On from Off status, ‘1234’ saved in D01000 will be downward by 1
word and saved in D01001.
b15 b0 b15 b0
D01000 1234 D01000 0 Shift by 1 word
2345 1234
3456 2345
4567 3456
D01004 5678 D01004 4567
P00000
WSFTP D01000 D01004
4-127
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.18.7 WSFL, WSFLP, WSFR, WSFRP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
D1 O - O O O - O - - - O O O O
WSFL(P)
D2 O - O O O - O - - - O O O O 4~6 - - -
WSFR(P)
N O - O O O - O - - O O O O O
Command
WSFL, WSFR D1 D2 N
Command
WSFLP, WSFRP P D1 D2 N
means WSFL/WSFR
[Area Setting]
Operand Description Data Type
D1 Device Number of the section to shift words. WORD
D2 Device Number of the section to shift words. WORD
N Number of words to shift at a time. WORD
3) Program Example
(1) If Input Signal P00020 is changed to On from Off status, 9-word data from P0000 to P0008 will be shifted to the
right by 2-word and 0 will be saved in P0007,P0008.
P00020
WSFR P0000 P0008 2
4-128
-
Command
SR SR Db I D N
[Area Setting]
Operand Description Data Type
Db Start bit of area to shift in bit unit
I Data of input to shift in bit unit BIT
D Shift direction in bit unit
N Number of bits to shift WORD
[Flag Set]
Flag Description Device Number
Error Flag will be set if N value exceeds maximum ‘Db’ area when SR instruction is
Error F110
executed.
1) SR
(1) It shifts N data from Shift Start Bit Db when Inpunt Signal which is execution condition of SR instruction is changed
to On from Off status.
(2) It shifts bits to the right if input direction bit is On, and to the left if off.
(3) The bits empty after data shifted will be filled with input data bit’s value.
2) Program Example
(1) In case of M00012=0 and M00013=0, when 1 initial Clock of Input Signal F00093 is changed to On from
Off status, it shifts 8-bit data to the left from D0000’s No. 0 bit and empty bit of input data is changed to 0.
(2) If Input bit data M00012=1, empty bit is charged ‘1’
(3) If shift direction bit M00013=1, direction of bit data is changed to the right and Bit Shift is executed with 1
second cycle.
F00093
SR D00000.0 M00012 M00013 8
4-129
Chapter 4 Details of Instructions
XGK XGB
4.18.9 BRR, BRRP ○ X
COMMAND
BRR S D n1 n2
COMMAND
BRRP P S D n1 n2
means BRR
[Area Setting]
Operand Description Data type
S Head address to execute operation BYTE
D Head address to save operation result BYTE
n1 The number of byte to rotate right WORD
n2 The number of right rotation WORD
2) Program example
If input signal P00000 is Off -> On, rotates 4 byte data starting from P10000 3 times with byte unit right and save
result in P11000.
4-130
-
COMMAND
BRL S D n1 n2
COMMAND
BRLP P S D n1 n2
means BRL
[Area Setting]
Operand Description Data type
S Head address to execute operation BYTE
D Head address to save operation result BYTE
n1 The number of byte to rotate left WORD
n2 The number of left rotation WORD
2) Program example
If input signal P00000 is Off -> On, rotates 4 byte data starting from P10000 3 times with byte unit left and save
result in P11000.
4-131
Chapter 4 Details of Instructions
(D)XCHG D1 D2
(D)XCHGP P D1 D2
means (D)XCHG
[Area Setting]
Operand Description Data Type
D1 Device Number of data to exchange WORD/DWORD
D2 Device Number of data to exchange WORD/DWORD
1) XCHG (Exchange)
(1) It exchanges word data of specified D1 and D2.
3) Program Example
(1) In case of P1000=’h1234’ and P1100=’5678’, Input Signal P00000 is changed from Off to On status,
‘5678’ is saved in P10000 and then ‘h1234’ is saved in P1100.
P00000
XCHG P1000 P1100
4-132
-
GXCHG D1 D2 N
GXCHGP P D1 D2 N
means GXCHG
[Area Setting]
Operand Description Data Type
D1 Start address of area to exchange data with D2 in word unit WORD
D2 Start address of area to exchange data with D1 in word unit WORD
N Number of data to exchange in word unit WORD
[Flag Set]
Flag Description Device Number
Error If N value exceeds applicable device’s area. F110
1) GXCHG
(1) It exchanges N word data starting from D1 and D2.
(2) It exchanges N data while increasing based on the value of D1 and D2. If D1 and D2 are overlapped, unintentional
result will be caused.
2) Program Example
(1) Input Signal P00000 is changed from Off to On status, it exchanges 3-word data of P0010~P0012 and
P0020~P0022.
P10 h0001 P20 h0100 After exchange P10 h0100 P20 h0001
h0002 h0101 h0101 h0002
h0003 h0102
h0102 h0003
P00000
GXCHG P0010 P0020 3
4-133
Chapter 4 Details of Instructions
XGK XGB
4.19.3 SWAP, SWAPP ○ ○
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
SWAP(P) D O - O - - - - - - - O O O O 2 - - -
Command
SWAP D
Command
SWAPP P D
means SWAP
[Area Setting]
Operand Description Data Type
D Word address of data to exchange byte upper and lower WORD
1) SWAP
(1) It exchanges byte upper and lower in a word.
2) Program Example
(1) If Input Signal P00000 is changed from Off to On, 1-word data in D00100’s upper byte and lower byte is
exchanged and then saved in P00100 again.
D100 0 1 0 0 0 0 0 1 0 0 0 1 0 1 0 0
D100 0 0 0 1 0 1 0 0 0 1 0 0 0 0 0 1
P00000
SWAP D00100
4-134
-
GSWAP D N
GSWAPP P D N
means GSWAP
[Area Setting]
Operand Description Data Type
D First Device Number of data to exchange byte upper and lower WORD
N Number of word data to exchange byte upper and lower WORD
[Flag Set]
Flag Description Device Number
Error If N’s range exceeds the specified area. F110
1byte 1byte
1 0 1 1 0 1 1 0 0 1 1 0 1 0 1 1
1 0 1 1 0 1 1 0 0 1 1 0 1 0 1 1
1 0 1 1 0 1 1 0 0 1 1 0 1 0 1 1
Byte exchanged
2) Program Example
(1) If Input signal P00000 is changed from Off too On, 3-word data of P1000~P1002’s upper byte and lower byte is
exchanged.
P00000
GSWAP P1000 3
4-135
Chapter 4 Details of Instructions
XGK XGB
4.19.5 SWAP2, SWAP2P ○ X
COMMAND
SWAP2 S D
SWAP2P P S D
means SWAP2
[Area Setting]
Operand Description Data type
S Device Number of data or data to exchange byte upper and lower WORD
D Address to save result of SWAP2 operation WORD
1) SWAP2
(1) Exchanes byte upper and lower for device set by S and saves it in D
2) Program example
If P00000 is Off -> On, upper byte and lower byte of 1 word data saved in D00100 are exchanged and result is
saved in D00110.
4-136
-
COMMAND
GSWAP2 S D N
COMMAND
GSWAP2P S D N
means GSWAP2
[Area Setting]
Operand Description Data type
S First Device Number of data to exchange byte upper and lower WORD
D Address to save result of GSWAP2 operation WORD
N Number of group to transmit ( 0 ~ 65536 ) WORD
[Flag setting]
Device
Flag Description
number
Error When N exceeds the range, flag is set. Instruction is not executed. F110
S h0002 D h0200
S+1 h0007 D+1 h0702
. h007F Group SWAP . h7F00
N N
. .
. .
S+N-1 h005A D+N -1 h5A00
Word
2) Program example
If input signal P00000 is Off -> On, exchanges upper byte and lower byte of 3 word data and saves result in
P0004~P0006.
S(Source) D(Destination)
GSWAP2
D00000 h0002 h0200 P00004
Execution
N D00001 h0007 h0702 P00005
D00002 h007F h7F00 P00006
(Before) (After)
4-137
Chapter 4 Details of Instructions
(D)ADD S1 S2 D
(D)ADDP P S1 S2 D
means ADD/DADD
[Area Setting]
Operand Description Data Type
S1 Data to be added to S2 INT/DINT
S2 Data to be added to S1 INT/DINT
D Address to save operation result in INT/DINT
D S D
b15 b0 b15 b0 b15 b0
5678 (BIN) + 1234 (BIN) 6912 (BIN)
3) Program Example
(1) In case of P1000=‘1234’ , P1100=‘1111’, Input Signal P00000 is changed from Off to On status, the
added result of ‘2345’ is saved In P1200.
P00000
ADD P1000 P1100 P1200
4-138
-
(D)SUB S1 S2 D
(D)SUBP P S1 S2 D
means SUB/DSUB
[Area Setting]
Operand Description Data Type
S1 Data to be subtracted from S2 INT/DINT
S2 Data to be subtracted from S1 INT/DINT
D Address to save operation result in INT/DINT
D S D
b15 b0 b15 b0 b15 b0
5678 (BIN) - 1234 (BIN) 4444 (BIN)
3) Program Example
(1) In case of P1000=‘200’ and P1100=‘100’, Input Signal P00000 is changed from Off to On status, the result of
subtracted ‘100’ will be saved in P1200.
P00000
SUB P1000 P1100 P1200
4-139
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.20.3 MUL, MULP, DMUL, DMULP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
S1 O O O O O - O - - O O O O O
MUL(P)
S2 O O O O O - O - - O O O O O 4~6 - - -
DMUL(P)
D O - O O O - O - - O O O O
MUL,DMUL S1 S2 D
MULP, DMULP P S1 S2 D
means MUL/DMUL
[Area Setting]
Operand Description Data Type
S1 Data to be multiplied by S2 INT/DINT
S2 Data to be multiplied by S1 INT/DINT
D Address to save operation result in DINT/LINT
S1 S2 D + 1 D
3) Program Example
(1) In case of P1000=’100 and P1100=’20’, Input Signal P00000 is changed from Off to On status, the result of
multiplied ‘2000’ is saved in P1200~P1201.
P00000
MUL P1000 P1100 P1200
Remark
Among MKS Instructions, the names of instructions of MULS, DIV, etc. have been changed in XGK as shown
below.
However, their functions are the same as before.
MULS(P) Æ MUL(P) DMULS(P) Æ DMUL(P)
DIV(P) Æ DIVU(P) DDIV(P) Æ DDIVU(P)
4-140
-
XGK XGB
○ ○
4.20.4 DIV, DIVP, DDIV, DDIVP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
S1 O O O O O - O - - O O O O O
DIV(P)
S2 O O O O O - O - - O O O O O 4~6 O - -
DDIV(P)
D O - O O O - O - - O O O O
(D)DIVU S1 S2 D
(D)DIVUP P S1 S2 D
means DIV/DDIV
[Area Setting]
Operand Description Data Type
S1 Data to be divided by S2 INT/DINT
S2 Data to be divided by S1 INT/DINT
D Address to save operation result in INT/DINT
[Flag Set]
Flag Description Device Number
Error To be set if S2’s value is 0. F110
3) Program Example
(1) In case of P1000=’5577’ and P1100=’5’, Input Signal P00000 is changed from Off to On, the quotient ‘1111’ is
saved in P1200 and then the remainder ‘2’ is saved in P1201.
P00000
DIV P1000 P1100 P1200
4-141
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.20.5 ADDU, ADDUP, DADDU, DADDUP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
S1 O O O O O - O - - O O O O O
ADDU(P)
4~6 - O O
DADDU(P) S2 O O O O O - O - - O O O O O
D O - O O O - O - - - O O O O
(D)ADDU S1 S2 D
(D)ADDUP P S1 S2 D
means ADDU/DADDU
[Area Setting]
Operand Description Data Type
S1 Data to be added to S2 WORD/DWORD
S2 Data to be added to S1 WORD/DWORD
D Address to save operation result in WORD/DWORD
[Flag Set]
Flag Description Device Number
Zero To be set if operation result is Zero. F111
Carry To be set if operation result is Overflow F112
3) Program Example
(1) In case of P1000=’1234’ and P1100=’5’, Input Signal P00000 is changed from Off to On status, the Unsigned
addition result ‘1239’ is saved in P1200.
P00000
ADDU P1000 P1100 P1200
4-142
-
XGK XGB
4.20.6 SUBU, SUBUP, DSUBU, DSUBUP ○ ○
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
S1 O O O O O - O - - O O O O O
SUBU(P)
4~6 - O O
DSUBU(P) S2 O O O O O - O - - O O O O O
D O - O O O - O - - - O O O O
(D)SUBU S1 S2 D
(D)SUBUP P S1 S2 D
means SUBU/DSUBU
[Area Setting]
Operand Description Data Type
S1 Data to be subtracted from S2 WORD/DWORD
S2 Data to be subtracted from S1 WORD/DWORD
D Address to save operation result in WORD/DWORD
[Flag Set]
Flag Description Device Number
Zero To be set if operation result is Zero. F111
Carry To be set if operation result is Overflow F112
3) Program Example
(1) In case of P1000=’1234’ and P1100=’5’, Input Signal P00000 is changed from Off to On status, the result of
subtraction ‘1229’ is saved in P1200.
P00000
(D)SUBU P1000 P1100 P1200
4-143
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.20.7 MULU, MULUP, DMULU, DMULUP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
S1 O O O O O - O - - O O O O O
MULU(P)
4~6 - O -
DMULU(P) S2 O O O O O - O - - O O O O O
D O - O O O - O - - - O O O O
(D)MULU S1 S2 D
(D)MULUP P S1 S2 D
means MULU/DMULU
[Area Setting]
Operand Description Data Type
S1 Data to be multiplied by S2 WORD/DWORD
S2 Data to be multiplied by S1 WORD/DWORD
D Address to save operation result in DWORD/LWORD
[Flag Set]
Flag Description Device Number
Zero To be set if operation result is Zero. F111
3) Program Example
(1) in case of P1000=’1234’ and P1100=’2’, Input Signal P00000 is changed from Off to On status, the result of
Unsigned addition ‘2468’ is saved in P1200.
P00000
MULU P1000 P1100 P1200
4-144
-
XGK XGB
4.20.8 DIVU, DIVUP, DDIVU, DDIVUP ○ ○
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
S1 O O O O O - O - - O O O O O
DIVU(P)
S2 O O O O O - O - - O O O O O 4~6 O O -
DDIVU(P)
D O - O O O - O - - - O O O O
(D)DIVU S1 S2 D
(D)DIVUP P S1 S2 D
means DIVU/DDIVU
[Area Setting]
Operand Description Data Type
S1 Data to be divided by S2 WORD/DWORD
S2 Data to be divided by S1 WORD/DWORD
D Address to save operation result in WORD/DWORD
[Flag Set]
Flag Description Device Number
Error To be set if S2’s value is 0. F110
Zero To be set if operation result is Zero. F111
3) Program Example
(1) In case of P1000=’5559’ and P1100=’5’, Input Signal is changed from Off to On status, the quotient of Unsigned
division ‘1111’ is saved in P1200 and the remainder ‘4’ is saved in P1201.
P00000
DIVU P1000 P1100 P1200
4-145
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.20.9 RADD, RADDP, LADD, LADDP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
S1 O O O O O - O - - O O O O O
RADD(P)
S2 O O O O O - O - - O O O O O 4~8 O - -
LADD(P)
D O - O O O - O - - - O O O O
RADD, LADD S1 S2 D
RADDP, LADDP P S1 S2 D
means RADD/LADD
[Area Setting]
Operand Description Data Type
S1 Data to be added to S2 REAL/LREAL
S2 Data to be added to S1 REAL/LREAL
D Address to save operation result in REAL/LREAL
[Flag Set]
Flag Description Device Number
Error To be set if FPU operation error flag of F0057E, F0057C, F0057B or F0057A is set. F110
※ If the result of operand’s value exceeds the range, operation error will occur. However, specific
value may be assigned thereto to keep continuous operation.
P00001
RADD M0000 M0004 M0008
※ If the result of operand’s value exceeds the range, operation error will occur. However, specific value
may be assigned thereto to keep continuous operation.
P00001
LADD M0000 M0004 M0008
4-146
-
XGK XGB
4.20.10 RSUB, RSUBP, LSUB, LSUBP ○ ○
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
S1 O O O O O - O - - O O O O O
RSUB(P)
S2 O O O O O - O - - O O O O O 4~8 O - -
LSUB(P)
D O - O O O - O - - - O O O O
RSUB, LSUB S1 S2 D
RSUBP, LSUBP P S1 S2 D
means RSUB/LSUB
[Area Setting]
Operand Description Data Type
S1 Data to be subtracted from S2 REAL/LREAL
S2 Data to be subtracted from S1 REAL/LREAL
D Address to save operation result in REAL/LREAL
[Flag Set]
Flag Description Device Number
Error To be set if FPU operation error flag of F0057E, F0057C, F0057B or F0057A is set. F110
※ If the result of operand’s value exceeds the range, operation error will occur. However, specific
value may be assigned thereto to keep continuous operation.
P00001
RSUB M0000 M0004 M0008
※ If the result of operand’s value exceeds the range, operation error will occur. However, specific value
may be assigned thereto to keep continuous operation.
P00001
LSUB M0000 M0004 M0008
4-147
Chapter 4 Details of Instructions
XGK XGB
4.20.11 RMUL, RMULP, LMUL, LMULP ○ ○
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
S1 O O O O O - O - - O O O O O
RMUL(P)
S2 O O O O O - O - - O O O O O 4~8 O - -
LMOV(P)
D O - O O O - O - - - O O O O
RMUL S1 S2 D
RMULP P S1 S2 D
means RMUL/LMUL
[Area Setting]
Operand Description Data Type
S1 Data to be multiplied by S2 REAL/LREAL
S2 Data to be multiplied by S1 REAL/LREAL
D Address to save operation result in REAL/LREAL
[Flag Set]
Flag Description Device Number
Error To be set if FPU operation error flag of F0057E, F0057C, F0057B or F0057A is set. F110
※ If the result of operand’s value exceeds the range, operation error will occur. However, specific
value may be assigned thereto to keep continuous operation.
P00001
RMUL M0000 M0004 M0008
※ If the result of operand’s value exceeds the range, operation error will occur. However, specific value
may be assigned thereto to keep continuous operation
P00000
LMUL P1000 P1100 P1200
4-148
-
XGK XGB
○ ○
4.20.12 RDIV, RDIVP, LDIV, LDIVP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
S1 O O O O O - O - - O O O O O
RDIV(P)
S2 O O O O O - O - - O O O O O 4~8 O - -
LDIV(P)
D O - O O O - O - - - O O O O
RDIV, LDIV S1 S2 D
RDIVP, LDIVP P S1 S2 D
means RDIV/LDIV
[Area Setting]
Operand Description Data Type
S1 Data to be divided by S2 REAL/LREAL
S2 Data to be divided by S1 REAL/LREAL
D Address to save operation result in REAL/LREAL
[Flag Set]
Flag Description Device Number
Error To be set if FPU operation error flag of F0057E, F0057C, F0057B or F0057A is set. F110
※ If the result of operand’s value exceeds the range, operation error will occur. However, specific value
may be assigned thereto to keep continuous operation.
P00001
RDIV M0000 M0004 M0008
※ If the result of operand’s value exceeds the range, operation error will occur. However, specific value
may be assigned thereto to keep continuous operation.
P00001
LDIV M0000 M0004 M0008
4-149
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.20.13 $ADD, $ADDP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
S1 O - O - - - - - - O O O O O
$ADD(P) S2 O - O - - - - - - O O O O O 4~18 - - -
D O - O - - - - - - - O O O O
$ADD S1 S2 D
$ADDP P S1 S2 D
means $ADD
[Area Setting]
Operand Description Data Type
S1 String or Device Number String data is saved in STRING
S2 String or Device Number String data is saved in STRING
D Address to save operation result in STRING
(2) Even if the length of S1 string plus S2 string exceeds the size of string data, error will not occur. In this case, the
value to be saved in D will be as big as the size of string data starting from S1 value.
Remark
(1) String data will be processed in 16-word data regardless of the string length. Thus, string-related instruction if
used shall designate a device which is allowed to use 16-word space.
4-150
-
XGK XGB
○ ○
4.20.14 GADD, GADDP, GSUB, GSUBP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
S1 O O O O O - O - - O O O O
GADD(P) S2 O O O O O - O - - O O O O O 4~7 O - -
GSUB(P) D O - O O O - O - - O O O O
N O - O O O - - - - O O O O O
GADD, GSUB S1 S2 D N
GADDP, GSUBP P S1 S2 D N
means GADD/GSUB
[Area Setting]
Operand Description Data Type
S1 Data address to be added to S2 INT
S2 Data address to be added to S1 INT
D Address to save operation result in INT
N Number of words to add WORD
[Flag Set]
Flag Description Device Number
Error To be set when N’s value exceeds specified area. F110
b15 b0 b15 b0
S1 1234 D 1334
S1+1 5555 b15 b0 D+1 5655
. .
+ S2 100 =
. .
. .
S1+(N-1) 1000 D+(N-1) 1100
(3) If specified device’s area is exceeded due to N value, error will occur.
4-151
Chapter 4 Details of Instructions
b15 b0 b15 b0
S1 1234 D 1134
S1+1 5555 b15 b0 D+1 5455
. .
- S2 100 =
. .
. .
S1+(N-1) 1000 D+(N-1) 900
(3) If specified device’s area is exceeded due to N value, error will occur.
4-152
-
ADDB, DADDB S1 S2 D
ADDBP, DADDBP P S1 S2 D
means ADDB
[Area Setting]
Operand Description Data Type
S1 BCD data to be added to S2 WORD/DWORD
S2 BCD data to be added to S1 WORD/DWORD
D Address to save operation result in WORD/DWORD
[Flag Set]
Flag Description Device Number
Error If the value of S1 and S2 is not of BCD format. F110
Zero To be set if operation result is Zero. F111
Carry To be set if operation result is Overflow. F112
D S D
5 6 7 8 + 1 2 3 4 6 9 1 2
3) Program Example
(1) In case of P1000=’100’ and P1100=’200’, If Input Signal P00000 is changed from Off to On, BCD data ‘300’ is
saved in P1200.
P00000
ADDB P1000 P1100 P1200
4-153
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.21.2 SUBB, SUBBP, DSUBB, DSUBBP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
S1 O O O O O - O - - O O O O O
SUBB(P)
S2 O O O O O - O - - O O O O O 4~6 O O O
DSUBB(P)
D O - O O O - O - - - O O O O
SUBB,DSUBB S1 S2 S3
SUBBP, DSUBBP P S1 S2 S3
means SUBB/DSUBB
[Area Setting]
Operand Description Data Type
S1 BCD data to be subtracted from S2 WORD/DWORD
S2 BCD data to be subtracted from S1 WORD/DWORD
D Address to save operation result in WORD/DWORD
[Flag Set]
Flag Description Device Number
Error If the value of S1 and S2 is not of BCD format. F110
Zero To be set if operation result is Set. F111
Carry To be set if operation result is Set. F112
3) Program Example
(1) In case of P1000=’200’ and P1100=’100’, Input Signal P00000 is changed from Off to On, BCD data ‘100’ is saved
in P1200.
P00000
SUBB P1000 P1100 P1200
4-154
-
XGK XGB
4.21.3 MULB, MULBP, DMULB, DMULBP ○ ○
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
S1 O O O O O - O - - O O O O O
MULB (P)
4~6 O O -
DMULB(P) S2 O O O O O - O - - O O O O O
D O - O O O - O - - - O O O O
MULB, DMULB S1 S2 D
MULBP, DMULBP P S1 S2 D
means MULB/DMULB
[Area Setting]
Operand Description Data Type
S1 BCD data to be multiplied by S2 WORD/DWORD
S2 BCD data to be multiplied by S1 WORD/DWORD
D Address to save operation result in DWORD/LWORD
[Flag Set]
Flag Description Device Number
Error If the value of S1 and S2 is not of BCD format. F110
Zero To be set if operation result is Zero. F111
S1 +1 S1 S2 +1 S2
9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9
D +3 D +2 D +1 D
9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9
3) Program Example
(1) In case of P1000=‘100’ and P1100=‘10’, If Input Signal P00000 is changed from Off to On status, BCD data ‘1000’
is saved in P1200 and P1201, 2-word area.
P00000
MULB P1000 P1100 P1200
4-155
Chapter 4 Details of Instructions
XGK XGB
4.21.4 DIVB, DIVBP, DDIVB, DDIVBP ○ ○
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
S1 O O O O O - O - - O O O O O
DIVB(P)
S2 O O O O O - O - - O O O O O 4~6 O O -
DDIVB(P)
D O - O O O - O - - - O O O O
DIVB, DDIVB S1 S2 D
DIVBP, DDIVBP P S1 S2 D
means DIVB/DDIVB
[Area Setting]
Operand Description Data Type
S1 BCD data to be divided by S2 WORD/DWORD
S2 BCD data to be divided by S1 WORD/DWORD
D Address to save operation result in WORD/DWORD
[Flag Set]
Flag Description Device Number
Error If the value of S1 and S2 is not of BCD format, if the value of S2 is 0 F110
Zero To be set if operation result is Zero F111
3) Program Example
(1) In case of P1000=’105’ and P1100=’10’, If Input Signal is chaged from Off to On, P1000 is divided by P1100. In
BCD division result, the quotient ‘10’ is saved in P1200 and the remainder ‘5’ is saved in P1201.
P00000
DIVB P1000 P1100 P1200
4-156
-
(D)WAND S1 S2 D
(D)WANDP P S1 S2 D
means WAND/DWAND
[Area Setting]
Operand Description Data Type
S1 Data to execute WAND operation with S2 BIN 16/32
S2 Data to execute WAND operation with S1 BIN 16/32
D Address to save WAND operation result in BIN 32
[Flag Set]
Flag Description Device Number
Zero To be set if operation result is Zero. F111
b15 b8 b7 b0
S1 1 0 1 0 0 1 1 0 1 1 1 1 0 1 1 1
WAND
b15 b8 b7 b0
S2 1 0 0 1 1 1 1 0 0 1 0 1 0 1 1 1
b15 b8 b7 b0
D 1 0 0 0 0 1 1 0 0 1 0 1 0 1 1 1
4-157
Chapter 4 Details of Instructions
S1+1 S1
DWAND
S2+1 S2
S2 1 0 1 1 0 0 1 1 0 1 1 1 0 1
D+1 D
4) Program Example
(1) In case of P1000=‘h1111’, P1100=‘h3333’, If Input Signal P00000 is changed from Off to On, the result
WAND executed ‘h3333’ is saved in P1200.
P00000
WAND P1000 P1100 P1200
4-158
-
XGK XGB
4.22.2 WOR, WORP, DWOR, DWORP ○ ○
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
S1 O O O O O - O - - O O O O O
WOR(P)
S2 O O O O O - O - - - O O O O 4~6 - O -
DWOR(P)
D O - O O O - O - - - O - O O
(D)WOR S1 S2 D
(D)WORP P S1 S2 D
means WOR/DWOR
[Area Setting]
Operand Description Data Type
S1 Data to execute WOR operation with S2 BIN 16/32
S2 Data to execute WOR operation with S1 BIN 16/32
D Address to save WOR operation result in BIN 16/32
[Flag Set]
Flag Description Device Number
Zero To be set if operation result is Zero. F111
b15 b8 b7 b0
S1 1 1 0 1 0 0 1 1 1 0 1 1 0 1 0 0
WOR
b15 b8 b7 b0
S2 1 1 0 0 0 1 1 0 0 1 1 1 0 1 1 0
b15 b8 b7 b0
D 1 1 0 1 0 1 1 1 1 1 1 1 0 1 1 0
4-159
Chapter 4 Details of Instructions
S1+1 S1
DWOR
S2+1 S2
S2 1 1 0 0 1 0 0 1 0 1 1 0 1 1
D+1 D
3) Program Example
(1) In case of P1000=‘h1111’ and P1100=‘h2222’ , If Input Signal P00000 is changed from Off to On, the result WOR
operation ‘h3333’ is saved in P1200.
P00000
WOR P1000 P1100 P1200
4-160
-
XGK XGB
○ ○
4.22.3 WXOR, WXORP, DWXOR, DWXORP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
S1 O O O O O - O - - O O O O O
WXOR(P)
S2 O O O O O - O - - - O O O O 4~6 - O -
DWXOR(P)
D O - O O O - O - - - O - O O
(D)WXOR S1 S2 D
(D)WXORP P S1 S2 D
means WXOR/DWXOR
[Area Setting]
Operand Description Data Type
S1 Data to execute WXOR operation with S2 WORD/DWORD
S2 Data to execute WXOR operation with S1 WORD/DWORD
D Address to save WXOR operation result in WORD/DWORD
[Flag Set]
Flag Description Device Number
Zero To be set if operation result is Zero. F111
b15 b8 b7 b0
S1 0 1 0 0 1 1 1 0 1 1 0 0 1 1 0 0
WXOR
b15 b8 b7 b0
S2 1 0 0 0 1 0 1 0 1 1 0 1 0 1 0 1
b15 b8 b7 b0
D 1 1 0 0 0 1 0 0 0 0 0 1 1 0 0 1
(2) Exclusive OR: If one bit is 0 and the other bit is 1, the corresponding result bit is set to 1. Otherwise, the
corresponding result bit is set to 0.
4-161
Chapter 4 Details of Instructions
S1+1 S1
DWXOR
S2+1 S2
S2 1 0 0 1 1 0 0 1 0 1 1 0 1 0
D+1 D
3) Program Example
(1) In case of P1000=‘h1111’ and P1100=‘h2222’, Input Signal is changed from Off to On, the WOR operation result of
‘h3333’ is saved in P1200.
P00000
WXOR P1000 P1100 P1200
4-162
-
XGK XGB
4.22.4 WXNR, WXNRP, DWXNR, DWXNRP ○ ○
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
S1 O O O O O - O - - O O O O O
WXNR(P)
S2 O O O O O - O - - - O O O O 4~6 - O -
DWXNR(P)
D O - O O O - O - - - O - O O
(D)WXNR S1 S2 D
(D)WXNRP P S1 S2 D
means WXNR
[Area Setting]
Operand Description Data Type
S1 Data to execute WXNR operation with S2 BIN 16/32
S2 Data to execute WXNR operation with S1 BIN 16/32
D Address to save WXNR operation result in BIN 16/32
[Flag Set]
Flag Description Device Number
Zero To be set if operation result is Zero. F111
b15 b8 b7 b0
S1 1 1 1 1 0 1 1 1 1 0 1 1 1 0 0 0
WXNR
b15 b8 b7 b0
S2 0 0 1 1 1 0 1 0 0 0 0 1 0 0 1 0
b15 b8 b7 b0
D 0 0 1 1 0 0 1 0 0 1 0 1 0 1 0 1
(2) Exclusive NOR: If S1 and S2 bit is different from each ather, the operated result is 0. If S1 and S2 bit is
same, the operated result is 1. The operated result is saved in applicable bit.
4-163
Chapter 4 Details of Instructions
S1+1 S1
DWXNR
S2+1 S2
D+1 D
3) Program Example
(1) In case of P1000=‘h1111’ and P1100=‘h2222’, If Input Signal P00000 is changed from Off to On, the Exclusive
NOR (WXNR) result ‘hCCCC’ is saved in P1200.
P00000
WXNR P1000 P1100 P1200
4-164
-
XGK XGB
○ ○
4.22.5 GWAND, GWANDP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
S1 O O O O O - O - - O O O O O
S2 O O O O O - O - - - O O O O
GWAND(P) 4~7 O - -
D O - O O O - O - - - O O O O
N O - O O O - O - - O O O O O
GWAND S1 S2 D N
GWANDP P S1 S2 D N
means GWAND
[Area Setting]
Operand Description Data Type
S1 Address of data to start GWAND operation with S2 BIN 16
S2 Address of data to start GWAND operation with S1 BIN 16
D Address to save GWAND operation result in BIN 16
N Number of data to execute WAND operation between words BIN 16
[Flag Set]
Flag Description Device Number
Error If N value exceeds applicable device’s area. F110
S1+1 1 0 1 1 0 1 0 1 1 0 1 0 1 1 0 0 S2+1 1 1 0 0 0 1 0 1 1 0 1 1 1 0 1 0
S1+2 0 1 0 1 0 1 1 0 0 0 1 1 1 0 0 1 S2+2 0 1 0 1 0 1 1 1 0 1 1 0 1 1 0 1
n AND n
S1+(N-2) 1 1 1 1 0 1 1 1 1 0 1 1 1 0 0 0 S2+(N-2) 0 0 1 1 0 0 1 1 1 1 0 0 1 1 0 1
S1+(N-1) 1 1 1 1 0 1 0 1 1 0 0 1 0 1 1 1 S2+(N-1) 1 1 0 0 1 1 1 1 1 0 1 0 1 0 1 1
b15 b8 b7 b0
D 1 0 1 1 0 0 1 0 1 0 0 1 1 0 0 0
D+1 1 0 0 0 0 1 0 1 1 0 1 0 1 0 0 0
D+2 0 1 0 1 0 1 1 0 0 0 1 0 1 0 0 1
D+(N-2) 0 0 1 1 0 0 1 1 1 0 0 0 1 0 0 0
D+(N-1) 1 1 0 0 0 1 0 1 1 0 0 0 0 0 1 1
4-165
Chapter 4 Details of Instructions
S1+1 1 0 1 1 0 1 0 1 1 0 1 0 1 1 0 0
S1+2 0 1 0 1 0 1 1 0 0 0 1 1 1 0 0 1
b15 b8 b7 b0
n AND S2 1 0 1 1 0 1 1 1 1 0 0 1 1 0 0 1
S1+(N-2) 1 1 1 1 0 1 1 1 1 0 1 1 1 0 0 0
S1+(N-1) 1 1 1 1 0 1 0 1 1 0 0 1 0 1 1 1
b15 b8 b7 b0
D 1 0 1 1 0 0 1 0 1 0 0 1 1 0 0 0
D+1 1 0 1 1 0 1 0 1 1 0 0 0 1 0 0 0
D+2 0 0 0 1 0 1 1 0 0 0 0 1 1 0 0 1
D+(N-2) 1 0 1 1 0 1 1 1 1 0 0 1 1 0 0 0
D+(N-1) 1 0 1 1 0 1 0 1 1 0 0 1 0 0 0 1
2) Program Example
(1) If Input Signal P00000 is changed from Off to ON status, It saves the result of GWAND operation 5-word data from
P1000~P1004 with 5-word data from P1100~P1104 in 5-word of P1200~1204 respectively.
P00000
GWAND P1000 P1100 P1200 5
4-166
-
XGK XGB
4.22.6 GWOR, GWORP ○ ○
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
S1 O O O O O - O - - O O O O O
S2 O O O O O - O - - - O O O O
GWOR(P) 4~7 O - -
D O - O O O - O - - - O O O O
N O - O O O - O - - O O O O O
GWOR S1 S2 D N
GWORP P S1 S2 D N
means GWOR
[Area Setting]
Operand Description Data Type
S1 Address of data to start GWOR operation with S2 WORD
S2 Address of data to start GWOR operation with S1 WORD
D Address to save GWOR operation result in WORD
N Number of data to execute WOR operation WORD
[Flag Set]
Flag Description Device Number
Error If N value exceeds applicable device’s area. F110
S1+1 1 1 0 1 0 1 0 1 0 0 1 0 0 0 0 1 S2+1 1 1 0 1 1 1 0 0 1 1 1 0 0 1 1 1
S1+2 0 0 1 0 0 1 1 0 0 0 0 0 1 0 0 1 S2+2 0 0 0 0 0 1 1 1 1 0 0 0 1 0 1 1
n OR n
S1+(N-2) 1 0 1 1 1 1 0 1 1 1 0 1 1 0 1 0 S2+(N-2) 0 1 1 0 1 0 0 1 1 1 0 1 1 1 1 1
S1+(N-1) 1 1 0 0 0 1 0 1 1 0 1 1 0 1 1 1 S2+(N-1) 1 1 0 1 1 1 0 1 1 0 1 1 0 1 0 0
b15 b8 b7 b0
D 1 1 1 1 0 1 1 1 0 1 1 1 1 1 0 1
D+1 1 1 0 1 1 1 0 1 1 1 1 0 0 1 1 1
D+2 0 0 1 0 0 1 1 1 1 0 0 0 1 0 1 1
D+(N-2) 1 1 1 1 1 1 0 1 1 1 0 1 1 1 1 1
D+(N-1) 1 1 0 1 1 1 0 1 1 1 0 1 0 1 1 1
4-167
Chapter 4 Details of Instructions
b15 b8 b7 b0
S1 0 0 0 1 0 0 1 1 0 1 1 1 1 1 0 1
S1+1 1 1 0 1 0 1 0 1 0 0 1 0 0 0 0 1
S1+2 0 0 1 0 0 1 1 0 0 0 0 0 1 0 0 1
b15 b8 b7 b0
n OR S2 1 1 1 1 0 1 1 1 0 0 1 0 1 1 0 1
S1+(N-2) 1 0 1 1 1 1 0 1 1 1 0 1 1 0 1 0
S1+(N-1) 1 1 0 0 0 1 0 1 1 0 1 1 0 1 1 1
b15 b8 b7 b0
D 1 1 1 1 0 1 1 1 0 1 1 1 1 1 0 1
D+1 1 1 1 1 0 1 1 1 0 0 1 0 1 1 0 1
D+2 1 1 1 1 0 1 1 1 0 0 1 0 1 1 0 1
D+(N-2) 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
D+(N-1) 1 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1
2) Program Example
(1) If Input Signal P00000 is changed from Off to On, It saves the result of GWOR operation 5-word data from
P1000~P1004 with 5-word data from P1100~P1104 in 5-word data of P1200~P1204 respectively.
P00000
GWOR P1000 P1100 P1200 5
4-168
-
XGK XGB
4.22.7 GWXOR, GWXORP ○ ○
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
S1 O O O O O - O - - O O O O O
S2 O O O O O - O - - - O O O O
GWXOR(P) 4~7 O - -
D O - O O O - O - - - O O O O
N O - O O O - O - - O O O O O
GWXOR S1 S2 D N
GWXORP P S1 S2 D N
means GWXOR
[Area Setting]
Operand Description Data Type
S1 Address of data to start GWXOR operation with S2 WORD
S2 Address of data to start GWXOR operation with S1 WORD
D Address to save GWXOR operation result in WORD
N Number of data to execute WXOR operation WORD
[Flag Set]
Flag Description Device Number
Error If N value exceeds applicable device’s area. F110
S1+1 1 1 0 0 0 0 0 0 1 1 1 1 1 1 0 0 S2+1 1 1 1 1 1 1 0 0 0 0 1 1 0 0 1 1
S1+2 0 0 1 1 0 0 1 1 0 0 0 1 1 1 0 1 S2+2 0 0 0 0 1 1 1 1 0 0 1 1 1 1 0 0
n XOR n
S1+(N-2) 1 0 0 1 1 1 0 0 1 1 1 1 0 0 1 1 S2+(N-2) 0 1 1 0 1 0 0 1 1 1 0 0 0 1 1 1
S1+(N-1) 1 1 0 0 0 0 0 0 1 1 1 1 0 0 1 1 S2+(N-1) 1 1 0 1 1 0 1 1 1 1 1 0 0 1 0 1
b15 b8 b7 b0
D 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0
D+1 1 1 0 0 0 0 1 1 0 0 1 1 0 0 0 0
D+2 1 1 0 0 0 0 1 1 1 1 0 1 1 1 1 0
D+(N-2) 0 0 0 0 1 0 1 0 1 1 0 0 1 0 1 1
D+(N-1) 1 1 1 0 0 1 0 0 1 1 1 0 1 0 0 1
4-169
Chapter 4 Details of Instructions
b15 b8 b7 b0
S1 0 0 1 1 1 1 1 1 0 0 1 1 1 1 0 0
S1+1 1 1 0 0 0 0 0 0 1 1 1 1 1 1 0 0
S1+2 0 0 1 1 0 0 1 1 0 0 0 1 1 1 0 1
b15 b8 b7 b0
n XOR S2 1 1 0 0 0 0 1 1 0 0 1 1 1 1 1 1
S1+(N-2) 1 0 0 1 1 1 0 0 1 1 1 1 0 0 1 1
S1+(N-1) 1 1 0 0 0 0 0 0 1 1 1 1 0 0 1 1
b15 b8 b7 b0
D 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0
D+1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 0 0
D+2 0 0 0 0 1 1 1 1 1 1 0 1 1 1 0 1
D+(N-2) 1 0 1 0 0 0 0 0 0 0 1 1 0 0 1 1
D+(N-1) 1 1 1 1 1 1 0 0 0 0 1 1 0 0 1 1
2) Program Example
(1) If Input Signal P00000 is changed from Off to On status, It saves the result of GWXOR operation 5-word data from
P1000~P1004 with 5-word data from P1100~P1104 in 5-word data of P1200~P1204 respectively.
P00000
GWXOR P1000 P1100 P1200 5
4-170
-
XGK XGB
4.22.8 GWXNR, GWXNRP ○ ○
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
S1 O O O O O - O - - O O O O O
S2 O O O O O - O - - - O O O O
GWXNR(P) 4~7 O - -
D O - O O O - O - - - O O O O
N O - O O O - O - - O O O O O
GWXNR S1 S2 D N
GWXNRP P S1 S2 D N
means GWXNR
[Area Setting]
Operand Description Data Type
S1 Address of data to start GWXNR operation with S2 WORD
S2 Address of data to start GWXNR operation with S1 WORD
D Address to save GWXNR operation result in WORD
N Number of data to execute WXNR operation WORD
[Flag Set]
Flag Description Device Number
Error If N value exceeds applicable device’s area. F110
S1+1 0 0 0 1 1 1 0 0 1 1 0 1 0 0 1 1 S2+1 1 0 1 0 1 0 0 1 1 0 1 0 1 0 0 1
S1+2 1 0 1 1 1 0 1 0 1 1 0 0 1 1 0 0 S2+2 0 0 1 1 0 1 0 1 1 0 1 1 0 1 1 1
n XNR n
S1+(N-2) 1 0 0 1 1 1 0 0 1 0 1 0 1 1 1 1 S2+(N-2) 1 1 1 1 1 1 0 0 0 0 1 1 0 0 1 1
S1+(N-1) 1 0 1 1 0 0 1 1 0 0 0 1 1 1 0 0 S2+(N-1) 0 0 1 1 0 0 1 1 1 1 0 0 1 0 1 1
b15 b8 b7 b0
D 0 0 1 0 1 1 0 0 1 0 0 1 1 0 1 1
D+1 0 1 0 0 1 0 1 0 1 0 0 0 0 1 0 1
D+2 0 1 1 1 0 0 0 0 1 0 0 0 0 1 0 0
D+(N-2) 1 0 0 1 1 1 1 1 0 1 1 0 0 0 1 1
D+(N-1) 0 1 1 1 1 1 1 1 0 0 1 0 1 0 0 0
4-171
Chapter 4 Details of Instructions
b15 b8 b7 b0
S1 1 1 0 0 0 0 1 1 1 1 0 0 1 1 1 1
S1+1 0 0 0 1 1 1 0 0 1 1 0 1 0 0 1 1
S1+2 1 0 1 1 1 0 1 0 1 1 0 0 1 1 0 0
b15 b8 b7 b0
n XNR S2 0 0 0 1 0 0 0 0 1 0 1 0 1 0 1 1
S1+(N-2) 1 0 0 1 1 1 0 0 1 0 1 0 1 1 1 1
S1+(N-1) 1 0 1 1 0 0 1 1 0 0 0 1 1 1 0 0
b15 b8 b7 b0
D 0 0 1 0 1 1 0 0 1 0 0 1 1 0 1 1
D+1 1 1 1 1 0 0 1 1 1 0 0 0 0 1 1 1
D+2 0 1 0 1 0 1 0 1 1 0 0 1 1 0 0 0
D+(N-2) 0 1 1 1 0 0 1 1 1 1 1 1 1 0 1 1
D+(N-1) 0 1 0 1 1 1 0 0 0 1 0 1 1 0 0 0
2) Program Example
(1) If Input Signal is changed from Off to On status, It saves the result of GWXNOR operation 5-word data from
P1000~P1004 with 5-word data from P1100~P1104 in 5-word data of P1200~P1204 respectively.
P00000
GWXNR P1000 P1100 P1200 5
4-172
-
COMMAND
BAND S1 S2 D N
COMMAND
BANDP P S1 S2 D N
means BAND
[Area Setting]
Operand Description Data type
S1 Address of data to start BAND operation with S2 BYTE
S2 Address of data to start BAND operation with S1 BYTE
D Address to save BAND operation result in BYTE
N Number of byte data to execute AND operation WORD
[Flag set]
Device
Flag Description
number
Error If N value exceeds applicable device’s area. F110
4-173
Chapter 4 Details of Instructions
2) Program example
If input signal P00000 is Off -> On, executes AND operation for 5 byte data of P1000~P1004 and 5 byte data of
P1100~P1104 and saves result in 5 byte data area of P1200~P1204.
4-174
-
COMMAND
BORD S1 S2 D N
COMMAND
BORP P S1 S2 D N
Means BORD
[Area Setting]
Operand Description Data type
S1 Address of data to start BOR operation with S2 BYTE
S2 Address of data to start BOR operation with S1 BYTE
D Address to save BOR operation result BYTE
N Number of byte data to execute OR operation WORD
[Flag Set]
Device
Flag Description
number
Error If N value exceeds applicable device’s area. Insturction is not executed. F110
S1+(N-2) 1 0 1 1 1 0 0 0 S2+(N-2) 1 1 0 0 1 1 0 1
S1+(N-1) 1 0 0 1 0 1 1 1 S2+(N-1) 1 0 1 0 1 0 1 1
b
b7
0
D 1 0 1 1 1 0 1 1
D+1 1 0 1 1 1 1 1 0
D+2 0 1 1 1 1 1 0 1
n
D+(N-2) 1 1 1 1 1 1 0 1
D+(N-1) 1 0 1 1 1 1 1 1
4-175
Chapter 4 Details of Instructions
2) Program example
If input signal P00000 is Off -> On, executes OR operation for 5 byte data of P1000~P1004 and 5 byte data of
P1100~P1104 and saves result in 5 byte data area of P1200~P1204.
4-176
-
COMMAND
BXOR S1 S2 D N
COMMAND
BXORP P S1 S2 D N
means BXOR
[Area Setting]
Operand Description Data Type
S1 Address of data to start BXOR operation with S2 BYTE
S2 Address of data to start BXOR operation with S1 BYTE
D Address to save BXOR operation result in BYTE
N Number of data to execute AND operation WORD
[Flag Set]
Flag Description Device Number
Error If N value exceeds applicable device’s area. F110
S1+(N-2) 1 0 1 1 1 0 0 0 S2+(N-2) 1 1 0 0 1 1 0 1
S1+(N-1) 1 0 0 1 0 1 1 1 S2+(N-1) 1 0 1 0 1 0 1 1
b
b7
0
D 0 0 1 0 0 0 1 1
D+1 0 0 0 0 0 1 1 0
D+2 0 1 0 1 0 1 0 0
n
D+(N-2) 0 1 1 1 0 1 0 1
D+(N-1) 0 0 1 1 1 1 0 0
4-177
Chapter 4 Details of Instructions
2) Program example
If input signal P00000 is Off -> On, executes XOR operation for 5 byte data of P1000~P1004 and 5 byte data of
P1100~P1104 and saves result in 5 byte data area of P1200~P1204.
4-178
-
COMMAND
BXNR S1 S2 D N
COMMAND
BXNRP P S1 S2 D N
means BXNR
[Area Setting]
Operand Description Data type
S1 Address of data to start BXNR operation with S2 BYTE
S2 Address of data to start BXNR operation with S1 BYTE
D Address to save BXNR operation result in BYTE
N Number of byte data to execute XNR operation WORD
[Flag set]
Device
Flag Description
number
Error If N value exceeds applicable device’s area. Instruction is not executed. F110
S1+(N-2) 1 0 1 1 1 0 0 0 S2+(N-2) 1 1 0 0 1 1 0 1
S1+(N-1) 1 0 0 1 0 1 1 1 S2+(N-1) 1 0 1 0 1 0 1 1
b
b7
0
D 1 1 0 1 1 1 0 0
D+1 1 1 1 0 1 0 0 1
D+2 1 0 1 0 1 0 1 1
n
D+(N-2) 1 0 0 0 1 0 1 0
D+(N-1) 1 1 0 0 0 0 1 1
4-179
Chapter 4 Details of Instructions
2) Program example
If input signal P00000 is Off -> On, executes XNR operation for 5 byte data of P1000~P1004 and 5 byte data of
P1100~P1104 and saves result in 5 byte data area of P1200~P1204.
4-180
-
COMMAND
BAND S D N
COMMAND
BANDP P S D N
means BAND
[Area Setting]
Operand Description Data type
S Address of data to start ABAND operation BYTE
D Address to save ABAND operation result in BYTE
N Number of byte data to execute ABAND WORD
[flag set]
Device
Flag Description
number
Error If N value exceeds applicable device’s area. F110
Zero If operation result is zero. F111
b7 b0
S1 1 0 1 1 1 0 1 0
S1+1 1 0 1 0 1 1 0 0
S1+2 1 0 1 1 1 0 0 1 b7 b0
n D 1 0 0 0 0 0 0 0
S1+(N-2) 1 0 1 1 1 0 0 0
S1+(N-1) 1 0 0 1 0 1 1 1
2) Program example
If input signal P00000 is Off -> On, executes AND operation for 5 byte data starting from P10000 and saves
result in P11000.
4-181
Chapter 4 Details of Instructions
XGK XGB
4.22.14 ABOR, ABORP ○ X
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
S O - O - - - - O O - O - - -
ABOR(P) D O - O - - - - O O - O - - - 5~7 O O -
N O - O O O - O - - O O O O O
COMMAND
ABOR S D N
COMMAND
ABORP P S D N
means ABOR
[Area Setting]
Operand Description Data type
S Address of data to start ABOR operation BYTE
D Address to save ABOR operation result in BYTE
N Number of byte data to execute OR WORD
[Flag set]
Flag Description Device number
Error If N value exceeds applicable device’s area. F110
Zero If operation result is zero. F111
b7 b0
S1 1 0 1 1 1 0 1 0
S1+1 1 0 1 0 1 1 0 0
S1+2 1 0 1 1 1 0 0 1 b
b7
0
n D 1 0 1 1 1 1 1 1
S1+(N-2) 1 0 1 1 1 0 0 0
S1+(N-1) 1 0 0 1 0 1 1 1
2) Program example
If input signal P00000 is Off -> On, executes OR operation for 5 byte data starting from P10000 and saves result
in P11000.
4-182
-
COMMAND
ABXOR S D N
COMMAND
ABXORP P S D N
means ABXOR
[Area Setting]
Operand Description Data type
S Address of data to start ABXOR operation BYTE
D Address to save ABXOR operation result in BYTE
N Number of byte data to execute XOR WORD
[Flag set]
Device
Flag Description
number
Error If N value exceeds applicable device’s area. F110
Zero If operation result is zero. F111
b7 b0
S1 1 0 1 1 1 0 1 0
S1+1 1 0 1 0 1 1 0 0
S1+2 1 0 1 1 1 0 0 1 b
b7
0
n D 1 0 0 0 0 0 0 0
S1+(N-2) 1 0 1 1 1 0 0 0
S1+(N-1) 1 0 0 1 0 1 1 1
2) Program example
If input signal P00000 is Off -> On, executes XOR operation for 5 byte data starting from P10000 and saves
result in P11000.
4-183
Chapter 4 Details of Instructions
XGK XGB
4.22.16 ABXNR, ABXNRP ○ X
Area Available Flag
Insturction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
S O - O - - - - O O - O - - -
ABXNR(P) D O - O - - - - O O - O - - - 5~7 O O -
N O - O O O - O - - O O O O O
COMMAND
ABXNR S D N
COMMAND
ABXNRP P S D N
means ABXNR
[Area Setting]
Operand Description Data type
S Address of data to start ABXNR operation BYTE
D Address to save ABXNR operation result in BYTE
N Number of byte data to execute ABXNR WORD
[Flag set]
Flag Description Device number
Error If N value exceeds applicable device’s area. F110
Zero If operation result is zero. F111
b7 b0
S1 1 0 1 1 1 0 1 0
S1+1 1 0 1 0 1 1 0 0
S1+2 1 0 1 1 1 0 0 1 b
b7
0
n D 1 0 0 0 0 0 0 0
S1+(N-2) 1 0 1 1 1 0 0 0
S1+(N-1) 1 0 0 1 0 1 1 1
2) Program example
If input signal P00000 is Off -> On, executes XNR operation for 5 byte data starting from P10000 and saves
result in P11000.
4-184
-
SEG S D Z
SEGP P S D Z
means SEG
[Area Setting]
Operand Description Data Type
S Address where data to decode in 7 segments is saved. BIN 32
D Address to save data decoded. BIN 32
Z Format to display BIN 16
[Flag Set]
Flag Description Device Number
Error To be set if Z’s format regulation is incorrect. F110
1) SEG( 7 Segments)
(1) It saves 7 segments of N digits decoded from S by Z’s specified format in D.
b15 b0
S 0 0 0 0 0 0 0 0 0 1 1 0 0 1 1 1
n = 1
n = 2
D 0 1 1 1 1 1 0 1 0 0 1 0 0 1 1 1
b15 b0
4-185
Chapter 4 Details of Instructions
2) Formation of Segments
S1 Formation of Data
Hexadecimal Bit 7 Segments b7 b6 b5 b4 b3 b2 b1 b0 displayed
0 0000 0 0 1 1 1 1 1 1 0
1 0001 0 0 0 0 0 1 1 0 1
2 0010 0 1 0 1 1 0 1 1 2
3 0011 0 1 0 0 1 1 1 1 3
4 0100 0 1 1 0 0 1 1 0 4
5 0101 0 1 1 0 1 1 0 1 5
b0
6 0110 0 1 1 1 1 1 0 1 6
b5 b6 b1
7 0111 0 0 1 0 0 1 1 1 7
8 1000 b4 b2 0 1 1 1 1 1 1 1 8
9 1001 0 1 1 0 1 1 1 1 9
b3
A 1010 0 1 1 1 0 1 1 1 A
B 1011 0 1 1 1 1 1 0 0 B
C 1100 0 0 1 1 1 0 0 1 C
D 1101 0 1 0 1 1 1 1 0 D
E 1110 0 1 1 1 1 0 0 1 E
F 1111 0 1 1 1 0 0 0 1 F
3) Program Example
(1) If Input Signal P00000 is changed from Off to On status, It displays for 4 digits that it is decoded from No.0 bit of
P1000 to No.0 of P1100 to 4 digits by 7 segments decoding format ‘h0004’ is saved in 2-word area of
P1100~P1101.
P00000
SEG P1000 P1100 h0004
4-186
Chapter 4 Details of Instructions
(D)BSUM S D
(D)BSUMP P S D
means BSUM
[Area Setting]
Operand Description Data Type
S Address of word data to count the number of 1s WORD/DWORD
D Address to save the counting result WORD
[Flag Setting]
Flag Description Device Number
Zero To be set if operation result is Zero F111
3) Program Example
(1) In case of D1000=h3333, If Input Signal P00000 is changed from Off to On status, It saves 8 in D1100.
4-187
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.24.2 BRST, BRSTP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
D O - O - - - - O - - O - - -
BRST(P) 4~6 O - -
N O - O - - - O - - O O - O -
BRST D N
BRSTP P D N
means BRST
[Area Setting]
Operand Description Data Type
D Device Number to display Reset Start Position BIT
N Number of bits to Reset WORD
[Flag Setting]
Flag Description Device Number
Error If N’s value is set to exceed specified D device’s maximum area. F110
2) Program Example
(1) If Input signal P00000 becomes On, It is Reset to 0 from 10-bit in P00103.
P00000
BRST P00103 10
4-188
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.24.3 ENCO, ENCOP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
S O O O O O - O - - O O O O O
ENCO(P) D O - O O O - O - - O O O O O 4~6 O O -
N O - O O O - O - - O O O O O
ENCO S D N
ENCOP P S D N
means ENCO
[Area Setting]
Operand Description Data Type
S Data or address to perform ENCO operation WORD
D Address to save operation result in WORD
N Available multipliers of bits to encode are 1 ~ 8 WORD
[Flag Setting]
Flag Description Device Number
If effective number of bits N is other than 0 ~ 8
Error F110
If effective number of bits starting from S exceeds device area
Zero If effective 2N data is Zero. F111
1) ENCO (Encode)
(1) It saves the result of the highest position of 1 made Hexadecimal among effective 2N data saved in S Device, in
specified device D.
(2) S if input with constant will be encoded in the input variable area although N’s value exceeds 4 (Searched
number of bits is 16).
(3) If N is 0, D will not be changed in details.
(4) It saves the result of the highest contact point position of 1 made Hexadecimal in 2N area, in D.
b15 b8 b7 b0 b15 b8 b7 b0
P0002 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 P0001
25 bits
5 bits
b15 b8 b7 b0
P0012 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0
2) Program Example
(1) In case of P1000=h4321 and P1200=h0004, If Input Signal is changed from Off to On status, h000E is saved in
P1100.
P00000
ENCOP P1000 P1100 P1200
4-189
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.24.4 DECO, DECOP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
S O O O O O - O - - O O O O O
DECO(P) D O - O O O - O - - - O O O O 4~6 O - -
N O - O O O - O - - O O O O O
DECO S D N
DECOP P S D N
means DECO
[Area Setting]
Operand Description Data Type
S Data address to perform DECO operation WORD
D Address to save operation result in WORD
N Available multipliers of bits to decode WORD
[Flag Setting]
Flag Description Device Number
If effective number of bits N is other than 0 ~ 8
Error N F110
Number of effective 2 which is started D is exceeds the device area
1) DECO (Decode)
(1) It decodes the lower N bits among saved data in specified S, and then the result saved in specified D device for 2N
bits. (8 bit is decoded to 256 bit)
(2) 1~8 is available for N.
(3) If N is 0, D will not be changed in details.
b15 b8 b7 b0
P0001 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0
N (5) bits
P0013 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 P0012
b15 b8 b7 b0 b15 b8 b7 b0
2) Program Example
(1) In case of D1000=h1234 and D1200=h0005, If Input Signal is changed from Off to On status, It saves
D1101=h0010 and D1100=h0000.
4-190
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.24.5 DIS, DISP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
S O O O O O - O - - - O O O O
DIS(P) D O - O O O - O - - - O O O O 4~6 O - -
N O - O O O - O - - O O O O O
DIS S D N
DISP P S D N
means DIS
[Area Setting]
Operand Description Data Type
S Data address to perform DIS operation WORD
D Address to save operation result in WORD
N Number of 4-bit data to be saved in starting D WORD
[Flag Setting]
Flag Description Device Number
To be set if N exceeds 4.
Error F110
If number of N’s range from D exceeds specified device area
1) DIS (Distribute)
(1) It saves the result of specified S device’s data divided into N nibbles (4-bit) in specified device D starting, in
regular order for the number of N.
(2) If N=0, the instruction will not be executed.
(3) Starting from device D, D+1, … , the lower 1 nibble will be filled with divided data, and the upper bits left with 0s.
(4) If N exceeds 4, Error Flag will be set.
b15 b8 b7 b0
D 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1
9
D+1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1
B
D+2 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0
E
D+3 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0
8
8 E B 9
S 1 0 0 0 1 1 1 0 1 0 1 1 1 0 0 1
b15 b8 b7 b0
2) Program Example
(1) In case of D1000=h1234 and D1200=h0003, If Input Signal P00000 is changed from Off to On status, It saves
D1100=h0004, D1101=h0003 and D1102=h0002.
4-191
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.24.6 UNI, UNIP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
S O O O O O - O - - - O O O O
UNI(P) D O - O O O - O - - - O O O O 4~6 O - -
N O - O O O - O - - O O O O O
UNI S D N
UNIP P S D N
means UNI
[Area Setting]
Operand Description Data Type
S Data address to perform UNI operation WORD
D Address to save operation result in WORD
N Number of 4-bit data to be united from S WORD
[Flag Setting]
Flag Description Device Number
If number of N’s range starting from S exceeds acceptable range of specified device, it
Error will be set. F110
To be set if N exceeds 4.
1) UNI (Unite)
(1) It saves the result of the united lower 4 bits in the N words starting from S, in word data D. At this moment the
upper 12 bit ignored.
(2) Each 4-bit data will be united from the lower in regular order and saved in word data D.
(3) Except the lower N 4-bit data in word data D, all will be 0.
(4) If N exceeds 4, Error Flag will be set.
b15 b8 b7 b0
S 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1
S+1 0 1 0 0 1 0 1 0 1 0 0 0 1 0 0 1
S+2 0 1 1 1 0 0 0 0 1 0 0 0 1 0 1 1
S+3 0 1 1 1 0 0 0 0 1 0 0 0 1 1 1 1
D 1 1 1 1 1 0 1 1 1 0 0 1 1 1 0 1
b15 b8 b7 b0
2) Program Example
(1) In case of D1000=h0004, D1001=h003 ,D1002=h0002 and D1200=h0003, In Input Signal P00000 is changed
from Off to On status, It saves D1100=h0234.
4-192
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.24.7 WTOB, WTOBP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
S O O O O O - O - - O O O O O
WTOB(P) D O - O O O - O - - - O O O O 2~4 O - -
N O - - - - - O - - - O O O O
WTOB S D N
WTOBP P S D N
means WTOB
[Area Setting]
Operand Description Data Type
S WORD data or Area Number where WORD data is saved WORD
D Start Number of area to save data converted to Byte WORD
N Number of converted Byte WORD
[Flag Setting]
Flag Description Device Number
Error If S or D is exceeds specified device’s acceptable range. F110
1) WTOB
(1) It saves N bytes resulted from each word data divided into 2 bytes starting from S, in starting D. At this
time, the upper byte will be filled with 0s, and the lower byte with byte value divided.
(2) In case N=0, instruction is not executed
b15 b8 b7 b0 b15 b8 b7 b0
S Upper byte Lower byte D h00 Lower byte data
S+1 Upper byte Lower byte D+1 h00 Upper byte data
D+2 h00 Lower byte data
Upper byte Lower byte D+3 h00 Upper byte data N
byte
2) Program Example
(1) In case of D01000=h1234, D01001=h5678,D01200=h0003, If Input Signal P00000 is changed from Off to On,
It saves D01100=h0034, D01101=h0012 and D01102=h0078.
P00000
WTOBP D01000 D01100 D01200
4-193
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.24.8 BTOW, BTOWP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
S O O O O O - - - - O O O O O
BTOW(P) D O - O O O - - - - - O O O O 2~4 O - -
N O - O O O - - - - - O O O O
BTOW S D N
BTOWP P S D N
means BTOW
[Area Setting]
Operand Description Data Type
S Byte data or Area Number where Byte data is saved WORD
D Area to save data converted to WORD WORD
N Number of bytes to unite. WORD
[Flag Setting]
Flag Description Device Number
Error If S or D is exceeded specified device’s acceptable range F110
1) BTOW
(1) It saves the result of the lower N byte data united with word data starting from S, in starting D. At this time,
if N is an odd number, the upper of device saved last will be filled with 0s.
(2) If N=0, the instruction will not be executed.
b15 b8 b7 b0 b15 b8 b7 b0
st nd st
S 1 byte data D 2 byte data 1 byte data
nd th rd
S+1 2 byte data D+1 4 byte data 3 byte data
rd
S+2 3 byte data
N bytes th
S+3 4 byte data Nth byte data n-1th byte data
2) Program Example
(1) In case of D1000=h0012, D1001=h0034 and D1200=h0003, In Input Signal is changed from Off to On status, It
saves D1100=h3412 and D1101=h0045.
4-194
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.24.9 IORF, IORFP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
S1 - - - - - - - - - O - - - -
IORF(P) S2 O O O O O - O - - O O O O O 4~6 O - -
S3 O O O O O - O - - O O O O O
IORF IORF S1 S3 S3
IORFP IORFP S1 S2 S3
[Area Setting]
Operand Description Data Type
S1 Position (base + slot) I/O module to process immediately. WORD
S2 Upper 32-bit data or Device Number to mask DWORD
S3 Lower 32-bit data or Device Number to mask DWORD
2) Program Example
(1) ‘01’ means No.1 slot of No.0 base. If I/O Fixed allocation is specified, applicable module address is
P00040~P0007F in 64 points Input module.
(2) In case of D1000=h00FF and D1100=hFF00, if Input signal is changed from Off to On,
P0004 is not refresh the input data since D1100’s the lower 8 bits is h00.
P0005 is refresh the input data since D1100’s the upper 8 bits is hFF.
P0006 is refresh the input data since D1000’s the lower 8 bits is hFF.
P0007 is not refresh the input data since D1000’s the upper 8 bits is h00.
Remark
(1) In case of using hybrid module, S2 value is the output mask data, S3 value is the input mask data. If it refreshes
hybrid module with 16 points input and 16 points output, S3's data becomes the mask data of the input part, S2's
data becomes the mask data of the output part.
4-195
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.24.10 SCH, SCHP, DSCH, DSCHP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
S1 O O O O O - O - - O O O O O
SCH(P) S2 O - O O O - O - - - O O O O
4~7 O O -
DSCH(P) D O - O O O - O - - - O O O O
N O - O O O - O - - O O O O O
(D)SCH S1 S2 D N
(D)SCHP P S1 S2 D N
means (D)SCH
[Area Setting]
Operand Description Data Type
S1 Data or address to searches for WORD/DWORD
S2 Start address of the area to searches for WORD/DWORD
D Address to save the position and number identical WORD
N Searching range of SCH operation WORD
[Flag Setting]
Flag Description Device Number
Error To be set if N exceeds applicable S1 device’s range F110
Zero To be set if no data is found identical. F111
S1 123 123
S2 10
S2+1 500 Identical data Searching progress
S2+2 123 D Position identical
Searching range(N)
-123 D+1 Number identical
S2+(N-2) 20
S2+(N-1) 123
123
(5) As its result, specified D, D+1 device will be “0” if no identical data is found.
4-196
Chapter 4 Details of Instructions
3) Program Example
(1) It searches in number of D01300 word data in D01100 for the value identical to word data D01000 in regular order.
(2) It saves the firest vlaue’s address in D, the total of the value identical to D01000 in D01201.
(3) In case of D01000=h1234, D01100=h1111, D01101=h2222, D01102=h1234, D01103=h1234, D01104=h3333, If
D01300=h0006, D01200=h0003 is for the position D01102 first united data. And D01202=h0002 is saved for 2
united number.
P00000
SCHP D01000 D01100 D01200 D01300
4-197
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.24.11 MAX, MAXP, DMAX, DMAXP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
S O O O O O - O - - - O O O O
MAX(P)
D O - O O O - O - - - O O O O 4~6 O O -
DMAX(P)
N O - O O O - O - - O O O O O
(D)MAX S D N
(D)MAXP P S D N
means (D)MAX
[Area Setting]
Operand Description Data Type
S Data address to start MAX operation INT/DINT
D Address to save operation result. INT/DINT
N Number of words to execute MAX operation starting from S WORD
[Flag Setting]
Flag Description Device Number
Error To be set if N exceeds applicable device’s range. F110
Zero To be set if operation result is 0. F111
1) MAX (Maximum)
(1) It searches from word data S up to N range for the maximum value to save in D.
(2) Comparison in size will be performed by signed operation.
(3) If operation result is Zero, Zero Flag will be set.
(4) If N=0, the instruction will not be executed.
4-198
Chapter 4 Details of Instructions
3) Program Example
(1) In case of D01000=1111, D01001=3333, D01002=2222, If Input Signal P00000 is changed from Off to On
status, It saves D01100=3333.
P00000
MAXP D01000 D01100 D01200
4-199
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.24.12 MIN, MINP, DMIN, DMINP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
S O O O O O - O - - - O O O O
MIN(P)
D O - O O O - O - - - O O O O 4~6 O O -
DMIN(P)
N O - O O O - O - - O O O O O
(D)MIN S D N
(D)MINP P S D N
means (D)MIN
[Area Setting]
Operand Description Data Type
S Data address to start MIN operation INT/DINT
D Address to save operation result. INT/DINT
N Number of words to execute MIN operation starting from S WORD
[Flag Setting]
Flag Description Device Number
Error To be set if N exceeds applicable device’s range F110
Zero To be set if operation result is 0 F111
1) MIN (Minimum)
(1) It searches from word data S up to N range for the minimum value to save in D.
(2) Comparison in size will be performed by signed operation.
(3) If operation result is Zero, Zero Flag will be set.
(4) If N=0, the instruction will not be executed.
S 123
S+1 10
S+2 500 Minimum value
S+3 123 Searching range D -123
(n )
S + (n-4) -123
S + (n-3) 20
S + (n-2) 123
S + (n-1) 123
4-200
Chapter 4 Details of Instructions
3) Program Example
(1) In case of D01000=1111, D01001=3333, D01002=2222, D01200=h0003, If Input Signal P00000 is changed from
Off to On status, It saves D01100=1111.
P00000
MINP D01000 D01100 D01200
4-201
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.24.13 SUM, SUMP, DSUM, DSUMP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
S O O O O O - O - - - O O O O
SUM(P)
D O - O O O - O - - - O O O O 4~6 O O O
DSUM(P)
N O - O O O - O - - O O O O O
(D)SUM S D N
(D)SUMP P S D N
means (D)SUM
[Area Setting]
Operand Description Data Type
S Data address to start SUM operation INT/DINT
D Address to save operation result. INT/DINT
N Number of words to execute SUM operation starting from S WORD
[Flag Setting]
Flag Description Device Number
Error To be set if N exceeds applicable device’s range, or overflow occurs during operation. F110
Zero To be set if operation result is 0. F111
Carry To be set if overflow occurs during operation. F112
4-202
Chapter 4 Details of Instructions
3) Program Example
(1) In case of Dp1000=h1111, D01001=h3333, D01002=h2222, D01200=h0003, If Input Signal P00000 is changed
from Off to On status, it saves D01100=h6666.
P00000
SUMP D01000 D01100 D01200
4-203
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.24.14 AVE, AVEP, DAVE, DAVEP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
S O O O O O - O - - - O O O O
AVE(P)
D O - O O O - O - - - O O O O 4~6 O O -
DAVE(P)
N O - O O O - O - - O O O O O
(D)AVE S D N
(D)AVEP P S D N
means AVE
[Area Setting]
Operand Description Data Type
S Data address to start AVE operation INT/DINT
D Address to save AVE operation result INT/DINT
N Number of words to execute AVE operation starting from S INT/DINT
[Flag Setting]
Flag Description Device Number
Error To be set if N exceeds applicable device’s range F110
Zero To be set if operation result is 0 F111
S 123
S+1 10
S+2 500 Average
S+3 123 D 112
n
S + (n-4) -123
S + (n-3) 20
S + (n-2) 123
S + (n-1) 123
4-204
Chapter 4 Details of Instructions
3) Program Example
(1) In case of D01000=1111, D01001=3333, D01002=2222, D01200=h0003, If Input Signal is changed from Off to
On status, it saves D01100=2222.
P00000
AVEP D01000 D01100 D01200
4-205
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.24.15 MUX, MUXP, DMUX, DMUXP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
S1 O O O O O - O - - - O O O O
MUX(P) S2 O O O O O - O - - - O O O O
4~7 O - -
DMUX(P) D O - O O O - O - - - O O O O
N O - O O O - O - - O O O O O
(D)MUX S1 S2 D N
(D)MUXP P S1 S2 D N
means (D)MUX
[Area Setting]
Operand Description Data Type
S1 Position to select (0~N-1) WORD/DWORD
S2 Head position of data to select WORD/DWORD
D Area where selected value will be saved WORD/DWORD
N Range of data to select WORD
[Flag Setting]
Flag Description Device Number
If N exceeds applicable device’s range
Error F110
Position to select data exceeds searching range.
1) MUX
(1) It transfers data applicable to S1st among N word data from S2 to D.
Position to select
S1 4 S2 70
S2+1 35
S2+2 5
S2+3
357
D 357
10
S2+(N-2) 53
S2+(N-1) 20
77
2) DMUX
(1) It transfers data applicable to No.S1 among N double word data from S2 to D.
3) Program Example
(1) In case of D01100=h1111, D01101=h3333, D01102=h2222, D01000=h0001, D01300=h0003, If Input Signal
P00000 is changed from Off to On, it saves D01200=h3333.
P00000
MUXP D01000 D01100 D01200 D01300
4-206
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.24.16 DETECT, DETECTP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
S1 O O O O O - O - - - O O O O
S2 O O O O O - O - - O O O O O
DETECT(P) 4~6 O O -
D O - O O O - O - - - O O O O
N O - O O O - O - - O O O O O
DETECT S1 S2 D N
DETECTP P S1 S2 D N
means DETECT
[Area Setting]
Operand Description Data Type
S1 Start position of data to detect WORD
S2 Allowance WORD
D 1st changed position & the number searched WORD
N Range WORD
[Flag Setting]
Flag Description Device Number
Error If N exceeds applicable device’s range F110
Zero To be set if no data exceeds the allowance specified in searching result S2. F111
1) DETECT
(1) It saves the position of the 1st value out of allowance in D if the value is larger than allowance (S1) among N data
from S1 (signed operation, searching unavailable if identical to allowance), and the sum of the number of the data
larger than S1 in D+1.
(2) If N=0, the instruction will not be executed.
2) Program Example
(1) In case of D01000=h1111, D01001=h3333,D01002=h2222, D01100=h3000, D01300=h0003, If Input Signal is
P00000 is changed from Off to On status, it saves D01200=h3333, D01201=h0001.
P00000
DETECTP D01000 D01100 D01200 D01300
4-207
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.24.17 RAMP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
N1 O O O O O - O - - O O O O O
N2 O O O O O - O - - O O O O O
RAMP D1 O - O - - - - - - - - O O O 4~7 - - -
N3 O O O O O - O - - O O O O O
D2 O - O - - - - - - - - O O O
[Area Setting]
Operand Description Data Type
N1 Initial value WORD
N2 Final value WORD
D1 Present value WORD
N3 Number of execution (the number of scan) WORD
D2 Instruction completed address (1: complete, 0: in progress or in Off state) WORD
1) RAMP
(1) It saves the value changed from the initial to the final value in the straight line during specified N3
number of scans in D1, and the number of times of scans executed presently in D1+1.
(2) If the instruction is completed, D2 value is made 1. (D2’s No.0 bit device set)
(3) It saves the value changed from specified N1 value to N2 value in the straight line during specified N3 number of
scans executed in D1. And the value saved in D1 should be operated per scan as follows;
350
300
Value saved in D1 250
200
Specified N1 value (0) 150 Specified
100 N2 value (350)
50
(5) If the changed value operated per scan is not divided by an integer, let it corrected be specified N2
value from specified N3 number of times executed, which may make straight slope unavailable.
(6) It specifies the number of times of scans in N3 till executed from N1 to N2. If N3=0, there will be no operation.
(7) D1+1 used by system saves the times of executed instruction. Thus, an undesirable result may be caused if it is
modified arbitrarily by user.
(8) If the instruction is completed up to the final value, specified D2 device completed is 1.
(9) Though the instruction is Off while the instruction is executed, details of D1 (present value) are not changed. If
the instruction is back On, RAMP instruction restarts the work.
(10) Set 1 to completed device to cancel the RAMP instruction in the middle.
(11) Turn the instruction Off Æ On to restart completed RAMP instruction after initialized.
(12) Do not change specified N1 and N2 value before specified D2+0 device completed is On. Since value to be
saved in D1+1 is operated with the identical formula per scan, the change of N1 or N2 will cause sudden effect.
4-208
Chapter 4 Details of Instructions
2) Program Example
(1) In case of D01000=1000, D01100=2000, D01300=100, If Input Signal is changed from Off to On status,
D01200 is increased by 10 per 1 scan and number of times of scans is saved in D01201.
(2) If the 100 scans is completed, D01400’s No.0 bit will be set.
P00000
RAMP D01000 D01100 D01200 D01300 D01400
Caution
(1) Be careful of using indirect designation (#) or index ([Z]) because the RAMP instruction has internal
processing parts without contact point ON.
For example, an error occurs without contact point ON if you use M100[Z10] for one of the RAMP instruction
operands and if Z10’s value exceeds 1947 that can be outside the M area.
4-209
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.24.18 SORT, DSORT
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
S O O O O O - O - - - O O O O
N1 O - O O O - O - - O O O O O
(D)SORT N2 O - O O O - O - - O O O O O 4~7 O - -
D1 O - O - - - O - - - O O O O
D2 O - O - - - O - - - - O O O
(D)SORT S N1 N2 D1 D2
means (D)SORT
[Area Setting]
Operand Description Data Type
S Start position of data to align WORD/DWORD
N1 Aligning range & order (in ascending/descending order) WORD
N2 Execution range per time (< Aligning range) WORD
D1 Instruction completed address (1: complete, 0: in progress or in Off state) WORD
D2 Auxiliary area WORD
[Flag Setting]
Flag Description Device Number
If N1’s value exceeds applicable area
Error F110
If specified N1+1 aligning order is other than 0 or 1
1) SORT
(1) It sorts (aligns) N1-point Binary 16-bit data from S1 in ascending(0)/descending(1) order based on N1+1 value.
-124
Data before sorted
-10
35 0 Sorted in ascending order
35
-10 500
500
-124 500
1
35
Sorted in descending order
-10
N1
-124
4 N1+0
0 N1+1
(2) Sorting by SORT instruction needs several scans. Scan times till instruction completed is the value divided by the
number of data compared with the maxiumum execution times in specified N2’s 1 time execution (decimals will be
omitted). The larger N2’s value is, the fewer the number of scans is and the longer scanning time is.
(3) If N2=0, the instruction will not be executed.
(4) Maximum execution times till sorting is completed shall be operated as follow;
Maximum execution times till completed = (N1) * (N1 -1) ÷ 2 ÷ N2 [times] For example, if N1=10 and N2=1, 10 *
(10-1) ÷ 2 ÷ 1=45(times). At this moment, if N2=2, 45 ÷ 2 = 22.5 → 23 [scans] will be taken to complete sorting.
(5) Specified D1 device (completed device) saves 1 if SORT Instruction completed. After sorted, turn input contact
point (Instruction) OFF to make specified D1 device’s value 0.
(6) In specified D2 device, 2-point (SORT)/4-point (DSORT) is used by system when the instruction is executed. User
shall not change 2-point (SORT)/4-point (DSORT) in specified D2 device.
(7) If N has been changed while being sorted, let it sorted with the number of sorted data after changed.
4-210
Chapter 4 Details of Instructions
2) Program Example
P00000
SORT P1000 P1100 P1200 P1300 P1400
Caution
(1) Be careful of using indirect designation (#) or index ([Z]) because the SORT/DSORT instruction has internal
processing parts without contact point ON.
For example, an error occurs without contact point ON if you use M100[Z10] for one of the SORT instruction
operands and if Z10’s value exceeds 1947 that can be outside the M area.
4-211
Chapter 4 Details of Instructions
FIWR S D
FIWRP P S D
means FIWR
[Area Setting]
Operand Description Data Type
S Data to input WORD
D Start position of table WORD
[Flag Setting]
Flag Description Device Number
Error If data table’s range after data is added exceeds applicable device’s range F110
Nth data
0
(1) Table size depends on how to operate. In data table process related instructions, data table size is decided
through the number of data saved in the device designated as start position of table. Thus, the table needs to be
initialized before used. If table size exceeds applicable device’s range, error will occur. All the table process
instructions attach ‘0’ to the end of the table. However, how to identify the end of the table depends on the
number of data only specified in table start address.
(2) All the data in the table will be identified in WORD format. If you want to save INT or BYTE type of data in the
table, device’s data type shall be changed through MOVE Instruction, etc. In addition, Insert and Delete operation
shall be repeatedly used to save DWORD data. Data table size is unlimited. However, since the table can’t
exceed device area, its maximum size is the value resulted from device’s size (where table is located) minus
table start address .
(3) All the table related instructions can change the number of data, whose error can not be detected, though. That is
to say, even if user has changed the number of data abitrarily, table process instruction not knowing this takes it
for normal. Consequently, the user is recommended previously to secure table area and table size and inspect
the area before using the table instruction.
4-212
Chapter 4 Details of Instructions
3) Program Example
(1) In case P1000=3333, P1100=2, P1101=1111, P1102=2222, if input signal P00000 is off->on, 3333 is
added at the end of table and the no. of table increase as 1, P1100=3, P1103=3333 is saved.
P00000
FIWRP P1000 P1100
4-213
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.25.2 FIFRD, FIFRDP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
S O O O O O - O - - O O O O O
FIFRD(P) 2~4 O 0 -
D O - O - - - - - - - - O O O
FIFRD S D
FIFRDP P S D
means FIFRD
[Area Setting]
Operand Description Data Type
S Start position of data table WORD
D Position to save in the value read from data table WORD
[Flag Setting]
Flag Description Device Number
Error If data table’s range exceeds applicable device’s range F110
Zero If no data is available in data table F111
Executed S 2
S 3
S+1 1234 S+1 2345
S+2 2345 S+2 3456
S+3 . 3456 S+3 0
.
. 0 .
0
. .
. .
0
D 1234
2) Program Example
(1) In case P1000=3, P1001=1111, P1002=2222, P1003=3333, if input signal P00000 is Off ->On, 1111, first data of
data table, is saved P1100, and data table decrease as 1, P1000=2, P1001=2222, P1002=3333, P1003=0 is
saved.
P00000
FIFRDP P1000 P1100
4-214
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.25.3 FILRD, FILRDP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
S O O O O O - O - - O O O O O
FILRD(P) 2~4 O O -
D O - O - - - - - - - - O O O
FILRD S D
FILRDP P S D
means FILRD
[Area Setting]
Operand Description Data Type
S Start position of data table WORD
D Position to save in the value read from data table WORD
[Flag Setting]
Flag Description Device Number
Error If data table’s range exceeds applicable device’s range F110
Zero If no data is available in data table F111
2) Program Example
(1) In case P1000=3, P1001=1111, P1002=2222, P1003=3333, if input signal P00000 is Off->On, 3333, the last
data of data table, is saved at P1100, data table is decreased as 1, P1000=2, P1003=0 is saved.
P00000
FILRDP P1000 P1100
4-215
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.25.4 FIINS, FIINSP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
S O O O O O - O - - O O O O O
FIINS(P) D O - O - - - - - - - - O O O 4~6 O - -
N O - O O O - O - - O O O O O
FIINS S D N
FIINSP P S D N
means FIINS
[Area Setting]
Operand Description Data Type
S Data value to input WORD
D Start position of data table WORD
N Position to save the input value in WORD
[Flag Setting]
Flag Description Device Number
If data table’s range exceeds applicable device’s range.
Error F110
If N value is larger than the present data size (speicified D) + 1
D 3 Executed D 4
D+1 1111 D+1 1111
D+2 2222 D+2 -1111
D+3 3333 D+3 2222
.
. 0 D+4 3333
.
. .
. 0 . 0
2) Program Example
(1) In case P1000=1234, P1100=3, P1101=1111, P1102=2222, P1103=3333, P1200=3, if input signal P00000 is
Off->On, 1234 is inserted at the third position of data table, P1103=1234, P1104=3333 is saved and P1100,
effective number within data table, is increased as1 and become 4.
P00000
FIINSP P1000 P1100 P1200
4-216
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.25.5 FIDEL, FIDELP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
S O O O O O - O - - O O O O O
FIDEL(P) D O - O - - - - - - - - O O O 4~6 O - -
N O - O O O - O - - O O O O O
FIDEL S D N
FIDELP P S D N
means FIDEL
[Area Setting]
Operand Description Data Type
S Start position of data table WORD
D Data value deleted WORD
N Position of data to delete WORD
[Flag Setting]
Flag Description Device Number
If data table’s range exceeds applicable device’s range.
Error F110
If position of data to delete exceeds table data size.
S 4 Executed S 3
S+1 1111 S+1 1111
S+2 -1111 S+2 -1111
S+3 2222 S+3 3333
S+4 3333 . 0
.
. 0
.
. 0
.
. 0
D 2222
2) Program Example
(1) In case P1000=4, P1001=1111, P1002=2222, P1003=3333, P1004=4444, P1200=1, if input signal P00000 is
Off -> On, 1111, the first data of data table, is saved at P1100, and P1000, effective number in the data table, is
decreased as 1, and become 3, and P1001=2222, P1002=3333, P1003=4444, P1004=0.
P00000
FIDELP P1000 P1100 P1200
4-217
Chapter 4 Details of Instructions
(D)BINDA S D
(D)BINDAP P S D
means BINDA
[Area Setting]
Operand Description Data Type
S Data or address to convert to ASCII INT/DINT
D Address to save operation result in STRING
b15 b8 b7 b0 b15 b8 b7 b0
S 0 D 10,000-digit ASCII code Sign
D+1 100-digit ASCII code 1,000-digit ASCII code
16-bit Binary data D+2 1-digit ASCII code 10-digit ASCII code
D+3 0
(6) For example, if –12345 is specified in S, the result after D will be saved as below;
b15 b0 b15 b8 b7 b0
S - 1 2 3 4 5 D h31 (1) h2D (-)
D+1 h33 (3) h32 (2)
D+2 h35 (5) h34 (4)
D+3 h00
b15 b0 b15 b8 b7 b0
S 2 3 4 5 D h33 (3) h32 (2)
D+1 h35 (5) h34 (4)
D+2 h00
4-218
Chapter 4 Details of Instructions
b15 b8 b7 b0
D 1000000000-digit ASCII code Sign data
3) Program Example
P00000
BINDAP P1000 P1100
4-219
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.26.2 BINHA, BINHAP, DBINHA, DBINHAP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
BINHA(P) S O O O O O - O - - O O O O O
2~4 O - -
DBINHA(P) D O - O O O - O - - - O O O O
(D)BINHA S D
(D)BINHAP P S D
means BINHA
[Area Setting]
Operand Description Data Type
S Data or address to convert to ASCII WORD/DWORD
D Address to save operation result in BIN 32
[Flag Setting]
Flag Description Device Number
Error To be set if specified area #D is exceeded F110
b15 b8 b7
b0 b15 b8 b7 b0
rd th
S D 3 -digit ASCII code 4 -digit ASCII code
st nd
D+1 1 -digit ASCII code 2 digit ASCII code
16-bit Binary data D+2 0
(4) For example, if 02A6H is specified in S, the result after will be saved as below;
b15 b8 b7 b0 b15 b8 b7 b0
S 02A6H D h32 (2) h30 (0)
D+1 h36 (6) h41 (A)
D+2 h00
4-220
Chapter 4 Details of Instructions
b15 b8 b7 b0
th th
D 7 -digit ASCII code 8 -digit ASCII code
th th
D+1 5 -digit ASCII code 6 -digit ASCII code
rd th
S+1 S D+2 3 -digit ASCII code 4 -digit ASCII code
Upper 16-bit Lower 16-bit D+3
st
1 -digit ASCII code
nd
2 digit ASCII code
D+4 00H
32-bit BIN data
3) Program Example
P00000
BINHAP P1000 P1100
4-221
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.26.3 BCDDA, BCDDAP, DBCDDA, DBCDDAP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
BCDDA(P) S O O O O O - O - - O O O O O
2~4 O - -
DBCDDA(P) D O - O O O - O - - - O O O O
(D)BCDDA S D
(D)BCDDAP P S D
means BCDDA
[Area Setting]
Operand Description Data Type
S BCD data or address to convert to ASCII BCD
D Address to save operation result in STRING
[Flag Setting]
Flag Description Device Number
Error If input BCD data exceeds operation range F110
(4) For example, h9105 is specified in S, the result after D will be saved as below.
4-222
Chapter 4 Details of Instructions
b15 b8 b7 b0
D 1000000-digit ASCII code 10000000-digit ASCII code
S+1 S
b31
D+1 10000-digit ASCII code 100000-digit ASCII code
b16 b15 b0
D+2 100-digit ASCII code 1000-digit ASCII code
D+3 1-digit ASCII code 10-digit ASCII code
10,000 digits 1 digit 0
100,000 digits 10 digits
1,000,000 digits 100 digits
10,000,000 digits 1,000 digit
3) Program Example
P00000
BCDDAP P1000 P1100
4-223
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.26.4 DABIN, DABINP, DDABIN, DDABINP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
DABIN(P) S O O O O O - O - - O O O O O
2~4 O - -
DDABIN(P) D O - O O O - O - - - O O O O
(D)DABIN S D
(D)DABINP P S D
means DABIN
[Area Setting]
Operand Description Data Type
S Address where decimal ASCII data to convert to binary is saved STRING
D Address to save operation result in INT/DINT
[Flag Setting]
Flag Description Device Number
To be set if input ASCII data exceeds operation range
Error To be set if input ASCII string length exceeds the maximum string length(31) F110
To be set if other string than sign and 0~9 is in input ASCII string
b15 b8 b7 b0 b15 b0
S 10000-digit ASCII code Sign data D
S+1 100-digit ASCII code 1000-digit ASCII code
1-digit ASCII code 10-digit ASCII code Binary16-bit data
End of string (Null)
b15 b8 b7 b0 b15 b0
S h32 (2) h2D (D) D - 2 5 1 0 8
S+1 h31 (1) h35 (5)
S+2 h38 (8) h30 (0)
h00 (NULL)
4-224
Chapter 4 Details of Instructions
b15 b8 b7 b0
S 1000000000-digit ASCII code Sign data
S+4 10-digit ASCII code 100-digit ASCII code 32-bit BIN data
S+5 End of string 1-digit ASCII code
3) Program Example
P00000
DABINP P1000 P1100
4-225
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.26.5 HABIN, HABINP, DHABIN, DHABINP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
HABIN(P) S O O O O - O - - O O O O O O
2~4 O - -
DHABIN(P) D O - O O - O - - - O O O O O
(D)HABIN S D
(D)HABINP P S D
means HABIN
[Area Setting]
Operand Description Data Type
S Address where Hexadecimal ASCII data to convert to binary is saved STRING
D Address to save operation result in WORD/DWORD
[Flag Setting]
Flag Description Device Number
To be set if string length exceeds the maximum string length.
Error To be set if input data exceeds operation range F110
To be set if other string than 0~F is in string
b15 b8 b7 b0 b15 b8 b7 b0
S 3rd-digit ASCII code 4th-digit ASCII code D
S+1 1st-digit ASCII code 2nd-digit ASCII code
b15 b8 b7 b0 b15 b8 b7 b0
S h41 (A) h35 (5) D 5A8DH
S+1 h44 (D) h38 (8)
S+2 h00 (NULL)
4-226
Chapter 4 Details of Instructions
b15 b8 b7 b0
th th
S 7 -digit ASCII code 8 -digit ASCII code
S+1 5th-digit ASCII code 6th-digit ASCII code D+1 D
rd th b31 b16 b15 b0
S+2 3 -digit ASCII code 4 -digit ASCII code
Upper 16-bit Lower 16-bit
st nd
S+3 1 -digit ASCII code 2 -digit ASCII code
32-bit Binary data
3) Program Example
P00000
HABINP P1000 P1100
4-227
Chapter 4 Details of Instructions
XGK XGB
4.26.6 DABCD, DABCDP, DDABCD, DDABCDP ○ ○
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
DABCD(P) S O O O O O - O - - O O O O O
2~4 O - -
DDABCD(P) D O - O O O - O - - - O O O O
(D)DABCD S D
(D)DABCDP P S D
means DABCD
[Area Setting]
Operand Description Data Type
S Address where decimal ASCII data to convert to BCD is saved STRING
D Address to save operation result in BCD
[Flag Setting]
Flag Description Device Number
If ASCII string exceeds BCD range(0~9, h30 ~ h39 in ASCII)
Error F110
If ASCII string length exceeds 4(DABCD)/8(DDABCD)
D+1 D
b15 b8 b7 b0 b31 b16 b15 b0
S 1000000-digit ASCII code 10000000-digit ASCII code
S+1 10000-digit ASCII code 100000-digit ASCII code
10,000 digits 1 digit
S+2 100-digit ASCII code 1000-digit ASCII code
100,000 digits 10 digits
S+3 1-digit ASCII code 10-digit ASCII code
S+4 0 1,000,000 digits 100 digits
10,000,000 digits 1,000 digit
4-228
Chapter 4 Details of Instructions
3) Program Example
(1) If Input Signal P00000 is changed to On, It converts ASCII code saved in D00000~D00001 to BCD value and
saved ‘1284’ in D00010.
P00000
DABCDP D00000 D00010
4-229
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.26.7 LEN, LENP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
S O - O O - - O - - - O O O O
LEN(P) 2~4 - - -
D O - O - - - O - - - O O O O
LEN S D
LENP P S D
means LEN
[Area Setting]
Operand Description Data Type
S Start position of string STRING
D Position to save string length WORD
1) LEN( Length)
(1) It calculates the string length saved in ASCII starting from S to save in D by 2 digits per word.
(2) Even if specified string S exceeds 31 characters with no NULL code, it will return 31 characters without any error.
b15 b8 b7 b0 b15 b8 b7 b0
S h33 (3) h32 (2) D 4
S+1 h35 (5) h34 (4)
S+2 h00
2) Program Example
(1) If Input Signal P00000 is changed to On, the string size of ‘124’ saved in D00000~D00001 is operated and ‘3’
saved in D10.
b15 b8 b7 b0 b15 b8 b7 b0
D0 h31 (1) h32 (2) D10 3
D1 h00 h34 (4)
D2 h36
P00000
LEN D0000 D00010
4-230
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.26.8 STR, STRP, DSTR, DSTRP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
S1 O - O - - - O - - - O O O O
STR(P)
S2 O - O O O - O - - O O O O O 4~6 O - -
DSTR(P)
D O - O - - - O - - - O O O O
(D)STR S1 S2 D
(D)STRP P S1 S2 D
means STR
[Area Setting]
Operand Description Data Type
S1 Data address (0~28) where S2’ decimal places are saved WORD
S2 Binary data to convert INT/DINT
D Address to save converted string in STRING
[Flag Setting]
Flag Description Device Number
Error To be set if specified decimal places are other than 0~28 F110
1) STR (String)
(1) It converts specified Binary 16-bit data S2 with decimal places added to specified position S1, to string to save
in the next number to specified device D.
S1 3
D h33 (3) h2D (-)
S2 -32765
4-231
Chapter 4 Details of Instructions
2) DSTR (String)
(1) It converts specified Binary 32-bit data S2 with decimal places added to specified position S1, to string to save in
the next number to specified device D.
b15 b8 b7 b0
S1 Decimal places th
(Specified total places-1) ASCII code of Sign
D ASCII code
32-bit Binary data D+4 (Specified total places-9)th (Specified total places-8)
th
b15 b8 b7 b0
S1 5
D h32 (2) h2D (-)
Sign
D+2 h34 (4) h37 (7)
S2+1 S2
b31 b16 b15 b0
-2147483645 D+3 h38 (8) h2E (.)
0 h00 (NULL)
3) Program Example
P00000
STR P1000 P1100 P1200
4-232
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.26.9 VAL, VALP, DVAL, DVALP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
S O - O - - - O - - - O O O O
VAL(P)
D1 O - O - - - O - - - O O O O 4~6 O - -
DVAL(P)
D2 O - O - - - O - - - O O O O
(D)VAL S D1 D2
(D)VALP P S D1 D2
means VAL
[Area Setting]
Operand Description Data Type
S Start address of string to convert to Binary data STRING
D1 Position to save Binary data’s places after converted WORD
D2 Position to save Binary data after converted INT/DINT
[Flag Setting]
Flag Description Device Number
If ASCII string value is other than 0x30~0x39, Sign( -, +) or decimal point
Error F110
If ASCII string length exceeds the maximum string length
1) VAL (Value)
(1) It saves specified string S converted to Binary data in D1, and saves converted 16-bit Binary data in D2 omitting
decimals.
(2) ASCII string range is h30 ~ h39, and Error Flag will be set for others than sign and decimal point. In VAL,
convertible range of S is –32768 ~ 32767.
b15 b8 b7 b0
st
S 1 string ASCII code ASCII code of Sign Decimal places
D1
rd
S+1 3 string ASCII code nd
2 string ASCII code
th th
S+2 5 string ASCII code 4 string ASCII code D2 Integer disregarding
decimal point
th th
S+3 7 string ASCII code 6 string ASCII code
2 text
Sign
1 text
7 text
th
3 D1
S h33 (3) h2D (-)
-32765 D2
4-233
Chapter 4 Details of Instructions
2) DVAL (Value)
(1) It saves specified string S converted to Binary data in D1, and saves converted data in D2.
(2) ASCII string range is h30 ~ h39, and Error Flag will be set for others than sign and decimal point. In DVAL,
convertible range of S is –2147483648 ~ 2147483647.
b15 b8 b7 b0
S +1 3rd string ASCII code 2nd string ASCII code D1 Decimal places
th th
S +2 5 string ASCII code 4 string ASCII code
D2+1 D2
S +3
th
7 string ASCII code 6th string ASCII code Integer disregarding decimal point
2 text
Sign
1 text
12 text
11th string ASCII code 10th string ASCII code
nd
st
th
00H 12th string ASCII code
3) Program Example
P00000
VAL P1000 P1100 P1200
4-234
Chapter 4 Details of Instructions
XGK XGB
○ X
4.26.10 RSTR, RSTRP, LSTR, LSTRP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
S1 O - O - - - O - - O O O O O
RSTR(P)
S2 O - O - - - O - - - O O O O 4~6 O - -
LSTR(P)
D O - O - - - O - - - O O O O
(D)RSTR S1 S2 D
(D)RSTRP P S1 S2 D
means RSTR
[Area Setting]
Operand Description Data Type
S1 Floating point data to convert REAL/LONG
S2 Effective decimal places (0~25) WORD
D Address to save string converted STRING
[Flag Setting]
Flag Description Device Number
If converted value exceeds specified area D
Error F110
If specified value S2 exceeds 0~25 range
S2 3 b15 b8 b7 b0
D2 h31 (1) h2D (-)
D2+1 h32 (2) h2E (.)
D2+2 h35 (5) h33 (3)
- 1 . 2 3 5 E + 0 D2+3 h2B (+) h45 (E)
D2+4 h00 (NULL) h30 (0)
Sign
4-235
Chapter 4 Details of Instructions
b15 b8 b7 b0
th
(Specified total places-1)
D ASCII code of Sign
ASCII code
S2 Decimal places
D+1 ASCII code of decimal (Specified total places-2)th
point(.)(2EH) ASCII code
th th
D+2 (Specified total places-5) (Specified total places-4)
. E
ASCII code (decimal) ASCII code (decimal)
3) Program Example
4-236
Chapter 4 Details of Instructions
XGK XGB
○ X
4.26.11 STRR, STRRP, STRL, STRLP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
STRR(P) S O - O - - - O - - - O O O O
2~4 O - -
STRL(P) D O - O - - - O - - - O O O O
STRR S D
STRRP P S D
means STRR
[Area Setting]
Operand Description Data Type
S Address string to convert is saved in STRING
D Address to save in converted floating point data REAL/LREAL
[Flag Setting]
Flag Description Device Number
1.If there is no NULL at the end of string, or ASCII data is other than 0x30~0x39, Sign,
decimal, ‘e’ or ‘E’
Error 2. If string length exceeds the maximum size F110
3. If input string is not floating point data format
4. If input string data exceeds operation range (STRR, STRRP)
b15 b8 b7 b0
S 1st string ASCII code ASCII code of Sign
S+1 D+1 D
3rd string ASCII code 2nd string ASCII code
S+2
5th string ASCII code 4th string ASCII code
S+3
7th string ASCII code 8th string ASCII code
S+4 Floating point Real
h00
"-1.23e+25" Normal
"-123e+25" Normal
"12345678" Normal
"12.345" Normal
"+12.345e-62" Normal
"-1.23e25" Abnormal
" 1.23e+25" Abnormal
4-237
Chapter 4 Details of Instructions
b15 b8 b7 b0
S 34H (4) 20H (-)
(4) Error will be set if ASCII value in string is other than 0x30~0x39, sign, decimal, ‘e’or E’.
(5) STRR’s operation range is -3.40282347e+038 ~ -1.17549435e-038 or 1.17549435e-038 ~ 3.402823
47e+038.
(6) In STRR(P), if input data exceeds operation range, Error will be set
If the number of effective places of input data exceeds 17, succeeding input value will be ignored.
3) Program Example
P00000
STRR P1000 P1100
4-238
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.26.12 ASC, ASCP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
S O - O - - - O - - O O O O O
ASC(P) D O - O - - - O - - - O O O O 4~6 O - -
cw O - O - - - O - - O O O O O
Instruction
ASC S D cw
Instruction
ASCP P S D cw
means ASC
[Area Setting]
Operand Description Data Type
S Hexadecimal Binary WORD
D Position to save converted string in. STRING
N Number of characters to convert. WORD
[Flag Setting]
Device
Flag Description
Number
Error If format regulation of cw is incorrect. F110
1) ASC( ASCII)
(1) It converts data in specified area S to ASCII value based on CW format to save in starting D specified.
CW’s format
S D 0 N
Number to be converted (0~8)
Don't Care
D ‘s start bit
S’s start bit
(2) It converts Binary 16-bit data as hexadecimal saved in position after specified device number S, to ASCII
to save in the range of the specified characters number n after specified device number D.
b15 b8 b7 b0 b15 b8 b7 b0
S 4th place 3rd place 2nd place 1st place D 2nd character’s ASCII code 1st letter’s ASCII code
S+1 4th place 3rd place 2nd place 1st place D+1 4th letter’s ASCII code 3rd letter’s ASCII code
nd
D+2 2 letter’s ASCII code 1st letter’s ASCII code
Specified number
D+3 4th letter’s ASCII code 3rd letter’s ASCII code
n of characters
th rd nd st
4 place 3 place 2 place 1 place
Binary data 2nd letter’s ASCII code 1st letter’s ASCII code
4-239
Chapter 4 Details of Instructions
(3) Setting the number of characters N will automatically set specified Binary data S’s range and specified device
D’s range to save string in.
(4) Even if the device range where Binary data to convert is saved and the device range where converted
ASCII data will be saved are duplicated, its process will be normal.
(5) If specified number of characters N is odd, “00H” will be saved automatically in the upper 8 bits of the last
device number in the device range to save string in.
(6) If specified number of characters N is“0,” no conversion will be executed.
2) Program Example
P00000
ASC P1000 P1100 P1200
4-240
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.26.13 HEX, HEXP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
S O - O - - - O - - - O O O O
HEX(P) D O - O - - - O - - - O O O O 4~6 O - -
N O - O O O - O - - O O O O O
HEX S D N
HEXP P S D N
means HEX
[Area Setting]
Operand Description Data Type
S String to convert to Binary data STRING
D Device address to save Binary data converted WORD
N Number of characters to convert WORD
[Flag Setting]
Flag Description Device Number
Error The string value specified S exceeds Hexadecimal displaying range F110
1) HEX
(1) It converts N characters from specified character S to HEX format to save in starting D.
(2) It converts Hexadecimal ASCII data saved in specified characters number N after specified device number
S to save in position after specified device number D.
Specified number
n of letters
Binary data
b15 b8 b7 b0
b15 b8 b7 b0
S h45 (E) h66 (f)
D 1 2 E F
Specified
S+1 h31 (1) h32 (2) number N D+1 A B 7 8
of letters
S+2 h37 (7) h38 (8)
0 0 0 0
S+3 h61 (a) h42 (B)
0 0 Binary data
4-241
Chapter 4 Details of Instructions
(3) The specified number of characters N, specified string S’s range and specified device D’s range to save Binary
data in will be automatically set.
(4) Even if the device range where ASCII data to convert is saved and the device range where converted Binary data
will be saved are duplicated, its process will be normal.
(5) If specified number of characters N is not the multiple of 4, “0” will be saved automatically in the place after specified
number of characters of the last device number in the device range to save converted Binary data in.
(6) If specified number of characters N is“0,” no conversion will be executed.
2) Program Example
P00000
HEX P1000 P1100 P1200
4-242
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.26.14 RIGHT, RIGHTP, LEFT, LEFTP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
S O - O - - - O - - - O O O O
RIGHT(P)
D O - O - - - O - - - O O O O 4~6 O - -
LEFT(P)
N O - O O O - O - - O O O O O
RIGHT, LEFT S D N
RIGHTP, LEFTP P S D N
means RIGHT/LEFT
[Area Setting]
Operand Description Data Type
S String STRING
D Position to save string extracted in STRING
N Number of characters to extract WORD
[Flag Setting]
Flag Description Device Number
Error If specified string length S exceeds the maximum string size F110
1) RIGHT
(1) It saves the data of the number of characters n starting from the right (end of the string) of the string data
saved in the place after specified device number S, in the place after specified device number D.
(2) If specified number of characters N is“0,” NULL code (h00) will be saved in D.
(3) If specified N value is larger than specified S’s string, all S string will be saved in D, with no error this time.
b15 b8 b7 b0 b15 b8 b7 b0
S h42 (B) h41 (H) D h32 (2) h31 (1)
S+1 h44 (D) h43 (C) D+1 h34 (4) h33 (3)
S+2 h46 (F) h45 (E) D+2 h00 h35 (5)
S+3 h32 (2) h31 (1) "12345"
S+4 h34 (4) h33 (3) 5th character’s ASCII code
S+5 h00 h35 (5)
"ABCDEF12345"
2) LEFT
(1) It saves the data of the number of characters n starting from the left (start of the string) of the string data saved
in the place after specified device number S, in the place after specified device number D.
(2) If specified number of characters N is“0,” NULL code (h00) will be saved in D.
(3) If specified N value is larger than specified S’s string, all S string will be saved in D, with no error this time.
4-243
Chapter 4 Details of Instructions
b15 b8 b7 b0 b15 b8 b7 b0
S h42 (B) h41 (H) D h42 (B) h41 (A)
S+1 h44 (D) h43 (C) D+1 h44 (D) h43 (C)
S+2 h46 (F) h45 (E) D+2 h46 (F) h45 (E)
S+3 h32 (2) h31 (1) D+3 h00 h31 (1)
S+4 h34 (4) h33 (3) "ABCDEF1"
S+5 h00 h35 (5)
"ABCDEF12345" 7th character’s ASCII code
3) Program Example
(1) If Input Signal P00000 is changed to On, It saves the data 5 strings starting from the right (end of the string) of
the string among D00000~D00005 in the D00100~D00102.
P00000
RIGHT D00000 D00100 5
4-244
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.26.15 MID, MIDP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
S1 O - O - - - O - - - O O O O
MID(P) D O - O - - - O - - - O O O O 4~6 O - -
S2 O - O - - - O - - - O O O O
MID S1 D S2
MIDP P S1 D S2
means MID
[Area Setting]
Operand Description Data Type
S1 Start address of string STRING
D Address to save operation result of string STRING
Position of head character at S2+0
S2 WORD
Number of characters to bring in S2+1
[Flag Setting]
Flag Description Device Number
1. If converted value exceeds specified area D
2. If S1 ‘s string length exceeds the maximum string size
Error F110
3. If position of head character specified in S2+0 exceeds the maximum string size
4. If the number of characters specified in S2+1 exceeds the maximum string size
1) MID (Middle)
(1) It saves the data of the number of characters specified in S2+1 starting from S2, from the left of the string data
saved in the place after specified device number S1, in the place after specified device number D.
(2) If specified S2+1’s length of string is“0”, NULL STRING( “”) will be saved in D.
b15 b8 b7 b0 b15 b8 b7 b0
S h42 (B) h41 (H) D h46 (F) h45 (E)
S+1 h44 (D) h43 (C) D+1 h48 (H) h47 (G)
S+2 h46 (F) h45 (E) D+2 h00 h49 (I)
S+3 h48 (H) h47 (G)
5th character’s position "EFGHI"
S+4 h4A (J) h49 (I)
th
S+5 h00 h4b (K) 5 character’s ASCII code
"ABCDEFGHIJK"
S2 5
S2+1 5
2) Program Example
P00000
MID P1000 P1100 P1200
4-245
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.26.16 REPLACE, REPLACEP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
S1 O - O - - - O - - - O O O O
REPLACE(P) D O - O - - - O - - - O O O O 4~6 O - -
S2 O - O - - - O - - - O O O O
REPLACE S1 D S2
REPLACEP P S1 D S2
means REPLACE
[Area Setting]
Operand Description Data Type
S1 Start address of string to replace STRING
D Start address of string STRING
S2 Position (S2+0) and replaced size (S2+1) of the string to be replaced in D WORD
[Flag Setting]
Flag Description Device Number
1. If S2+1’s value exceeds D’s string length
Error F110
2. If S2’s value exceeds D’s string length
1) REPLACE
(1) It replaces string data (from the left) saved in the position from device number D including specified S2 and
S2+1’s number of characters data, with specified S1’s string.
(2) If S2+1 is 0, S1 will be inserted in specified S2 position of string specified in D.
(3) If S1’s string length is different from S2+1’s string size, D’s string may keep increasing or deceasing, which
needs user’s precaution.
Before
b15 b8 b7 b0
D h42 (B) h41 (A)
b15 b8 b7 b0
D+1 h44 (D) h43 (C)
S h31 (I) h30 (0)
D+2 h46 (F) h45 (E)
S+1 h33 (3) h32 (2)
D+3 h48 (H) h47 (G)
S+2 h35 (5) h34 (4)
D+4 h00 h49 (I)
h00 h36 (6)
"ABCDEFGHI"
"0123456"
After
b15 b8 b7 b0
D h42 (B) h41 (A)
D+1 h31 (I) h30 (0)
D+2 h33 (3) h32 (2)
S2 3 Position from the left of D’s string data D+3 h35 (5) h34 (4)
S2+1 2 The number of characters to be replaced D+4 h45 (E) h36 (6)
from S2
D+5 h47 (G) h46 (F)
D+6 h49 (I) h48 (H)
D+7 h00 h00
"AB0123456EFGHI"
2) Program Example
P00000
REPLACE P1000 P1100 P1200
4-246
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.26.17 FIND, FINDP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
S1 O - O - - - O - - - O O O O
S2 O - O - - - O - - - O O O O
FIND(P) 4~7 O - -
D O - O - - - O - - - O O O O
N O O O O O - O - - O O O O O
FIND S1 S2 D N
FINDP P S1 S2 D N
means FIND
[Area Setting]
Operand Description Data Type
S1 Start address of string to be searched for STRING
S2 Start address of string to search for STRING
D Address to save result WORD
N Start position to search for string WORD
[Flag Setting]
Flag Description Device Number
1.If S1, S2’s string length exceeds the maximum string size
Error 2.If start position to search specified in N is larger than string’s length to be searched F110
for, specified in S1
1) FIND
It searches starting Nth character of specified string S1 for the string with starting S2 to save the first identical
string’s start position in D.
b15 b8 b7 b0
S1 S2 C (0x43) T (0x54)
S1+1 S2+1 NULL (0x00) P (0x50)
S1+2 T (0x54)
N S1+3 P (0x50) C (0x33)
Distance from the S1’s start position saved.
S1+4
.... D 6
2) Program Example
P00000
FIND P1000 P1100 P1200 P1300
4-247
Chapter 4 Details of Instructions
XGK XGB
○ X
4.26.18 RBCD, RBCDP, LBCD, LBCDP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
S1 O - O - - - O - - - O O O O
RBCD(P)
S2 O - O - - - O - - - O O O O 4~6 O - -
LBCD(P)
D O - O - - - O - - - O O O O
RBCD, LBCD S1 S2 D
RBCDP, LBCDP P S1 S2 D
means RBCD/LBCD
[Area Setting]
Operand Description Data Type
S1 Floating point Data REAL/LREAL
S2 Decimal places (0~7) WORD
D Position to save in data decomposed to BCD WORD
[Flag Setting]
Flag Description Device Number
1.If converted BCD data exceeds specified area D
Error 2.If the range of decimal places exceeds 0~7 F110
3.If S1’ value exceeds operation range
S1+1 S1
If plus:0
D Sign If minus:1
S1+1 S1
-3.578 216E+2 D 1
D+1
H3578216
S2 6 D+2
D+3 0
D+4 2
4-248
Chapter 4 Details of Instructions
3) Program Example
P00000
RBCD P1000 P1100 P1200
4-249
Chapter 4 Details of Instructions
XGK XGB
○ X
4.26.19 BCDR, BCDRP, BCDL, BCDLP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
S1 O - O - - - O - - - O O O O
BCDR(P)
S2 O O O O O - O - - O O O O O 4 O - -
BCDL(P)
D O - O - - - O - - - O O O O
BCDR S1 S2 D
BCDRP P S1 S2 D
means BCDR
[Area Setting]
Operand Description Data Type
S1 Data with BCD floating point format WORD
S2 Decimal places of BCD floating point format WORD
D Device to save result in REAL/LREAL
[Flag Setting]
Flag Description Device Number
1.If specified area S1’s data format is not correct
Error 2.If the range of decimal places specified in S2 exceeds 0~7 F110
3.If BCD exponential exceeds allowable range( BCDR(P) : 38, BCDL(P) : 290)
Sign If plus:0
S1 D+1 D
If minus:1
S1+1
BCD floating decimal BCD7places
S1+2
point format If plus:0
S1+3 Sign specified Floating point real
If minus:1
S1+4 BCD exponential (0~38)
S1 1
S1+1 S1
S1+1
H3578216 -3.578 216E+2
S1+2
S1+3 Sign specified
S1+4 BCD exponential
S2 6
4-250
Chapter 4 Details of Instructions
3) Program Example
P00000
BCDR P1000 P1100 P1200
4-251
Chapter 4 Details of Instructions
SIN SIN S D
SINP SINP S D
[Area Setting]
Operand Description Data Size
S Input angle value (Radian) of Sine operation LREAL
D Device number to save operation result in LREAL
1) SIN (Sine)
(1) It performs SIN operation of data value in specified area S to save in D. At this moment, data type of S and D is
of Double real, and internal operation will be processed after converted to Double real data.
(2) Input value is of radian. Refer to RAD for details on Conversion of angle to radian.
(3) If S’s value is 1.047…(π/3 rad = 600), operation result is 0.8660… ( 3 2 ).
2) Program Example
P00000
RAD M0008 M0000
P00001
SIN M0000 M0004
It converts the degree inputted at M0008, M0009 into radian value and save them at M0000, M0001. And
it executes SIN operation and save them at M0004, M0005 by conversion value.
4-252
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.27.2 COS, COSP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
S O - O O O - - - - O O O O O
COS(P) 2~4 - - -
D O - O - - - - - - - - O O O
COS COS S D
COSP COSP S D
[Area Setting]
Operand Description Data Size
S Input angle value (Radian) of Cosine operation LREAL
D Device number to save operation result in LREAL
1) COS (Cosine)
(1) It performs COS operation of data value in specified area S to save in D. At this moment, data type of S and D is
of double real.
(2) Input value is of radian. Refer to RAD for details on Conversion of angle to radian.
(3) If S’s value is 0.5235…(π/6 rad = 300), operation result is 0.8660… ( 3 2 ).
2) Program Example
P00000
RAD M0008 M0000
P00001
COS M0000 M0004
4-253
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.27.3 TAN, TANP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
S O - O O O - - - - O O O O O
TAN(P) 2~4 - - -
D O - O - - - - - - - - O O O
TAN TAN S D
TANP TANP S D
[Area Setting]
Operand Description Data Size
S Input angle value (Radian) of Tangent operation LREAL
D Device number to save operation result in LREAL
1) TAN (Tangent)
(1) It performs Tangent operation of data value in specified area S to save in D. At this moment, data type of S and D
is of double real.
(2) Input value is of radian. Refer to RAD for details on Conversion of angle to radian.
(3) If S’s value is 0.5235…(π/6 rad = 300), operation result is 0.5773...
2) Program Example
P00000
RAD M0008 M0000
P00001
TAN M0000 M0004
4-254
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.27.4 RAD, RADP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
S O - O O O - - - - O O O O O
RAD(P) 2~4 - - -
D O - O - - - - - - - - O O O
RAD RAD S D
RADP RADP S D
[Area Setting]
Operand Description Data Size
S Angle data LREAL
D Device number to save in the operation result of converted RADIAN value LREAL
1) RAD (Radian)
(1) It converts angle (0) of data in specified area S to radian to save in D. At this moment, data type of S and D is of
double real.
(2) In degree unit, conversion to radian is as follows;
(3) Radian = Degree x π/180
2) Program Example
P00003
RAD M0000 M0002
P00004
DEG M0002 M0004
4-255
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.27.5 DEG, DEGP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
S O - O O O - - - - O O O O O
DEG(P) 2~4 - - -
D O - O - - - - - - - - O O O
DEG DEG S D
DEGP DEGP S D
[Area Setting]
Operand Description Data Size
S Radian value LREAL
D Device number to save operation result in. LREAL
1) DEG (Degree)
(1) It converts radian of data in specified area S to angle (degree) to save in D. At this moment, data type of S and D
is of double real.
(2) In radian unit, conversion to degree is as follows;
(3) Degree = Radian x 180 / π
2) Program Example
P00003
RAD M0000 M0002
P00004
DEG M0002 M0004
4-256
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.27.6 SQRT, SQRTP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
S O - O O O - - - - O O O O O
SQRT(P) 2~4 O - -
D O - O - - - - - - - - O O O
SQRT SQRT S D
SQRTP SQRTP S D
[Area Setting]
Operand Description Data Size
S Input value to perform SQRT operation LREAL
D Device number to save operation result in LREAL
[Flag Setting]
Device
Flag Description
Number
Error To be set if value in specified area S is negative F110
2) Program Example
P00001
SQRT M0000 M0004
4-257
Chapter 4 Details of Instructions
LIMIT,DLIMIT S1 S2 S3 D
LIMITP, DLIMITP P S1 S2 S3 D
means LIMIT/DLIMIT
[Area Setting]
Operand Description Data Size
S1 Device number where input value to control is saved INT/DINT
S2 Maximum output value INT/DINT
S3 Minimum output value INT/DINT
D Device number to save output value in INT/DINT
[Flag Setting]
Flag Description Device Number
Error If the maximum output is smaller than the minimum output F110
1) LIMIT
(1) Function
(1) It saves controlled output value in D, based on the value available in the range designated as the
maximum/minimum of the input value specified in S1.
(2) Output Condition
S1 < S3 , D = S3
S3 < S1 < S2 , D = S1
S2 < S1 , D = S2
Output Output D
S2
Input Input S1
S3
4-258
Chapter 4 Details of Instructions
2) Program Example
4-259
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.28.2 DZONE, DZONEP, DDZONE, DDZONEP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
S1 O - O - - - O - - - O O O O
DZONE(P) S2 O - O O O - O - - O O O O O
4~7 O - -
DDZONE(P) S3 O - O O O - O - - O O O O O
D O - O - - - O - - - O O O O
DZONE, DDZONE S1 S2 S3 D
DZONEP, DDZONEP P S1 S2 S3 D
means DZONE/DDZONE
[Area Setting]
Operand Description Data Size
S1 Device number where input value to control is saved INT/DINT
S2 Horizontal radius of dead zone INT
S3 Inclination [%] in dead zone, (0%=0, 100%=1) INT
D Device number to save output value in INT/DINT
[Flag Setting]
Flag Description Device Number
Error If inclination exceeds 0~100[%] F110
1) DZONE
(1) It saves output value converted from input value specified in S1 based on dead zone’s horizontal radius and
inclination in D.
(2) Output Condition
S3
S1 < − S2 , D = S1 − × S2 + S2
100
S3
− S2 < S1 < S2 , D = × S1
100
S3
S2 < S1 , D = S1 + × S2 − S2
100
Output D
Output
Inclination S3
-S2
S2
Input Input S1
4-260
Chapter 4 Details of Instructions
2) Program Example
P00011
4-261
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.28.3 VZONE, VZONEP, DVZONE, DVZONEP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
S1 O - O - - - O - - O O O O
VZONE(P) S2 O - O O O - O - - O O O O O
4~7 O - -
DVZONE(P) S3 O - O O O - O - - O O O O O
D O - O - - - O - - - O O O O
VZONE, DVZONE S1 S2 S3 D
VZONEP, DVZONEP P S1 S2 S3 D
means ZONE/DZONE
[Area Setting]
Operand Description Data Size
S1 Device number where input value to control is saved INT/DINT
S2 Vertical radius of vertical zone INT
S3 Reciprocal of inclination [%] in vertical zone, (0%=inf, 100%=1) INT
D Device number to save output value in INT/DINT
[Flag Setting]
Flag Description Device Number
Error If reciprocal of inclination exceeds 0~100[%] F110
1) VZONE
(1) It saves output value converted from input value specified in S1 based on vertical zone’s horizontal radius and
inclination in D.
(2) Output Condition
S3 S3
S1 < − × S2 , D = S1 + × S2 − S2
100 100
S3 S3 100
− × S2 < S1 < × S2 , D = × S1
100 100 S3
S3 S3
× S2 < S1 , D = S1 − × S2 + S2
100 100
Output D
Output
Reciprocal of S2
inclination S3
Input Input S1
-S2
4-262
Chapter 4 Details of Instructions
2) Program Example
P00011
VZONE D00011 300 50 D00021
4-263
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.28.4 PIDRUN
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
PIDRUN S - - - - - - - - - O - - - - 2 - - -
PIDRUN PIDRUN S
[Area Setting]
Operand Description Data Size
S Loop Number to perform PID operation (0~31) Const
2) Quick Start
(1) For simple application, PV and MV are respectively used as controller’s input and output. The value user
should input is SV, MV_man, Kp, Ti and Td.
PV : Controller’s input (sensor output to be controlled), AD module mainly used.
MV : Controller’s Output (input signal to be controlled), DA module mainly used.
SV : Controlling target, where sensor’s output is input as desired to reach through the control.
MV_max : Maximum controlled output, where maximum range of controlled output is input. Usually
10000 is input (usually 4000 is input in XGB case). And if this value is 0, more than 0 will not
be output.
Kp, Ti, Td : Where proportional, integral and differential coefficients are respectively input and tuned.
Remark
Ti value is the denominator of integral term. Thus, reduce Ti to increase integral effect, or enlarge Ti to
decrease integral effect. In case PIDRUN Block is to be deleted for modification during run, let it deleted in the
state that contact point is off. If modified during run with contact point on, the output value will be kept as
before, which causes error that control is successively performed when the identical loop is later added with
contact point always on.
Refer to additional PID Instructions List for detailed functions.
Be well informed of PIDRUN, PIDPRMT, PIDPAUSE and PIDINIT instructions to keep from any accident
caused by abnormal operation.
3) Program Example
P0
PIDRUN 0
4-264
Chapter 4 Details of Instructions
In case of XGK
Loop K area Symbol Data type Operation in 0 Function
K0000 --
None Previous model changing and User using area
K0999
K10000~
_PIDxx_MAN BIT Auto PID Output specified (0:Automatic, 1:Manual)
K1001F
K10020~
_PIDxx_PAUSE BIT Disable PID PAUSE
K1003F
K10040~
_PIDxx_NEG BIT Positive PID (0:forward,1:reverse) Control of operation
K1005F
K10060~
_PIDxx_AW_DIS BIT Disable PID Anti Wind-up (0:operation,1:prohibition)
K1007F
K10080~ PID external operation instruction
_PIDxx_EX_RUN BIT Disable
K1009F (when operates by HMI)
K10100~
_PIDxx_STAT BIT Stop PID operation indicated (0:Stop, 1:Run)
K1011F
Common
K10120~ PID Auto-tuning setting
_PIDxx_AT_EN BIT Stop
K1013F (0:Prohibition 1:Operation)
K10140~ Controll setting after PID Auto-tuning
_PID00_AT_ONLY BIT 0
K1015F (0:Control after tuning,1:Only operates tuning)
K10140~ PID Auto tuning Hysteresis setting automatically
_PID00_AT_HYS BIT Manual
K1015F (0:Manual, 1:Auto-detect)
K10140~ PID Display of Auto-tuning operation status (0:Stop,
_PID00_AT_STAT BIT Stop
K1015F 1:Run)
K10140~ PID Self-tuning setting
_PID00_ST_EN BIT Disable
K1015F (0:Prohibition, 1:Operation)
K10140~ PID Internal memory 0
_PID00_INT0 BIT -
K1015F (Prohibition of user setting)
K1024 _PID00_SV INT 0 PID target value (SV) – Loop 00
K1025 _PID00_T_s WORD Every scan PID calcualtion cycle (T_s)[0.1msec] - Loop 00
K1026 _PID00_K_p REAL 0 PID P - constant (K_p) – Loop 00
K1028 _PID00_T_i REAL Disable PID I - constant (T_i)[sec] –Loop 00
K1030 _PID00_T_d REAL 0 PID D - constant (T_d)[sec] –Loop 00
K1032 _PID00_d_PV_max INT Disable PID PV variation limitation - Loop00
K1033 _PID00_d_MV_max INT Disable PID MV variation limitation - Loop 00
K1034 _PID00_MV_max INT If both are PID MV maximum value limitation – Loop 00
K1035 _PID00_MV_min INT Disable PID MV minimum value limitation – Loop 00
K1036 _PID00_MV_man INT 0 PID manual output (MV_man) – Loop 00
K1037 _PID00_ALARM WORD 0 PID alarm (latch) – Loop 00
K1038 _PID00_PV INT 0 PID present value (PV) – Loop 00
0 K1039 _PID00_PV_old INT 0 PID previous value (PV_old) – Loop 00
K1040 _PID00_MV INT 0 PID output value (MV) – Loop 00
K1041 _PID00_AT_HYS_val INT 0 PID Hysteresis setting value – Loop 00
K1042 _PID00_ERR DINT 0 PID control error value – Loop 00
K1044 _PID00_MV_p REAL 0 PID output value P – Loop 00
K1046 _PID00_MV_i REAL 0 PID output value I – Loop 00
K1048 _PID00_MV_d REAL 0 PID output value D – Loop 00
K1050 _PID00_AT_STEP WORD - PID display of Auto-tuning status - Loop 00
K1051 _PID00_ST_STEP WORD - PID display of self-tuning status - Loop 00
K1052 _PID00_AT_prd1 WORD - PID internal memory 1 (Prohibition of user setting) - Loop 00
K1053 _PID00_AT_prd2 WORD - PID internal memory 2 (Prohibition of user setting) - Loop 00
K1054 _PID00_AT_max WORD - PID internal memory 3 (Prohibition of user setting) - Loop 00
L1055 _PID00_AT_min WORD - PID internal memory 4 (Prohibition of user setting) - Loop 00
1 K1056 _PID01_SV INT 0 PID target value (SV) – Loop 01
30 K2015 Reserved Memory
K2016
_PID31_SV INT 0 PID target value (SV) – Loop 31
(1024+32N)
31
K2047
- Reserved Memory
(1055+32N)
* xx : Loop number of PID
Remark
If PID related instructions are not used, it can be used just like a normal K device.
Controlled Input of PV lets it connected to sensor output to control with MOV instruction, etc.
Controlled Output of MV lets it connected to driver to control with MOV instruction, etc.
PV, MV and the value to monitor can be all inspected in graphs or table format at a glance through XG5000’s trend monitor or
data trace to check the operation of the control system.
4-265
Chapter 4 Details of Instructions
In case of XGB
Device Type Name Function
K1203 16bit _PID_AW2D PID Anti Wind-up2 prohibition (0: Operate 1: Prohibit)
K1204 16bit _PID_REM_RUN PID remote run bit for HMI (0: STOP, 1: RUN)
K1205 - - NO USE
PID common K1206 16bit _PID_D_on_ERR PID derivative term (0: on PV, 1: on ERR)
K1207 - - NO USE
K1208 16bit _PID_PWM_EM PID PWM operation permission (0: Prohibit, 1: Permit)
K1209 16bit _PID_STD PID operation indicated (0: STOP, 1: RUN)
K1210 16bit _PID_ALARM PID display of warning status (0: Normal, 1: Warning)
K1211 16bit _PID_ERROR PID display of error status (0: Normal, 1: Error)
K1212~1215 - Reserved NO USE
4-266
Chapter 4 Details of Instructions
XGK XGB
○ X
4.28.5 PIDPRMT
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
S O - O - - - O - - - O O O O
PIDPRMT 2 - - -
D - - - - - - - - - O - - - -
PIDPRMT PIDPRMT S D
[Area Setting]
Operand Description Data Size
S Device number where PID operation information to change is saved INT
D Loop number to change PID operation information (0~31) Const
2) Program Example
P00000
PIDPRMT P1000 0
4-267
Chapter 4 Details of Instructions
XGK XGB
○ X
4.28.6 PIDPAUSE
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
PIDPAUSE S - - - - - - - - - O - - - - 2 - - -
PIDPAUSE PIDPAUSE S
[Area Setting]
Operand Description Data Size
S Loop number to convert PID operation to PAUSE(temporary stop) state (0~31) Const
PIDRUN
PIDSTOP PIDPAUSE
3) Program Example
P0
PIDPAUSE 0
Remark
Before PID loop is stabilized, any system easily unstable or with external hindrance or noise highly expected
shall not be used if not surely necessary since it may cause divergence due to PIDPAUSE. In addition, its user
should monitor the system to be able to stop the system urgently anytime at PAUSE, and should not leave it in
PAUSE state for long.
4-268
Chapter 4 Details of Instructions
XGK XGB
○ X
4.28.7 PIDINIT
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
PIDINIT S - - - - - - - - - O - - - - 2 - - -
PIDINIT PIDINIT S
[Area Setting]
Operand Description Data Type
S Loop number (0~31) to exchange in PAUSE of PID operation status Const.
2) Program Example
P0
PIDINIT 0
4-269
Chapter 4 Details of Instructions
XGK XGB
○ X
4.28.8 PIDAT
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
PIDAT S - - - - - - - - - O - - - - 2 - - -
PIDAT PIDAT S
[Area Setting]
Operand Description Data Size
S Loop number to perform AT operation (0~15) Const
2) Quick Start
(1) For simple application, PV and MV are respectively used as controller’s input and output. The value user
should input is SV, Ts.
PV : Controller’s input (sensor output to be controlled), AD module mainly used.
MV : Controller’s Output (input signal to be controlled), DA module mainly used.
SV : Controlling target, where sensor’s output is input as desired to reach through the control.
3) Program Example
4-270
Chapter 4 Details of Instructions
4-271
Chapter 4 Details of Instructions
XGK XGB
4.28.9 PIDHBD X ○
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
F - - - - - - - - - O - - - -
PIDHBD 2 - - -
D - - - - - - - - - O - - - -
PIDPRMT PIDHBD F R
[Area Setting]
Operand Description Data Size
F Loop number to operate forward PID operation (0~15) Const
R Loop number to operate reverse PID operation (0~15) Const
2) Quick Start
(1) When you use PIDHBD instruction, you should assign the forward operation loop number and reverse
operation loop number correctly.
(2) If you use the loop on other instruction like PIDRUN after using in PIDHBD instruction, control operation can
operate abnormally.
3) Program Example
4-272
Chapter 4 Details of Instructions
XGK XGB
4.28.10 PIDCAS X ○
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
M - - - - - - - - - O - - - -
PIDCAS 2 - - -
S - - - - - - - - - O - - - -
PIDCAS PIDCAS M S
[Area Setting]
Operand Description Data Size
M CASCADE external loop number (0~15) Const
S CASCADE internal loop number (0~15) Const
2) Quick Start
(1) You should assign an external loop and an internal loop correctly.
(2) If you use the loop on other instruction like PIDCAS after using in PIDRUN instruction, control operation can
operate abnormally.
3) Program Example
4-273
Chapter 4 Details of Instructions
SCAL COMMAND
DSCAL S1 S2 S3 D
RSCAL
COMMAND
SCALP P S1 S2 S3 D
DSCALP
RSCALP means SCAL
[Area setting]
Operand Desciprtion Data size
S1 Device number of input data to input INT / DINT / REAL
S2 Scale upper limit of input data INT / DINT / REAL
S2+1 Scale lower limit of input data INT / DINT / REAL
S3 Scale upper limit of output data INT / DINT / REAL
S3+1 Scale lower limit of output data INT / DINT / REAL
D Device number to save output data INT / DINT / REAL
[Flag Set]
Device
Flag Content
number
Error In case of error in lower limit and upper limit of input data F110
Error In case scale upper limit of input data is same with lower limit F110
4-274
Chapter 4 Details of Instructions
(7) The result of the operation of INT/DINT type is represented rounded off the number to one decimal
place.
(8) Be cautious when using more than ±1.000e+010 at a numerator or less than ±1.000e-010 at a
denominator, because, out of the range of expressable Max/Min value in the operation of REAL type,
it is represented as ±1.INF00000e+000
(9) In case operation result exceeds the max./min. value that is expression available in the REAL type
operation process, it is expressed as ±1.INF00000e+000, so when using more than ±1.000e+010 at
nominator or less than ±1.000e-010 at denominator, be careful.
(10) In case of operating DINT type, if setting value is more than 10 million, error may occurs.
4-275
Chapter 4 Details of Instructions
2) Program example
(1) SCAL program scales value between 0 and 16000 to value between 100 and 200.
D100 = 16000
D101 = 0
D200 = 200
D201 = 100
subsitution
(2) RSCAL program scales value between 0 and 1000 to value between 2000 and 1000.
D100 = 1000
D102 = 0
D200 = 1000
D202 = 2000
substitution
4-276
Chapter 4 Details of Instructions
SCAL2 COMMAND
DSCAL2 S1 S2 S3 S4 D
RSCAL2
COMMAND
SCAL2P P S1 S2 S3 S4 D
DSCAL2P
RSCAL2P Means SCAL2
[Area setting]
Operand Description Data size
S1 Device number of input device to change INT / DINT / REAL
S2 Standard deviation of input data INT / DINT / REAL
S3 Standard deviation of otput data INT / DINT / REAL
S4 Offset of outut data INT / DINT / REAL
D Device number to save output data INT / DINT / REAL
[Flag Set]
Device
Flag Content
number
Error In case input data standard deviation is 0 F110
4-277
Chapter 4 Details of Instructions
(7) The result of the operation of INT/DINT type is represented rounded off the number to one decimal
place.
(8) Be cautious when using more than ±1.000e+010 at a numerator or less than ±1.000e-010 at a
denominator, because, out of the range of expressable Max/Min value in the operation of REAL type,
it is represented as ±1.INF00000e+000
(9) In case operation result exceeds the max./min. value that is expression available in the REAL type
operation process, it is expressed as ±1.INF00000e+000, so when using more than ±1.000e+010 at
nominator or less than ±1.000e-010 at denominator, be careful.
(10) In case of operating DINT type, if setting value is more than 10 million, error may occurs.
2) Program example
(1) Program that scales input value to 1/16 and outputs it.
D100 = 16
D200 = 1
D300 = 0
substitution
D100 = 1
D200 = 2
D300 = 2000
substitution.
4-278
Chapter 4 Details of Instructions
DATERD D
DATERDP P D
means DATERD
[Area Setting]
Operand Description Data Size
D Device number to save transferred data WORD
(4) Details of days: 0-Sunday, 1-Monday, 2-Tuesday, 3-Wednesday, 4-Thursday, 5-Friday, 6-Saturday.
2) Program Example
P00000
DATERD P1000
4-279
Chapter 4 Details of Instructions
XGK XGB
○ X
4.29.2 DATEWR, DATEWRP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
DATEWR(P) D O - O - - - - - - - O O O O 2 O - -
DATEWR S
DATEWRP P S
means DATERD/DATEWR
[Area Setting]
Operand Description Data Size
S Device number time data is saved in WORD * 4
[Flag Setting]
Flag Description Device Number
Error If time data size specified in S exceeds its applicable range F110
b15 b8 b7 b0
Month Year S
Hour Date S+1 Time data
Sec Min S+2
100 years Day S+3
2) Program Example
P00000
DATEWR P1000
4-280
Chapter 4 Details of Instructions
XGK XGB
○ X
4.29.3 ADDCLK, ADDCLKP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
S1 O - O - - - O - - - O O O O
ADDCLK(P) S2 O - O - - - O - - O O O O O 4~6 O - -
D O - O - - - O - - - O O O O
ADDCLK S1 S2 D
ADDCLKP P S1 S2 D
means ADDCLK/SUBCLK
[Area Setting]
Operand Description Data Size
S1 Device number time data is saved in DWORD
S2 Device number time data is saved in DWORD
D Device number to save result in DWORD
[Flag Setting]
Flag Description Device Number
Error If S1, S2’s data exceeds time data size F110
(2) Time data value shall be input in BCD format. For example, if time data is in D00010, to which 1 hour
20 minimum 30 sec. is added to be in D20, its input will be as follows;
P00010
(3) If specified device S2’s lowest byte value exists, the value in that position will be not operated.
2) Program Example
P00000
ADDCLK P1000 P1100 P1200
4-281
Chapter 4 Details of Instructions
XGK XGB
○ X
4.29.4 SUBCLK, SUBCLKP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
S1 O - O - - - O - - - O O O O
SUBCLK(P) S2 O - O - - - O - - - O O O O 4~6 O - -
D O - O - - - O - - - O O O O
SUBCLK S1 S2 D
SUBCLKP P S1 S2 D
means ADDCLK/SUBCLK
[Area Setting]
Operand Description Data Size
S1 Device number time data is saved in DWORD
S2 Device number time data is saved in DWORD
D Device number to save result in DWORD
[Flag Setting]
Flag Description Device Number
Error If S1, S2’ data exceeds time data size F110
(2) Time data value shall be input in BCD format. For example, if time data is in D00010, from which 20 minimum 30
sec. is subtracted to be in D20, its input will be as follows;
P00010
(3) If specified device S2’s lowest byte value exists, the value in that position will be not operated.
2) Program Example
P00000
SUBCLK P1000 P1100 P1200
4-282
Chapter 4 Details of Instructions
XGK XGB
○ X
4.29.5 SECOND, SECONDP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
S O - O - - - O - - O O O O O
SECOND(P) 2~4 O - -
D O - O - - - O - - - O O O O
SECOND SECOND S D
SECONDP SECONDP S D
[Area Setting]
Operand Description Data Size
S Data to transfer, or device number data is saved in DWORD
D Device number to save transferred data in DWORD
[Flag Setting]
Flag Description Device Number
Error If S, S+1, S+2’s data exceeds time data size respectively F110
1) SECOND (Second)
(1) It converts time data value in specified area S to second data to save D+1,D.
b15 b8 b7 b0 D+1 D
S Hour (h00~h23) 16#00
Sec. (0 ~ 86399)
S+1 Sec. (h00~h59) Min. (h00~h59)
(2) Time data shall be input in BCD format. And if applicable data range is exceeded, error (F110) may occur
respectively.
2) Program Example
P00000
SECOND P1000 P1100
4-283
Chapter 4 Details of Instructions
XGK XGB
○ X
4.29.6 HOUR, HOURP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
S O - O - - - O - - O O O O O
HOUR(P) 2~4 O - -
D O - O - - - O - - - O O O O
HOUR D
HOURP P D
means SECOND/HOUR
[Area Setting]
Operand Description Data Size
S Data to transfer, or device number data is saved in DWORD
D Device number to save transferred data in DWORD
[Flag Setting]
Flag Description Device Number
Error If the second in specified S is larger than 86399 F110
1) HOUR (Hour)
(1) It converts second data in specified area S+1, S to time data to save in D+2, D+1, D.
b15 b8 b7 b0
S+1 S Hour (h00~h23)
D 16#00
Sec (0 ~ 86399) D+1 Sec (h00~h23) Min (h00~h23)
2) Program Example
P00000
HOUR P1000
4-284
Chapter 4 Details of Instructions
[Area Setting]
Operand Description Data Type
n Position label to jump on (English : up to 16) STRING
1) JMP
(1) If JMP (label) instruction’s input contact point is On, it will jump on the place after specified label (LABEL), and
all the instructions between JMP and label will not be operated.
(2) Labels duplicated can not be used. However, JMP can be duplicated.
(3) It is recommended to insert the program which shall not be operated in emergency, between JMP and label.
2) Program Example
(1) When turning on input signal P00020, program between JMP SKIP_RING and label SKIP_RING is not executed.
4-285
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.30.2 CALL, CALLP, SBRT, RET
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
CALL(P) n - - - - - - - - - O - - - - 1 - - -
SBRT n - - - - - - - - - O - - - - 5 - - -
CALL(P) P n
END
SBRT SBRT n
RET RET
means CALL
[Area Setting]
Operand Description Data Type
n Function’s label to call (English : up to 16, Korean : up to 8 characters) STRING
1) CALL
(1) If input condition is allowed while program executed, the program between SBRT n ~ RET instructions will be
executed according to CALL n instruction.
(2) CALL No. can be duplicated, and the program between SBRT n ~ RET instructions shall be at the back of
END instruction.
(3) Error processing condition
. In case the total SBRT number exceeds 512: Program downloading unavailable.
. In case CALL n exists but SBRT n dose not.
(4) Calling other SBRT is available in SBRT for 16 times.
(5) In SBRT, CALL can be located next to END.
2) Program Example
P00020 P00050
( )
P00021 P00022 P00051
( )
P0002F
CALL INC_D0
END
SBRT INC_D0
F0092
INCP D00000
F0010
MOV D00000 P0006
RET
4-286
Chapter 4 Details of Instructions
FOR FOR n
NEXT NEXT
[Area Setting]
Operand Description Data Type
n Number of times to execute FOR~NEXT WORD
1) FOR~NEXT
(1) PLC meeting FOR in RUN mode will execute the process between FOR~NEXT instructions for n times and
then the next step of NEXT instruction.
(2) 1 ~ 65535 is available for n.
(3) Up to 16 is available for NESTING of FOR~NEXT. If this is exceeded, program downloading will be unavailable.
(4) As another method to escape from FOR~NEXT loop, BREAK instruction can be used.
(5) Since scan time may be longer than expected, use WDT instruction not to exceed WDT setting limit.
2) Program Example
Where PLC executes FOR~NEXT for 2 times in RUN mode.
FOR 2
NEXT
4-287
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.31.2 BREAK
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
BREAK - - - - - - - - - - - - - - 1 - - -
BREAK BREAK
1) BREAK
(1) It is used to escape from FOR~NEXT section.
(2) BREAK instruction can not be used solely. It shall be surely used only between FOR~NEXT.
If not used between FOR~NEXT, it will cause program error to make program downloading unavailable.
2) Program Example
(1) Where M0000 if On ignores 5 times of FOR~NEXT loop inside, escapes to ‘Loop End’ position and continue to
execute the operation.
4-288
Chapter 4 Details of Instructions
STC STC
CLC CLC
[Flag Setting]
Flag Description Device Number
To be set if execution condition of STC is On
Carry To be reset if execution condition of CLC is On F112
No change if STC or CLC execution condition is Off
3) Program Example
(1) Where Carry Flag(F112) will be set if input M00000 is On.
M00000 Executed
STC Carry Flag(F112) contact point set
M00001 Executed
STC Carry Flag(F112) contact point cleared
4-289
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.32.2 CLE
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
CLE - - - - - - - - - - - - - - 1 - - -
CLE CLE
M00001
CLE
4-290
Chapter 4 Details of Instructions
FALS N
means FALS
[Area Setting]
Operand Description Data Type
N Number to be saved in F area (F0014) WORD
1) FALS
(1) It saves N in specified address of F area.
(2) h0000 ~ hFFFF is available for N, and the first produced N will be saved till it is cancelled.
(3) Use FALS 0000 to cancel FALS.
2) Program Example
P00000
FALS P1000
-
When turning on input signal, P00000, it saves data saved in D01000 at F0014.
4-291
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.33.2 DUTY
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
D - O - - - - - - - - - - - -
DUTY N1 - - - - - - - - - O - - - - 4 - - -
N2 - - - - - - - - - O - - - -
[Area Setting]
Operand Description Data Type
D F100 ~ F107 BIT-
N1 Number of scans to be ON WORD
N2 Number of scans to be OFF WORD
1) DUTY
(1) It generates the pulse to make user’s timing pulse F area (F100~F107) specified in D, On for N1 scan and Off
for N2 scan.
(2) If input condition is Off, the timing pulse (F100~F107) will be Off.
(3) If N1 = 0, the timing pulse will be always Off.
(4) If N1 > 0, N2 = 0 , the timing pulse will be always On.
(5) If DUTY instruction operates to start to generate the timing pulse with input condition once ON, the timing
pulse will be continuously produced even if duty’s input condition is Off.
Input
condition
DUTY
Timing
N1 scanN2 scan
2) Program Example
P0
DUTY F01000 3 1
Remark
(1) Timing pulse will keep operating even if DUTY instruction applicable to specific timing pulse is cancelled through
modification during Run.
4-292
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.33.3 TFLK
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
D1 O - - - - - - O - - - - - -
S1 O O O O O - O - - O O O O O
TFLK 4~7 O - -
S2 O O O O O - O - - O O O O O
D2 O - O O O - O - - - O O O O
TFLK TFLK D1 S1 S2 D2
[Area Setting]
Operand Description Data Type
D1 Bit number to be On/Off for setting time BIT
S1 Time to turn the bit On specified in D1 WORD
S2 Time to turn the bit Off specified in D1 WORD
(D2+0) : Present time being executed
D2 (D2+1) : Time unit to be used (0-1ms, 1-10ms, 2-100ms, 3-1s) WORD
(D2+2) ~ (D2+4): System area (word * 3)
1) TFLK
(1) It is used to turn the specified D1 bit On for S1 time and then Off for S2 time when input contact point is On.
(2) If contact point is Off, the present time being executed in D2 will be initialized, and the bit specified in D1 will
be Off. If contact point is back On, the instruction will be executed from the first.
(3) Time unit has set to be used in D2+1.
0 – 1ms, 1 – 10ms, 2 – 100ms, 3 – 1s. If time unit is morer than 4, error will not occurred. And all is to be set
a 1s.
(4) In order to execute this instruction, 3-word data area is necessary. D2+2, D2+3, D2+4 will be used inside the
instruction for this. Thus, when setting D2, be concerned about each device’s range.
2) Program Example
P00000
TFLK P07000 P1000 P1100 P1200
Caution
(1) Be careful of using indirect designation (#) or index ([Z]) because the TFLK instruction has internal
processing parts without contact point ON.
For example, an error occurs without contact point ON if you use M100[Z10] for one of the TFLK instruction
operands and if Z10’s value exceeds 1947 that can be outside the M area.
4-293
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.33.4 WDT, WDTP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
WDT(P) - - - - - - - - - - - - - - 1 - - -
WDT
WDTP P
means WDT
2) Program Example
P0
WDT
4-294
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.33.5 OUTOFF
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
OUTOFF - - - - - - - - - - - - - - 1 - - -
1) OUTOFF
(1) If input condition is allowed, the whole output will be Off, and internal operation will go on with F113 (whole
output Off) Flag to be set in F area.
(2) If input condition is cancelled, normal output will be followed.
2) Program Example
P0
OUTOFF
4-295
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.33.6 STOP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
STOP - - - - - - - - - - - - - - 1 - - -
STOP STOP
1) STOP
(1) It converts to program mode after the scan presently in progress is completed.
(2) This instruction is used to stop the operation at specific time desired.
2) Program Example
P0
STOP
4-296
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.33.7 ESTOP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
ESTOP - - - - - - - - - - - - - - 1 - - -
ESTOP ESTOP
2) Program Example
P0
ESTOP
4-297
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.33.8 INIT_DONE
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
INIT_DONE - - - - - - - - - - - - - - 1 - - -
P00000
INIT_DONE
4-298
Chapter 4 Details of Instructions
EI EI
DI DI
1) EI
All the prepared task programs are executed.
2) DI
All the prepared task programs are not be executed.
3) Program Example
it executes all of the Time-driven and Internal Task program in project.
EI
4-299
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.34.2 EIN, DIN
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
EIN / DIN n - - - - - - - - - O - - - - 1 - - -
EIN EIN n
DIN DIN n
[Area Setting]
Operand Description Data Type
n Interrupt number to specify. WORD
1) EIN
(1) Specified n task program is executed.
∗ If interrupt 5 enabled
P00001
EIN 5
2) DIN
(1) Specified n task program is stopped.
∗ If interrupt 5 disenabled
P00001
DIN 5
Remark
4-300
Chapter 4 Details of Instructions
NEG, DNEG D
NEGP, DNEGP P D
1) NEG (Negative)
(1) It converts the sign of the detail in specified area D to save in D area.
(2) View Monitoring Option is available for monitoring if signed, and the value converted to negative is
useful only in Signed Operation.
P00001
NEGP D00010
3) Program Example
(1) Where D0020 value converted to negative is operated as signed.
M00000
NEGP D00020
4-301
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.35.2 RNEG, RNEGP, LNEG, LNEGP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
RNEG(P)
D O - O - - - O - - - O O O O 2 - - -
LNEG(P)
RNEG, LNEG D
LNEGP, LNEGP P D
means RNEG/LNEG
[Area Setting]
Operand Description Data Type
D Area to convert signs REAL/LREAL
P00003
RNEG M0000
P00003
LNEG M0000
3) Program Example
P00000
RNEG P1000
4-302
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.35.3 ABS, ABSP, DABS, DABSP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
ABS(P)
D O - O - - - O - - - O O O O 2 - - -
DABS(P)
ABS, DABS D
ABSP, DABSP P D
means ABS/DABS
[Area Setting]
Operand Description Data Type
D Area to convert absolute value. WORD/DWORD
P00003
ABSP D00010
3) Program Example
P00000
ABS P1000
4-303
Chapter 4 Details of Instructions
RSET RSET S
[Area Setting]
Operand Description Data Type
S Block number to convert, or device number (0~1) where Block number to convert is saved WORD
Remark
2) Program Example
P00000
RSET P1000
When turin on P00000, it changes set block number into block number set in P1000.
4-304
Chapter 4 Details of Instructions
XGK XGB
○ X
4.36.2 EMOV, EMOVP, EDMOV, EDMOVP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
S1 O - O - - - O - - O - O O O
EMOV(P)
4~7 - - -
EDMOV(P) S2 O - O - - - O - - O - O O O
D O - O - - - O - - - - O O O
[Area Setting]
Operand Description Data Size
S1 Block number of flash area WORD
S2 Device number where data desired in the specified block S1 is saved. WORD
D Device number to save WORD
FLASH MEMORY
0
Block 0
32767
0
Block 1
32767
D Internal device
0
Block 31
32767
3) Program Example
P00000
EMOV P1000 P1100 P1200
4-305
Chapter 4 Details of Instructions
XGK XGB
○ X
4.36.3 EBREAD
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
S1 O - O - - - O - - O - O O O
EBREAD 2~4 - - -
S2 O - O - - - O - - O - O O O
EBREAD EBREAD S1 S2
[Area Setting]
Operand Description Data Size
S1 Block number of flash area (0 ~ 31) WORD
S2 R device’s block number to save (0 ~ 1) WORD
M00021
EBREAD 1 1
FLASH MEMORY
R device
0 0
. .
Block 0 Block 0
. .
32767 32767
0 0
. .
Block 1 Block 1
. .
32767 32767
. (S2)
.
.
0
.
Block 31
.
32767
(S1)
2) Program Example
P00000
EBREAD P1000 P1100
4-306
Chapter 4 Details of Instructions
XGK XGB
○ X
4.36.4 EBWRITE
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
S1 O - O - - - O - - O - O O O
EBWRITE 2~4 - - -
S2 O - O - - - O - - O - O O O
EBWRITE EBWRITE S1 S2
[Area Setting]
Operand Description Data Size
S1 Block number of R device (internal RAM) WORD
S2 Block number of flash area to save WORD
M00021
EBWRITE 0 14
FLASH MEMORY
R device
0 0
. .
Block 0 Block 0
. .
32767 32767
0 0
. .
Block 1 Block 1
. .
32767 32767
(S1) .
.
.
0
.
Block 31
.
32767
(S2)
2) Program Example
P00000
EBWRITE P1000 P1100
4-307
Chapter 4 Details of Instructions
XGK XGB
○ X
4.36.5 EBCMP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
S1 O - O - - - O - - O O O O O
S2 O - O - - - O - - O O O O O
EBCMP 4~7 - - -
D1 O - O - - - O - - - O O O O
D2 O - O - - - O - - -- O O O O
EBCMP EBCMP S1 S2 D1 D2
[Area Setting]
Operand Description Data Size
S1 R device’s block number (CPUH : 0~1, CPUS : 0) WORD
S2 Flash memory’s block number (0~31) WORD
D1: Number not identical (0~20. If it is more than 20. no more Compare Operation
D1 will be executed) WORD
D1+1: Presently processed number of words
D2 Compare Operation completion status (0 or 1) WORD
FLASH MEMORY
R devce
0 0
. .
Block 0 Compare Block 0
. .
32767 32767
0 0
. .
Block 1 Block 1
. .
32767 32767
(S1) .
.
Number of
discorded D1 .
Number of D1+1 0
processed .
Block 31
Completion .
D2 32767
whether or not
(S2)
2) Program Example
P00000
EBCMP P1000 P1100 P1200 P1300
4-308
Chapter 4 Details of Instructions
XGK XGB
4.36.6 EERRST ○ X
Area available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
EERRST - - - - - - - - - - - - - - 1 - - -
2) Program Example
When contact point M00001 becomes On, it is clear the Error bit of F0159 and F0164 (DWORD)
4-309
Chapter 4 Details of Instructions
FSET FSET D
[Area Setting]
Operand Description Data Size
D Area of F10240 ~ F2047R in F area BIT
1) FSET
(1) It is to be set the bit between F10240~F2047F among the Special Relay Area F.
(2) It can be able to control the F area as shown below.
3) Program Example
(1) If contact point P00000 connected with external device is changed to On, Write ‘100’ in F1027(_ANC_WAR) and
Warning Falg become Set.
P00000
FWRITE 100 F1027
FSET F10243
4-310
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.37.2 FRST
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
FRST D - O - - - - - - - - - - - - 2 - - -
[Area Setting]
Operand Description Data Size
D F10240 ~ F2047F area in F area BIT
1) FRST
(1) It is used to instruction to reset the bit of F10240~F2047F in F area of Special Relay area.
(2) It is not need to use the FRST instruction because the bit of F10240 ~ F10243 area become to reset after 1 Scan
automatically even if the bit become Set.
2) Program Example
(1) Reset the No.3 bit of external Warning information area(_ANC_WAR)
(2) If P00000 is changed to On, NO3. bit of _ANC_WAR(F1027) is changed to Reset.
P00000
FRST F10272
4-311
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.37.3 FWRITE
Area available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st. (F110) (F111) (F112)
S O O O O O - O - - O O - O O
FWRITE 2~3 - - -
D - O - - - - - - - - - - - -
[Area Setting]
Operand Description Data Size
S Number of Data or Device WORD
D F1024 ~ F2047 area in F area WORD
1) FWRITE
(1) It is used to instruction to save temporary value in word of F1024~F2047 in Special Rely in F area. The value
saved by FWRITE is removed Powerr OFF.
(2) It is used to saved the word data in area repectively when detect the external device Error or Warning.
2) Program Example
(1) If P00001 connected with external device is changed to On, data of ‘1234’ is witten in F1026(_ANC_ERR) and
the request of detection of external device Error flag become Set. So PLC operation status is changed to Error
status.
P00001
P FWRITE 1234 F1026
FSET F10242
4-312
Chapter 4 Details of Instructions
LOADB(N)
S n
means B or BN
[Area Setting]
Operand Description Data Size
S Word area of the relevant device WORD
n nth bit in Word area WORD
1) LOADB
(1) This instruction takes nth bit of word data (S) as a present operation result.
(2) It takes only lower 4 bits of n value to decide bit position. Therefore, it doesn’t occur an error when n value
exceeds the Word’s range.
2) LOADBN
(1) This instruction reverses nth bit of word data (S) and takes it as a present operation result.
(2) It takes only lower 4 bits of n value to decide bit position. Therefore, it doesn’t occur an error when n value
exceeds the Word’s range.
3) Program Example
If bit 4 of D00001 becomes 1, P0001D is ON.
4-313
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.38.2 ANDB, ANDBN
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
ANDB S O O O O - O - - - O O O O
2 - - -
ANDBN n O O O O O - O - - O O O O O
ANDB(N) S n sl
means B or BN
[Area Setting]
Operand Description Data Size
S Word area of the relevant device WORD
n nth bit in Word area WORD
1) ANDB
(1) This instruction takes nth bit of word data (S) and do AND operation with a present operation result.
(2) It takes only lower 4 bits of n value to decide bit position. Therefore, it doesn’t occur an error when n value
exceeds the Word’s range.
2) ANDBN
(1) This instruction reverses nth bit of word data (S) and do AND operation with a present operation result.
(2) It takes only lower 4 bits of n value to decide bit position. Therefore, it doesn’t occur an error when n value
exceeds the Word’s range.
3) Program Example
If 15th bit (b15) of D00003 is 1, P0001A becomes ON when M0003 is ON.
4-314
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.38.3 ORB, ORBN
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
ORB S O O O O - O - - - O O O O
2 - - -
ORBN n O O O O O - O - - O O O O O
ORB(N)
S n
means B or BN
[Area Setting]
Operand Description Data Size
S Word area of the relevant device WORD
n nth bit in Word area WORD
1) ORB
(1) This instruction takes nth bit of word data (S) and do OR operation with a present operation result.
(2) It takes only lower 4 bits of n value to decide bit position. Therefore, it doesn’t occur an error when n value
exceeds the Word’s range.
2) ORBN
(1) This instruction reverses nth bit of word data (S) and do OR operation with a present operation result.
(2) It takes only lower 4 bits of n value to decide bit position. Therefore, it doesn’t occur an error when n value
exceeds the Word’s range.
3) Program Example
If bit 6 of D00000 becomes 1 or M00001 becomes 1, M0003F is ON.
4-315
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.38.4 BOUT
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
D O O O O - O - - - O O O O
BOUT 2 - - -
n O O O O O - O - - O O O O O
BOUT BOUT D n
[Area Setting]
Operand Description Data Size
D Word area of the relevant device WORD
n nth bit in Word area WORD
1) BOUT
(1) This instruction outputs a present operation result to nth bit of specified D area.
(2) It takes only lower 4 bits of n value to decide bit position. Therefore, it doesn’t occur an error when n value
exceeds the Word’s range.
2) Program Example
When M00002 is ON, 7th bit (b17) of D00001 becomes ON.
4-316
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.38.5 BSET, BRESET
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
BSET D O O O O - O - - - O O O O
2 - - -
BRESET n O O O O O - O - - O O O O O
BSET BSET D n
BRESET
BRESET D n
[Area Setting]
Operand Description Data Size
S Word area of the relevant device WORD
n nth bit in Word area WORD
1) BSET
(1) In sufficient condition, set nth bit of specified D area.
(2) It takes only lower 4 bits of n value to decide bit position. Therefore, it doesn’t occur an error when n value
exceeds the Word’s range.
2) BRESET
(1) In sufficient condition, reset nth bit of specified D area.
(2) It takes only lower 4 bits of n value to decide bit position. Therefore, it doesn’t occur an error when n value
exceeds the Word’s range.
3) Program Example
If M00002 is ON, it sets the 2nd bit (b2) of D00001. And if M00003 is ON, it resets the 2nd bit (b2) of D00001
4-317
Chapter 4 Details of Instructions
GET sl S D N
GETP P sl S D N
means GET
[Area Setting]
Operand Description Data Size
sl Slot number where special module is installed (Set to the Hexadecimal) WORD
S Start address of internal memory in special module WORD
D Start address of Device in CPU which is saving the data to read WORD
N Number of data to read WORD
[Flag Setting]
Flag Description Device Number
PUT/GET If there is no special module installed on specified slot
F0015 ~ F0022
Error If PUT/GET instruction is not completed correctly
1) GET
(1) This instruction is used to read the data of special module with memory.
(2) It saves N word data from special module’s memory (specified in S: address) specified in sl (special module’s
slot number) to internal device area specified in D.
(3) If there is no special module specified in sl (special module’s slot number), or GET instruction is not completed
correctly, applicable position bit of PUT/GET Error Flag, F0015~F0022(WORD) will be set.
(4) The setting method of sl (slot number of special module) is to set the 2 places of Hexadecimal. If sl ‘h10’ is same
as below program, first number ‘1’ is a base number and second ‘0’ means a slot number.
M00021
GET h10 100 D00100 4
4-318
Chapter 4 Details of Instructions
2) Program Example
(1) If Input Signal P00001 is changed to On, it saves 4-word data from special module’s fixed area address 0
installed on the slot number 3 of the base number 0, in D0010 ~ 00013.
P00001
GET h03 0 D00010 4
Special module
D area of CPU Fixed area
4-319
Chapter 4 Details of Instructions
XGK XGB
○ ○
4.39.2 PUT, PUTP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
S - - - - - - - - - O - - - -
PUT(P) 4~7 O - -
D O - O - - - - - - - O O O O
N O - O - - - - - - O - - - -
PUT sl S1 S2 N
PUTP P sl S1 S2 N
means PUT
[Area Setting]
Operand Description Data Size
sl Slot number where special module is installed (Set to the Hexadecimal) WORD
S1 Address in internal memory of special module WORD
S2 Start number of Device or a Constant, saved data will be saved in special module. WORD
N Number of data to save WORD
[Flag Setting]
Flag Description Device Number
PUT/GET If there is no special module installed on specified slot
F0015 ~ F0022
Error If PUT/GET instruction is not completed correctly
1) PUT
(1) This instruction is used to write the data in special module with memory.
(2) It writes N word data from device specified in S2, in specified special module’s memory (specified in S) in sl
(special module’s slot number).
(3) If there is no special module specified in sl (special module’s slot number), or PUT instruction is not completed
correctly, applicable position bit of PUT/GET Error Flag, F0015~F0022(WORD) will be set.
(4) The setting method of sl (slot number of special module) is to set the 2 places of Hexadecimal. If sl ‘h14’ is same
as below program, first number ‘1’ is a base number and second ‘4’ means a slot number.
M00021
PUT h14 2 D00100 4
b15 b0
F0015
F0016 1
If there is no special module in .
the Slot 0 of No.1 Base, or PUT .
instruction is not completed
correctly.
.
F0022
4-320
Chapter 4 Details of Instructions
2) Program Example
(1) Where the 40-word data of D1000 ~ D1039 is written in special module’s starting memory address 10 ~ 50
installed on the slot number 7 of No.0 base when M00000 is On.
M00000
PUT h07 10 D1000 40
(2)Where the 3-word data of word M00010 ~ M00012 is written in A/D module’s internal memory address 5 ~ 7
installed on the slot number 3 of No.0 base.
M00000
PUT h03 5 M00010 3
4-321
Chapter 4 Details of Instructions
P2PSN P2PSN N1 N2 N3
[Area Setting]
Operand Description Data Size
N1 P2P number (1 ~8) WORD
N2 Block number( 0 ~ 63) WORD
N3 Station number (0 ~ 63) WORD
[Flag Setting]
Flag Description Device Number
Error If N1, N2, N3’s value exceeds the applicable range F110
1) P2PSN
(1) P2PSN instruction is used to change the other’s P2P service station No. during run.
(2) It changes N1 P2P’s N2 block remote station No. to N3.
(3) Applicable Communication module : FDEnet, Cnet.
2) Error
(1) If N1(1~8), N2(0~63), N3(0~63)’s value exceeds the applicable range, Error Flag(F110) will be set.
3) Program Example
P00000
P2PSN P1000 P1100 P1200
If input condition P00000 is On, it changes block remote station number set as P1100 among P2P number
set as P1000 into station number set as P1200.
4-322
Chapter 4 Details of Instructions
XGK XGB
○ X
4.40.2 P2PWRD
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
N1 O - O O O - O - - O O O O O
N2 O - O O O - O - - O O O O O
P2PWRD N3 O - O O O - O - - O O O O O 4~6 O - -
N4 O - O O O - O - - O O O O O
N5 O - O O O - O - - - O O O O
P2PWRD P2PWRD N1 N2 N3 N4 N5
[Area Setting]
Operand Description Data Size
N1 P2P number (1 ~ 8) WORD
N2 Block number( 0 ~ 63) WORD
N3 Variable number (1 ~ 4) WORD
N4 Variable size [n byte] (0 ~ 1400) WORD
N5 Device WORD
[Flag Setting]
Flag Description Device Number
Error If N1, N2, N3, N4’s value exceeds the applicable range F110
1) P2PWRD
(1) P2PWRD instruction is used to change applicable P2P parameter block’s variable size and WORD
READ device area.
(2) Use N1, N2 and N3 to specify applicable P2P parameter, block and variable and then change variable
size and device to N4 and N5 respectively.
(3) Applicable communication modules: FEnet, FDEnet, Cnet.
2) Error
(1) If N1 (1~8), N2 (0~63), N3 (1~4), N4 (0~1400)’s value exceeds the applicable range, Error Flag (F110) will be
set.
3) Program Example
P00000
P2PWRD P1000 P1100 P1200 P1300 P1400
Remark
(1) As for individual instruction, 1~4 is used for variable number (N3) with no variable size (N4) applied.
(2) As for continuous instruction, 1 is always used for variable number (N3) with variable size (N4) applied.
(3) Variable size (N4) is used in byte unit.
4-323
Chapter 4 Details of Instructions
XGK XGB
○ X
4.40.3 P2PWWR
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
N1 O - O O O - O - - O O O O O
N2 O - O O O - O - - O O O O O
P2PWWR N3 O - O O O - O - - O O O O O 4~6 O - -
N4 O - O O O - O - - O O O O O
N5 O - O O O - O - - - O O O O
P2PWWR P2PWWR N1 N2 N3 N4 N5
[Area Setting]
Operand Description Data Size
N1 P2P number (1 ~ 8) WORD
N2 Block number( 0 ~ 63) WORD
N3 Variable number (1 ~ 4) WORD
N4 Variable size (0 ~ 1400) WORD
N5 Device WORD
[Flag Setting]
Flag Description Device Number
Error If N1, N2, N3, N4’s value exceeds the applicable range F110
1) P2PWWR
(1) P2PWWR instruction is used to change applicable P2P parameter block’s variable size and WORD WRITE
device area.
(2) Use N1, N2 and N3 to specify applicable P2P parameter, block and variable and then change variable size and
device to N4 and N5 respectively.
(3) Applicable communication modules: FEnet, FDEnet, Cnet.
2) Error
(1) If N1 (1~8), N2 (0~63), N3 (1~4), N4 (0~1400)’s value exceeds the applicable range, Error Flag (F110) will be
set.
3) Program Example
P00000
P2PWWR P1000 P1100 P1200 P1300 P1400
Remark
(1) As for individual instruction, 1~4 is used for variable number (N3) with no variable size (N4) applied.
(2) As for continuous instruction, 1 is always used for variable number (N3) with variable size (N4) applied.
(3) Variable size (N4) is used in byte unit.
4-324
Chapter 4 Details of Instructions
XGK XGB
○ X
4.40.4 P2PBRD
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
N1 O - O O O - O - - O O O O O
N2 O - O O O - O - - O O O O O
P2PBRD N3 O - O O O - O - - O O O O O 4~6 O - -
N4 O - O O O - O - - O O O O O
N5 O - O O O - - O O - O - - -
P2PBRD P2PBRD N1 N2 N3 N4 N5
[Area Setting]
Operand Description Data Size
N1 P2P Number (1 ~ 8) WORD
N2 Block Number( 0 ~ 63) WORD
N3 variable Number (1 ~ 4) WORD
N4 variable Size (0 ~ 2000) WORD
N5 Device WORD
[Flag Setting]
Flag Description Device Number
Error If N1, N2, N3, N4’s value exceeds the applicable range F110
1) P2PBRD
(1) P2PBRD instruction is used to change applicable P2P parameter block’s variable size and BIT READ device
area.
(2) Use N1, N2 and N3 to specify applicable P2P parameter, block and variable and then change variable size and
device to N4 and N5 respectively.
(3) Applicable communication modules: FEnet, FDEnet, Cnet.
2) Error
(1) If N1 (1~8), N2 (0~63), N3 (1~4), N4 (0~1400)’s value exceeds the applicable range, Error Flag (F110) will be
set.
3) Program Example
P00000
P2PBRD P1000 P1100 P1200 P1300 P1400
Remark
(1) As for individual instruction, 1~4 is used for variable number (N3) with no variable size (N4) applied.
(2) As for continuous instruction, 1 is always used for variable number (N3) with variable size (N4) applied.
(3) Variable size (N4) is used in byte unit.
4-325
Chapter 4 Details of Instructions
XGK XGB
○ X
4.40.5 P2PBWR
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
N1 O - O O O - O - - O O O O O
N2 O - O O O - O - - O O O O O
P2PBWR N3 O - O O O - O - - O O O O O 4~6 O - -
N4 O - O O O - O - - O O O O O
N5 O - O O O - - O O - O - - -
P2PBWR P2PBWR N1 N2 N3 N4 N5
[Area Setting]
Operand Description Data Size
N1 P2P number (1 ~ 8) WORD
N2 Block number (0 ~ 63) WORD
N3 Variable number (1 ~ 4) WORD
N4 Variable size (0 ~ 2000) WORD
N5 Device WORD
[Flag Setting]
Flag Description Device Number
Error If N1, N2, N3, N4’s value exceeds the applicable range F110
1) P2PBWR
(1) P2PWR instruction is used to change applicable P2P parameter block’s variable size and BIT WRITE device
area.
(2) Use N1, N2 and N3 to specify applicable P2P parameter, block and variable and then change variable size and
device to N4 and N5 respectively.
(3) Applicable communication modules: FEnet, FDEnet, Cnet.
2) Error
(1) If N1 (1~8), N2 (0~63), N3 (1~4), N4 (0~1400)’s value exceeds the applicable range, Error Flag (F110) will be
set.
3) Program Example
P00000
P2PBWR P1000 P1100 P1200 P1300 P1400
Remark
(1) As for individual instruction, 1~4 is used for variable number (N3) with no variable size (N4) applied.
(2) As for continuous instruction, 1 is always used for variable number (N3) with variable size (N4) applied.
(3) Variable size (N4) is used in byte unit.
4-326
Chapter 4 Details of Instructions
ORG ORG sl ax
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on WORD
ax Axis to instruction WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) ORG
(1) Function
(1) It is used to the positioning module to return to Origin Point.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl (positioning module’s slot
number) to return to Origin Point.
(2) Error
(1) If a value more than 2 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
2) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘X’ installed on the slot number 1 to
return to Origin Point.
M00000
P ORG 1 0
(2) If input signal M00000 is On, it instructions the positioning module’s axis specified in D00010 installed on the
slot number 3 to return to Origin Point.
M00000
P ORG 3 D00010
4-327
Chapter 4 Details of Instructions
XGK XGB
○ ○
4. 41.2 FLT
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
FLT 4~7 O - -
ax O - O - - - O - - O - O O O
FLT FLT sl ax
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on WORD
ax Axis to instruction WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) FLT
(1) Function
A) It is used to instruction the positioning module to set the Floating point.
B) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl (positioning module’s slot
number) to set Floating Origin Point.
(2) Error
A) For XGK, if a value more than 2 is input in specified instruction axis ‘ax’, for XGB, if a value more than 1 is
input Error Flag (F110) will be set.
2) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘X’ installed on the slot number
1 to set Floating Point.
M00000
P FLT 1 0
(2) If input signal M00000 is On, it instructions the positioning module’s axis specified in D00010 installed
on the slot number 3 to return to Origin Point.
4-328
Chapter 4 Details of Instructions
XGK XGB
○ ○
4. 41.3 DST
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
ax O - O - - - O - - O - O O O
n1 O - O - - - O - - O - O O O
DST n2 O - O - - - O - - O - O O O 4~7 O - -
n3 O - O - - - O - - O - O O O
n4 O - O - - - O - - O - O O O
n5 O - O - - - O - - O - O O O
DST DST sl ax n1 n2 n3 n4 n5
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on WORD
ax Axis to instruction WORD
n1 Target position DWORD
n2 Target speed DWORD
n3 Dwell time WORD
n4 M code number WORD
n5 Control word WORD
1) DST
(1) It is used to instruction the positiong module to start directly.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl (positioning module’s slot
number) to start directly.
(3) The axis to perform the instruction outputs the pulse with Target Position (n1), Target Speed (n2), Dwell Time
(n3), M Code (n4).
(4) Control Word (n5) has meaning of as described below per bit.
15 ~ 7 6~5 4 3~1 0
Adjusting 0: Absolute coordinate 0:Position Control
- -
Time 1: Relative coordinate 1:Speed Control
2) Error
(1) If a value more than 2 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
(2) If there is no special module on the specified slot, or no address specified in S is available in the installed module,
Error Flag (F110) will be set. This is because the fixed area address may be different according to the properties of
the special module.
3) Program Example
(1) If input signal M00000 is On, it outputs the pulse to instruction the positioning module’s axis ‘X’ installed on the
slot number 1 to start directly, with Target Speed 500, Absolute Position up to 1000, Adjusting Time 3, Dwell Time
10ms and M Code 20.
M00000
P DST 1 0 1000 500 10 20 hE0
4-329
Chapter 4 Details of Instructions
XGK XGB
○ ○
4. 41.4 IST
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
IST ax O - O - - - O - - O - O O O 4~7 O - -
n1 O - O - - - O - - O - O O O
IST IST sl ax n1
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on WORD
ax Axis to instruction WORD
n1 Step number to start WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) IST
(1) It is used to instruction the positiong module to start indirectly.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl (positioning module’s slot
number) to start n1 step indirectly.
2) Error
(1) If a value more than 2 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
(2) If there is no special module on the specified slot, or no address specified in S is available in the installed
module, Error Flag (F110) will be set. This is because the fixed area address may be different according to the
properties of the special module.
2) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘X’ installed on the slot number
1 to start No.3 step indirectly.
M00000
P IST 1 0 3
(2) If input signal M00000 is On, it instructions the positioning module’s axis ‘Y’ installed on the slot number
3 to start the step specified in D00010 indirectly.
M00000
P IST 3 1 D00010
4-330
Chapter 4 Details of Instructions
XGK XGB
○ ○
4. 41.5 LIN
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
ax O - O - - - O - - O - O O O
LIN 4~7 O - -
n1 O - O - - - O - - O - O O O
n2 O - O - - - O - - O - O O O
LIN LIN sl ax n1 n2
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on WORD
ax Axis to instruction WORD
n1 Step number to execute linear Interpolation WORD
n2 Axis setting to execute linear Interpolation WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) LIN
(1) It is used to instruction the positioning module to set the Linear Interpolatioin.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl (positioning module’s slot
number) to let n2 axis operate n1 step by Linear Interpolation.
(3) In order to set the axis to perform Linear Interplotion to n2, the bit of the axis assigned per bit shall be set as
follows;
15 ~ 3 2 1 0
Z axis
Unused Y axis X axis
(Unused in XGB)
2) Error
(1) If a value more than 2 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
(2) If there is no special module on the specified slot, or no address specified in S is available in the installed
module, Error Flag (F110) will be set. This is because the fixed area address may be different according to the
properties of the special module.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘X’ installed on the slot number
1 to let No.4 step operate 2 axes of X & Y by Linear Interplotion.
M00000
P LIN 1 0 4 3
(2) If input signal M00000 is On, it instructions the positioning module’s axis ‘Y’ installed on the slot number
3 to let the step specified in D00010 operate 3 axes of X, Y & Z by Linear Interplotion.
4-331
Chapter 4 Details of Instructions
XGK XGB
○ X
4. 41.6 CIN
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
ax O - O - - - O - - O - O O O
CIN 4~7 O - -
n1 O - O - - - O - - O - O O O
n2 O - O - - - O - - O - O O O
CIN CIN sl ax n1 n2
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on WORD
ax Axis to instruction WORD
n1 Step number to execute Circular Interpolation WORD
n2 Ordinate axis setting to execute Circular Interpolation WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) CIN
(1) It is used to instruction the positioning module to set the Linear Interpolatioin.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl (positioning module’s slot
number) to let n2 axis (as servant) operate n1 step by Circular Interplotion.
(3) In order to set the axis of ordinates to perform Linear Interplotion to n2, the bit of the axis assigned per bit shall
be set as follows;
15 ~ 3 2 1 0
Z axis
Unused Y axis X axis
(Unused in XGB)
2) Error
(1) If a value more than 2 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
(2) If there is no special module on the specified slot, or no address specified in S is available in the installed
module, Error Flag (F110) will be set. This is because the fixed area address may be different according to the
properties of the special module.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘X’ installed on the slot number 1 to let
No.4 step operate 2 axes of X (main) & Y (slave) by Circular Interplotion.
M00000
P CIN 1 0 4 2
(2) If input signal M00000 is On, it instructions the positioning module’s axis ‘Y’ installed on the slot number 3 to let
the step specified in D00010 operate the axes of Y (main) & Z (slave) by Circular Interplotion.
M00000
P CIN 3 1 D00010 4
4-332
Chapter 4 Details of Instructions
XGK XGB
○ ○
4. 41.7 SST
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - O O
ax O - O - - - O - - O - O O O
SST n1 O - O - - - O - - O - O O O 4~7 O - -
n2 O - O - - - O - - O - O O O
n3 O - O - - - O - - O - O O O
n4 O - O - - - O - - O - O O O
SST SST sl ax n1 n2 n3 n4
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on WORD
ax Axis to instruction WORD
n1 X axis step number to execute Simultaneous Start WORD
n2 Y axis step number to execute Simultaneous Start WORD
n3 Z axis step number to execute Simultaneous Start WORD
n4 Axis setting to execute Simultaneous Start WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) SST
(1) It is used to instruction the positioning module to set the simultaneous Start.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl (positioning module’s slot
number) to let the axes simultaneously operate n1 (X), n2 (Y) and n3 (Z) steps (unused in XGB case) by
Simultaneous Start.
(3) In order to set the axis (n4) to perform Simultaneous Start, the bit of the axis assigned per bit shall be set as
follows.
15 ~ 3 2 1 0
Z axis
Unused Y axis X axis
(Unused in XGB)
2) Error
(1) If a value more than 2 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
(2) If there is no special module on the specified slot, or no address specified in S is available in the installed
module, Error Flag (F110) will be set. This is because the fixed area address may be different according to the
properties of the special module.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘X’ installed on the slot number 1 to let the
axes simultaneously operate n1(X), n2 (Y) and n3 (Z) steps by Simultaneous Start.
M00000
P SST 1 0 1 2 3 7
(2) If input signal M00000 is On, it instructions the positioning module’s axis ‘Y’ installed on the slot number
3 to let the axes simultaneously operate the step specified in D00010 (X) and n10 step (Y) by Simultaneous
Start.
M00000
P SST 3 1 D00010 10 6
4-333
Chapter 4 Details of Instructions
XGK XGB
○ ○
4. 41.8 VTP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
VTP 4~7 O - -
ax O - O - - - O - - O - O O O
VTP
VTP sl ax
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on WORD
ax Axis to instruction WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) VTP
(1) It is used to instruction the positioning module to switch Speed/Position control.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl (positioning module’s slot
number) to switch Speed/Position Control.
2) Error
(1) If a value more than 2 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
(2) If there is no special module on the specified slot, or no address specified in S is available in the installed
module, Error Flag (F110) will be set. This is because the fixed area address may be different according to the
properties of the special module.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘X’ installed on the slot number
1 to switch Speed/Position Control
M00000
P VTP 1 0
(2) If input signal M00000 is On, it instructions the positioning module’s axis specified in D00010 installed
on the slot number 3 to switch Speed/Position Control.
M00000
P VTP 3 D00010
4-334
Chapter 4 Details of Instructions
XGK XGB
○ ○
4. 41.9 PTV
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
PTV 4~7 O - -
ax O - O - - - O - - O - O O O
PTV PTV sl ax
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on WORD
ax Axis to instruction WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) PTV
(1) It is used to inatruction the positioning module to switch Position/Speed control.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl (positioning module’s slot
number) to switch Position/Speed Control.
2) Error
(1) If a value more than 2 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
(2) If there is no special module on the specified slot, or no address specified in S is available in the installed
module, Error Flag (F110) will be set. This is because the fixed area address may be different according to the
properties of the special module.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘X’ installed on the slot number
1 to switch Position/Speed Control
M00000
P PTV 1 0
(2) If input signal M00000 is On, it instructions the positioning module’s axis specified in D00010 installed
on the slot number 3 to switch Position/Speed Control.
M00000
P PTV 3 D00010
4-335
Chapter 4 Details of Instructions
XGK XGB
○ ○
4. 41.10 STP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
STP 4~7 O - -
ax O - O - - - O - - O - O O O
STP STP sl ax
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) STP
(1) It is used to instruction the positioning module to stop as decelerated.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl (positioning module’s slot
number) to stop as decelerated.
2) Error
(1) For XGK, if a value more than 2 is input in specified instruction axis ‘ax’, for XGB, if a value more than 1 is input
Error Flag (F110) will be set.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘X’ installed on the slot number
1 to stop as decelerated.
M00000
P STP 1 0
(2) If input signal M00000 is On, it instructions the positioning module’s axis specified in D00010 installed
on the slot number 3 to stop as decelerated.
M00000
P STP 3 D00010
4-336
Chapter 4 Details of Instructions
XGK XGB
○ X
4. 41.11 SKP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
SKP 4~7 O - -
ax O - O - - - O - - O - O O O
SKP SKP sl ax
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on WORD
ax Axis to instruction WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) SKP
(1) It is used to instruction the positioning module to Skip.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl (positioning module’s slot
number) to skip.
2) Error
(1) If a value more than 2 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
(2) If there is no special module on the specified slot, or no address specified in S is available in the installed module,
Error Flag (F110) will be set. This is because the fixed area address may be different according to the properties
of the special module.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘X’ installed on the slot number 1 to skip.
M00000
P SKP 1 0
(2) If input signal M00000 is On, it instructions the positioning module’s axis specified in D00010 installed on the slot
number 3 to skip.
M00000
P SKP 3 D00010
4-337
Chapter 4 Details of Instructions
XGK XGB
○ ○
4. 41.12 SSP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
ax O - O - - - O - - O - O O O
SSP n1 O - O - - - O - - O - O O O 4~7 O - -
n2 O - O - - - O - - O - O O O
n3 O - O - - - O - - O - O O O
SSP SSP sl ax n1 n2 n3
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on WORD
ax Axis to instruction WORD
n1 Main axis’s position value to execute Position Synchronization DWORD
n2 Step number of instruction axis to operate when Position Synchronization starts WORD
n3 Main axis Setting for Position Synchronization WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) SSP
(1) It is used to instruction the positioning module to synchronize the position.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl (positioning module’s slot
number) to execute synchoronizing the position to operate n2 step of the axis ‘ax’ when the main axis of n3 is to
with n1.
(3) The available setting value on n3 is as described below.
Axis
Setting Value
XGK XGB
0 X axis X axis
1 Y axis Y axis
2 Z axis
No support
3 Encoder
2) Error
(1) If a value more than 2 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
(2) If there is no special module on the specified slot, or no address specified in S is available in the installed
module, Error Flag (F110) will be set. This is because the fixed area address may be different according to the
properties of the special module.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘X’ installed on the slot number 1 to
execute synchronizing the position to operate n3 step of the axis X when the main axis of Y is to synchronize
the position with 1000.
M00000
P SSP 1 0 1000 3 1
4-338
Chapter 4 Details of Instructions
XGK XGB
○ ○
4. 41.13 SSS
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
ax O - O - - - O - - O - O O O
SSS n1 O - O - - - O - - O - O O O 4~7 O - -
n2 O - O - - - O - - O - O O O
n3 O - O - - - O - - O - O O O
SSS SSS sl ax n1 n2 n3
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on WORD
ax Axis to instruction WORD
XGK: Main axis ratio of Speed Synchronization; XGB: Speed Synchronization ratio
n1 WORD
(0 ~ 100.00%)
n2 XGK: Slave axis ratio of Speed Synchronization; XGB: delay time (1 ~ 10ms) WORD
n3 Setting main axis of Speed Synchronization WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) SSS
(1) It is used to instruction the positioning module to synchronize the speed.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl (positioning module’s slot
number) to execute synchronizing the speed to operate the main axis of n3 with main axis ratio of n1 and slave
axis ratio of n2.
(3) The available setting value on n3 is as described below.
Axis
Setting Value
XGK XGB
0 X axis X axis
1 Y axis Y axis
2 Z axis High-speed counter Ch0
3 Encoder High-speed counter Ch1
4 High-speed counter Ch2
No support
5 High-speed counter Ch3
2) Error
(1) If a value more than 2 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
(2) If there is no special module on the specified slot, or no address specified in S is available in the installed
module, Error Flag (F110) will be set. This is because the fixed area address may be different according to the
properties of the special module.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘X’ installed on the slot number 1 to
execute synchronizing the speed to operate the main axis of Y with a main and slave axis ratio of 4 : 3.
M00000
P SSS 1 0 4 3 1
4-339
Chapter 4 Details of Instructions
XGK XGB
○ ○
4. 41.14 POR
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - O - - - -
POR ax O - O - - - O - - O - O O O 4~7 O - -
n1 O - O - - - O - - O - O O O
POR POR sl ax n1
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on WORD
ax Axis to instruction WORD
n1 Target position to change DWORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) POR
(1) It is used to instruction the positioning module to override position.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl( positioning module’s slot
number) to override position to change the target position to n1 during run.
2) Error
(1) For XGK, if a value more than 2 is input in specified instruction axis ‘ax’, for XGB, if a value more than 1 is input
Error Flag (F110) will be set.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘X’ installed on the slot number
1 to override position to change its target position to 20000.
M00000
P POR 1 0 20000
(2) If input signal M00000 is On, it instructions the positioning module’s axis specified in D00010 installed
on the slot number 3 to override position to change its target position to the value specified in D00020.
M00000
P POR 3 D00010 D00020
4-340
Chapter 4 Details of Instructions
XGK XGB
○ ○
4. 41.15 SOR
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl O - O - - - O - - O - O O O
SOR ax O - O - - - O - - O - O O O 4~7 O - -
n1 O - O - - - O - - O - O O O
SOR SOR sl ax n1
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on WORD
ax Axis to instruction WORD
n1 Target Speed to change DWORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) SOR
(1) It is used to instruction the positioning module to override the speed.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to override speed to change the target speed to n1 during run.
2) Error
(1) If a value more than 2 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
(2) If there is no special module on the specified slot, or no address specified in S is available in the installed
module, Error Flag (F110) will be set. This is because the fixed area address may be different according to the
properties of the special module.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘X’ installed on the slot number
1 to override speed to change its target speed to 5000
(2) If input signal M00000 is On, it instructions the positioning module’s axis specified in D00010 installed
on the slot number 3 to override speed to change its target speed to the value specified in D00020.
4-341
Chapter 4 Details of Instructions
XGK XGB
○ ○
4. 41.16 PSO
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
ax O - O - - - O - - O - O O O
PSO 4~7 O - -
n1 O - O - - - O - - O - O O O
n2 O - O - - - O - - O - O O O
PSO PSO sl ax n1 n2
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on WORD
ax Axis to instruction WORD
n1 Position to change speed DWORD
n2 Target speed to change DWORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) PSO
(1)It is used to instruction the positioning module to override position-specified.
(2)It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to override position-specified speed to change the target speed to n2 when the present position is n1
during run.
2) Error
(1) If a value more than 2 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
(2) If there is no special module on the specified slot, or no address specified in S is available in the installed
module, Error Flag (F110) will be set. This is because the fixed area address may be different according to the
properties of the special module.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘X’ installed on the slot number
1 to override position-specified speed to change its target speed to 2000 when the present position is
5000.
M00000
P PSO 1 0 5000 2000
(2) If input signal M00000 is On, it instructions the positioning module’s axis specified in D00010 installed
on the slot number 3 to override position-specified speed to change its target speed to the value
specified in D00030 when the present position is D00020.
M00000
P PSO 3 D00010 D00020 D00030
4-342
Chapter 4 Details of Instructions
XGK XGB
○ X
4. 41.17 NMV
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
NMV 4~7 O - -
ax O - - O - - O - - O - O O O
NMV NMV sl ax
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) NMV
(1) It is used to instruction the positioning module to operate continuously.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to operate continuously during run. If the instructioned axis ‘ax’ is running n step, it will change position
and speed to target position and target speed specified in (n+1) as soon as instructioned.
2) Error
(1) If a value more than 2 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
(2) If there is no special module on the specified slot, or no address specified in S is available in the installed
module, Error Flag (F110) will be set. This is because the fixed area address may be different according to the
properties of the special module.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘X’ installed on the slot number
1 to operate continuously.
M00000
P NMV 1 0
(2) If input signal M00000 is On, it instructions the positioning module’s axis specified in D00010 installed
on the slot number 3 to operate continuously.
M00000
P NMV 3 D00010
4-343
Chapter 4 Details of Instructions
XGK XGB
○ ○
4. 41.18 INCH
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl O - O - - - O - - O - O O O
INCH ax O - O - - - O - - O - O O O 4~7 O - -
n1 O - O - - - O - - O - O O O
INCH INCH sl ax n1
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction WORD
n1 Target Position DWORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) INCH
(1) It is used to instruction the positioning module to inch.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to inch by n1.
2) Error
(1) If a value more than 2 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
(2) If there is no special module on the specified slot, or no address specified in S is available in the installed
module, Error Flag (F110) will be set. This is because the fixed area address may be different according to the
properties of the special module.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘X’ installed on the slot number
1 to inch by 100.
M00000
P NMV 1 0
(2) If input signal M00000 is On, it instructions the positioning module’s axis specified in D00010 installed
on the slot number 3 to inch by 10 backward.
M00000
P NMV 3 D00010
4-344
Chapter 4 Details of Instructions
XGK XGB
○ X
4. 41.19 RTP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
RTP 4~7 O - -
ax O - O - - - O - - O - O O O
RTP RTP sl ax
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) RTP
(1) It is used to instruction the positioning module to return to position previous to manual operation.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to return to position previous to manual operation.
2) Error
(1) If a value more than 2 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
(2) If there is no special module on the specified slot, or no address specified in S is available in the installed
module, Error Flag (F110) will be set. This is because the fixed area address may be different according to the
properties of the special module.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘X’ installed on the slot number
1 to return to position previous to manual operation.
M00000
P RTP 1 0
(2) If input signal M00000 is On, it instructions the positioning module’s axis specified in D00010 installed
on the slot number 3 to return to position previous to manual operation.
M00000
P RTP 3 D00010
4-345
Chapter 4 Details of Instructions
XGK XGB
○ ○
4. 41.20 SNS
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
SNS ax O - O - - - O - - O - O O O 4~7 O - -
n1 O - O - - - O - - O - O O O
SNS SNS sl ax n1
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction WORD
n1 Setting step number of next operation WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) SNS
(1) It is used to instruction the positioning module to change operation step to the next step.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to change operation step to the next step n1.
2) Error
(1) If a value more than 2 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
(2) If there is no special module on the specified slot, or no address specified in S is available in the installed
module, Error Flag (F110) will be set. This is because the fixed area address may be different according to the
properties of the special module.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘X’ installed on the slot number
1 to change operation step to the next step number 10.
M00000
P SNS 1 0 10
(2) If input signal M00000 is On, it instructions the positioning module’s axis specified in D00010 installed
on the slot number 3 to change operation step to the next step value specified in D00020.
M00000
P SNS 3 D00010 D00020
4-346
Chapter 4 Details of Instructions
XGK XGB
○ X
4. 41.21 SRS
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
SRS ax O - O - - - O - - O - O O O 4~7 O - -
n1 O - O - - - O - - O - O O O
SRS SRS sl ax n1
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction WORD
n1 Setting step of repeated operation WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) SRS
(1) It is used to instruction the positioning module to chage pepeated operation step.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to change repeated operation step to n1.
2) Error
(1) If a value more than 2 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
(2) If there is no special module on the specified slot, or no address specified in S is available in the installed
module, Error Flag (F110) will be set. This is because the fixed area address may be different according to the
properties of the special module.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘X’ installed on the slot number
1 to change repeated operation step to step number 10.
M00000
P SNS 1 0 10
(2) If input signal M00000 is On, it instructions the positioning module’s axis specified in D00010 installed
on the slot number 3 to change repeated operation step to the value specified in D00020.
M00000
P SNS 3 D00010 D00020
4-347
Chapter 4 Details of Instructions
XGK XGB
○ ○
4. 41.22 MOF
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
MOF 4~7 O - -
ax O - O - - - O - - O O O O O
MOF MOF sl ax
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) MOF
(1) It is used to instruction the positioning module to make produced M code Off.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to make produced M code Off so to delete the value of M code.
2) Error
(1) If a value more than 2 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
(2) If there is no special module on the specified slot, or no address specified in S is available in the installed
module, Error Flag (F110) will be set. This is because the fixed area address may be different according to the
properties of the special module.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘X’ installed on the slot number
1 to make produced M code off so to delete the value of M code.
M00000
P MOF 1 0
(2) If input signal M00000 is On, it instructions the positioning module’s axis specified in D00010 installed
on the slot number 3 to make produced M code off so to delete the value of M code.
M00000
P MOF 3 D00010
4-348
Chapter 4 Details of Instructions
XGK XGB
○ ○
4. 41.23 PRS
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl O - O - - - O - - O - O O O
PRS ax O - O - - - O - - O - O O O 4~7 O - -
n1 O - O - - - O - - O - O O O
PRS PRS sl ax n1
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction WORD
n1 Setting present position to change. DWORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) PRS
(1) It is used to instruction the positioning module to change present position.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to change present position to n1.
2) Error
(1) If a value more than 2 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
(2) If there is no special module on the specified slot, or no address specified in S is available in the installed
module, Error Flag (F110) will be set. This is because the fixed area address may be different according to the
properties of the special module.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘X’ installed on the slot number
1 to change present position to -100.
M00000
P PRS 1 0 -100
(2) If input signal M00000 is On, it instructions the positioning module’s axis specified in D00010 installed
on the slot number 3 to change present position to the value specified in D00020.
M00000
P PRS 3 D00010 D00020
4-349
Chapter 4 Details of Instructions
XGK XGB
○ X
4. 41.24 ZOE
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
ZOE 4~7 O - -
ax O - O - - - O - - O - O O O
ZOE ZOE sl ax
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) ZOE
(1) It is used to instruction the positioning module to allw zone output.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to allow zone output.
2) Error
(1) If a value more than 2 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
(2) If there is no special module on the specified slot, or no address specified in S is available in the installed module,
Error Flag (F110) will be set. This is because the fixed area address may be different according to the properties
of the special module.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘X’ installed on the slot number
1 to allow zone output.
M00000
P ZOE 1 0
(2) If input signal M00000 is On, it instructions the positioning module’s axis specified in D00010 installed
on the slot number 3 to allow zone output.
M00000
P ZOE 3 D00010
4-350
Chapter 4 Details of Instructions
XGK XGB
○ X
4. 41.25 ZOD
Area Available Flag
Instruction Con Step Error Zero Carry
PMKL F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
ZOD 4~7 O - -
ax O - O - - - O - - O - O O O
ZOD ZOD sl ax
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) ZOD
(1) It is used to instruction the positioning module to prohibit zone output.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to prohibit zone output.
2) Error
(1) If a value more than 2 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
(2) If there is no special module on the specified slot, or no address specified in S is available in the installed
module, Error Flag (F110) will be set. This is because the fixed area address may be different according to the
properties of the special module.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘X’ installed on the slot number
1 to prohibit zone output
M00000
P ZOD 1 0
(2) If input signal M00000 is On, it instructions the positioning module’s axis specified in D00010 installed
on the slot number 3 to prohibit zone output.
M00000
P ZOD 3 D00010
4-351
Chapter 4 Details of Instructions
XGK XGB
○ X
4. 41.26 EPRS
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl O - O - - - O - - O - O O O
EPRS ax O - O - - - O - - O - O O O 4~7 O -
n1 O - O - - - O - - O - O O O
ERPS ERPS sl ax n1
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction WORD
n1 Setting encoder value to change DWORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) EPRS
(1) It is used to instruction the positioning module to change present Encoder Value.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to change present Encoder Value to n1.
2) Error
(1) If a value more than 2 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
(2) If there is no special module on the specified slot, or no address specified in S is available in the installed
module, Error Flag (F110) will be set. This is because the fixed area address may be different according to the
properties of the special module.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘X’ installed on the slot number
1 to change present Encoder Value to -100.
M00000
P EPRS 1 0 -100
(2) If input signal M00000 is On, it instructions the positioning module’s axis specified in D00010 installed
on the slot number 3 to change present Encoder Value to the value specified in D00020.
M00000
P EPRS 3 D00010 D00020
4-352
Chapter 4 Details of Instructions
XGK XGB
○ X
4. 41.27 TEA
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
ax O - O - - - O - - O - O O O
TEA n1 O - O - - - O - - O - O O O 4~7 O - -
n2 O - O - - - O - - O - O O O
n3 O - O - - - O - - O - O O O
n4 O - O - - - O - - O - O O O
TEA TEA sl ax n1 n2 n3 n4
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction WORD
n1 Teaching Data (target position or target speed) DWORD
n2 Setting step number to teach WORD
n3 Setting teaching method (0: RAM teaching or 1: ROM teaching) WORD
n4 Setting teaching item (0: Position teaching or 1: Speed teaching) WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) TEA
(1) It is used to instruction the positioning module to teaching.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to change target position or target speed to n1 value, according to n4 value among n2 step data of the
axis ‘ax’.
(3) It is available to RAM teaching or ROM teaching according to the setting value of n3.
Setting value available for n4 is as shown below
2) Error
(1) If a value more than 2 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
(2) If there is no special module on the specified slot, or no address specified in S is available in the installed
module, Error Flag (F110) will be set. This is because the fixed area address may be different according to the
properties of the special module.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘X’ installed on the slot number 1 to
change target position of step number 10 of the axis ‘X’ to 3000 with ROM Teaching.
M00000
P TEA 1 0 3000 10 1 0
4-353
Chapter 4 Details of Instructions
XGK XGB
○ X
4. 41.28 TEAA
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
ax O - O - - - O - - O - O O O
TEAA n1 O - O - - - O - - O - O O O 4~7 O - -
n2 O - O - - - O - - O - O O O
n3 O - O - - - O - - O - O O O
n4 O - O - - - O - - O - O O O
TEAA TEAA sl ax n1 n2 n3 n4
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction WORD
n1 Setting head step number to teach WORD
n2 Setting teaching method (0: RAM teaching or 1: ROM teaching) WORD
n3 Setting teaching item (0: Position teaching or 1: Speed teaching) WORD
n4 Setting the number of teaching WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) TEAA
(1) It is used to instruction the positioning module to teaching array.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to change target position or target speed to the value saved in teaching data area, according to n2 as
many as the number specified in n1 ~ n4 steps of the axis ‘ax’ with teaching array. At this time, based on the
value specified in n3, RAM or ROM teaching will be available.
(3) Teaching data value shall be specified in memory area inside an additional positioning module before teaching
array instruction is given.
2) Error
(1) If a value more than 2 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
(2) If there is no special module on the specified slot, or no address specified in S is available in the installed
module, Error Flag (F110) will be set. This is because the fixed area address may be different according to the
properties of the special module.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘X’ installed on the slot number 1 to
change target speed of 5 steps starting from step number 10 of the axis ‘X’ with RAM Teaching Array.
M00000
P TEAA 1 0 10 0 1 5
4-354
Chapter 4 Details of Instructions
XGK XGB
○ ○
4. 41.29 EMG
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
EMG 4~7 O - -
ax O - O - - - O - - O - O O O
EMG EMG sl ax
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) EMG
(1) It is used to instruction the positioning module to perform Emergent Stop.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to perform Emergent Stop.
2) Error
(1) If a value more than 2 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
(2) If there is no special module on the specified slot, or no address specified in S is available in the installed
module, Error Flag (F110) will be set. This is because the fixed area address may be different according to the
properties of the special module.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘X’ installed on the slot number
1 to perform Emergent Stop.
M00000
P EMG 1 0
(2) If input signal M00000 is On, it instructions the positioning module’s axis specified in D00010 installed
on the slot number 3 to perform Emergent Stop.
M00000
P EMG 3 D00010
4-355
Chapter 4 Details of Instructions
XGK XGB
○ ○
4. 41.30 CLR
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl O - O - - - O - - O - O O O
CLR ax O - O - - - O - - O - O O O 4~7 O - -
n1 O - O - - - O - - O - O O O
CLR CLR sl ax n1
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction WORD
n1 Setting prohibited output to clear WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) CLR
(1) It is used to instruction the positioning to reset generated Error.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to reset generated error to delete. Clearing the prohibited output state is available based on specified
n1.
2) Error
(1) If a value more than 2 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
(2) If there is no special module on the specified slot, or no address specified in S is available in the installed
module, Error Flag (F110) will be set. This is because the fixed area address may be different according to the
properties of the special module.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘X’ installed on the slot number
1 to reset generated error to delete, and to clear prohibited output state.
M00000
P CLR 1 0 1
(2) If input signal M00000 is On, it instructions the positioning module’s axis specified in D00010 installed
on the slot number 3 to reset generated error to delete.
M00000
P CLR 3 D00010 0
4-356
Chapter 4 Details of Instructions
XGK XGB
○ X
4. 41.31 ECLR
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - -
ECLR 4~7 O - -
ax O - O - - - O - - O - O O O
ECLR ECLR sl ax
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) ECLR
(1) It is used to instruction the positioning module to reset the Error history.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to reset saved error history to delete.
2) Error
(1) If a value more than 2 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
(2) If there is no special module on the specified slot, or no address specified in S is available in the installed
module, Error Flag (F110) will be set. This is because the fixed area address may be different according to the
properties of the special module.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘X’ installed on the slot number
1 to reset saved error history to delete.
M00000
P ECLR 1 0
(2) If input signal M00000 is On, it instructions the positioning module’s axis specified in D00010 installed
on the slot number 3 to reset saved error history to delete.
M00000
P ECLR 3 D00010
4-357
Chapter 4 Details of Instructions
XGK XGB
○ X
4. 41.32 PST
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
PST ax O - O - - - O - - O - O O O 4~7 O - -
n1 O - O - - - O - - O - O O O
PST PST sl ax n1
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction WORD
n1 Number of Point Operation Data WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) PST
(1) It is used to instruction the positioning module to perform Point Operation.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to perform Point Operation, based on step value saved in Point Operation Data area.
2) Error
(1) If a value more than 2 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
(2) If there is no special module on the specified slot, or no address specified in S is available in the installed
module, Error Flag (F110) will be set. This is because the fixed area address may be different according to the
properties of the special module.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘X’ installed on the slot number 1 to
perform Point Operation about the 5 data saved in Point Operation Data area of the axis ‘X’.
4-358
Chapter 4 Details of Instructions
XGK XGB
4. 41.33 TBP ○ X
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
ax O - - O - - O - - O - O O O
TBP 4~7 O - -
n1 O - - O - - O - - O - O O O
n2 O - - O - - O - - O - O O O
TBP TBP sl ax n1 n2
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction WORD
n1 Teaching Data (changed value of the item to change among basic parameters) DWORD
n2 Item to change among basic parameters. WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) TBP
(1) It is used to instruction the positioning module with basic parameters teaching.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to change n2 to n1 among basic parameters, with basic parameters teaching.
2) Error
(1) If a value more than 2 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
(2) If there is no special module on the specified slot, or no address specified in S is available in the installed
module, Error Flag (F110) will be set. This is because the fixed area address may be different according to the
properties of the special module.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘X’ installed on the slot number
1 to change speed limit to 200000 among basic parameters of the axis ‘X’, with basic parameters
teaching.
M00000
P TBP 1 0 200000 1
(2) If input signal M00000 is On, it instructions the positioning module’s axis specified in D00010 installed
on the slot number 3 to change bias speed to the value specified in D00020 among basic parameters,
with basic parameters teaching.
M00000
P TBP 3 D00010 D00020 2
4-359
Chapter 4 Details of Instructions
XGK XGB
○ X
4. 41.34 TEP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
ax O - - O - - O - - O - O O O
TEP 4~7 O - -
n1 O - - O - - O - - O - O O O
n2 O - - O - - O - - O - O O O
TEP TEP sl ax n1 n2
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction WORD
n1 Teaching Data (changed value of the item to change among extended parameters) DWORD
n2 Item to change among extended parameters. WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) TEP
(1) It is used to instruction the positioning with extended parameters teaching.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to change n2 to n1 among extended parameters, with extended parameters teaching.
Setting
Value Item
1 Maximum of S/W
2 Minimum of S/W
3 Backlash Compensation
4 Output Time of Positioning Complete
5 S-Curve Rate
6 Select External Instruction 0:Start 1:JOG 2:Skip
7 Pulse Output Direction 0:Forward 1:Reverse
8 Adjusting Pattern 0:Trapezoid 1:S-Curve
9 M Code Mode 0:None 1:With 2:After
10 Display Position during Uniform Operation 0:not displayed 1:displayed
11 Detect Maximum/Minimum during Uniform 0:not detected 1:detected
Operation
12 External Speed/Position Control Switching 0:prohibited 1:allowed
Allowed
13 External Instruction Allowed 0:prohibited 1:allowed
14 External Stop Allowed 0:prohibited 1:allowed
15 Simultaneous External Start Allowed 0:prohibited 1:allowed
0:Dwell Time 1:In-Position Sign
16 Condition of Positioning Complete 2: Dwell Time AND In-Position Sign
3: Dwell Time OR In-Position Sign
2) Error
(1) If a value more than 2 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
(2) If there is no special module on the specified slot, or no address specified in S is available in the installed
module, Error Flag (F110) will be set. This is because the fixed area address may be different according to the
properties of the special module.
4-360
Chapter 4 Details of Instructions
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘X’ installed on the slot number
1 to change Backlash Compensation to 100 among extended parameters, with extended parameters
teaching.
M00000
P TEP 1 0 100 3
(2) If input signal M00000 is On, it instructions the positioning module’s axis specified in D00010 installed
on the slot number 3 to change External Stop Allowed to the value specified in D00020 among extended
parameters, with extended parameters teaching.
M00000
P TEP 3 D00010 D00020 14
4-361
Chapter 4 Details of Instructions
XGK XGB
○ X
4. 41.35 THP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
ax O - - O - - O - - O - O O O
THP 4~7 O - -
n1 O - - O - - O - - O - O O O
n2 O - - O - - O - - O - O O O
THP THP sl ax n1 n2
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction WORD
n1 Teaching Data (changed value of the item to change among returned parameters to origin) DWORD
n2 Item to change among returned parameters to origin WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) THP
(1) It is used to instruction the positioning module with returned parameters teaching.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to change n2 to n1 among returned parameters to origin point, with returned parameters teaching.
Setting Item
Value
1 Address of Origin Point
2 Return to Origin Point, High Speed
3 Return to Origin Point, Low Speed
4 Return to Origin Point, Adjusting Time
5 Return to Origin Point, Dwell Time
6 Compensation of Origin Point
7 Return to Origin Point, Restart Time
0: DOG/Origin Point(OFF) 1: DOG/Origin Point(ON)
2: Maximum& Minimum/Origin Point 3:DOG
8 Returning Method to Origin Point
4: Return to Origin Point at High Speed
5: Maximum & Minimum
9 Returning Direction to Origin Point 0:Forward 1:Reverse
2) Error
(1) If a value more than 2 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
(2) If there is no special module on the specified slot, or no address specified in S is available in the installed
module, Error Flag (F110) will be set. This is because the fixed area address may be different according to the
properties of the special module.
4-362
Chapter 4 Details of Instructions
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘X’ installed on the slot number
1 to change Restart Time of Return to Origin Point to 100ms among returned parameters to origin
point, with returned parameters teaching.
M00000
P THP 1 0 100 7
(2) If input signal M00000 is On, it instructions the positioning module’s axis specified in D00010 installed
on the slot number 3 to change Address of Origin Point to the value specified in D00020 among
returned parameters to origin point, with returned parameters teaching.
M00000
P THP 3 D00010 D00020 1
4-363
Chapter 4 Details of Instructions
XGK XGB
○ X
4. 41.36 TMP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
ax O - - O - - O - - O - O O O
TMP 4~7 O - -
n1 O - - O - - O - - O - O O O
n2 O - - O - - O - - O - O O O
TMP TMP sl ax n1 n2
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction WORD
n1 Teaching Data (changed value of the item to change among manual parameters) DWORD
n2 Item to change among manual parameters WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) TMP
(1) It is used to instruction the positioning module with manual parameters teaching.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to change n2 to n1 among manual parameters, with manual parameters teaching.
(3) Setting value of n2 is as shown below.
2) Error
(1) If a value more than 2 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
(2) If there is no special module on the specified slot, or no address specified in S is available in the installed
module, Error Flag (F110) will be set. This is because the fixed area address may be different according to the
properties of the special module.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘X’ installed on the slot number
1 to change Jog High Speed to 5000 among manual parameters of the axis ‘X’, with manual
parameters teaching.
M00000
P TMP 1 0 500 1
(2) If input signal M00000 is On, it instructions the positioning module’s axis specified in D00010 installed
on the slot number 3 to change Jog Adjusting Time to the value specified in D00020 among manual
parameters, with manual parameters teaching.
M00000
P TMP 3 D00010 D00020 3
4-364
Chapter 4 Details of Instructions
XGK XGB
○ X
4. 41.37 TSP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
TSP ax O - O - - - O - - O - O O O 4~7 O - -
n1 O - O - - - O - - O -- O O O
TSP TSP sl ax n1
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction WORD
n1 Teaching Data(changed value of input signal parameter) WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) TSP
(1) It is used to instruction the positioning module with Input Signal parameters teaching.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to change its input signal parameter to n1, with input signal parameters teaching.
(3) Each bit of n1 value is assigned to input signal. If the bit’s value is o, its applicable signal will be identified as A
contact point, and if the bit’s value is 1, its applicable signal will be identified as B contact point.
2) Error
(1) If a value more than 2 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
(2) If there is no special module on the specified slot, or no address specified in S is available in the installed
module, Error Flag (F110) will be set. This is because the fixed area address may be different according to the
properties of the special module.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘X’ installed on the slot number
1 to change Emergent Stop Signal to B contact point among input signal parameters of the axis ‘X’,
with input signal parameters teaching
M00000
P TSP 1 0 h0010
(2) If input signal M00000 is On, it instructions the positioning module’s axis specified in D00010 installed
on the slot number 3 to change input signal parameter to the value specified in D00020, with input
signal parameters teaching.
M00000
P TSP 3 D00010 D00020
4-365
Chapter 4 Details of Instructions
XGK XGB
○ X
4. 41.38 TCP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
ax O - O - - - O - - O - O O O
TCP 4~7 O - -
n1 O - O - - - O - - O - O O O
n2 O - O - - - O - - O - O O O
TCP TCP sl ax n1 n2
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction WORD
n1 Teaching Data (changed value of the item to change among common parameters) DWORD
n2 Item to change among common parameters WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) TCP
(1) It is used to instruction the positioning module with common parameters teaching.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to change n2 to n1 among common parameters, with common parameters teaching.
(3) Setting value available for n2 is as shown below;
Setting
Item
Value
1 Pulse Output Level 0:Low Active 1:High Active
2 Circular Interpolation Type 0:Middle point 1:Central point
0:CW/CCW(1-Phase 1-multiplier)
1:CW/CCW(1-Phase 2-multiplier)
2:Pulse/Dir(1-Phase 1-multiplier)
3 Encoder Pulse Input Mode 3:Pulse/Dir(1-Phase 2-multiplier)
4:PhaseA/B(2-Phase 1-multiplier)
5:PhaseA/B(2-Phase 2-multiplier)
6:PhaseA/B(2-Phase 4-multiplier)
4 Encoder’s Auto Reloaded Value
5 Zone Output Mode 0:Individual Output
1:Total Output
6 Zone1 Axis Setting
7 Zone2 Axis Setting 0:X axis 1:Y axis 2:Z axis 3:Encoder
8 Zone3 Axis Setting
9 Zone1 On Area
10 Zone1 Off Area
11 Zone2 On Area
12 Zone2 Off Area
13 Zone3 On Area
14 Zone3 Off Area
4-366
Chapter 4 Details of Instructions
2) Error
(1) If a value more than 2 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
(2) If there is no special module on the specified slot, or no address specified in S is available in the installed
module, Error Flag (F110) will be set. This is because the fixed area address may be different according to the
properties of the special module.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘X’ installed on the slot number
1 to change Pulse Output Level to High Active among common parameters, with common parameters
teaching.
M00000
P TCP 1 0 1 1
(2) If input signal M00000 is On, it instructions the positioning module’s axis specified in D00010 installed
on the slot number 3 to change Encoder Pulse Input Mode to the value specified in D00020, with
common parameters teaching
M00000
P TCP 3 D00010 D00020 3
4-367
Chapter 4 Details of Instructions
XGK XGB
○ ○
4. 41.39 WRT
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - O O O
WRT ax O - O - - - O - - O - O O O 4~7 O - -
n1 O - O - - - O - - O - O O O
WRT WRT sl ax n1
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction WORD
n1 Axis to save parameter in WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) WRT
(1) It is used to the instruction moduel to save parameter.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to save presently run parameter of the axes n1, in Flash ROM.
(3) In order to set the axis to save parameter in n1, the bit of the axis assigned per bit shall be set as follows;
3~ 15 2 1 0
XGK
Unused Z axis Y axis X axis
n1 = 0 n1 = 1 n1 = 2
XGB High-speed counter
Positioning parameter PID parameter
parameter
2) Error
(1) If a value more than 2 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
(2) If there is no special module on the specified slot, or no address specified in S is available in the installed
module, Error Flag (F110) will be set. This is because the fixed area address may be different according to the
properties of the special module.
3) Program Example
M00000
P WRT 0 P1100 P1200
4-368
Chapter 4 Details of Instructions
XGK XGB
○ X
4. 41.40 SRD
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - O O O
SRD ax O - O - - - O - - O - O O O 4~7 O - -
D O - O - - - O - - - - O O O
SRD SRD sl ax D
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction WORD
D Device name & number in CPU WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) SRD
(1) It is used to instruction the positioning module to read its present status.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to read its present status so to save in CPU area specified in D.
(3) Value to be saved in CPU area specified in D is as shown below;
2) Error
(1) If a value more than 2 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
(2) If there is no special module on the specified slot, or no address specified in S is available in the installed
module, Error Flag (F110) will be set. This is because the fixed area address may be different according to the
properties of the special module.
3) Program Example
P00000
SRD 0 P1100 P1200
4-369
Chapter 4 Details of Instructions
XGK XGB
○ X
4. 41.41 PWR
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
ax O - O - - - O - - O - O O O
PWR 4~7 O - -
S O - O - - - O - - - - O O O
n1 O - O - - - O - - O - O O O
PWR PWR sl ax S n1
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction WORD
S Head aderess of Device which is saved in point operation data WORD
n1 Number of point operation step WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) PWR
(1) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to move the value of point operation step to be used to the axis ‘ax’ of the positioning module as many
as n1 from CPU area specified in S.
(2) Number of point operation steps to be specified in n1 is 1 ~ 20.
(3) Value to read from CPU area specified in S is as below;
2) Error
(1) If a value more than 2 is input in specified instruction axis ‘ax’, Error Flag (F0110) will be set.
(2) If there is no special module on the specified slot, or no address specified in S is available in the installed
module, Error Flag (F110) will be set. This is because the fixed area address may be different according to the
properties of the special module.
3) Program Example
P00000
PWR 0 P1200 P1300 P1400
4-370
Chapter 4 Details of Instructions
XGK XGB
○ X
4. 41.42 TWR
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
ax O - O - - - O - - O - O O O
TWR 4~7 O - -
S O - O - - - O - - - - O O O
n1 O - O - - - O - - O - O O O
TWR TWR sl ax S n1
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction WORD
S Head address of Device which is saved data of plural teaching DWORD
n1 Number to plural teaching WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) TWR
(1) It is used to instruction the positioning module the teaching data value to be used for plural teaching.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to move the teaching data value to be used for plural teaching, to the axis ‘ax’ of the positioning
module as many as n1 from CPU area specified in S.
(3) Number of point operation steps to be specified in n1 is 1 ~ 16.
(4) Value to read from CPU area specified in S is as below.
2) Error
(1) If a value more than 2 is input in specified instruction axis ‘ax’, Error Flag (F0110) will be set.
(2) If there is no special module on the specified slot, or no address specified in S is available in the installed
module, Error Flag (F110) will be set. This is because the fixed area address may be different according to the
properties of the special module.
3) Program Example
P00000
TWR 0 P1200 P1300 P1400
4-371
Chapter 4 Details of Instructions
XGK XGB
○ X
4. 41.43 TMD
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
ax O - O - - - O - - O - O O O
TMD n1 O - O - - - O - - O - O O O 4~7 O - -
n2 O - O - - - O - - O - O O O
n3 O - O - - - O - - O - O O O
TMD TMD sl ax n1 n2 n3
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction (0: X-axis, 1: Y-axis, 2: Z-axis) WORD
n1 Operation data value to convert DINT
n2 Operation data Item to convert (1~11) WORD
n3 Operation data Step number to convert WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) TMD
(1) It is used to instruction the positioning module to convert the operation data value.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to convert n2 items to n1 value among the n3 steps of operation data.
(3) You can set n2 values up as below.
Setting
Item Data range Data type
Value
1 Target Position -2147483648 ~ 2147483647 DINT
Circular Interpolation Asistant
2 -2147483648 ~ 2147483647 DINT
Position
3 Operation Speed 0 ~ Maximum speed DWORD
4 Dwell Time 0 ~ 50000 WORD
5 M Code Number 0 ~ 65535 WORD
6 Control Method 0: Position control, 1: Speed control WORD
7 Operation Method 0: Single, 1: Repeat WORD
8 Operation Pattern 0: End, 1: Repeat, 2: Continue WORD
0: Absolute coordinates,
9 Coordinates WORD
1: Relative coordinates
10 Adjusting Number 1~4 WORD
Circular Interpolation
11 0: CW, 1: CCW WORD
Direction
2) Error
(1) If a value more than 2 is input in specified instruction axis ‘ax’, Error Flag (F0110) will be set.
3) Program Example
If input signal M00000 is On, it instructions the positioning module’s X-axis installed on the slot number 0 to
change the target position value is specified in D00020 among the position data of X-axis to 10000, with
common parameters teaching
4-372
Chapter 4 Details of Instructions
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on WORD
ax Axis to instruction WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) Function
(1) It is used to the positioning module to return to Origin Point.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl (positioning module’s slot
number) to return to Origin Point.
2) Error
(1) If 0 or more than 5 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘1’ installed on the slot number 1 to
return to Origin Point.
(2) If input signal M00000 is On, it instructions the positioning module’s axis specified in D00010 installed on the
slot number 3 to return to Origin Point.
4-373
Chapter 4 Details of Instructions
XGK XGB
○ X
4. 42.2 XFLT
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
XFLT 4~7 O - -
ax O - O - - - O - - O - O O O
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on WORD
ax Axis to instruction WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) Function
(1) It is used to instruction the positioning module to set the Floating point.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl (positioning module’s slot
number) to set Floating Origin Point.
2) Error
(1) If 0 or more than 5 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘1’ installed on the slot number
1 to set Floating Origin Point.
(2) If input signal M00000 is On, it instructions the positioning module’s axis specified in D00010 installed
on the slot number 3 to set Floating Origin Point.
4-374
Chapter 4 Details of Instructions
XGK XGB
4. 42.3 XDST ○ X
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on WORD
ax Axis to instruction WORD
n1 Target position DWORD
n2 Target speed DWORD
n3 Dwell time WORD
n4 M code number WORD
n5 Control word WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) Function
(1) It is used to instruction the positiong module to start directly.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl (positioning module’s slot
number) to start directly.
(3) The axis to perform the instruction outputs the pulse with Target Position (n1), Target Speed (n2), Dwell Time
(n3), M Code (n4).
(4) Control Word (n5) has meaning of as described below per bit.
2) Error
(1) If 0 or more than 5 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
3) Program Example
(1) If input signal M00000 is On, it outputs the pulse to instruction the positioning module’s axis ‘1’ installed on the
slot number 1 to start directly, with Target Speed 500, Absolute Position up to 1000, ACC/DEC Time 3, Dwell Time
10ms and M Code 20.
4-375
Chapter 4 Details of Instructions
XGK XGB
4. 42.4 XIST ○ X
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on WORD
ax Axis to instruction WORD
n1 Step number to start WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) Function
(1) It is used to instruction the positiong module to start indirectly.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl (positioning module’s slot
number) to start n1 step.
2) Error
(1) If 0 or more than 5 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘1’ installed on the slot number
1 to start No.3 step.
(2) If input signal M00000 is On, it instructions the positioning module’s axis ‘1’ installed on the slot number
3 to start the step specified in D00010 indirectly.
4-376
Chapter 4 Details of Instructions
XGK XGB
○ X
4. 42.5 XSST
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
XSST ax O - O - - - O - - O - O O O 4~7 O - -
n1 O - O - - - O - - O - O O O
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on WORD
ax Axis to instruction WORD
n1 Axis to operate WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) Function
(1) It is used to instruction the positioning module to set the simultaneous Start.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl (positioning module’s slot
number) to let the axes set in n1 simultaneously operate
(3) In order to set the axis to perform Simultaneous Start, the bit of the axis assigned per bit shall be set as follows.
15 ~ 4 3 2 1 0
2) Error
(1) If o or more than 5 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning moduleinstalled on the slot number 1 to let the axes
simultaneously operate axis 1, axis 2 and axis 4 by Simultaneous Start.
4-377
Chapter 4 Details of Instructions
XGK XGB
○ X
4. 42.6 XVTP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
XVTP 4~7 O - -
ax O - O - - - O - - O - O O O
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on WORD
ax Axis to instruction WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) Function
(1) It is used to instruction the positioning module to switch Speed/Position control.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl (positioning module’s slot
number) to switch Speed/Position Control.
2) Error
(1) If 0 or more than 5 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘1’ installed on the slot number
1 to switch Speed/Position Control
(2) If input signal M00000 is On, it instructions the positioning module’s axis designated in D00010 installed on the slot
number 3 to switch Speed/Position Control
4-378
Chapter 4 Details of Instructions
XGK XGB
4. 42.7 XPTV ○ X
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
XPTV 4~7 O - -
ax O - O - - - O - - O - O O O
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on WORD
ax Axis to instruction WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) Function
(1) It is used to inatruction the positioning module to switch Position/Speed control.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl (positioning module’s slot
number) to switch Position/Speed Control.
2) Error
(1) If 0 more than 5 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘X’ installed on the slot number
1 to switch Position/Speed Control
(2) If input signal M00000 is On, it instructions the positioning module’s axis specified in D00010 installed
on the slot number 3 to switch Position/Speed Control.
4-379
Chapter 4 Details of Instructions
XGK XGB
4. 42.8 XSTP ○ X
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction WORD
n1 Decelerating Time (0~ 2,147,483,647) WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) Function
(1) It is used to instruction the positioning module to stop as decelerated.
2) Error
(1) If 0 or more than 5 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘1’ installed on the slot number
1 to stop as decelerated.
(2) If input signal M00000 is On, it instructions the positioning module’s axis specified in D00010 installed
on the slot number 3 to stop as decelerated.
4-380
Chapter 4 Details of Instructions
XGK XGB
○ X
4. 41.9 XSKP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
XSKP 4~7 O - -
ax O - O - - - O - - O - O O O
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on WORD
ax Axis to instruction WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) Function
(1) It is used to instruction the positioning module to Skip.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl (positioning module’s slot
number) to skip.
2) Error
(1) If 0 or more than 5 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘1’ installed on the slot number 1 to skip.
(2) If input signal M00000 is On, it instructions the positioning module’s axis specified in D00010 installed on the slot
number 3 to skip.
4-381
Chapter 4 Details of Instructions
XGK XGB
○ X
4. 42.10 XSSP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
ax O - O - - - O - - O - O O O
SSP n1 O - O - - - O - - O - O O O 4~7 O - -
n2 O - O - - - O - - O - O O O
n3 O - O - - - O - - O - O O O
COMMAND
XSSP XSSP sl ax n1 n2 n3
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on WORD
ax Axis to instruction WORD
n1 Main axis’s position value to execute Position Synchronization DWORD
n2 Step number of instruction axis to operate when Position Synchronization starts WORD
n3 Main axis Setting for Position Synchronization WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) Function
(1) It is used to instruction the positioning module to synchronize the position.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl (positioning module’s slot
number) to execute synchoronizing the position to operate n2 step of the axis ‘ax’ when the main axis of n3 is to
with n1.
(3) The available setting value on n3 is as described below.
1 ~ 4 : axis 1 ~ axis 4
9 : encoder
2) Error
(1) If 0 or more than 5 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘1’ installed on the slot number 1 to
execute synchronizing the position to operate n3 step of the axis 1 when the main axis of Y is to synchronize the
position with 1000.
4-382
Chapter 4 Details of Instructions
XGK XGB
○ X
4. 42.11 XSSS
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
ax O - O - - - O - - O - O O O
XSSS n1 O - O - - - O - - O - O O O 4~7 O - -
n2 O - O - - - O - - O - O O O
n3 O - O - - - O - - O - O O O
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on WORD
ax Axis to instruction WORD
n1 Main axis ratio of Speed Synchronization WORD
n2 Slave axis ratio of Speed Synchronization WORD
n3 Setting main axis of Speed Synchronization WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) Function
(1) It is used to instruction the positioning module to synchronize the speed.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl (positioning module’s slot
number) to execute synchronizing the speed to operate the main axis of n3 with main axis ratio of n1 and slave
axis ratio of n2.
(3) The available setting value on n3 is as described below.
1 ~ 4 : axis 1 ~ axis 4
9 : encoder
2) Error
(1) If 0 or more than 2 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘1’ installed on the slot number 1 to
execute synchronizing the speed to operate the main axis of 2 with a main and slave axis ratio of 4 : 3.
4-383
Chapter 4 Details of Instructions
XGK XGB
○ X
4. 42.12 XPOR
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl O - O - - - O - - O - O O O
XPOR ax O - O - - - O - - O - O O O 4~7 O - -
n1 O - O - - - O - - O - O O O
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on WORD
ax Axis to instruction WORD
n1 Target position to change DWORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) Function
(1) It is used to instruction the positioning module to override position.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl ( positioning module’s slot
number) to override position to change the target position to n1 during run.
2) Error
(1) If 0 or more than 5 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘1’ installed on the slot number 1 to
override position to change its target position to 20000.
(2) If input signal M00000 is On, it instructions the positioning module’s axis specified in D00010 installed
on the slot number 3 to override position to change its target position to the value specified in D00020.
4-384
Chapter 4 Details of Instructions
XGK XGB
○ X
4. 42.13 XSOR
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
XSOR ax O - O - - - O - - O - O O O 4~7 O - -
n1 O - O - - - O - - O - O O O
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on WORD
ax Axis to instruction WORD
n1 Target Speed to change DWORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) Function
(1) It is used to instruction the positioning module to override the speed.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to override speed to change the target speed to n1 during run.
2) Error
(1) If 0 or more than 5 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘1’ installed on the slot number
1 to override speed to change its target speed to 5000
(2) If input signal M00000 is On, it instructions the positioning module’s axis specified in D00010 installed
on the slot number 3 to override speed to change its target speed to the value specified in D00020.
4-385
Chapter 4 Details of Instructions
XGK XGB
4. 42.14 XPSO ○ X
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
ax O - O - - - O - - O - O O O
XPSO 4~7 O - -
n1 O - O - - - O - - O - O O O
n2 O - O - - - O - - O - O O O
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on WORD
ax Axis to instruction WORD
n1 Position to change speed DWORD
n2 Target speed to change DWORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) Function
(1)It is used to instruction the positioning module to override position-specified.
(2)It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to override position-specified speed to change the target speed to n2 when the present position is n1
during run.
2) Error
(1) If 0 or more than 5 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘1’ installed on the slot number
1 to override position-specified speed to change its target speed to 2000 when the present position is
5000.
(2) If input signal M00000 is On, it instructions the positioning module’s axis specified in D00010 installed
on the slot number 3 to override position-specified speed to change its target speed to the value
specified in D00030 when the present position is D00020.
4-386
Chapter 4 Details of Instructions
XGK XGB
○ X
4. 42.15 XNMV
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
XNMV 4~7 O - -
ax O - - O - - O - - O - O O O
COMMAND
XNMV XNMV sl ax
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) Function
(1) It is used to instruction the positioning module to operate continuously.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to operate continuously during run. If the instructioned axis ‘ax’ is running n step, it will change position
and speed to target position and target speed specified in (n+1) as soon as instructioned.
2) Error
(1) If 0 or more than 5 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘1’ installed on the slot number
1 to operate continuously.
(2) If input signal M00000 is On, it instructions the positioning module’s axis specified in D00010 installed
on the slot number 3 to operate continuously.
4-387
Chapter 4 Details of Instructions
XGK XGB
○ X
4. 42.16 XINCH
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - O - - O - - - -
XINCH ax O - O - - - O - - O - O O O 4~7 O - -
n1 O - O - - - O - - O - O O O
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction WORD
n1 Target Position DWORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) Function
(1) It is used to instruction the positioning module to inch.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to inch by n1.
2) Error
(1) If 0 or more than 5 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘1’ installed on the slot number
1 to inch by 100.
(2) If input signal M00000 is On, it instructions the positioning module’s axis specified in D00010 installed
on the slot number 3 to inch by 10 backward.
4-388
Chapter 4 Details of Instructions
XGK XGB
○ X
4. 42.17 XRTP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
XRTP 4~7 O - -
ax O - O - - - O - - O - O O O
COMMAND
XRTP XRTP sl ax
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) Function
(1) It is used to instruction the positioning module to return to position previous to manual operation.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to return to position previous to manual operation.
2) Error
(1) If 0 or more than 5 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘1’ installed on the slot number
1 to return to position previous to manual operation.
(2) If input signal M00000 is On, it instructions the positioning module’s axis specified in D00010 installed
on the slot number 3 to return to position previous to manual operation.
4-389
Chapter 4 Details of Instructions
XGK XGB
○ X
4. 42.18 XSNS
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
XSNS ax O - O - - - O - - O - O O O 4~7 O - -
n1 O - O - - - O - - O - O O O
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction WORD
n1 Setting step number of next operation WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) SNS
(1) It is used to instruction the positioning module to change operation step to the next step.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to change operation step to the next step n1.
2) Error
(1) If 0 or more than 5 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘1’ installed on the slot number
1 to change operation step to the next step number 10.
(2) If input signal M00000 is On, it instructions the positioning module’s axis specified in D00010 installed
on the slot number 3 to change operation step to the next step value specified in D00020.
4-390
Chapter 4 Details of Instructions
XGK XGB
○ X
4. 42.19 XSRS
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
XSRS ax O - O - - - O - - O - O O O 4~7 O - -
n1 O - O - - - O - - O - O O O
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction WORD
n1 Setting step of repeated operation WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) Function
(1) It is used to instruction the positioning module to chage pepeated operation step.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to change repeated operation step to n1.
2) Error
(1) If 0 or more than 5 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘1’ installed on the slot number
1 to change repeated operation step to step number 10.
(2) If input signal M00000 is On, it instructions the positioning module’s axis specified in D00010 installed
on the slot number 3 to change repeated operation step to the value specified in D00020.
4-391
Chapter 4 Details of Instructions
XGK XGB
○ X
4. 42.20 XMOF
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
XMOF 4~7 O - -
ax O - O - - - O - - O O O O O
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) Function
(1) It is used to instruction the positioning module to make produced M code Off.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to make produced M code Off so to delete the value of M code.
2) Error
(1) If 0 or more than 5 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘1’ installed on the slot number
1 to make produced M code off so to delete the value of M code.
(2) If input signal M00000 is On, it instructions the positioning module’s axis specified in D00010 installed
on the slot number 3 to make produced M code off so to delete the value of M code.
4-392
Chapter 4 Details of Instructions
XGK XGB
○ X
4. 42.21 XPRS
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
XPRS ax O - O - - - O - - O - O O O 4~7 O - -
n1 O - O - - - O - - O - O O O
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction WORD
n1 Setting present position to change. DWORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) PRS
(1) It is used to instruction the positioning module to change present position.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to change present position to n1.
2) Error
(1) If 0 or more than 5 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘1’ installed on the slot number
1 to change present position to -100.
(2) If input signal M00000 is On, it instructions the positioning module’s axis specified in D00010 installed
on the slot number 3 to change present position to the value specified in D00020.
4-393
Chapter 4 Details of Instructions
XGK XGB
○ X
4. 42.22 XEPRS
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
ax O - O - - - O - - O - O O O
XEPRS 4~7 O -
n1 O - O - - - O - - O - O O O
N2 O - O - - - O - - O - O O O
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction WORD
n1 Setting encoder value to change DINT
N2 Selecting encoder to change WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) Function
(1) It is used to instruction the positioning module to change present Encoder Value.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to change present Encoder Value to n1.
2) Error
(1) If 0 or more than 5 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘1’ installed on the slot number
1 to change present Encoder 1 Value to -100.
(2) If input signal M00000 is On, it instructions the positioning module’s axis specified in D00010 installed
on the slot number 3 to change present Encoder 2 Value to the value specified in D00020.
4-394
Chapter 4 Details of Instructions
XGK XGB
○ X
4. 42.23 XTEAA
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
ax O - O - - - O - - O - O O O
XTEAA n1 O - O - - - O - - O - O O O 4~7 O - -
n2 O - O - - - O - - O - O O O
n3 O - O - - - O - - O - O O O
n4 O - O - - - O - - O - O O O
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction WORD
n1 Setting head step number to teach WORD
n2 Setting teaching method (0: RAM teaching or 1: ROM teaching) WORD
n3 Setting teaching item (0: Position teaching or 1: Speed teaching) WORD
n4 Setting the number of teaching WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) Function
(1) It is used to instruction the positioning module to teaching array.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to change target position or target speed to the value saved in teaching data area, according to n2 as
many as the number specified in n1 ~ n4 steps of the axis ‘ax’ with teaching array. At this time, based on the
value specified in n3, RAM or ROM teaching will be available.
(5) Teaching data value shall be specified in memory area inside an additional positioning module before teaching
array instruction is given.
2) Error
(1) If 0 or more than 5 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘1’ installed on the slot number 1 to
change target speed of 5 steps starting from step number 10 of the axis ‘X’ with RAM Teaching Array.
4-395
Chapter 4 Details of Instructions
XGK XGB
○ X
4. 42.24 XEMG
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
XEMG 4~7 O - -
ax O - O - - - O - - O - O O O
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) Function
(1) It is used to instruction the positioning module to perform Emergent Stop.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to perform Emergent Stop.
2) Error
(1) If 0 or more than 5 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘1’ installed on the slot number
1 to perform Emergent Stop.
(2) If input signal M00000 is On, it instructions the positioning module’s axis specified in D00010 installed
on the slot number 3 to perform Emergent Stop.
4-396
Chapter 4 Details of Instructions
XGK XGB
○ X
4. 42.25 XCLR
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
XCLR ax O - O - - - O - - O - O O O 4~7 O - -
n1 O - O - - - O - - O - O O O
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction WORD
n1 Setting prohibited output to clear (Ignored in XPM) WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) Function
(1) It is used to instruction the positioning to reset generated Error.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to reset generated error to delete.
(3) N1 doesn’t affect the operation in XPM.
2) Error
(1) If 0 or more than 5 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘1’ installed on the slot number
1 to reset generated error to delete, and to clear prohibited output state.
(2) If input signal M00000 is On, it instructions the positioning module’s axis specified in D00010 installed
on the slot number 3 to reset generated error to delete.
4-397
Chapter 4 Details of Instructions
XGK XGB
○ X
4. 42.26 XECLR
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - -
XECLR 4~7 O - -
ax O - O - - - O - - O - O O O
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) Function
(1) It is used to instruction the positioning module to reset the Error history.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to reset saved error history to delete.
2) Error
(1) If 0 or more than 5 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘1’ installed on the slot number
1 to reset saved error history to delete.
(2) If input signal M00000 is On, it instructions the positioning module’s axis specified in D00010 installed
on the slot number 3 to reset saved error history to delete.
4-398
Chapter 4 Details of Instructions
XGK XGB
○ X
4. 42.27 XPST
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
XPST ax O - O - - - O - - O - O O O 4~7 O - -
n1 O - O - - - O - - O - O O O
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction WORD
n1 Number of Point Operation Data WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) Function
(1) It is used to instruction the positioning module to perform Point Operation.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to perform Point Operation, based on step value saved in Point Operation Data area.
2) Error
(1) If 0 or more than 5 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘1’ installed on the slot number 1 to
perform Point Operation about the 5 data saved in Point Operation Data area of the axis ‘X’.
4-399
Chapter 4 Details of Instructions
XGK XGB
4. 42.28 XSBP ○ X
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
Sl - - - - - - - - - O - - - -
Ax O - - O - - O - - O - O O O
XSBP n1 O - - O - - O - - O - O O O 4~7 O - -
n2 O - - O - - O - - O - O O O
n3 O - - O - - O - - O - O O O
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction WORD
n1 Teaching Data (changed value of the item to change among basic parameters) DWORD
n2 Item to change among basic parameters. WORD
n3 Selecting teaching method (RAM teaching or ROM teaching) WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) Function
(1) It is used to instruction the positioning module with basic parameters teaching.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to change n2 to n1 among basic parameters, with basic parameters teaching.
(3) n2 can be set as follows.
2) Error
(1) If 0 or more than 5 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
4-400
Chapter 4 Details of Instructions
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘1’ installed on the slot number
1 to change speed limit to 200000 among basic parameters of the axis ‘1’ and save them in RAM, with basic
parameters teaching.
(2) If input signal M00000 is On, it instructions the positioning module’s axis specified in D00010 installed
on the slot number 3 to change bias speed to the value specified in D00020 among basic parameters and save
them in ROM, with basic parameters teaching.
4-401
Chapter 4 Details of Instructions
XGK XGB
○ X
4. 42.29 XSEP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
ax O - - O - - O - - O - O O O
XSEP n1 O - - O - - O - - O - O O O 4~7 O - -
n2 O - - O - - O - - O - O O O
n3 O - - O - - O - - O - O O O
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction WORD
n1 Teaching Data (changed value of the item to change among extended parameters) DWORD
n2 Item to change among extended parameters. WORD
n3 Selecting teaching method (RAM teaching or ROM teaching)
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) Function
(1) It is used to instruction the positioning with extended parameters teaching.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to change n2 to n1 among extended parameters, with extended parameters teaching.
(3) n2 can set as follows.
Setting
Item
Value
1 S/W upper limit
2 S/W lower limit
3 Backlash compensation
4 S-curv ratio
5 Pulse output direction
6 Acc./Dec. pattern 0: Trapezoid 1: S-curve
7 M code mode 0: None 1: With 2: After
8 Software limit detect 0: Don’t’ detect 1: Detect
9 External VTP 0: Disable 1: Enable
10 External stop selection 0: EMG stop 1: DEC stop
11 Position complete condition 0: Dwell 1: In-Position
2: Dwell AND In-Pos.
3: Dwell OR In-Pos.
12 Int. continuous opr. Type 0: Pass target pos.
1: Pass near pos.
13 Arc insertion position
14 Arc insertion 0: Don’t insert
1: Insert arc cont.
15 Spd. Override with pos. coordi. 0: ABS 1: INC
16 Position completion time 0: CW 1: CCW
4-402
Chapter 4 Details of Instructions
2) Error
(1) If 0 or more than 5 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘1’ installed on the slot number
1 to change Backlash Compensation to 100 among extended parameters and save RAM, with extended
parameters
teaching.
(2) If input signal M00000 is On, it instructions the positioning module’s axis specified in D00010 installed
on the slot number 3 to change External Stop Allowed to the value specified in D00020 among extended
parameters and save in ROM, with extended parameters teaching.
4-403
Chapter 4 Details of Instructions
XGK XGB
○ X
4. 42.30 XSHP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
ax O - - O - - O - - O - O O O
4~7 O - -
XSHP n1 O - - O - - O - - O - O O O
n2 O - - O - - O - - O - O O O
n3 O - - O O - - O - O O O
[Area Setting]
Operand Description Data Size
Sl Slot number positioning module is installed on. WORD
Ax Axis to instruction WORD
n1 Teaching Data (changed value of the item to change among returned parameters to origin) DWORD
n2 Item to change among Home parameters WORD
n3 Teaching method setting (RAM teaching or ROM teaching)
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) Function
(1) It is used to instruction the positioning module with returned parameters teaching.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to change n2 to n1 among returned parameters to origin point, with returned parameters teaching.
(3) n2 can be set as follows.
Setting
XGF-PDxH/POxH
Value
1 Home position
2 Home high speed
3 Home low speed
4 Home acc. time
5 Home dec. time
6 Home dwell time
7 Home compensation
8 Home restart time
9 0: DOG/Home (Off) 1: DOG/Home (ON)
Home method 2: U.L.Limit/Home 3: DOG
4: High speed 5: Upper/Lower Limit 6: home
10 Home direction 0: CW 1: CCW
2) Error
(1) If 0 or more than 5 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
4-404
Chapter 4 Details of Instructions
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘1’ installed on the slot number
1 to change Restart Time of Return to Origin Point to 100ms among returned parameters to origin
Point and save in RAM with returned parameters teaching.
(2) If input signal M00000 is On, it instructions the positioning module’s axis specified in D00010 installed
on the slot number 3 to change Address of Origin Point to the value specified in D00020 among
returned parameters to origin point and save in ROM with returned parameters teaching.
4-405
Chapter 4 Details of Instructions
XGK XGB
○ X
4. 41.31 XSMP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
ax O - - O - - O - - O - O O O
4~7 O - -
XSMP n1 O - - O - - O - - O - O O O
n2 O - - O - - O - - O - O O O
n3 O - - O - - O - - O - O O O
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction WORD
n1 Teaching Data (changed value of the item to change among manual parameters) DWORD
n2 Item to change among manual parameters WORD
n3 Teaching method setting (RAM teaching or ROM teaching) WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) Function
(1) It is used to instruction the positioning module with manual parameters teaching.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to change n2 to n1 among manual parameters, with manual parameters teaching.
(3) Setting value of n2 is as shown below.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘1’ installed on the slot number
1 to change Jog High Speed to 5000 among manual parameters of the axis ‘1’ save in RAM, with manual
parameters teaching.
(2) If input signal M00000 is On, it instructions the positioning module’s axis specified in D00010 installed
on the slot number 3 to change Jog Adjusting Time to the value specified in D00020 among manual
parameters save in ROM, with manual parameters teaching.
4-406
Chapter 4 Details of Instructions
XGK XGB
○ X
4. 42.32 XSES
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
ax O - O - - - O - - O - O O O 4~7 O - -
XSES
n1 O - O - - - O - - O -- O O O
n2 O -- O -- -- -- O -- -- O -- O O O
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction WORD
n1 Teaching Data(changed value of input signal parameter) WORD
n2 Teaching method setting (RAM teaching or ROM teaching)
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) Function
(1) It is used to instruction the positioning module with Input Signal parameters teaching.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to change its input signal parameter to n1, with input signal parameters teaching.
(3) Each bit of n1 value is assigned to input signal. If the bit’s value is o, its applicable signal will be identified as A
contact point, and if the bit’s value is 1, its applicable signal will be identified as B contact point.
Bit XGF-PDxH/POxH
0 Upper limit signal
1 Lowr limi signal
2 DOG signal
3 Home signal
4 EMG signal
5 VTP signal
6 Driver ready signal
7 Inposition signal
8 Deviation cnt. clear output
(4) n3 can be set as follows.
Setting value Teaching method
0 RAM teaching
1 ROM teaching
2) Error
(1) If 0 or more than 5 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘1’ installed on the slot number
1 to change Emergent Stop Signal to B contact point among input signal parameters of the axis ‘1’ and save in
RAM, with input signal parameters teaching
(2) If input signal M00000 is On, it instructions the positioning module’s axis specified in D00010 installed
on the slot number 3 to change input signal parameter to the value specified in D00020 and save in ROM, with
input signal parameters teaching.
4-407
Chapter 4 Details of Instructions
XGK XGB
○ X
4. 42.33 XSCP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
ax O - O - - - O - - O - O O O
4~7 O - -
XSCP n1 O - O - - - O - - O - O O O
n2 O - O - - - O - - O - O O O
n3 O - O - - - O - - O - O O O
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction WORD
n1 Teaching Data (changed value of the item to change among common parameters) DWORD
n2 Item to change among common parameters WORD
n3 Teaching method setting (RAM teaching or ROM teaching) WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) Function
(1) It is used to instruction the positioning module with common parameters teaching.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to change n2 to n1 among common parameters, with common parameters teaching.
(3) Setting value available for n2 is as shown below;
Setting
Item
Value
1 Speed override 0: Specify % 1: Specify speed
0: CW/CCW (x1)
1: PULSE/DIR (x1)
2: PULSE/DIR (x2)
2 Enc pulse input
3: PHASE A/B (x1)
4: PHASE A/B (x2)
5: PHASE A/B (x4)
3 Enc max. value
4 Enc min. value
5 Pulse output level 0: Low Active 1: High Active
4-408
Chapter 4 Details of Instructions
2) Error
(1) If 0 or more than 5 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘1’ installed on the slot number
1 to change “Speed override” to “Specify speed” among common parameters and save in RAM, with common
parameters teaching.
(2) If input signal M00000 is On, it instructions the positioning module’s axis specified in D00010 installed
on the slot number 3 to change Encoder Pulse Input Mode to the value specified in D00020 and save in ROM,
with common parameters teaching
4-409
Chapter 4 Details of Instructions
XGK XGB
4.42.34 XSMD
○ X
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
ax O - O - - - O - - O - O O O
XSMD n1 O - O - - - O - - O - O O O 4~7 O - -
n2 O - O - - - O - - O - O O O
n3 O - O - - - O - - O - O O O
n4 O - O - - - O - - O - O O O
[Area Setting]
Operand Description Data size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction (1:axis 1,2: axis 2,3: axis 3,4: axis4) WORD
n1 Teaching Data (changed value of the item to change among operation data) DINT
n2 Item to change among operation data (1~11) WORD
n3 Step number to change WORD
n4 Teaching method setting (RAM teaching or ROM teaching) WORD
[Flag Setting]
Device
Flag Description
Number
Error If ‘ax’ value exceeds the range F110
1) Function
(1) It is used to instruction the positioning module with operation data teaching.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to change n2 to n1 among n3 operation data, with operation data teaching.
(3) Setting value available for n2 is as shown below;
Setting
XGF-PDxH/POxH
value
1 Target position
2 Cir. int. auxiliary point
3 Operation speed
4 Dwell time
5 M code
6 Sub. Axis setting Setting axis 1~4 with 0~3 bit
7 Helical int. 0 ~ 4 (In case of 0, general circular interpolation)
8 Circular int. turns
9 Coordinate 0 : Absolute, 1: incremental
0: Single axis Position control, 1: Single axis Ppeed control
10 Control method 2: Single axis Feed control, 3: Linear interpolation
4: Circular interpolation
11 Operation method 0 : Single, 1 : Repeat
12 Operation pattern 0 : END, 1 : KEEP, 2 : CONT
13 Arc size 0 : Arc < 180, 1 : Arc >= 180
14 Acc. no. 0~3
15 Dec. no. 0~3
16 Circular int. mode 0 : Middle, 1: Center, 2 : Radius
17 Circular int. direction 0 : CW, 1 : CCW
4-410
Chapter 4 Details of Instructions
2) Error
(1) If 0 or more than 5 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
3) Program example
(1) If input signal M00000 is On, it instructions the positioning module’s axis ‘1’ installed on the slot number
0 to change “Target position” to “10000” among step number of operation data set in D00020 save in RAM, with
common parameters teaching.
4-411
Chapter 4 Details of Instructions
XGK XGB
○ X
4. 42.35 XWRT
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
XWRT ax O - O - - - O - - O - O O O 4~7 O - -
n1 O - O - - - O - - O - O O O
XWRT XWRT
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction WORD
n1 Axis to save parameter in WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) Function
(1) It is used to the instruction moduel to save parameter.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to save presently run parameter of the axes n1, in Flash ROM.
(3) In order to set the axis to save parameter in n1, the bit of the axis assigned per bit shall be set as follows;
5~ 15 4 3 2 1 0
XGK
Unused 4-axis 3-axis 2-axis 1-axis Unused
2) Error
(1) If 0 or more than 5 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
3) Program Example
(1) If input signal M00000 is On, it instructions the positioning module’s axis set in P1100 installed on the slot number
0 to save current parameter and operation data of axis set in P1200 in FRAM.
4-412
Chapter 4 Details of Instructions
XGK XGB
○ X
4. 42.36 XSRD
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
XSRD ax O - O - - - O - - O - O O O 4~7 O - -
D O - O - - - O - - - - O O O
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction WORD
D Device name & number in CPU WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) Function
(1) It is used to instruction the positioning module to read its present status.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to read its present status so to save in CPU area specified in D.
(3) Value to be saved in CPU area specified in D is as shown below;
2) Error
(1) If 0 or more than 5 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
3) Program Example
(1) If input signal P00000 is On, it instructions the positioning module’s axis set in P1100 installed on the slot number
0 to read current state data of axis set in P1100 to D1000.
4-413
Chapter 4 Details of Instructions
XGK XGB
4.42.37 XCAM ○ X
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
ax O - O - - - O - - O - O O O
XCAM 4~7 O - -
n1 O - O - - - O - - O - O O O
n2 O - O - - - O - - O - O O O
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction WORD
n1 CAM operation main axis setting WORD
n2 CAM data block number WORD
[Flag Setting ]
Device
Flag Description
Number
Error If ‘ax’ value exceeds the range F110
1) Function
(1) It is used to instruct the positioning module of CAM operation.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) fo CAM operation with CAM data of n2
2) Error
(1) If 0 or more than 5 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
3) Program example
(1) If input signal M00000 is On, it instructions the axis 1 on slot 1 to execute CAM operation with CAM data block
number 1.
4-414
Chapter 4 Details of Instructions
XGK XGB
4.42.38 XELIN ○ X
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction WORD
n1 Step number to operate WORD
n2 Ellipse rate (%) WORD
n3 Operation angle WORD
[Flag Setting]
Device
Flag Description
Number
Error If ‘ax’ value exceeds the range F110
1) Function
(1) It is used to instruction the positioning module of ellipse interplocation operation
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to execute ellipse interpolation with n2 rate and n3 anlge for n1 operation data step.
2) Error
(1) If 0 or more than 5 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
3) Program example
(1) If input signal M00000 is On, it instructions the positioning module’s axis 1 installed on the slot number 1 to execute
eliipse interpolation with ellipse rate 50% and angle 180 about operation step number 3.
(2) If input signal M00000 is On, it instructions the positioning module’s axis 1 installed on the slot number 1 to execute
eliipse interpolation with ellipse rate set in D00012 and angle set in D00013 about operation step number set in
D00010.
4-415
Chapter 4 Details of Instructions
XGK XGB
4.42.39 XSSSP ○ X
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
ax O - O - - - O - - O - O O O
XSSSP n1 O - O - - - O - - O - O O O 4~7 O - -
n2 O - O - - - O - - O - O O O
n3 O - O - - - O - - O - O O O
n4 O - O - - - O - - O - O O O
[Area Setting]
Operand Description Data size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction WORD
n1 Speed synchronization main axis rate WORD
n2 Speed synchronization sub axis rate WORD
n3 Speed synchronization main axis setting WORD
n4 Speed synchronization target position DWORD
[Flag setting]
Device
Flag Description
number
Error If ‘ax’ value exceeds the range F110
1) Function
(1) It is used to instruction the positioning module of speed synchronization operation
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to execute speed synchronization with rate of main axis rate n1 and sub axis rate n2. If ax reaches position
set in n4, ax goes out speed sychonization mode and stops.
(3) n3 can be set as follows.
Setting value Axis
1~4 1 axis ~ 4 axis
9 Encoder1
2) Error
(1) If 0 or more than 5 is input in specified instruction axis ‘ax’, Error Flag (F110) will be set.
3) Program example
(1) If input signal M00000 is On, it instructions the positioning module’s axis 1 installed on the slot number 0 to execute
speed synchronization with main axis rate: sub axis rate 200:100 where main axis is axis 2. And if it reaches target
position 2000, it stops.
4-416
Chapter 4 Details of Instructions
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction WORD
S Head aderess of Device which is saved in point operation data WORD
n1 Number of point operation step WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) Function
(1) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to move the value of point operation step to be used to the axis ‘ax’ of the positioning module as many
as n1 from CPU area specified in S.
(2) Number of point operation steps to be specified in n1 is 1 ~ 20.
(3) Value to read from CPU area specified in S is as below;
2) Error
(1) If 0 or more than 5 is input in specified instruction axis ‘ax’, Error Flag (F0110) will be set.
3) Program Example
(1) If input signal P00000 is On, it instructions the positioning module’s axis 1 installed on the slot number 0 to
save data as many as D1400 from D1300 as point operation step.
4-417
Chapter 4 Details of Instructions
XGK XGB
4. 42.41 XTWR ○ X
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
ax O - O - - - O - - O - O O O
XTWR 4~7 O - -
S O - O - - - O - - - - O O O
n1 O - O - - - O - - O - O O O
[Area Setting]
Operand Description Data Size
sl Slot number positioning module is installed on. WORD
ax Axis to instruction WORD
S Head address of Device which is saved data of plural teaching DWORD
n1 Number to plural teaching WORD
[Flag Setting]
Flag Description Device Number
Error If ‘ax’ value exceeds the range F110
1) Function
(1) It is used to instruction the positioning module the teaching data value to be used for plural teaching.
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to move the teaching data value to be used for plural teaching, to the axis ‘ax’ of the positioning
module as many as n1 from CPU area specified in S. If you use XTEAA insturcion after this insturcion, data
teaching will be complete
(3) Number of point operation steps to be specified in n1 is 1 ~ 16.
(4) Value to read from CPU area specified in S is as below.
2) Error
(1) If 0 or more than 5 is input in specified instruction axis ‘ax’, Error Flag (F0110) will be set.
3) Program Example
(1) If input signal P00000 is On, it instructions the positioning module’s axis 2 installed on the slot number 0 to save
data as many as D1400 from D1300 as plural teaching data.
4-418
Chapter 4 Details of Instructions
XGK XGB
4.42.42 XSWR ○ X
[Area Setting]
Operand Description Data size
sl Slot number positioning module is installed on. WORD
ax Axis to insturction WORD
S Head address of Device which simultanest start operatio setp is saved WORD
n1 Number to plural teaching WORD
[Flag setting]
Device
Flag Description
Number
Error If ‘ax’ value exceeds the range F110
1) Function
(1) It is used to set step data necessary for simultaneous start
(2) It is used to instruction the positioning module’s specified axis ‘ax’ installed on sl(positioning module’s slot
number) to move the operation step value from CPU area set as S as many as n1 to positioning module. If you
exeute XSST instruction after this instruction, you can execute simultaneous start.
(3) The number of point operatio step set in n1 is 1 ~ 4.
(4) Value to read from CPU area specified in S is as below.
CPU area Size Teaching data
S WORD Axis 1 simultaneous operation step
~ ~
S+3 WORD Axis 4 simultaneous operation step
2) Error
(1) If 0 or more than 5 is input in specified instruction axis ‘ax’, Error Flag (F0110) will be set.
3) Program example
(1) If input signal P00000 is On, it instructions the positioning module’s axis 2 installed on the slot number 0 to save
data as many as D1400 from D1300 as simultaneous start step number.
4-419
Chapter 4 Details of Instructions
GETM sl S D N
GETMP P sl S D N
means GETM
[Area Setting]
Operand Description Data Size
sl Slot number motion module is installed on. WORD
S Motion module’s fixed area head address WORD
D Device name & number in CPU DWORD
N Number of data to read. DWORD
[Flag Setting]
Flag Description Device Number
1. If there is no module on the specified slot.
Error F110
2. If no address specified in S is available in the installed module on the specified slot.
1) GETM, GETMP
(1) This instruction is used to read the data of motion module.
(2) It reads N double word data from the memory of the motion module specified in sl(special module’s slot
number) to save in CPU area specified in sl.
2) Error
(1) If the area from specified address S to N exceeds the applicable block, error may occur. This error is blocked,
not to be input in Present XG5000.
(2) If there is no motion module on the specified slot, or no address specified in S is available in the installed
module, Error Flag (F110) will be set. This is because the fixed area address may be different according to the
properties of the special module.
3) Program Example
(1) It reads 4-word data from motion module’s fixed area address 0 to address 3 installed on the slot number 3 of
the base number 0, to save in D0010 ~ D00013.
P00001
GETM 03 0 D00010 2
4-420
Chapter 4 Details of Instructions
XGK XGB
○ X
4.43.2 PUTM, PUTMP
Area Available Flag
Instruction Con Step Error Zero Carry
PMK F L T C S Z D.x R.x U N D R
st (F110) (F111) (F112)
sl - - - - - - - - - O - - - -
S1 - - - - - - - - - O - - - -
PUTM(P) 4~7 O - -
S2 O - O - - - - - - - O O O O
N O - O - - - - - - O - - - -
Instruction
PUTM sl S1 S2 N
Instruction
PUTMP P sl S1 S2 N
means PUTM
[Area Setting]
Operand Description Data Size
sl Slot number motion module is installed on. WORD
S1 Motion module’s fixed area head address WORD
S2 Device name & number where data to save in motion module is saved. DWORD
N Number of data to save. WORD
[Flag Setting]
Flag Description Device Number
1. If there is no module on the specified slot.
Error F110
2. If no address specified in S is available in the installed module on the specified slot.
1) PUTM, PUTMP
(1) This instruction is used to write the data in motion module.
(2) It writes N double word data from the specified device S2 in the memory (S1) of the motion module specified in
sl (special module’s slot number).
2) Error
(1) If the area from specified address S1 to N exceeds the applicable block, error may occur. This error is blocked,
not to be input in Present XG5000.
(2) If there is no motion module on the specified slot, or no address specified in S is available in the installed
module, Error Flag (F110) will be set. This is because the fixed area address may be different according to the
properties of the special module.
3) Program Example
(1) If input signal M00000 is On, it writes the 40-word of D1000 ~D1049 in motion module’s memory address 10 ~
47 installed on the slot number 7.
M00000
PUTM 7 10 D1000 20
4-421
Chapter 5 SFC (Sequential Function Chart)
5-1
Chapter 5 SFC (Sequential Function Chart)
5.2.1 Step
▷ Step indicates a sequence control unit by connecting the action.
▷ When step is in an active state, the attached content of action will be executed.
▷ The initial step is one to be activated first.
▷ If a next transition condition of activated initial step (S1) is established, step 1 (S1) that is currently
activated becomes deactivated and Step 2 (S2) connected to S1 becomes activated.
5.2.2 Transition
▷ Transition indicates the execution condition between steps.
▷ A transition condition should be described as a PLC language such as ST or LD.
▷ The result of a transition condition should always be a BOOL type and the variable name should
be TRANS for any transition.
▷ In case that the result of transition condition is 1, the current step is deactivated and the next step
is activated.
▷ There must be a transition between step and step.
S1
T1
TRAN1
S2
T2
5-2
Chapter 5 SFC (Sequential Function Chart)
5.2.3 Action
▷ Each step is able to connect up to two actions.
▷ The step without action is regarded as a waiting action and it is required to wait until the next
transition condition will be 1.
▷ Action is composed of PLC language such as LD/SFC/ST and the action will be executed while the
step is activated.
▷ Action qualifier will be used to control action.
▷ When action becomes deactivated state after activating, the contact output in action will be 0.
However, S, R, function and function block output retain their state before they become non-
activating.
S1 N ACTION1
S ACTION2
T1
5-3
Chapter 5 SFC (Sequential Function Chart)
Reference
Post Scan
When action is deactivated, this action is scanned again.
As it is scanned as if there were a contact (contact with the value of 0) in the beginning part of an action
program, the program output, which is composed of contacts, will be 0.
Function, function block, S, R output etc., are not included.
1) N (Non-Stored)
Action is executed only when the step is activated.
5-4
Chapter 5 SFC (Sequential Function Chart)
2) S (Set)
It continues the action after the step is activated (until the action is reset by R qualifier).
3) R (Overriding Reset)
It terminates the execution of an action previously started with the S, SD, SL or DS qualifier.
4) L (Time Limited)
It starts the action when the step becomes active and continues until the step goes inactive or a set
time elapses.
Step connected by L
Action T
5) D (Time Delayed)
Start a delay timer when the step becomes active - after the time delay the action starts (if step still
active) and continues until deactivated.
6) P (Pulse)
It starts the action when the step becomes active and executes the action only once.
5-5
Chapter 5 SFC (Sequential Function Chart)
Step connected by DS T
Action
Step connected by R
5-6
Chapter 5 SFC (Sequential Function Chart)
▷ For the transition between steps connected by serial, the lower step will be activated if the upper
step is active and the transition condition connected to the next is 1.
S1
T1 T4 T5
S2 S4 S5
T2 T6 T7
S3
T3
* In case that the transition condition of T1 is 1, the order of activation will be S1 -> S2 -> S3.
* In case that the transition condition of T4 is 1, the order of activation will be S1 -> S4 -> S3.
* In case that the transition condition of T5 is 1, the order of activation will be S1 -> S5 -> S3.
5-7
Chapter 5 SFC (Sequential Function Chart)
If the transition conditions are 1 at the same time, the processor chooses the left-most path.
* In case that the transition condition of T1 and T4 is 1 at the same time, the order of activation will be
S1 -> S2 -> S3..
* In case that the transition condition of T4 and T5 is 1 at the same time, the order of activation will be
S1 -> S4 -> S3.
Example
S1
T1
S2 S6 S8
T2 T6
S3 S7
T3
S4
T4
S5
T5
- If the transition condition of T1 is 1 when S1 is active, S2, S6 and S8 will be activated and S1 will be
deactivated.
- If the transition condition of T4 is 1 when S4, S7 and S8 are activated, S5 will be activated and S4,
S7 and S8 will be deactivated.
5-8
Chapter 5 SFC (Sequential Function Chart)
5.3.4 Jump
▷ If the transition condition connected to the next is 1 after the last step of SFC is activated, the initial
step of SFC will be activated.
Example
S1
T1
S2
T2
S3
T3
S1 S2 S3
Example
S1
T1
ABC
S2
T2
S3 S5
T3 T5
ABC
S4
T4
5-9
Chapter 5 SFC (Sequential Function Chart)
S1
T1
LABEL1 S7
S2
T8
T2 T6 S8
S3 S6
T9
T3 T7
LABLE1
S9
S4
T4
S5
T5
S1
T1
LABEL1 S5
S2
T5
T2 S6
S3
T3
S4
T4
LABEL1
5-10
Chapter 6 ST (Structured Text)
6.2 Comments
▷ There are two types in comments, one line comment and block comment.
▷ One line comment uses “//”, that line is used as comment line.
▷ Block comment considers text between “*” and “*”.
Ex.)
6-1
Chapter 6 ST (Structured Text)
6.3 Expression
▷ Expression consists of operator and operand. Operand may be constant, character, character
string, time character, defined variable (named variable, direct variable), defined function (function,
function block). Operator of ST is described in <Table 1>.
▷ Expression is calculated according to order of operator in <Table 1>. Operator having highest
priority is calculated first and then operator having second highest priority is calculated. This is
repeated until end of calculation.
Ex.) A+B*C: first, multiplies B by C and adds the result to A.
Number Operation Symbol Order
1 Parenthesis (Expression) High
2 Function Function name (Parameter list)
Ex.) ADD(X, Y)
3 not -
Complement NOT
4 Exponent **
5 Multiplication *
Division /
Remain MOD
6 Add +
Subtract -
7 Compare <, >, <=, >=
8 same =
Not same <>
9 Bool logical AND &
AND
10 Bool logical Exclusive OR XOR
Low
11 Bool logical OR OR
6-2
Chapter 6 ST (Structured Text)
Characteristic
Number Example
Method Variable Variable
of ADD(S1, S2, D);
assignment sequence
variable
Application instruction
Not fixed type Impossible Fixed Fixed
Ex.) ADD(1, B, A);
- Sequence of parameter used in application instruction is fixed.
<Table 2> how to use parameter of application instruction
Remark
6-3
Chapter 6 ST (Structured Text)
6.3.1 + operator
▷ + Operator is used to add two operands.
▷ Expression
result := expression1 + expression2
Items Description
Result Named variable or direct variable
expression1 ANY_NUM type
expression2 ANY_NUM type
Example Description
Val1 := 20; Adds Val1(20) to Val2(4) and inputs result
Val2 := 4; Value of Result becomes 24.
Result := Val1 + Val2; Constant and variable can be used as operands (Val1, Val2).
Note
- ANY_NUM includes ANY_REAL type and ANY_INT.
For more detail, refer to data type layer of ch.3.2.2
- Operation of LWORD, LINT, ULINT type is not supported.
6.3.2 - Operator
▷ Subtracts right value from left value.
▷ Expression
result := expression1 - expression2
Items Description
result Named variable or direct variable
expression1 ANY_NUM
expression2 ANY_NUM
Example Description
Val1 := 20; Subtracts right value(Val2) from left value(Val1) and inputs result.
Val2 := 4; Value of result becomes 16
Result := Val1 - Val2; Constant and variable can be used as operands (Val1, Val2).
6-4
Chapter 6 ST (Structured Text)
Note
Operation of LWORD, LINT, ULINT type is not supported
6.3.3 * Operator
▷ Multiplies two operands
▷ Expression
result := expression1 * expression2
Items Description
result Named variable or direct variable
expression1 ANY_NUM type
expression2 ANY_NUM type
Example Description
In1 := 2 ; Multiplies 20 by In1(2) and inputs result.
Result := 20 * In1 ; Value of result becomes 40.
Constant and variable can be used as operands (Val1, Val2).
Note
Operation of LWORD, LINT, ULINT type is not supported
6.3.4 / Operator
▷ Divides left value by right value.
▷ Data type of result is different according to data type of operand. If operand is REAL type, result is
also REAL type. If operand is integer, result is also integer. If 5 (int) is divided by 3 (int), result is
real but number less than decimal point is removed.
6-5
Chapter 6 ST (Structured Text)
▷ Expression
result := expression1 / expression2
Item Description
result Named variable or direct variable
expression1 ANY_NUM type
expression2 ANY_NUM type
Example Description
In1 := 2 ; Divides 20 by 2(ln1) and inputs Result.
Result := 20 / In1 ; Result becomes 10.
Constant and variable can be used as operands.
Notes
- If some value is divided by 0, operation error flag (_ERR) is On. In case of this, CPU
keeps RUN mode.
- Operation of LWORD, LINT, ULINT type is not supported
Example Description
In1 := 10 ; Divides 12 by 10(ln1) and inputs remain into Result
Result := 12 MOD In1 ; Constant and variable can be used as operands.
Notes
If some value is divided by 0, operation error flag (_ERR) is On. In case of this, CPU keeps
RUN mode.
Operation of LWORD, LINT, ULINT, REAL, LREAL type is not supported
6-6
Chapter 6 ST (Structured Text)
6.3.6 ** Operator
▷ Exponential operator is used to multiply left number as many as right number times
▷ Expression
result := expression1 ** expression2
Items Description
result Named variable or direct variable
expression1 ANY_REAL type
expression2 ANY_REAL type
Example Description
In1 := 3 ; Multiplies 10 as many as 3 times and inputs it to Result.
Result := 10 ** In1 ; Result becomes 1000.
Constant and variable can be used as operands.
Notes
Only LREAL type operation is available.
Item Description
result Named variable or direct variable
expression1 ANY_BIT type
expression2 ANY_BIT type
Example Description
th
Result := h93 AND h3D ; Since first bit and 5 bit of two operands are both 1,
result is “h11”.
Constant and variable can be used as operands.
6-7
Chapter 6 ST (Structured Text)
Notes
Operation of LWORD, LINT, ULINT type is not supported.
6.3.8 OR operator
▷ Executes logical bit OR operation.
▷ Expression
result := expression1 OR expression2
Items Description
result Named variable or direct variable
expression1 ANY_BIT type
expression2 ANY_BIT type
Example Description
Result := h93 OR h3D; Since there are 1 except 7th bit in two operands, Result
is “hBF”.
6-8
Chapter 6 ST (Structured Text)
Example Description
Result := h93 XOR h3D; Since first bits of two operands are 1, first bit of result is
0.
Result is “hAE”
6.3.10 = operator
▷ Compares two operands if they are same.
▷ Expression
result := expression1 = expression2
Item Description
result Named variable or direct variable
expression1 ANY type
expression2 ANY type
Example Description
Val1 := 20; Compares Val1 and Val2 and output result.
Val2 := 20 ; Result is 1.
Result := Val1 = Val2 ;
6-9
Chapter 6 ST (Structured Text)
Example Description
Val1 := 20; Compares Val1 and Val2 and output result.
Val2 := 20 ; Result is 0.
Result := Val1 <> Val2 ;
Note
Operation of LWORD, LINT, ULINT type is not supported.
Example Description
Val1 := 20; Compares two operands if left one is larger than right one.
Val2 := 10 ; Result is 1.
Result := Val1 > Val2 ;
Note
Operation of LWORD, LINT, ULINT type is not supported.
6-10
Chapter 6 ST (Structured Text)
Example Description
Val1 := 20; Compares two operands if left one is smaller than right
Val2 := 10 ; one.
Result := Val1 < Val2 ; Result is 0.
Note
Operation of LWORD, LINT, ULINT is not supported.
6-11
Chapter 6 ST (Structured Text)
Example Description
Val1 := 20; Compares two operands if left one is larger than right one or
Val2 := 20 ; same.
Result := Val1 >= Val2 ; Result is 1.
Note
Operation of LWORD, LINT, ULINT type is not supported.
6-12
Chapter 6 ST (Structured Text)
Example Description
Val1 := 2; Compares two operands if left one is smaller than right one or
Val2 := 20 ; same.
Result := Val1 <= Val2 ; Result is1.
Note
Operation of LWORD, LINT, ULINT type is not supported.
Example Description
Val1 = h000C; Changes Val1 and output Result.
Result:= NOT Val1 ; Result is “hFFF3”
Note
Operation of LWORD, LINT, ULINT, REAL, LREAL is not supported.
6.3.17 - operator
▷ Adds negative sign into value.
▷ Expression
result := - expression
item Description
result Named variable or direct variable
expression ANY_NUM type
Example Description
Val1 = 10; Adds negative sign into value and output Result.
Result:= - Val1 ; Result is -10.
6-13
Chapter 6 ST (Structured Text)
Note
Operation of LWORD, LINT, ULINT type is not supported.
6.4 Statement
Note
6-14
Chapter 6 ST (Structured Text)
6-15
Chapter 6 ST (Structured Text)
6-16
Chapter 6 ST (Structured Text)
Or
IF condition THEN
statements
[ELSIF condition-n THEN
elseifstatements] . . .
[ELSE
elsestatements]
END_IF
Item Description
condition If condition is TRUE, a statement following THEN is executed.
In case of FLASE, ELSIF or ELSE is executed.
statements If condition is TRUE, a statement more than one is executed.
condition-n N conditions can be used.
elseifstatements If condition-n is TRUE, a statement more than one is executed.
elsestatements If condition or condition-n is false, a statement more than one is
executed.
6-17
Chapter 6 ST (Structured Text)
Example Description
IF Val1 <= 10 THEN If condition (Val1 <= 10) is TRUE, 10 is assigned into Result.
Result := 10;
END_IF;
IF Val1 <= 10 THEN If condition (Val1 <= 10) is TRUE, 10 is assigned into Result.
Result := 10; If condition is FALSE, 20 is assigned into Result.
ELSE
Result := 20;
END_IF;
IF Val1 <= 10 THEN If condition (Val1 <= 10) is TRUE, 10 is assigned into Result.
Result := 10; If condition is FALSE, ELSEIF is executed. If second condition (Val
ELSIF Val1 <= 20 THEN <= 20) is TRUE, 20 is assigned into Result. If second is FALSE, a
Result := 20; statement under ELSE is executed. Namely, 30 is assigned into
ELSE Result.
Result := 30;
END_IF;
6.4.6 CASE
▷ Diverges according to value of expression following CASE. Expression should be integer. When
value of expression is not included in case list, a statement after ELSE is executed. If there is no
ELSE, no statement list is executed.
▷ Expression
CASE expression OF
case_list : statement_list
{ case_list : statement_list}
[ELSE
statement_list]
END_CASE
Item Description
expression Only INT type is available.
case_list case_list_element {',' case_list_element}
There are diverse statement like above.
case_list_element Subrange or signed_integer are available
subrange signed_integer .. signed_integer type
statement_list Executes statements more than one
6-18
Chapter 6 ST (Structured Text)
Example Description
CASE Val1 OF If value of Val1 is 1, 10 is assigned into Result.
1 : Result := 10 ; If value of Val1 is 2~5, 20 is assigned into Result.
2..5 : Result := 20 ; If value of Val1 is 7 or 10, 30 is assigned into Result.
7, 10 : Result := 30 ; In case of other values, 40 is assigned into Result.
ELSE
Result := 40 ;
END_CASE ;
6.4.7 FOR
▷ It is used to deal with repetition and uses three control statements. First, statement for initialization
is necessary. If To expression is TRUE (present counter value is less than end value), loop is
executed one time. Then counter values increases as many as BY value and condition is checked
again. In FOR statement, condition is checked first and loop is executed later. So no loop may be
executed.
▷ Expression
FOR counter := start TO end [BY step] DO
statements
END_FOR
Item Description
counter Integer (SINT, INT, DINT) s
start, end, step should be same type.
start Initial value of counter
end Last value of counter
step Indicates increment of count variable whenever loop is executed. If this is not
used, increment is 1.
statements It is executed according to three control texts.
6-19
Chapter 6 ST (Structured Text)
Example Description
SUM := 0; Counter variable increases from 0 to 10 as many as 1. 1 is
FOR counter := 0 TO 10 DO added into SUM variable repeatedly. Final value of SUM is
SUM := SUM + 1; 11.
END_FOR ;
SUM := 0; Counter variable increases from 0 to 10 as many as 2. 1 is
FOR counter = 0 TO 10 BY 2 DO added into SUM variable repeatedly. Final value of SUM is
SUM := SUM + 1; 6.
END_FOR ;
Note
6.4.8 WHILE
▷ It is executed repeatedly until condition is 0. In WHILE statement, condition is checked first and
loop is executed later. So no loop may be executed.
▷ Expression
WHILE condition DO
statements
END_ WHILE
Item Description
condition If condition is TRUE, statements after DO are executed.
In case of FLASE, it goes out from loop.
statements If condition is TRUE, statements more than one are executed.
Example Description
Counter := 0 If condition that Counter is less than 20 is TRUE, a statement is
WHILE Counter < 20 DO executed.
Counter := Counter + 1; If condition is FALSE, it goes out from loop.
END_WHILE ;
6-20
Chapter 6 ST (Structured Text)
Note
In WHILE statement, in case condition doesn’t become 0, it can’t go out from loop. In this
case, due to long scan time, watch-dog is on. So be careful so that condition is not always
TRUE.
UNTIL condition
END_REPEAT
Item Description
condition If condition is FALSE, it is executed repeatedly and if TRUE, goes
out from loop.
statements Loop is executed repeatedly until condition is TRUE.
Example Description
Counter := 0; First, Counter variable is set to 1. If the condition that Counter
REPEAT DO variable is larger than 2 is met, it goes out from loop or it executes
Counter := Counter + 1; loop.
UNTIL Counter > 20 If Counter variable is 21, condition is TRUE and it goes out from
END_REPEAT ; loop.
Note
In REPEAT statement, in case condition doesn’t become 1, it can’t go out from loop. In this
case, due to long scan time, watch-dog is on. So be careful so that condition is not always
FALSE.
6-21
Chapter 6 ST (Structured Text)
6.4.10 EXIT
▷ It is used to go out from repeat statements (WHILE, FOR, REPEAT).
▷ If it is used outside repeat statements, error occurs.
▷ Expression
EXIT
Example Description
SUM := 0; Counter variable increases from 0 to 10 as many as1. But because
FOR Counter := 0 TO 10 DO of EXT, loop ends. Counter variable becomes 0 and SUM becomes
SUM := SUM + 1; 1.
EXIT;
END_FOR ;
Counter := 0; Text is executed repeatedly when Counter is less than 20 and if
WHILE Counter < 20 DO Counter is larger than 20, loop ends. But because of IF statement
Counter := Counter + 1 ; and EXIT statement, loop ends when Counter is 10.
IF Counter = 10 THEN
EXIT;
END_IF;
END_WHILE ;
6-22
Appendix 1. Numeric System & Data Structure
However, since decimal is easy and most widely used in daily life, numeric information to write or read through
PLC needs to be converted from decimal to hexadecimal, or hexadecimal to decimal. In this chapter, how to
express or how to relate decimal, binary, hexadecimal and binary coded decimal (BCD) will be described.
(1) Decimal
For example, decimal 153 will be expressed as shown below in the aspect of row and “value weighted of row”
135=100+50+3
=1*100+5*10+3*1
2 1 0
=1*10 +5*10 +3*10
10진수의 기호(0~9)
Signs decimal (0~9)
Value
행의 weighted of row
가중치
Binary is “number of two signs 0 and 1 used to express order and size”.
Appendix 1-1
Appendix 1. Numeric System & Data Structure
Binary Decimal
0 0
1 1
10 2
11 3
100 4
101 5
110 6
111 7
1000 8
…… ……
“10011101”
As the row number and the value weighted of row have been considered in decimal, bit number and bit value
...
...
...
...
...
...
...
Let’s think about the sum of the multiplication of each bit’s code value weighted as in decimal.
= 1×128+0×64+0×32+1×16+1×8+1×4+0×2+1×1
= 128+16+8+4+1
= 157
In other words, binary is the result of “code of 1 plus bit value weighted”
Appendix 1-2
Appendix 1. Numeric System & Data Structure
Hexadecimal as similarly as above is “number of signs 0 ~ 9 and A ~ F” used to express order and size ”.
= 19101
Appendix 1-3
Appendix 1. Numeric System & Data Structure
Thus, binary coded decimal displays decimal 0 ~ 9999 (max. of 4 rows) in 16 bits.
Appendix 1-4
Appendix 1. Numeric System & Data Structure
Appendix 1-5
Appendix 1. Numeric System & Data Structure
As for integral number expressed, if the highest bit (MSB) is 0, it stands for positive number, and if it is 1, it
stands for negative number.
The highest bit expressing negative or positive number is called Sign bit.
Since the position of MSB is different in 16 bits and 32 bits, pay attention to the position of Sign bit.
In case of 16 bits
b16 b0
0: displays 0 and
Sign bit positive number
1: displays
negative number
Displayed range:-32768~32767
In case of 32 bits
0: displays 0 and
Sign bit positive number
1: displays
negative number
(1) Take out the negative sign and mark 0001. (b15=1)
b15 b0
1 0 ~ 0 1
b15 b0
1 1 ~ 1 0
b15 b0
1 1 ~ 0 1
-0001 = hFFFF
Appendix 1-6
Appendix 2. Measurement and Precision of Timer
Appendix 2-1
Appendix 2. Measurement and Precision of Timer
P00
Timer’s
internal coil
+1
Scan
0 Scan +1
-1 Scan
+1
Scan
-1
Appendix 2-2
Appendix 3. List of Special Relays (F)
F0000 DWORD _SYS_STATE Mode & Status PLC mode & run status displayed.
F00000 BIT _RUN RUN RUN status.
F00001 BIT _STOP STOP STOP status.
F00002 BIT _ERROR ERROR ERROR status.
F00003 BIT _DEBUG DEBUG DEBUG status.
F00004 BIT _LOCAL_CON Local control Local control mode.
F00005 BIT _MODBUS_CON Mode bus mode Mode bus control mode.
F00006 BIT _REMOTE_CON Remote mode Remote control mode.
Program being downloaded
F00008 BIT _RUN_EDIT_ST Modification during run
during run.
Modification in progress during
F00009 BIT _RUN_EDIT_CHK Modification during run
run.
Modification complete
F0000A BIT _RUN_EDIT_DONE Modification complete during run.
during run
Modification complete
F0000B BIT _RUN_EDIT_END Modification complete during run.
during run
F0000C BIT _CMOD_KEY Run mode Run mode changed by key.
Run mode changed by local
F0000D BIT _CMOD_LPADT Run mode
PADT.
Run mode changed by remote
F0000E BIT _CMOD_RPADT Run mode
PADT.
Run mode changed by remote
F0000F BIT _CMOD_RLINK Run mode
communication module.
F00010 BIT _FORCE_IN Compulsory input Compulsory input status.
F00011 BIT _FORCE_OUT Compulsory output Compulsory output status.
F00012 BIT _SKIP_ON I/O SKIP I/O SKIP being executed.
F00013 BIT _EMASK_ON Error mask Error mask being executed.
F00014 BIT _MON_ON Monitor Monitor being executed.
F00015 BIT _USTOP_ON STOP Stopped by STOP function
F00016 BIT _ESTOP_ON ESTOP Stopped by ESTOP function.
F00017 BIT _CONPILE_MODE compiling Compile being performed.
Initialization task being
F00018 BIT _INIT_RUN Initializing
performed.
F0001C BIT _PB1 Program code 1 Program code 1 selected.
F0001D BIT _PB2 Program code 2 Program code 2 selected.
F0001E BIT _CB1 Compile code 1 Compile code 1 selected.
F0001F BIT _CB2 Compile code 2 Compile code 2 selected.
Appendix 3-1
Appendix 3. List of Special Relays (F)
Appendix 3-2
Appendix 3. List of Special Relays (F)
Appendix 3-3
Appendix 3. List of Special Relays (F)
Appendix 3-4
Appendix 3. List of Special Relays (F)
F0050 WORD _SCAN_MAX Max. scan time Max. scan time since run displayed
F0051 WORD _SCAN_MIN Min. scan time Min. scan time since run displayed
F0052 WORD _SCAN_CUR Present scan time Present scan time displayed.
F0053 WORD _MON_YEAR Month / Year PLC’s time information (Month/Year)
F0054 WORD _TIME_DAY Hour / Date PLC’s time information (Hour/Date)
F0055 WORD _SEC_MIN Second / Minute PLC’s time information (Second/Minute)
F0056 WORD _HUND_WK 100 years / Day PLC’s time information (100 years/Day)
FPU operation Floating decimal operation result
F0057 WORD _FPU_INFO
result displayed.
Incorrect error
F00570 BIT _FPU_LFLAG_I Latched if in incorrect error.
latch
F00571 BIT _FPU_LFLAG_U Underflow latch Latched if underflow found.
F00572 BIT _FPU_LFLAG_O Overflow latch Latched if overflow found.
F00573 BIT _FPU_LFLAG_Z Latch divided by 0 Latched if divided by 0.
Invalid operation
F00574 BIT _FPU_LFLAG_V Latched if invalid operation.
latch
F0057A BIT _FPU_FLAG_I Incorrect error Reported if incorrect error found.
F0057B BIT _FPU_FLAG_U Underflow Reported if underflow found.
F0057C BIT _FPU_FLAG_O Overflow Reported if overflow found.
F0057D BIT _FPU_FLAG_Z Division by 0 Reported if divided by 0.
F0057E BIT _FPU_FLAG_V Invalid operation Reported if operation invalid.
Irregular value
F0057F BIT _FPU_FLAG_E Reported if irregular value input.
input
F0058 DWORD _ERR_STEP Error step Error step saved.
Increased when module refresh
F0060 DWORD _REF_COUNT Refresh
executed.
F0062 DWORD _REF_OK_CNT Refresh OK Increased if module refresh normal
F0064 DWORD _REF_NG_CNT Refresh NG Increased if module refresh abnormal.
Increased if module refresh abnormal
F0066 DWORD _REF_LIM_CNT Refresh LIMIT
(TIME OUT).
F0068 DWORD _REF_ERR_CNT Refresh ERROR Increased if module refresh abnormal.
_MOD_RD_ERR_ Module READ Increased if module reads 1 word
F0070 DWORD
CNT ERROR abnormally.
_MOD_WR_ERR Module WRITE Increased if module writes 1 word
F0072 DWORD
_CNT ERROR abnormally.
Increased if module’s block data
F0074 DWORD _CA_CNT Block service
serviced
Block service Increased if module’s block data
F0076 DWORD _CA_LIM_CNT
LIMIT service abnormal.
Block service Increased if module’s block data
F0078 DWORD _CA_ERR_CNT
ERROR service abnormal.
Increased if CPU’s internal buffer is
F0080 DWORD _BUF_FULL_CNT Buffer FULL
FULL.
F0082 DWORD _PUT_CNT PUT count Increased if PUT executed.
F0084 DWORD _GET_CNT GET count Increased if GET executed.
F0086 DWORD _KEY Present key Local key’s present status displayed.
F0088 DWORD _KEY_PREV Previous key Local key’s previous status displayed.
Appendix 3-5
Appendix 3. List of Special Relays (F)
Appendix 3-6
Appendix 3. List of Special Relays (F)
F0128 WORD _IO_IFER_0 Module IF 0 error Main base module interface error
Added base step 1 module interface
F0129 WORD _IO_IFER_1 Module IF 1 error
error
Added base step 2 module interface
F0130 WORD _IO_IFER_2 Module IF 2 error
error
Added base step 3 module interface
F0131 WORD _IO_IFER_3 Module IF 3 error
error
Added base step 4 module interface
F0132 WORD _IO_IFER_4 Module IF 4 error
error
Added base step 5 module interface
F0133 WORD _IO_IFER_5 Module IF 5 error
error
Added base step 6 module interface
F0134 WORD _IO_IFER_6 Module IF 6 error
error
Added base step 7 module interface
F0135 WORD _IO_IFER_7 Module IF 7 error
error
F0136 WORD _RTC_DATE RTC date RTC’s present date
F0137 WORD _RTC_WEEK RTC day RTC’s present day of the week
F0138 DWORD _RTC_TOD RTC time RTC’s present time (ms unit)
F0140 DWORD _AC_FAIL_CNT Power-cut times Power-cut times saved.
F0142 DWORD _ERR_HIS_CNT Errors found Number of found errors saved.
Mode conversion
F0144 DWORD _MOD_HIS_CNT Mode conversion times saved.
times
F0146 DWORD _SYS_HIS_CNT History updated System’s updated history saved.
F0148 DWORD _LOG_ROTATE Log rotate Log rotate information saved.
F0150 WORD _BASE_INFO0 Slot information 0 Main base slot information
F0151 WORD _BASE_INFO1 Slot information 1 Added base step 1 slot information
F0152 WORD _BASE_INFO2 Slot information 2 Added base step 2 slot information
F0153 WORD _BASE_INFO3 Slot information 3 Added base step 3 slot information
F0154 WORD _BASE_INFO4 Slot information 4 Added base step 4 slot information
F0155 WORD _BASE_INFO5 Slot information 5 Added base step 5 slot information
F0156 WORD _BASE_INFO6 Slot information 6 Added base step 6 slot information
F0157 WORD _BASE_INFO7 Slot information 7 Added base step 7 slot information
Used block
F0158 WORD _RBANK_NUM Presently used block number
number
F0159 WORD _RBLOCK_STATE Flash status Flash block status
F0160 DWORD _RBLOCK_RD_FLAG Flash Read ON when reading Flash N block data.
F0162 DWORD _RBLOCK_WR_FLAG Flash Write ON when writing Flash N block data.
Error found during Flash N block
F0164 DWORD _RBLOCK_ER_FLAG Flash error
service.
Setting in case of
F09320 BIT _FUSE_ER_PMT Ignores fuse error
fuse error
Setting in case of
F09321 BIT _IO_ER_PMT Ignores I/O module error
I/O error
Setting in case of
F09322 BIT _SP_ER_PMT Ignores special module error
special erro
Setting in case of
F09323 BIT _CP_ER_PMT Ignores comm. module error
comm. Error
F0934 DWORD _BASE_EMASK_INFO Base default mask Base default mask information
Appendix 3-7
Appendix 3. List of Special Relays (F)
F0940 WORD _SLOT_EMASK_INFO_2 Slot default mask Slot default mask information (BASE 2)
F0941 WORD _SLOT_EMASK_INFO_3 Slot default mask Slot default mask information (BASE 3)
F0942 WORD _SLOT_EMASK_INFO_4 Slot default mask Slot default mask information (BASE 4)
F0943 WORD _SLOT_EMASK_INFO_5 Slot default mask Slot default mask information (BASE 5)
F0944 WORD _SLOT_EMASK_INFO_6 Slot default mask Slot default mask information (BASE 6)
F0945 WORD _SLOT_EMASK_INFO_7 Slot default mask Slot default mask information (BASE 7)
F1037 WORD _HUND_WK_DT 100 years / Day Time information data (100 years/Day)
Appendix 3-8
Appendix 4 Execution Speed of Instruction
1)
If using the timer, the execution time of timer is as added as number of timer.
Appendix 4-1
Appendix 4. Execution Speed of Instruction
Unit: ns
XGK-CPUS/E XGK-CPUH/A
Section Instruction Non- Executed Executed Non- Executed Executed
executed N=1 N=8 or X executed N=1 N=8 or X
MOV 252 252 - 84 84 -
MOVP 420 420 - 140 140 -
DMOV 252 252 - 84 84 -
DMOVP 420 420 - 140 140 -
RMOV 252 252 - 84 84 -
RMOVP 420 420 - 140 140 -
LMOV 420 1596 - 140 532 -
LMOVP 588 1764 - 196 588 -
MOV4 504 6426 - 168 2142 -
MOV4P 672 6594 - 224 2198 -
MOV8 504 6426 - 168 2142 -
MOV8P 672 6594 - 224 2198 -
Data CMOV 252 336 - 84 112 -
Transfer CMOVP 420 504 - 140 168 -
Instruction
DCMOV 252 336 - 84 112 -
DCMOVP 420 504 - 140 168 -
GMOV 420 8358 11592 140 2786 3864
GMOVP 588 8526 11760 196 2842 3920
FMOV 420 4662 7308 140 1554 2436
FMOVP 588 4830 7476 196 1610 2492
BMOV 420 3108 - 140 1036 -
BMOVP 588 3276 - 196 1092 -
GBMOV 504 9618 17556 168 3206 5852
GBMOVP 672 9786 17724 224 3262 5908
$MOV 336 16674 - 112 5558 -
$MOVP 504 16842 - 168 5614 -
BCD 336 1722 - 112 574 -
BCDP 504 1890 - 168 630 -
DBCD 336 1806 - 112 602 -
DBCDP 504 1974 - 168 658 -
BIN 336 1680 - 112 560 -
BINP 504 1848 - 168 616 -
DBIN 336 1764 - 112 588 -
DBINP 504 1932 - 168 644 -
GBCD 420 9408 20580 140 3136 6860
GBCDP 588 9576 20748 196 3192 6916
GBIN 420 9324 19908 140 3108 6636
GBINP 588 9492 20076 196 3164 6692
I2R 336 1638 - 112 546 -
I2RP 504 1806 - 168 602 -
Conversion I2L 336 4830 - 112 1610 -
Instruction
I2LP 504 4998 - 168 1666 -
D2R 336 1554 - 112 518 -
D2RP 504 1722 - 168 574 -
D2L 336 4662 - 112 1554 -
D2LP 504 4830 - 168 1610 -
R2I 336 3150 - 112 1050 -
R2IP 504 3318 - 168 1106 -
R2D 336 3150 - 112 1050 -
R2DP 504 3318 - 168 1106 -
L2I 420 3234 - 140 1078 -
L2IP 588 3402 - 196 1134 -
L2D 420 3234 - 140 1078 -
L2DP 588 3402 - 196 1134 -
Appendix 4-2
Appendix 4 Execution Speed of Instruction
Unit: ns
XGK-CPUS/E XGK-CPUH/A
Section Instruction Non- Executed Executed Non- Executed Executed
executed N=1 N=8 or X executed N=1 N=8 or X
CMP 336 1764 - 112 588 -
CMPP 504 1932 - 168 644 -
DCMP 336 1764 - 112 588 -
DCMPP 504 1932 - 168 644 -
CMP4 504 6552 - 168 2184 -
CMP4P 672 6720 - 224 2240 -
CMP8 504 6552 - 168 2184 -
CMP8P 672 6720 - 224 2240 -
TCMP 420 17724 - 140 5908 -
TCMPP 588 17892 - 196 5964 -
DTCMP 420 20664 - 140 6888 -
Compare DTCMPP 588 20832 - 196 6944 -
Instruction GEQ 504 9198 15372 168 3066 5124
GEQP 672 9366 15540 224 3122 5180
GGT 504 9198 15372 168 3066 5124
GGTP 672 9366 15540 224 3122 5180
GLT 504 9198 15372 168 3066 5124
GLTP 672 9366 15540 224 3122 5180
GGE 504 9198 15372 168 3066 5124
GGEP 672 9366 15540 224 3122 5180
GLE 504 9198 15372 168 3066 5124
GLEP 672 9366 15540 224 3122 5180
GNE 504 9198 15372 168 3066 5124
GNEP 672 9366 15540 224 3122 5180
LOAD= - 336 - - 112 -
LOAD> - 336 - - 112 -
LOAD< - 336 - - 112 -
LOAD>= - 336 - - 112 -
LOAD<= - 336 - - 112 -
LOAD<> - 336 - - 112 -
AND= 336 336 - 112 112 -
Compare AND> 336 336 - 112 112 -
Instruction AND< 336 336 - 112 112 -
(16 Bit AND>= 336 336 - 112 112 -
Integer) AND<= 336 336 - 112 112 -
AND<> 336 336 - 112 112 -
OR= 336 336 - 112 112 -
OR> 336 336 - 112 112 -
OR< 336 336 - 112 112 -
OR>= 336 336 - 112 112 -
OR<= 336 336 - 112 112 -
OR<> 336 336 - 112 112 -
Appendix 4-3
Appendix 4. Execution Speed of Instruction
Unit: ns
XGK-CPUS/E XGK-CPUH/A
Section Instruction Non- Executed Executed Non- Executed Executed
executed N=1 N=8 or X executed N=1 N=8 or X
LOADD= - 504 - - 168 -
LOADD> - 504 - - 168 -
LOADD< - 504 - - 168 -
LOADD<= - 504 - - 168 -
LOADD>= - 504 - - 168 -
LOADD<> - 504 - - 168 -
ANDD= 420 420 - 140 140 -
Compare ANDD> 420 420 - 140 140 -
Instructioin ANDD< 420 420 - 140 140 -
(32 bit ANDD>= 420 420 - 140 140 -
Integer) ANDD<= 420 420 - 140 140 -
ANDD<> 420 420 - 140 140 -
ORD= 420 420 - 140 140 -
ORD> 420 420 - 140 140 -
ORD< 420 420 - 140 140 -
ORD 420 420 - 140 140 -
ORD = 420 420 - 140 140 -
ORD 420 420 - 140 140 -
LOAD4= - 6132 - - 2044 -
LOAD4> - 6132 - - 2044 -
LOAD4< - 6132 - - 2044 -
LOAD4>= - 6132 - - 2044 -
LOAD4<= - 6132 - - 2044 -
LOAD4<> - 6132 - - 2044 -
AND4= 504 5964 - 168 1988 -
Compare AND4> 504 5964 - 168 1988 -
Instructioin AND4< 504 5964 - 168 1988 -
(4 bit AND4>= 504 5964 - 168 1988 -
Integer) AND4<= 504 5964 - 168 1988 -
AND4<> 504 5964 - 168 1988 -
OR4= 504 6468 - 168 2156 -
OR4> 504 6468 - 168 2156 -
OR4< 504 6468 - 168 2156 -
OR4>= 504 6468 - 168 2156 -
OR4<= 504 6468 - 168 2156 -
OR4<> 504 6468 - 168 2156 -
LOAD8= - 6132 - - 2044 -
LOAD8> - 6132 - - 2044 -
LOAD8< - 6132 - - 2044 -
LOAD8>= - 6132 - - 2044 -
LOAD8<= - 6132 - - 2044 -
LOAD8<> - 6132 - - 2044 -
AND8= 504 5964 - 168 1988 -
Compare AND8> 504 5964 - 168 1988 -
Instructioin AND8< 504 5964 - 168 1988 -
(8 bit AND8>= 504 5964 - 168 1988 -
Integer) AND8<= 504 5964 - 168 1988 -
AND8<> 504 5964 - 168 1988 -
OR8= 504 6468 - 168 2156 -
OR8> 504 6468 - 168 2156 -
OR8< 504 6468 - 168 2156 -
OR8>= 504 6468 - 168 2156 -
OR8<= 504 6468 - 168 2156 -
OR8<> 504 6468 - 168 2156 -
Appendix 4-4
Appendix 4 Execution Speed of Instruction
Unit: ns
XGK-CPUS/E XGK-CPUH/A
Section Instruction
Non- Executed Executed Non- Executed Executed
executed N=1 N=8 or X executed N=1 N=8 or X
LOADG= 1848 8274 12684 616 2758 4228
LOADG> 1848 8274 12684 616 2758 4228
LOADG< 1848 8274 12684 616 2758 4228
LOADG>= 1848 8274 12684 616 2758 4228
LOADG<= 1848 8274 12684 616 2758 4228
LOADG<> 1848 8274 12684 616 2758 4228
ANDG 420 8106 12516 140 2702 4172
Compare ANDG> 420 8106 12516 140 2702 4172
Instructioin ANDG< 420 8106 12516 140 2702 4172
(16 bit ANDG>= 420 8106 12516 140 2702 4172
group) ANDG<= 420 8106 12516 140 2702 4172
ANDG<> 420 8106 12516 140 2702 4172
ORG 420 8610 13020 140 2870 4340
ORG> 420 8610 13020 140 2870 4340
ORG< 420 8610 13020 140 2870 4340
ORG>= 420 8610 13020 140 2870 4340
ORG<= 420 8610 13020 140 2870 4340
ORG<> 420 8610 13020 140 2870 4340
LOADR= - 1596 - - 532 -
LOADR> - 1596 - - 532 -
LOADR< - 1596 - - 532 -
LOADR>= - 1596 - - 532 -
LOADR<= - 1596 - - 532 -
LOADR<> - 1596 - - 532 -
ANDR= 336 1428 - 112 476 -
Real ANDR> 336 1428 - 112 476 -
Compare
ANDR< 336 1428 - 112 476 -
Instruction
(Single Real ANDR>= 336 1428 - 112 476 -
Number) ANDR<= 336 1428 - 112 476 -
ANDR<> 336 1428 - 112 476 -
ORR= 336 1932 - 112 644 -
ORR> 336 1932 - 112 644 -
ORR< 336 1932 - 112 644 -
ORR>= 336 1932 - 112 644 -
ORR<= 336 1932 - 112 644 -
ORR<> 336 1932 - 112 644 -
LOADL= - 1764 - - 588 -
LOADL> - 1764 - - 588 -
LOADL< - 1764 - - 588 -
LOADL>= - 1764 - - 588 -
LOADL<= - 1764 - - 588 -
LOADL<> - 1764 - - 588 -
ANDL= 504 1596 - 168 532 -
Real ANDL> 504 1596 - 168 532 -
Compare ANDL< 504 1596 - 168 532 -
Instruction
ANDL>= 504 1596 - 168 532 -
(Double Real
Number) ANDL<= 504 1596 - 168 532 -
ANDL<> 504 1596 - 168 532 -
ORL= 504 2100 - 168 700 -
ORL> 504 2100 - 168 700 -
ORL< 504 2100 - 168 700 -
ORL>= 504 2100 - 168 700 -
ORL<= 504 2100 - 168 700 -
ORL<> 504 2100 - 168 700 -
Appendix 4-5
Appendix 4. Execution Speed of Instruction
Unit: ns
XGK-CPUS/E XGK-CPUH/A
Section Instruction
Non- Executed Executed Non- Executed Executed
executed N=1 N=8 or X executed N=1 N=8 or X
LOAD$= - 8526 - - 2842 -
LOAD$> - 8526 - - 2842 -
LOAD$< - 8526 - - 2842 -
LOAD$>= - 8526 - - 2842 -
LOAD$<= - 8526 - - 2842 -
LOAD$<> - 8526 - - 2842 -
AND$= 336 8358 - 112 2786 -
AND$> 336 8358 - 112 2786 -
String AND$< 336 8358 - 112 2786 -
Compare
AND$>= 336 8358 - 112 2786 -
Instruction
AND$<= 336 8358 - 112 2786 -
AND$<> 336 8358 - 112 2786 -
OR$= 336 8862 - 112 2954 -
OR$> 336 8862 - 112 2954 -
OR$< 336 8862 - 112 2954 -
OR$>= 336 8862 - 112 2954 -
OR$<= 336 8862 - 112 2954 -
OR$<> 336 8862 - 112 2954 -
LOAD=3 - 2268 - - 756 -
LOAD>3 - 2268 - - 756 -
LOAD<3 - 2268 - - 756 -
LOAD>=3 - 2268 - - 756 -
LOAD<=3 - 2268 - - 756 -
LOAD<>3 - 2268 - - 756 -
AND=3 420 2100 - 140 700 -
Operand AND>3 420 2100 - 140 700 -
Compare
AND<3 420 2100 - 140 700 -
Instruction
(16 bit AND>=3 420 2100 - 140 700 -
integer) AND<=3 420 2100 - 140 700 -
AND<>3 420 2100 - 140 700 -
OR=3 420 2604 - 140 868 -
OR>3 420 2604 - 140 868 -
OR<3 420 2604 - 140 868 -
OR>=3 420 2604 - 140 868 -
OR<=3 420 2604 - 140 868 -
OR<>3 420 2604 - 140 868 -
LOADD=3 - 2268 - - 756 -
LOADD>3 - 2268 - - 756 -
LOADD<3 - 2268 - - 756 -
LOADD>=3 - 2268 - - 756 -
LOADD<=3 - 2268 - - 756 -
LOADD<>3 - 2268 - - 756 -
ANDD=3 420 2100 - 140 700 -
Operand ANDD>3 420 2100 - 140 700 -
Compare ANDD<3 420 2100 - 140 700 -
Instrucion
ANDD>=3 420 2100 - 140 700 -
(32 bit
Integer) ANDD<=3 420 2100 - 140 700 -
ANDD<>3 420 2100 - 140 700 -
ORD=3 420 2604 - 140 868 -
ORD>3 420 2604 - 140 868 -
ORD<3 420 2604 - 140 868 -
ORD>=3 420 2604 - 140 868 -
ORD<=3 420 2604 - 140 868 -
ORD<>3 420 2604 - 140 868 -
Appendix 4-6
Appendix 4 Execution Speed of Instruction
Unit: ns
XGK-CPUS/E XGK-CPUH/A
Section Instruction Non- Executed Executed Non- Executed Executed
executed N=1 N=8 or X executed N=1 N=8 or X
INC 252 336 252 84 112 -
INCP 420 504 420 140 168 -
DINC 252 420 252 84 140 -
DINCP 420 588 420 140 196 -
INC4 336 6426 336 112 2142 -
INC4P 504 6594 504 168 2198 -
INC8 336 6426 336 112 2142 -
INC8P 504 6594 504 168 2198 -
DEC 252 336 252 84 112 -
DECP 420 504 420 140 168 -
DDEC 252 420 252 84 140 -
Increase/ DDECP 420 588 420 140 196 -
Decrease
DEC4 336 6426 336 112 2142 -
Instruction
DEC4P 504 6594 504 168 2198 -
DEC8 336 6426 336 112 2142 -
DEC8P 504 6594 504 168 2198 -
INCU 252 672 252 84 224 -
INCUP 420 840 420 140 280 -
DINCU 252 714 252 84 238 -
DINCUP 420 918 420 140 306 -
DECU 252 672 252 84 224 -
DECUP 420 840 420 140 280 -
DDECU 252 714 252 84 238 -
DDECUP 420 918 420 140 306 -
ROL 252 588 252 84 196 -
ROLP 420 756 420 140 252 -
DROL 336 3444 336 112 1148 -
DROLP 504 3612 504 168 1204 -
ROL4 420 7014 420 140 2338 -
ROL4P 588 7182 588 196 2394 -
ROL8 420 6762 420 140 2254 -
ROL8P 588 6930 588 196 2310 -
ROR 252 588 252 84 196 -
RORP 420 756 420 140 252 -
DROR 336 3444 336 112 1148 -
DRORP 504 3612 504 168 1204 -
ROR4 420 7014 420 140 2338 -
Rotation ROR4P 588 7182 588 196 2394 -
Instruction ROR8 420 6762 420 140 2254 -
ROR8P 588 6930 588 196 2310 -
RCL 336 4200 336 112 1400 -
RCLP 504 4368 504 168 1456 -
DRCL 336 6216 336 112 2072 -
DRCLP 504 6384 504 168 2128 -
RCL4 420 9198 420 140 3066 -
RCL4P 588 9366 588 196 3122 -
RCL8 420 9114 420 140 3038 -
RCL8P 588 9282 588 196 3094 -
RCR 336 4116 336 112 1372 -
RCRP 504 4284 504 168 1428 -
DRCR 336 6216 336 112 2072 -
DRCRP 504 6384 504 168 2128 -
Appendix 4-7
Appendix 4. Execution Speed of Instruction
Unit: ns
XGK-CPUS/E XGK-CPUH/A
Section Instruction Non- Executed Executed Non- Executed Executed
executed N=1 N=8 or X executed N=1 N=8 or X
RCR4 420 9030 - 140 3010 -
Rotation RCR4P 588 9198 - 196 3066 -
Instruction RCR8 420 8946 - 140 2982 -
RCR8P 588 9114 - 196 3038 -
Appendix 4-8
Appendix 4 Execution Speed of Instruction
Unit: ns
XGK-CPUS/E XGK-CPUH/A
Section Instruction Non- Executed Executed Non- Executed Executed
executed N=1 N=8 or X executed N=1 N=8 or X
BSFT 504 3864 - 168 1288 -
BSFTP 672 4032 - 224 1344 -
BSFL 336 3108 - 112 1036 -
BSFLP 504 3306 - 168 1102 -
DBSFL 336 3444 - 112 1148 -
DBSFLP 504 3612 - 168 1204 -
BSFL4 420 7014 - 140 2338 -
BSFL4P 588 7182 - 196 2394 -
BSFL8 420 6762 - 140 2254 -
BSFL8P 588 6930 - 196 2310 -
BSFR 252 588 - 84 196 -
BSFRP 420 756 - 140 252 -
Move
DBSFR 336 3444 - 112 1148 -
Instruction
DBSFRP 504 3612 - 168 1204 -
BSFR4 420 6762 - 140 2254 -
BSFR4P 588 6930 - 196 2310 -
BSFR8 420 6762 - 140 2254 -
BSFR8P 588 6930 - 196 2310 -
WSFT 336 12138 - 112 4046 -
WSFTP 504 12306 - 168 4102 -
WSFL 420 21798 21420 140 7266 7140
WSFLP 588 21966 21588 196 7322 7196
WSFR 420 21714 21126 140 7238 7042
WSFRP 588 21882 21294 196 7294 7098
SR 0 0 - - - -
XCHG 336 1512 - 112 504 -
XCHGP 504 1680 - 168 560 -
DXCHG 336 1848 - 112 616 -
DXCHGP 504 2016 - 168 672 -
Exchange GXCHG 420 7854 12264 140 2618 4088
Instruction GXCHGP 588 8022 12432 196 2674 4144
SWAP 252 1344 - 84 448 -
SWAPP 420 1512 - 140 504 -
GSWAP 336 4662 8484 112 1554 2828
GSWAPP 420 4830 8652 140 1610 2884
ADD 252 420 - 84 140 -
ADDP 420 588 - 140 196 -
DADD 252 462 - 84 154 -
DADDP 420 630 - 140 210 -
SUB 252 420 - 84 140 -
SUBP 420 588 - 140 196 -
DSUB 252 462 - 84 154 -
BIN DSUBP 420 630 - 140 210 -
Operation
Instruction MUL 252 1722 - 84 574 -
MULP 420 1890 - 140 630 -
DMUL 252 3150 - 84 1050 -
DMULP 420 3318 - 140 1106 -
DIV 252 2436 - 84 812 -
DIVP 420 2604 - 140 868 -
DDIV 252 3864 - 84 1288 -
DDIVP 420 4032 - 140 1344 -
Appendix 4-9
Appendix 4. Execution Speed of Instruction
Unit: ns
XGK-CPUS/E XGK-CPUH/A
Section Instruction Non- Executed Executed Non- Executed Executed
executed N=1 N=8 or X executed N=1 N=8 or X
ADDU 252 756 - 84 252 -
ADDUP 420 924 - 140 308 -
DADDU 252 798 - 84 266 -
DADDUP 420 966 - 140 322 -
SUBU 252 756 - 84 252 -
SUBUP 420 924 - 140 308 -
DSUBU 252 798 - 84 266 -
DSUBUP 420 966 - 140 322 -
MULU 252 1890 - 84 630 -
MULUP 420 2058 - 140 686 -
DMULU 252 3318 - 84 1106 -
DMULUP 420 3486 - 140 1162 -
DIVU 252 2604 - 84 868 -
DIVUP 420 2772 - 140 924 -
DDIVU 252 4032 - 84 1344 -
DDIVUP 420 4200 - 140 1400 -
RADD 252 1442 - 84 602 -
RADDP 420 1498 - 140 658 -
BIN LADD 588 2870 - 196 1078 -
Operation
Instruction LADDP 756 2926 - 252 1134 -
RSUB 252 1442 - 84 602 -
RSUBP 420 1498 - 140 658 -
LSUB 588 2870 - 196 1078 -
LSUBP 756 2926 - 252 1134 -
RMUL 252 1948 - 84 1106 -
RMULP 420 2004 - 140 1162 -
LMUL 588 4186 - 196 2394 -
LMULP 756 4242 - 252 2450 -
RDIV 252 1974 - 84 1134 -
RDIVP 420 2030 - 140 1200 -
LDIV 588 4200 - 196 2660 -
LDIVP 756 4256 - 252 2716 -
$ADD 420 12768 35490 140 4256 11830
$ADDP 588 12936 35658 196 4312 11886
GADD 504 11046 15456 168 3682 5152
GADDP 672 11214 15624 224 3738 5208
GSUB 504 11046 15456 168 3682 5152
GSUBP 672 11214 15624 224 3738 5208
ADDB 420 2730 - 140 910 -
ADDBP 588 2898 - 196 966 -
DADDB 420 2856 - 140 952 -
DADDBP 588 3324 - 196 1108 -
SUBB 420 2730 - 140 910 -
SUBBP 588 2898 - 196 966 -
DSUBB 420 2856 - 140 952 -
BCD
Operation DSUBBP 588 3324 - 196 1108 -
Instruction MULB 420 8316 - 140 2772 -
MULBP 588 8394 - 196 2798 -
DMULB 420 18648 - 140 6216 -
DMULBP 588 18816 - 196 6272 -
DIVB 420 7224 - 140 2408 -
DIVBP 588 7392 - 196 2464 -
DDIVB 420 8736 - 140 2912 -
DDIVBP 588 8904 - 196 2968 -
Appendix 4-10
Appendix 4 Execution Speed of Instruction
Unit: ns
XGK-CPUS/E XGK-CPUH/A
Section Instruction
Non- Executed Executed Non- Executed Executed
executed N=1 N=8 or X executed N=1 N=8 or X
WAND 252 588 - 84 196 -
WANDP 420 756 - 140 252 -
DWAND 252 588 - 84 196 -
DWANDP 420 756 - 140 252 -
WOR 252 588 - 84 196 -
WORP 420 756 - 140 252 -
DWOR 252 588 - 84 196 -
DWORP 420 756 - 140 252 -
WXOR 252 588 - 84 196 -
WXORP 420 756 - 140 252 -
DWXOR 252 588 - 84 196 -
Logic DWXORP 420 756 - 140 252 -
Operation WXNR 252 672 - 84 224 -
WXNRP 420 840 - 140 280 -
DWXNR 252 672 - 84 224 -
DWXNRP 420 840 - 140 280 -
GWAND 504 11046 15456 168 3682 5152
GWANDP 672 11214 15624 224 3738 5208
GWOR 504 11046 15456 168 3682 5152
GWORP 672 11214 15624 224 3738 5208
GWXOR 504 11046 15456 168 3682 5152
GWXORP 672 11214 15624 224 3738 5208
GWXNR 504 11130 16128 168 3710 5376
GWXNRP 672 11298 16296 224 3766 5432
FALS 252 1344 - 84 448 -
DUTY - - - - - -
System WDT - - - - - -
Instruction WDTP - - - - - -
OUTOFF - - - - - -
STOP - - - - - -
BSUM 336 10836 - 112 3612 -
BSUMP 504 11004 - 168 3668 -
DBSUM 336 20496 - 112 6832 -
DBSUMP 504 20664 - 168 6888 -
BRST 420 6552 - 140 2184 -
BRSTP 588 6720 - 196 2240 -
ENCO 420 4284 15456 140 1428 5152
ENCOP 588 4452 15624 196 1484 5208
DECO 420 3444 10248 140 1148 3416
DECOP 588 3612 10416 196 1204 3472
Data DIS 420 5754 7896 140 1918 2632
Process DISP 588 5922 8064 196 1974 2688
Instruction UNI 420 6006 8148 140 2002 2716
UNIP 588 6174 8316 196 2058 2772
WTOB 420 8484 11676 140 2828 3892
WTOBP 588 8652 11844 196 2884 3948
BTOW 420 8400 12180 140 2800 4060
BTOWP 588 8568 12348 196 2856 4116
IORF - - - - - -
IORFP - - - - - -
SCH 504 6594 15120 168 2198 5040
SCHP 672 6762 15288 224 2254 5096
DSCH 504 6846 16548 168 2282 5516
DSHP 672 7014 16716 224 2338 5572
Appendix 4-11
Appendix 4. Execution Speed of Instruction
Unit: ns
XGK-CPUS/E XGK-CPUH/A
Section Instruction Non- Executed Executed Non- Executed Executed
executed N=1 N=8 or X executed N=1 N=8 or X
MAX 420 5208 9282 140 1736 3094
MAXP 588 5376 9450 196 1792 3150
DMAX 420 5628 10878 140 1876 3626
DMAXP 588 5796 11046 196 1932 3682
MIN 420 5292 9618 140 1764 3206
MINP 588 5460 9786 196 1820 3262
DMIN 420 5712 11214 140 1904 3738
DMINP 588 5880 11382 196 1960 3794
SUM 420 6006 9828 140 2002 3276
SUMP 588 6174 9996 196 2058 3332
DSUM 420 6468 11760 140 2156 3920
Data DSUMP 588 6636 11934 196 2212 3978
Process AVE 420 8736 14028 140 2912 4676
Instruction AVEP 588 8874 14196 196 2958 4732
DAVE 420 12600 23478 140 4200 7826
DAVEP 588 12768 23646 196 4256 7882
MUX 504 5376 - 168 1792 -
MUXP 672 5544 - 224 1848 -
DMUX 504 5628 - 168 1876 -
DMUXP 672 5796 - 224 1932 -
DETECT 504 5460 10248 168 1820 3416
DETECTP 672 5628 10416 224 1876 3472
RAMP - - - - - -
SORT - - - - - -
DSORT - - - - - -
Appendix 4-12
Appendix 4 Execution Speed of Instruction
Unit: ns
XGK-CPUS/E XGK-CPUH/A
Section Instruction Non- Executed Executed Non- Executed Executed
executed N=1 N=8 or X executed N=1 N=8 or X
FIWR - - - - - -
FIWRP - - - - - -
FIFRD - - - - - -
FIFRDP - - - - - -
Data
Table FILRD - - - - - -
Process FILRDP - - - - - -
Instruction FINS - - - - - -
FINSP - - - - - -
FIDEL - - - - - -
FIDELP - - - - - -
SEG 420 13188 23898 140 4396 7966
Display
SEGP 588 13356 24066 196 4452 8022
BINDA 336 15498 28938 112 5166 9646
BINDAP 504 15666 29106 168 5222 9702
DBINDA 336 25410 52290 112 8470 17430
DBINDAP 504 25578 52488 168 8526 17496
BINHA 336 8316 - 112 2772 -
BINHAP 504 8484 - 168 2828 -
DBINHA 336 12180 - 112 4060 -
DBINHAP 504 12336 - 168 4112 -
BCDDA 336 12096 - 112 4032 -
BCDDAP 504 12264 - 168 4088 -
DBCDDA 336 19824 - 112 6608 -
DBCDDAP 504 19992 - 168 6664 -
DABIN 336 6426 17346 112 2142 5782
DABINP 504 6594 17514 168 2198 5838
DDABIN 336 11172 3528 112 3724 1176
DDABINP 504 11340 3696 168 3780 1232
HABIN 336 11172 - 112 3724 -
HABINP 504 11340 - 168 3780 -
DHABIN 336 22512 - 112 7504 -
DHABINP 504 22680 - 168 7560 -
String DABCD 336 15456 - 112 5152 -
Process
DABCDP 504 15624 - 168 5208 -
Instruction
DDABCD 336 30324 - 112 10108 -
DDABCDP 504 30492 - 168 10164 -
LEN 336 2520 7812 112 840 2604
LENP 504 2688 7980 168 896 2660
STR 420 34314 - 140 11438 -
STRP 588 34482 - 196 11494 -
DSTR 420 69720 - 140 23240 -
DSTRP 588 69888 - 196 23296 -
VAL 420 28938 - 140 9646 -
VALP 588 29106 - 196 9702 -
DVAL 420 60690 - 140 20230 -
DVALP 588 60858 - 196 20286 -
RSTR 420 273630 - 140 91210 -
RSTRP 588 273798 - 196 91266 -
LSTR 420 292824 - 140 97608 -
LSTRP 588 292992 - 196 97664 -
STRR 336 1050000 - 112 350000 -
STRRP 504 1050000 - 168 350000 -
STRL 420 1050000 - 140 350000 -
STRLP 588 1050000 - 196 350000 -
Appendix 4-13
Appendix 4. Execution Speed of Instruction
Unit: ns
XGK-CPUS/E XGK-CPUH/A
Section Instruction Non- Executed Executed Non- Executed Executed
executed N=1 N=8 or X executed N=1 N=8 or X
ASCP 420 8232 23520 196 2800 7895
ASC 588 8400 23685 140 2744 7840
HEX 420 7098 20412 140 2366 6804
HEXP 588 7266 20580 196 2422 6860
RIGHT 420 18396 21630 140 6132 7210
RIGHTP 588 18594 21798 196 6198 7266
LEFT 420 17430 20664 140 5810 6888
LEFTP 588 17598 20832 196 5866 6944
MID 420 19026 22260 140 6342 7420
MIDP 588 19194 22428 196 6398 7476
String REPLACE 420 33348 - 140 11116 -
Process
Instruction REPLACEP 588 33516 - 196 11172 -
FIND 504 8904 - 168 2968 -
FINDP 672 9072 - 224 3024 -
RBCD 420 134820 - 140 44940 -
RBCDP 588 134988 - 196 44996 -
LBCD 420 153636 - 140 51212 -
LBCDP 588 153804 - 196 51268 -
BCDR 420 48972 - 140 16324 -
BCDRP 588 49140 - 196 16380 -
BCDL 420 80556 - 140 26852 -
BCDLP 588 80724 - 196 26908 -
Appendix 4-14
Appendix 4 Execution Speed of Instruction
Unit: ns
XGK-CPUS/E XGK-CPUH/A
Section Instruction Non- Executed Executed Non- Executed Executed
executed N=1 N=8 or X executed N=1 N=8 or X
SIN 420 75798 - 140 25266 -
SINP 588 75966 - 196 25322 -
COS 420 73710 - 140 24570 -
COSP 588 73878 - 196 24626 -
TAN 420 155988 - 140 51996 -
Special TANP 588 156156 - 196 52052 -
Function
Instruction RAD 420 13062 - 140 4354 -
RADP 588 13230 - 196 4410 -
DEG 420 13062 - 140 4354 -
DEGP 588 13230 - 196 4410 -
SQRT 420 6972 - 140 2324 -
SQRTP 588 7140 - 196 2380 -
LIMIT 504 1848 - 168 616 -
LIMITP 672 1986 - 224 662 -
DLIMIT 504 1932 - 168 644 -
DLIMITP 672 2100 - 224 700 -
DZONE 504 26796 - 168 8932 -
Data DZONEP 672 26964 - 224 8988 -
Control
Instruction DDZONE 504 25704 - 168 8568 -
DDZONEP 672 25872 - 224 8624 -
VZONE 504 27510 - 168 9170 -
VZONEP 672 27708 - 224 9236 -
DVZONE 504 26418 - 168 8806 -
DVZONEP 672 26586 - 224 8862 -
DATERD 252 5796 - 84 1932 -
DATERDP 420 5964 - 140 1988 -
DATEWR 252 5964 - 84 1988 -
DATEWRP 420 6132 - 140 2044 -
ADDCLK 420 8526 - 140 2842 -
Time ADDCLKP 588 8694 - 196 2898 -
related
Instruction SUBCLK 420 8610 - 140 2870 -
SUBCLKP 588 8778 - 196 2926 -
SECOND 336 6636 - 112 2212 -
SECONDP 504 6804 - 168 2268 -
HOUR 336 7098 - 112 2366 -
HOURP 504 7266 - 168 2422 -
Appendix 4-15
Appendix 4. Execution Speed of Instruction
Unit: ns
XGK-CPUS/E XGK-CPUH/A
Section Instruction Non- Executed Executed Non- Executed Executed
executed N=1 N=8 or X executed N=1 N=8 or X
JMP - - - - - -
LABEL - - - - - -
Diverge CALL - - - - - -
Instrution CALLP - - - - - -
SBRT - - - - - -
RET - - - - - -
FOR - - - - - -
Loop NEXT - - - - - -
BREAK - - - - - -
STC 168 168 - 56 56 -
Flag CLC 168 168 - 56 56 -
CLE 168 168 - 56 56 -
EI - - - - - -
Interrupt DI - - - - - -
Instruction EIN - - - - - -
DIN - - - - - -
NEG 252 420 - 84 140 -
NEGP 420 588 - 140 196 -
DNEG 252 462 - 84 154 -
DNEGP 420 630 - 140 210 -
RNEG 252 1596 - 84 532 -
Sign
RNEGP 420 1764 - 140 588 -
Reverse
Instruction LNEG 252 1932 - 84 644 -
LNEGP 420 2100 - 140 700 -
ABS 252 1428 - 84 476 -
ABSP 420 1596 - 140 532 -
DABS 252 1512 - 84 504 -
DABSP 420 1680 - 140 560 -
RSET - - - - - -
RCLR - - - - - -
File ZRCLR - - - - - -
related EMOV - - - - - -
Instruction EDMOV - - - - - -
EBREAD - - - - - -
EBWRITE - - - - - -
GET - - - - - -
GETP - - - - - -
PUT - - - - - -
Special
PUTP - - - - - -
Module
Instruction GETM - - - - - -
GETMP - - - - - -
PUTM - - - - - -
PUTMP - - - - - -
PIDRUN - - - - - -
PID PIDPRMT - - - - - -
Instruction PIDPAUSE - - - - - -
PIDSTOP - - - - - -
Appendix 4-16
Appendix 4 Execution Speed of Instruction
Unit: ns
XGK-CPUS/E XGK-CPUH/A
Section Instruction Non- Executed Executed Non- Executed Executed
executed N=1 N=8 or X executed N=1 N=8 or X
P2PSN - - - - - -
P2PWRD - - - - - -
Communi-
cation
P2PWWR - - - - - -
P2PBRD - - - - - -
P2PBWR - - - - - -
ORG - - - - - -
FLT - - - - - -
DST - - - - - -
IST - - - - - -
LIN - - - - - -
CIN - - - - - -
SST - - - - - -
VTP - - - - - -
PTV - - - - - -
STP - - - - - -
SKP - - - - - -
SSP - - - - - -
SSS - - - - - -
POR - - - - - -
SOR - - - - - -
PSO - - - - - -
NMV - - - - - -
INCH - - - - - -
Position RTP - - - - - -
Control
Instruction SNS - - - - - -
SRS - - - - - -
MOF - - - - - -
PRS - - - - - -
ZOE - - - - - -
ZOD - - - - - -
EPRS - - - - - -
TEA - - - - - -
TEAA - - - - - -
EMG - - - - - -
CLR - - - - - -
ECLR - - - - - -
PST - - - - - -
TBP - - - - - -
TEP - - - - - -
THP - - - - - -
TMP - - - - - -
TSP - - - - - -
TCP - - - - - -
Appendix 4-17
Warranty
1. Terms of warranty
LSIS provides an 18-month warranty starting from the date of production.
2. Range of warranty
For problems within the terms of the warranty, LSIS will replace the entire PLC or repair the defective parts free
of charge except for the following cases.
3. This warranty is limited to the PLC itself only. It is not valid for the whole system which the PLC is attached to.
LS values every single customers.
Quality and service come first at LSIS.
Always at your service, standing for our customers.
http://eng.lsis.biz
10310000510
■ HEAD OFFICE
■ LS Industrial Systems (Shanghai) Co., Ltd. >> China
LS tower, Hogye-dong, Dongan-gu, Anyang-si, Gyeonggi-do
Address: Room E-G, 12th Floor Huamin Empire Plaza,
1026-6, Korea http://eng.lsis.biz e-mail: [email protected]
No. 726, West Yan’an Road, Shanghai, China
Tel. (82-2)2034-4689, 4888 Fax.(82-2)2034-4648
Tel: 86-21-5237-9977
■ LS Industrial Systems Tokyo Office >> Japan
■ LS Industrial Systems(Wuxi) Co., Ltd. >> China
Address: 16F, Higashi-Kan, Akasaka Twin Towers 17- 22,
Address: 102-A National High & New Tech Industrial
2-chome, Akasaka, Minato-ku, Tokyo 107-8470, Japan
Development Area, Wuxi, Jiangsu, China e-mail: [email protected]
Tel: 81-3-3582-9128 Fax: 81-3-3582-2667
Tel: 86-510-534-6666 Fax: 86-510-522-4078
e-mail: [email protected]
■ LS Industrial Systems Beijing Office >> China
■ LS Industrial Systems Dubai Rep. Office >> UAE
Address: B-tower 17th Floor, Beijing Global Trade Center building,
Address: P.O.BOX-114216, API World Tower, 303B, Sheikh
No. 36, BeiSanHuanDong-Lu, DongCheng-District, Beijing, China
Zayed road, Dubai, UAE. e-mail: [email protected]
Tel: 86-10-5825-6025
Tel: 971-4-3328289 Fax: 971-4-3329444
■ LS Industrial Systems Guangzhou Office >> China
■ LS-VINA Industrial Systems Co., Ltd. >> Vietnam
Address: Room 1403, 14F, New Poly Tower, 2 Zhongshan Liu
Address: LSIS VINA Congty che tao may dien Viet-Hung
Rad, Guangzhou, China e-mail: [email protected]
Dong Anh Hanoi, Vietnam e-mail: [email protected]
Tel: 86-20-8326-6754 Fax: 86-20-8326-6287
Tel: 84-4-882-0222 Fax: 84-4-882-0220
■ LS Industrial Systems Chengdu Office >> China
■ LS Industrial Systems Hanoi Office >> Vietnam
Address: Room 2907, Zhong Yin B/D, No. 35, Renminzhong(2)-
Address: Room C21, 5th Floor, Horison Hotel, 40 Cat Linh,
Road, Chengdu, China e-mail: [email protected]
Hanoi, Vietnam
Tel: 86-28-8612-9151 Fax: 86-28-8612-9236
Tel: 84-4-736-6270/1 Fax: 84-4-736-6269
■ LS Industrial Systems Qingdao Office >> China
■ Dalian LS Industrial Systems co., Ltd, >> China
Address: 12th Floor, Guodong building, No52 Jindun Road,
Address: No. 15 Liaohexi 3 Road, economic and technical
Chengdu, China e-mail: [email protected]
development zone, Dalian, China e-mail: [email protected]
Tel: 86-532-580-2539 Fax: 86-532-583-3793
Tel: 86-411-8273-7777 Fax: 86-411-8730-7560