Академический Документы
Профессиональный Документы
Культура Документы
1
2
Table of Contents
Overview
This user manual describes the types and functions of the instructions used in the PLC NX plus series.
This manual is intended to allow the users to utilize the instructions easily which are used in the
programming software (WinGPC version 4.15.2 or later).
Features
NX plus Series support the users so that they can use the various functions effectively on a user
friendly environment.
User friendly configuration of the environment
- Support of the streamlined instruction system
- Change of an instruction is allowed during monitoring
- Support of various instructions e.g., selection of a sign, operation of real number, trigonometrical
function, etc.
- Access allowed depending on various communication methods
- Convenient self-diagnosis function
Note 1)
The instructions available for each product version may differ depending on the version of NX plus series, and even the same
instruction may have different functions, so they must be used after sufficient testing for each version.
Note 2)
The description of this manual focuses on the NX7 5.0 or later version and NX7R product.
9
CPU Performance
Note 4) For the WinGPC 4.14 or older version, D0 + area is displayed from W3072 area.
11
The status of the NX Plus CPU operation switch is divided into RUN / RMT (Remote) / PROG (Stop).
Each status provides different control functions and operation modes as follows.
Note)
- If the mode switch is in REMOTE, the operation mode is memorized upon power off → on.
- Upon debugging the user program, it is recommended to put the mode switch in REMOTE.
Note 1)
If an error occurs in a RUN mode as in the state ①, the operation mode is switched to STOP or PAUSE state automatically
depending on the error, and ERR lamp is lighted. If ERR occurs while running e.g., an operation error, however, the ERR lamp
is lighted and the state is changed to STOP; and then if CPU is stopped, the ERR lamp may be turned off.
Note 2)
As for the mode switching indicated by the state ②, the mode is changed to RMT when the error is released.
12
Note 3)
The mode switching indicated by Note 1) and Note 2) above also occurs even when the F0.15 contact which controls the RUN
CPU Initialization
When you unpack the CPU of the NX plus series for the first time, data of program might be remained
in the CPU. As they are the abnormal program or setting data which already existed in the CPU
when applying power after unpacking, they should be initialized to ensure normal operation.
So, before using the product, initialization should be done as follows:
1) Unpack the product and connect the battery for retention (not applicable to the mode without a
battery).
2) Make an online connection to PC.
3) From the "Online" menu, select "Initialize CPU" and clear the backup data and programs.
4) Download the program and start operation.
5) If you download a program and start operation without initialization, abnormal operation may occur
due to the remained setting data.
Program Diagnosis
When starting CPU operation after creating a PLC program, the program should be inspected in 3
stages as follows:
1) When creating a program with WinGPC, errors should be handled by identifying the instructions
supported by each CPU type.
2) After creating, saving and compiling the program, check if the error window shows whether the
program is normal or not.
3) After downloading a program to CPU, check if the error LEDs of CPU are working normally.
Every error should be corrected at each stage to proceed to the next stage.
For the errors found at the initial stage of instruction input, enter the CPU type and version to the
'CPU Selection' under the 'Projector' menu of the WinGPC, then you can use all the instructions
available for such CPU.
The parameters required for each instruction should be entered appropriately.
Secondly, the errors found at the compile stage occurs when the program is not completed in the
WinGPC or the program cannot be downloaded to the CPU due to program capacity exceeded,
duplicate use, abnormal instruction, etc.; and they can be corrected when a normal program is
completed in the WinGPC.
Thirdly, the LED for errors arising in CPU can be checked on the 'CPU Diagnosis' window of the
13
'Monitoring' menu of WinGPC, where you can identify the step number when an error occurred. If you
correct the error, normal operation is possible.
If the LED for CPU error flashes, it indicates not a program error but a disconnected battery or other
problems caused by external factors, that is, the program can operate normally.
.
14
Memory addressing is classified into R, L, M, K, F, TC, SV, PV, W, D, SR, etc. depending on its type.
Type Bit Contact Word Address Description
External I/O R000.00 - R000 - R127 - I/O area (2048 points, 128 words)
(R) R127.15 - The specified area differs per CPU type.
Keep contact K000.00 - K000 - K127 - Retentive internal auxiliary contact memory area
(F) K127.15 (differs per CPU type)
- 2048 points, 128 words
- Cleared 'Reset retentive area' is performed.
Special contact F000.00 - F000 - F015 - Special internal contact memory area
(F) F015.15 - 256 points, 16 words
Timer / Counter Channels= Set value= - 256 channels are used commonly (duplicate use
(TC, SV, PV) 0 - 255 SV0-SV255 not allowed)
- TC indicates “contact”.
Output Current value= - Set value = SV + Channel No., Present value = PV
contacts= PV0-PV255 + Channel No.
TC0-TC255 - Range of SV: 0 - 65535
Data word N/A W0000 - W2047 - Range of retentive area may differ per CPU type.
(W) - Bit addressing is not possible.
- Data are cleared if 'Reset retentive area' is
performed.
Expansion data D0000 - D2047 - Range differs per CPU type and F/W version.
word D0000 - D12799 - Bit addressing is not possible.
(D) - Data are cleared if 'Reset retentive area' is
performed.
- For WinGPC 4.13 or older version, display
available from W3072
Special word SR000 - SR511 - Area for CPU state, data settings, RTC, etc.
(SR) - Error state, diagnosis, special settings, etc.
- Special internal data area
- Bit addressing is not possible.
Note)
- Bit, word or double word addressing can be used separately for each instruction type.
- The word-only register (W, D, SR, SV, and PV) cannot be used for bit instruction.
15
Addressing Format
A bit address is composed of a character (R, L, M, K, F) that identifies its type, 3-digit decimal
number(000 to 127) that indicates a word, and a 2-digit decimal number(00 to 15) that indicates a bit.
The timer/counter contact is represented by the characters (TC) and channel number (000 to 255)
e.g., TC000.
A word address is composed of a character (R, L, M, K, F, W, SV, PV, and SR) and 3-digit (000 to
127) or 4-digit (0000 to 2047) decimal number that indicates a word. Special register SR000 to SR511
can be also represented as W2560 to W3071.
In case of R, L, M, K and F where both bit and word address can be used, care should be taken
because the bit or word address is used automatically depending on the instruction type.
A bit address indicates the state: ON (1) or OFF (0), and a word address is composed of 16 bits and
holds a data value from 0 to 65535. A double word address is composed of 32 bits and holds a data
value from 0 to 4,294,967,295. The version that can handle a negative (signed) number has the
positive number area from 1 to 32767, negative number area from -1 to -32768, and value 0. (See the
handling of negative numbers)
M123.12
Bit number: 2-digit; range from 00 to 15; increased by decimal increments
Point: Distinguishes word address from bit address; not applicable to word-only
instruction.
Word number: Increased from 0 to max. value by decimal increments. When used with a
bit number, 3 digits (000 to 127) are used. When used as a word-only
number, it is expressed in 4-5 digits. Point (.) and bit number cannot be
used.
Address type: Depending on the address type, one of R, L, M, K, F, SV, PV, TC, W, D and SR
is used.
An instruction determines whether to apply word or double word. (LET, INC, etc. applies word; and
DLET, DINC, etc. applies a double word). Double word addressing is the same as word addressing,
except that 32-bit data is referenced by the specified address and its next address.
16
With the parameter D or S, 1 word data (16 bits = 0 to 65535) are processed.
With the parameter D or S, 2-word data (32 bits = 0 to 4,294,967,295) are processed.
W0001 W0000
W0 is combination of W0 and W1; W0000 becomes LSB and W0001 becomes MSB. Likewise,
W0001 represents the combination of two words W0001 and W0002. Be careful because duplicate
use of the same word may cause problems.
W0000
W0001 W0000 The range of double word
W0001 instruction includes the upper
W0002
W0002 word area.
W0003
…
Absolute Addressing
The address system of PLC indicates the address used for programming with WinGPC etc. in PLC's
internal memory area. Apart from this system, an address is sequentially listed and specified to be
used for communication or by using special instructions. It is called the absolute addressing.
In this absolute addressing, the PLC memory is increased from 0000 to the end in physical order by
hexadecimal (decimal) number, and the absolute number matches 1-to-1 to the NX plus address
system as follows.
The range of D area address differs depending on CPU type and firmware version.
18
Signed
The basic instruction system of the NX plus supports the operation by a positive number (decimal);
but some types support or do not support the negative (-) sign processing depending on CPU type
and version.
The types which support the negative sign processing include NX7 V5.x or later version and NX7R.
To support the negative number processing by default, data should be specified in the internal special
area.
The data handled in the PLC are 16-bit or 32-bit integer values except for the floating point. These
values are divided into the values with a sign and values without a sign.
When expressing the integer value with a sign, the most significant bit (MSB) is used for the sign,
and the remaining bits are used for the value. The unsigned 16-bit integer can be between 0 and
65535 represented by 216, but the signed integer can be between 0 and 32767 represented by 215. If
the MSB is 1, the number has a sign and the range of the displayed value is - 32767 to 32767; and
the value 32768 (the value with sign '-' where data are all 0) is processed as -32768.
As the operation by the signed and unsigned integers produces different result respectively, a
different method of operation should be applied. Before processing, it should be specified first
whether the integer has a sign or not.
NX PLC has a separate flag to indicate it.
-F13.3: Sign processing contact (ON= -32768 to +32767, Off= 0 to 65535)
-F13.4: Max. / min. value limit (ON = keep the max (min) value when the max (min) value is exceeded,
Off= Cycling operation is done if max (min) value is exceeded (operation continues after flag
processing)
According to the setting for F13.03, the operation of integer is conducted with (On setting) or without
(Off setting) a sign. The factory default is 'Off'.
In case of overflow or underflow of integer data resulting from the operation, NX PLC handles it
differently depending on the F13.04 setting. If overflow (or underflow) occurs, Carry (F1.08) becomes
On; if F13.04 is Off, the lower value is saved as a result value and the higher value is saved in SR20
and SR21; but if F13.04 is On, +/-Max value is displayed as the result value. The factory default is
'Off'.
In case of a floating point operation, +/-Max is applied for the signed operation regardless of F13.03
and F13.04. In this case, the floating point value called INF is saved as +/-Max.
In case of operation for the add instruction ADD D=W0, S1=W1, S2=W2, the result is saved in
W1+W2=W0. If W1=65535(-1) and W2=32768(-32768), the output value (W0) is as follows:
19
Indirect Addressing
It is used when indirect address designation is adopted for programming in the instructions of NX plus.
A different address is specified depending on the data value of the address used in the instruction; it
is used for such instructions as LDR, DLDR, STO, DSTO, etc.; and the data for the absolute
addressing is also used for this purpose.
Format of Instruction
The basic formats of the instruction include the difference between a basic command and applied
instruction, and contact instruction and output instruction.
The basic instructions indicate the command and control conducted by most of sequence symbols;
and the applied instructions are required for the compact controls such as operation, move,
substitution, interrupt, block processing, etc.
The basic instructions and applied instructions are described below.
The contact instructions are used for the contact state at the front of a ladder or in the middle of
values for input state e.g., compare instruction; and the output instructions are positioned at the
output area of a ladder program to execute the operation per the input conditions.
20
Overview of WinGPC
WinGPC is used as the software for operation, programming and diagnosis of the PLC NX plus CPU;
and WinGPC 4.15 or later version supports the latest instructions for the NX system which is released
lately.
With WinGPC, a user can operate NX plus PLC easily and effectively, and construct an optimum
control system by swiftly responding to the various diagnosis functions, editing, monitoring, control
and setting changes, etc.
The PLC types supported by WinGPC V4.x include the NX series e.g., NX700plus, NX70plus and
NX7 series; and the obsolete product N700plus, N70 plus, and SPC series (SPC300, A200, SPC100,
SPC10, SPC24S, SPC120S, SPC10, etc.).
Operating WinGPC
Running WinGPC
After starting the WinGPC, a user can create a 'New Projector' on the main screen, or edit existing
one by clicking 'Open Projector'. For one WinGPC program, only one projector (program) can be
opened. To open multiple programs, multiple WinGPC programs need to be executed.
22
Programming Work
- Editing work e.g., copy, change, insert and delete can be done by moving the cursor. In case of
insertion, it is inserted behind the cursor.
- If it is not possible to use a desired instruction, you can use only the instructions available for the
CPU type and version identified on the 'CPU Selection' tab of the 'Projector' menu.
If you save and compile the completed program, a 'Message Window' is displayed to show the errors
in the program.
If there is no error, it is possible to download it to PLC; and if an error is found, it should be corrected
before downloading to PLC.
If compiling is completed after programming, it can be downloaded to PLC. Once it is sent to PLC, it is
possible to monitor the ladder program.
If CPU error is found while monitoring, the number of the step where the error occurred should be
located and corrected.
If the CPU and program operates normally, now it is possible to run the CPU.
24
25
Contact Instructions
Output Instructions
PLF Pulse Falling Out 1 Scan output when Arithmetic result fall
Output Instructions
Master block
MS Starts master block
Set
Master block
MR Ends master block
Reset
Timer Instructions
Mnemo Ladder
Name Description Remarks
nic Symbol
Time Base: Ch 0~63= 0.01s
Turns on after set delay time Ch 64~255= 0.1s
TIM Setting range: SV = 0~65535
from input on
On Delay Ch=00010
TIM Input
Contact indicator: TC + channel
SV=00050
Timer number
Output ←5 Sec→
27
Output ←5 Sec→
Counter Instructions
Mnemo Ladder
Name Description Remarks
nic Symbol
Channel range: Ch 0~255
UC Up Counter (Shared with
U Ch=020 Input
timer)
UC Up Counter SV=004 Current Setting
Value
Setting range: SV = 0~65535
Value
Shift SR Command
Mnemo Ladder
Name Description Remarks
nic Symbol
Usable address area of (Sb, Eb):
SR Shift Register M, K
I Sb=K1.4 Sb K1.4 I 1 bit shift on each p input.
Shift Register Eb=K2.5 . . Value
SR P . . Stores the status value I in Sb for
. .
. . every P input.
R .
Eb K2.5 Max. number of instructions: 256
29
Contact Instructions
Note 1)
Some (old) models are marked with ADN instructions instead of ANN instructions according to hand-held programmer (HHP)
type.
Contact A is turned on when its address is 1, while it is turned off (NO: Normal Open) when its status
is 0 that indicates no signal.
Contact B is turned on when its address is 0, while it is turned off (NC: Normal Close) when its status
is 0 that indicates no signal.
Contacts are divided into 'contact A‟ and „contact B‟, and Mnemonic instructions are divided into
series contacts (AND) and parallel contacts (OR) and distinguished as AND/ANN, OR/ORN etc.
Address can be designated only in bit address areas such as R, L, M, K, F, TC, etc.
When the contact A of R000.00 is ON, output M000.00 turns ON, while the contact is OFF, output
turns OFF.
As for the contact B, the output turns ON when R000.01 is OFF.
When the contact is ON, the output turns OFF.
When the R0.0 of the contact A is ON and R0.1 is ON (AND condition), the output is turned ON.
When the R000.02 of the contact B is OFF and R000.03 is OFF (AND NOT condition), the output is
turned ON.
R000.02 M000.05
/ (OUT)
ORN
R000.03
/
When either R0.0 or R0.1 of the contact A is ON (OR condition), the output (M0.4) turns ON.
The OR circuit is expressed as Y=A+B by using the Boolean log.
NAND (AND NOT) circuit refers to a circuit in which output MO.5 turns ON when either R0.2 or R0.3
The ladder is converted to the mnemonic program and then operates as the following order.
STR R000.00,
OR R000.01,
OUT M000.04
STN R000.02,
ORN R000.03,
OUT M000.05
NOR (OR NOT) circuit means like the left ladder. The output M0.4 and M0.5
becomes the same program.
XOR (exclusive logical sum) circuit refers to a circuit, for which the output is set to ON only when
either the input A or B is ON. It is expressed as
Interlock Circuit
R000.00 M001.01 M001.00
/ (OUT)
R000.01 M001.00 M001.01
/ (OUT)
An Interlock circuit restricts the other output from turning ON if either output X or Y is ON.
This is expressed as
32
Alternating Circuit
R000.00 M000.00
R (OUT)
M000.00 M001.00 M001.00
/ (OUT)
M000.00 M001.00
/
Alternating Circuit is the circuit in which output converts into ON and OFF alternatively as input
contact changes into ON and OFF. In other words, when the input turns ON and then OFF, the output
remains ON. To turn the output OFF, the input should be turned ON again.
Note 1)
In the example of the Alternating Circuit, the program is set to the following settings: Input is R0.0, output is M1.0, and inner
contact is M0.0.
Note 2)
The ladder mark of the input contact R means „rising edge‟ and the moment the input changes from OFF to ON, the
contact operates for only 1 scan. For more information, refer to the DIF instruction section.
33
Mnemonic No. of
Ladder Description Applicable Model
Instruction Words
1. An edge contact is the contact that is turned on for one scan when the value changes.
2. A rising edge (DIF) is the contact that is turned on for one scan when the contact changes
from OFF to ON. A falling edge (DFN) is the contact that is turned on for one scan when the
contact changes from ON to OFF.
3. Address designation can only be performed in the following bit addresses and can be used
while overlapping.
- Entire fields such as -NX-CPU700P, NX70-CPU70p2, NX70-CPU70p1 (Ver2.0 or later),
CPL9216A, CPL7215A = R, L, M, K, F, TC, etc.
- All of NX70-CPU70p1 (V1.x), CPL9215A = R, M0.0 to M63.15, F, and TC fields.
4. Multiple rising and falling edges may be used with one address.
5. Edge instructions operate in order like sequences. Therefore, if the output is changed when
the program runs, the edge activities before and after output may change.
34
Rising/Falling edge
Contact A
R000.00 M000.00
(OUT)
Rising edge
R000.00 M000.01
R (OUT)
Falling edge
R000.00 M000.02
F (OUT)
Edge contacts are also used in the same styles as contact A or B. Its mnemonic instructions depend
on the start circuit, series circuit, and parallel circuit. The example can be converted to the mnemonic
such as STR R00.00, OUT M00.00, STR DIF R00.00, OUT M00.01, STR DFN R00.00, OUT M00.02,
etc.
35
Mnemo
Name Ladder Symbol Word Description
nic
Note) this is available in CPU F/W version 5.x or later, and WinGPC 4.15 or later.
1. If ON is detected in the artithmetic result prior to instructions, the arithmetic result is turned
on for one scan. It will be OFF for the next scan.
2. -↑-(DF) is the contact that is turned on for one scan when the contact changes from OFF to
ON. -↓-(DN) is the contact that is turned on for one scan when the contact changes from ON
to OFF.
3. It is different with contact point edge instructions and does not designate an address. Edge
with a status of the arithmetic will be performed.
4. It is available in CPU F/W version 5.x or later, and WinGPC 4.15 or later.
5. It can be used like the contact point instructions in Ladder, cannot be placed at the beginning
of the Power Line.
Mnemonic No. of
Ladder Description Applicable Model
Instruction Words
1. The NOT instruction reverses the state prior to the instruction and does not designate an
address.
NOT Instruction
NOT reverses the prior operation results as well as the contact state and the series or parallel circuits.
The following two circuits have the same function. In other words, the closed contact and open
contact have opposite functions.
This function allows Sequence Circuit to convert into a Boolean Log. In other words, if the circuit that
is composed of an OR circuit (parallel) as shown below is converted, it becomes an AND circuit.
This way allows a complicated AND circuit to convert into an OR circuit to get the same result with
ease. Converting various interlock circuits into easy-to understand programs is also allowed.
38
Mnemonic No. of
Ladder Description Applicable Model
Instruction Words
Input R0.0
OUT output M0.0 is kept to be ON until input
Input R0.1 R0.0 contact is turned ON.
OUT
(M0.0)
SET SET output M0.1 is kept to be ON until RST
(M0.1) input R0.1 is turned ON.
The ladder program is converted to the mnemonic program such as STR R000.00, OUT M000.00,
SET M000.01, STR R000.01, and RST M000.01.
Here, the parallel circuits can repetitively use the output circuit.
The following magnetic retentive contacts can be used as SET and RST instructions.
Mnemo
Name Ladder Symbol Word Description
nic
Pulse Rising Output (PLS) Output On when rising edge for one scan
PLS 3
PLF Pulse Falling Output (PLF) Output On when falling edge for one scan
3
Note) this is available in CPU F/W version 5.x or later, and WinGPC 4.15 or later.
1. It can only be used in areas R, L, M, and K where they are used as contacts. The special
inner contact F can only be used partially for the output.
2. For the I/O address R, the address without an input module cannot be used for output.
3. This is multiplying addresses, and the result can be different according to steps.
4. This is available in CPU F/W version 5.x or later, and WinGPC 4.15 or later.
Input R0.0
Input R0.1
ALT Output
(M01.0)
Scan Cycle
PLS Output
(M01.1)
PLF Output
(M01.2)
41
Mnemonic No. of
Ladder Description Applicable Model
Instruction Words
1. ANB (AND Block) is a series connection of more than two blocks and ORB (OR Block) is a
parallel connection of more than two circuit blocks.
2. These three instructions do not designate addresses and are only used as instructions.
3. Up to 16 buffers (stack) that are composed of blocks are available and its type depends on
the CPU.
ANB Instructions
A Block B Block
R000.00 R000.02 M000.00
(OUT)
R000.01 R000.03
ANB
ANB connects block A and B with a series AND condition. When both A and B blocks are ON, output
turns ON.
ORB Instructions
42
A Block
R000.00 R000.01 M000.01
(OUT)
B Block
R000.02 R000.03
ORB connects A and B blocks in parallel with an OR condition. When one of the blocks is connected,
the output turns ON.
Mnemonic No. of
Ladder Description Applicable Model
Instruction Words
All Models
MCS Starts circuit branch. 1
(Note 2)
All Models
MCR Ends circuit branch. 1
(Note 2)
Note 1)
MS and MR instructions operate in the CPU F/W version 2.x or later, and WinGPC version 3.70 or later.
In the WinGPC version 3.70 or later and PLC V2.0 or later, the MCS and MCR instructions are upgraded to circuit format.
Note 2)
These instructions operate as output MS and MR in the WinGPC version 3.70 or later, are converted to a circuit format in the
WinGPC version 3.6 or earlier, and are all expressed as output in the versions 2.xx or earlier.
1. The output MS and MR inscrutions are not given a separate address. They are only used as
instructions and operate as master block bit.
2. The MS and MR must be composed in pairs. As up to 16 of nesting (repetitive use within MS
field) can be allowed, any excessive use of this nesting can be cause overflow. This max.
number varies on the CPU type.
3. The MCS, and MCR used in the CPU are expressed as circuit branch in WinGPC3.0 or later
and can see in Mnemonic. These instructions are expressed as MCS and MCR, respective,
in the WinGPC V2.xx or earlier.
4. Instructions need its preceding instruction and cannot be directly connected to the ROOT
while the MR does not need its preceding instruction and can be directly connected to the
Root.
5. The MCS and MCR instructions can be used as circuit branch in the WinGPC V3.70 or later,
can see in Mnemonic.
44
<Figure 1>
(CPU V1.3~, WinGPC 3.5~or later)
R000.00
(MS )
R000.01 R000.02 M000.00
(OUT)
R000.03 M000.01
MCS
/ (OUT)
MCR
(MR )
When the R0.0 contact of the MCS condition and the contact of the MCS and MCR block are ON, the
output turns ON.
In other words, if R0.0, R0.1, R0.2 is ON, output M0.0 is ON. If R0.0= ON, R0.1= ON, R0.3= OFF,
M0.1 is ON. When R0.0 is OFF, all output is OFF.
<Figure 2> WinGPC2.x version <Figure 3>Example of Conversion <Figure 4>Example of conversion (WinGPC3.7x)
R000.00 (WinGPC3.1x)
R001.00
(MCS) R000.00 R000.01 M000.00
(OUT) (MS )
R000.01 M000.00 R000.00 R000.01 M000.00
(OUT) MCS R000.02 M000.01 (OUT)
R000.02 M000.01 exi st en ce / (OUT) MCS R000.02 M000.01
/ (OUT) / (OUT)
MCR exi st en ce
exi st en ce
MCR exi st en ce
(MCR) (MR )
1. In the WinGPC V2.x, the MCS and MCR functions can be expressed and used as shown in
<Figure 1> and <Figure 2>. <Figure 3> is the expression in the WinGPC3.6 version or earlier,
<Figure 4> is the expression in the WinGPC3.7 or late, and the MS and MR did not operate
in the version WinGPC 3.7 or earlier.
2. When programming with a ladder, do not use MCS/MCR instructions. These instructions are
automatically included in the programs operating in the CPU. When uploading the program
from the CPU, the original MCS/MCR instructions formats may be changed.
3. When compiling the ladder program in the PC and transmitting it to the PLC, the original
instructions formats are kept. However, when uploading the program from the PLC and then
decompiling it to the ladder, the instructions formats depend on the WinGPC version, as
shown in Figures 2, 3, and 4.
If you save the sample programming in the WinGPC V3.1x or earlier shown in <Figure 2> to
the PLC and then upload it in the WinGPC V3.x or later, it will be expressed as <Figure 3>.
45
When uploading it in the WinGPC V2.x or earlier, it will be always expressed as <Figure 2>.
4. The programming in the WinGPC V3.7x, such as that illustrated in <Figure 1>, does not
operate in the CPU versions V1.2x or earlier and operates normally in the PLC V2.0x or later.
In the previous versions such as PLC V1.2x or earlier, the programming like <Figure 3> will
operate normally.
5. In the WinGPC V3.7 or later, it has been modified to go into MCS/MCR, and MS/MR
instructions automatically, regardless of ROM version of CPU.
The ladder program is converted to the mnemonic program as the following examples:
For WinGPC, it is converted to STR R0.0, MCS, STR R0.1, OUT M0.0, STN R0.2, OUT M0.1, MCR,
etc.
For WINGPC V3.5.x or later and CUP version 2.0x or later, additional MS and MR instructions can be
used, however, cannot be saved in the previous version.
46
The address of the timer and counter instructions in NX plus series are compsed as follow.
1. The timer and counter can be used up to 256.
2. The timer and counter shared a common channel number and designate numbers between 0 and
255 in random order. The channel number cannot be duplicated.
3. When you use the timer, the time base is automatically calculated in 10mSec (0.01 sec) modules
according to the channel number. It depends on CPU model.
CPU Model 0.01 Sec Time Base 0.1 Sec Time Base
NX7, NX7s, NX7R, NX70p, NX700p,
Channel 0 ~ 63 Channel 64 ~ 255
N700p,N70p, SPC300, A200,
SPC (Except SPC300), Channel 0 ~ 15 Channel 16 ~ 255
4. The setting value (SV) or process value (PV) is 16 bits and can be designated between 0 and
65,535.
5. The output contact address of the timer or counter is designated by “TC + channel number”.
Note)
The program (PGM10 and PGM300A, etc) which can not input TC contact point is designated by “TIM+channel number”.
6. If you use process value as count, the PV, the PV can be retained before power is removed. If you
use process value as timer, the PV cannot be retained before power is removed and initialized.
Note 1)
In case that the PV cannot be retained before power is removed when you use PV as counter:
CPU Model Able to retain the power Not able to retain the power
NX7s-10xxx, NX7s-14xxx Channel 0 ~ 127 Channel 128~255
SPC10/24S/120S/100 Channel 0 ~ 15 Channel 16 ~ 255
Others Whole area(Ch 0~255) None
Note 2)
In case that the PV can be retained before power is removed when you use the PV as timer:
It can be retained before power is removed by using Timer RTM instruction (Retentive On-delay timer).
47
7. PV of Timer such as TIM and SST, etc is increased when it is on, and is stop when it reaches max.
set value (65535). If input option is off, the PV will be initialized.
TIM, TOF, and SST instructions of Timer consists 1 input option and have channel number and
setting variables.
UC, DC, and RCT instruction of counter and RTM instruction of timer consist two input options, have
channel number and setting variables.
UDC instruction of counter consists of three input options and has channel number and setting
variables.
48
ON/OFF/SST Timer
Mnemonic No. of
Ladder Description Applicable Model
Instruction Words
Note 1)
NX700
N70 Plus NX70 Plus N/NX700 Plus
SPC100 Plus
Model SPC-10 SPC300 A200 9215A, CPU70p1/v2 7215A,
24S/120S CPU700p/
9216A CPU70p2/V2 CPU700p
V2
Support x x x o o o o o
1. There are 3 types of timer functions and up to 256 timers can be used jointly with the counter.
2. The timer and counter shared a common channel number and designate numbers between
0 and 255 in random order. The channel number cannot be duplicated.
3. When you use the timer and designate the channel number between 0 and 63, the time base
is automatically calculated in 10mSec (0.01 sec) modules. When the channel number is
designated between 64 and 255, the time base is calculated in 100mSec (0.1 sec) modules
(Refer to separate reference for SPC model).
4. The setting value (SV) is 16 bits and can be designated between 0 and 65,535.
5. The output contact address of the timer or counter is designated by “TC + channel number”.
6. If you use the timer for each channel, the PV cannot be retained before power is removed. If
49
you use the counter for each channel, the PV can be retained before power is removed
(Refer to separate reference for SPC and NX7s).
7. When you use the timer where the PV increases, such as TIM and SST etc, the PV comes to
the maximum value of 65535 even after the setting value is passed and output is turned on.
When the input condition is OFF, the PV is reset.
8. When you use the timer where the PV decreases, such as TOF, the PV decreases when the
timer is operating. When the PV is 0, the output is ON and the PV stops.
9. TIM is an ON delay timer that operates after the input is ON and the output turns ON after
the specified time.
10. TOF is an OFF delay timer that operates when the input is OFF and the output turns OFF
after the specified time.
11. SST is a timer that begins operation at the same time input is ON and output turns OFF after
the specified time.
50
ON Timer – TIM
R000.00 TI M
Ch=0 <Time Chart>
SV=300
Input
TC000 M000.00
(OUT) Output ←3 Sec→
When the timer input condition is ON, the timer‟s PV increases. When it exceeds the setting value, the
output contact turns ON.
When the input is OFF, the timer‟s PV is reset and output turns OFF.
When the timer input condition is ON, the timer‟s output turns ON. When the input is OFF, the PV
decreases. When the input is 0, the output contact turns OFF.
When the input contact is ON, the timer‟s output turns ON at the same time. From the moment the
input is OFF, the SST timer operates, and exceeds the setting value. When the PV and setting value
is same, the output contact turns OFF.
When the timer input condition is ON, the output turns ON. When the timer‟s PV exceeds the set
value, the output turns OFF.
If the input is OFF before the PV exceeds the set value, the output turns OFF.
52
When the input is ON, the flicker circuit turns on and off, respectively, for 3 seconds in turn (Flicker
circuit).
The flicker frequency can be controlled by adjusting the SV value of the timer.
This circuit uses the timer and alternating circuit.
When input is on, the flicker circuit turns on and off, respectively, for 3 seconds in turn.
R000.00 SST
Ch=10 <Time Chart>
SV=30
TC010 Input
1. While the timer‟s input conditions are operating, the PV increases to its maximum value.
Therefore, the comparison instruction allows the timer‟s PV to be set to build a program for
each level and configure an effective circuit.
2. If the input conditions stop, all outputs pause.
54
Mnemo
Name Ladder Symbol Word Description
nic
RTM
Retentive On-delay T CH=
RTM timer Retentive On-delay timer
R SV= 3
Note)
RTM timer is available in CPU F/W version 5.x or later, and WinGPC 4.15 or later.
1. This timer keeps PV and arithmetic result when the power is off.
2. The timer designates channel numbers between 0 and 255 in random order. From 0 to 63,
the Time Base is calculated in 10mSec (0.01 sec), and from 64 to 255, the Time Base is
calculated in 100mSec (0.1 sec).
3. When you use the timer, the time base is automatically calculated in 10mSec (0.01 sec)
modules according to the channel number. It depends on CPU model.
4. 16 bits (0 to 65,535) can be assigned for the set value (SV).
5. The output contact address of the timer is designated by “TC + channel number.”
6. The PV increases up to Max. SV (65535). If input option is off, it keeps the SV.
7. If R input (Reset) is on, the PV will be initialized.
8. This is On delay timer that operates after the input is ON and the output turns ON after the
specified time.
R000.00 RTM
T Ch=0
R000.01 SV=300
R
TC000 M000.00
(OUT)
If timer input option is on, the PV is increased. The output contact point will be on when the PV is
passed the SV.
Result and the PV can be retained before power is removed.
If input of R0.1 is on, the PV will be initialized and output off.
55
T Input (R0.0)
R Input (R0.1)
TC Output (M0.0)
Up/Down Counter
Mnemonic No. of
Ladder Description Applicable Model
Instruction Words
UC Input
U Ch=020 Current
Value
Set Value
SV=004
UC Up Counter Output 3 All models
Reset
R
DC Input
Current Set Value
D Ch=021 Down Value
SV=005
DC Output 3 All models
R Counter Reset
1. There are four types of counters, such as UC, DC, RCT, and UDC. Up to 256 counters can
be used jointly with timers.
2. The timer and counter share a common channel number and designate numbers between 0
and 255 in random order. The channel number cannot be duplicated.
3. 16 bits (0 to 65,535) can be assigned for the set value (SV). The output contact address of
the D timer or counter is designated by “TC + channel number.”
4. If the counter is used for each channel, the PV value can be retained before power is
removed.
5. When the rising counter input contact changes from OFF to ON, the value increases by 1
until 65,535. The highest value is retained regardless of input.
6. If the reset inputs of all counters are ON, it will not be affected and be reset.
Up Counter
R000.00 UC Input (R0.0)
U Ch=20 Reset (R0.1)
SV=4
R000.01 5
Present Value 3
4 Set Value
R 2
(PV20)
TC020 M000.00 1
(OUT) Output (TC20)
In the up counter, the present value increases by 1 whenever the input is ON. When it reaches the set
value, the output contact goes ON. When the reset input is ON, it resets to 0.
57
Down Counter
Input (R0.0)
R000.00 DC
D Ch=21 Reset (R0.1)
SV=5
R000.01 Present Value 5 4
3
5 Set
(PV21) 2 Value
R 1
TC021 M000.01 0
Output (TC21)
(OUT)
In the down counter, the present value decreases by 1 whenever the input is ON. When it is 0, the
output contact is ON. When the reset input is ON, the output stops and the present value is set to a
set value.
58
Mnemonic No. of
Ladder Description Applicable Model
Instruction Words
RCT Input
T Ch=022 Current
Value
Set
Value
SV=004
RCT Ring Counter Output 3 Note 1
R Reset
UDC U Input
D Input
U Ch=023
SV=003 UP/Down Current
Value
Set Value
UDC D
Output
3 All models
Counter
R Reset
Note 1)
Applicable Model: A200, N70+ (CPL9215A/9216A), N700+ (CPL7215A), NX70+ (CPU70P1/P2), NX700+ (CPU700P)
1. There are four types of counters: UC, DC, RCT, and UDC. Up to 256 counters can be jointly
used with the timer.
2. The timer and counter share a common channel number and designate numbers between 0
and 255 in random order. The channel number cannot be duplicated.
3. 16 bits (0 to 65,535) can be assigned for the set value (SV). The output contact address of
the D timer or counter is designated by “TC + channel number.”
4. If the counter is used for each channel, the PV value can be retained before power is
removed.
5. Whenever the RCT (Ring Counter) input contact changes from OFF to ON, the counter
moves to 1 from 0. When the counter reaches the set value, it changes to 0 and output is ON.
It increases again with the next input and repeats the counter value.
6. In the UDC (Up/Down Counter) increases by 1 when the up input (U) condition changes from
OFF to ON, and decreases by 1 until 0 when the down input (D) condition changes from
OFF to ON. When the present value is larger than the set value or 0, the output turns ON.
When the reset input is ON, the output turns OFF and the PV becomes 0. (But, the Down
Counter in SPC series decrease from 0 to minus (-)).
7. If the reset inputs of all counters are ON, it will not be affected and be reset.
59
Ring Counter
Input (R0.0)
R000.00 RCT
T Ch=22 Reset (R0.1)
In the ring counter, the present value cycles based on the set value. When the present value is 0, the
output turns ON. When the reset input is ON, the value changes to 0, and the output goes OFF.
UP-Down Counter
R000.00 UDC
U Ch=23 U Input (R0.0)
R000.01 SV=3 D Input (R0.1)
Reset (R0.1)
D
R000.02 Preset Value Set Value
R (PV22)
TC023 M000.00 0 12 3 4 3 2 1 2 3 2 1 0 0 1 0
(OUT) Output (TC22)
With UDC instruction, the U input goes up and the D input goes down. The output goes on when the
present value exceeds the set value or becomes 0.
60
Shit SR Instructions
Mnemonic No. of
Ladder Description Applicable Model
Instruction Words
SR
Sb K1.4 I
I Sb=K1.4 . .
Set
Eb=K2.5 . .
. . Value
SR P Shift Register . . 4 Note 1
.
R Eb K2.5
Note 1)
1. Up to 256 SR instructions are allowed and the number of used instructions is automatically
checked.
2. The address may be used in the same type M or K areas. The designated bit range is from 2
to 1024.
3. The address of Sb or Eb indicates the shift direction. The address can be duplicated. The
address can be designated in the opposite direction, if Sb is lower than Eb. If Sb is lower
than Eb, the register will shift towards higher bits. If Sb is greater than Eb, it will shift towards
lower bits.
4. Input I‟ determines the data value of the start address (Sb). Each time „Input P‟ is on, the
entire data shifts from Sb to Eb by one module.
5. When the reset input is on, the data is reset to 0.
61
I Input (R0.0) 1 1 0 1 0 1 0
R000.00 SR
I Sb=K1.4 P Input (R0.1)
R000.01 Eb=K2.3 Reset (R0.1)
P
R000.02 Start Contact (Sb)(K1.4) 0 1 1 0 1 0 1 0
R
K001.04 M001.00
Contact Sb+1 (K1.5) 0 0 1 1 0 1 0 0
(OUT) Contact Sb+2 (K1.6) 0 0 0 1 1 0 1 0
K001.05 M001.01
Contact Sb+3 (K1.7) 0 0 0 0 1 1 0 0
(OUT)
K001.10 M001.02 Contact Sb+4 (K1.8) 0 0 0 0 0 1 1 0
(OUT) : 0 0 0 0 0 0 : 0
K002.03 M001.03
(OUT) End Contact (Eb) (K2.5) 0 0 0 0 0 0 0 0
2. When the P input (pulse shift instruction) is on while „I Input‟ (Input Data) is on, the data value 1 is
stored in Sb. All bit values of the area shift by one bit from Sb to Eb.
3. When the second P input is on, I Input data (on) is stored in Sb and the existing Sb value shifts to
Sb+1 bit.
4. The data will retain its value until P input is on. When the input is on, the shift actions repeat, and
the final bit (Eb) value overflows. When the reset input is on, all data will be reset to 0.
62
1. 8 bit address can be assigned for SPC-120/24 model, while 16 bit address can be assigned for NX
plaus.
2. Responed addresses are as below.
NX PLC supports SFC in a ladder format. The components of SFC includes step and transition; the
there are branch and join for flow control. The branch / join are divided into selection branch / join and
selection branch / join.
The step controller instructions of the NX PLC are structured so that they can express the
components of various types like these.
START
Step
Step a Step d
Step b
Step e Step f
Step c
Step g
Step h
The SFC program is a graphic language, and NX supports SFC programming in Ladder language.
Therefore, the graphic program of the SFC can be programmed in a ladder language using several
rules.
A box indicates a step, and the "double box" in the figure indicates the initial step. If a step is activated,
its routine is activated. The output of the routine activated during program scan is operated per
conditions. The ladder expression indicating the initial step is ISTP. ISTP should be in front of a SFC
block program, and it should be activated by the ladder logic.
SSTP is a preceding instruction which leads a rung, and it should be programmed in the form of an
input contact. The actions of the step is combined with the preceding SSTP by AND logic. So, if the
64
step is activated, the relevant actions are outputted per the conditions.
There are 3 types of transitions: single branch, parallel branch and selection branch. The independent
branch means that the number of next steps to be transited is one; and the parallel branch means that
it is divided into multiple steps after transition and all the divided steps are activated simultaneously.
The selection branch means that one step is selected from the branched steps after transition and
activated. Join means that, after the parallel branch or selection branch, the flows are combined into a
single step. It is divided into the parallel branch join and selection branch join.
In addition, there are block initialization and step initialization which initializes the state.
For all branches, the NSTP instruction is used. In the preceding end of this instruction, SSTP should
be specified as an input condition. NSTP instruction should also be used for the parallel branch; and it
should be prepared as many as the number of the parallel branches consecutively.
The step number 0-15 is allocated to the initial step. Therefore, a ladder program can have 16 SFC
blocks.
In the step controller program, SET/RESET instruction should not be used. As the bit state is
maintained even in an inactive step, it can violate the SFC protocol, resulting in the unexpected
control.
In the step controller, duplicate output is possible, but duplicate use within a single step rung should
be avoided. It may result in the unexpected control.
If a general program is mixed into between the step controller programs, it may result in the
unexpected control value or state; so it should be avoided.
The steps with number 2048-4095 should be retained.
Within the step controller program, other block processing instructions e.g., FOR, DFOR, NEXT, JMP,
LBL, JMPS, JMPE, INT, and RETI should not be used as it may result in abnormal processing of
instruction. Care should be taken when using the subroutine instruction CALL, SBR and RET because
it may result in unexpected control depending on the condition.
65
Mnemo No. of
Name Ladder Symbol Description
nic Words
ISTP
ISTP Step Initializing Step= 2 Activate start step(Step0~15)
Mnemonic No. of
Ladder Description Applicable Model
Instruction Words
INC
Binary increment (decimal increment)
INC D= 2 All models
One word
DINC
Binary increment (decimal increment)
DINC D= 2 All models
Double word
The increment instruction operates for one scan when the M1.0 contact is ON. Each instruction has a
69
M10 and M11 indicate the difference between when the input condition is the contact or when it is an
edge instruction.
As the F1.4 contact is ON for 0.5 seconds and OFF for 0.5 seconds, the M10 word in the Contact A
condition increases by 1 for each scan and M11 word of the edge instruction condition increases by 1
every second.
70
Mnemonic No. of
Ladder Description Applicable Model
Instruction Words
INCB
INCB D= BCD increment – One word 2 All models
DINCB
DINCB D= BCD increment - Double word 2 All models
The increment instruction operates for one scan when the M1.0 contact is ON. Each instruction has a
71
M10 and M11 indicate the difference between when the input condition is the contact or when it is an
edge instruction.
As the F1.4 contact is ON for 0.5 seconds and OFF for 0.5 seconds, the M10 word in the Contact A
condition increases by 1 for each scan and M11 word of the edge instruction condition increases by 1
every second.
What is BCD?
BCD stands for „Binary Coded Decimal‟. It is a code method that expresses decimals using 4 bits.
For example, the number 23 is 0010 0011 in BCD, and it is $32 in HEX.
The number 57 is 0101 0111 in BCD and $57 in HEX, and 87 in DEC.
The BCD value of words ranges from 0 to $9999 (39,321 in decimal) and that of double word ranges
Decrease Instructions
Mnemonic No. of
Ladder Description Applicable Model
Instruction Words
DEC
Binary decrement (decimal decrement)
DEC D= 2 All models
One word
DDEC
Binary decrement (decimal decrement)
DDEC D= 2 All models
Double word
DECB
DECB D= BCD decrement – One word 2 All models
DDECB
DDECB D= BCD decrement - Double word 2 All models
1. The decrement instructions decrease the D value address by 1.There are two types of
decrement instructions: Binary decrement and BCD decrement instructions.
2. Binary decreases in bit, and BCD decreases in four bits that are composed of BCD numbers.
This value is the same as the one from which the hexadecimal value of A through F have
been excluded.
3. Word (double word) address for R, L, M, K, W, SV, PV, and SR, etc can be assigned for the
D area. 16 bits (65.535) of words can be input in the Word instruction and 32 bits
(4,294,967,295) of words can be input in the Double Word instruction.
4. If the value decreases, starting at 0, the overflow will cause the value to decrease by 1,
starting at the maximum value.
5. The increment instruction can normally operate under the same condition of the contacts,
and cannot be directly connected at the root. When it increases like counter functions, the
input contact must be used as an edge contact.
73
M000.00 LET
D=W 100
S=100
LET
D=W 101
S=$100
F001.04 DEC
R D=W 100
DECB
D=W 101
M001.00 DDEC
R D=W 105
D=W 107
If M0.0 contact is ON, 100 will be stored into W100 and W101.
If the F1.4 contact is ON every second, the decrement instructions operate. Each instruction has a
different function.
DEC instruction decreases by 1 word in binary unit, and DECB instruction decreases within 1 word in
BCD unit.
W105 and W107 word from DDEC and DDECB instructions decrease by one word from the maximum
of its initial condition „O‟. DDEC instruction decreases by two words or less in binary, and DDECB
instruction decreases by two words or less in BCD unit.
74
Mnemo
Name Ladder Symbol Word Description
nic
1. Word (double word) addresses such as R, L, M, K, W, D, SR, and D, etc can be assigned for
the D area.
2. If the value decreases, starting at 0, the overflow will cause the value to decrease by 1,
starting at the maximum value. If the increased value exceeds the maximum or minimum, the
overflow will cause the value to be 0 and to begin counting again.
3. Instructions can normally operate under the same condition of the contacts, andcannot be
directly connected at the root.
4. When you operate it based on the specified input condition, the input contact must be used
as an edge contact.
Mnemonic No. of
Ladder Description Applicable Model
Instruction Words
word value)
1. The substitution instructions directly input the S value in the address D or substitute
(transmit) the value of another double word address.
2. Double word addresses such as R, L, M, K, W, SV, PV, and SR, etc can be assigned for the
D area in the substitution instructions. The word address or 16 bits (65,535) can be input to
the S area in the LET, and the word address or 32 bits (4,294,967,295) can be input to the S
area in the DLET.
3. The substitution instruction can normally operate under the same condition of the contacts,
and cannot be directly connected at the root. If it needs to be run at all times, uses the F0.15
address (always ON during operations) as „Contact A‟.
76
F001.00 LET
D=W 100
S=123
DLET
D=W 102
S=80000
F000.15 LET
D=W 110
S=W 100
M000.00 DLET
R D=W 112
S=W 102
>= M001.00
A=W 110 (OUT)
B=50
D>= M001.01
A=W 112 (OUT)
B=70000
The F1.0 contact is the signal that is on for one scan. The PLC inputs (sends) data value 123 from the
first operated scan to W100 word. Substitute (send) the data value 80000 from the first operated scan
to W102.
The S value of W100 is stored into the D value of W110 for every scan operated in the PLC. When
the contact M0.0 is on, substitute (send) W102 for W112.
Note)
Since the DLET instruction sends the value in double word module, it can substitute the values of W102, W103 for W112,
W113.
If the W110 word is greater than 50, M001.00 is set to ON. If the W112 double word is greater than 70000, M001.01 set to ON.
F001.00 LET
D=W 120
S=20
LET
D=W 122
S=$20
== M001.00
A=W 120 (OUT)
B=20
== M001.01
A=W 120 (OUT)
B=$20
== M001.02
A=W 122 (OUT)
B=$20
== M001.03
A=W 122 (OUT)
B=32
The PLC inputs (sends) data value 20 (decimal) from the first operated scan to W120 word and data
value $20 (hex) from the scan to W122. ($ before the value indicates a hex.)
77
Mnemo
Name Ladder Symbol Word Description
nic
floating point
FLET
FLET Substitute D=
5 Store S value into D.
S=
Instruction
1. FLET copies floating point value of S or specifies a constant value of the floating-point to D
address.
2. Word (double word) addresses such as R, L, M, K, W, and D can be assigned for the D and
S area. A constant value of the floating-point can be assigened for S area.
3. Double word addresses can be assigned for D and S address automatically.
4. If a constant value is assigned to S, 2 words are assigned and then it becomes 5 words.
M00.00
FLET
D= M20
S= 3.4
FLET
D= M22
S= M20
Mnemo
Name Ladder Symbol Word Description
nic
MLET
D= Store multiple word data to multiple
Multiple Word N=
MLET S1= 9 registers. Store N data from D by
Data assignment … between S1 and S6
S6=
DMLET
Multiple Double D= Store multiple double word data to
N=
DMLET Word S1= 15 multiple registers. Store N date from
… D by using between S1and S6.
S6=
Data assignment
FMLET
Multiple Floating D= Store multiple floating point data to
N=
FMLET Point S1= 16 multiple storeage. Store N data from
… D by using between S1 and S6.
S6=
Data assignment
1. This instrunction stores multiple data from a register repeatly and automatically. Use this to
input TABLE typed.
2. MLET is instruction for word, while DMLET is for doble word. FMLET is for floting point data.
3. Double word addresses such as R, L, M, K, W, D, SV, PV, SR, and D, etc can be assigned
for the D area. The word address or 16 bits can be input to the S area in the MLET, and the
word address or 32 bits can be input to the S area in the DMLET. The Floating point data
can be input in the FMLET.
4. Only numbers betweer 1 and 6 can be input to N.
5. Regardless of N, same numbers of words are assigned. (MLET=9 word, DMLET=15 word,
FMLET=16 word)
F001.0 MLET
D=W 100
N=6
S1=2456
S2=6378
S3=8012
S4=7691
S5=1920
S6=3101
80
F1.0 contact is be set to ON for one scan when the CPU initially operates. And then data from S1 to
S6 will be entered into from W100 to W102.
W100 2456
W101 6378
W102 8012
W103 7691
W104 1920
W105 3101
Error Handling
Bigger data specified word in the N (size) is not entered. That is, if N=3, values from S1 to S3 are
input, values from S4 to S6 are ignored.
In case of Float instruction, if the input data is not Float typed value, INF value can be assigned. If
source value from S1 to S6 is not used, some value must be input.
For negative values when using MLET and DMLET does not distinguish. (F13.03 is independent)
DMLET instruction assigns double word to each operand. That is, followings are stored to each area.
S1=123456=W200, W201 area
S2=800 =W202, W203 are
S3=$50000 = W204, W205 area.
FMLET instruction assigns real number to each operand. (Refer to Floating Point)
81
Mnemonic No. of
Ladder Description Applicable Model
Instruction Words
ABS
ABS D= Absolute value operation (D = |D|) (word) 2 All models
DABS
Absolute value operation (D = |D|) (double
DABS D= 2 All models
word)
F ABS
D = |D|
FABS D=
(Store D‟s absolute value in D)
WNOT
NOT (word reverse, 1's complement)
WNOT D= 2 All models
(word)
DNOT
NOT (double word reverse, 1's
DNOT D= complement) 2 All models
(double word)
Negative (word)
1. If ABS (absolute value) instruction takes 2‟s complement when the highest bit (MSB) is 1,
and leave as it is when the highest bit is 0. In the decimal operation, a minus value will be
changed into a plus value, and a plus value will not be changed.
2. There are two types of absolute value instruction: ABS (absolute value of word) and DABS
(absolute value of double word) instructions.
3. WNOT (1‟s complement) instruction is the same as each reversed bit of word (double word)
instruction.
4. The reverse instruction includes WNOT (word reverse) and DNOT (double word reverse).
5. NEG (2‟s complement, Minus and Negative, etc) instruction is the same as the minus value
of word (double word) and the reversed bit of word plus one.
6. The minus instruction includes NEG (word minus) and DNEG (double word minus)
83
instructions.
7. The word (double word) addresses such as R, L, M, K, W, SV, PV, and SR, etc can be
assigned for the D area.
8. In the word instructions, values within 16 bits (65,535) can be calculated. In the double word
instructions, values within 32 bits (4,294,967,295) can be calculated.
9. The instruction can normally operate under the same condition of the contacts, and cannot
be directly connected at the root. When you operate it based on the specified input condition,
the input contact must be used as an edge contact.
M000.00 LET
R D=W 100
S=$0123
LET
D=W 200
S=$8123
M000.01 AB S
R D=W 100
AB S
D=W 200
M000.02 WNOT
R D=W 200
M000.03 NEG
R D=W 100
If M000.00 is set to be ON to store data in the word area, $0123 (DEC 291) will be stored into W100
and $8123 (DEC 33059) (-32477 with sign) will be stored into W200. (You can check it with register
monitor of WinGPC.)
When M000.01 contact is on, values of W100 and W200 are handled as an absolute value with ABS
(absolute value) instructions.
As $0123(0000 0001 0010 0011) (291) of W100 is a positive number (+), its absolute value does not
change even it is converted.
As $8123(1000 0001 0010 0011) (-32477) of W200 is a negative value, its absolute value is positive
value, 32477 (0111 1110 1101 1101) ($7EDD). That is the 2‟s complement, a reversed bit of word
plus 1.
WNOT instruction will be the revered bit in MO.2. $8123 will be changed into $7EDC (0111 1110
84
1101 1100).
NEG instruction in M0.3 changes the positive values into the negative and vice verse, for example,
$0123 (291) will be -291 (1111 1110 1101 1101).
85
The data handled in the PLC are 16-bit or 32-bit integer values except for the floating point. These
values are divided into the values with a sign and values without a sign. When expressing the integer
value with a sign, MSB is used for the sign, and the remaining bits are used for the value. The
unsigned 16-bit integer can be between 0 and 65535 represented by 216, but the signed integer can
be between 0 and 32767 represented by 215. If the MSB is 1, the number has a sign and the range of
the displayed value is - 32767 to 32767.
As the operation by the signed and unsigned integers produces different result respectively, a
different method of operation should be applied. Before processing, it should be specified first
whether the integer has a sign or not.
NX PLC has a separate flag to indicate it.
-F13.3: Sign processing contact (ON= -32768 to +32767, Off= 0 to 65535)
-F13.4: Max. / min. value limit (ON = keep the max (min) value when the max (min) value is exceeded,
Off= Cycling operation is done if max (min) value is exceeded (operation continues after flag
processing)
According to the setting for F13.03, the operation of integer is conducted with (On setting) or without
(Off setting) a sign. The factory default is 'Off'.
In case of overflow or underflow of integer data resulting from the operation, NX PLC handles it
differently depending on the F13.04 setting. If overflow (or underflow) occurs, Carry (F1.08) becomes
On; if F13.04 is Off, the lower value is saved as a result value and the higher value is saved in SR20
and SR21; but if F13.04 is On, +/-Max value is displayed as the result value. The factory default is
'Off'.
In case of a floating point operation, +/-Max is applied for the signed operation regardless of F13.03
and F13.04. In this case, the floating point value called INF is saved as +/-Max.
In case of operation for the add instruction ADD D=W0, S1=W1, S2=W2, the result is saved in
W1+W2=W0. If W1=65535(-1) and W2=32768(-32768), the output value (W0) is as follows:
Conditions F13.03 Off F13.03 Off F13.03 On F13.03 On
F13.04 Off F13.04 On F13.04 Off F13.04 On
Output Value 32767 65535 32767 32768(-32768)
86
Related Instructions
1. Arithmetic such as ADD (DADD), SUB (DSUB), MUL (DMUL), and DIV (DDIV), etc.
2. Compare Instructions such as ==(D==), <>(D<>), >=(D>=), <=(D<=), >(D>), <(D<), and LIM(DLIM),
etc.
3. Data Processing Instructions such as MIN, MAX, SUM, AVG, and SORT, etc.
4. Data Processing Instructions such as SCALE, SCP, BAND, BIAS, and LIMIT, etc.
Mnemo
Name Ladder Symbol Word Description
nic
LETX
D =
Wore Data Index IDX_D=
LETX S = 6 D[D+IDX_D] = S[S+IDX_S]
assignment IDX_S=
DLETX
Double Word D =
IDX_D=
DLETX Data index S = 6 D[D+(IDX_D×2)] = S[S+(IDX_S×2)].
IDX_S=
assignment
FLETX
D =
Floating Data IDX_D=
FLETX S = 7 D[D+(IDX_D×2)] = S[S+(IDX_S×2)]
Index assignment IDX_S=
1. Data located at the location of the data added by the value of IDX_S from S is stored to
location of the data added by the value of IDX_D from D.
2. Register or constant value can be input to IDX_D and IDX_S.
3. The value stored in D and S address cannot affect execution of the instruction.
4. IDX value multipled in DLETX and FLETX.
F001.0 LETX
D= W 100
IDX_D =W 0
S= D100
IDX_S =D0
The value of IDX can be extended automatically according to instruction size. (In case of double word
or Float instruction can be multipled.)
88
W0 6 = W(100+6) W0 6
Error Handling
If the range of addresses include IDX value exceed the area can be handled, runtime error (F0.3) occurred and
CPU stops.
In case of Float instruction, if the Source is not Float instruction, INF value can be assigned.
89
Mnemon
ic No. of
Ladder Description Applicable Model
Instructi Words
on
MOV
Copy Ns words from S to D.
D= S ...... 1 0 1 0 1 0 1 0 D ...... 1 0 1 0 1 0 1 0
MOV S= S+1 ...... 0 0 0 0 1 1 1 1 D+1 ...... 0 0 0 0 1 1 1 1
4 All models
N= S+2 ...... 1 1 1 1 0 0 0 0 D+2 ...... 1 1 1 1 0 0 0 0
1. Use MOV instruction to transmit (copy) data in word block module. Use FMOV instruction to
repeatedly transmit any data to a designated register block.
2. In MOV instructions, the word addresses such as R, L, M, K, W, SR, etc can be assigned for
the D and S area. The same number within the range of the register can be assigned for the
value N.
3. In FMOV instructions, the word addresses such as R, L, M, K, W, SR, etc can be assigned
for the D area. The same number within the range of the register can be assigned for the
value N and the number within 16 bits can be assigned for the value V.
4. The instruction can normally operate under the same condition of the contacts, and cannot
be directly connected at the root. When you operate it based on the specified input condition,
the input contact must be used as an edge contact.
90
F001.00 FM OV
D=W 0
N=1000
V=0
M000.00 DLET
R D=M20
S=$12345678
MOV
D=W 20
S=M20
N=3
M000.01 FM OV
R D=W 21
N=10
V=$0305
== M001.00
A=W 30
B=$0305
(OUT)
Initialize one thousand words from W0 to W999 to 0 on the first scan with the contact F1.0.
When the contact M0.0 is set to ON, $5678 is stored to M20 and the value of $1234 to M21.
At the same time, the value of M20 to M22 is stored into the range between W20 and W22.
When the contact M0.1 is set to ON, the value of W21 to W30 by 10 words is stored as $0305.
When the word value of W30 and $0305 are same, the output M1.0 will be set to ON.
91
This example shows how to store the previous data by shifting it in word module.
It transmits w50 to w51 and w51 to w52 every time it runs.
M000.00 INC
R D=W 50
M000.01 MOV
R D=W 51
S=W 50
N=20
Every time M0.0 is set to ON, W50 increases by 1 with INC instruction.
Every time M0.1 is set to ON, 20 words from W50 to W69 are transmitted to W51 to W70.
In other words, the value is stored into the next value in sequence, for example, from W50 to W51, etc.
Finally, W70 will be disappeared.
92
Mnemon
ic No. of
Ladder Description Applicable Model
Instructi Words
on
...... 0 1 1 1 1 1 0 0
Db
1. Use BMOV instruction to transmit data in bit block module. Use BFMV instruction to
repeatedly transmit any data (0 or 1) to a designated register block.
2. In BMOV instruction, the word addresses such as R, L, M, and K, etc can be assigned for
the Db and Sb area. The value N can be between 1 and 256.
3. BFMV instructions, the Db bit addresses such as R, L, M, and K, etc can be assigned for the
N area. The value N can be between 1 and 256, and V can be 0 or 1.
4. The instruction can normally operate under the same condition of the contacts, and cannot
be directly connected at the root. When you operate it based on the specified input condition,
the input contact must be used as an edge contact.
93
F001.00 DLET
D=M20
S=$12345678
M000.00 BM OV
R Db=K30.4
Sb=M20.8
N =16
M000.01 BFMV
R Db=M22.4
N =10
V =1
== M001.00
A=M22
B=$3FF0
(OUT)
$5678 is stored into M20 word and $1234 into M21 word at the first scan with the contact F1.0.
When the contact M0.0 is set to ON, 16-bit values between M20.8 and M21.7 are stored as 16-bit
values between K30.4 and K31.3.
When the contact MO.1 is set to ON, 10-bit values between M22.4 and M22.13 are stored as 1.
When the actual M22 word value is $3FFO (0011 1111 1111 0000), the output contact M1.0 will be
set to ON.
94
Mnemon
ic No. of
Ladder Description Applicable Model
Instructi Words
on
LDR
Calls the data of indirectly designated
LDR D= 3 All models
S= addressvalue. (Store value at absolute address S
in D.)
DLDR
DLDR D= 3 All models
S=
STO
Stores S data to the indirectly designated
STO S= 3 All models
D= address value. (Store S in register at absolute
address D.)
DSTO
DSTO S= 3 All models
D=
1. The indirect designation instruction stores and transmits data to the designated address
(absolute address) based on the value of the designated address, not storing it to the fixed
address.
2. This indirect designation instruction uses an absolute address. This absolute address refers
to the address that is allocated to CPU memory and then assigned in order regardless of the
types such as
3. In the LDR and DLDR instructions, the D value to be saved depends on the address S. In
the STO and DSTO instructions, the address to be saved depends on the address D.
4. The instruction can normally operate under the same condition of the contacts, and cannot
be directly connected at the root. When you operate it based on the specified input condition,
the input contact must be used as an edge contact.
95
F001.00 LET
D=M20
S=$00C2
DLET
D=M2
S=$0140123
M000.00 4
LDR
R D=W 100
S=M20
== M001.00
A=W 100 (OUT)
B=$1234
M000.01 STO
R S=W 100
D=M3
== M001.01
A=K0 (OUT)
B=$1234
$00C2 is stored into the word M20 at the first scan with contact F1.0. $1234 is stored into the word
M2 and $0140 is stored into the word M3.
When the contact M0.0 is set to ON, the value that will be stored to D is set to S=$00C2 based on the
value S.
As the absolute address $00C2 is the address M0002, the value of the word M0002 ($1234) will be
stored into the address D (W100).
If $1234 and W100 is the same, the output M1.0 will be set to ON.
In the STO instruction for the contact M0.1, the value of the word D (M3) that decides the address to
be saved is $0140 and the absolute address of the $0140 is K0 word. In other words, the value of S
(W100=$1234) is stored into the K0 word. When the value of K0 is $1234, the output contact M1.1 will
be set to ON.
Register and Absolute address (Refer to the manual for further information).
Register Ab. Register Ab.Add Register Ab.Add Register Ab.Add Register Ab.Add
Add
R0000 $0000 L0000 $0080 M0000 $01C0 K0000 $0140 W0000 $0200
R0001 $0001 L0001 $0081 M0001 $01C1 K0001 $0141 W0001 $0201
R0002 $0002 L0002 $0082 M0002 $01C2 K0002 $0142 W0002 $0202
R0126 $007E L0062 $00BE M0126 $013E K0126 $01BE W2046 $09FE
R0127 $007F L0063 $00BF M0127 $013F K0127 $01BF W2047 $09FF
96
1. Data values are stored to address that is specified by the Stack automatically. It will be actual
data storage from next address as number of Depth.
2. FIFOWR and LIFOWR move old data and input new data to data storage.
3. POPS reads data from data storage and decreases the stored data.
4. TOS read data from data storage, but does not decrease the stored data. (* Excute Read
Stack function).
5. Data storage consists of word address. If the stored data is exceed the Depth size or number
data is less than or equal to zero, error is occurred.
- Stored number of data N = FIFOWR (LIFOWR) execution numbers – POPS execution
numbers
- N is less than or equal to zero or bigger than Depth value, error is occurred.
[FIFO Example]
If M0.0 contact point is ON, 8024 is input to FIFO storage started from W100, and then the number of
97
If M0.1 contact point is ON, 3952 is input to FIFO storage started from W100, and then the number of
stored data can be increased by 1.
If M0.2 contact point is ON, it extracts the first stored value from FIFO storage start from W100 and
stores it to W200. The number of stored data can be ncreased by 1.
W100 0 1 2 1
[LIFO Example]
If M0.0 contact point is ON, 3952 is input to LIFO storage started from W100, and then the number of
stored data can be increased by 1.
If M0.1 contact point is ON, 1723 is input to LIFO storage started from W100, and then the number of
stored data can be increased by 1.
If M0.2 contact point is ON, it extracts the first stored value from FIFO storage start from W100 and
stores it to W200. The number of stored data can be ncreased by 1.
98
W100 0 1 2 2
Mnemonic
No. of
Instructio Ladder Function Description Applicable Model
Words
n
values.
STR D>
On if A value is greater than B value.
D>
AND D> A=
B= A>B A and B are double word addresses 4 All models
OR D>
or double word values.
1. The A or B area of the comparison instruction can contain word or double word addresses or
data values of R, L, M, K, W, SV, PV, SR and D, etc.
2. Up to 16 bits (65,535) of data value can be assigned for the words. Up to 32 bits
(4,294,967,295) of data value can be assigned for the double words.
3. For each comparison instruction, mnemonic instructions can be used with STR, AND, OR etc,
like the contacts.
4. When the input is ON, the output is turned on based on the comparison result of A and B.
F001.04 UC
U Ch=30
SV=5
R000.01
R
== M000.00
A=PV30 (OUT)
B=7
<> M000.01
A=PV30 (OUT)
B=10
<= >= M000.02
A=15 A=20 (OUT)
B=PV30 B=PV30
F001.02 DINC
R D=M5
D>= D< M000.03
A=M5 A=M5 (OUT)
B=1000 B=200000
The F1.2 contact repeats ON/OFF every 20 mS. DINC instruction increases by 1 every 20 mS. Output
M0.3 is ON when the double word of M0005 is within the range of 1000 and 200000.
102
Mnemonic
No. of
Instructio Name Ladder Function Description
Words
n
STR F==
Compare
F== On if A value and B value are
AND F== A=
Floating B= A=B 4-6
OR F== the same.
Point (A=B)
STR F>=
Compare
F>= On if A value is greater than or
AND F>= A= A ≥ B
Floating B= 4-6
OR F>= equal to B value.
Point (A≥B)
STR F<
Compare
F< On if A value is less than B
AND F< A=
Floating B= A< B 4-6
OR F< value.
Point (A<B)
1. The double word addresses or constant values of floating such as R, L, M, K, W, and D area
can be assigned for the comnparision instruction A or B.
2. If constant values are assigned, DEC value convered to binary floating automatically and
stored.
3. If constant values are assigned to operand, it assigned as 3 words up to max. 6 words.
4. For each comparison instruction, mnemonic instructions can be used with STR, AND, OR etc,
like the contacts.
103
If W300 of STR F>= is same or bigger than 10.1, or W30 of AND F<= is same or smaller than 20.5,
output M00.00 goes on.
If W30 of F== is 32.1, W30 of OR F== is 35.0 or W32 of F<> is 15, Output M00.01 goes on.
104
Mnemonic No. of
Name Ladder Function Description
Instruction Words
S TR L I M
Word LOW≤S≤HIGH On if S value is in a range
AND LIM 4
OR LIM Limit LOW≥S≥HIGH between Low and High.
1. LIM is instruction for word comparing, while DLIM is for double word.
2. Double word address such as R, L, M, K, W, D, SV, PV, SR, and S, D can be assigned for
the LOW and HIGH.
3. Constant value can be assigned for LOW and HIGH, 16 bits (65.535) of words can be input
in the Word instruction and 32 bits (4,294,967,295) of words can be input in the Double Word
instruction.
4. If double word can be assigned for Low or High of DLIM, number of word increased by 1
word.
When it is same or bigger than Low (15) value of FLIM instruction, or same or smaller than High value
(20), output M0.0 goes on.
It can be calculrated as same by two comparision instructions. If the value is 15.4 or more and 20.2 or
less, Output M0.2 goes on.
106
Mnemonic No. of
Name Ladder Function Description
Instruction Words
Floating
Point
S TR F L I M Data FLIM On if S value is same or in a
Range S =
AND FLIM Compari Low= LOW≤S≤HIGH 5-7 range between Low and High.
OR FLIM ng High=
Inscutri Off if not.
on
1. Double word address or floating point such as R, L, M, K, W, and D can be assigned for
LOW or HIGH in comparision instructions.
2. If constant values are assigned, DEC point value convered into binary floating automatically
and stored.
3. If constant values are assigned to Low or Highoperand, it assigned as 2 words up to max. 7
words.
4. For each comparison instruction, mnemonic instructions can be used with STR, AND, OR etc,
like the contacts.
When it is same or bigger than Low (15.4) value of FLIM instruction, or same or smaller than High
107
It can be calculrated as same by two comparision instructions. If the value is 15.4 or more and 20.2 or
less, Output M0.2 goes on.
108
Mnemonic No. of
Ladder Description Applicable Model
Instruction Words
ADD
D = Adding binary numbers (Adding Decimals)
ADD S1=
S2=
- 1 Word (Binary addition ) 4 All models
DLDR
Adding binary numbers (Adding Decimals)
DLDR D= 3 All models
S= -Double Word
STO D = S1 + S2 + Carry, (Word)
STO S= Adding binary numbers include carry 3 All models
D= (Decimal addition with carry)
1. ADD and DADD addition instructions add S1 and S2, and then store the result value into D.
S1, S2, and Carry are included.
2. Binary addition operates in bit, and BCD addition operates in four bits that are composed of
BCD numbers. It is the same as the addition expression in HEX. (Please refer to the
Example.)
3. The number or word (double word) addresses such as R, L, M, K, W, SV, PV, SR, and D etc
can be assigned for the S1 and S2 areas. Only word (double word) address can be assigned
for the D area, a storage area.
4. In the binary word instructions, values within 16 bits (65,535) can be calculated. In the
double word instructions, values within 32 bits (4,294,967,295) can be calculated.
5. If the calculated value exceeds the maximum, the carry bit is turned on and then the rest
after the maximum will be stored. When you calculate 65530 + 10 in word operation, the
carry bit F1.8 will be set to ON and then the rest 4, a value that the maximum value of 65536
was extracted from the sum.
6. The subtraction instruction can normally operate under the same condition of the contacts,
and cannot be directly connected at the root. When you operate it based on the specified
input condition, the input contact must be used as an edge contact.
109
F001.00 LET
D=W 100
S=21
LET
D=W 102
S=22
M000.00 AD D
R D =W 110
S1=W 100
S2=W 102
D AD D
D =W 120
S1=W 100
S2=W 102
M001.00 F001.08
(OUT)
M000.01 AD C
R D =W 112
S1=W 100
S2=W 102
D AD C
D =W 122
S1=W 100
S2=W 102
F1.0 contact is be set to ON for one scan when the CPU initially operates. And then DEC 21
(HEX $15) will be entered into W100 and DEC 22 (HEX $16) will be entered into W102.
Four instructions work according to M000.00 contact and calculate values as follows:
ADD calculates 21+22=43 in decimal addition.
DADD calculates double word operations that are common in the 16-bit operation. The W120 will be
evaluated to 43
ADC and DADC (include carry) instruction can be different according to carry value. As D=21+22+C,
if carry bit (F1.8) is 0, the value is 43. If 1, the value 44 is stored into D.
Carry value is the stored value in F1.8 address, and can be different during scan. Always refresh it
before using.
110
Mnemonic No. of
Ladder Description Applicable Model
Instruction Words
MUL Binary multiplication (decimal multiplication) –
D =
MUL S1= 4 All models
S2= One word
DMUL
D = Binary multiplication (decimal multiplication) –
DMUL S1= 5 All models
S2=
Double word
F001.00 LET
D=W 100
S=3
LET
D=W 102
S=7
M000.00 MUL
R D =W 110
S1=W 100
S2=W 102
DMUL
D =W 120
S1=5000
S2=7000
M000.01 MUL
R D =W 130
S1=22
S2=$10
F1.0 contact is be set to ON for one scan when the CPU initially operates. And then DEC 3 (HEX $3)
will be entered into W100 and DEC 7(HEX $7) will be entered into W102.
Four instructions work according to M000.00 contact and calculate values as follows:
MUL calculates 3 x 7 = 21 in decimal operation and the value of 21 will be stored into w110 in D.
DMUL is double word operations and the value of 5000 x 7000 = 35000000 will be stored into D.
You can directly enter either decimal or hexadecimal numbers. The result of 22x16 ($10) = 352 will be
stored into the D.
112
Mnemonic No. of
Ladder Description Applicable Model
Instruction Words
DIV
D =
DIV S1= Binary division (decimal division) – One word 4 All models
S2=
DDIV
D =
DDIV S1=
S2=
Binary division (decimal division) – Double word 5 All models
F001.00 LET
D=W 200
S=3
LET
D=W 122
S=7
M000.00 <> DIV
R A=W 200 D =W 100
B=0 S1=5000
S2=W 200
DDIV
D =W 112
S1=W 122
S2=30
This instruction divides 5000 by W200, and then stores the result in W100. When W200 is not „0‟, a
comparison instruction will be used.
In the DIVB instruction, the comparison instruction is also used when W200 of S2 is not 0.
Calculated results are within the one word.
But, in the DDIV and DDIVB instructions, the comparison instruction will not be used because the
denominator is always 30 and not 0, respectively. In the DDIVB instruction, put $ in front of number to
designate the value of BCD.
F001.00 LET
D=W 100
S=24
LET
D=W 200
S=4
M000.00 <> DIV
R A=W 200 D =W 300
B=0 S1=W 100
S2=W 200
When M0.0 contact is on and denominator W200 is not 0, the operation result is stored in W100 ÷
W200 = W300.
The resulting value of 24 ÷ 4, that is 6, is stored in operation result.
114
F001.00 DL E T
D=W100
S=876543
DL E T
D=W200
S=765430
M000.00 DDI V
R D =W 300
S1=W 100
S2=W 200
When M0.0 contact is on, double word division are executed. If you calculate 876543÷765430, the
result is that the quotient is 1 with a remainder of 111113 ($1B209). Reminder of double word value is
stored to SR22. $0001 is stored in SR23, while 45577($B209) is stored in SR22.
F001.00 DLET
D=W 100
S=$88000
DLET
D=W 200
S=3
M000.00 DDIV
R D =W 300
S1=W 100
S2=W 200
When M0.0 contact is on, W100 is convered 2 words by double word DDIV instruction. W100 is
$8000, if you calculate 32768($8000) ÷3, the result is that the quotient is 10922 with a remainder of 2.
10922 is stored in W300 while 2 is sotred in SR22.
115
Mnemonic No. of
Name Ladder Description
Instruction Words
FADD
Floating point D = D= S1+S2
FADD S1=
S2=
7
Addition (Add S1and S2, and store is to D)
FSUB D= S1-S2
Floating point D =
FSUB S1=
S2=
7 (Substruct S2 from S1, and store it
Subtraction
into D)
FMUL D= S1xS2
Floating point D =
FMUL S1=
S2=
7 (Multiple S1and S2, and store it into
Multiplication
D)
FDIV
Floating point D = D= S1/S2
FDIV S1= 7
Division S2=
(Divide S1by S2, and store is into D)
1. Constant value of Floating point or double word such as R, L, M, K, W, and D address can
be assigned for operand S1 and S2, while only double word address can be assigned for D
area, a storage area.
2. If constant values are assigned to S1 and S2 operand, it assigned as 2 words up to max. 7
words.
116
F001.00 FLET
D=W 100
S=1.2
FLET
D=W 102
S=2.7
M000.00 F AD D
R D =W 110
S1=W 100
S2=W 102
FSUB
D =W112
S1=W100
S2=W102
FM UL
D =W 114
S1=W 100
S2=W 102
FDIV
D =W116
S1=W100
S2=W102
FLET
D =W 118
S =W 112
F AB S
D =W 118
When M0.0 contact is on, stored decimal point 1.2 in W100 and 2.7 in W103 at first scan.
Mnemonic No. of
Ladder Description Applicable Model
Instruction Words
ADDB
D =
ADDB S1= BCD addition - One word 4 All models
S2=
DADDB
D =
DADDB S1=
S2=
BCD addition – Double word 5 All models
ADCB
D = D = S1 + S2 + CY (word)
ADCB S1=
S2=
4 Note 1
BCD addition, include carry
DADCB
D = D = S1 + S2 + CY (double word)
DADCB S1=
S2=
5 Note 1
BCD addition, include carry
1. Binary addition operates in bit, and BCD addition operates in four bits that are composed of
BCD numbers. It is the same as the addition expression in HEX (Refer to the Example).
2. The number or word (double word) addresses such as R, L, M, K, W, SV, PV, SR and D, etc
can be assigned for the S1 and S2 areas. Only word (double word) address can be assigned
for the D area, a storage area.
3. When you enter a numeric value in S1 and S2 of BCD arithmetic instructions such as ADDB
and DADDB, the input should be in BCD modules and includes $ in front of the numbers (ex.
$100, $300, etc).
4. In the binary word instructions, values within 16 bits (65,535) can be calculated. In the
double word instructions, values within 32 bits (4,294,967,295) can be calculated. For BCD
words, values between 0 and $9999 (39,321 in decimal number) can be calculated. For BCD
double words, values between 0 and $99999999 (DEC 2,576,980,377) can be calculated.
5. The addition instruction can normally operate under the same condition of the contacts, and
cannot be directly connected at the root. When you operate it based on the specified input
condition, the input contact must be used as an edge contact.
118
F001.00 LET
D=W 100
S=21
LET
D=W 102
S=22
M000.00 AD D B
R D =W 112
S1=W 100
S2=W 102
D =W 122
S1=W 100
S2=W 102
M001.00 F001.08
(OUT)
M000.01 AD C B
R D =W 114
S1=W 100
S2=W 102
D =W 124
S1=W 100
S2=W 102
F1.0 contact is be set to ON for one scan when the CPU initially operates.
And then DEC 21(HEX $15) will be stored in W100 and DEC 22 (HEX $16) will be stored in W102.
ADCB and DADCB (BCD addition include carry) can be different according to carry value.
When D=21($15)+22($16)+C, if carry bit (F1.8) is 0, $ 31 is stored into D. If 1, $32 is stored into D.
Carry value is the stored value in F1.8 address, and can be different during scan. Always refresh it
before using.
119
Mnemonic No. of
Ladder Description Applicable Model
Instruction Words
SUBB
D =
SUBB S1= BCD subtraction – One word 4 All models
S2=
DSUBB
D =
DSUBB S1=
S2=
BCD subtraction - Double word 5 All models
SBCB
D = D = S1 - S2 - CY (word)
SBCB S1=
S2=
4 Note 1
BCD subtraction, include carry
DSBCB
D = D = S1 - S2 - CY (double word)
DSBCB S1=
S2=
5 Note 1
BCD subtraction, include carry
1. The subtraction instruction subtracts S2 from S1 and stores it in D. There are two subtraction
instructions, such as binary subtraction and BCD subtraction.
2. Binary subtraction operates in bit, and BCD subtraction operates in four bits that are
composed of BCD numbers. It is the same as the subtraction expression in HEX (Please
refer to the Example).
3. The number or word (double word) addresses such as R, L, M, K, W, SV, PV, SR and D, etc
can be assigned for the S1 and S2 areas. Only word (double word) address can be assigned
for the D area, a storage area.
4. When you enter a numeric value in S1 and S2 of BCD arithmetic instructions such as ADDB
and DADDB, the input should be in BCD modules and includes $ in front of the numbers (ex.
$10 and $30, etc.).
5. For BCD words, values between 0 and $9999 (39,321 in decimal number) can be calculated.
For BCD double words, values between 0 and $99999999 (2,576,980,377 in decimal
number) can be calculated.
6. If the calculated value is negative (minus), the carry bit is turned on and then the negative
(minus) value will be displayed. It may look like a subtraction from the maximum in decimal
value. That is, when you calculate 10 through 20 in word operation the resulting value is -10.
But this result turns carry bit F1.8 on, then the value of 65526 (the maximum value of 65536
minus 10) is stored. This value is expressed as -10.
7. The subtractive instructions can normally operate under the same condition of the contacts,
and cannot be directly connected at the root. When you operate it based on the specified
input condition, the input contact must be used as an edge contact.
120
F001.00 LET
D=W 100
S=34
LET
D=W 102
S=19
M000.00 SUBB
R D =W112
S1=W100
S2=W102
DSUBB
D =W122
S1=W100
S2=W102
M000.01 SUBB
R D =W130
S1=$23
S2=$11
F1.0 contact is be set to ON for one scan when the CPU initially operates. And then DEC 34 (HEX
$22) will be entered in W100 and DEC 19 (HEX $13) will be entered into W102.
SUBB calculates 34-19=9 in BCD subtraction. It can be expressed as $22-$13=$9 in BCD and $9=9
in DEC.
DSUBB is double words BCD subtraction, and the resulting value of $9 is stored at W122.
You can directly enter values into S1 and S2 of the instructions. The result of 23-11=12 will be stored
in W130.
121
Mnemonic No. of
Ladder Description Applicable Model
Instruction Words
MULB
D =
MULB S1= BCD Multiplication – One word 4 All models
S2=
DMULB
D =
DMULB S1=
S2=
BCD Multiplication - Double word 5 All models
1. The multiplication instruction multiplies S1 and S2 and stores it in D. There are two types of
multiplication instructions: binary multiplication and BCD multiplication.
2. Binary multiplication operates in bit module, and BCD multiplication operates in BCD module.
It is the same as the multiplication expression in HEX.
3. The number or word (double word) addresses such as R, L, M, K, W, SV, PV, SR and D, etc
can be assigned for the S1 and S2 areas. Only word (double word) address can be assigned
for the D area, a storage area.
4. If you enter a numeric value in S1 and S2 of BCD arithmetic instructions such as MULB and
DMULB, etc, the input should be in BCD module and includes $ in front of the numbers (ex.
$100 and $300, etc.).
5. For BCD words, values between 0 and $9999 (39,321 in decimal number) can be calculated.
For BCD double words, values between 0 and $99999999 (2,576,980,377 in decimal
number) can be calculated.
6. If the calculated value exceeds the maximum, the value of high word will be stored in special
word SR20, and the value of low word which is the rest, a value that the maximum value of
65536 was extracted from the sum, will be stored in D, after carry bit is turned on.
7. The multiplication instruction can normally operate under the same condition of the contacts,
and cannot be directly connected at the root. When you operate it based on the specified
input condition, the input contact must be used as an edge contact.
122
F001.00 LET
D=W 100
S=3
LET
D=W 102
S=7
M000.00 MULB
R D =W 112
S1=W 100
S2=W 102
D =W 122
S1=$800
S2=$700
F1.0 contact is be set to ON for one scan when the CPU initially operates. And then DEC 3 (HEX $3)
will be entered into W100 and DEC 7(HEX $7) will be entered into W102.
MULB calculates $3 x $7 = $21 in BCD multiplication and $21 (33 in decimal number) will be stored in
D.
DMULB is double word BCD multiplication instruction and $800 x $700 = $560000 („5636096‟ in
decimal number) will be stored into D.
123
Mnemonic No. of
Ladder Description Applicable Model
Instruction Words
DIVB
D =
DIVB S1= BCD division - One word 4 All models
S2=
DDIVB
D =
DDIVB S1=
S2=
BCD division - Double word 5 All models
1. The division instruction divides S1 and S2 and stores it in D. There are two types of division
instructions: binary division instruction and BCD division instruction.
2. The resulting remainder (a value below the decimal point) is temporarily stored as double
word condition (SR0021) in the special internal word. The high value of remainder is stored
in the high word SR23 of double word and the low value of remainder is stored in the low
word SR22.
3. In the division instructions, the denominator (S2) „0‟ results in infinity (∞). If so, the CPU
handles it as an error, the error bits (F1.9), indicating the denominator (S2) is 0, will be
turned on and then the error LED flickers. To prevent this error, it is recommended to use the
comparison instruction because it will normally operate when the input condition in the
division instruction is not „0‟. (Please refer to the Example.)
4. BCD division operates in BCD. It is the same as the division expression in HEX.
5. The number or word (double word) addresses such as R, L, M, K, W, SV, PV, SR and D, etc
can be assigned for the S1 and S2 areas. Only word (double word) address can be assigned
for the D area, a storage area.
6. When you enter a numeric value in S1 and S2 of BCD arithmetic instructions such as DIVB
and DDIVB, etc, the input should be in BCD modules and includes $ in front of the numbers
(ex. $100 and $300, etc).
7. For BCD words, values between 0 and $9999 (39,321 in decimal number) can be calculated.
For BCD double words, values between 0 and $99999999 (2,576,980,377 in decimal
number) can be calculated.
8. The division instruction can normally operate under the same condition of the contacts, and
cannot be directly connected at the root. When you operate it based on the specified input
condition, the input contact must be used as an edge contact.
124
F001.00 LET
D=W 120
S=$11
LET
D=W 210
S=$3
M000.00 <> DIVB
R A=W 210 D =W 110
B=0 S1=W 120
S2=W 210
D =W 114
S1=W 124
S2=$5
F1.0 contact is be set to ON for one scan when the CPU initially operates. And then DEC 17
(HEX $11) will be entered into W120 and DEC 3 (HEX $3) will be entered into W210.
In BCD division, $11 ÷ $3 equals to $3 and the remaining is $ 2. Thus, $3 is stored in W110, and $2 is
stored in SR22.
125
F001.00 LET
D=W 100
S=24
LET
D=W 200
S=4
M000.00 <> DIVB
R A=W 200 D =W 302
B=0 S1=W 100
S2=W 200
When M0.0 contact is on and denominator W200 is not 0, in BCD division, $18÷$4 equals to 4.5 when
NCD value of W100 is $18(24). Thus, $4 is stored in W302, and 5 (the value of reminder 0.5) is
stored in SR022.
F001.00 DLET
D=W 100
S=$88000
DLET
D=W 200
S=3
M000.00
R D =W 300
S1=W 100
S2=W 200
In DDIVB, $88000÷$3=29333 and $29333 is stored in W300. Reminder of double word value $1 is
stored in SR22.
126
DAND S1 0 0 1 1
D = Logical product (D-Word AND :)
S2 0 1 0 1
DAND S1=
S2= D 0 0 0 1
5 All models
Store AND of S1 and S2 in D.
WOR S1 0 0 1 1
D = Logical sum (Word OR :) S2 0 1 0 1
WOR S1=
S2= D 0 1 1 1
4 All models
Store OR of S1 and S2 in D.
DOR
S1 0 0 1 1
D = Logical sum (D-Word OR :) S2 0 1 0 1
DOR S1=
S2= D 0 1 1 1
5 All models
Store OR of S1 and S2 in D.
WXOR S1 0 0 1 1
D = Exclusive OR (Word Exclusive OR) S2 0 1 0 1
WXOR S1=
S2= D 0 1 1 0
4 All models
Store exclusive OR of S1 and S2 in D.
DXOR S1 0 0 1 1
D = Exclusive OR (Exclusive OR :) S2 0 1 0 1
DXOR S1=
S2= D 0 1 1 0
5 All models
Store Exclusive OR of S1 and S2 in D.
Exclusive OR)
OR)
1. Logical product operation of WAND (DAND) logically multiplies (When the bits of S1 and S2
are all 1, the result is 1.) bit addresses of S1 and S2, and stores the result into the bit
address of D.
2. Logical sum operation of the WOR (DOR) instruction logically adds bits of S1 and S2 (when
either S1 or S2 is 1, the result is 1), and stores the result into D.
3. When only one of bits from S1 and S2 is 1, exclusive logical sum operation of the WXOR
(DOR) instruction stores the result as 1 into D.
4. When the bits of S1 and S2 are same, the reverse (equal circuit) operation of the Exclusive
127
M000.00 LET
R D=W 100
S=$3333
LET
D=W 200
S=$5555
M000.01 W AN D
R D =W 300
S1=W 100
S2=W 200
WOR
D =W 301
S1=W 100
S2=W 200
D =W 302
S1=W 100
S2=W 200
WXNR
D =W 304
S1=W 100
S2=W 200
If the contact M000.00 is set to ON to save data into the word area, $3333(0011 0011 0011 0011) will
be saved into W100 and $5555 (0101 0101 0101 0101) will be saved into W200.
When the contact M000.01 is set to ON, logical operation runs once and the result of each instruction
will be stored into D as follows:
Mnemonic No. of
Ladder Description Applicable Model
Instruction Words
RLC
D= Rotate the content of D to the left N times.
N= (Rotate left without carry, word)
RLC 3 All models
F1.8 15 ..... D word .... 00
1. The RLC (DRLC) shifts each bit of designated address D to its left (from lower bit to higher
bit) by N bit and the higher bit value (MSB) will be stored at the carry bit F1.8.
2. The RRC (DRRC) shifts each bit of designated address D to its right (from higher bit to
lower) by N bit and the lower bit value (LSB) is stored at the carry bit F1.8.
3. The word (double word) addresses such as R, L, M, K, W, SR and D, etc can be assigned
for the D area. The N can be between 0 and 15 (word instructions) or between 0 and 31
(double word instructions).
4. The instruction can normally operate under the same condition of the contacts, and cannot
be directly connected at the root. When you operate it based on the specified input condition,
the input contact must be used as an edge contact.
129
M000.00 DLET
R D=M10
S=$0F0F0F
0F
DLET
D=M12
S=$0F0F0F
0F
DLET
D=M14
S=$FF00FF
00
M001.00 F001.08
(OUT)
M000.01 RLC
R D=M10
N=1
DRLC
D=M12
N=1
M001.00 F001.08
(OUT)
F001.04 RRC
R D=M11
N=1
DRRC
D=M14
N=1
If the contact M000.00 is set to ON to save data into the word area, $0F0F0F0F will be stored into
M10.
By doing this, $OFOF is stored into the word M10 and $OFOF is stored in the word M11. In addition,
$OFOF is stored into the word M12 and M13 and $FFOO is stored into the word M14 and M15. The
carry bit output of F1.8 determines whether it is reflected on the contact.
After an operation
of DRRC
131
Mnemonic No. of
Ladder Description Applicable Model
Instruction Words
1. The RLC (DRLC) shifts each bit of designated address D to the left (from lower bit to higher
bit) by N bit and the higher bit value (MSB) will be stored at the carry bit F1.8. The carry bit
value will be stored into the lower bit (LSB).
2. The ROR (DROR) shifts each bit of designated address D to the right (from higher bit to
lower bit) by N bit and the lower bit value (LSB) will be stored at the carry bit F1.8. The carry
bit value will be stored into the higher bit (MSB).
3. The word (double word) addresses such as R, L, M, K, W, and SR can be assigned for the D
area. The N can be between 0 and 15 (word instructions) or between 0 and 31 (double word
instructions).
4. The instruction can normally operate under the same condition of the contacts, and cannot
be directly connected at the root. When you operate it based on the specified input condition,
the input contact must be used as an edge contact.
132
M000.00 DLET
R D=M10
S=$0F0F0F
0F
DLET
D=M12
S=$0F0F0F
0F
DLET
D=M14
S=$FF00FF
00
M001.00 F001.08
/ (OUT)
M000.01 ROL
R D=M10
N=1
DROL
D=M12
N=1
M001.01 F001.08
/ (OUT)
F001.04 ROR
R D=M11
N=1
DROR
D=M14
N=1
If the contact M0.0 is set to on, $OFOF will be stored into M10 and M11.
$OFOF is also stored into the words M12 and M13, and $FFOO into the words M14 and M15.
The carry output of F1.8 determines whether it is reflected on the contact or not.
The following shows the value that changes when the contact is set to ON.
After an operation of
the contact M0.1M10
After an operation of
DROL
After an operation of
the ROR instruction
Initial state of M14
After an operation
of DROR
133
Mnemonic No. of
Ladder Description Applicable Model
Instruction Words
1. The SHL (DSHL) shifts each bit of designated address D to the left (from lower bit to higher
bit) by N bit, and the higher bit value (MSB) will be stored at the carry bit F1.8. The value of 0
is stored into the lower bit (LSB).
2. The SHR (DSHR) shifts each bit of designated address D to the right (from higher bit to
lower bit) by N bit, and the lower bit value (LSB) will be stored at the carry bit F1.8. The value
of 0 is stored into the higher bit (MSB).
3. The word (double word) addresses such as R, L, M, K, W, and SR can be assigned for the D
area. The N can be between 0 and 15 (word instructions) or between 0 and 31 (double word
instructions).
4. The instruction can normally operate under the same condition of the contacts, and cannot
be directly connected at the root. When you operate it based on the specified input condition,
the input contact must be used as an edge contact.
134
M000.00 DLET
R D=M10
S=$F00FF0
0F
DLET
D=M12
S=$F00FF0
0F
DLET
D=M14
S=$F00FF0
0F
M001.00 F001.08
(OUT)
M000.01 SHL
R D=M10
N=1
DSHL
D=M12
N=1
M001.01 F001.08
(OUT)
F001.04 SHR
R D=M11
N=1
DSHR
D=M14
N=1
When the contact M0.0 is set to ON, $FOOF will be stored into M10 and M11.
$FOOF will be also stored into the word M12, M13, M14, and M15.
The carry output of F1.8 determines whether it is reflected on the contact or not.
The following shows the value that changes when the contact is set ON.
After an operation of
the contact M0.1M10
After an operation of
DSHL
After an operation of
the SHR instruction
Initial state of M14
After an operation
of DSHR
136
DSHL
Convert binary number of S to BCD and store it in D
DSHL D= 3 All models
N= (double word).
DSHR
Convert BCD of S to binary number and store it in D
DSHR D= 3 All models
N= (double word).
1. BCD (DBCD) converts the binary value of the S address into BCD, and stores it into the D
area. The value of S should be within the maximum range of BCD module.
2. BIN (DBIN) converts the BCD value of the S address into binary, and stores it into the D area.
The value of S should be within the maximum range of BCD module.
3. The maximum value in the word instruction (BCD, BIN) is 0 to 9999 in decimal ($270F in
hexadecimal). In double word (DBCD, DBIN) it should exist within the range of 0 to
99999999 ($05F5E0FF in hexadecimal).
4. The word (double word) addresses such as R, L, M, K, W, SR and D, etc can be assigned
for the D area. The numbers or word/double word addresses can be assigned for the S area.
5. The instruction can normally operate under the same condition of the contacts, and cannot
be directly connected at the root. When you operate it based on the specified input condition,
the input contact must be used as an edge contact.
137
M000.00 BCD
R D=W 10
S=1234
DBCD
D=W 12
S=W 10
M000.01 BIN
R D=W 20
S=W 10
BIN
D=W 22
S=$27
When the contact M0.0 is set to on, the decimal value of 1234 will be converted into BCD, and stored
into W10.
What is BCD?
BCD stands for „Binary Coded Decimal‟. It is a code method that expresses decimals using 4 bits.
For example, the number 23 is 0001 0111 in BCD and 0010 0011 ($23 in hexadecimal). The number 57
is 0101 0111 in BCD and $57 in hexadecimal. If you use WinGPC to open Tool (T)/Number Conversion (N) menu
in program edit mode, you can convert numbers into decimal/ hexadecimal/binary.
The BCD value of words ranges from 0 to $9999 (39,321 in decimal) and that of double word ranges
1. ENCO instruction converts the value of bit address of the highest bit which has 1 in S
n
address into encode (n value of 2 ) and stores the resulting value into the lower 8 bit in D
area. The D value of the higher bit will be kept, and when there are more than two 1s, the bit
value that is in the highest order will be processed. (The SPC series stores the encode
n
conversion in D after converting it with value of n+1 of 2 .)
2. DECO instruction stores the value of lower 4 bit of S address into D area after converting it
n
into decode (the value of 2 ).
3. The word (double word) addresses such as R, L, M, K, W, and SR can be assigned
for the D area. The numbers or word/double word addresses can be assigned for
the S area.
4. The instruction can normally operate under the same condition of the contacts, and
cannot be directly connected at the root. When you operate it based on the specified
input condition, the input contact must be used as an edge contact.
139
F001.00 LET
D=W 20
S=$1234
M000.00 ENCO
R D=W 20
S=$0550
ENCO
D=W 21
S=W 20
M000.01 DECO
R D=W 30
S=W 21
DECO
D=W 31
S=6
Put the value of $1234 into the word W20 as an initial condition.
When the contact M0.0 is set to ON, the value of $0550, a hexadecimal, is converted into
Encode and stored into W10.
140
e c
D 0 0 0 0D+3 0 …..
0 0 0 0 00 1 01 10 11 11 =7
0 1
g f e d c b a d
D+3 0 ….. 0 0 1 1 1 =7
1. The SEG instruction converts the value of the lower 4-bit value of S address into 7-segment
and store it into lower 8-bit value of D word.
2. In the SEG instruction, the higher bite value of the D address does not change and is kept.
3. The word addresses such as R, L, M, K, W, and SR can be assigned for the D area. The
numbers or word addresses can be assigned for the S area.
4. The instruction can normally operate under the same condition of the contacts, and cannot
be directly connected at the root. When you operate it based on the specified input condition,
the input contact must be used as an edge contact.
141
F001.00 LET
D=W 20
S=$2345
LET
D=W 21
S=$2345
M000.00 SEG
R D=W 21
S=W 20
M000.01 SEG
R D=W 30
S=3
Substitute $2345 into the word W20 and W21 as an initial condition.
When the contact M0.0 is set to ON, the data 5 of lower 4 bits in S address is converted into 7-
segment and stored into the lower 8 bit (1 bit) of the D.
When the contact M0.1 is on, 3 of the S data is converted and stored into the D area.
Bit address: 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
g f e d c b a g f e d c b a
D+3 0 ….. 0 0 1 1 1 D+3 0 ….. 0 0 1 1 1
=7 0 = 0 0 1 1 1 1 1 1 8 = 0 1 1 1 1 1 1 1
=7 a
1 = 0 0 0 0 0 1 1 0 9 = 0 1 1 0 1 1 1 1
2 = 0 1 0 1 1 0 1 1 A = 0 1 1 1 0 1 1 1 f g b
3 = 0 1 0 0 1 1 1 1 b = 0 1 1 1 1 1 0 0 e c
4 = 0 1 1 0 0 1 1 0 C = 0 0 1 1 1 0 0 1
d
5 = 0 1 1 0 1 1 0 1 d = 0 1 0 1 1 1 1 0
6 = 0 1 1 1 1 1 0 1 E = 0 1 1 1 1 0 0 1
7 = 0 0 1 0 0 1 1 1 F = 0 1 1 1 0 0 0 1
142
DXCHG
DXCHG D1= 3 All models
Exchange D1 and D2 values. (double word)
D2=
x x o o o o o o
1. The function of XCHG (DXCHG) instruction exchanges the values on the D1 and D2 address.
2. Only word addresses such as R, L, M, K, and W can be assigned for both D1 and D2 area.
3. The instruction can normally operate under the same condition of the contacts, and cannot
be directly connected at the root. When you operate it based on the specified input condition,
the input contact must be used as an edge contact.
143
F001.00 LET
D=W 20
S=$2345
LET
D=W 21
S=$8765
DLET
D=W 30
S=$98765
M000.00 XCHG
R D=W 21
S=W 20
M000.01
R D=W 20
S=W 30
Substitute the value of $2345 into W20 and $8765 into W21 as an initial condition.
When the contact M0.0 is set to ON, the data of D1 and D2 addresses are exchanged each other.
When the contact M0.1 is set to ON, the value of D1 and D2 of double word is exchanged each other.
144
D 0 ..… 0 0 1 0 1 =5
N=3 D+1 0 ….. 0 0 0 1 0 =2
D+2 0 ….. 0 0 0 1 1 =3
D+3 0 ….. 0 0 1 1 1 =7
D=$7325 0 1 1 1 0 0 1 1 0 0 1 0 0 1 0 1
F001.00 DL E T
D=W 20
S=$1234567
8
DL E T
D=W 22
S=$8765432
1
M000.00 DI S
R D=W 30
N=1
S=W 20
DI S
D=W 22
N=3
S=W 21
M000.01 UNI
R D=W 32
S=W 21
N=3
As an initial condition, apply the value $12345678 to W20 word, and $87654321 to W22 word.
If M0.0 contact is on, the lower 2-digit number of the W20 word value of S is separated and saved in
D word (W30) and D+1 word (W31).
Mnemonic No. of
Name Ladder Description
Instruction Words
SWAP
SW A P B yt e S w a p D=
Swap high byte and low byte of S value,
S= 3
and then sotre it to D.
1. Instruction for swaping high byte and low byte in a word. XCHG and DXCHG instructions for
swaping data in a word or double word..
M000.00 LET
D=W 100
S=$80F2
M000.01 S W AP
D=W 200
S=W 100
If M0.1 contact point is on, the $80F2 stored to W100 is swapped, and then stored to W100.
MSB LSB
Mnemonic No. of
Name Ladder Description
Instruction Words
EXT
Expand word to double word. If V is 0,
D =
EXT W or d S=
E xp a n t i o n V= 3 assign 0 to upper word. If V is 1, assign
M0.0 EXT
D=W 0
V=0
BSET th
Set N bit of D to 1.
BEST D= D ...... 0 0 1 0 0 1 0 0 3 All models
N=
When N=5 (N=0~15)
BRST th
Reset N bit of D to 0.
BRST D= D ...... 0 1 0 1 0 1 0 0 3 All models
N=
When N=3 0
th
BNOT Reverse state of N bit of D. (0 1, 1 0)
D ...... 0 1 1 1 0 1 0 0
BNOT D= 3
When N=4
N=
D ...... 0 1 1 0 0 1 0 0
BTST Store the value of Nth bit of the carry bit F1.8.
BTST D= D ...... 0 1 1 1 0 1 0 0 3
N= When N=6 F1.8
1. The bit conversion instruction controls each bit value at the word address.
2. The bits that are not designated as N keep its existing value.
3. The word (double word) addresses such as R, L, M, K, W, and SR can be assigned for the D
area. The N area can be between 0 and 15.
4. The instruction can normally operate under the same condition of the contacts, and cannot
be directly connected at the root. When you operate it based on the specified input condition,
the input contact must be used as an edge contact.
149
F001.00 LET
D=W 20
S=$2345
M000.00 BSET
R D=W 20
N=3
M000.01 BRST
R D=W 20
S=6
M000.02 BNOT
R D=W 20
S=9
M000.03 BTS T
R D=W 20
S=13
F001.08 M001.00
(OUT)
Substitute the value of $2345 into the word W20 as an initial condition.
150
1. The SUM instruction counts the number of ON (=1) bits in the S word and stores the
resulting value in D.
2. The word addresses such as R, L, M, K, W, SR, etc can be assigned for the D and S areas.
3. The instruction can normally operate under the same condition of the contacts, and cannot
be directly connected at the root. When you operate it based on the specified input condition,
the input contact must be used as an edge contact.
These instructions are commonly used to check the conditions of contacts and the changes of data.
F001.00 LET
D=W 20
S=$0365
F000.15 SUM
D=W 21
S=W 20
RC
Reset carry bit (F1.8) to 0.
RC 1 All models
0 F1.8
1. The carry bit F1.8 is a special internal flag that is used to control the present value because
this value can exceed the allowed range during the operation of the program or can be
changed into Set or Reset when symbols are displayed, shifted or moved.
2. The SC, RC, and CC instructions are used to control the carry bit F1.8.
3. Please be aware that the carry bit can change the condition and the result of operations.
4. Operand variables of the carry instructions do not exist and the carry bit F1.8 contact is
always controlled.
5. The instruction can normally operate under the same condition of the contacts, and cannot
be directly connected at the root. When you operate it based on the specified input condition,
the input contact must be used as an edge contact.
M000.00 SC
/
M000.00 RC
F001.08 M001.00
(OUT)
F000.15 SC
F001.08 M001.01
(OUT)
152
Set or reset the carry bit (F1.8) according to the conditions of contact M0.0. In other words, designate
F1.8 to Set when M0.0 is OFF and designate F1.8 to reset when M0.0 is ON.
CC operates for the contact F0.15 that is always set to ON and then the carry is reversed.
The output M1.1 is always the opposite of M1.0 due to the contact F1.8.
153
Finding Max./Min.value
Mnemonic No. of
Name Ladder Description
Instruction Words
5 write it into D.
5 write it into D.
1. MAX instruction finds Max. value among Ns Word/Double words/Real Data Value from S,
and then write it into D. Min instruction finds Min. value among Ns Word/Double Words/Real
Data Value from S and then write it into D.
2. Runtime error can be occurred if the sum of output address and size exceed the max.
memory size, and then CPU will stop.
3. If Signed operating execution Flag (F13.03) is On, it will take negative sign.
F001.0 MLET
D=W 100
N=4
S1=3478
S2=2581
S3=247
S4=192
M AX
D=W 200
S=W 100
Ns=4
MIN
D=W 202
S=W 100
Ns=4
Max. value adming 4 words from W100 can be stored into D. The max. value is 3478.
Min. value among 4 words from W100 can be stored into D. The min. value is 192.
Average Instruction
Mnemonic No. of
Name Ladder Description
Instruction Words
5 write it into D.
F001.0 MLET
D=W 100
N=4
S1=3478
S2=2581
S3=247
S4=192
AV G
D=W 200
S=W 100
Ns=4
Average value among 4 words from W100 can be stored into D. The average value is
(3478+2581+247+192)/4=1624.5, so, D can be round down to 1624.
Stored value to S
Address Stored Value
S (W100) 3478
S+1 (W101) 2581
S+2 (W102) 247
S+3 (W103) 192
156
Mnemonic No. of
Name Ladder Description
Instruction Words
5 write it into D.
1. If SUM value exceed Word, or Double Words, Set Overflow flag and store the high value
exceed set value into SR20~SR21.
2. Runtime error can be occurred if the sum of output address and size exceed the max.
memory size, and then CPU will stop.
3. If Signed operating execution Flag (F13.03) is on, it will take negative sign.
F001.0 MLET
D=W 100
N=4
S1=3478
S2=2581
S3=247
S4=192
D=W 200
S=W 100
Ns=4
Mnemonic No. of
Name Ladder Description
Instruction Words
1. SORT instruction sort data value among Ns Word/Double Words/Real Data value from S in
an ascending order / descending order, and then store it into D.
2. If Method value is 0, sort it in an ascending order. If 1, sort it in a desending order.
3. Runtime error can be occurred if the sum of output address and size exceed the max.
memory size, and then CPU will stop.
4. If Signed operating execution Flag (F13.03) is on, it will take negative sign.
F001.0 MLET
D=W 100
N=4
S1=3478
S2=2581
S3=247
S4=192
SORT
D=W 200
S=W 100
Ns=4
Method=0
Sorting 4 words from W100 and then store them to D in order of size.
Mnemonic No. of
Name Ladder Description
Instruction Words
SCALE
D =
SCALE S =
S1 = 5 Scaing word (double word/real number)
S2 =
DSCALE value of S by function with S1 and S2
D =
DSCALE Data Scale S =
values, and then store is into D.
S1 = 6-8
S2 =
FSCALE (D= S1xS + S2)(Function value of value
D =
FSCALE S = y=ax+b).
S1 = 6-8
S2 =
SCP
D =
S =
SCP SMin=
SMax= 7
DMin=
DMax= Scaling word (double word, real number) of
DSCP
Data D = S by function with SMin, SMax, DMin, and
S =
DSCP Parameter SMin=
DMax value, and then store it into D.
SMax= 12
Scale DMin=
DMax=
(D=[(Dmax-Dmin)/(Smax-Smin)]*(S
FSCP
D =
S =
Smin)+Dmin)
FSCP SMin=
SMax= 12
DMin=
DMax=
1. SCALE, DSCALE, and FSCALE instructions plot a straight-line graph containing S1 (slop
value) and S2 (Offset value) and then stored to D by scaling according to S value.
2. SCP, DSCP, and FSCP instructions plot a straight-line graph with 2 passage point value and
no slop value. SCP instruction is good for use to output D value operating according to S
value. In SCP, Min and Max value can be scarled. (DMax-DMin)/(SMax-SMin) becomes slop,
and DMin becomes offset value. D or S value should be within max, and min. range.
3. That is, if you know contant value a, and b in function expression y=ax+b, SCALE instruction
can be used. If you do not know a and b value in the general expression, know 2 passage
points, SCP can be used.
4. In case of SCALE, DSCALE, SCP, and DSCP, data will be lost by overflow or round down.
Generally point is required for function operation. Thus, the FSCALE and FSCP instruction
are used for general function operation.
5. Except D and S, 16/32 bit word data, and floating point data can be input for other variables
according to instruction.
162
If M0.0 is ON, W200 value assigned S is scaled by S1 x S + S2 type and then the result W200 X 2 +
25 is stored into W100.
The expression is y=2x + 25
Thus, if S (W200) value is 100, D (W100) is 225.
(2000,1500)
D
(120,350)
S(500)
If M0.0 is on, 500 assigned to S is stored to W200, and slop is [(DMax - DMin)/(SMax - SMin)]=(1500-
350)/(2000-120)= 0.61170212766. Thus, D=0.6117(500-120) + 350) =582.4468.
Mnemonic No. of
Name Ladder Description
Instruction Words
LIMIT
L I MI T D =
5
Set Limit S = Set limit to Word/Double Words/Real S
D L I MI T
Low=
F L I MI T High= 5-7 value, and store the result into D.
D.
BIAS
BIAS D = If input value of Word/double word value S
S = 5
DBIAS Set Bias
Low= is 0, output is 0. If not 0, set bias to high
FBIAS 5-7
High=
value and then store it into D.
1. The limit is used to so that the S value may not exceed the high limit value (High) and low
limit value (Low) range.
2. As for the limit, if S is within the range between High and Low value, the S value is saved in
D; if S is below the Low, the Low value is saved in D; and if S is above the High, the High
value is saved in D. That is, if Low <= S <= High, D=S; if S>High, D =High; and if S<Low,
D=Low.
3. LIMIT is the instruction for word value processing; DLIMIT for double word; and FLIMIT for
real number.
4. D and S can use the register (R, L, M, K, W, D, SV, PV and SR); and Low and High can use
the register or data value.
5. As for BAND, if S is within the range between High and Low, 0 is saved; and if the range is
deviated, the deviation value is calculated to be saved in D. That is, if Low <= S <= High,
165
D=0 is saved; if S>High, D = S-High; and if S<Low, D= Low-S. Note) When the result of
BAND instruction operation is a negative (-) number, if the sign handing (bit F13.3) is ON,
such value is represented as a negative number; if a positive (+) number handling operation
is enabled, + value is saved all the time.
6. The BIAS instruction adds the bias value to S value and saves the result to D. If S = 0,
D=0; if S > 0, D= S+High; and if S<0, D=S+Low.
7. The negative number area or the minus (-) slope is enabled when the signed instruction
execution flag (F13.03) is on.
As for the LIMIT instruction, if value 1000 is applied to W0, as soon as M0.0 is turned on, the value 25
is saved in W100 because 1000 is bigger than the High value 25.
166
As for the BAND command, as soon as M0.1 is turned on, the value 975 (= W0 value – High value
25) is saved in W200 as 1000 is a positive value.
As for the BIAS command, as soon as M0.2 is turned on, the value 1025 (= W0 value + High value
25) is saved in W300 because 1000 is a positive value and bigger than High.
167
Mnemonic No. of
Name Ladder Description
Instruction Words
Data
C o n ve r s i o n N2F
Convert 16bit (word) integer with sign into
N2F D=
4
(Dec 1 W ord S=
Floating Point ) floading point.
Data
C o n ve r s i o n F2N
Data conversion instructions
F2N D=
(Floating Point S= 4-5
D E C I wo r d ) (Floating PointDEC 1 word)
Data
C o n ve r s i o n L2F
Convert 32bit (double word) integer with
L2F D=
(Dec 2 W ord S= 4
Floating Point ) sign into floading point.
Data
C o n ve r s i o n F2L
F2L D=
Convert floating point into 32 bit integer with
( Floating Point S= 4-5
D E C 2 wo r d ) sign
D2R
Degree to
D2R Radian D=
4 D(Radian) = S(Degree) x π/180
S=
R2D
R2D Radian to D=
Degree 4 D(Degree) = S(Radian) x 180/π
S=
1. These conversion instructions take only integer with sign. Be careful when you use integer
without sign to integer operate before conversion or after conversion.
2. When floating point is converted into integer by using F2N and F2L, values after point is
rounded down.
3. Double Word can be assigned for an area that floating point is stored or will be stored.
4. If constant values are assigned for S operand of F2N or F2L instruction, it assigned as 2
words up to max. 5 words.
5. Double word addresses such as R, L, M, K, W, and D, etc can be assigned for the D and S,
and integer can be assigned for S area as well.
168
If M0.0 contact is on, it converts M30 (25) into point and sotres 25.0 to M32. Double word can be
assigned to M32.
If M0.1 contact is on, it converts point value of M32 word (25.0) into DEC (25), and then stores it to
M34. Values after Point will be rounded down.
If M0.0 is on, it converts M40 (345678) into point and then stores 345678.0 to M42 word.
If M0.1 contact is on, it converts point value (345678.0) of M42 word into DEC 345678 and then
stores it to M44. Values after Point will be rounded down.
169
If M0.0 is on, it converts M40 (90.0) into Radian and then stores the Radian value (1.570796) to M42
word.
(Radian = Degree (90.0) x π/180)
If M0.1 contact is on, it converts Radian value (1.570796) of M42 word into Degree value (90.0) and
then stores it to M44.
(Degree= Radian (1.570796) x 180/π)
170
Mnemonic No. of
Name Ladder Description
Instruction Words
STLET
String size is stored to D address. String
3+String
S TL E T String Let D=
S= information from D+1 address input to S is
(4~65)
stored.
stores it to D.
STEXR
D =
S TE X R String Extract S = Extract N strings start from Pos character in
Pos= 5
N = S sting and then store it to D.
S TR S T= = String ST==
Comparision Compare string A and B whether they is
O R S T= = A =
3
B =
A N D S T= = (A=B) same or not. If same, it is on.
S TR S T< > String ST<>
Comparision Compare string A and B whether they is
O R S T< > A =
3
B =
A N D S T< > (A≠ B) same or not. If not same, it is on.
SEARCH
Search S2 strings from Pos in S1 and then
D =
SEARCH String S1=
Searching POS= 5 store the character to D. S1 and S2 should
S2=
be String type.
1. String processing instructions stores number of characters to staring address. And then the
first character in this string is stored to Low bite of Next address.
2. S can be directly input to “ ” in STLET. Up to 62 characters can be input.
3. If you excute STLET, STADD, and STEXR, reisgers as 32 Words(1Word + 62 Byte) from D
address register without input strings are initialized and then strings are input.
4. String cannot be directly input to instruction excep STLET.
If M0.0 is on, 5 is input to W100, and strings are input from W101 to W103 in order of Low byte.
171
MSB LSB
W100 5 String length (number of characters) is stored.
If M0.0 contact is on, Hello and Friend string is stored start from W100 and W110.
If M0.2 contact is on, „Hello Friend‟ is stored start from W120. Characters of String are stored to W120,
and then strings from W121 to W110 are stored first. Strings in W100 are stored after.
th
If M0.3 contact is on, 6 string is extracted from 7 th strings stroed in W120 and stored it to W140.
Compare the stored characters stored in W110 and W140, and then displayes it to M0.10.
172
stored.
W100 5
MSB LSB
W110 7 String length (number of characters) is stored.
stored.
W120 12
stored
W140 7
During M0.0 is on, it searches S2 strings from Pos of S1 and then store the result to D.
If W10 = “1234567890”, Pos=3, and W100= “4567”, 2 will be displayed at W0.
174
Mnemonic No. of
Name Ladder Description
Instruction Words
created.
D address.
I2A
Read values on D address as 16 bit integer
Integer ASCII
I2A D =
C o n ve r s i o n S = 3 and convert it into 6 strings. And then stores
D address.
address.
6. If A2I and N value of A2L is smaller than actual value, error for S value of A2H, A2L and A2I
is not occurred.
If M0.1 is on, HEX value $00A5B3C1 stored in W100 is converted into ASCII code and then stored
from Low byte in W200 in order of A, 5, B, 3, C, and 1.
If M0.2 is on, 6 characters in W200 W201 and W202 are converted into HEX from Low byte in W200
and then stored to from W300 to W301.
H2A Result (Conver 3 byte HEX code from W100 into ASCII code and store it from W200 in reverse
order)
A2H Result (Convert 6 byte ASCII code from W200 into HEX and store it from W 300 in reverse
order)
176
I2A Result (Convert DEC integer with sign of W100 into ASCII code and then stored from Low byte in
W200 in reverse order)
A2I Result (Conver 6 byte ASCII code from W200 into Integer and then stores it to W300)
177
178
Mnemonic No. of
Name Ladder Description
Instruction Words
S i n e C o n ve r s i o n SIN
D = SIN ( S ),
SIN 4
Arc Sine D=
ASIN C o n ve r s i o n S=
D = ASIN ( S )
Cosine
COS C o n ve r s i o n COS
D = COS ( S ),
D=
ACOS Arc Cosine S= 4
C o n ve r s i o n D = ACOS ( S )
Ta n g e n t
TAN C o n ve r s i o n T AN
D = TAN ( S ),
D=
A TA N A r c Ta n g e n t S= 4
C o n ve r s i o n D = ATAN ( S )
1. Real number can be assigned for D and S area. Double word addresses such as R, L, M, K,
W, SV, PV, and SR, etc can be assigned for the D area and real number for S.
2. Radian value can be assigned for S value of Trigonometric functions.
3. SIN instruction operates sign function for S, and then stores it into D.
4. COS instruction operates cosign function for S, and then stores it into D.
5. TAN instruction operates tangent function for S, and then stores it into D.
If M0.0 is ON, it converts M42 (0.7853982) to Sin, and then stores 0.7071068 into M50 word.
It convers M42 (0.7853982) to Cos, and then stores 0.7071068 into M52 word.
It converts M42 (0.7853982) to Tan, and then stores 1.0 into M54 word.
180
Mnemonic No. of
Name Ladder Description
Instruction Words
SQRT
SQRT Square Root D= 4
S= D = SQRT ( S )
EXP
E XP E xp o n e n t D=
S= 4 D = EXP (S) (The E square of S)
LOG
LOG Log D=
D = LOG (S) ( common logarithms, 10 base
S= 4
log)
LN
LN Natural D=
Logarithms S= 4 D = LN (S) (e=2.71828 base log)
POWER
P OW E R Square D= D = S1^S2 (extract S1square of S2 and
S1= 5
S2= then sotre to D)
1. Both D and S is real numbers. Double word can be assigned for R, L, M, K, and W. Real
number can be input in S.
2. S value on Square Root (SQRT) is positive number. If negative numbers are input, error is
occurred.
Square Root
3. Exp instruction extracts the S involution of “e(2.71828)", and then store it into D.
s
Sqare D = e
4. Log instruction is common logarithms arithmetic operation, and LN is Natural Logarithms
arithmetic operation.
S2
5. Power instruction extracts the involution, and then stores the result to D. D = S1
181
LOOP.)
1. The FOR (DFOR) instruction executes a block by repeating itself to NEXT until the value of
the word D is 0. General instructions or branch instructions such as JMP and CALL can be
used in FOR to NEXT instruction block. The number of execution (D value) can be changed
even while the program is running.
2. When the D value of the FOR instruction is 0, it will be divided into the corresponding NEXT
instructions.
3. The FOR (DFOR) instruction and the NEXT instruction should be used in pair at all times. In
NEXT instruction, the operand does not exist.
4. When the input condition of the NEXT instruction is OFF, the FOR (DFOR) instruction will
loop only once. Only when the input condition is ON, the FOR (DFOR) to NEXT instruction
will loop repeatedly.
5. The word addresses such as R, L, M, K, and W can be assigned for the D area. The FOR
instruction can designate word addresses and the DFOR instruction can designate the value
of the double word.
6. Please be aware of the use of FOR (DFOR) instruction. Scan time can increase when the D
value is enlarged because the enlargement causes excessive execution of the loop.
7. The FOR and DFOR instructions can normally operate under the same condition of the
contacts, and cannot be directly connected at the root. When you operate it based on the
183
specified input condition, the input contact must be used as an edge contact.
F0.15 contact point is always ON during running, and store value of 5 to M20 word in every scan.
FOR and NEXT section is repeted whenever M0.0 is ON, and M20 word is reduced by 1 in every
execution. When it becomes 0, go to next instruction of NEXT.
That is, due to M20 is 5, it is executed 5 times whenever M0.0 contact point is on, and M21 word will
be incremented by 5 for one SCAN by the INC instruction
Output M1.0 goes on when M21 word value is 20 or more (after 4 times or more execution).
184
1. Use the JMP instruction to forcefully jump the circuit without changing a part of the circuit
during the processing of the program. The Lb ranges from 0 to 63.
2. The JMP instruction and the LBL instruction should be used in pair at all times and the Lb
number cannot be used repeatedly.
3. The jump location (LBL) instruction should be located after the jump start instruction (JMP).
4. The JMP instructions can be used between the LBL instructions that are used with the JMP
instruction.
5. The JMP instructions can normally operate under the same condition of the contacts, and
cannot be directly connected at the root. When you operate it based on the specified input
condition, the input contact must be used as an edge contact.
6. The LBL instruction must be directly connected from the root at all times and must be used
without any input condition.
F001.04 M001.00
(OUT)
F000.15 JM P
Lb=1
F001.04 INC
R D=M20
LBL
Lb=1
F001.04 INC
R D=M21
The contact F1.4 is an internal contact that changes into ON/OFF every second. At the same time,
the output M1.0 is set to ON for 0.5 second and OFF for 0.5 second (for monitoring operation status).
185
As the JMP instruction always operates by the contact F0.15 that is always set to ON, the internal
contact F1.4 and the INC (word M20) instruction do not operate.
The contact F1.4 operates after the jump is completed by the LBL instruction. The value of the word
M21 of the INC instruction increases by 1 every second
186
Jump Instructions
JMPE
End of jump. (Paired with JMPS)
JMPE 1 All models
(Must be located after JMPS instruction)
1. Use the JMP instruction to forcefully jump the circuit without changing a part of the circuit
during the processing of the program. It jumps to the JMPE instruction without the operand.
2. The JMP instruction and the LBL instruction should be used in pair at all times and the LBL
instruction must be located after the JMPS instruction.
3. The JMPS instructions can normally operate under the same condition of the contacts, and
cannot be directly connected at the root. When you operate it based on the specified input
condition, the input contact must be used as an edge contact.
4. The LBL instruction must be directly connected from the root at all times and must be used
without any input condition.
F001.04 M001.00
(OUT)
F000.15 JMPS
F001.04 INC
R D=M20
JMPE
F001.04 INC
R D=M21
The output M1.0 is set to ON for 0.5 seconds and OFF for 0.5 seconds with the contact F1.4.
As the contact F0.15 makes the JMPS instruction to operate and jump to the JMPE instruction, the
word M20 of the INC does not increase.
The JMPE instruction makes the jump to be completed and then the contact F1.4 operates.
187
The value of the word M21 of the INC instruction increases by one every second.
Subroutine Instructions
SBR
Start subroutine
SBR Sb= 2 All models
Sb = 0 to 63 (uses 64 Sbs, no duplicates)
RET
End subroutine. Return execution to instruction after
RET 1 All models
CALL.
1. CALL instruction calls and executes the subroutine. It calls all programs of the subroutine
numbers and then processes them.
2. It executes the RET instruction that ends a subroutine and then reverts it after the CALL
instruction.
3. 64 subroutines from 0 to 63 can be assigned for Sb of the CALL and SBR instruction. The
CALL instruction must exist prior to the SBR/RET instruction.
4. The Sb number of the CALL instruction can be duplicated. The SBR and RET instruction
cannot be used repeatedly and must be used together at all times. The RET instruction must
be located after the SBR.
5. The actions of CALL instructions can normally operate under the same condition of the
contacts, and cannot be directly connected at the root. When you operate it based on the
specified input condition, the input contact must be used as an edge contact.
6. The SBR and RET instruction must be directly connected at the root at all times and must be
used without any input condition.
7. As the program cannot operate after the subroutine block that is composed of the SBR and
RET instruction, the program for processing the sequence must be located ahead of the
SBR instruction at all times for operating.
188
The output M1.0 will be set to ON for 0.5 seconds and OFF for 0.5 seconds with the contact F1.4.
M1.0 enables the CALL 3 to execute the subroutine No.3 program every second. In the subroutine,
the contact F0.15 enables the INC instruction to operate. Because it increases by 1 every time for one
scan, the word M23 increases by 1 every second.
F1.3 is an internal contact of 0.2-second clock and is set to ON/OFF for 0.1 seconds. In other words,
the action of CALL 5 executes No.5 program of the subroutine. The word M25 increases by 1 every
0.2 second by the INC instruction of subroutine No.5.
189
Mnemonic No. of
Name Ladder Description
Instruction Words
INT
INT Interrupt 2 Begin block of constant cycle scan
V=
instructions.
RETI
R E TI Return Interrupt End block of constant cycle scan
1
instructions
1. Interrupt function changes from F/W V3.xx or later, and this is only for V3.xx or later. It is
incompatible with F/W V2.xx.
2. Intrupput type is set by V value.
V Interrupt Type
2 HSC0 Interrupt
9 PTO0: R16.0
10 PTO1: R16.1
3. Constant Cycle Interrupt is applied to NX plus all models. Other interrupts is only for NX7
and NX7S V 3.0 or later.
4. Interrupt control setting is done through the register settings of the system from SR480 to
SR486.
5. Only one constant scan instruction can be used in the program.
6. The INT and RET1 instruction must be directly connected at the root at all times and must be
used without any input condition.
7. Interrupt routine is executed before the scan time of main program.
8. If the time that takes to execute the constant scan routine is longer than the scan time of
main program, the program will not work normally. Thus, the constant scan routine should be
190
sec)
RETI
RETI End block of constant cycle scan instructions 1 Note 1)
Note 1)
Applicable Model
NX700
N70 Plus NX70 Plus N/NX700 Plus
SPC100 Plus
Model SPC-10 SPC300 A200 9215A, CPU70p1/v2 7215A,
24S/120S CPU700p/
9216A CPU70p2/V2 CPU700p
V2
Support x x o o o o o o
1. Use the constant cycle scan instruction to periodically operate a certain program block (from
the INT instruction to RET1 instruction), regardless of the scan time. Number from 0.02
seconds to 10 seconds can be assigned for this instruction.
2. In the constant cycle scan, time is set in 10 mSec module by the V value + 1. Its formula is
Constant cycle time = (V+1) x 0.01 sec. If the V value is 3, the formula is (3+1) x 0.01 = 40
mSec.
3. Only one constant scan instruction can be used in the program.
4. The constant scan instruction is controlled by the internal contact F0.11 and operates only
when the contact is ON.
5. The INT and RET1 instruction must be directly connected at the root at all times and must be
used without any input condition.
6. If the time that takes to execute the constant scan routine is longer than the scan time of
main program, the program will not work normally. Thus, the constant scan routine should be
made with the least number of steps.
194
The output M1.0 will be set to ON for 0.5 seconds and OFF for 0.5 seconds with the contact F1.4.
The INT instruction operates when M0.0 is set to ON. When it is set to OFF, instruction from INT to
RETI will not work.
The value of the word M20 increases by one at every scan with F0.15.
The constant cycle area has the V value of 9, and operates in unit of (9+1) x 10 mS = 100 mSec. The
word M23 increases by one at every 100 mSec. Periodical program operates only when the contacts
M0.0 and F0.11 are set to ON.
195
Note 1)
Applicable Model
NX700
N70 Plus NX70 Plus N/NX700 Plus
SPC100 Plus
Model SPC-10 SPC300 A200 9215A, CPU70p1/v2 7215A,
24S/120S CPU700p/
9216A CPU70p2/V2 CPU700p
V2
Support x x o o o o o o
1. In the PLC, I/O data is handles in the following order: Diagnose CPU Transmit input data
Execute program Process output data Process communication and other data.
2. Use the INPR and the OUTR instruction to transmit I/O data during the program scanning. It
is also used to detect quick input pulse and set initial data of specialty module.
3. The INPR instruction updates the data from the input module to input register during the
execution of the program. Ch is the word address of the designated input, excluding number
for R.
4. The OUTR instruction transmits the value of output register that is executing a program to
the output module and then updates it. Ch is the word address of the designated output,
excluding number for R.
5. The value from 0 to 63 can be assigned for Ch. Address of the I/O module that is mounted
onto the backplane can be designated, and I/O of the remote area cannot be used.
196
The following example describes the installed I/O modules that are input R0, R1, and high speed
counter (input R2, output R3).
This program receives data from the input unit and then runs program every scan. It checks any
change in the date of the input unit during running the program. In other words, it stores input R1 word
of the starting point of the program at W1. It calls the changed value from the input unit to the INPR
instruction and then stores it into R1. If W1 and R1 are different, it means there is any change in the
input contact.
It checks this change at every scan and stores the difference into W2.
197
END
End program. (The end is automatically created in
END 1 All models
CPU)
Note 1)
Applicable Model
NX700
N70 Plus NX70 Plus N/NX700 Plus
SPC100 Plus
Model SPC-10 SPC300 A200 9215A, CPU70p1/v2 7215A,
24S/120S CPU700p/
9216A CPU70p2/V2 CPU700p
V2
Support x x o o o o o o
1. The WAT instruction resets the elapsed value of the watchdog timer while the program is
running to prevent the program from stopping even if the scan time exceeds the watchdog
time.
2. In CPU, programs are processed in scan module. Scan time refers to the time to execute
program, I/O signal, and others.
3. When the scan time is longer than watchdog time, the CPU assumes that there is a problem
in processing the program. Then it stops the execution and creates an error.
4. The watchdog timer checks the length of the scan time is different every time it runs. The
watchdog time sets the maximum time that takes to stop program when any error occurs in
the program. The initial default watchdog time is 3000 mSec.
5. If the time is expected to exceed the watchdog time, the WAT instruction initializes the
elapsed time of the watchdog and the resolves all the errors.
6. The WAT instructions can normally operate under the same condition of the contacts, and
cannot be directly connected at the root. When you operate it based on the specified input
condition, the input contact must be used as an edge contact.
7. The END instruction ends the program. The end of the program will be automatically
generated by the CPU.
8. Use the END instruction to check some parts of the program or forcefully end the program.
198
9. The END instruction must be directly connected at the root at all times and must be used
without any input condition.
10. The WAT and END instruction is used only with instructions without any operand.
The word M3 substitutes $5555 for 0.5 seconds and $AAAA for 0.5 seconds with the contact
F1.4. This example displays how the program runs.
When the M5.0 is set to ON, the elapsed time of the watchdog timer will be initialized.
If the END instruction makes the program to forcefully shutdown, F1.4 will make the output contact
M1.0 not to operate.
199
Mnemonic No. of
Name Ladder Description
Instruction Words
SET_HSC
Ch=
HSC Mode=
S E T_ H S C parameter Start= 11
setting CmpH=
Set HSC function parameter in PLC
CmpL=
SV=
HSC
HSC HSC
E xe c u t i o n D= 3 Execute HSC function in PLC
CH=
1. CH designates channels to set, and Mode sets Operation Mode. Only constant value can be
assigned.
2. During input EN signal is on, the designated constant value can be assigned for the EN
register
3. If RUN signal is input, the RUN function is executed and then diplay CV to the designated
PV register.
4. In case of HSC input, if Ring input is on, Ring count is excuted
5. If you designate same Ch at the same time, error may occur because PWM and PTO use
same internal register.
6. Following table shows summary of the functions.
Instructions Operand Size Descriptions
SET_HSC Ch 1W HSC Ch number
Mode 1W Set HSC mode
Start 2W HSC Preset Value
Cmp H 2W The upper limit of HSC
comparing output
Cmp L 2W The lowest limit of HSC
comparing output
SV 2W HSC Set Value
HSC D 2W HSC Present Value
Ch 1W HSC Ch number
200
High Speed Counter is the function to be used for sequence and operations because it is faster than
the speed period (scan time) that CPU operates programs and it counts short pulses. It is designed to
use between R0.0 and R0.3 (R0.4 to R0.7), which is used for the normal contact, as the internal bit
setting for the high speed counter and to receive the voltage of DC12 to 24V as a signal type like the
contact. When High Speed Counter is used, the pulse input mode and the encoder mode are
distinguished in accordance with the setting.
Input Option
Parameter Setting
Control Setting
Input Terminal
Mnemonic No. of
Name Ladder Description
Instruction Words
SET_PW
M
Ch=
PW M Mode=
S E T_ PW M parameter Freq= 6
Setting SV=
Set PWM function parameter in PLC
Duty=
PWM
PW M PW M
E xc u t i o n D= 3 Set PWM function in PLC
CH=
1. CH designates channel to set, and Mode sets Operation Mode. Only constant value can be
assigned.
2. If EN is on, designated constant value assigned to the internal register.
3. PWM and PTO use the same internal registers at the same time. It may cause of malfunction
that same channel is designated at the same time.
4. Following table shows each instruction‟s functions.
Privious Version
Overview
High Speed Pulse Output is the function to be used for sequence and operations because it is faster
than the scan time that CPU operates programs and it outputs short pulse. It is designed to use
between R16.0 and R16.3, which is used for the normal contact, as the internal bit setting for the high
speed output. When High Speed Output is used, the PWM (Pulse Width Modulation) mode and the
PTO (Pulse Transition Output) mode are distinguished.
Output Option
NX7: Max. PTO: 10 KHz, PWM: 5 KHz, 2 Channel (But, If PWM, Duty is 20% ~ 75%)
NX7R: Max. PTO: 60 KHz, PWM: 30 KHz, 2 Channel (But, If PWM, Duty is 10% ~ 85%)
Parameter Setting
Contorl Setting
Output Termination
Output
** Contents in () are for CH1 only.
206
Mnemonic No. of
Name Ladder Description
Instruction Words
SET_PTO
Ch=
P TO Mode=
S E T_ P T O Parameter Freq= 9
Setting SV= Set PTO parameter in PLC
Start=
Acc=
Dcc=
PTO
P TO P TO
E xc u t i o n D= 3 Excute PTO in PLC
CH=
1. CH designates channels to set, and Mode sets Operation Mode. Only constant value can be
assigned.
2. During input EN signal is on, the designated constant value can be assigned for the EN
register
3. If RUN signal is input, the RUN function is executed and then diplay CV to the designated
PV register.
4. In case of HSC input, if Ring input is on, Ring count is excuted
5. If you designate same Ch at the same time, error may occur because PWM and PTO use
same internal register.
Following table shows summary of the functions.
Privious Version
207
Mnemonic No. of
Name Ladder Description
Instruction Words
SET_PID
Parm=
Control=
SP=
PV=
Kc=
PID Ti=
S E T_ P I D Parameter Td= 15
Setting L-Time= Set PID parameter
FF/Bias=
DB=
SPmax=
SPmin=
CVmax=
CVmin=
PID
PID PID Parm=
E xc u t i o n 2 Excute PID instruction
To keep the process controlled variable (PV) of humidity, pressure, flux, liquefaction, etc. at the level
of the Set Point (SP), the operations of PID is carried out and the output as the result is sent to the
209
Input Input/Output
Index Symbol Contents
Output Range
0 STATUS Display PID Status Output Bit
1 CONTROL Set PID Contorl Mode Input Bit
2 SP Set Value Input -32768 ~ 32767
3 PV Current Value Input -32768 ~ 32767
4 CV Output Value Input -32768 ~ 32767
5 Kc Proportional Gain Input 0 ~ 32767
6 Ti Intergral Time Input 0 ~ 32767
7 Td Differential Time Input 0 ~ 32767
8 BIAS BIAS Input -32768 ~ 32767
1: Enable, 0: Disable
Bit 4 Set Ti/Td Gain x 10
1: Enable, 0: Disable
Bit 5 Set Set Value Range Limit
1: Enable, 0:Disable
Bit 6 Set TD process ,
1: Error, 0: delta PV
Bit 7 Set Proportional Action process
1: Error, 0: delta PV
213
Set the Set Point of the process controlled variable. (-32768 ~ 32767)
If the SP range limit is enabled, set to SPmin and SPmax.
Input the Process Value of the process controlled variable. (-32768 ~ 32768)
Use the A/D conversion unit to input the value.
If the SP range limit is enabled, set to SPmin and SPmax.
CV
The results of the PID operations are stored. Use the D/A conversion unit to output to the process.
If the CV range limit is enabled, set to CVmin and CVmax.
Kc
Set the control gain used for the PID operations. Set Point x 0.01 is an actual gain.
Set the integral gain used for the PID operations. The range of the Set Point is between 0 and 32767,
and if the Ti/Td Gain x 10 setting is enabled, x10 is an actual gain.
If 0, the integral is not carried out.
Set the Differential Gain used for the PID operations. SPx 10ms is an actual gain.
The range of the Set Point is between 0 and 32767, if the Ti/Td Gain x 10 setting is enabled, x10 is an
actual gain.
214
Bias (FF/Bias)
Set the bias value that is added to the output of the PID operation. (-32768 ~ 32767)
Deadband (ZCB)
Set the minimum value of error that occurs when the PID operation is performed. (0 ~ 32767)
The absolute value of the value of error is smaller than the setting value, the PID operation stops.
Set the maximum value of SP of the process controlled variable. (-32768 ~ 32767)
If range of the Set Point is enabled, it is activated.
A/D conversion unit is recommended to use the maximum value.
Set the maximum value of SP of the process controlled variable. (-32768 ~ 32767)
If range of the Set Point is enabled, it is activated.
A/D conversion unit is recommended to use the minimum value.
Set the maximum value of PID of the process controlled variable. (-32768 ~ 32767)
If range of the Set Point is enabled, it is activated.
D/A conversion unit is recommended to use the maximum value.
Set the minimum value of PID of the process controlled variable. (-32768 ~ 32767)
If range of the Output Value is enabled, it is activated.
D/A conversion unit is recommended to use the minimum value.
215
Check if PID parameter errors occur or not, and display the results.
Caution
PID operating uses 30 words form register in Para. Be careful this area not to use in other operating.
Note) PID
dE : SP-PV
dPV/dt)
dE : PV-SP
dE/dt)
dE : PV-SP
dE : PV-SP
dPV/dt)
dE : PV-SP
dPV :PVn-1 - PV
dE/dt)
dE : PV-SP
dPV :PVn-1 - PV
217
Suspend Instructions
Mnemonic No. of
Name Ladder Description
Instruction Words
SUS
SUS Error V= 2 After error detection, display the system
Detection
stops and error.
If M0.0 goes on, CPU stops Laddre execution, and then turned to Error Stop Mode. CPU is stop
Ladder execution, and then convered Error Stop Mode. At this time, the assigned V value is resitered
to special resiger.
(Check V value at the Online-System >> Information-CPU >> Diagnostic-Misc in WinGPC. Error is
cleared by „Clear Fault‟ Button in WinGPC.)
218
Mnemonic No. of
Name Ladder Description
Instruction Words
SET_DATE
Year =
Set RTC Month= 5 Set Year/Month/Week/Day to Real time
S E T_ D A TE Date Week=
Day= clock on CPU.
GET_DATE
G e t R TC 2 Get Year/Month/Week/Day from Real time
G E T_ D A T E Date D =
on PLC.
SET_TIME
Set RTC HOUR =
4 Set Time/Minute/Second to Real time clock
S E T_ TI ME Ti m e MIN=
SEC=
on PLC.
T2S
S High byte 12 (BCD) D+1:D 1,123,005
Low byte 34(BCD)
S+1 High byte 56(BCD)
Low byte 45(BCD)
S2T
S High byte 12 (BCD) D+1:D 1,123,005
Low byte 34(BCD)
S+1 High byte 56(BCD)
Low byte 45(BCD)
Due to slow uploading speed of SET_DATE and SET_TIME instructions, be careful when you using
them.
220
Mnemonic No. of
Ladder Description Applicable Model
Instruction Words
Read Data (Shared memory of high
performance module)
READ - Read NR3 words from the module memory 5 Note 1)
address NR6 of the slot NN5, and store them
in the register RR1.
Note 1)
Applicable Model
NX700
N70 Plus NX70 Plus N/NX700 Plus
SPC100 Plus
Model SPC-10 SPC300 A200 9215A, 9216A, 7215A,
24S/120S CPU700p/
CPU70p1, V2 CPU70p1, V2 CPU700p
V2
Support x x x x x o o o
1. The high performance I/O module refers to the structure, where the processor and memory
for this module is mounted onto and data is exchanged with PLC CPU. It includes analog I/O,
high-speed counter, position control module, SCU communication module, DeviceNet,
remote module, and link module.
2. Use the READ instruction to read the data of the built-in memory (shared memory) in the
high performance I/O module for PLC CPU.
3. RR1= Starting address to store read data. (PLC CPU‟s register)
NR3= Number of data or register to read.
NN5= Slot number which I/O module is mounted onto. (Refer to the numbers in bit module
and slot number from 0.)
4. NR6= Starting address to be read from on the shared memory of the high performance I/O
module (number/register).
5. The READ instruction can normally operate under the same condition of the contacts, and
cannot be directly connected at the root. When you operate it based on the specified input
condition, the input contact must be used as an edge contact.
221
This example shows how to designate the address with shared memory system for the high
performance input module and read the data in the shared memory data.
This is the instruction to read the content of 8 words (from 0 to 7) in shared memory area (from 0 to
52 words) of the analog input unit and store the value at W2 to W9.
222
Mnemonic No. of
Ladder Description Applicable Model
Instruction Words
Write Data (Shared memory of high
performance module)
WRITE Read NR3 words from NR5 and write them to 5 Note 1)
slot NN1, module memory address NR2.
NX700
N70 Plus NX70 Plus N/NX700 Plus
SPC100 Plus
Model SPC-10 SPC300 A200 9215A, 9216A, 7215A,
24S/120S CPU700p/
CPU70p1, V2 CPU70p1, V2 CPU700p
V2
Support x x x x x o o o
1. The high performance I/O module refers to the structure, where the processor and memory
for this module is mounted onto and data is exchanged with PLC CPU. It includes analog I/O,
high-speed counter, position control module, SCU communication module, Device Net,
remote module, and link module.
2. Use the WRITE instruction write (transmit) the data of the built-in memory (shared memory)
in the high performance I/O module for PLC CPU.
3. NN1= Slot number of the high performance I/O module. (Refer to the numbers in bit module
and slot number from 0).
NR2= Starting address of the module shared memory to write in the high performance I/O
module (number/register).
NR3= Number of data or register to write.
NR5= Starting address of the PLC CPU to write (number/register).
4. The WRITE instruction can normally operate under the same condition of the contacts, and
cannot be directly connected at the root. When you operate it based on the specified input
condition, the input contact must be used as an edge contact.
This example shows how to designate addresses with shared memory system for the high
performance analog output module and write the data in the shared memory of the module. Shared
223
This is the instruction to transmit 4 words (W2 to W5) of CPU to area 0 to 3 for shared memory (word
0 to 47) of the analog output unit.
224
Mnemonic No. of
Ladder Description Applicable Model
Instruction Words
Read Data (Shared memory of high
performance I/O module mounted onto the
backplane of the remote slave (local))
RMRD - Read NR1 words from the shared memory 7 Note 1)
NR6 of the slot number NN5 on the station
NN4 of the remote loop NN3 and store them
in the register RR2.
NX700
N70 Plus NX70 Plus N/NX700 Plus
SPC100 Plus
Model SPC-10 SPC300 A200 9215A, 9216A, 7215A,
24S/120S CPU700p/
CPU70p1, V2 CPU70p1, V2 CPU700p
V2
Support x x x x x o o o
1. The high performance I/O module refers to the structure, where the processor and memory
for this module is mounted onto and data is exchanged with PLC CPU. It includes analog I/O,
high-speed counter, position control module, SCU communication module, Device Net,
remote module, and link module.
2. Use the RMRD to read the data of the built-in memory (shared memory) in the high
performance I/O module in the backplane of the remote slave (local) for PLC CPU.
3. NR1= Number of data or register to read.
RR2= Starting address of word into which the read data is stored (PLC CPU‟s register)
NN3= Number of remote network. (1, 2 or 3: 1 for one remote master) NN4= Number of
slave station connected to the relevant remote network.
NN5= Number of slot which a module to read is mounted onto.
NR6= Starting address of the shared memory to read from the high performance I/O module
(number/register).
4. As the RMRD instruction operates after the scan is completed, it should not operate more
than once at one scan in the relevant remote network.
5. The RMRD instruction can normally operate under the same condition of the contacts, and
cannot be directly connected at the root. When you operate it based on the specified input
condition, the input contact must be used as an edge contact.
225
This example shows how to designate the address with the shared memory system for the high
performance input module in the slot number 4 of the slave ID 5 with the remote master mounted onto
and then read the shared memory data.
This instruction reads the input data of 4-channel analog input unit mounted onto the slave and stores it into
Mnemonic No. of
Ladder Description Applicable Model
Instruction Words
Write Remote Slave Data (Shared memory of
high performance module mounted onto the
backplane of remote slave (local))
RMWR - Read NR5 words from the data/register NR6 7 Note 1)
and store it in the shared memory NR4 of the
slot number NN3 on the station NN2 for the
remote loop NN1.
NX700
N70 Plus NX70 Plus N/NX700 Plus
SPC100 Plus
Model SPC-10 SPC300 A200 9215A, 9216A, 7215A,
24S/120S CPU700p/
CPU70p1, V2 CPU70p1, V2 CPU700p
V2
Support x x x x x o o o
1. The high performance I/O module refers to the structure, where the processor and memory
for this module is mounted onto and data is exchanged with PLC CPU. It includes analog I/O,
high-speed counter, position control module, SCU communication module, Device Net,
remote module, and link module.
2. Use the RMWR Instruction to write data of the built-in shared memory in the high
performance I/O module in the backplane of the remote slave (local) for PLC CPU.
3. NN1= Number of remote network (1, 2 or 3: 1 for one remote master).
NN2= Number of slave station connected to the relevant remote network.
NN3= Number of slot which a module to write is mounted onto.
NR4= Starting address of the shared memory to write in the high performance I/O module
(number/register).
NR5= Number of data or register to write.
RR6= Starting address of CPU stored the data to write (PLC CPU‟s register).
4. As the RMWR instruction operates after the scan is completed, it should not operate more
than once at one scan in the relevant remote network.
5. The RMWR instruction can normally operate under the same condition of the contacts, and
cannot be directly connected at the root. When you operate it based on the specified input
condition, the input contact must be used as an edge contact.
227
This example shows how to designate the address with the shared memory system for the high
performance output module in the slot number 4 of the slave ID 5 with the remote master mounted
onto and then write the data in the shared memory.
This instruction transmits (writes) data 1000 in the 4-channel analog output unit mounted onto the
slave and stores it in W10 to W13 Word when the remote communication is normal.
228
Mnemonic No. of
Ladder Description Applicable Model
Instruction Words
Receive link data word using the link
communication module.
- Read NR1 words from the module memory
RECV NR6 of the slot NN5 for the station NN4 on 7 Note 1)
the link network loop NN3, and write them in
the register RR2.
NX700
N70 Plus NX70 Plus N/NX700 Plus
SPC100 Plus
Model SPC-10 SPC300 A200 9215A, 9216A, 7215A,
24S/120S CPU700p/
CPU70p1, V2 CPU70p1, V2 CPU700p
V2
Support x x x x x o o o
1.
2. Use the RECV instruction to read the data of CPU with a different ID when the link network is
established.
3. NR1= Number of registers or the reception data to read.
RR2= Starting address to store read data. (PLC CPU‟s register)
NN3= Loop number of the link network (1, 2 or 3: 1 indicates that one link is mounted onto
each CPU.).
NN4= Number of slave station connected to the relevant remote network.
NN5= Type of the register to read (0= L Register, 1=M, 2=R, 3=K, 4=SV, 5=PV, 6=W, 7=F).
NR6= Starting address of the register to read. (number/register)– remote CPU
4. As the RMRD instruction operates after the scan is completed, it should not operate more
than once at one scan in the relevant remote network.
5. The RECV instruction can normally operate under the same condition of the contacts, and
cannot be directly connected at the root. When you operate it based on the specified input
condition, the input contact must be used as an edge contact.
This example shows how to read three words from the No.5 of the register R (type 2) located in the
229
link ID No.3 CPU when one link communication module is mounted onto and stored them in the
specified K10 addresses.
The function reads three words from the address R5 of the ID #3 and stores them into the address
K10 to 12 of ID #1 when the link is mounted onto and the transmission is done.
230
Mnemonic No. of
Ladder Description Applicable Model
Instruction Words
Send link data word using the link
communication module.
Read NR5 words from the module memory
SEND NR6, and write them in module memory NR4 7 Note 1)
of the slot NN3 for the station NN2 on the link
network loop NN1
NX700
N70 Plus NX70 Plus N/NX700 Plus
SPC100 Plus
Model SPC-10 SPC300 A200 9215A, 9216A, 7215A,
24S/120S CPU700p/
CPU70p1, V2 CPU70p1, V2 CPU700p
V2
Support x x x x x o o o
1. Use the SEND instruction to transmit the data to the CPU with different ID when the link
network is established.
2. NN1= Loop number of the link network (1, 2 or 3: 1 indicates that one link is mounted onto
each CPU.)
NN2= Number of slave station connected to the relevant remote network
NN3= Type of the register to read (0= L register, 1=M, 2=R, 3=K, 4=SV, 5=PV, 6=W, 7=F)
NR4= Starting address that will store the transmitted register (number/register) – remote
CPU.
NR5= Number of register or data to be transmitted.
NR6= Register address of data to be transmitted
3. As the SEND instruction operates after the scan is completed, it should not operate more
than once at one scan in the relevant remote network.
4. The SEND instruction can normally operate under the same condition of the contacts, and
cannot be directly connected at the root. When you operate it based on the specified input
condition, the input contact must be used as an edge contact.
This example shows to how to transmit (write) five words from the word R4 of the ID No.1 CPU
231
located in the area W10 to W14 of the link ID No.4 when one link communication module is mounted
onto.
Mnemonic No. of
Ladder Description Applicable Model
Instruction Words
Send link data word using the link
communication module.
Read NR5 words from the module memory
RECVB NR6, and write them in module memory NR4 6 Note 1)
of the slot NN3 for the station NN2 on the link
network loop NN1
NX700
N70 Plus NX70 Plus N/NX700 Plus
SPC100 Plus
Model SPC-10 SPC300 A200 9215A, 9216A, 7215A,
24S/120S CPU700p/
CPU70p1, V2 CPU70p1, V2 CPU700p
V2
Support x x x x x o o o
1. Use the RECVB instruction to read the bit data of the CPU with a different ID when the link
network is established.
2. BR1= Bit address to store the received data to be read.
3. NN3= The Loop number of the link network (1, 2 or 3: 1 indicates that one link is mounted
onto each CPU.)
4. NN4= Number of slave station connected to the relevant remote network
NN5= Type of the register to read (0= L Register, 1=M, 2=R, 3=K, 4=SV, 5=PV, 6=W, 7=F)
NR6= Starting address of the register to read. (number/register)– remote CPU, expressed in
Hex.
Example: When the 5th bit of the 3rd word is designated, NR6=$0035 is set.
5. As the RECVB instruction operates after the scan is completed, it should not operate more
than once at one scan in the relevant remote network.
6. The RECVB instruction can normally operate under the same condition of the contacts, and
cannot be directly connected at the root. When you operate it based on the specified input
condition, the input contact must be used as an edge contact.
This example shows how to read the bit location $0012 (word No.1 bit number 2 K1.2) of the register
233
K (type 3) which is located in the Link ID No.3 CPU and store it into the bit M2.0 of ID #1.
Mnemonic No. of
Ladder Description Applicable Model
Instruction Words
Send link data bit using link communication
module.
SENDB - Read NB5 words, and store them in the bit 6 Note 1)
memory NR4 of the slot NN3 for the station
NN2 on the link network loop NN1.
NX700
N70 Plus NX70 Plus N/NX700 Plus
SPC100 Plus
Model SPC-10 SPC300 A200 9215A, 9216A, 7215A,
24S/120S CPU700p/
CPU70p1, V2 CPU70p1, V2 CPU700p
V2
Support x x x x x o o o
1. Use the RECVB instruction to transmit the bit data to the CPU with a different ID when the
link network is established.
2. NN1= Loop number of the link network (1, 2 or 3: 1 indicates that one link is mounted onto
each CPU.)
3. NN2= Number of slave station connected to the relevant remote network.
NN3= Type of the register to be read (0= L Register, 1=M, 2=R, 3=K, 4=SV, 5=PV, 6=W,
7=F).
NR4= Starting address of the register to store (number/register) - remote CPU, expressed in
Hex. Example: When the 5th bit of the 3rd word is designated,
NR6= $0035 is set.
NB5= Value of bit data to transmit.
4. As the SENDB instruction operates after the scan is completed, it should not operate more
than once at one scan in the relevant remote network.
5. The SENDB instruction can normally operate under the same condition of the contacts, and
cannot be directly connected at the root. When you operate it based on the specified input
condition, the input contact must be used as an edge contact.
This example shows how to transmit R3.2 bit value of ID No.1 CPU which is located in M0.1 bit area
235
of the link ID No.4 CPU when one link communication module is mounted onto.
Modbus Controll
Mnemonic No. of
Name Ladder Descriptions
Instruction Words
Commu- device
MODCOMM 6
nication - Reg is storage of NX PLC
1. Modbus communication instructions read or write data that is sent from Modbus RTU.
2. To communicate by using MODCOMM instruction, contact point of F13.8 in COM1 Port and
F13.12in COM2 Port should be enabled.
3. COM1 (1) or COM2 (2) which is embedded in CPU can be specified as communication port.
4. Parameter value between 0 and 233 can be specified as S ID (Slave ID).
5. S Addr (Slave Address) is address of Slave device, and is parameter value.
If RTU device is NX PLC, absolute address symmetric with address of R, M, L, K, W, D, PV,
SV, and SR can be assigned.
6. Reg is PLC internal address processes and stores data after communicate with Slave, and
can specify the R, M, L, K, W, and D word addresses.
7. N is data length that can be specified on protorol, and only constant value should be
specified.
237
8. Status is a word shows current communication status. To check status of each contact point,
specify R, M, L, and K address able to bit-addressing. Bit status values of the specified
address are as following.
Functinal Bit code, 01, 02, 05, and 0F instructions, run equally well in the system.
NX PLC Bit Address Modbus Add Modicon PLC Address
Note
Input / Output Bit Bit Address Input Output
Contact Point
Contact Point
Contact Point
Point
Contact Point
Contact Point
Functional word codes, 03, 04, 06, and 16 instructions, run equally well in the system.
NX PLC Word Address Modbus Add Modicon PLC Address
Note
Input / Output Word Word Address Input Output
Word
Word
Word
Contact Point
Word
240
Value
Value
Register
Register Word
When communication request M0.0 goes on, read 16 bytes data is sent starting at W100 via COM1.
The starting character 12, 16, and 13 are sent sequentially, and then transmisstion is terminated.
When communication request M0.1 goes on, write the value of Modbus RTU on 03 address, and of
K10 and K11 address via COM1.
When communication request M0.0 goes on, read 2 consecutive registers at 0100 address starting
from Modbus RTU on 03 address and store to L10 address.
241
If the communication request M0.1 goes On, write the value of Modbus RTU on 03 address, and of
K10 and K11 address via COM1.
This is a program that repeats Data writing and reading automatically by using PLC COM2 port.
242
243
PLC Communcation
Mnemonic No. of
Name Ladder Descriptions
Instruction Words
Mnemonic No. of
Name Ladder Descriptions
Instruction Words
1. COM1 or COM2 which is embedded in CPU can be specified as the Communication port.
2. Word address such as R, M, L, K, W, and D area can be assigned by TxBuf and RxBuf.
3. 16-bit parameter can be specified by TxLen and RxLen.
4. SChar is starting character to send and EChar is ending character to send.
5. Mode defines starting and eding of transmission and the result is as following. But, if both M0
and M1 are 0, SChar is not sent, and if both M2 and M3 are 0, EChar is not sent.
S0(EN): ON when the communication is start. OFF when the communication is terminated
(S3 is ON).
S1(DN): Off when the communication is start. ON when the communication is terminated.
S2(ERR): ON when the communication error is occurred. At this time, S1 is ON.
S3(BUSY): ON during communication. OFF when the communication is terminated.
S8 - S11: Data length is stored automatically after the communication is terminated.
7. The unit of Time out is 10msec.
8. To use Binary communication instructions, 00 bit of SR270 in COM1 Port and 00 bit of
SR271 in COM2 Port should be enabled. This Enabled contact point should be keep in case
of Binary communication. (In case of SR register, the related bit is set by BSET instruction to
control bit contact point.)
247
When communication request M0.0 goes ON, 16 byte data ara sent starting at W100 via COM1. The
starting character 12, 16, and 13 are sent sequentially, and then transmisstion is terminated.
When communication request M0.1 goes ON, then it waits for 12 received via COM1. When it
detectes 12, then it atarts buffering 16 bytes and then the received data is strored staring at W200.
Once 13 are received, transmisstion is terminated.
When communication request M0.0 goes ON, 16 bytes data ara sent starting at W100 via COM1. The
starting character STX, 16 bytes and Carry Return are sent sequentially, and then transmisstion is
terminated.
When communication request M0.1 goes ON, hen communication request M0.1 goes ON, then it
waits for STX received via COM1. When it detectes STX, then it atarts buffering 16 bytes and then the
received data is strored staring at W200. Once Carry Return received, transmisstion is terminated.
248
Mnemonic No. of
Name Ladder Descriptions
Instruction Words
1. COM1 or COM2 which is embedded in CPU can be specified as the Communication port.
2. Word address such as R, M, L, K, W, and D area can be assigned by TxBuf and RxBuf.
3. 16-bit parameter can be specified by TxLen and RxLen.
249
S0 (EN): ON when the communication is start. OFF when the communication is terminated
(S3 is ON).
S1 (DN): Off when the communication is start. ON when the communication is terminated.
S2 (ERR): ON when the communication error is occurred. At this time, S1 is ON.
S3 (BUSY): ON during communication. OFF when the communication is terminated.
S8 - S11: Data length is stored automatically after the communication is terminated.
7. The unit of Time out is 10msec.
8. To use Binary communication instructions, 00 bit of SR270 in COM1 Port and 00 bit of
SR271 in COM2 Port should be enabled. This Enabled contact point should be keep in case
of Binary communication. (In case of SR register, the related bit is set by BSET instruction to
control bit contact point.)
250
When communication request M0.0 goes ON, 16 bytes data ara sent starting at W100 via COM1. The
starting character 12, 16, and 13 are sent sequentially, and then transmisstion is terminated.
When communication request M0.1 goes ON, then it waits for 12 received via COM1. When it
detectes 12, then it atarts buffering 16 bytes and then the received data is strored staring at W200.
Once 13 are received, transmisstion is terminated.
When communication request M0.0 goes ON, 16 bytes data ara sent starting at W100 via COM1. The
leading character STX, 16 bytes and Carrage Return are sent sequentially, and then transmission is
terminated.
When communication request M0.1 goes ON, then it waits for STX received via COM1. When it
detectes STX, then it atarts buffering 16 bytes and then the received data is strored staring at W200.
Once Carrage Return are received, transmisstion is terminated
251
Mnemonic No. of
Name Ladder Descriptions
Instruction Words
1. Length that can be specified is number of Byte. Low byte is calculated first. Therefore, if the
odd number of byte is specified, the word which is reffered last calculates only low byte
contents.
2. Even operation is done by Byte; the result value is stored in a word. if the top value is not
required, it should be masked.
3. Max. byte length can be specified is 255 bytes.
4. Type can be specified are as follows:
Type=1: CRC16
Type=2: SUM8 or SUM16