Sie sind auf Seite 1von 252

Version 3.

1
2

Table of Contents

Overview of the Instructions for NX Plus Series ..................................................................................... 8


Overview .......................................................................................................................................... 8
Features ........................................................................................................................................... 8
Functions and Performance .................................................................................................................... 9
CPU Performance ............................................................................................................................ 9
Overview of CPU Operation .................................................................................................................. 11
Operation modes and functions per CPU operation switch ........................................................... 11
Mode Functions per Operation Switch Transition State. ............................................................... 11
CPU Initialization............................................................................................................................ 12
Program Diagnosis ........................................................................................................................ 12
Addressing System and Format ............................................................................................................ 14
Addressing System of NX Plus Series........................................................................................... 14
Addressing Format......................................................................................................................... 15
Double Word Addressing ............................................................................................................... 15
Absolute Addressing ...................................................................................................................... 16
Signed ............................................................................................................................................ 18
Indirect Addressing ........................................................................................................................ 19
Format of Instruction ...................................................................................................................... 19
Programing Software ............................................................................................................................ 21
Overview of WinGPC ..................................................................................................................... 21
Operating WinGPC ........................................................................................................................ 21
Running WinGPC ................................................................................................................... 21
Projector Work Procedure ...................................................................................................... 22
Programming Work ................................................................................................................. 22
Saving and Compiling of Program .......................................................................................... 23
Program Download and Monitoring ........................................................................................ 23
Basic Sequence Instructions ................................................................................................................. 25
Contact Instructions ....................................................................................................................... 25
Output Instructions ......................................................................................................................... 25
Output Instructions ......................................................................................................................... 26
Timer Instructions .......................................................................................................................... 26
Counter Instructions ....................................................................................................................... 28
Shift SR Command ........................................................................................................................ 28
3

Detailed Basic Sequence Instructions .................................................................................................. 29


Contact Instructions ....................................................................................................................... 29
Edge Contact Instructions ..................................................................................................................... 33
Arithmetic Edge Instructions ................................................................................................................. 35
Arithmetic Edge Instructions ................................................................................................................. 37
Output Instructions ................................................................................................................................ 38
Arithmetic result and Output Instructions ....................................................................................... 38
Special Coil Output ........................................................................................................................ 40
Block Instructions .................................................................................................................................. 41
Circuit Block Instructions................................................................................................................ 41
Master Control Instructions ............................................................................................................ 43
Overview of the Timer and Counter Instructions................................................................................... 46
Understanding of the Timer/Counter Instructions .......................................................................... 46
ON/OFF/SST Timer ....................................................................................................................... 48
Retentive On-delay timer Instruation ............................................................................................. 54
Counter Instructions .............................................................................................................................. 56
Up/Down Counter .......................................................................................................................... 56
Ring Counter, Up/Down Counter ................................................................................................... 58
Shit SR Instructions ....................................................................................................................... 60
Step Control Instructions ....................................................................................................................... 63
About STEP Controller................................................................................................................... 63
STEP Controller Instructions ......................................................................................................... 65
Substitution, Increment Instructions ...................................................................................................... 68
Binary increase Instructions ........................................................................................................... 68
BCD Increase Instructions ............................................................................................................. 70
Decrease Instructions .................................................................................................................... 72
Real number Increase/Decrease Instructions ............................................................................... 74
Substitution Instructions ........................................................................................................................ 75
Integer Substitution Instructions .................................................................................................... 75
Real Numbers Subtraction Instructions ......................................................................................... 78
Sequential assignment Instructions ............................................................................................... 79
Arithmetic Instructions (Absolute Value, Complement) ........................................................................ 82
Operation on Signed Integers ............................................................................................................... 85
Arithmetic Position Assignment Instructions ......................................................................................... 87
Move Instructions .................................................................................................................................. 89
Word Data Mov .............................................................................................................................. 89
4

Bit Data Move ................................................................................................................................ 92


Indirect Designation Instruction ............................................................................................................. 94
Data Table Processing Insturctions ...................................................................................................... 96
Comparison Instructions ....................................................................................................................... 99
Real Number Comparision Instructions .............................................................................................. 102
Data Range Comparing Instuctions .................................................................................................... 104
Variable Data Range Comparing ................................................................................................. 104
Real Number Data Range Comparing ......................................................................................... 106
Arithmetic Instructions ......................................................................................................................... 108
Arithmetic Instruction (Addition) ................................................................................................... 108
Arithmetic Instruction (Multiplication) ........................................................................................... 110
Arithmetic Instruction (Division) ................................................................................................... 112
Real Number Arithmetic Instruction ............................................................................................. 115
BCD Arithmetic Instruction .................................................................................................................. 117
BCD Arithmetic Instruction (Addition) .......................................................................................... 117
BCD Arithmethric Instructions (Substrucation) ............................................................................ 119
BCD Arithmetic Inscturctions (Multiplication) ............................................................................... 121
BCD Arithmetric Instructions (Division) ........................................................................................ 123
Logical Instructions ............................................................................................................................. 126
Rotation Instructions ........................................................................................................................... 128
Rotation Instructions (Left/Right) ................................................................................................. 128
Rotation Instructions (Left/Right Include Carry) ........................................................................... 131
Instructions .......................................................................................................................................... 133
BCD Number Change Instructions ...................................................................................................... 136
BCD Number Change .................................................................................................................. 136
Encoder Conversion Instructions ................................................................................................. 138
7-Segment Number Change Instruction ...................................................................................... 140
Data Exchange Instructions ................................................................................................................ 142
Word Exchange Instruction .......................................................................................................... 142
Nibble (4bit) Conversion Instructions ........................................................................................... 144
Byte Swap Instruction .................................................................................................................. 146
Word Expantion Instruction .......................................................................................................... 147
Bit Conversion Instructions .......................................................................................................... 148
Bit Counter Instructions................................................................................................................ 150
Carry Bit Insturctions.................................................................................................................... 151
Data Instructions ................................................................................................................................. 153
5

Finding Max./Min.value ................................................................................................................ 153


Average Instruction ...................................................................................................................... 155
Data Sum Instruction ................................................................................................................... 157
Data Sorting Instruction ............................................................................................................... 159
Function Instructions ........................................................................................................................... 161
Data Limit Instructions ......................................................................................................................... 164
Floating Point Conversion Instructions ............................................................................................... 167
String Instructions ............................................................................................................................... 170
String Conversion Instructions ............................................................................................................ 174
ASCII Code Table ............................................................................................................................... 177
Trigonometrical Function Instructions ................................................................................................. 178
Trigonometrical Function Instructions .......................................................................................... 178
Log Function Instructions ............................................................................................................. 180
Loop/Branch Instructions .................................................................................................................... 182
Loop Repeat Insrcutions .............................................................................................................. 182
Branching Control Instructions ..................................................................................................... 184
Jump Instructions ......................................................................................................................... 186
Subroutine Instructions ................................................................................................................ 187
Interrupt Processing Instructions ........................................................................................................ 189
Interrupt Instructions (Interrupt Function Ver. 3) .......................................................................... 189
Information details of Registers that are used by INT ......................................................................... 190
INT 1: Periodic timed interrupt ..................................................................................................... 190
INT 2: Interrupt occurs when Comparison is Equal to Target Value ........................................... 190
INT 9: Interrupt is triggered when PTO0 is finished ..................................................................... 191
INT 10: Interrupt is triggered when PTO1 is finished. .................................................................. 191
INT 17: Interrupt is triggered by External Input R0.0 ................................................................... 192
INT 18: Interrupt is triggered by External Input R0.1 ................................................................... 192
INT 19: Interrupt is triggered by External Input R0.4 ................................................................... 192
INT 20: Interrupt is triggered by External Input R0.5 ................................................................... 192
Constant cycle scan (V2.xx or earlier) ......................................................................................... 193
Input Output Signal Controlling ........................................................................................................... 195
Input Output Signal Controlling .................................................................................................... 195
System Control Instructions ......................................................................................................... 197
Special Function Control Instructions ................................................................................................. 199
High Speed Counter Instructions ................................................................................................. 199
NX7 Series Hight Speed Counter (HSC) Input Function .................................................................... 200
6

Input Option ................................................................................................................................. 200


Parameter Setting ........................................................................................................................ 200
Control Setting ............................................................................................................................. 201
Input Terminal .............................................................................................................................. 201
Pulse PWM Control Instructions .................................................................................................. 202
High Speed Pulse (PWM/PTO) Output Function ................................................................................ 204
Overview ...................................................................................................................................... 204
Output Option ............................................................................................................................... 204
Parameter Setting ........................................................................................................................ 204
Contorl Setting ............................................................................................................................. 205
Output Termination ...................................................................................................................... 205
Pulse Output PTO Instructions .................................................................................................... 206
PID Control Instructions ............................................................................................................... 208
Parameter Table Setting ..................................................................................................................... 210
Parameter Descriptions ....................................................................................................................... 211
Status Display Word (STATUS) ................................................................................................... 211
Contol Word (CONTROL) ............................................................................................................ 211
Terms .................................................................................................................................................. 213
Set Point (SP) ....................................................................................................................... 213
Process Value (PV) .............................................................................................................. 213
CV ......................................................................................................................................... 213
Kc .......................................................................................................................................... 213
Intergral Time (Ti) ................................................................................................................. 213
Differential Time (Td) ............................................................................................................ 213
Bias (FF/Bias) ....................................................................................................................... 214
Deadband (ZCB) ................................................................................................................... 214
Maximum Set Point (SPmax) ............................................................................................... 214
Maximum Set Point (SPmin) ................................................................................................ 214
Maximum Output Value (CVmax) ......................................................................................... 214
Maximim Output Value (CVmin) ........................................................................................... 214
Operating Cycle (Ts)............................................................................................................. 215
Error Code (ECODE) ............................................................................................................ 215
Operation according to CONTROL Setting .......................................................................... 216
Suspend Instructions ................................................................................................................... 217
Time Controlling Instructions............................................................................................................... 218
Communication Module Controlling Instructions................................................................................. 220
7

Shared Memroy Reading ............................................................................................................. 220


Shared Memory Writing ............................................................................................................... 222
Remote Reading Instruction ........................................................................................................ 224
Remote Writing Instruction .......................................................................................................... 226
Link Data Receiving Instruction ................................................................................................... 228
Link Data Sending Instruction ...................................................................................................... 230
Link Bit Receive (RECVB) ........................................................................................................... 232
Link Bit Sending Instructions (SENDB)........................................................................................ 234
Communication Contoll Instructions ................................................................................................... 236
Modbus Controll ........................................................................................................................... 236
Modbus Address Bit Data Table ......................................................................................................... 239
Modbus Address Word Register Data Table ...................................................................................... 239
PLC Communcation ..................................................................................................................... 243
ASCII Communication Instructions .............................................................................................. 245
Hex Communication Instrcutions ................................................................................................. 248
Communication Code Operating Instruction ................................................................................ 251
8

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

CPU Type NX7s NX7 NX7R NX70 NX700


Control method Stored program, cyclic operation
20(A), 28, 48, 28
External Input/output 10, 14, 20, 28,
2 expansions, 2 expansions Up to 384 points Up to 1600 points
point 40, 48 points
14/28 points 14/28
V3.x or older = 30 types
Basic 36+ types 30 types 30 types
Instructi V5.x or later = 36 types
ons V3.x or older = 139 types V2=approx. 150
Advanced 284+ types V2=148+ types
V5.x or later = 284+ types types
V3.x or older =
9KW, 70P1=9.6K,
Program capacity 2KW 32K 20K
V4.x or later = 32K 70P2=20K
(note 1)
I/O, internal (R) R000.00 - R127.15 (2048 points, 128 words)
Link contact (L) L000.00 - L063.15 (1024 points, 64 words)
Internal contact
M000.00 - M127.15 (2048 points, 128 words)
(M)
Keep contact (K) K000.00 - K127.15 (2048 points, 128 words)
Mem Special contact F000.00 - F015.15 (256 points, 16 words)
ory (F)
Size Timer / Counter 256 channels (timer + counter), duplicate use of channel not allowed
Data word(W) W0000 - W2047 (2048 words)
V2.x=N/A V2 or older = N/A
Data word (D) V3 or later = V4 or later = 12800W 2048W 2048W
2048W 12800W
Special word
SR000 - SR511 (512 words)
(SR)
Up to 57600,
Speed 4800, 9600, 19200, 38400 4800, 9600, 19200, 38400
115200,
2 Ports (Port 1: NX7S=RS232C only, Other models: RS232C/RS485 both)
Com Ports
(Port 2: NX7S=RS485 only, Other models: RS232C/RS485 both)
munic
ation Comm. Protocol 2/4 step NXp comm protocol, user-defined communications, communication master,
1 modbus slave
Comm. Protocol Supported by
- Support - -
2 V5.x or later
High-speed counter 1 Ch, pulse HSC 2Ch, Analog,RTD,TC, HSC, Pulse,
Special functions
output 2 Ch, pulse catch 4 points Pulse Out 2 Ch, Position, Link,
Built-in (optional
Other Clock functions None Built-in
battery)
Built-in Built-in
s Supports 8 Loops (NX7 V5=494
PID Max. 494 Loops Supports 8 Loops
Loops)
Memory backup EEPROM backup Option memory EEPROM backup
V5.x or later =
Entire WinGPC 4.5 or
Program Tools WinGPC4.15.2 or Entire WinGPC
WinGPC later
later

Note 1) CPU Processor supported by WinGPC


10

- SPC-10(CPU14), SPC24S (CPU24S), SPC100 (CPU10R, CPU10AR), SPC120S (CPU12S)

- SPC300(CPU300, CPU300A, CPU300C, CPU500), A200(CPU200,CPU201),

- N70 (CPL9215A, CPL9216A), N700 (CPL7215A)

Note 2) Comparison of N plus Series Data Area

- N70: 9215A=9.6KW, D area: not available, 9216A= 20KW, D area: 2048W

-N700: V2.x or below= 24KW, D area: 2048W

Note 3) The types of instruction may differ depending on the version.

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.

Operation modes and functions per CPU operation switch

Operation Operation LED State Program Data Operation Mode


Switch Mode RUN PROG Change Change upon Power Off→On

RUN ● No Yes RUN


RUN
STOP ● No Yes RUN

RUN Yes Yes RUN


RMT
(Remote)
PAUSE Yes Yes PAUSE

PROG. STOP ● Yes Yes STOP

Note)

- LED status symbol: =On, = Flashing, ●= Off.

- If the PROG. LED is on, it is allowed to change the user grogram.

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

Mode Functions per Operation Switch Transition State.

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

mode is turned on/off; therefore care should be taken when programming.

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

Addressing System of NX Plus Series

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.

Link contact L000.00 - L000 - L063 - Shared area of link contact


(L) L063.15 - 1024 points, 64 words
- Can be used as an internal contact when not used
as a link.
Internal contact M000.00 - M000 - M127 - Internal auxiliary contact area
(M) M127.15 - 2048 points, 128 words

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.

Double Word Addressing

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

Word Address Instruction

With the parameter D or S, 1 word data (16 bits = 0 to 65535) are processed.

Double Word Address Instruction

With the parameter D or S, 2-word data (32 bits = 0 to 4,294,967,295) are processed.

Data structure of a double word W0000 address


31 30 17 16 15 14 1 0
2 2 … 2 2 2 2 2 2
15 14 … 1 0 15 14 … 1 0

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.

Register Absolute Address Register Absolute Address


Address Dec. Hex. Address Dec. Hex.
Outer R0000 000 $0000 Internal F0000 448 $01C0
Input R0001 001 $0001 Special F0001 449 $01C1
Output R0002 002 $0002 Contact F0002 450 $01C2
17

… … … Point ... ... ...


R0126 126 $007E F0014 462 $01CE
R0127 127 $007F F0015 463 $01CF
Link L0000 128 $0080 Data W0000 512 $0200
Area L0001 129 $0081 Area W0001 513 $0201
L0002 130 $0082 W0002 514 $0202
... ... ... ... ... ...
L0062 190 $00BE W2047 2559 $09FF
L0063 191 $00BF Data W0000 512 $0200
Inter- M0000 192 $00C0 Area W0001 513 $0201
nal M0001 192 $00C1 W0002 514 $0202
Cont- M0002 194 $00C2 ... ... ...
act M0003 195 $00C3 W2047 2559 $09FF
Point ... ... ... T/C SV000 2560 $0A00
M0064 256 $0100 Setting SV001 2561 $0A01
M0065 257 $0101 Value ... ... ...
... ... ... SV255 2815 $0AFF
M0126 318 $013E T/C PV000 2816 $0B00
M0127 319 $013F Current PV001 2817 $0B01
Keep K0000 320 $0140 Value ... ... ...
Conta- K0001 321 $0141 PV255 3071 $0BFF
ct K0002 322 $0142 Status SR000 3072 $0C00
Area K0003 323 $0143 Display SR001 3073 $0C01
... ... ... ... ... ...
K0126 446 $01BE SR511 3583 $0DFF
K0127 447 $01BF Data D0000 3584 $0E00
Area D0001 3585 $0E01
... ... ...
D2047 5631 $15FF
D2048 5632 $1600
... ... ...
D12799 16383 $3FFF

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

F13.03 = Off F13.03 = Off F13.03 = On F13.03 = On


Condition
F13.04 = Off F13.04 = On F13.04 = Off F13.04 = On
W0 32767 65535 32767 32768(-32768)

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

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

Contact Point Instriction Output Instriction


21

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

Projector Work Procedure

The following should be performed to operate the PLC.


- Open the projector; Select CPU (PLC model, type, version info, etc.)
- Programming, saving, and compiling
- PLC access, download/upload, system information check
- Ladder monitoring, register monitoring, status check and diagnosis.

Programming Work

The programming work is done as follows:


- Programming is carried out in rung units.
- All works are done at a cursor position.
- The shape of a cursor varies per rung, instruction, block, position and position.
23

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

Saving and Compiling of Program

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.

Program Download and Monitoring

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

Mnemonic Name Ladder Symbol Description

STR Start Starts contact A

STN Start Not Starts contact B

AND And Contact A series circuit

ANN And Not Contact B series circuit

OR Or Contact A parallel circuit

ORN Or Not Contact B parallel circuit

STR DIF Start Differential Starts rising edge contact ( )

STR DFN Start Dif. Not Starts falling edge contact ( )

AND DIF And Dif. Rising edge series connection ( )

AND DFN And Dif. Not Falling edge series connection ( )

OR DIF Or Dif Rising edge parallel connection ( )

OR DFN Or Dif. Not Falling edge parallel connection ( )

DF Differential Arithmetic result rising edge process ( )

DN Differential Not Arithmetic result falling edge process ( )

NOT Not Inverts circuit

Output Instructions

Mnemonic Name Ladder Symbol Description

OUT Output Arithmetic result output


26

SET Set Sets output and retains On

RST Reset Resets output and retains Off

ALT Alternative Output Alternative output when Arithmetic result rais

PLS Pulse Output 1 Scan output when Arithmetic result rais

PLF Pulse Falling Out 1 Scan output when Arithmetic result fall

Output Instructions

Mnemonic Name Ladder Symbol Description

ANB And Block Circuit blocks series connection

ORB Or Block Circuit blocks parallel connection

Master block
MS Starts master block
Set

Master block
MR Ends master block
Reset

MCS MCS Starts circuit branch (Master Control Set)

MCR MCR Ends circuit branch (Master Control 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

Time Base: Ch 0~63= 0.01s


Turns off after set delay time Ch 64~255= 0.1s
TOF from input off Setting range: SV = 0~65535
Off Delay Ch=00064 Contact indicator: TC + channel
TOF SV=00005 Input
Timer number

Output ←5 Sec→

Time Base: Ch 0~63= 0.01s


Turns off after set delay time Ch 64~255= 0.1s
SST Setting range: SV = 0~65535
from input on
Single Shot Ch=00100 Contact indicator: TC + channel
SST SV=00005 Input
Timer number
Output
←5 Sec→

Time Base: Ch 0~63= 0.01s


Retentive Timer Ch 64~255= 0.1s
RTM
→ ←Power cut Setting range: SV = 0~65535
Retentive Ch=00070
RTM SV=00050 Input Contact indicator: TC + channel
Timer number
Except Power cut
Output
← 5 Sec→
28

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

R Output Contact indicator: TC + channel


Reset number
Channel range: Ch 0~255
DC Down Counter (Shared with
Input
Down D Ch=021 Setting
timer)
SV=005 Current
DC Counter Value
Value
Setting range: SV = 0~65535
Contact indicator: TC + channel
R Output
Reset number

Channel range: Ch 0~255


RCT Ring Counter (Shared with
Ring T Ch=022 Input
timer)
RCT Counter SV=004 Current
Value
Setting
Value Setting range: SV = 0~65535
R Output
Contact indicator: TC + channel
Reset number

UDC Channel range: Ch 0~255


Up-Down Counter (Shared with
U Ch=023 U Input
Up-Down SV=003 timer)
D Input
UDC Counter D Current Setting Setting range: SV = 0~65535
Value
Value
Contact indicator: TC + channel
R Output
number
Reset

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

A Contact, B Contact Instructions

Mnemonic No. of Applicable


Ladder Description
Instruction Words Model

STR Start contact A 1 All models

STN Start contact B 1 All models

AND Contact A series connection 1 All models

ANN (Note1) Contact B series connection 1 All models

OR Contact A parallel connection 1 All models

ORN Contact B parallel connection 1 All models

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.

STR, STN Instruction


STR
R000.00 M000.00
(OUT)
STN
R000.01 M000.01
/ (OUT)
30

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.

The ladder program is converted to the mnemonic as the following order:


STR R000.00, OUT M000.00,
STN R000.01, OUT M000.01

STR, STN Instruction


AND
R000.00 R000.01 M000.02
(OUT)
ANN
R000.02 R000.03 M000.03
/ / (OUT)

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.

The ladder program is converted to the mnemonic as the following order:


STR R000.00, AND R000.01, OUT M000.02,
STN R000.02, ANN R000.03, OUT M000.03.

OR, ORN Instruction


R000.00 M000.04
(OUT)
OR
R000.01

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

of the contact B is OFF. The circuit is expressed as and its conversion is ,


same as a ladder.
31

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


R000.00 M000.04
/ (OUT)
R000.01

R000.00 R000.01 M000.05


/ / (OUT)

NOR (OR NOT) circuit means like the left ladder. The output M0.4 and M0.5
becomes the same program.

XOR (Exclusive OR) Circuit


R000.00 R000.01 M000.00
/ (OUT)
R000.00 R000.01
/

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

STR DIF R Start rising edge contact ( ) 1 All models

AND DIF R Rising edge series connection ( ) 1 All models

Rising edge parallel connection


OR DIF R 1 All models
( )
STR DFN F Start falling edge contact ( ) 1 All models

Falling edge series contact connection


AND DFN F 1 All models
( )

Falling edge parallel contact connection


OR DFN F 1 All models
( )

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)

Input R0.0 The OUT output M0.0 is turned on while


the input R0.0 contact is ON.
OUT Rising edge is the contact where the
(M0.0)
> < 1Scan
output is turned on for one scan when the
Rising edge input changes from OFF to ON.
(M0.1)
1Scan > Falling edge is the contact where the
<
Falling edge
output is turned on for one scan when the
(M0.2) input changes from ON to OFF

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

DF Logic Rising Edge ↑ Arithmetic result rising edge process ( )


2
Logic Falling Edge ↓
DN 2 Arithmetic result falling edge process ( )

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.

Available Not Available

Arithmetic result is ON prior to --↑-- instruction.


Output M1.0 keeps ON status for one scan at the time that both R0.0 and R0.1 is ON.

Arithmetic result is OFF prior to --↓-- instruction.


Output M1.1 keeps ON status for one scan at the time that both R0.0 and R0.1 is OFF.
36
37

Mnemonic No. of
Ladder Description Applicable Model
Instruction Words

Circuit reverse (reverse former circuit


NOT 1 All models
results)

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.

R000.00 Not Circuit M000.01 R000.00 M000.01


/ (OUT) / (OUT)

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.

R000.00 M000.02 NOT Circuit


A (OUT)
R000.00 R000.01 R000.02 R000.03 M000.02
A B C D Y (OUT)
R000.01 Y / / / / /
B
The OR circuit on the left is expressed as Y=A+B+C+D in a
R000.02
C Boolean log. It is then converted to
R000.03 In this equation, If the NOT circuit
D is inserted before Y, its result becomes same as that of Y.

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

Arithmetic result and Output Instructions

Mnemonic No. of
Ladder Description Applicable Model
Instruction Words

OUT (OUT) Arithmetic result output 1 All models

SET (SET) Set output (maintains ON) 2 All models

RST (RST) Reset output (maintains OFF) 2 All models

1. OUT output operates at every scan.


2. Outputs such as OUT, SET, and RST 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.
3. For the I/O address R, the address without an input module cannot be used for output.
4. For the OUT output, only one I/O R and more than one inner contacts L, M, K, and F can be
allowed. However, caution is required to use multiple fields because these operate as the
final OUT instruction.
5. For the SET or RST instructions, multiple contacts can be allowed. When the contact is set
once, the operation results are kept until it is reset.
6. When SET or RST is used as K area, it maintains the value prior to OFF.
7. Output instructions, such as OUT, SET, and RST, may not be used as direct outputs from
the root without an input. When it needs to operate at all times, use the contact A of the
F0.15 address that is always ON during operation

OUT, SET, RST Instruction


R000.00 M000.00
OUT
(OUT)
M000.01
SET
(SET)
R000.01 M000.01
RST
(RST)
39

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.

R000.00 R000.01 M000.00 R000.00 M000.00


/ (OUT) (SET)
M000.00 R000.01 M000.00
(RST)
40

Special Coil Output

Mnemo
Name Ladder Symbol Word Description
nic

Alternative Output (ALT) Blink every rising edge


ALT 3

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.

M1.0 blinks when R0.0 is On.


When R0.0 is On, M1.1 is on for one scan.
When R0.1 is changed from On to OFF, M1.2 is ON for one scan.

Input R0.0

Input R0.1

ALT Output
(M01.0)
Scan Cycle
PLS Output
(M01.1)

PLF Output

(M01.2)
41

Circuit Block Instructions

Mnemonic No. of
Ladder Description Applicable Model
Instruction Words

ANB Circuit block series connection 1 All models

ORB Circuit block parallel connection 1 All models

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.

The ladder is converted to the mnemonic program as the following order:


STR R000.00, OR R000.01,
STR R000.02, OR R000.03

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.

The ladder is converted to the mnemonic program as the following order:


STR R000.00, AND R000.01,
STR R000.02, AND R000.03
43

Master Control Instructions

Mnemonic No. of
Ladder Description Applicable Model
Instruction Words

MS ( MS ) Circuit block series connection 1 Note 1

Ends master block. (for processor


MR ( MR ) 1 Note 1
version 2.0 or higher)

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)

Expression will be changed according to WinGPC version.

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

Understanding of the Timer/Counter Instructions

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.

Timer/Counter instruction output contact point is designated by “TC + channel number”.

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

TIM ON delay timer


Ch=
TIM SV= (Turn on after set delay time from input 3 All models
on)

TOF OFF delay timer


Ch=
TOF SV= (Turn off after set delay time from input 3 All models
off)

SST Single shot timer


Ch=
SST SV= (Turn off after set delay time from input 3 All Models
on)

Note 1)

Applicable Model (TOF Instruction).

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.

OFF Delay Timer – TOF

R000.00 TOF <Time Chart>


Ch=100
SV=50 Input
TC100 M000.01
Output
(OUT) ←5 Sec→

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.

OFF Delay Timer using SST

R00.0 R001.10 SST


Ch=100
SV=50 <Time Chart>
TC100 R001.01
Input
( )
R00.0
Output
←5 Sec→

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.

Single Shot Timer – SST


51

R000.00 SST <Time Chart>


Ch=200
SV=30 Input
TC200 M000.02
Output
(OUT) ←3 Sec→

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

[Flicker circuit using one timer]

When the input is ON, the flicker circuit turns on and off, respectively, for 3 seconds in turn (Flicker
circuit).

R000.00 TC100 TIM


/ Ch=100
Input SV=30
M000.00 M000.00
<Time Chart>
TC100
/ (OUT)
output
Input
TC100 M000.00
Output
/ ←3 Sec→ ←3 Sec→

The flicker frequency can be controlled by adjusting the SV value of the timer.
This circuit uses the timer and alternating circuit.

[Two-flicker circuit using two timers]

When input is on, the flicker circuit turns on and off, respectively, for 3 seconds in turn.

R000.00 TC102 TIM


Input / Ch=101
SV=30
TC101 TIM <Time Chart>
Ch=102 Input
SV=20
R000.00 TC101 M000.00 Output
←3 Sec→ ←2 Sec→
/ (OUT)

[Applied flicker circuit using two timers 3]

R000.00 TC102 TIM


/ Ch=101 <Time Chart>
Input
SV=30 Applied Expression
TC101 TIM
Ch=102 Input
SV=20
M000.00 Output
←3 Sec→ ← 2 Sec→
(OUT)
53

[Stabilizing circuit of unstable signal]

This circuit stabilizes unstable circuits such as input‟s pulse noise.

R000.00 SST
Ch=10 <Time Chart>
SV=30
TC010 Input

TC010 M000.00 Output


(OUT) ←0.3 Sec→ ←0.3 Sec→

[Control circuit using timer’s PV]

Use the timer‟s PV to compose a ladder circuit. (Refer to Comparison Instructions).

Ladder Program Time Chart Comparison


R000.00 TIM
Ch=100 Input
SV=30
Progress Value
TC100 M000.00 P r o g r e s s
V a l u e
Set Value
(OUT) 0 30 50 70 100 ……
<= < M000.01
A=50 A=PV100 (OUT) OutpuM
t 000.00
B=PV100 B=70
30
<= < M000.02 O u t p uMt 0 0 0 . 0 1
A=70 A=PV100 (OUT) 50
B=PV100 B=100 O u t p uMt 0 0 0 . 0 2
<= M000.03 70
A=100 (OUT) O u t p uMt 0 0 0 . 0 3
B=PV100
100

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

Retentive On-delay timer Instruation

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)

3 Sec is calculated after power off section.


If input contact point is keept on after power has removed, timer contact point also kept.
R(Reset) input is on, output is off.
56

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

Ring Counter, Up/Down Counter

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)

Non Applicable Mode: SPC-10/24S/120S/300

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)

R000.01 SV=4 When Set Value = 4


Present Value 3
R (PV22) 1
2
TC022 M000.00 0
(OUT) Output (TC22)

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)

Applicable Model: A200, N70+(CPL9215A/9216A), N700+(CPL7215A), NX70+(CPU70P1/P2), NX700+(CPU700P)

Non Applicable Mode: SPC-10/24S/120S/300

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

1. When the reset input is on, all data is reset to 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

[Example of SPC120/24 Model] [Example of NX-p, Nplus Model]


1 R000.00 SR
I Sb=K4.0
2 400 R000.01 Eb=K5.3
SR P
~
3 423 R000.02
R
400 K004.00 M002.00
(20 ) (OUT)
401 K004.01 M002.01
(21 ) (OUT)

423 K005.03 M003.03


(43 ) (OUT)

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.

SPC- NX-p, SPC- NX-p, SPC- NX-p, SPC- NX-p,

120/24 Nplus 120/24 Nplus 120/24 Nplus 120/24 Nplus

400 K4.00 412 K4.10 20 M2.00 32 M2.10


401 K4.01 413 K4.11 21 M2.01 33 M2.11
402 K4.02 414 K4.12 22 M2.02 34 M2.12
403 K4.03 415 K4.13 23 M2.03 35 M2.13
404 K4.04 416 K4.14 24 M2.04 36 M2.14
405 K4.05 417 K4.15 25 M2.05 37 M2.15
406 K4.06 420 K5.00 26 M2.06 40 M3.00
407 K4.07 421 K5.01 27 M2.07 41 M3.01
410 K4.08 422 K5.02 30 M2.08 42 M3.02
411 K4.09 423 K5.03 31 M2.09 43 M3.03
63

About STEP Controller

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

STEP Controller Instructions

Mnemo No. of
Name Ladder Symbol Description
nic Words
ISTP
ISTP Step Initializing Step= 2 Activate start step(Step0~15)

SSTP Check step status. If the step is


SSTP Step Start Step= 2
activated, it becomes ON.
NSTP
NSTP Next Step Step= 2 Instruction for single or parallel branch

ASTP Detect AND condition with previos


ASTP And Step Step= 2
STEP.
CSTP
CSTP Step Clear Step= 2 Initialize the specified step status.
CBSTP
STEP1=
CBSTP Step Block Clear STEP2= 3 Initialize step in the designated block
ESTP
ESTP Step End 1 End Step Controller routine.

[Start Step Activation Program]

[Single Circuit Program]


66

[Parallel Circuit Program]

[Selected Branch Program]

[Joint Parallel Branch Porgram]


67

[Joint Selected Branch Program]


68

Binary increase Instructions

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

1. The increment instructions increase the value of D address by 1.


2. Binary increases in bit.
3. Word (double word) addresses such as 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 increased value exceeds the maximum, the overflow will cause the value to be 0 and to
begin counting again.
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.

The increment instruction operates for one scan when the M1.0 contact is ON. Each instruction has a
69

different function as follows:


INC instruction increases by one word in binary module (DEC value).
INCB instruction increases by one word in BCD modules.

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

BCD Increase Instructions

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

1. The BCD increment instructions increase the value of D address by 1 BCD.


2. BCD increases in bit, and BCD increases 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) addresses such as 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 increased value exceeds the maximum, the overflow will cause the value to be 0 and to
begin counting again.
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.

The increment instruction operates for one scan when the M1.0 contact is ON. Each instruction has a
71

different function as follows:


INCB instruction increases by one word in BCD modules.
DINCB instruction increases by two words in BCD modules.

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.

It also shows each cipher in decimal as a binary number.

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

from 0 to $99999999 (2,576,980,377 in decimal).


72

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

Real number Increase/Decrease Instructions

Mnemo
Name Ladder Symbol Word Description
nic

Real number data FINC If input is on, the Float Ponint of D


FINC D = 3 increases by 1.0. D = D + 1.0
Increase by 1.0

Real number data FDEC In input is O, the N Float Ponint of D


FDEC D = 3 decreases by 1.0. D = D - 1.0
Decrease by 1.0

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.

If 15.3 is in W100, when R0.1 is becom on, 16.3 is stored to W100.

If 1.3 is in W200, when R0.2 is ON, -0.3 is stored to W200.


75

Integer Substitution Instructions

Mnemonic No. of
Ladder Description Applicable Model
Instruction Words

Substitute value (data)


LET
(S = source, D = destination)
LET D= 3 All models
S=
(D = word address, S = word address,

word value)

Substitute double word


DLET
(Store S value into D)
DLET D= 4 All models
S=
(D = double word address, S = double

word, double 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

This example checks the stored data.


If W120 is 20, the output M0.0 is set to ON. If W120 is $20, the output M0.1 is set to ON.
(As it is a decimal value (32), the output is set to OFF.)

If W122 is $20, the output M0.2 is set to ON.


($20 and 32 will be input as the same value.)
78

Real Numbers Subtraction Instructions

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

Decimal point 3.4 can be input to M20 word by FLET instuctions.

The decinal point value of M20 can be substituted to M22.


Address or real number can be used as S value.
79

Sequential assignment Instructions

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.

Following table shows the result.

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

That is, followings are stored in each area.


S1=-20.0 = W200, W201 area
S2=0.5678 =W202, W203 area.
82

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)

Store 2‟s complement of D in D


NEG
D= 2 All models
NEG (1‟s complement + 1 = minus value)

Negative (word)

Store 2‟s complement of D in D


DNEG
DNEG D= (1‟s complement + 1 = minus value) 2 All models

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

Instructions that is operated on Signed Integers


1. Every floating point instructions
2. ASCII Change Instructions such as A2I (A2L), and I2A (L2A).
3. Floating point change instructions such as F2N (F2L), and N2F (L2F).
87

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 D[100+D0] address is stored to W[100+W0] address.


Resiger or constant numbers can be assigned to IDX.

The value of IDX can be extended automatically according to instruction size. (In case of double word
or Float instruction can be multipled.)
88

Register Before Note Register After

W100 4321 W(100+W2) W100 4321

W0 6 = W(100+6) W0 6

W106 1234 = W106 W106 4567

D100 6789 D(100+D0) D100 6789 Copy


Copy
D0 10 = D(100+10) D0 10

D110 4567 = D110 D110 4567

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

Word Data Mov

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

Repeatedly copy the value V, Ns times towards


FMOV
D= starting at D.
FMOV N= D ...... 1 0 1 0 1 0 1 0 4 All models
V= V ...... 1 0 1 0 1 0 1 0
D+1 ...... 1 0 1 0 1 0 1 0
N=4
D+2 ...... 1 0 1 0 1 0 1 0
D+3 ...... 1 0 1 0 1 0 1 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

Bit Data Move

Mnemon

ic No. of
Ladder Description Applicable Model
Instructi Words

on

Move Ns bits from bit address Sb to bit address


BMOV
Db= Db. (Sb and Db are bit address.)
BMOV Sb= Sb Db 4 All models
N =
...... 0 1 1 1 0 1 0 0 ...... 0 1 1 1 0 1 0 0

Movement of N number of bit

Repeatedly copy the bit value V, N times to bit


FMOV address Db. (V=0, 1)(N=1…256, within
D=
FMOV N= domain)(Db is bit address) 4 All models
V=
Ex) When V=1, N=5

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

Mnemonic Name Ladder Symbol Word Description


FIFOWR
Stack =
FIFOWR FIFO Store S= 4 Store FIFO typed data
Depth=
LIFOWR
Stack =
LIFOWR LIFO Store S= Store LIFO typed data
Depth=
4
POPS
D = Read data from data storage. Next data
POPS Read Data Stack= 4 will be prepared.
Depth=
TOS
D = Read data from data storage. Same
TOS Refer Data Stack=
Depth=
4 data can be read repeatedly.

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

stored data can be increased by 1.

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.

Before M0.0 is ON M0.1 is ON M0.2 is ON

8024 3952 W200 8024

W100 0 1 2 1

W101 xxxx 8024 8024 8024

W102 xxxx xxxx 3952 3952

W103 xxxx xxxx xxxx xxxx

W104 xxxx xxxx xxxx xxxx

W105 YYYY YYYY YYYY YYYY

[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

Before M0.0 is ON M0.1 is ON M0.2 is ON

3952 1723 W200 1723

W100 0 1 2 2

W101 xxxx 3952 1723 1723

W102 xxxx xxxx 3952 3952

W103 xxxx xxxx xxxx xxxx

W104 xxxx xxxx xxxx xxxx

W105 YYYY YYYY YYYY YYYY


99

Mnemonic
No. of
Instructio Ladder Function Description Applicable Model
Words
n

On if A value and B value are the


STR == ==
AND == A=
OR == B= A=B same. 3 All models
A and B are word counts or values.

On if A value and B value are the


STR D== D== same.
AND D== A=
OR D== B= A=B 4 All models
A, B are double word counts or

double word values.

On if A value and B value are


STR <> <> different.
AND <> A=
OR <> B= A≠B 3 All models
A and B are word addresses or word

values.

On if A value and B value are


STR D<> D<> different.
AND D<> A=
OR D<> B= A≠B 4 All models
A and B are double word addresses

or double word values.

On if A value is greater than B value.


STR > >
AND > A=
OR > B= A>B A and B are word addresses or 3 All models
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.

STR >= On if A value is greater than or equal


>=
AND >= A= A ≥ B
B= to B value. A and B are word 3 All models
OR >=
addresses or word values.

STR D>= On if A value is greater than or equal


D>=
AND D>= A=
A ≥ B
B= to B value. A and B are double word 4 All models
OR D>=
addresses or double word values.
100

STR <= On if A value is less than or equal to


<=
AND <= A=
A ≤ B
B= B value. A and B are word addresses 3 All models
OR <=
or word values.

STR D<= On if A value is less than or equal to


D<=
AND D<= A=
B= A ≤ B B value. A and B are double word 4 All models
OR D<=
addresses or double word values

STR < On if A value is less than B value. A


<
AND < A=
B= A< B and B are word addresses or word 3 All models
OR <
values.

STR D< On if A value is less than B value. A


D<
AND D< A=
B= A<B and B are double word addresses or 4 All models
OR D<
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

This shows how to increase data by using the UP counter.


The F1.4 contact is a signal that repeats every second.
101

When the PV of counter (PV30) is 7, output M0.0 is ON.


When the PV of counter is not 10, output M0.1 is ON
When the PV PV30 is between 15 and 20, output M0.2 is ON.

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 On if A value and B value are


F<>
AND F<> A=
Floating B= A≠B 4-6 not the same. <> is same with
OR F<>
Point (A≠B) ≠.

STR F> Compare


F> On if A value is greater than B
AND F> A=
Floating B= A>B 4-6
OR F> value.
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 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

This is an example of double word data increment by 1.0 by FINC instruction.

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

Variable Data Range Comparing

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.

STR DLIM Double


LOW≤S≤HIGH On if S value is in a range
AND DLIM
word 4-6
OR DLIM LOW≥S≥HIGH between Low and High.
Limit

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.

This is an example of data increment by 1.0 by INC instruction.


F1.4 contact point is a sign that repeat ON/OFF at every 1 sec. W30 value can be increased by 1.0 at
every 1 second.
105

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

Real Number Data Range Comparing

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.

This is an example of data increment by 1.0 by FINC instruction.


F1.4 contact point is a sign that repeat ON/OFF at every 1 sec. W30 value can be increased by 1.0 at
every 1 second.

When it is same or bigger than Low (15.4) value of FLIM instruction, or same or smaller than High
107

value (20.2), 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.
108

Arithmetic Instruction (Addition)

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)

DSTO D = S1 + S2 + Carry, (Double Word)


DSTO S= Adding binary numbers include carryZ 3 All models
D= (Decimal addition with carry)y

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

Arithmetic Instruction (Multiplication)

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

1. The multiplication instruction multiplies S1 and S2 and stores it in D.


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. MUL calculates the numbers within 16bit (65,535). DMUL calculates the numbers within 32
bit (4,294,967,295).
4. 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. In the MUL
instruction of the Word operation, 20*3500 will be evaluated to 70000. However, 1 (65536)
will be stored into SR20, the carry bit F1.8 will be turned on, and then the low word value
4464 will be stored into D.
5. 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.
111

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

Arithmetic Instruction (Division)

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

1. The division instruction divides S1 and S2 and stores it in D (D = S1÷S2).


2. The resulting remainder (a value below the decimal point) is temporarily stored as double
word condition (SR22) 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. Binary division operates in bit, and BCD division operates in BCD. It is the same as the
division expression in HEX. (Please refer to the Example.)
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. In the DIV, values within 16 bits (65,535) can be calculated. In the DDIV, values within 32
bits (4,294,967,295) can be calculated.
7. 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.
113

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

Store 24 in W100, and 4 in W200 at first scan.

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

Store 876543 in W100 and 765430 in W200 at first scan.

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

Store $88000 (DEC 557056) in W100 and 3 in W200 at first scan.

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

Real Number Arithmetic Instruction

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.

If M00.00 contact point is ON, following instructions are calculated.

If W110= (1.2) + (2.7), the result is W110=3.9.

If W112= (1.2)-(2.7), the result is W112= -1.5.

If W114= (1.2) x (2.7), the result is W114= 3.24.

If W116= (1.2)/ (2.7), the result is W116= 0.4444444.


117

BCD Arithmetic Instruction (Addition)

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.

ADDB calculates 21+22=49 in BCD addition.


It can be also expressed as $15+$16=$31 in BCD and $31=49 in DEC.

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

BCD Arithmethric Instructions (Substrucation)

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

BCD Arithmetic Inscturctions (Multiplication)

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

BCD Arithmetric Instructions (Division)

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

Store 24 in W100, and 4 in W200 at first scan.

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

Store $88000(DEC 557056) in W100 and 3 in W200 at first scan.

In DDIVB, $88000÷$3=29333 and $29333 is stored in W300. Reminder of double word value $1 is
stored in SR22.
126

Mnemonic No. of Applicable


Ladder Description
Instruction Words Model
DIVB S1 0 0 1 1
D = Logical product (Word AND :)
S2 0 1 0 1
WAND S1=
S2=
Store AND of S1 and S2 into D. D 0 0 0 1
4 All models

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.

Equal circuit (Word Exclusive OR


WXNR S1 0 0 1 1
D = NOT) Store Exclusive OR NOT of S1 S2 0 1 0 1
WXNR S1=
S2=
4 All models
D 1 0 0 1
and S2 in D. (Reverse value of the

Exclusive OR)

Equal Circuit (Exclusive OR NOT :)


DXNR S1 0 0 1 1
D = Store Exclusive OR NOT of S1 and S2 S2 0 1 0 1
DXNR S1=
S2= D 1 0 0 1
in D. (Reverse value of the Exclusive

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

OR in WXNR (DXNR) instruction stores the result as 1 into D.


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.

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:

In WAND, $1111 (0001 0001 0001 0001) is stored into W300.


In WOR, $7777 (0111 0111 0111 0111) is stored into W301.
In WXOR, $6666 (0110 0110 0110 0110) is stored into W302.
In WXNR, $9999 (1001 1001 1001 1001) is stored into W304.
128

Rotation Instructions (Left/Right)

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

DRLC Rotate the content of D to the left N times.


D=
DRLC N= (Rotate left without carry, double word) 4 All models
F1.8 15 ... D W (double)... 00

RRC Rotate the content of D to the right N times


D=
RRC N= (Rotate left without carry, word) 3 All models
15 ....... D word .... 00 F1.8

DRRC Rotate the content of D to the right N times


D=
DRRC N= (Rotates right without carry, double word) 4 All models
15 ... DW (double) ... 00 F1.8

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.

Initial state M10

After the contact


M0.1 has run
once. M10
Initial state of M12
After an operation of
DRLC

Shifted by the contact F1.4 at every second.


130

Initial state of M12

After an operation of the


DRLC instruction

Initial state of M14

After an operation
of DRRC
131

Rotation Instructions (Left/Right Include Carry)

Mnemonic No. of
Ladder Description Applicable Model
Instruction Words

ROL Rotate (shift) to the left N times.


D= (Include carry, word)
ROL 3 All models
N= F1.8 15 ..... D word .... 00

Rotate (shift) to the left N times.


DROL
DROL D= (Include carry, double word) 4 All models
N=
F1.8 15 ... DW (double)... 00

Rotate (shift) to the right N times.


ROR
ROR D= (Include carry, word) 3 All models
N=
15 ....... D word .... 00 F1.8

Rotate (shift) to the right N times.


DROR
DROR D= (Include carry, double word) 4 All models
N=
15 ... DW (double) ... 00 F1.8

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.

Initial state M10=

After an operation of
the contact M0.1M10

Initial state of M12

After an operation of

DROL

Shifted by the contact F1.4 at every second.

Initial state M11

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

SHL Shift value of designated register D to the left N


D= times (input 0 for low bit word)
SHL 3 All models
N= F1.8 15 ....Double words... 00 0

Shift value of designated register D to the left N


DSHL
DSHL D= times (input 0 for low bit, double word) 4 All models
N=
F1.8 15 ... Double Words... 00 0

Shift value of designated register D to the right N


SHR
SHR D= times(input 0 for high bit, word) 3 All models
N=
0 15 ....Double words.... 00 F1.8

Shift value of designated register D to the right N


DSHR
DSHR D= times (input 0 for high bit, double word) 4 All models
N=
0 15 ...Double Words ... 00 F1.8

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.

Initial state M10

After an operation of
the contact M0.1M10

Initial state of M12

After an operation of

DSHL

Shifted by the contact F1.4 at every second.


135

Initial state M11

After an operation of
the SHR instruction
Initial state of M14

After an operation
of DSHR
136

BCD Number Change

Mnemonic No. of Applicable


Ladder Description
Instruction Words Model

Convert binary number of S to BCD and store it in D


BCD
D=
(word).
BCD 3 All models
S=
Ex)S=00063 (DEC) D=$0063 (BCD)
0 0 0 0 0 0 0 0 0 1 1 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1

DSHL
Convert binary number of S to BCD and store it in D
DSHL D= 3 All models
N= (double word).

Convert BCD of S to binary number and store it in D


SHR
(word).
SHR D= 3 All models
N= Ex) S=$0039 (BCD) → D=00039 (decimal, binary)
0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 1 1 1

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.

It also shows each cipher in decimal as a binary number.

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

from 0 to $99999999 (2,576,980,377 in decimal).


138

Encoder Conversion Instructions

Mnemonic No. of Applicable


Ladder Description
Instruction Words Model
ENCO
Convert the highest bit value in the S words to 8421
ENCO D= 3 All models
S= Encode and then store it into D.
DECO
Convert the bit value in the S words to 8421 Encode and
DECO D= 3 All models
S= then store it into D.

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

7-Segment Number Change Instruction

Mnemonic No. of Applicable


Ladder Description
Instruction Words Model

Converts the low-order 4-bit value of S to 7-segment


SEG display pattern and store them in D.
=5
SEG D= a 3 All models
S= S 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 f
g
b

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.

Note) an example of 7-segment indicating bit

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

Word Exchange Instruction

Mnemonic No. of Applicable


Ladder Description
Instruction Words Model
XCHG
XCHG D1= Exchange D1 and D2 values. (word) 3 All models
D2=

DXCHG
DXCHG D1= 3 All models
Exchange D1 and D2 values. (double word)
D2=

Note1) Applicable Model

NX70 plus N/NX700 Plus


SPC- SPC100 N70 Plus N/NX700 Plus
SPC300 A200 CPU70p1/V2, 7215A,
10 24S/120S 9215A, 9216A CPU700p
CPU70p2/V2 CPU700p

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

Nibble (4bit) Conversion Instructions

Mnemonic No. of Applicable


Ladder Description
Instruction Words Model

Separate S into N+1 modules, 4 bits each, and store

them in the low 4 bits of words starting at D.


DIS
D=
DIS N=
S=$7325 0 1 1 1 0 0 1 1 0 0 1 0 0 1 0 1
4 All models
S=

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

Combine the low 4 bits of S+1 words starting at S, and

store them in D (N= 0 to 3).


UNI
D=
UNI S= S 0 ..… 0 0 1 0 1 =5 4 All models
N= N=3
S+1 0 ….. 0 0 0 1 0 =2
S+2 0 ….. 0 0 0 1 1 =3
S+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

1. The DIS instruction separates data into 4-bit (1 digit) module.


2. The UNI instruction combines the separated 4 bits into one word.
3. The word addresses such as R, L, M, K, and W can be assigned for the D and S area. The N
area can be between 0 and 3.
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.
145

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

W20 = ($5678) W21 = ($1234)


Initial value
0101 0110 0111 1000 0001 0010 0011 0100

DIS W30 = ($0008) W31 = ($0007)


Arithmetic
Result 1 0000 0000 0000 1000 0000 0000 0000 0111
W22 = ($4324) W23 = ($8763)
DIS
Arithmetic 0100 0011 0010 0100 1000 0111 0110 0011
Result 2 W24 = ($0002) W25 = ($0001)
0000 0000 0000 0010 0000 0000 0000 0001
If M0.1 contact is on, the lower 4bit value of the W21 to W24 is
combined and sated.
W24 W23 W22 W21
Arithmetic Result W32 = ($2344) 0010 0011 0100 0100
146

Byte Swap Instruction

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.0 contact point is on, $80F2 value is stored to W100.

If M0.1 contact point is on, the $80F2 stored to W100 is swapped, and then stored to W100.

MSB LSB

1 0 0 0 0 0 0 0 1 1 1 1 0 0 1 0 $80F2 Data value assigned for W100.

After swap, the value of W100 becomes


1 1 1 1 0 0 1 0 1 0 0 0 0 0 0 0
$F280.
147

Word Expantion Instruction

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

MSB (D15) to upper word.

M0.0 EXT
D=W 0
V=0

If M0.0 is On, W0 is expanded to double word.


If V=0, upper words are expanded to 0,
If V=1, upper words are expanded to MSB of D.

If W0 = 0x1234, and V = 0, the result is W1=0, and W0=0x1234.


If W0 = 0x8234, and V=0, the result is W1=0, and W0=0x8234.
If W0 = 0x1234, and V=1, the result is W1=0, and W0=0x1234.
If W0 = 0x8234, and V=1, the result is W1=0xFFFF, and W0=0x8234.
148

Bit Conversion Instructions

Mnemonic No. of Applicable


Ladder Description
Instruction Words Model

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

Bit Counter Instructions

Mnemonic No. of Applicable


Ladder Description
Instruction Words Model

SUM Store the number of bits in S that are 1 in D.


D= S 0001101001101001 No. of ON(=1)=7
SUM 3 All models
S= D 0000000000000111 D=7

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

Substitute the value of $0365 to word W20 as an initial condition.


151

Carry Bit Insturctions

Mnemonic No. of Applicable


Ladder Description
Instruction Words Model
SC
Set carry bit (F1.8) to 1.
SC 1 All models
1 F1.8

RC
Reset carry bit (F1.8) to 0.
RC 1 All models
0 F1.8

CC Reverse carry bit (F1.8) value.


F1.8 F1.8
CC 1 All models
1 0
0 1

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.

The output of M1.0 is set to ON or OFF depending on the status of F1.8.

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

M AX 4 Find Max. value among Ns Wore/Double


MA X F i n d Ma x. D =
D MA X va l u e i n t h e
F MA X block
S =
Ns=
4 words/Real Data value from S and then

5 write it into D.

MIN 4 Find Min. value of N N Wore/Double


MI N F i n d Mi n .
D =
D MI N va l u e i n t h e
F MI N block
S = 4 words/Real Data value from S and then
Ns=

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

Input data to 4 words from W100 to W103.


154

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.

Stored value to S address


Address Stored Value
S (W100) 3478
S+1 (W101) 2581
S+2 (W102) 247
S+3 (W103) 192

The result of MAX


Address Value
D (W200) 3478

The result of MIN


Address Value
D (W202) 192
155

Average Instruction

Mnemonic No. of
Name Ladder Description
Instruction Words

AVG 4 Find average value among Ns Word/Double


AVG
Block D =
DAVG A ve r a g e S = 4 Words/ Real Data value from S and then
FAVG Ns=

5 write it into D.

1. AVG value is integer arithmetic and round off decimals.


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

AV G
D=W 200
S=W 100
Ns=4

Input data to 4 words from W100 to W103.

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

The result of AVG


Address Value
D (W200) 1624
157

Data Sum Instruction

Mnemonic No. of
Name Ladder Description
Instruction Words

WSUM 4 Sum data values among Ns Word/Double


MS U M
D =
DSUM Sum Block
FSUM
S = 4 Words/Real Data value from S and then
Ns=

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

Input data to 4 words from W100 to W103.

Sum 4 words from W100 and stores it to D word.


Sum value is (3478+2581+247+192)=6498.

Stored value to S address.


Address Stored Value
S (W100) 3478
S+1 (W101) 2581
S+2 (W102) 247
S+3 (W103) 192
158

The result of WSUM


Address Value
D (W200) 6498
159

Data Sorting Instruction

Mnemonic No. of
Name Ladder Description
Instruction Words

Sort data value among Ns Word/Double


SORT 5
SORT Blcok D = Words/Real Data value from S in an
DSORT Sorting S =
FSORT Ns= 5
Method= ascending order / a descending order, and
6
then store it into D.

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

Input data to 4 words from W100 to W103.

Sorting 4 words from W100 and then store them to D in order of size.

Stored value to S address


Address Stored Value
S (W100) 3478
S+1 (W101) 2581
S+2 (W102) 247
S+3 (W103) 192
160

The result of SORT


Address When Method=0 When Method=1
D (W200) 192 3478
D+1 (W201) 247 2581
D+2 (W202) 2581 247
D+3 (W203) 3478 192
161

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.

Followings show various operating cases.


-If Dmax value is same with Dmin (S is fixed) D = Dmin
- If Smax is same with Smin (D is fixed) D = Dmin
163

- If Smin is bigger than Smax (slope is negative value) D = Dmin


-If S value is smaller than Smin (less than Min. value) D = Dmin
- If S value is bigger than Smax (More than Max. value) D = Dmax
164

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.

BAND Set dead band limit to Word/Double Words


BAND D =
S = 5 S value, and designate as 0 in this area. If
DBAND Set Band
FBAND Low=
High= 5-7 exceed limit, only exceed value stores into

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 PointDEC 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

DEC 25 can be input to M30 word by LET instruction.

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.

DEC 345678 can be input to M40 Word by DLET instruction.

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

Real number 90.0 can be input to M40 word by FLET instruction.

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.

ST ADD Convert S1 and S2 strings into a string that


D =
S TA D D String Add S1= 4 S1 comes first and then S comes next and
S2=

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.

String Input Example

If M0.0 is on, 5 is input to W100, and strings are input from W101 to W103 in order of Low byte.
171

When you input string, register area as 32WORD can be initialized.

MSB LSB
W100 5 String length (number of characters) is stored.

W101 „e‟ „H‟ $6548

W102 „I‟ „I‟ $6C6C

W103 \00 „0‟ $006F

W104 \00 \00 $0000


︙ ︙ ︙ ︙

W105 \00 \00 $0000

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

MSB LSB If M0.0 is ON, String length (number of characters) is

stored.

W100 5

W101 „e‟ „H‟ $6548

W102 „I‟ „I‟ $6C6C

W103 „o‟ $006F

MSB LSB
W110 7 String length (number of characters) is stored.

W111 „F‟ ‘ ’ $4620

W112 „I‟ „r‟ $6972

W113 „n‟ „e‟ $6E65

W114 „d‟ $0064

MSB LSB If M0.2 is ON, String length (number of characters) is

stored.

W120 12

W121 „e‟ „H‟ $6548

W122 „I‟ „I‟ $6C6C

W123 „‟ „o‟ $206F

W124 „r‟ „F‟ $7246

W125 „e‟ „i‟ $6569

W126 „d‟ „n‟ $646E

MSB LSB If M0.3 is ON, String length (number of characters) is

stored

W140 7

W141 „F‟ ‘ ’ $4620

W142 „I‟ „r‟ $6972

W143 „n‟ „e‟ $6E65

W144 „d‟ $0064


173

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

A2H Conver N strings in S into HEX value and


ASCII  HEX D =
A2H 4
C o n ve r s i o n S = then stores it on [D + (N/4 -1)] address in
N =

high nibble (4bit) order.

Convert HEX value from Low nibble on S

H2A into strings as number of Byte and then


HEX  ASCII D =
H2A
C o n ve r s i o n S = 4 stores it from [D + Byte/2] address in high
Bytes=

byte order. 2 strings fer Byte can be

created.

A2I Convert N strings from Low byte on S into


A2I ASCII  Integer D =
C o n ve r s i o n S = 4 32 bit integer with sign and then stores it to
N =

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

them from Low byte to high on D address.

A2L Conver N stings from lower byte on S into


A S C I I  2W o r d D =
A2L
C o n ve r s i o n S =
N =
4 32 bit integer with sign and then stores it to

D address.

Read values on D address as 32 bit integer


L2A
2W o r d  A S C I I D = and convert it into 11 strings. And then
L2A
C o n ve r s i o n S = 3
stores them from Low byte to high on D

address.

1. Word address can be assigned for A2H and D and S of A2I.


2. Word address can be assigned for H2A and D of I2A, word address, HEX value within word
range or 16 bit integer value with sign can be assigned for S.
3. Double word address can be assigned for D of A2L and S of L2A.
4. In case of A2I and A2L, error may occur when coversion values exceed 16 bit and 32 bit.
5. Only constant value can be assigned for N and Bytes. Constant values from 1 to 31 can be
assigned for H2A, from 1 to 5 for A2I, and from 1 to 10 for A2L.
175

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.0 is on, $00A5B3C1 is stored to from W100 to W101.

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.

Input Data (W100~W101)

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

If M0.0 is ON, integer valoe of 4720 is stored to W100.


If M0.1 is ON, 4720 stored in W100 is converted into 6 characters ASCII and “+04720” is stored from
Low byte in W200.
If M0.2 is on, 6 characters in from W200 to W202 are converted integer from Low byte characters in
W200 and then stored to W300.

Input Data (W100)

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

Trigonometrical Function Instructions

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.

Input 45.0 to M40 word by FLET instruction.

Convert it to radian value. Radian for 45.0 is 0.7853982.


179

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

Log Function Instructions

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

Input 100.0 to M40 word by FLET insturction.

If M0.0 contact point is ON,


-Convert M40 (100.0) to the Square Root, and then store 10.0 to M50 word.
-Convert M50 (10.0) to the Exponent, and then store 22026.46 to M52 word.
- Convert M50 (10.0) to the Log, and then store 1.0 to M54 word.
-Conver to M50 (10.0) to the LN, and then store 2.302585 to M56 word.
The result (81.0) of 4.0 raised to the power of 3.0 is stored to M58 word by Power Instruction.
182

Loop Repeat Insrcutions

Mnemonic No. of Applicable


Ladder Description
Instruction Words Model

Repeat execution D times between FOR and the


FOR
FOR D= corresponding NEXT (until D becomes 0) while 3 All models
decreasing the value D (word) by 1. (Starts FOR LOOP.)

Repeat execution D times between FOR and the


DFOR corresponding NEXT (until D becomes 0) while
DFOR D= 3 All models
decreasing the value D (double word) by 1. (Starts FOR

LOOP.)

End the repetitive execution from the FOR instruction.


NEXT NEXT 2 All models
(Ends FOR 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

Branching Control Instructions

Mnemonic No. of Applicable


Ladder Description
Instruction Words Model
JMP Jump to LB of the LBL instruction.
JMP Lb= 3 All models
(Jump by the pointer) Lb=0 to 63 (No duplicates)
LBL
Position jumped to by JMP.
LBL Lb= 2 All models
Lb=0 to 63 (No duplicates)

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.

LBL instruction completes the jumping to Lb1 in pair.

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

Mnemonic No. of Applicable


Ladder Description
Instruction Words Model
JMPS
JMPS Jump to JMPE instruction. (Starts the jump.) 2 All models

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

Mnemonic No. of Applicable


Ladder Description
Instruction Words Model
CALL
CALL Sb= Call subroutine Sb 3 All models

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

Interrupt Instructions (Interrupt Function Ver. 3)

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

1 Constant Cycle Interrupt

2 HSC0 Interrupt

9 PTO0: R16.0

10 PTO1: R16.1

17 External input: R0.0

18 External input: R0.1

19 External input: R0.4

20 External input: R0.5

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

made with the least number of steps.

INT 1: Periodic timed interrupt

Address Type Contents


SR480 Word Set a periodic time(ms)*
SR481.0 Bit User Interrupt Enable *
SR482.0 Bit Executing User Interrupt.*
SR483.0 Bit Lost User Interrupt.*

INT 2: Interrupt occurs when Comparison is Equal to Target Value

Address Type Contents


SR481.1 Bit User Interrupt Enable *
SR482.1 Bit Executing User Interrupt.*
SR483.1 Bit Lost User Interrupt.*
R40 Word High Speed Counter Mode
R40.7 Bit Software preset
R40.8 Bit Select Counter Mode of R0.3
On = Input Direction, Off = B Phase
R40.9 Bit Select Counter Mode of R0.2
On = Input Pulse, Off = A Phase
R40.10 Bit Enable Input Counter Inhibit using of R0.1
R40.11 Bit Enable Input Preset using of R0.0
R40.12 R40.13 Bit 00 = Mode 0 = Pulse Input Mode
10 = Mode 2 = Encoder Input Mode
R40.15 Bit On when HSC is operating
R42 Double Word Accumulator - Counted Pulses
R44 Double Word Preset Value
R46 Double Word High limit Compare Value
R48 Double Word Low limit Compare Value
R56 Double Word Software Preset Value
R65.0 Bit Enable HSC0
R65.2 Bit Start HSC0 counting
R65.6 Bit Set Ring Counter Mode
191

INT 9: Interrupt is triggered when PTO0 is finished

Address Type Contents


SR481.8 Bit User Interrupt Enable.*
SR482.8 Bit Executing User Interrupt.*
SR483.8 Bit Lost User Interrupt.*
R80 Word Pulse Train Output Mode
R80.9 Bit Enable Direction Output using of R16.2
R80.11 Bit Control Direction Output Mode of R16.2
R80.12 R80.13 Bit 00 = PTO Mode = Pulse Output(R16.0) + Direction(R16.2)
10 = PWM Mode = PWM Pulse Output(R16.0) +
Direction(R16.2)
R80.15 Bit On when PTO is operating
R81 Word Pulse Output Frequency : 20 - 5KHz
R82 Double Word PWM Mode = Duty ratio : 25 - 75%
PTO Mode = Pulse Output Numbers
R84 Double Word the number of output pulses
R86 Word Start Frequency
R87 Word Acceleration Pulse
R88 Word Deceleration Pulse

INT 10: Interrupt is triggered when PTO1 is finished.

Address Type Contents


SR481.9 Bit User Interrupt Enable.*
SR482.9 Bit Executing User Interrupt.*
SR483.9 Bit Lost User Interrupt.*
R90 Word Pulse Train Output Mode
R90.9 Bit Enable Direction Output using of R16.3
R90.11 Bit Control Direction Output Mode of R16.3
R90.12 R90.13 Bit 00 = PTO Mode = Pulse Output(R16.1) + Direction(R16.3)
10 = PWM Mode = PWM Pulse Output(R16.1) +
Direction(R16.3)
R90.15 Bit On when PTO is operating
R91 Word Pulse Output Frequency : 20 - 5KHz
R92 Double Word PWM Mode = Duty ratio : 25 - 75%
192

PTO Mode = Pulse Output Numbers


R94 Double Word the number of output pulses
R96 Word Start Frequency
R97 Word Acceleration Pulse
R98 Word Deceleration Pulse

INT 17: Interrupt is triggered by External Input R0.0

Address Type Contents


SR480 Bit User Interrupt Enable.*
SR485.0 Bit Executing User Interrupt.*
SR486.0 Bit Lost User Interrupt.*

INT 18: Interrupt is triggered by External Input R0.1

Address Type Contents


SR480 Bit User Interrupt Enable.*
SR485.0 Bit Executing User Interrupt.*
SR486.0 Bit Lost User Interrupt.*

INT 19: Interrupt is triggered by External Input R0.4

Address Type Contents


SR484.2 Bit User Interrupt Enable.*
SR485.2 Bit Executing User Interrupt.*
SR486.2 Bit Lost User Interrupt.*

INT 20: Interrupt is triggered by External Input R0.5

Address Type Contents


SR484.3 Bit User Interrupt Enable.*
SR485.3 Bit Executing User Interrupt.*
SR486.3 Bit Lost User Interrupt.*
193

Constant cycle scan (V2.xx or earlier)

Mnemonic No. of Applicable


Ladder Description
Instruction Words Model

Begin block of constant cycle scan instructions. (Only

one instruction is available)


INT
INT V= V = 1 to 999. Control bit = F0.11 2 Note 1)
Constant cycle time = (V+1)×0.01 sec (20 msec to 10

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

Input Output Signal Controlling

Mnemonic No. of Applicable


Ladder Description
Instruction Words Model

Refresh external input (get input signal during


INPR
INPR Ch= execution of program). 2 Note 1)
Ch is external input word address.

Refresh external output (send output signal during


OUTR
OUTR Ch= execution of program). 2 Note 1)
Ch is external output word address.

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

The contact F1.0 is set to ON at one scan that starts a program.


$0080 is assigned for the output unit R3 word. Date will be directly transmitted into the output unit.

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

System Control Instructions

Mnemonic No. of Applicable


Ladder Description
Instruction Words Model
W AT
WAT Clear watchdog elapsed value. (Processed as 0) 1 Note 1)

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

High Speed Counter Instructions

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

NX7: Max. Phase 8 KHz/ or more, 4 KHz, 1 Channel


\NX7R: Max. 40 KHz, 2 Channels

Parameter Setting

Address Address Signal Functions


(CH0) (CH1)
R40 R41 Mode Setting Bit 0-6: Reserved
Bit 7: S/W Preset function setting
Bit 8: Set whether to use R0.3(R0.7) Direction/ B phase
Bit 9: Set whether to use R0.2(R0.6) pulse / A phase
Bit 10: Set whether to use R0.1(R0.5) counter inhibit
Bit 11: Set whether to use R0.0(R0.4) preset
(* If ON, Available, If OFF, Not Available)
Bit 13:12: Mode Setting
00: Pulse input mode 11: Encoder input mode
Bit 14: Ring Mode Setting
Bit 15: Display RUN/STOP Status
R42-43 R50-51 PV Display Counter PV (32bit)
R44-45 R52-53 Preset Counter Preset Value (32bit)
R46-47 R54-55 CmpH Max. Counter Comparition Value (32bit)
R48-49 R58-59 CmpL Min. Counter Comparition Value (32bit)
R56-57 R60-61 SV Counter Setting Value (32bit)
** Only NX7R supports CH1.
201

Control Setting

Address Signal Function


R65.0(R65.1) Enable Parameter Setting Complement
On if SET_HSC instruction is executed.
R65.2(R65.3) START Counter Start/Stop
When you use HSC instruction, it shows input status.
If it is started correctly, it is reflected on R40.15(R41.15).
(If ON, START. If OFF, STOP)

Input Terminal

Address Signal Function


R0.0(R0.4) Preset It stores Preset value as CV. That is, if contact is on, initial value
can be stored as current value.
(But, it works when R40.11 (R41.11) address is set)
R0.1(R0.5) Inhibit Input counter inhibit (If contact is on, counting can be inhibitted).
(But, it works when R40.10 (R41.10) address is set)
R0.2(R0.6) IN 0 If set MODE0: Count pulse input
If set MODE2: A phase of Encode input
R0.3(R0.7) IN 1 If set MODE0: Count direction input
If set MODE2: B phase of Encode input
** Contents in () are for CH1 only.
202

Pulse PWM Control Instructions

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.

Instructions Operand Size Contents


SET_PWM Ch 1W PWM Ch number
Mode 1W Set PWM mode
Freq 2W PWM Target output frequency
SV 2W PWM output command pulse
Duty 1W PWM On Duty %
PWM D 2W PWM output pulse
Ch 1W PWM number

Privious Version

Instructions Operand Size Inside Register Contents


PWM PV 2W R85:84/R95/94 PWM Ch0/1 CV
Ch 1W 0,1 PWM Ch0/1 number
Mode 1W R80/90 PWM Ch0/1 mode Setting
SV 2W R83:82/R93:92 PWM Ch0/1 initial pulse
Duty W R81/91 PWM Ch0/1 Duty value
203

EN Bit R64.0/64.1 PWM Ch0/1 Parameter Load


RUN Bit R64.2/64.3 PWM Ch0/1 Run Excution
204

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

Address Address Signal Functions


(CH0) (CH1)
R80 R90 Mode setting Bit 0-8: Reserved
Bit 9: Set whether to use R16.2(R16.3) direction output
(1: Available, 0: Not Available)
Bit 10: Reserved
Bit 11: Control R16.2(R16.3) direction output control
(1 = High, 0 = Low)
Bit 13:12: mode setting
00: PTO mode (Pulse + Direction)
11: PWM mode (PWM + Direction)
Bit 14: Reserved
Bit 15: Display RUN/STOP status
R81 R91 Target Set Frequency Output
Frequency(Freq)
R82~83 R92-93 Pulse Output Set Pulse Output
(SV)
R84-85 R94-95 Output Pulse Display the Output Pulse
(PV)
R86 R96 Start Frequency PTO mode: Start Frequency
205

(Start or Duty) PWM mode: On Duty setting


R87 R97 Acceleration PTO Mode: Set Acceleration Pulse
Pulse (Acc) PWM Mode: Not Available
R88 R98 Deceleration PTO Mode: Set Deceleration Pulse
Pulse (Dcc) PWM Mode: Not Available
R89 R99 Reserved

Contorl Setting

Address Signal Function


R64.0(R64.1) Enable Parameter Input Complement
On if SET_PTO (or SET_PWM) instruction is executed.

R64.2(R64.3) START Pulse Output Start/Stop


If PTO/PWM instructions are input, it shows input status.
If it starts correctly, it is reflected on R80.15(R91.15).
(If ON, START. If OFF, STOP)
** Contents in () are for CH1 only.

Output Termination

Address Signal Function


R16.0(R16.1) Pulse Output Output PTO/PWM pulse.
R16.2(R16.3) Direction If R80.9 (R90.9) is ON, output the status of R80.11 (R90.11).

Output
** Contents in () are for CH1 only.
206

Pulse Output PTO Instructions

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.

Instructions Operand Size Contents


SET_PTO Ch 1W PTO number
Mode 1W Set PTO mode
Freq 2W PTO Target Output Frequency
SV 2W PTO Output Command Pulse
Start 1W PTO Start Frequency
Acc 1W PTO Acceleration Frequency
Dcc 1W PTO Decceleration Frequency
PTO D 2W Output PTO Pulse
Ch 1W PTO number

Privious Version
207

Instructions Operand Size Internal Contents


Register
PTO PV 2W R85:84/R95/94 PTO Ch0/1CV
Ch 1W 0,1 PTO Ch0/1 number
Mode 1W R80/90 PTO Ch0/1 mode Setting
Freq 1W R81/91 PTO Ch0/1 Output Frequency
Value
SV 2W R83:82/R93:92 PTO Ch0/1Output Pulse
Start 1W R86/96 PTO Ch0/1 Start Frequency
Acc 1W R87/97 PTO Ch0/1 Acceleration Pulse
Decel 1W R88/98 PTO Ch0/1 Acceleration Pulse
EN Bit R64.0/64.1 PTO Ch0/1 Parameter Load
RUN Bit R64.2/64.3 PTO Ch0/1 Run Execution
208

PID Control Instructions

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

Instructions Operand Size Contents


SET_PID Parm 1W Assign the start register for PID Parameter
Settings
Control 1W Set PID control mode
SP 1W Set Point
PV 1W Process Value Input
Kc 1W Set Controller Gain
Ti 1W Set Integral Gain
Td 1W Set Derateive Gain

L-Time 1W Set Sample Time (x10ms)


FF/Bias 1W Set Feedforward Bais
DB 1W Set Deadband
SPmax 1W Set point maximum value
SPmin 1W Set point minimum value
CVmax 1W Contorl Output Value maximum value
CVmin 1W Contorl Output Value minimum value
PID Parm 1W PID Parameter Block first register

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

Control Value (CV).


Input the current value of the process controlled variable on PV by using the D/A conversion unit, etc.
Output CV, which is PID operation value, as the process by using the D/A conversion unit, etc.
Set the modulus (proportional gain, integral time, derivative time) used for PID operation or the
operation type and period as parameter tables. The PID operation is performed as specified.
210

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

9 SP max Max. Set Value Input -32768 ~ 32767

10 SP min Min. Output Value Input -32768 ~ 32767

11 ZCB Dead Band Input 0 ~ 32767

12 CV max Max. Output Value Input -32768 ~ 32767

13 CV min Min. Output Value Input -32768 ~ 32767

14 Ts Sampling Time Input 0 ~ 65535

15 ECODE Error Code Output


16~17 PID Calcuation Area

18 CV man Force output in manual mode Input -32768 ~ 32767

19~29 PID Calcuation Area


211

Status Display Word (STATUS)

Bit No. Contents


Bit 0 PID enable
1 : PID enable, 0 : PID disable
Bit 1 PID done
1 : PID Complete, 0 : PID ready
Bit 2 PID parameter error
1 : Error, 0 : Normal
Bit 3 DB : Error is in Deadband
1: Absolute value of Error  Dead Band Value, 0: Absolute Error > Dead Band
Bit 4 Fast PID Sampling Time
1 : PID lost working, 0 : none
Bit 5 CV is over Cvmax when Output Limiting Enable
1 : CV > Cvmax, 0 : CV <= CVmax
Bit 6 CV is under Cvmin when Output Limiting Enable
1 : CV < CV min , 0 : CV > CV min
Bit 7 SP out of range when SP Limiting Enable
1 : SP < SP min, or SP > SP max, 0 : SP min <= SP <= SP max
Bit 8 PV ou of range when SP Limiting Enable
1 : PV < SP min, or PV > SP max, 0 : SP min <= PV <= SP max
Bit 9~15 Reserved

Contol Word (CONTROL)

Bit No. Contents


Bit 0 Always Off
Bit 1 Set Auto/Manual Mode
0: Automatic, 1: Manual
Bit 2 Error
1: FORWARD (PV-SP or PVn-1 - PVn),
0: REVERSED (SP-PV or PV – PVn-1)
Bit 3 Set Output Value Range Limit
212

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 Point (SP)

Set the Set Point of the process controlled variable. (-32768 ~ 32767)
If the SP range limit is enabled, set to SPmin and SPmax.

Process Value (PV)

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.

Intergral Time (Ti)

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.

Differential Time (Td)

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

If 0, the differential is not carried out.

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.

Maximum Set Point (SPmax)

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.

Maximum Set Point (SPmin)

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.

Maximum Output Value (CVmax)

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.

Maximim Output Value (CVmin)

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

Operating Cycle (Ts)

Set the PID of operating cycle. (1 ~ 65535 x 10ms)


If the operating cycle is too fast, Bit 4 on the Status becomes On.

Error Code (ECODE)

Check if PID parameter errors occur or not, and display the results.

Error Code Contents Action


11 Operating Cycle Setting Error (Ts) Set Operating Cycle to 1 or more.

12 Controller Gain Setting Error (Kc) Set Contoller Gain to 0 or more.

13 Integral Time Setting Error (Ti) Set Integral Time to 0 or more.


14 Differential Time Setting Error (Td) Set Differential Time to 0 or more.
21 SP Setting Error Set target Min. SP to below than Max.SP.
25 Dead Band Range Setting Error Set Dead Band setting value to 0 or mor
26 SP Setting Error Set min. SP to below than Max. SP.

CV manual operation value (CV manual)


Set the CV value, when PID is in manual operation mode.

Weak area for Operating


It is internal area for PID operating. Do not use this to other operation. It may cause of PID operating
error.

Caution
PID operating uses 30 words form register in Para. Be careful this area not to use in other operating.

Note) PID

CV = Kc x ( dE + 1/Ti ∫ dE x dt + Td x dE/dt) + Bias

CV: Output Value

dE: Error Value (SP- PV or PV – PVn-1)


216

Operation according to CONTROL Setting

Set Differential Proportional Kind of Expression


Forwared/ error error Operation
Reversed handling handling

Off Off Off PID CV = Kc x ( dE + 1/Ti ∫ dE x dt + Td x dE/dt)

dE : SP-PV

Off Off On PI-D CV = Kc x ( dE + 1/Ti ∫ dE x dt + Td x

dPV/dt)

dE : PV-SP

dPV :PV - PVn-1

Off On On I-PD CV = Kc x ( dPV + 1/Ti ∫ dE x dt + Td x

dE/dt)

dE : PV-SP

dPV :PV - PVn-1

On Off Off PID CV = Kc x ( dE + 1/Ti ∫ dE x dt + Td x dE/dt)

dE : PV-SP

On Off On PI-D CV = Kc x ( dE + 1/Ti ∫ dE x dt + Td x

dPV/dt)

dE : PV-SP

dPV :PVn-1 - PV

On On On I-PD CV = Kc x ( dPV + 1/Ti ∫ dE x dt + Td x

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.

1. This instruction is used for system debugging or diagnostics.


2. This instruction changes PLC mode to an error mode.
3. You can check the error codes in online - System Information - CPU Diagnostics - Misc.
4. Click "Clear fault", or set F1.14 bit to 1 to clear the 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.

G e t R TC GET_TIM Get Time/Minute/Second from Real time


G E T_ T I ME Ti m e ED = 2
clock on PLC.
T2S
Ti m e t o 4 Conver Time (BCD) to Second (decimal
T2 S Second D =
S =
data).
S2T
Second to 4 Conver Second (decimal data) to Time
S2T Ti m e D =
S =
(BCD).

Constant value can be set for SET_DATE and SET_TIME.


Every data for RTC is BCD type.
Data by word address for GET_DATE
D High byte Year
Low byte Month
D+1 High byte Date
Low byte Hour
Data by word address for GET_TIME
D High byte DATE
Low byte HOUR
D+1 High byte MIN
Low byte SEC
219

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

Shared Memroy Reading

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

* Reference) Operand method: NN=number, NR=Number or register, RR=register

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

Shared Memory Writing

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.

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

* Reference) Operand method: NN=number, NR=Number or register, RR=register

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

memory area of PLC CPU is internal register area.

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

Remote Reading Instruction

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.

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

* Reference) Operand method: NN=number, NR=Number or register, RR=register

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

words W10 to W13 Word while the remote communication is normal.


226

Remote Writing Instruction

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.

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

* Reference) Operand method: NN=number, NR=Number or register, RR=register

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

Link Data Receiving Instruction

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.

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

* Reference) Operand method: NN=number, NR=Number or register, RR=register

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

Link Data Sending Instruction

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

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

* Reference) Operand method: NN=number, NR=Number or register, RR=register

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.

Link network = 1, Station (ID) number = 4


Storage address for transmission W=6,
Start address = 10
Transmitted words = 5,
Transmitted words start address = R4
232

Link Bit Receive (RECVB)

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

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

* Reference) Operand method: NN=number, NR=Number or register, RR=register

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.

Storage bit address for the received value = M2.0


Link network = 1, Station (ID) number = 3
Reception storage address K = 3,
Storage bit address = 01.2
234

Link Bit Sending Instructions (SENDB)

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.

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

* Reference) Operand method: NN=number, NR=Number or register, RR=register

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.

Link network = 1, Station (ID) number = 4


Bit addresses to store M = 1,
Bit address = 00.1
Bit address to transmit = R3.2
236

Modbus Controll

Mnemonic No. of
Name Ladder Descriptions
Instruction Words

Read and write by Modbus RTU.

- Port is a communication port wihic is


embedded in CPU

- SID is communication address of the


MODBUS RTU device.

Modbus - SL Addr is register of MODBUS RTU

Commu- device
MODCOMM 6
nication - Reg is storage of NX PLC

(Master) - N is a WORD or number of Bit

- Status is register to show


communication status

- FNC is the function code of Modbus


communication

- TimeOut is specified Time Out

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.

S0 (EN): On if it is enabled. Off if S3 is on.


S1 (DN): On when communication is terminated. Off if communication is started.
S2 (ERR): On if communication error is occurred. S1 is on at this time.
S3 (BUSY): On If communication is started or enabled. Off if S3 is on.
S8 - S15: When errors are occurred (when S2 bit is on), following error codes are stored.
- Mod_No Error : 0 ($00) - Mod_Timeout Error : 1 ($01)
- Mod_MasterNotEnable : 2 ($02) - Mod_NotSupportPort : 3 ($03)
- Mod_NotSupportCmd : 4 ($04) - Mod_CRC Error : 5 ($05)
9. FNC supports 01, 02, 03, 04, 05, 06, 15, and 16 of Modbus Protocol. Functions of each code
are as follow:
01($01): Read Coil Status,
02($02): Read Input Status,
03($03): Read Holding Registers
04($04): Read Input Registers,
05($05): Force Single Coil,
06($06): Preset Single Register,
15($0F): Force Multiple Coils,
16($10): Preset Multiple Registers.
10. Time out is the maximum wating time. If there is no reponse in this thime, Timeout Error is
occurred and communication is terminated. The unit is 10 msec.
11. This Flag register is only for MODCOMM instruction.
238

- F13.8 (Enable): ON if COM1 Port of Modbus communication is available.


- F13.9 (Busy): On if COM1 Port of the Modbus communication is BUSY.
- F13.10 (Error): On if COM1 Port Error of the Modbus communication is occurred.
- F13.11 (Timeout): ON if COM1 Port of the Modbus communication is Timeout.
- F13.12 (Enable): ON if COM2 Port of Modbus communication is available.
- F13.13 (Busy): On if COM2 Port of the Modbus communication is BUSY.
- F13.14 (Error): On if COM2 Port Error of the Modbus communication is occurred.
- F13.15 (Timeout): On if COM2 Port of the Modbus communication is Timeout.
12. Set internal special contact point to support Modbus Slave communication Protocol.

Special Function Note


Contact Point
F12.02 Switch COM1 Port Modbus slave “1” Modbus RTU Mode
communication
F12.09 Switch COM2 Port Modbus slave “1” Modbus RTU Mode
communication
239

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

R000.00~R127.15 2048 $0000~$07FF 100001~102048 000001~002048 External Relay

Contact Point

L000.00~L063.15 1024 $0800~$0BFF 102049~103072 002049~003072 Link Data

Contact Point

M000.00~M127.15 2048 $0C00~$13FF 103073~105120 003073~005120 Internal Relay

Contact Point

K000.00~K127.15 2048 $1400~$1BFF 105121~107168 005121~007168 Keep Contact

Point

F000.00~F015.15 256 $1C00~$1CFF 107169~107424 007169~007424 Special Relay

Contact Point

TC000 ~ TC255 256 $1D00~$1DFF 107425~107680 007425~007680 Timer/Counter

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

R000 ~ R127 128 $0000~$07FF 30001~30128 40001~40128 External Relay

Word

L000 ~ L063 64 $0800~$0BFF 30129~30192 40129~40192 Link Data Word

M000 ~ M127 128 $0C00~$13FF 30193~30320 40193~40320 Internal Relay

Word

K000 ~ K127 128 $1400~$1BFF 30321~30448 40321~40448 Keep Word

F000 ~ F015 16 $1C00~$1CFF 30449~30464 40449~40464 Special Relay

Word

TC000 ~ TC255 16 $01D0~$01DF 30465~30480 40465~40480 Timer/Counter

Contact Point

W0000 ~ W2047 2048 $0200~$09FF 30513~32560 40513~42560 Interal Register

Word
240

SV000 ~ SV255 256 $0A00~$0AFF 32561~32816 42561~42816 TC Setting

Value

PV000 ~ PV255 256 $0B00~$0BFF 32817~33072 42817~43072 TC Process

Value

SR000 ~ SR511 512 $0C00~$0DFF 33073~33584 43073~43584 Internal Special

Register

D0000 ~ D2047 2048 $0E00~$15FF 33585~35632 43585~45632 Internal

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.

Radder program with MOCOCOMM instruction and result

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

Read or write data from other NX PLC.

- Port is a communication port which is


embeded in CPU

- ID is communication address of the


PLC
PLC
- SL Addr is register of the PLC
Commu- 9
PLCCOMM - MA Addr is register of Master PLC
nication
- Size is the No. of WORD or Bit
(Master)
- Status is register to show
commnucation status

- FNC is the Function code of NX PLC


ccommuncation

- TimeOut is specified Time Out (x10ms).

1. To communicate by using PLCCOMM instruction, contact point of SR272.0 in COM1 Port


and SR273.0 in COM2 Port should be enabled.
2. COM1 (1) or COM2 (2) which is embedded in CPU can be specified as communication port.
3. Parameter value between 0 and 233 can be specified as ID (PLC Slave ID).
4. SL Addr (Slave Address) can specify address (Bit or Word) of Slave device.
5. MA Addr (Master Address) can specify address (Bit or Word) of Master device.
6. Size means Data length that is specified on Protocol, only parameter should be specified.
7. Status is a word to show current communication status, and specify addresses in bit address
areas such as R, L, M, K, and F to check the contact point status. Following shows the bit
status of specified addresses.

S0 (EN): On when communication is enabled. OFF when communication is begine (S3 is


ON).
244

S1 (DN): On when communction is terminated. OFF when communication is begine.


S2 (ERR): On if communication error is occurred. And then, S1 is ON.
S3 (BUSY): On If communication is begine or request is accepted. OFF If S3 is On.
S4 (Timeout): On if there is no communication during Timeout.
8. 01 and 02 functional code of NXplus PLC can be supported by FnCode (Function Code).
01: Read Word, 02: Write Word
9. Time out is the maximum wating time. if there is no reponse in this thime, Timeout Error is
occurred and communication is terminated. The unit is 10 msec.
10. SR272 (COM1) and SR273 (COM2) can be assigned to control the PLCCOMM instruction.
This address is only for the PLCCOMM instruction..

Bit 0 (Enable): Enabled when it is On.


Bit 1 (Done): On when communication of this port is terminated.
Bit 2 (Busy): On when communication status is BUSY.
Bit 3 (Error): On when communication error is occurred.
Bit 4 (Timeout): On when the Timeout is occurred.
11. Input Contact point should be ON during communication.
245

ASCII Communication Instructions

Mnemonic No. of
Name Ladder Descriptions
Instruction Words

Send information to ASCII Serial device.

- Port is a communication port which is


embeded in CPU

- Txbuf is starting address to send.


- TxLen is data byte length to send.
Write
- S Char is starting character to input
ASCII 9
WRASCII when it is transmited.
Communicat
- E Char is ending character to input
ion
when it is transmitted.
- Status shows communication status

- Mode specifes the communication


mode.

- TimeOut is the specified Time Out.

Receive information from ASCII Serial


device.

- Port is a communication port which is


embeded in CPU
- Txbuf is starting address to send.

Read - TxLen is data byte length to send.

ASCII 9 - S Char is starting character to input


RDASCII
Communicat when it is transmited.

ion - E Char is ending character to input


when it is transmitted.

- Status shows communication status

- Mode specifes the communication


mode.

- TimeOut is the specified Time Out.


246

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.

M0: Transmission starting character is 1 Byte.


M1: Transmission starting character is 2 Byte. (If M1 is set, M0 is ignored.)
M2: Transmission ending character is 1 Byte.
M3: Transmission ending character 2 Byte. (If M3 is set, M2 is ignored.)
6. Following shows status of communication in Status.

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

Hex Communication Instrcutions

Mnemonic No. of
Name Ladder Descriptions
Instruction Words

Send Binary information to Serial device.

- Port is a communication port which is


embeded in CPU

- Txbuf is data storage to send

Write - TxLen is data byte length to send

Binary 9 - S Char is starting character to input when it


WRBIN
Communica is transmitted.

-tion - E Char is ending character to input when it is


transmitted.

- Status shows communication status

- Mode specifies the communication mode

- TimeOut is specified Time Out.

Receive Binary information from Serial


device.

- Port is a communication port which is


embeded in CPU

- Txbuf is data storage to send


Read
- TxLen is data byte length to send
Binary 9
RDBIN - S Char is starting character to input when it
Communica
is send to.
-tion
- E Char is ending character to input when it is
send to.

- Status shows communication status

- Mode specifies the communication mode

- TimeOut is specified Time Out.

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

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.

M0: SChar is 1 byte.


M1: SChar is 2 byte.
M2: EChar is 1 byte.
M3: EChar is 2 byte.

6. Following shows status of communication in Status.

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

Communication Code Operating Instruction

Mnemonic No. of
Name Ladder Descriptions
Instruction Words

Calculate CHKSUM which is specified


CHKSUM type by data increased as the number of
D =
CHKSUM Check Sum
S =
Bytes=
5 bytes from S address and store to D
Type=
address.
Able to choose CRC-16 or SUM16.

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

Das könnte Ihnen auch gefallen