GP PRO Ex Instructions
GP PRO Ex Instructions
Instructions
This chapter describes GP-Pro EX logic instructions. Instructions that can be used in logic
programs are described in detail.
29.1 Instructions....................................................................................................29-2
29.2 Instruction Notation List.................................................................................29-6
29.3 About Addresses You can Set up as Operands ..........................................29-34
29.4 Number of Steps Per Instruction .................................................................29-42
29.5 Instruction Descriptions...............................................................................29-43
29-1
Instructions
29.1 Instructions
The following table provides a list of instructions available for the logic program. Models
that support logic can use all of these instructions. The instructions are divided into the
following nine categories: (1) Basic, (2) Timer, (3) Counter, (4) Read/Write, (5) Operation,
(6) Function, (7) Comparison, (8) Conversion, (9) I/O Driver Instructions.
Category Instruction Name Instruction
Basic Bit Basics Normally Open NO
Normally Closed NC
Out OUT
Negative Out OUTN
Set SET
Reset RST
Pulse Basic Positive Transition PT
Down Transition NT
Program Jump JMP
Control Jump to Subroutine JSR
Return RET
Repeat Processing FOR
NEXT
Inverse INV
Exit EXIT
Power Bar Control PBC
Power Bar Reset PBR
Logic Wait LWA
Timer ⎯ On Delay Timer TON
Instruction Off Delay Timer TOF
Pulse Timer TP
Duration On Delay Timer TONA
Duration Off Delay Timer TOFA
Counter ⎯ Up Counter CTU
Instruction Down Counter CTD
Up/Down Counter CTUD
R/W Time Read/ Read Time JRD
Instruction Write Set Time JSET
Date Read/ Read Date NRD
Write Set Date NSET
Continued
Positive PT 2 to 5 steps 1
Pulse Basic
Transition
Down NT 2 to 5 steps 1
Transition
Jump JMP 2 Step ⎯
Program Control
NEXT 1 Step ⎯
Basic Instructions
PBR 2 Step 1
(Note)
To use 1 step, the number of steps must be fewer than the clear bit variables (M address) +
1536. If more than 1536 bit variables are created with clear bit variable settings, there will be
2 steps.
Please configure retentive/volatile settings in the Retentive Settings dialog box.
1
Timer Instruction
Number of Steps
Determination
in Instruction
Instruction
Number of
Operands
Category
Notation
of Input
Symbol
Ladder
Name
Continued
Pro EX Instruction
Number of Steps
Determination
in Instruction
Instruction
Number of
Operands
Category
Notation
of Input
Symbol
Ladder
Counter Down Name CTD 2 Step 1 Level
Instruction Counter
Pro EX Instruction
Number of Steps
Determination
in Instruction
Instruction
Number of
Operands
Category
Notation
of Input
Symbol
Ladder
Name
Pro EX Instruction
Number of Steps
Determination
in Instruction
Instruction
Number of
Operands
Category
Notation
of Input
Symbol
Ladder
Name
ADDP 4 to 13 3 Up Edge
steps
SUB 4 to 13 3 Level
steps
Arithmetic
Operation
Subtract
SUBP 4 to 13 3 Up Edge
steps
MUL 4 to 13 3 Level
steps
Multiplication
MULP 4 to 13 3 Up Edge
steps
Continued
Pro EX Instruction
Number of Steps
Determination
in Instruction
Instruction
Number of
Operands
Category
Notation
of Input
Symbol
Ladder
Name
DIV 4 to 13 3 Level
steps
Division
DIVP 4 to 13 3 Up Edge
steps
MOD 4 to 13 3 Level
steps
Modulation
Arithmetic
Operation
MODP 4 to 13 3 Up Edge
steps
INC 2 to 4 1 Level
steps
Increment
INCP 2 to 4 1 Up Edge
steps
DEC 2 to 4 1 Level
steps
Decrement
DECP 2 to 4 1 Up Edge
steps
in the Instructions
Pro EX Instruction
Number of Steps
Determination
Instruction
Number of
Operands
Category
Notation
of Input
Symbol
Ladder
Name
Instruction
AND
Logical
Name
Instruction Notation List
Pro EX Instruction
ANDP
Notation
Number of Steps
steps
steps
4 to 13
4 to 13
in Instruction
29-14
3
3
Number of
Operands
Determination
Level
of Input
Up Edge
Ladder
Symbol
Continued
Instruction Notation List
Pro EX Instruction
Number of Steps
Determination
in Instruction
Instruction
Number of
Operands
Category
Notation
of Input
Symbol
Ladder
Name
Logical OR 4 to 13 3 Level
OR steps
ORP 4 to 13 3 Up Edge
steps
Logical
XORP 4 to 13 3 Up Edge
steps
NOTP 3 to 9 2 Up Edge
steps
Pro EX Instruction
Number of Steps
Determination
in Instruction
Instruction
Number of
Operands
Category
Notation
of Input
Symbol
Ladder
Name
MOVP 3 to 9 2 Up Edge
steps
BLMVP 6 to 10 3 Up Edge
Operation
Transfer
steps
FLMVP 4 to 10 3 Up Edge
steps
Continued
29.2.9
Category Category
Shift Transfer
Instruction
Instruction Name
Name
Shift Left
Exchange
Instruction Notation List
Shift Instructions
SHL
XCH
SHLP
XCHP
Notation Notation
steps
steps
3 to 7
3 to 7
in Instruction
4 to 10
4 to 10
in Instruction
29-17
3
3
2
2
Number of Number of
Operands Operands
Determination Determination
Level
Level
of Input of Input
Up Edge
Up Edge
Ladder Ladder
Symbol Symbol
Continued
Instruction Notation List
Pro EX Instruction
Instruction Name
Number of Steps
Determination
in Instruction
Number of
Operands
Category
Notation
of Input
Symbol
Ladder
Shift Right SHR 4 to 10 3 Level
steps
SHRP 4 to 10 3 Up Edge
steps
Shift
SALP 4 to 10 3 Up Edge
steps
SARP 4 to 10 3 Up Edge
steps
Pro EX Instruction
Number of Steps
Determination
in Instruction
Instruction
Number of
Operands
Category
Notation
of Input
Symbol
Ladder
Name
ROLP 4 to 10 3 Up Edge
steps
Operation
Rotation
RORP 4 to 10 3 Up Edge
steps
Continued
Pro EX Instruction
Number of Steps
Determination
in Instruction
Instruction
Number of
Operands
Category
Notation
of Input
Symbol
Ladder
Name
Rotate Left RCL 4 to 10 3 Level
with Carry steps
Over
RCLP 4 to 10 3 Up Edge
steps
Operation
Rotation
RCRP 4 to 10 3 Up Edge
steps
Pro EX Instruction
Number of Steps
Determination
in Instruction
Instruction
Number of
Operands
Category
Notation
of Input
Symbol
Ladder
Name
SUMP 4 to 10 3 Up Edge
steps
steps
Function
AVEP 4 to 10 3 Up Edge
steps
SQRTP 3 to 7 2 Up Edge
steps
Continued
PID
Instruction
Name
Bit Count
Instruction Notation List
PID
BCNT
Notation
BCNTP
Number of Steps
steps
steps
steps
3 to 9
3 to 9
in Instruction
10 to 18
5
2
2
29-22
Number of
Operands
Determination
Level
Level
of Input
Up Edge
Ladder
Symbol
Instruction Notation List
Pro EX Instruction
Number of Steps
Determination
in Instruction
Instruction
Number of
Operands
Category
Notation
of Input
Symbol
Ladder
Name
SINP 3 to 7 2 Up Edge
steps
COSP 3 to 7 2 Up Edge
steps
Trigonometric
Function
TANP 3 to 7 2 Up Edge
steps
ASINP 3 to 7 2 Up Edge
steps
Continued
Pro EX Instruction
Number of Steps
Determination
in Instruction
Instruction
Number of
Operands
Category
Notation
of Input
Symbol
Ladder
Name
Arc ACOS 3 to 7 2 Level
Cosine steps
ACOSP 3 to 7 2 Up Edge
steps
ATANP 3 to 7 2 Up Edge
steps
COTP 3 to 7 2 Up Edge
steps
Pro EX Instruction
Number of Steps
Determination
in Instruction
Instruction
Number of
Operands
Category
Notation
of Input
Ladder
Name
Chart
Exponential EXP 3 to 7 2 Level
steps
EXPP 3 to 7 2 Up Edge
steps
Miscellaneous function
Logarithm LN 3 to 7 2 Level
steps
Function
LNP 3 to 7 2 Up Edge
steps
LG10P 3 to 7 2 Up Edge
steps
Pro EX Instruction
Number of Steps i
Determination
n Instruction
Instruction
Number of
Operands
Category
Notation
of Input
Symbol
Ladder
Name
Comparison EQ 3 to 9 2 Level
(=) steps
Comparison GT 3 to 9 2 Level
(>) steps
Comparison LT 3 to 9 2 Level
(<) steps
Arithmetic Compare
Compare
Comparison GE 3 to 9 2 Level
(> =) steps
Comparison LE 3 to 9 2 Level
(< =) steps
Comparison NE 3 to 9 2 Level
(<>) steps
Continued
Pro EX Instruction
Number of Steps
Determination
in Instruction
Instruction
Number of
Operands
Category
Notation
of Input
Symbol
Ladder
Name
Pro EX Instruction
Number of Steps
Determination
in Instruction
Instruction
Number of
Operands
Category
Notation
of Input
Symbol
Ladder
Name
Pro EX Instruction
Number of Steps
Determination
in Instruction
Instruction
Number of
Operands
Category
Notation
of Input
Symbol
Ladder
Name
BCDP 3 to 7 2 Up Edge
steps
BINP 3 to 7 2 Up Edge
steps
Data Convert
steps
ENCOP 3 to 7 2 Up Edge
steps
DECOP 3 to 7 2 Up Edge
steps
Continued
Pro EX Instruction
Number of Steps
Determination
in Instruction
Instruction
Number of
Operands
Category
Notation
of Input
Symbol
Ladder
Name
Convert to RADP 3 to 7 2 Up Edge
Radian steps
DEGP 3 to 7 2 Up Edge
Convert
steps
SCLP 7 to 11 2 Up Edge
steps
Pro EX Instruction
Number of Steps
Determination
in Instruction
Instruction
Number of
Operands
Category
Notation
of Input
Symbol
Ladder
Name
I2FP 3 to 7 2 Up Edge
steps
I2RP 3 to 7 2 Up Edge
steps
F2IP 3 to 7 2 Up Edge
steps
Continued
Pro EX Instruction
Number of Steps
Determination
in Instruction
Instruction
Number of
Operands
Category
Notation
of Input
Symbol
Ladder
Name
Float→ F2R 3 to 7 2 Level
Real steps
F2RP 3 to 7 2 Up Edge
steps
R2IP 3 to 7 2 Up Edge
steps
R2FP 3 to 7 2 Up Edge
steps
H2SP 3 to 5 2 Up Edge
steps
S2HP 3 to 5 2 Up Edge
steps
Pro EX Instruction
Number of Steps
in Instruction
Instruction
Number of
Operands
Category
Notation
Symbol
Ladder
Name
CAN
Outlines the symbol variables, connection device addresses, and constants that you can set as
operands in each instruction.
Because the content that you can configure differs depending on the instruction, refer to each
instruction description.
29.3.2 Symbol
This function changes addresses in external devices into names that users can easily
understand. Make sure you map external device addresses to their respective names.
For example, To assign the name "RUN" to device address "X0000" on a Mitsubishi Electric
Corporation PLC, define "RUN" and "X0000."
29.3.3 LS Address
This is the address of an internal memory area on a GP unit. Please note that how you specify
the address varies depending on the communication settings.
Name Type Example Description
Internal Bit [#INTERNAL]LS010000 Bit Specifications for GP
Memory Internal Memory
Word [#INTERNAL]LS0100 Word Specifications for GP
Internal Memory
Memory link Bit [#MEMLINK]010000 Bit Specifications for GP
settings Internal Memory
Word [#MEMLINK]0100 Word Specifications for GP
Internal Memory
• LS area and USR area words are 16-bits, but are treated as 32-bits when
processed by the Logic. However, the top 16 bits are ignored when used in a
display and other parts.
• LS area and USR area words are 16-bits, but are treated as 32-bits when
processed by the Logic. However, the top 16 bits are ignored when used in a
display and other parts.
• Some of the system variables used in logic programs work only when the
logic program is enabled. Attention must be paid when [Disable] is selected
for the logic program or you are using #L∗∗∗∗ logic variables.
29.3.6 Variable
Variables are available for all GP models. You can use the variables without being aware of
device addresses. Variables can be used with modifiers (∗1) and as arrays (∗2). When using
modifiers, you can access individual bits or bytes in integer variables.
Structure Variable
Timer Variable
Timer Variable Variables Settings Description
VariableName.TI Bit Variable Turns ON when timer begins counting.
VariableName.Q Bit Variable Turns ON when the timer finishes counting.
VariableName.R Bit Variable Resets the current value on the timer. 0 clear.
VariableName.PT Integer Variable The value set on the timer.
VariableName.ET Integer Variable The current value on the timer.
Counter Variable
Counter Variable Variables Settings Description
VariableName.R Bit Variable Resets the current value. Clear (0).
VariableName.Q Bit Variable Turns ON when the current value reaches the
preset value.
VariableName.UP Bit Variable Turns ON while counting up.
VariableName.QU Bit Variable For Up/Down counters, turns ON when the current
value reaches the preset value.
VariableName.QD Bit Variable For Up/Down counters, turns ON when the current
value reaches 0 or less.
VariableName.PV Integer Variable Counter setting value.
VariableName.CV Integer Variable Current value on the counter.
Time Variable
Time Variable Variables Settings Description
VariableName.HR Integer Variable Hours are input in BCD.
VariableName.MIN Integer Variable Minutes are input in BCD.
VariableName.SEC Integer Variable Seconds are input in BCD.
Date Variable
Date Variable Variables Settings Description
VariableName.YR Integer Variable The year is input in BCD.
VariableName.MO Integer Variable The month is input in BCD.
VariableName.DAY Integer Variable The day is input in BCD.
PID Variable
PID Variable Variables Settings Description
VariableName.Q Bit Variable Completion Flag for PID Instruction Processing
VariableName.PF Bit Variable Processing Deadband Range Flag
VariableName.UO Bit Variable Output Values over the Upper Limit
VariableName.TO Bit Variable Output Values over the Lower Limit
VariableName.IF Bit Variable Integral Setting
VariableName.KP Integer Variable Proportional Constant
VariableName.TR Integer Variable Integral Calculus Time
VariableName.TD Integer Variable Differential Calculus Time a Time
VariableName.PA Integer Variable PID Processing Deadband Range
VariableName.BA Integer Variable Bias (Offset)
Variable name.ST Integer Variable Frequency in Sampling
The conversion of the number of steps per instruction is described. (For details on the
number of steps for each instruction, refer to the description of the relevant instruction.)
The following program uses only the output coil OUT which is always ON.
For 1 step instructions, the number of steps indicated below a rung number and the actual
number of steps may differ, as 1 step instructions are optimized upon saving and error
checking.
Operand Settings
The following describes the specifiable content of Operand (S1).
Name Type Condition Number of Possible: O
Steps in Not
Instruction Possible: X
External Bit ⎯ 2 O
Device Word Specify a bit in the word. 3 O
Address (Example:
[PLC1]D0000.00)
Internal Bit ⎯ 2 O
Address Word Specify a bit in the word. 3 O
(Example:
[#INTERNAL]LS000000)
Symbol Bit ⎯ 2 O
Word ⎯ ⎯ X
Continued
Program example
1
Start
0
1
Motor
0
A B
Point A When the bit variable Start turns ON, the NO instruction closes the contacts
and the bit variable Motor turns ON.
Point B When the bit variable Start turns OFF, the NO instruction opens the contacts
and the bit variable Motor turns OFF.
Program example
1
Start
0
1
Motor
0
A B
Point A When the bit variable Start turns ON, the NC instruction opens the contacts
and the bit variable Motor turns OFF.
Point B When the bit variable Start turns OFF, the NC instruction closes the contacts
and the bit variable Motor turns ON.
Note: To retain the state when the power is turned OFF, set the symbol variable to
Retentive. Use a keep address for the address format. (The keep setting cannot
be used for external inputs and outputs.)
Operand Settings
The following describes the specifiable content of Operand (D1).
Name Type Condition Number of Possible: O
Steps in Not
Instruction Possible: X
External Bit ⎯ 2 O
Device Word Specify a bit in the word. 3 O
Address (Example:
[PLC1]D0000.00)
Internal Bit ⎯ 2 O
Address Word Specify a bit in the word. 3 O
(Example:
[#INTERNAL]LS000000)
Symbol Bit ⎯ 2 O
Word ⎯ ⎯ X
Program example
1
Start
0
1
Motor
0
A B
Point A When the bit variable Start turns ON, the bit variable Motor of the OUT
instruction turns ON.
Point B When the bit variable Start turns OFF, the bit variable Motor of the OUT
instruction turns OFF.
Program example
1
Start
0
1
Motor
0
A B
Point A When the bit variable Start turns ON, the bit variable Motor of the OUTN
instruction turns OFF.
Point B When the bit variable Start turns OFF, the bit variable Motor of the OUTN
instruction turns ON.
Note: To retain the state when the power is turned OFF, set the symbol variable to
Retentive. Use a keep address for the address format. (The keep setting cannot
be used for external inputs and outputs.)
The example above shows how to use multiple OUT instructions by branching OUT
instructions. An error will occur if OUT_001 and OUT_002 are placed in a series.
Operand Settings
The following describes the specifiable content of Operand (D1).
Name Type Condition Number of Possible: O
Steps in Not
Instruction Possible: X
External Bit ⎯ 2 O
Device Word Specify a bit in the word. 3 O
Address (Example:
[PLC1]D0000.00)
Internal Bit ⎯ 2 O
Address Word Specify a bit in the word. 3 O
(Example:
[#INTERNAL]LS000000)
Symbol Bit ⎯ 2 O
Word ⎯ ⎯ X
Program example
1
Start
0
Motor 1
0
1
Stop
0
A B C D
Point A The bit variable (Start) turns ON, the SET instruction executes, and then, bit
variable (Motor) turns ON.
Point B The bit variable (Start) turns OFF; however, bit variable (Motor) keeps the ON state.
Point C The bit variable (Stop) turns ON, the RST instruction executes. Then, bit
variable Motor turns ON.
When the RST instruction turns the bit variable (Motor) ON, the state is
cleared and the bit variable (Motor) changes from ON to OFF.
Point D The bit variable (Motor) remains in the OFF state until the bit variable (Start)
turns ON.
Operand Settings
The following describes the specifiable content of Operand (S1).
Name Type Condition Number of Possible: O
Steps in Not
Instruction Possible: X
External Bit ⎯ 2 O
Device Word Specify a bit in the word. 3 O
Address (Example:
[PLC1]D0000.00)
Internal Bit ⎯ 2 O
Address Word Specify a bit in the word. 3 O
(Example:
[#INTERNAL]LS000000)
Symbol Bit ⎯ 2 O
Word ⎯ ⎯ X
Variable Bit Specify a bit 2 O
Format Specify bit array ([constant]) 3 O
Specify bit array ([variable]) 4 O
Continued
Program example
Motor 1
0
Positive Transition
A B C
Point A The variable (Start) turns ON, and then the variable motor turns ON.
Point B After a scan is executed one time, the variable (Motor) is turned OFF.
Point C The variable (Motor) remains OFF because the upward transition of the
variable (Start) is not detected.
Program example
1
Start
0
1
Motor
0
Negative
Transition A B C
Point A The variable (Start) turns OFF, and then variable motor turns ON.
Point B After a scan is executed once, the variable motor will be turned OFF.
Point C The variable (Motor) remains OFF because the upward transition of the
variable (Start) is not detected.
(Supplementary) For the positive transition and negative transition instruction operands, you
must pay attention when performing indirect addressing to each element,
especially when an element is specifying an array or bit using variables. The
variable in the operand of the previous execution is compared with the variable
in the operand of the current execution, and then an instruction is executed.
Therefore, if the variable value to be specified is different, the target for
comparison will differ.
Specifying Labels
Right-click and select [Insert Label], or on the [Logic] menu
click [Insert Label].
You can select a label from 192 labels ranging from LABEL-
001 to LABEL-192.
Label names cannot be arbitrarily specified.
When you execute a JMP instruction, the program will jump to the specified label. Unlike a
JSR instruction, the program does not automatically return to the rung of the jump source. It
is not possible to jump over the INIT or SUB block. Create a program that jumps to a label
within a block. Also, note that if the program jumps up the program, it may result in an
infinite loop.
A JMPP instruction executes a jump instruction only when an upward transition is detected.
The processing after a jump is the same as the JMP instruction.
Program Example
JMP
When the NO variable (Jump) is turned ON, the JMP instruction will be executed and the
program will jump to the fourth rung set with the label name: "LABEL-001".
After the jump, the program continues executing after the fourth rung. As long as the
Normally Open (NO) instruction remains ON, the program in the third rung will not execute.
Program Example
JMPP
Only the upward transition of the normally open instruction is detected, and the JMPP
instruction executes. Then, the program jumps to the fourth rung with the label name:
"LABEL-001". After the jump, the program continues executing after the fourth rung.
During subsequent scans, the JMPP instruction does not execute, even if the normally open
instruction remains ON. After one scan, the program in the third rung executes.
Specifying Subroutines
To create a subroutine screen, on the [Screen List Window] select [New Screen], or on the
[Screen] menu click [New Screen].
The destinations you can specify for a subroutine instruction are SUB-01 to SUB-32.
The subroutine name is fixed and cannot be arbitrarily named.
Program Example
JSR
When the normally open instruction is turned ON to indicate a problem, the JSR instruction
will be executed. The JSR instruction jumps to the subroutine screen "SUB-01" and executes
the program. When "SUB-01" ends, the program will return to the rung after the JSR
instruction and continue executing. In subsequent scans, if the normally open instruction is
still ON, the JSR instruction will execute. Place JSR instructions at the end of rungs.
Place a JSR instruction in the last row.
Program Example
JSRP
When the upward transition of a normally open instruction is detected the JSRP instruction
executes. The JSRP instruction jumps to the subroutine screen "SUB-01" and executes the
program. When "SUB-01" ends, the program returns to the rung after the JSRP instruction
and continues executing. In subsequent scans, if the normally open instruction remains ON,
the JSRP instruction will not execute. After the first scan, the subroutine does not run, and
the program continues executing rungs that follow. Place JSRP instructions at the end of
rungs.
After one scan, the subroutine processing is not performed, and the processing in the next
rung is performed.
Place a JSRP instruction in the last row.
Restrictions
(1) JSR and JSRP instructions are placed only at the right end of a row.
(2) A subroutine jump is possible up to 128 times.
One stack is used for one subroutine jump. A total of 128 stacks can be used for a logic
program.
Other instructions that use stacks are FOR and NEXT instructions. Each instance of FOR/
NEXT instructions use two stacks.
RET(Return)
Symbols and Features
Ladder Instruction Ladder Symbol Feature Number of
Name Steps
RET Control 1
(Return)
RET instructions return the program from a subroutine to the original JSR instruction call,
and continues executing instructions in rungs that follow.
Use RET instructions to interrupt the subroutine and return to the MAIN program.
Because the program automatically returns to the caller after the subroutine processing ends,
it is not always necessary to use an RET instruction.
Place RET instructions at the end of rungs. RET instructions can only be used in subroutines.
Program Example
RET
RET instructions can only be used in subroutines. When the subroutine call instruction is
executed in MAIN, the program flow moves to the subroutine. The subroutine processes
instructions in rungs 1 and 2. If the variable for the normally open instruction in rung 3 is
ON, the RET instruction is executed and returns the program flow to MAIN without
executing the fourth rung.
When the RET instruction is not executed, the program is executes the fourth rung, then
returns the program to MAIN after the subroutine ends (END).
Operand Settings
The following table lists the configurable conditions of Operand (S1) in the FOR instruction.
Program Example
FOR and NEXT
Other instructions cannot coexist on the same rung as FOR and NEXT instructions. You can
use a JMP instruction to specify conditions for executing FOR and NEXT instructions. The
following program example of FOR and NEXT instructions shows how you can use a
condition to run FOR and NEXT instructions.
When the variable of the normally open instruction turns ON FOR and NEXT will not
execute, and the program will jump to "LABEL-001". When the variable is OFF, the FOR
and NEXT instructions execute. The value (N) of the FOR instruction's operand S1 indicates
the number of times that the rungs between the FOR and NEXT instructions will be repeated.
When S1 = 10, the FOR loop is repeated 10 times. After exiting the FOR loop, processing
continues with instructions that follow the NEXT instruction.
Restrictions
(1) After inserting a FOR instruction, you need to also insert the corresponding NEXT
instruction.
(2) Do not insert instructions on the same rung before or after FOR to NEXT instructions.
(You cannot set any conditions on rungs with FOR or NEXT instructions.)
(3) You cannot change the number of executions between FOR and NEXT instructions.
(4) You cannot exit FOR and NEXT instructions midway.
(5) You can nest FOR and NEXT instructions up to 64 times. After exceeding 64 nests, a
major error occurs and error code 4 is written to# L_FaultCode.
(6) For each nest, two stacks are used. A total of 128 stacks can be used in the logic program.
Other than the FOR and NEXT instructions, the JSR instruction also uses stacks. The JSR
instruction uses only one stack.
INV(Invert)
Symbols and Features
Ladder Instruction Ladder Symbol Feature Number of
Name Steps
INV Control 1
(Invert)
Program example
When the operand of the normally open instruction is ON, the INV instruction will execute
and the OUT coil turns OFF.
When the operand of the normally open instruction is ON, the INV instruction will execute
and the OUT coil turns OFF.
EXIT(End of Processing)
Symbols and Features
Ladder Instruction Ladder Symbol Feature Number of
Name Steps
EXIT Control 1
(End of Processing)
Program example
When the switch is turned ON, the EXIT instruction at the end of the rung will run.
Therefore, processing of instructions between EXIT and END is not performed.
Operand Settings
The following describes the specifiable content of Operands (S1) and (D1) in the PBC
instruction.
Name Type Condition Number of Possible: O
Steps in Not
Instruction Possible: X
External Bit ⎯ ⎯ X
Device Word Specify by words only ⎯ X
Address (Example: [PLC1]D0000)
Internal Bit ⎯ ⎯ X
Address Word Specify a bit in the word. ⎯ X
(Example:
[#INTERNAL]LS000000)
Symbol Bit ⎯ ⎯ X
Word ⎯ ⎯ X
Continued
Operand Settings
The following describes the specifiable content of operands (S1) in the PBR instructions.
Explanation of the Power Bar Control (PBC) and Power Bar Reset (PBR)
Instructions
When a PBC instruction is executed, the program between PBC and PBR will be executed.
PBC and PBR instructions can be used only in MAIN. They cannot be used in other parts of
the program.
When the PBC instruction is turned ON, the bit variable in D1 will turn ON. The program
running between PBC and PBR instructions executes ON processing until the PBC
instruction turns OFF.
For every PBC instruction, one PBR instruction is always required.
PBC/PBR instruction S1 specifies nesting level. The processing of the specified level
between PBC and PBR is executed.
When the variable of the normally open instruction is ON, the PBC instruction will execute.
When the PBC instruction is executed, processing between PBC and PBR instructions is
executed.
(1) When the PBC instruction is OFF (PBC execution bit is OFF)
The ADD instruction does not execute even when the normally open instruction in the
third rung is ON.
The MOV instruction does not execute even when the normally open instruction in the
fourth rung is ON.
(3)
(2)
(1)
(1) This is nesting level 2. In the previous program, the state is low.
(2) This is nesting level 1. In the previous program, the state is medium.
(3) This is nesting level 0. In the previous program, the state is high.
LWA(Logic Wait)
Symbols and Features
Ladder Instruction Ladder Symbol Feature Number of
Name Steps
LWA Control 2
(Logic Wait)
Operand Settings
The following describes the specifiable content of operand (S1).
Name Type Condition Number of Possible: O
Steps Not
Possible: X
External Bit ⎯ ⎯ X
Device Word Specify by words only ⎯ X
Address (Example: [PLC1]D0000)
Internal Bit ⎯ ⎯ X
Address Word Specify a bit in the word. ⎯ X
(Example:
[#INTERNAL]LS000000)
Symbol Bit ⎯ ⎯ X
Word ⎯ ⎯ X
Variable Bit Specify a bit ⎯ X
Format Specify bit array ([constant]) ⎯ X
Specify bit array ([variable]) ⎯ X
Integer Arrays and modifiers are not ⎯ X
specified
Specify integer ⎯ X
variable[constant]
Specify integer variable ⎯ X
[Variable]
Specify integer ⎯ X
variable[constant/variable]
.X[constant/variable]
Continued
(Notes)
If a large number of LWA instructions are used, a WDT (watch dog time) error may occur.
Attention must be paid when using LWA instructions since WDT errors affect the scan time.
Restrictions on use
(1) If a large number of LWA instructions are used, a WDT (watch dog time) error may occur.
Attention must be paid when using LWA instructions since WDT errors affect the scan
time.
(2) Only one LWA instruction can be placed in one rung.
(3) An LWA instruction must be the last instruction on the rung, just to the left of the right
power bar.
(4) An LWA instruction can be used only in MAIN and SUB. It cannot be used in INIT.
Program example
(1) When the bit variable is turned ON, the LWA instruction will be executed.
(2) When the LWA instruction is executed, the logic program stops for the time (1 to 10 ms)
specified in operand S1.
(3) After the specified time has elapsed, processing will continue on the next rung.
Explanation of the ON Delay Timer (TON) and OFF Delay Timer (TOF)
Instructions
Timer variables used in TON and TOF instructions are structure variables. The following
table lists the internal structures.
Timer Variable
Timer Variable Variables Settings Description
VariableName.TI Bit Variable Turns ON when the timer begins.
VariableName.Q Bit Variable Turns ON upon completion of the timer.
VariableName.PT Integer Variable The value set on the timer
VariableName.ET Integer Variable The current value on the timer
Double-click the timer instruction to display the following dialog box. Enter the preset time
in this dialog box.
Enter the timer value and units.
For time-based settings, double-click the timer instruction to display the setup dialog box.
Time base Description PT value/ET value
ms Specify the time in The PT value is specified and displayed in units of ms.
units of ms. The ET value is displayed in units of ms.
Setting range = 0 to 2147483647 x 1ms
10ms Specify the time in The PT value is set and displayed in units of 10 ms.
units of 10 ms. The ET value is displayed in units of 10 ms.
Setting range = 0 to 214748364 x 10 ms
0.1s Specify the time in The PT value is specified and displayed in units of 0.1 s.
units of 0.1 s. The ET value is displayed in units of 0.1 s.
Setting range = 0 to 21474836 x 100 ms
s Specify the time in The PT value is specified and displayed in units of 1 s.
units of 1 s. The ET value is displayed in units of 1 s.
Setting range = 0 to 2147483 x seconds
Program Example
TON
(1) When the variable of the normally open instruction is turned ON, the elapsed time .ET
will increase by the specified time-based units because the TON instruction is triggered.
• The timer measurement bit .TI turns ON.
• The timer output bit .Q turns OFF.
(2) When the elapsed time .ET increases to equal the preset time .PT, the elapsed time .ET
keeps the current value.
• The timer measurement bit .TI turns OFF.
• The timer output bit .Q turns ON and allows power to pass.
(3) When start measurement is off (turned off), the elapsed time .ET will be reset to 0.
• The timer measurement bit .TI turns OFF.
• The timer output bit .Q turns OFF.
IN
TI
PT
A B C D E
Point A The timer turns ON and the timer measurement bit .TI turns ON. The timer
measurement starts and the elapsed time .ET increases. The timer output bit .Q
remains OFF.
Point B When the elapsed time .ET equals the preset time .PT, the timer output bit .Q turns
ON. The value of the elapsed time. ET remains the same as the preset time .PT. The
timer measurement bit .TI turns OFF.
Point C The timer turns OFF and the timer output bit .Q turns OFF. The elapsed time
.ET resets to 0.
Point D The timer turns ON and the timer measurement bit .TI turns ON. The timer
measurement starts and the elapsed time .ET increases.
Point E The timer turns OFF before the elapsed time .ET reaches the preset time .PT.
While the timer output bit .Q remains OFF, the elapsed time .ET resets to 0.
Program Example
TOF
(1) When the variable for NO instructions is turned ON, the elapsed time .ET will be reset to
0 because the TON instruction is triggered.
• The timer measurement bit .TI turns OFF.
• The timer output bit .Q turns ON and allows power to pass.
(2) When the TOF instruction is triggered and the measurement start bit is turned OFF, the
elapsed time .ET will increase by the specified time-based units.
• The timer measurement bit .TI turns ON.
• The timer output bit .Q remains ON.
(3) When the elapsed time .ET increases to equal the preset time .PT, the elapsed time .ET
keeps the current value.
• The timer measurement bit .TI turns OFF.
IN
TI
PT
A B C D E F
Point A The timer turns ON. The timer measurement bit .TI remains OFF. The timer
output bit .Q turns ON. The elapsed time .ET resets to 0.
Point B The timer turns OFF. The timer starts measurement (.TI turns ON.) The timer
output bit remains ON.
Point C The elapsed time .ET equals the preset time .PT. The timer output bit .Q turns
OFF. The timer stops measurement (.TI turns OFF). The elapsed time .ET
remains equal to the setup time (ET = PT).
Point D The timer turns ON. The timer measurement bit .TI remains OFF. The timer
output bit .Q remains ON. The elapsed time .ET resets to 0.
Point E The timer turns OFF. The timer starts measurement (.TI turns ON.) The timer
output bit .Q remains ON.
Point F The timer turns ON before the elapsed time .ET reaches the preset time .PT,
and the timer stops measurement (.TI turns OFF). The timer output bit .Q
remains ON and the elapsed time .ET resets to 0.
TP (Pulse Timer)
Symbols and Features
Ladder Instruction Ladder Symbol Feature Number of
Name Steps
TP Timer 2
(Positive Transition
Timer)
Timer Variable
Timer Variable Variables Settings Description
VariableName.TI Bit Variable Turns ON when the timer begins.
VariableName.Q Bit Variable Turns ON upon completion of the timer.
VariableName.PT Integer Variable The value set on the timer
VariableName.ET Integer Variable The current value on the timer
Double-click the timer instruction to display the following dialog box. Enter the preset time
in this dialog box.
Enter the timer value and units.
For time-based settings, double-click the timer instruction to display the setup dialog box.
Program example
(1) When the normally open instruction turns ON, the TP instruction is triggered. Because the
TP instruction detects positive transitions, when the instruction is triggered, it starts the
timer no matter what condition the timer was in.
The elapsed time .ET increases by the units specified as the time base.
• The timer measurement bit .TI turns ON.
• The timer output bit .Q turns ON and allows power to pass.
(2) When the elapsed time .ET reaches the preset time, the TP instruction turns OFF.
The timer output bit .Q turns off after the preset time has elapsed, regardless of the power
flow to the left of the TP instruction.
• When PT =< ET, it is immediately reset to 0.
• When the elapsed time .ET equals the preset time .PT, the timer bit .TI is turned off.
• When the TP instruction is off, the timer output bit .Q is off.
(3) When the variable of the normally open instruction turns OFF, if the elapsed time .ET has
reached the preset time .PT, the elapsed time .ET resets to 0.
• The timer output bit .Q turns OFF.
• Otherwise, the timer continues measurement and the timer output bit .Q remains ON.
IN
TI
PT PT
A B C D E F
Point A The timer turns ON. The timer starts measurement (.TI turns ON). The timer
output bit .Q turns ON.
Point B The elapsed time .ET equals the preset time .PT. The timer output bit .Q turns
OFF. The timer stops measurement (.TI turns OFF). The elapsed time .ET
remains equal to the preset time (ET = PT).
Point C The timer turns OFF. The elapsed time .ET resets to 0.
Point D The timer turns ON. The timer starts measurement (.TI turns ON). The timer
output bit .Q turns ON.
Point E The timer turns OFF. The timer continues measurement (.TI remains ON). The
timer output bit .Q remains ON.
Point F The elapsed time .ET equals the preset time .PT. The timer output bit .Q turns
OFF. The timer stops measurement (.TI turns OFF). Because the timer input
bit IN is OFF, the elapsed time .ET resets to 0.
Timer Variable
Timer Variable Variables Settings Description
VariableName.TI Bit Variable Turns ON when the timer begins.
VariableName.Q Bit Variable Turns ON upon completion of the timer.
VariableName.R Bit Variable Resets the current timer. Clear (0).
VariableName.PT Integer Variable The value set on the timer
VariableName.ET Integer Variable The current value on the timer
Double-click the timer instruction to display the following dialog box. Enter the preset time
in this dialog box.
Enter the timer value and units.
For time-based settings, double-click the timer instruction to display the setup dialog box.
Time base Description PT value/ET value
ms Specify the time in The PT value is specified and displayed in units of ms.
units of ms. The ET value is displayed in units of ms.
Setting range = 0 to 2147483647 x 1 ms
10ms Specify the time in The PT value is set and displayed in units of 10 ms.
units of 10 ms. The ET value is displayed in units of 10 ms.
Setting range = 0 to 214748364 x 10 ms
0.1s Specify the time in The PT value is specified and displayed in units of 0.1 s.
units of 0.1 s. The ET value is displayed in units of 0.1 s.
Setting range = 0 to 21474836 x 100 ms
s Specify the time in The PT value is specified and displayed in units of 1 s.
units of 1 s. The ET value is displayed in units of 1 s.
Setting range = 0 to 2147483 x seconds
Program Example
TONA
(1) When the variable of the normally open instruction is turned ON, the elapsed time .ET
will increase by the specified time-based units because the TONA instruction is triggered.
• The timer measurement bit .TI turns ON.
• The timer output bit .Q turns OFF.
(2) When the elapsed time .ET increases to equal the preset time .PT, the elapsed time .ET
keeps the current value.
• The timer measurement bit .TI turns OFF.
• The timer output bit .Q turns ON and allows power to pass.
(3) When the TONA instruction turns OFF, the elapsed time .ET keeps the current value.
• The timer measurement bit .TI turns OFF.
• The timer output bit .Q turns OFF.
(4) The TONA instruction acts like an accumulator and increases its value. Set the R coil ON
to reset the current value.
Timing Chart for the TONA Instruction
IN
TI
PT A PT B Q PT A
A B C D E F G
Points A, F The timer input bit IN turns ON and the timer measurement bit TI turns ON.
The timer starts and the elapsed time ET increases. The timer output bit Q
remains OFF.
Points B, G The timer input bit IN turns OFF, and if the elapsed time ET is less than the
preset time PT, the timer output bit Q remains OFF. The elapsed time ET is in
the keep state.
Point C The timer input bit IN turns ON and the timer measurement bit TI turns ON.
The timer measurement starts again and the elapsed time ET is added to the
kept value. The timer output bit Q remains OFF.
Point D When the elapsed time ET reaches the preset time PT, the timer measurement
bit TI turns OFF.
The timer output bit Q turns ON.
Point E The timer input bit IN turns OFF and the timer output bit Q turns OFF. Reset
the elapsed time ET to zero using the reset bit (R).
(1) When the timer turns OFF, because the TOFA instruction is triggered, the elapsed time
.ET increases in the specified time-based units.
• The timer measurement bit .TI turns ON.
• The timer output bit .Q turns OFF.
(2) When the elapsed time .ET increases to equal the preset time .PT, the elapsed time .ET
keeps the current value.
• The timer measurement bit .TI turns OFF.
• The timer output bit .Q turns ON and allows power to pass.
(3) When the TONA instruction turns OFF, the elapsed time .ET keeps the current value.
• The timer measurement bit .TI turns OFF.
• The timer output bit .Q turns OFF.
IN
TI
PT PT PT
A B C D E F G H I J K L M
(1) If any numeric value out of the setting range is input, an error will occur and the “6706”
error code will be set for #L_CalcErrCode. For checking error details, refer to the
#L_CalcErrCode. If any value out of the setting range is input, the instruction is not
executed.
Counter Variable
Counter Variable Variables Settings Description
Variable name.R Bit Variable Resets the current value. Clear (0).
Variable name.Q Bit Variable Turns ON when the current value reaches the
preset value.
Variable name.UP Bit Variable Counts up when the variable is ON.
Variable name.QU Bit Variable For Up/Down counters, turns ON when the
current value reaches the preset value.
Variable name.QD Bit Variable For Up/Down counters, turns ON when the
current value reaches 0 or less.
Variable name.PV Integer Variable Preset value
Variable name.CV Integer Variable Current value
When CTU and CTUP instructions are executed, if the counter reset bit variable .R is OFF,
regardless of the preset value .PV, the current value .CV will increase by 1. When the current
value .CV equals the preset value .PV, the counter output bit variable .Q turns ON. When the
counter reset bit variable .R is ON, the current value .CV is reset to 0 and the counter output
bit variable .Q also turns OFF.
Program Example
CTU
In the following example, if five operation errors are counted within 1 minute, an error will
be displayed.
In the program example, the timer instruction is not shown. Only the one-minute timer start
trigger for timer start is shown.
To count operation errors, create a separate error input trigger.
(1) When the normally open instruction of the one-minute timer turns ON, the OUT
instruction assigned to counter .R (reset) turns ON.
When the operation error counter .R (reset) turns ON, the operation error counter .CV of
the CTU instruction is cleared to zero.
(2) When the positive transition normally open instruction in rung 3 turns ON, the operation
error counter .CV value (current value) increases by 1.
(3) When the operation error counter .CV value (current value) equals the .PV value (preset
value), the operation error counter .Q of the CTU instruction turns ON , and the OUT
instruction in rung 4 outputs the error detection message.
Program Example
CTUP
The difference between CTU and CTUP instructions is whether the .CV value increases as a
level counter, or as a positive transition counter.
The difference in program creation is that the positive transition normally open instruction
located on rung 3 to detect operation errors is a normally open instruction.
There is no difference in operation other than how the input is determined.
Counter Variable
Counter Variable Variables Settings Description
Variable name.R Bit Variable Resets the current value. Clear (0).
Variable name.Q Bit Variable Turns ON when the current value reaches the
preset value.
Variable name.UP Bit Variable Counts up when the variable is ON.
Variable name.QU Bit Variable For Up/Down counters, turns ON when the
current value reaches the preset value.
Variable name.QD Bit Variable For Up/Down counters, turns ON when the
current value reaches 0 or less.
Variable name.PV Integer Variable Preset value
Variable name.CV Integer Variable Current value
When the CDT and CDTP instructions are ON, if the counter reset bit variable .R is OFF, the
current value .CV will decrease by 1.
When the current value .CV is less than 0, the counter output bit .Q turns ON. When the
counter reset bit variable .R turns ON, the preset value .PV is copied to the current value
variable .CV. And, the counter output variable .Q turns OFF.
• When the preset value of the down counter is set to zero or less, output
continues to remain on. Be sure to set the preset value to 1 or more.
Program Example
CDT
In the following example, if five operation errors are counted within 1 minute, an error will
be displayed.
In the program example, the timer instruction is not shown. Only the one-minute timer start
trigger for timer start is shown.
To count operation errors, create a separate error input trigger.
(1) When the normally open instruction of the one-minute timer turns ON, the OUT
instruction assigned to counter .R (reset) turns ON.
When the operation error counter .R (reset) turns ON, the CDT instruction's preset value
.PV is copied to the current value .CV. In the program example, 5 is copied to the current
value .CV.
(2) When the positive transition normally open instruction turns ON, the operation error
counter .CV value (current value) decreases by 1.
(3) When the value of the operation error counter .CV value (current value) is 0 or less, the
operation error counter .Q of the CDT instruction turns ON, and the OUT instruction in
rung 4 outputs the error detection message.
Program Example
CTDP
The difference between CTD and CTDP instructions is one counts down when it detects a
level change and the other counts down when it detects a positive transition.
The difference in program creation is that the positive transition normally open instruction
located on rung 3 to detect operation errors is a normally open instruction.
There is no difference in operation other than how the input is determined.
Counter Variable
Counter Variable Variables Settings Description
Variable name.R Bit Variable Resets the current value. Clear (0).
Variable name.Q Bit Variable Turns ON when the current value reaches the
preset value.
Variable name.UP Bit Variable Counts up when the variable is ON.
Variable name.QU Bit Variable For Up/Down counters, turns ON when the
current value reaches the preset value.
Variable name.QD Bit Variable For Up/Down counters, turns ON when the
current value reaches 0 or less.
Variable name.PV Integer Variable Preset value
Variable name.CV Integer Variable Current value
When the .UP bit of CTUD and CTUDP instructions is ON, they operate the same as CTU
instructions. When the .UP bit is OFF, CTUD and CTUDP instructions operate the same as
CTD instructions.
When .UP is ON (counts up) and if .CV (current value) is larger than .PV (preset value), .Q
turns ON when the current value reaches the preset value and .QU turns ON.
When .UP is OFF (counts down) is OFF and .CV (current value) is 0 or less, then .Q turns
ON when the current value reaches the preset value and .QD turns ON.
Program Example
CTUD
In the following example, if five operation errors are counted within 1 minute, an error will
be displayed.
In the program example, the timer instruction is not shown. Only the one-minute timer start
trigger for timer start is shown.
To count operation errors, create a separate error input trigger.
(1) When the normally open instruction of the one-minute timer turns ON, the OUT
instruction assigned to counter .R (reset) turns ON.
When the operation error counter .R (reset) turns ON, if .UP is ON, the CTU instruction is
executed, and .CV (current value) is cleared to zero. If .UP is OFF, the CTD instruction is
executed, and .PV (preset value) is copied to .CV (current value).
(2) When the positive transition normally open instruction in rung 3 turns ON, and if .UP is
ON, the .CV value increases by 1. If .UP is OFF, the .CV value (current value) decreases
by 1.
(3) When .UP is ON, and the .PV value (preset value) and the .CV value become equal, .Q
and .QU turn ON. When .UP is OFF, and the .CV value (current value) is less than 0, Q
and .QD turn ON.
(4) The operation error counter .Q of the CTUD instruction (turns ON when the current value
reaches the preset value) turns ON and the OUT instruction outputs the error detection
message.
Program Example
CTUDP
The difference between CTUD and CTUDP instructions is whether the .CV value increases
or decreases as a level counter, or as a positive transition counter. The difference in program
creation is that a positive transition normally open instruction located on rung 3 to detect
operation errors is a normally open instruction. There is no difference in operation other than
how the input is determined.
Time Variable
Time Variable Variables Settings Description
VariableName.HR Integer Variable Hours are input in BCD.
VariableName.MIN Integer Variable Minutes are input in BCD.
VariableName.SEC Integer Variable Seconds are input in BCD.
When JRD and JRDP instructions receive power, the current time will be stored in the
variable in D1. The stored time variable can be extracted into hours, minutes and seconds by
specifying the structure element. When the time 12:10:45 is stored in the time variable D1,
the .HR time is 12, the .MIN time is 10, and the .SEC time is 45.
Program Example
JRD
Stores the current time in the time variable.
(1) When the positive transition instruction turns ON, a JRD instruction will execute. When
the JRD instruction is executed, the current time is stored in D1.
Program Example
JRDP
(1) When the normally open instruction turns ON, the JRDP instruction will execute. When
the JRDP instruction is executed, the current time is stored in D1.
Time Variable
Time Variable Variables Settings Description
VariableName.HR Integer Variable Hours are input in BCD.
VariableName.MIN Integer Variable Minutes are input in BCD.
VariableName.SEC Integer Variable Seconds are input in BCD.
When JSET and JSETP instructions receive power, the specified time will be stored in the
time variable. To set the time, use JSET and JSETP instructions. The time variable in D1 can
be extracted into hours, minutes, and seconds by specifying structure elements.
When the current time 12:10:45 is stored in D1, the values 12, 10, and 45 are stored in .HR,
.MIN and .SEC, respectively.
In the above dialog box, specify the desired time in hours, minutes and seconds.
Setting Range
Hour 0 - 23
Minute 0 - 59
Second 0 - 59
Confirming Execution Results
(1) If you input a value outside the defined range, an error occurs and the error code (6706) is
written to #L_CalcErrCode. When troubleshooting, always check the error code in
#L_CalcErrCode.
(2) #L_CalcZero turns on when the value of D1 is 00:00:00.
Program Example
JSET
Stores the defined time in the time variable.
(1) When the positive transition instruction turns ON, the JSET instruction will execute.
When the JSET instruction executes, the defined time 17:30:01 is stored in the time
variable in D1.
Program Example
JSETP
(1) When the normally open instruction turns ON, the JSETP instruction will execute. When
the JSETP instruction executed, the defined time 17:30:00 is stored in the time variable in
D1.
Date Variable
Date Variable Variables Settings Description
VariableName.YR Integer Variable The year is input in BCD.
VariableName.MO Integer Variable The month is input in BCD.
Variable name DAY Integer Variable The day is input in BCD.
When NRD and NRDP instructions receive power, the current time is stored in D1. You can
extract the year/month/date of the date variable by specifying a particular date element.
When the current date 2005/10/20 is stored in D1, 05, 10, and 20 are stored in .YR, .MO, and
.DAY, respectively.
Program Example
NRD
Stores the current date in the date variable.
(1) When the positive transition instruction turns ON, the NRD instruction is executed. When
the NRD instruction is executed, the current date is stored in the date variable in D1.
Program Example
NRDP
(1) When the normally open instruction turns ON, the NRDP instruction will be executed.
When the NRDP instruction is executed, the current date is stored in the date variable in
D1.
Date Variable
Date Variable Variables Settings Description
VariableName.YR Integer Variable The year is input in BCD.
VariableName.MO Integer Variable The month is input in BCD.
VariableName.DAY Integer Variable The day is input in BCD.
When the NSET and NSETP instructions receive power, the specified date will be stored in
the date variable. To set the date, use NSET and NSETP instructions. The date variable in D1
can be extracted into hours, minutes, and seconds by specifying structure elements.
When the date 2005/10/20 specified in the JSET instruction is stored in D1, 05, 10, and 20
are stored in .YR, .MO, and .DAY, respectively.
In the above dialog box, enter the desired date in years, months and days.
Setting Range
Year 0 - 99
Month 1 - 12
Day 1 - 31 (The range depends on the month. Leap
years can be specified. Example: February 2008 has 29 days.)
Confirming Execution Results
(1) If any numeric value out of the setting range is input, an error will occur and the “6706”
error code is set for #L_CalcErrCode. For checking error details, refer to the
#L_CalcErrCode.
Program Example
NSET
Stores the setup date in the date variable.
(1) When the positive transition instruction turns ON, the NSET instruction will be executed.
When the NSET instruction is executed, the date 10 (month) 20 (day), 2005 specified in
the dialog box is stored in the date variable in D1.
Program Example
NSETP
(1) When the normally open instruction turns ON, the NSETP instruction will be executed.
When the NSETP instruction is executed, the date 10 (month) 20 (day), 2005 specified in
the dialog box is stored in the date variable in D1.
Operand Settings
The following describes the specifiable content of operands (S1, S2, and D1) for the ADD
and ADDP instructions.
The actual number of steps in the ADD and ADDP instructions depends on how operand
values are specified. The following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand S2 + Number of steps in
operand D1 +1 = Total number of steps in one instruction
For example, Converting the number of steps in ADD and ADDP instructions
(For the number of steps in an operand, refer to the operand settings on the next page.)
Operand Settings
The following describes the specifiable content of Operands (S1) and (S2) in the ADD and
ADDP instructions.
Operand Settings
The following describes the specifiable content of Operand (D1) in the ADD and ADDP
instructions.
When operand D1 is an integer variable and you want to input hexadecimal values in
operands S1 and S2.
When 0x (zero and lower case "x") is input, the following values will be interpreted as
hexadecimal values.
When adding the specified array data (integer variable array), specify the array using data [0]
or data [N] (N indicates an integer variable).
When all operands S1, S2, and D1 specify the entire array, an error will occur even if the
specified variables are the same type.
Data_1 Array size = 5
Data_2 Array size = 5
Result Array size = 5
The operand specification in the left diagram
results in an error.
(Notes)
When checking the result using system variables, make sure the check takes place after the
instruction has been executed.
When checking the state after multiple instructions have been executed, system variables will
store the result only of the last processed instruction.
Program Example
ADD
Adds one constant to another and stores the result in the integer variable.
(1) When the positive transition instruction in the operation turns ON, the ADD instruction
will be executed. When the ADD instruction is executed, the result value of 40, obtained
from 25 +15 = 40, is stored in D1.
When the operation is a normally open instruction, as long as the variable is ON, the ADD
instruction is always executed.
Program Example
ADDP
(1) When the normally open instruction turns ON, the ADDP instruction will be executed.
When the ADDP instruction is executed, the result value of 40, obtained from 25 +15 =
40, is stored in D1.
Even when the operation is a normally open instruction, only when the upward transition
is detected, will the ADDP instruction execute.
Therefore, even when the variable of the normally open instruction is always ON, the
ADDP instruction is executed only for one scan.
Operand Settings
The following describes the specifiable content of the (S1, S2, and D1) operands for the SUB
and SUBP instructions.
The actual number of steps in the SUB and SUBP instructions depends on the specified
operand. The following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand S2 + Number of steps in
operand D1 + 1 = Total number of steps in one instruction
For example, Converting the number of steps in SUB and SUBP instructions
(For the number of steps in an operand, refer to the operand settings on the next page.)
Operand Settings
The following describes the specifiable content of Operands (S1) and (S2) in the SUB and
SUBP instructions
.
Name Type Condition Number of Possible: O
Steps in the Not
Operand Possible: X
External Bit ⎯ ⎯ X
Device Word Specify by words only 1 O
Address (Example: [PLC1]D0000)
Internal Bit ⎯ ⎯ X
Address Word Specify by words only 1 O
(Example:
[#INTERNAL]LS0000)
Symbol Bit ⎯ ⎯ X
Word ⎯ 1 O
Continued
Operand Settings
The following describes the specifiable content of Operand (D1) in the SUB and SUBP
instructions.
When operand D1 is an integer variable and you want to input hexadecimal values in
operands S1 and S2.
When 0x (zero and lower case "x") is input, the following values will be interpreted as
hexadecimal values.
When subtracting specified array data (integer variable array) Specify the array using data
[0] or data [N] (N indicates an integer variable).
When all operands S1, S2, and D1 specify the entire array, an error will occur even if the
specified variables are the same type.
(Notes)
When checking the result using system variables, make sure the check takes place after the
instruction has been executed.
When checking the state after multiple instructions have been executed, system variables will
store the result only of the last processed instruction.
Program Example
SUB
Subtracts one constant from another and stores the result in the integer variable.
(1) When the positive transition instruction turns ON, the SUB instruction will be executed.
When the SUB instruction is executed, the result value of 10, obtained from 25 - 15 = 10,
is stored in D1.
When using a normally open instruction, as long as the variable is ON, the SUB
instruction is always executed.
Program Example
SUBP
(1) When the normally open instruction turns ON, the SUBP instruction will be executed.
When the SUBP instruction is executed, the result value of 10, obtained from 25 - 15 =
10, is stored in D1.
Even when using a normally open instruction, only the upward transition is detected, and
the SUBP instruction is executed.
Therefore, even when the normally open instruction is always ON, the SUBP instruction
is executed only for one scan.
Operand Settings
The following describes the specifiable content of the (S1, S2, and D1) operands for the
MUL and MULP instructions.
The actual number of steps in the MUL and MULP instructions depends on the specified
operands. The following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand S2 + Number of steps in
operand D1 + 1 = Total number of steps in one instruction
For example, Converting the number of steps in MUL and MULP instructions
(For the number of steps in an operand, refer to the operand settings on the next page.)
Operand Settings
The following describes the specifiable content of Operands (S1) and (S2) in the MUL and
MULP instructions.
Operand Settings
The following describes the specifiable content of Operand (D1) in the MUL and MULP
instructions.
When operand D1 is an integer variable and you want to input hexadecimal values in
operands S1 and S2.
When 0x (zero and lower case "x") is input, the following values will be interpreted as
hexadecimal values.
When multiplying the specified array data (integer variable array) Specify the array using data
[0] or data [N] (N indicates an integer variable).
When all operands S1, S2, and D1 specify the entire array, an error will occur even if the
specified variables are the same type.
(Notes)
When checking the result using system variables, make sure the check takes place after the
instruction has been executed.
When checking the state after multiple instructions have been executed, system variables will
store the result only of the last processed instruction.
Program Example
MUL
Multiplies one constant by another and stores the result in the integer variable.
(1) When the positive transition instruction turns ON, the MUL instruction will be executed.
When the MUL instruction is executed, the result value 375, obtained from 25 × 15 = 375,
is stored in D1.
When using a normally open instruction, as long as the instruction variable is ON, the
MUL instruction is always executed.
Program Example
MULP
(1) When the normally open instruction turns ON, the MULP instruction will be executed.
When the MULP instruction is executed, the result value of 10, obtained from 25 × 15 =
375, is stored in D1.
Even when using a normally open instruction, the MULP instruction executes only when
it detects the upward transition. Therefore, even when the variable of the NO instruction
is always ON, the MULP instruction is executed only for one scan.
Operand Settings
The following describes the specifiable content of the (S1, S2, and D1) operands for DIV and
DIVP instructions.
The actual number of steps in the DIV and DIVP instructions depends on the specified
operands. The following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand S2 + Number of steps in
operand D1 +1 = Total number of steps in one instruction
Operand Settings
The following describes the specifiable content of Operands (S1) and (S2) in the DIV and
DIVP instructions.
Operand Settings
The following describes the specifiable content of Operand (D1) in the DIV and DIVP
instructions.
When operand D1 is an integer variable and you want to input hexadecimal values in
operands S1 and S2.
When 0x (zero and lower case "x") is input, the following values will be interpreted as
hexadecimal values.
Operand S1 Integer constant 0xA
Operand S2 Integer constant 0x3
Operand D1 Integer variable OUT2
The operation result is rounded off to the nearest
integer.
Example: 0xA (S1) / 0x3 (S2) = 3 (D1)
When dividing specified array data (integer variable array) Specify the array using data [0] or
data [N] (N indicates an integer variable).
When all operands S1, S2, and D1 specify the entire array, an error will occur even if the
specified variables are the same type.
(Notes)
When checking the result using system variables, make sure the check takes place after the
instruction has been executed.
When checking the state after multiple instructions have been executed, system variables will
store the result only of the last processed instruction.
Program Example
DIV
Divides one constant by another and stores the result in the float variable.
(1) When the positive transition instruction turns ON, the DIV instruction will be executed.
When the DIV instruction is executed, the result value of 1.66666..., obtained from 25/15
= 1.66666..., is stored in the result data (float variable) in D1. When the value cannot be
divided, it is rounded off to the nearest digit.
When using a normally open instruction, as long as the variable for the instruction is ON,
the DIV instruction is always executed.
Program Example
DIVP
(1) When the normally open instruction turns ON, the DIVP instruction will be executed.
When the DIVP instruction is executed, the result value of 1.66666..., obtained from 25 /
15 = 1.66666..., is stored in the result data (float variable) in D1. When the value cannot
be divided, it is rounded off to the nearest digit.
Even when using a normally open instruction, only the upward transition is detected, and
the DIVP instruction is executed.
Therefore, even when the instruction is always ON, the DIVP instruction is executed only
for one scan.
Operand Settings
The following describes the specifiable content of operands (S1, S2, and D1) for the MOD
and MODP instructions.
The actual number of steps in the MOD and MODP instructions depends on the specified
operands. The following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand S2 + Number of steps in
operand D1 +1 = Total number of steps in one instruction
Operand Settings
The following describes the specifiable content of Operands (S1) and (S2) in the MOD and
MODP instructions.
Operand Settings
The following describes the specifiable content of Operand (D1) in the MOD and MODP
instructions.
When operand D1 is an integer variable and you want to input hexadecimal values in
operands S1 and S2.
When 0x (zero and lower case "x") is input, the following values will be interpreted as
hexadecimal values.
Operand S1 Integer constant 0xFF
Operand S2 Integer constant 0xFE
Operand D1 Integer variable OUT2
Example: 10 (S1) / 3 (S2) = 3 Remainder 1
Therefore, D1 = 1
When performing a module operation for specified array data (integer variable array) Specify
an array using data [0] or data [N] (N indicates an integer variable).
When all operands S1, S2, and D1 specify the entire array, an error will occur even if the
specified variables are the same type.
(Notes)
When checking the result using system variables, make sure the check takes place after the
instruction has been executed.
When checking the state after multiple instructions have been executed, system variables will
store the result only of the last processed instruction.
Program Example
MOD
Performs modules operation on two constants and stores the result in the integer variable.
(1) When the positive transition instruction turns ON, the MOD instruction will be executed.
When the MOD instruction is executed, the result value of 10, obtained from 25/15 = 1
(remainder 10), is stored in D1. When using a normally open instruction, as long as the
operation is ON, the MOD instruction is always executed.
Program Example
MODP
(1) When the normally open instruction start turns ON, the MODP instruction will be
executed. When the MODP instruction is executed, the result value of 10, obtained from
25 / 15 = 1 (remainder 10), is stored in D1.
Even when using a normally open instruction, the MODP instruction executes only when
it detects the upward transition. Therefore, even when the NO instruction is always ON,
the MODP instruction is executed only for one scan.
Operand Settings
The following describes the specifiable content of Operand (D1) in the INC and INCP
instructions.
Name Type Condition Instruction Possible: O
Step Count Not
Possible: X
External Bit ⎯ ⎯ X
Device Word Specify by words only 2 O
Address (Example: [PLC1]D0000)
Internal Bit ⎯ ⎯ X
Address Word Specify by words only 2 O
(Example:
[#INTERNAL]LS0000)
Symbol Bit ⎯ ⎯ X
Word ⎯ 2 O
Continued
(Notes)
When checking the result using system variables, make sure the check takes place after the
instruction has been executed.
When checking the state after multiple instructions have been executed, system variables will
store the result only of the last processed instruction.
Program Example
INC
Every time the INC instruction turns on, 1 is added.
(1) When the positive transition instruction turns on, it passes power and the INC instruction
adds 1 to the result data D1 (integer variable). When using a normally open instruction, as
long as the instruction is passing power, the INC instruction continually executes adding 1
at each scan.
Program Example
INCP
(1) When the normally open instruction turns ON, the INCP instruction will be executed.
When the INCP instruction is executed, 1 is added to the result data (integer variable) in
D1.
Even when using a normally open instruction, the INCP instruction executes only when it
detects the upward transition.Therefore, even when the instruction is always ON, the
INCP instruction is executed only for one scan and 1 is added to the result data (integer
variable).
Operand Settings
The following describes the specifiable content of Operand (D1) in the DEC and DECP
instructions.
Specify integer 3
O
variable[constant]
Specify integer variable 4
O
[Variable]
Specify integer ⎯
variable[constant/variable] X
.B/W[constant/variable]
Float ⎯ ⎯ X
Specify float variable[constant] ⎯ X
Specify float variable[variable] ⎯ X
Real ⎯ ⎯ X
Specify real variable [constant] ⎯ X
Specify real variable [variable] ⎯ X
Timer .PT/.ET only 3 O
Counter .PV/ .CV only 3 O
Date .YR/ .MO/ .DAY only 3 O
Time .HR/ .MIN/ .SEC only 3 O
PID .KP / .TR / .TD / .PA / .BA / .ST 3
only O
Continued
(Notes)
When checking the result using system variables, make sure the check takes place after the
instruction has been executed.
When checking the state after multiple instructions have been executed, system variables will
store the result only of the last processed instruction.
Program Example
DEC
Every time the DEC instruction turns on, 1 is subtracted.
(1) When the positive transition instruction turns on and passes power to the DEC instruction,
the DEC instruction subtracts 1 from the result data D1 (integer variable). When using a
normally open instruction, as long as the instruction is passing power, the DEC instruction
is continually run and subtracts 1 from D1.
Program Example
DECP
(1) When the normally open instruction turns ON, the DECP instruction will be executed.
When the DECP instruction is executed, 1 is subtracted from D1(integer variable).
Even when using a normally open instruction, the DECP instruction executes only when it
detects an upward transition. Therefore, even when the operation is continuously ON, the
INCP instruction executes for only one scan and 1 is subtracted from D1(integer
variable).
Operand Settings
The following describes the specifiable content of Operands (S1, S2, and D1) in the JADD
and JADDP instructions.
Time Variable
Time Variable Variables Settings Description
VariableName.HR Integer Variable Hours are input in BCD
VariableName.MIN Integer Variable Minutes are input in BCD
VariableName.SEC Integer Variable Seconds are input in BCD
In the JADD instruction, you cannot run time add operations on individual time variable
elements (.HR .MIN .SEC).
The time variables and each element thereof are saved as BCD data.
(Notes)
When checking the result using system variables, make sure the check takes place after the
instruction has been executed.
When checking the state after multiple instructions have been executed, system variables will
store the result only of the last processed instruction.
Program Example
JADD
When the positive transition instruction is turned ON, time addition will be performed.
(1) When the positive transition instruction turns on and passes power to the JADD
instruction, the JADD instruction adds S1 (Data_1, Time variable) and S2 (Data_2, Time
variable) and stores the result in D1 (Time variable). When using a normally open
instruction, as long as the instruction is passing power, the JADD instruction continually
executes at each scan, performing the time add operation.
Program Example
JADDP
(1) When the Normally Open instruction turns ON, the JADDP instruction will be executed.
When the JADDP instruction is executed, Data_1 (time variable) in operand S1 is added
to Data_2 (time variable) in operand S2, and the result of the addition is stored in operand
D1. Even when using a Normally Open instruction, only the upward transition is detected,
and the JADDP instruction is executed. Therefore, even when the variable of the NO
instruction is always ON, the JADDP instruction is executed only for one scan.
Operand Settings
The following describes the specifiable content of Operands (S1, S2, and D1) in the JSUB
and JSUBP instructions.
Name Type Condition Number of Possible: O
Steps in the Not
Operand Possible: X
External Bit ⎯ ⎯ X
Device Word Specify by words only ⎯
Address X
(Example: [PLC1]D0000)
Internal Bit ⎯ ⎯ X
Address Word Specify by words only ⎯
(Example: X
[#INTERNAL]LS0000)
Symbol Bit ⎯ ⎯ X
Word ⎯ ⎯ X
Continued
Time Variable
Time Variable Variables Settings Description
VariableName.HR Integer Variable Hours are input in BCD.
VariableName.MIN Integer Variable Minutes are input in BCD.
VariableName.SEC Integer Variable Seconds are input in BCD.
In the JSUB instruction, you cannot run time subtract operations on individual time variable
elements (.HR .MIN .SEC).
The time variables and each element thereof are saved as BCD data.
(Notes)
When checking the result using system variables, make sure the check takes place after the
instruction has been executed.
When checking the state after multiple instructions have been executed, system variables will
store the result only of the last processed instruction.
Program Example
JSUB
When the positive transition instruction is turned ON, time subtraction will be performed.
(1) When the positive transition instruction turns on and passes power to the JSUB
instruction, the JSUB instruction subtracts S2 (Data_2, Time variable) from S1 (Data_1,
Time variable), and stores the result in D1 (Time variable). When using a normally open
instruction, on every scan the JSUB instruction receives power, it runs the date/time
calculation.
Program Example
JSUBP
(1) When the Normally Open instruction turns ON, the JSUBP instruction will be executed.
When the JSUBP instruction is executed, Data_2 (time variable) in operand S2 is
subtracted from Data_1 (time variable) in operand S1, and the result of the subtraction is
stored in operand D1. Even when using a Normally Open instruction, only the upward
transition is detected, and the JSUBP instruction is executed. Therefore, even when the
variable of the NO instruction is always ON, the JSUBP instruction is executed only for
one scan.
Operand Settings
The following describes the specifiable content of Operands (S1, S2, and D1) in the AND
and ANDP instructions.
The actual number of steps in the AND and ANDP instructions depends on the specification
method of the operand. The following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in the S2 operand + Number of steps in
operand D1 + 1 = Total number of steps in one instruction
Operand Settings
The following describes the specifiable content of Operands (S1 and S2) in the AND and
ANDP instructions.
Name Type Condition Number of Possible: O
Steps in the Not
Operand Possible: X
External Bit ⎯ ⎯ X
Device Word Specify by words only 1
Address O
(Example: [PLC1]D0000)
Internal Bit ⎯ ⎯ X
Address Word Specify by words only 1
(Example: O
[#INTERNAL]LS0000)
Symbol Bit ⎯ ⎯ X
Word ⎯ 1 O
Variable Bit Specify a bit ⎯ X
Format Specify bit array ([constant]) ⎯ X
Specify bit array ([variable]) ⎯ X
Integer Arrays and modifiers are not 1
(including I/O) specified O
Specify integer 2
variable[constant] or
Specify integer variable B/
W[constant] O
Specify integer array(entire
array)
Specify integer 3
variable[variable] or
O
Specify integer variable B/
W[variable]
Specify integer 4
variable[constant/variable] O
.B/W[constant/variable]
Continued
Operand Settings
The following describes the specifiable content of Operand (D1) in the AND and ANDP
instructions.
When an AND instruction is executed, the D1 bit will be turned ON only when S1 and S2 are
ON. Otherwise, the D1 bit is OFF.
When operand D1 is an integer variable and you want to input hexadecimal values in
operands S1 and S2.
When 0x (zero and lower case x) is input, the following values will be interpreted as
hexadecimal values.
Operand S1 Integer constant 0xA
Operand S2 Integer constant 0x3
Operand D1 Integer variable OUT2
(Notes)
When checking the result using system variables, make sure the check takes place after the
instruction has been executed.
When checking the state after multiple instructions have been executed, system variables will
store the result only of the last processed instruction.
Program Example
AND
(1) When the positive transition instruction turns on and passes power to the AND
instruction, it does a logical AND between Data_A and F0FF and stores the result in D1
(integer variable). When using a normally open instruction, as long as the instruction is
passing power, the AND instruction continually executes at each scan, performing the
logical AND operation.
Program Example
ANDP
(1) When the normally open instruction turns ON and passes power to the ANDP instruction,
it does a logical AND between Data_A and F0FF and stores the result in D1 (integer
variable). Even when using a normally open instruction, the ANDP instruction executes
only when it detects the upward transition. As a result, even if the instruction is always on,
ANDP executes only at the first scan.
Operand Settings
The following describes the specifiable content of Operands (S1, S2, and D1) in the OR and
ORP instructions.
The actual number of steps in the OR and ORP instructions depends on the specification
method of the operand. The following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand S2 + Number of steps in
operand D1 + 1 = Total number of steps in one instruction
One final step is required in the total number of steps in the instruction. Be sure to add 1 step.
Operand Settings
The following describes the specifiable content of Operands (S1 and S2) in the OR and ORP
instructions.
Operand Settings
The following describes the specifiable content of Operand (D1) in the OR and ORP
instructions.
S1 Operator S2 D1
OFF OR OFF OFF
ON OFF ON
OFF ON ON
ON ON ON
When an OR instruction is executed, the D1 bit will be turned ON only when S1 and S2 are
ON. Otherwise, the D1 bit is OFF.
When operand D1 is an integer variable and you want to input hexadecimal values in
operands S1 and S2.
When 0x (zero and lower case x) is input, the following values will be interpreted as
hexadecimal values.
Operand S1 Integer constant 0xA
Operand S2 Integer constant 0x3
Operand D1 Integer variable OUT2
(Notes)
When checking the result using system variables, make sure the check takes place after the
instruction has been executed.
When checking the state after multiple instructions have been executed, system variables will
store the result only of the last processed instruction.
Program Example
OR
(1) When the positive transition instruction start turns ON, the OR instruction will be
executed. When the OR instruction is executed, the result value obtained by ORing
Data_A with FOFF is stored in D1.
When using a normally open instruction, as long as the instruction variable is ON, an OR
instruction is always executed.
Program Example
ORP
(1) When the normally open instruction turns ON, the ORP instruction will be executed.
When the ORP instruction is executed, the result value obtained after Data_A is ORed
with FOFF is stored in D1.
Even when using a normally open instruction, the ORP instruction executes only when it
detects the upward transition.Therefore, even when the variable of the NO instruction is
always ON, the ORP instruction is executed only for one scan.
Operand Settings
The following describes the specifiable content of Operands (S1, S2, and D1) in the XOR
and XORP instructions.
The actual number of steps in the XOR and XORP instructions depends on the specification
method of the operand. The following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand S2 + Number of steps in
operand D1 + 1 = Total number of steps in one instruction
Example: Converting the number of steps in the XOR and XORP instructions
(For the number of steps in an operand, refer to operand settings on the next page.)
One final step is required in the total number of steps in the instruction. Be sure to add 1 step.
Operand Settings
The following describes the specifiable content of Operands (S1 and S2) in the XOR and
XORP instructions
.
Name Type Condition Number of Possible: O
Steps in the Not
Operand Possible: X
External Bit ⎯ ⎯ X
Device Word Only a word is specified. 1 O
Address (Example: [PLC1]D0000)
Internal Bit ⎯ ⎯ X
Address Word Only a word is specified. 1 O
(Example:
[#INTERNAL]LS0000)
Symbol Bit ⎯ ⎯ X
Word ⎯ 1 O
Variable Bit Specify a bit ⎯ X
Format Specify bit array ([constant]) ⎯ X
Specify bit array ([variable]) ⎯ X
Integer Arrays and modifiers are not 1 O
(including I/O) specified
Specify integer 2 O
variable[constant] or
Specify integer variable B/
W[constant]
Specify integer array(entire
array)
Specify integer 3 O
variable[variable] or
Specify integer variable B/
W[variable]
Specify integer 4 O
variable[constant/variable]
.B/W[constant/variable]
Continued
Operand Settings
The following describes the specifiable content of Operand (D1) in the XOR and XORP
instructions.
S1 Operator S2 D1
OFF XOR OFF OFF
ON OFF ON
OFF ON ON
ON ON OFF
When an XOR instruction is executed, the D1 bit will be turned ON only when either S1 or
S2 is ON. Otherwise, the D1 bit is OFF.
When operand D1 is an integer variable and you want to input hexadecimal values in
operands S1 and S2.
When 0x (zero and lower case x) is input, the following values will be interpreted as
hexadecimal values.
(Notes)
When checking the result using system variables, make sure the check takes place after the
instruction has been executed.
When checking the state after multiple instructions have been executed, system variables will
store the result only of the last processed instruction.
Program Example
XOR
(1) When the positive transition instruction turns ON, the XOR instruction will be executed.
When the XOR instruction is executed, the result value obtained by XORing Data_A with
FOFF is stored in D1.
When using a normally open instruction, as long as the instruction variable is ON, the
XOR instruction is always executed.
Program Example
XORP
(1) When the normally open instruction turns ON, the XORP instruction will be executed.
When the XORP instruction is executed, the result value obtained after Data_A is XORed
with F0FF is stored in D1.
Even when using a normally open instruction, the XORP instruction executes only when
it detects the upward transition. Therefore, even when the variable of the NO instruction
is always ON, the XORP instruction is executed only for one scan.
Operand Settings
The following describes the specifiable content of operands S1 and D1 for the NOT and
NOTP instructions.
The actual number of steps in the NOT and NOTP instructions depends on the specification
method of the operand. The following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand D1 + 1 = Total number of steps
in one instruction
Example: Converting the number of steps in the NOT and NOTP instructions
(For the number of steps in an operand, refer to the operand settings on the next page.)
One final step is required in the total number of steps in the instruction. Be sure to add 1 step.
Operand Settings
The following describes the specifiable content of Operand (S1) in the NOT and NOTP
instructions.
Operand Settings
The following describes the specifiable content of Operand (D1) in the NOT and NOTP
instructions.
S1 Operator D1
OFF NOT ON
ON OFF
When a NOT instruction is executed, if the S1 bit is OFF, the D1 bit turns ON. If the S1 bit is
ON, the D1 bit turns OFF.
When operand D1 is an integer variable and you want to input a hexadecimal value
in operand S1.
When 0x (zero and lower case x) is input, the following values will be interpreted as
hexadecimal values.
(Notes)
When checking the result using system variables, make sure the check takes place after the
instruction has been executed.
When checking the state after multiple instructions have been executed, system variables will
store the result only of the last processed instruction.
Program Example
NOT
(1) When the positive transition instruction turns ON, the NOT instruction will be executed.
When the NOT instruction is executed, the result value obtained by logically inverting
Data_A is stored in D1.
When using a normally open instruction, as long as the instruction variable is ON, the
NOT instruction is always executed.
Program Example
NOTP
(1) When the normally open instruction turns ON, the NOTP instruction will be executed.
When the NOTP is executed, the result value obtained after Data_A is logically inverted
is stored in D1.
Even when using a normally open instruction, the NOTP instruction executes only when
it detects the upward transition. Therefore, even when the variable of the NO instruction
is always ON, the NOTP instruction is executed only for one scan.
Operand Settings
The following describes the specifiable content of Operands (S1 and D1) in the MOV and
MOVP instructions.
The actual number of steps in the MOV and MOVP instructions depends on the specification
method of the operand. The following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand D1 + 1 = Total number of steps
in one instruction
Example: Converting the number of steps in the MOV and MOVP instructions
(For the number of steps in an operand, refer to the operand settings on the next page.)
One final step is required in the total number of steps in the instruction. Be sure to add 1 step.
Operand Settings
The following describes the specifiable content of Operand (S1) in the MOV and MOVP
instructions
.
Name Type Condition Number of Possible: O
Steps in the Not
Operand Possible: X
External Bit ⎯ ⎯ X
Device Word Only a word is specified. 1 O
Address (Example: [PLC1]D0000)
Internal Bit ⎯ ⎯ X
Address Word Only a word is specified. 1 O
(Example:
[#INTERNAL]LS0000)
Symbol Bit ⎯ ⎯ X
Word ⎯ 1 O
Variable Bit Specify a bit ⎯ X
Format Specify bit array ([constant]) ⎯ X
Specify bit array ([variable]) ⎯ X
Integer Arrays and modifiers are not 1 O
(including I/O) specified
Specify integer 2 O
variable[constant] or
Specify integer variable B/
W[constant]
Specify integer 3 O
variable[variable] or
Specify integer variable B/
W[variable]
Specify integer 4 O
variable[constant/variable]
.B/W[constant/variable]
Continued
Operand Settings
The following describes the specifiable content of Operand (D1) in the MOV and MOVP
instructions.
When operand D1 is an integer variable and you want to input a hexadecimal value
in operand S1.
When 0x (zero and lower case x) is input, the following values will be interpreted as
hexadecimal values.
Operand S1 Integer constant 0xFF
Operand D1 Integer variable OUT2
When transferring data in a specified array (integer variable array) Specify the array using
data [0] or data [N] (N indicates an integer variable).
When operands S1 and D1 specify the entire array, an error will occur even if the variables
are the same type.
Data_1 Array size = 5
Result Array size = 5
The operand specification in the left
diagram results in an error.
(Notes)
When checking the result using system variables, make sure the check takes place after the
instruction has been executed.
When checking the state after multiple instructions have been executed, system variables will
store the result only of the last processed instruction.
Program Example
MOV
Stores the constant in the integer variable.
(1) When the positive transition instruction turns ON, the MOV instruction will be executed.
When the MOV instruction is executed, the constant 10 is stored in D1.
When using a normally open instruction, as long as the instruction variable is ON, the
MOV instruction is always executed.
Program Example
MOVP
(1) When the normally open instruction turns ON, the MOVP instruction is executed. When
the MOVP instruction is executed, the constant 10 is stored in D1.
Even when using a normally open instruction, the MOVP instruction executes only when
it detects the upward transition. Therefore, even when the variable of the NO instruction
is always ON, the MOVP instruction is executed only for one scan.
BLMV and BLMVP (Block Transfer)
Symbols and Features
Ladder Instruction Ladder Symbol Feature Number of
Name Steps
BLMV Transfer 6 to 10
(Block Transfer -
Level Sensitive)
Operand Settings
The following describes the specifiable content of Operands (S1, S2, and D1) in the BLMV
and BLMVP instructions.
The actual number of steps in the BLMV and BLMVP instructions depends on the
specification method of the operand. The following describes how to calculate the number of
steps.
Number of steps in operand S1 + Number of steps in operand S2 + Number of steps in
operand D1 + 1 = Total number of steps in one instruction
Example: Converting the number of steps in the BLMV and BLMVP instructions
(For the number of steps in an operand, refer to the operand settings on the next page.)
One final step is required in the total number of steps in the instruction. Be sure to add 1 step.
Operand Settings
The following describes the specifiable content of Operands (S1 and D1) in the BLMV and
BLMVP instructions.
Operand Settings
The following describes the specifiable content of Operand (S2) in for the BLMV and
BLMVP instructions.
When operand D1 is an integer variable and you want to input a hexadecimal value
in operand S2
When 0x (zero and lower case "x") is input, the following values are interpreted as
hexadecimal values.
(Notes)
When checking the result using system variables, make sure the check takes place after the
instruction has been executed.
When checking the state after multiple instructions have been executed, system variables will
store the result only of the last processed instruction.
Program Example
BLMV
Copies 1 through 5 from Data_1 to Data_2.
(1) When the positive transition instruction turns ON, the BLMV instruction will be
executed. When the BLMV instruction is executed, numbers 0 through 4 in data 1, stored
in D1, are copied to numbers 0 through 4 in data 2.
When the start is a normally open instruction, as long as the start is ON, the BLMV
instruction is always executed.
Array Variable Data 1 5 Executed Data 2
Name Instructions
Element Data_1[0] → Data_2 [0]
Data_1 [1] → Data_2 [1]
Data_1 [2] → Data_2 [2]
Data_1 [3] → Data_2 [3]
Data_1 [4] Data_2 [4]
→
Data_1 [5] Data_2 [5]
Data_1 [6] Data_2 [6]
Data_1 [7] Data_2 [7]
Data_1 [8] Data_2 [8]
Data_1 [9] Data_2 [9]
Data_1 [10] Data_2 [10]
Program Example
BLMVP
(1) When the normally open instruction turns ON, the BLMVP instruction will be executed.
When the BLMVP instruction is executed, numbers 0 through 4 in data 1, stored in D1,
are copied to numbers 0 through 4 in data 2.
Even when using a normally open instruction, only the start ON up edge is detected, and the BLMVP
instruction is executed.
Therefore, even when the variable of the NO instruction is always ON, the BLMVP
instruction is executed only for one scan.
Operand Settings
The following describes the specifiable content of Operands (S1, S2, and D1) in the FLMV
and FLMVP instructions.
The actual number of steps in the FLMV and FLMVP instructions depends on the
specification method of the operand. The following describes how to calculate the number of
steps.
Number of steps in operand S1 + Number of steps in operand S2 + Number of steps in
operand D1 + 1 = Total number of steps in one instruction
Example: Converting the number of steps in the FLMV and FLMVP instructions
(For the number of steps in an operand, refer to the operand settings on the next page.)
One final step is required in the total number of steps in the instruction. Be sure to add 1 step.
Operand Settings
The following describes the specifiable content of Operand (S1) in the FLMV and FLMVP
instructions.
Operand Settings
The following describes the specifiable content of Operand (S2) in the FLMV and FLMVP
instructions.
Operand Settings
The following describes the specifiable content of Operand (D1) in the FLMV and FLMVP
instructions.
When operand D1 is an integer variable and you want to input hexadecimal values in
operand S2.
When 0x (zero and lower case x) is input, the following values will be interpreted as
hexadecimal values.
(Notes)
When checking the result using system variables, make sure the check takes place after the
instruction has been executed.
When checking the state after multiple instructions have been executed, system variables will
store the result only of the last processed instruction.
Program Example
FLMV
Copies the data in data 1 to elements 0 through 4 in data 2.
(1) When the positive transition instruction turns ON, the FLMV instruction will be executed.
When the FLMV instruction is executed, data 1, stored in D1, is copied to elements 0
through 4 in data 2.
When the start is a normally open instruction, as long as the start is ON, the FLMV
instruction is always executed.
Program Example
FLMVP
(1) When the normally open instruction turns ON, the FLMVP instruction will be executed.
When the FLMVP instruction is executed, the data in data 1, stored in D1, is copied to
numbers 0 through 4 in data 2.
Even when using a normally open instruction, the FLMVP instruction executes only when
it detects the upward transition.Therefore, even when the variable of the NO instruction is
always ON, the FLMVP instruction is executed only for one scan.
Operand Settings
The following describes the specifiable content of Operands (D1 and D2) in the XCH and
XCHP instructions.
The actual number of steps in the XCH and XCHP instructions depends on the specification
method of the operand. The following describes how to calculate the number of steps.
Number of steps in operand D1 + Number of steps in operand D2 + 1 = Total number of steps
in one instruction
Example: Converting the number of steps in the XCH and XCHP instructions
(For the number of steps in an operand, refer to the operand settings on the next page.)
One final step is required in the total number of steps in the instruction. Be sure to add 1 step.
Operand Settings
The following describes the specifiable content of Operands (D1 and D2) in the XCH and
XCHP instructions
.
Name Type Condition Number of Possible: O
Steps in the Not
Operand Possible: X
External Bit ⎯ ⎯ X
Device Word Only a word is specified. 1 O
Address (Example: [PLC1]D0000)
Internal Bit ⎯ ⎯ X
Address Word Only a word is specified. 1 O
(Example:
[#INTERNAL]LS0000)
Symbol Bit ⎯ ⎯ X
Word ⎯ 1 O
Variable Bit Specify a bit ⎯ X
Format Specify bit array ([constant]) ⎯ X
Specify bit array ([variable]) ⎯ X
Integer Arrays and modifiers are not 1 O
(Output specified
included) Specify integer 2 O
variable[constant]
Specify integer variable 3 O
[Variable]
Specify integer ⎯ X
variable[constant/variable]
.B/W[constant/variable]
Continued
(Notes)
When checking the result using system variables, make sure the check takes place after the
instruction has been executed.
When checking the state after multiple instructions have been executed, system variables will
store the result only of the last processed instruction.
Program Example
XCH
Exchanges the contents of data 1 and data 2.
(1) When the positive transition instruction turns ON, the XCH instruction will be executed.
When the XCH instruction is executed, the summary of the Data_1[0] in D1 and the
Data_2[0]in D2 will be switched.
When using a normally open instruction, as long as the instruction variable is ON, the
XCH instruction is always executed.
Program Example
XCHP
(1) When the positive transition instruction turns ON, the XCHP instruction will be executed.
When the XCHP instruction is executed, the summary of the Data_1[0] in D1 and the
Data_2[0] in D2 will be switched.
Even when the operation is a normally open instruction, the XCHP instruction will execute only
when an upward transition is detected.
Therefore, even when the variable of the normally open instruction is always ON, the
XCHP instruction executes for only one scan.
Operand Settings
The following table lists the specifiable content of operands S1, S2, and D1 for the SHL and
SHLP instructions.
The actual number of steps in the SHL and SHLP instructions depends on the specified
operands. The following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand S2 + Number of steps in
operand D1 + 1 = Total number of steps in one instruction
For example, Converting the number of steps in SHL and SHLP instructions
(For the number of steps in an operand, refer to the operand settings on the next page.)
One final step is required in the total number of steps in the instruction. Be sure to add 1 step.
Operand Settings
The following describes the specifiable content of Operand (S1) in SHL and SHLP
instructions.
Operand Settings
The following describes the specifiable content of Operand (S2) in SHL and SHLP
instructions.
Operand Settings
The following describes the specifiable content of Operand (D1) in SHL and SHLP
instructions.
When operand D1 is an integer variable and you want to input hexadecimal values in
operands S1 and S2.
When 0x (zero and lower case x) is input, the following values will be interpreted as
hexadecimal values.
Use the same format when shifting data in a specified array (integer variable array) and when
specifying an array element.
If the S1 and D1 arrays are the same size, S1 is treated like a single giant integer. Bits are
shifted one element to the next element.
The topmost bits of each element are not lost. However, the topmost bit in the last element is
lost. Specify S2 as 0 or higher (32 x Array Size −1).
If both S1 and D1 are not in an array, this instruction shifts the 32 bits in S1. Specify a value
between 0 and 31 for S2.
(Notes)
When checking the result using system variables, make sure the check takes place after the
instruction has been executed.
When checking the state after multiple instructions have been executed, system variables will
store the result only of the last processed instruction.
Program Example
SHL
Determines whether the most significant bit is ON or OFF.
(1) When the positive transition instruction turns ON, an SHL instruction will be executed.
When the SHL instruction is executed, the result from shifting 1 bit to the left is stored in
D1.
(2) When 1 bit is shifted to the left, you can check whether the most significant bit before data
shifting is ON or OFF from the state of #L_CalcCarry.
(Note) When using a normally open instruction, the SHL instruction is always executed as
long as the normally open instruction is ON.
Program Example
SHLP
SHLP and SHL instructions have different ways of detecting when to execute. In SHLP
instructions, even when using a normally open instruction, only the upward transition is
detected and the SHLP instruction is executed. Therefore, the SHLP instruction is executed
only for one scan, even when the normally open instruction remains ON.
Operand Settings
The following describes the specifiable content of operands S1, S2, and D1 for the SHR and
SHRP instructions.
The number of steps in the SHR and SHRP instructions depends on the specified operand.
The following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand S2 + Number of steps in
operand D1 + 1 = Total number of steps in one instruction
For example, Converting the number of steps in SHR and SHRP instructions
(For the number of steps in an operand, refer to the operand settings on the next page.)
One final step is required in the total number of steps in the instruction. Be sure to add 1 step.
Operand Settings
The following describes the specifiable content of Operand (S1) in SHR and SHRP
instructions.
Operand Settings
The following describes the specifiable content of Operand (S2) in SHR and SHRP
instructions.
Operand Settings
The following describes the specifiable content of Operand (D1) in SHR and SHRP
instructions.
When operand D1 is an integer variable and you want to input hexadecimal values in
operands S1 and S2.
When 0x (zero and lower case x) is input, the following values will be interpreted as
hexadecimal values.
Use the same format when shifting data in a specified array (integer variable array) and when
specifying an array element.
If the S1 and D1 arrays are the same size, S1 is treated like a single giant integer. Bits are
shifted one element to the next element.
The bottom bit of each element is not lost, except for the bottom bit in the last element.
Specify S2 as 0 or higher, up to (32 x Array Size −1).
If both S1 and D1 are not arrays, 32 bits are shifted. Specify S2 between 0 and 31.
(Notes)
When checking the result using system variables, make sure the check takes place after the
instruction has been executed.
When checking the state after multiple instructions have been executed, system variables will
store the result only of the last processed instruction.
Program Example
SHR
Determines whether the least significant bit is ON or OFF.
(1) When the variable of the positive transition instruction turns ON, the SHR instruction is
run. The SHR instruction shifts bits in Data_1 one bit to the right and stores the result in
D1.
(2) After the bit shift operation is complete, you can check the previous value of the least
significant bit in Data_1 by using the #L_CalcCarry system variable.
(Supplementary) When using a normally open instruction, the SHR instruction is always
executed as long as the bit remains ON.
Program Example
SHRP
When to run the instruction is different between SHRP and SHR instructions. In the SHRP
instruction, even when using a normally open instruction, only the upward transition of the
bit is detected, and the SHRP instruction is executed. Even if the bit of the normally open
instruction remains ON, the SHRP instruction is executed only for one scan.
Operand Settings
The following table lists the specifiable content of operands S1, S2, and D1 for the SAL and
SALP instructions.
The number of steps in the SAL and SALP instructions depends on the specified operand.
The following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand S2 + Number of steps in
operand D1 + 1 = Total number of steps in one instruction
For example, Converting the number of steps in SAL and SALP instructions
(For the number of steps in an operand, refer to the operand settings on the next page.)
One final step is required in the total number of steps in the instruction. Be sure to add 1 step.
Operand Settings
The following describes the specifiable content of Operand (S1) in SAL and SALP
instructions.
Operand Settings
The following describes the specifiable content of Operand (S2) in SAL and SALP
instructions.
Operand Settings
The following describes the specifiable content of Operand (D1) in SAL and SALP
instructions.
Before instruction 31 30 29 28 3 2 1 0
execution 1 0 1 1 1 0 1 1 0 is stored in the
Erased least significant
bit.
After instruction 1 1 1 0 1 1 0 0
execution
When operand D1 is an integer variable and you want to input hexadecimal values in
operands S1 and S2.
When 0x (zero and lower case x) is input, the following values will be interpreted as
hexadecimal values.
31 array element bits are shifted. For S2, specify a value between 0 and 31.
(Notes)
When checking the result using system variables, make sure the check takes place after the
instruction has been executed.
When checking the state after multiple instructions have been executed, system variables will
store the result only of the last processed instruction.
Program Example
SAL
(1) When the positive transition instruction turns ON, the SAL instruction is executed. When
the SAL instruction is executed, the result of the bit shift is stored in D1. The most
significant bit is not shifted, and zero is stored in the least significant bit.
(Supplementary) When using a normally open instruction, the SAL instruction is always
executed as long as the normally open bit is ON.
Program Example
SALP
The SALP and SAL instructions have different ways of detecting when to execute. In the
SALP instruction, Even when using a normally open instruction, the SLAP instruction
executes only when it detects the upward transition.As a result, if the bit remains ON, the
SALP instruction is executed only for one scan.
Operand Settings
The following table lists the specifiable content of operands S1, S2, and D1 for the SAR and
SARP instructions.
The actual number of steps in the SAR and SARP instructions depends on the specified
operands. The following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand S2 + Number of steps in
operand D1 + 1 = Total number of steps in one instruction
For example, Converting the number of steps in SAR and SARP instructions
(For the number of steps in an operand, refer to the operand settings on the next page.)
One final step is required in the total number of steps in the instruction. Be sure to add 1 step.
Operand Settings
The following describes the specifiable content of Operand (S1) in SAR and SARP
instructions.
Name Type Condition Number of Possible: O
Steps in the Not
Operand Possible: X
External Bit ⎯ ⎯ X
Device Word Only a word is specified. 1 O
Address (Example: [PLC1]D0000)
Internal Bit ⎯ ⎯ X
Address Word Only a word is specified. 1 O
(Example:
[#INTERNAL]LS0000)
Symbol Bit ⎯ ⎯ X
Word ⎯ 1 O
Variable Bit Specify a bit ⎯ X
Format Specify bit array ([constant]) ⎯ X
Specify bit array ([variable]) ⎯ X
Integer Arrays and modifiers are not 1 O
(including I/O) specified
Specify integer 2 O
variable[constant]
Specify integer variable 3 O
[Variable]
Specify integer ⎯ X
variable[constant/variable]
.B/W[constant/variable]
Float ⎯ ⎯ X
Specify float ⎯ X
variable[constant]
Specify float variable[variable] ⎯ X
Continued
Operand Settings
The following describes the specifiable content of Operand (S2) in SAR and SARP
instructions.
Name Type Condition Number of Possible: O
Steps in the Not
Operand Possible: X
External Bit ⎯ ⎯ X
Device Word Only a word is specified. 1 O
Address (Example: [PLC1]D0000)
Internal Bit ⎯ ⎯ X
Address Word Only a word is specified. 1 O
(Example:
[#INTERNAL]LS0000)
Symbol Bit ⎯ ⎯ X
Word ⎯ 1 O
Variable Bit Specify a bit ⎯ X
Format Specify bit array ([constant]) ⎯ X
Specify bit array ([variable]) ⎯ X
Integer Arrays and modifiers are not 1 O
(including I/O) specified
Specify integer 2 O
variable[constant]
Specify integer variable 3 O
[Variable]
Specify integer ⎯ X
variable[constant/variable]
.B/W[constant/variable]
Float ⎯ ⎯ X
Specify float ⎯ X
variable[constant]
Specify float ⎯ X
variable[variable]
Continued
Operand Settings
The following describes the specifiable content of Operand (D1) in SAR and SARP
instructions.
Name Type Condition Number of Possible: O
Steps in the Not
Operand Possible: X
External Bit ⎯ ⎯ X
Device Word Only a word is specified. 1 O
Address (Example: [PLC1]D0000)
Internal Bit ⎯ ⎯ X
Address Word Only a word is specified. 1 O
(Example:
[#INTERNAL]LS0000)
Symbol Bit ⎯ ⎯ X
Word ⎯ 1 O
Variable Bit Specify a bit ⎯ X
Format Specify bit array ([constant]) ⎯ X
Specify bit array ([variable]) ⎯ X
Integer Arrays and modifiers are not 1 O
(Output specified
included) Specify integer 2 O
variable[constant]
Specify integer variable 3 O
[Variable]
Specify integer ⎯ X
variable[constant/variable]
.B/W[constant/variable]
Float ⎯ ⎯ X
Specify float variable[constant] ⎯ X
Specify float variable[variable] ⎯ X
Continued
31 30 29 28 3 2 1 0
Before instruction
execution 1 0 1 1 1 0 1 1
Erased
After instruction 1 1 0 0 1 0 1
execution
When operand D1 is an integer variable and you want to input hexadecimal values in
operands S1 and S2.
When 0x (zero and lower case x) is input, the following values will be interpreted as
hexadecimal values.
31 array element bits are shifted. For S2, specify a value between 0 and 31.
(Notes)
When checking the result using system variables, make sure the check takes place after the
instruction has been executed.
When checking the state after multiple instructions have been executed, system variables will
store the result only of the last processed instruction.
Program Example
SAR
(1) When the positive transition instruction turns ON, the SAR instruction will be executed.
When the SAR instruction is executed, the 1 bit to the right is stored in D1. The most
significant bit is not shifted but is also copied to D1. For every bit that shifts, the most
significant bit is copied to the topmost empty bit.
(Supplementary) When using a normally open instruction, the SAR instruction is always
executed as long as the bit is ON.
Program Example
SALP
The SARP and SAR instructions have different ways of detecting when to execute. In the
SARP instruction, even when using a normally open instruction, the SARP instruction is
executed only when a positive transition is detected. As a result, even if the bit remains ON,
the SARP instruction is executed only for one scan.
Operand Settings
The following table lists the specifiable content of operands S1, S2, and D1 for the ROL and
ROLP instructions.
The actual number of steps in the ROL and ROLP instructions depends on the specified
operands. The following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand S2 + Number of steps in
operand D1 + 1 = Total number of steps in one instruction
For example, Converting the number of steps in ROL and ROLP instructions
(For the number of steps in an operand, refer to the operand settings on the next page.)
One final step is required in the total number of steps in the instruction. Be sure to add 1 step.
Operand Settings
The following describes the specifiable content of Operand (S1) in ROL and ROLP
instructions.
Operand Settings
The following describes the specifiable content of Operand (S2) in ROL and ROLP
instructions.
Operand Settings
The following describes the specifiable content of Operand (D1) in ROL and ROLP
instructions.
Bit 31 30 29 28 27 26 25 24 23 22 3 2 1 0
1 0 0 0 0 0 0 0 1 0 0 0 0 0
1 bit is rotated
to left
0 0 0 0 0 0 0 1 0 0 0 0 0 1
When operand D1 is an integer variable and you want to input hexadecimal values in
operands S1 and S2.
When 0x (zero and lower case x) is input, the following values are interpreted as
hexadecimal values.
Use the same format when rotating data in a specified array (integer variable array) and when
specifying an array element.
If the arrays of S1 and D1 are the same size, S1 is treated as if it's a giant integer. Bits are
rotated from one element to the next.
The entire array is rotated, not bits within each element. Specify S2 as 0 or higher, up to (32 x
Array Size −1).
If both S1 and D1 are not arrays, 32 bits are rotated. For S2, specify a value between 0 and
31.
(Notes)
When checking the result using system variables, make sure the check takes place after the
instruction has been executed.
When checking the state after multiple instructions have been executed, system variables will
store the result only of the last processed instruction.
Program Example
ROL
(1) When a positive transition instruction turns ON, the ROL instruction is executed. When
the ROL instruction is executed, the result of rotating 1 bit is stored in D1.
(Supplementary) When using a normally open instruction, the ROL instruction is always
executed as long as the bit is ON.
Bit 31 30 29 28 27 26 25 24 23 22 3 2 1 0
1 0 0 0 0 0 0 0 1 0 0 0 0 0
1 bit is rotated
to left
0 0 0 0 0 0 0 1 0 0 0 0 0 1
Program Example
ROLP
The ROLP and ROL instructions have different ways of detecting when to execute. In the
ROLP instruction, even when using a normally open instruction, only the upward transition
of the bit is detected, and the ROLP instruction is executed. As a result, even if the bit
remains ON, the ROLP instruction is executed only for one scan.
Operand Settings
The following table lists the specifiable content of operands S1, S2, and D1 for ROR and
RORP instructions..
The number of steps in the ROR and RORP instructions depends on the specified operand.
The following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand S2 + Number of steps in
operand D1 + 1 = Total number of steps in one instruction
For example, Converting the number of steps in the ROR and RORP instructions
(For the number of steps in an operand, refer to the operand settings on the next page.)
One final step is required in the total number of steps in the instruction. Be sure to add 1 step.
Operand Settings
The following describes the specifiable content of Operand (S1) in ROR and RORP
instructions.
Operand Settings
The following describes the specifiable content of Operand (S2) in ROR and RORP
instructions.
Operand Settings
The following describes the specifiable content of Operand (D1) in ROR and RORP
instructions.
Bit 31 30 29 28 27 26 25 24 23 22 3 2 1 0
1 0 0 0 0 0 0 0 1 0 0 0 0 0
1 bit is rotated to
right
0 0 0 0 0 0 0 1 0 0 0 0 0 1
When operand D1 is an integer variable and you want to input hexadecimal values in
operands S1 and S2.
When 0x (zero and lower case x) is input, the following values are interpreted as
hexadecimal values.
Use the same format when rotating data in a specified array (integer variable array) and when
specifying an array element.
An error will occur if the formats are different.
If the arrays of S1 and D1 are the same size, S1 is treated as if it's a giant integer. Bits are
rotated from one element to the next.
The entire array is rotated, not just bits in each element. For S2, specify a value from 0 to (32
x Array Size −1).
If both S1 and D1 are not arrays, 32 bits are rotated. For S2, specify a value between 0 and
31.
(Notes)
When checking the result using system variables, make sure the check takes place after the
instruction has been executed.
When checking the state after multiple instructions have been executed, system variables will
store the result only of the last processed instruction.
Program Example
ROR
(1) When the positive transition instruction turns ON, the ROR instruction is executed. When
the ROR instruction is executed, the result of rotating 1 bit to the right is stored in D1.
(Supplementary) When using a normally open instruction, the ROR instruction is always
executed as long as the bit is ON.
Bit 31 30 29 28 27 26 25 24 23 22 3 2 1 0
1 0 0 0 0 0 0 0 1 0 0 0 0 0
1 bit is rotated to
right
0 0 0 0 0 0 0 1 0 0 0 0 0 1
Program Example
RORP
The RORP and ROR instructions have different ways of detecting when to execute. For
RORP, even when using a normally open instruction, only the upward transition is detected,
and the RORP instruction is executed. Therefore, the RORP instruction is executed only for
one scan, even when the bit confirmation continues to turn ON.
Operand Settings
The following table lists the specifiable content of operands S1, S2, and D1 for the RCL and
RCLP instructions.
The actual number of steps in the RCL and RCLP instructions depends on the specified
operands. The following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand S2 + Number of steps in
operand D1 + 1 = Total number of steps in one instruction
For example, Converting the number of steps in the RCL and RCLP instructions
(For the number of steps in an operand, refer to the operand settings on the next page.)
One last step is included in the instruction. Be sure to add that one step.
Operand Settings
The following describes the specifiable content of Operand (S1) in RCL and RCLP
instructions.
Operand Settings
The following describes the specifiable content of Operand (S2) in RCL and RCLP
instructions.
Operand Settings
The following describes the specifiable content of Operand (D1) in RCL and RCLP
instructions.
After
instruction 0 1 1 0 1 1 0 1
execution
The most significant bit is stored in a carry flag. Information in a carry
flag after execution of
an instruction
When operand D1 is an integer variable and you want to input hexadecimal values in
operands S1 and S2.
When 0x (zero and lower case x) is input, the following values are interpreted as
hexadecimal values.
If both S1 and D1 are not an array, 32 bits are rotated with carry over.
For S2, specify a value between 0 and 32.
System Variables Indicating Execution Results
When the execution result is 0, #L_CalcZero turns on.
If an overflow results from the rotation instruction, the overflowed bit is stored in
#L_CalcCarry.
When the execution results in an error, the error information is stored in #L_Status.
When the execution results in an error, the error code is stored in #L_CalcErrCode.
(Notes)
When checking the result using system variables, make sure the check takes place after the
instruction has been executed.
When checking the state after multiple instructions have been executed, system variables will
store the result only of the last processed instruction.
Program Example
RCL
(1) When the positive transition instruction turns ON, the RCL instruction is executed. When
the RCL instruction is executed, the result from rotating 1 bit with carry over is stored in
D1.
(2) When 1 bit is shifted to the left with carry over, you can use #L_CalcCarry to check the
value of the most significant bit before the rotate operation.
(Supplementary) When using a normally open instruction, the RCL instruction is always
executed as long as the bit is ON.
Most significant bit Least significant bit Information in a carry
flag before execution of
an instruction
Before 31 30 29 28 3 2 1 0
instruction
execution 1 0 1 1 1 0 1 1 0
After
instruction 0 1 1 0 1 1 0 1
execution
Information in a carry
The most significant bit is stored in a carry flag.
flag after execution of
an instruction
Program Example
RCLP
The RCLP and RCL instructions have different ways of detecting when to execute. In the
RCLP instruction, Even when using a normally open instruction, the RCLP instruction
executes only when it detects the upward transition. Therefore, the RCLP instruction is
executed only for one scan, even when the bit remains ON.
Operand Settings
The following table lists the specifiable content of operands S1, S2, and D1 for the RCR and
RCRP instructions.
The actual number of steps in the RCR and RCRP instructions depends on the specified
operands. The following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand S2 + Number of steps in
operand D1 + 1 = Total number of steps in one instruction
For example, Converting the number of steps in RCR and RCRP instructions
(For the number of steps in an operand, refer to the operand settings on the next page.)
One last step is included in the instruction. Be sure to add that one step.
Operand Settings
The following describes the specifiable content of Operand (S1) in RCR and RCRP
instructions
.
Name Type Condition Number of Possible: O
Steps in the Not
Operand Possible: X
External Bit ⎯ ⎯ X
Device Word Only a word is specified. 1 O
Address (Example: [PLC1]D0000)
Internal Bit ⎯ ⎯ X
Address Word Only a word is specified. 1 O
(Example:
[#INTERNAL]LS0000)
Symbol Bit ⎯ ⎯ X
Word ⎯ 1 O
Variable Bit Specify a bit ⎯ X
Format Specify bit array ([constant]) ⎯ X
Specify bit array ([variable]) ⎯ X
Integer Arrays and modifiers are not 1 O
(including I/O) specified
Specify integer 2 O
variable[constant]
Specify integer variable 3 O
[Variable]
Specify integer ⎯ X
variable[constant/variable]
.B/W[constant/variable]
Float ⎯ ⎯ X
Specify float ⎯ X
variable[constant]
Specify float ⎯ X
variable[variable]
Continued
Operand Settings
The following describes the specifiable content of Operand (S2) in RCR and RCRP
instructions.
Operand Settings
The following describes the specifiable content of Operand (D1) in RCR and RCRP
instructions.
After
instruction 0 1 1 0 1 1 0 1
execution
Information in a carry flag is stored Information in a carry flag after
in the most significant bit. execution of an instruction
When operand D1 is an integer variable and you want to input hexadecimal values in
operands S1 and S2.
When 0x (zero and lower case x) is input, the following values are interpreted as
hexadecimal values.
Operand S1 Integer constant 0xFF
Operand S2 Integer constant 0xF
Operand D1 Integer variable OUT2
If both S1 and D1 are not an array, 32 bits are rotated with carry over.
For S2, specify a value between 0 and 32.
(Notes)
When checking the result using system variables, make sure the check takes place after the
instruction has been executed.
When checking the state after multiple instructions have been executed, system variables will
store the result only of the last processed instruction.
Program Example
RCR
(1) When the positive transition instruction turns ON, the RCR instruction will be executed.
When the RCR instruction is executed, the result of rotating 1 bit with carry over is stored
in D1.
(2) When 1 bit is shifted to the right with carry over, you can use #L_CalcCarry to check the
value of the least significant bit before rotation.
(Supplementary) When using a normally open instruction, as long as the bit is ON, the RCR
instruction is always executed.
Most significant bit Least significant bit Information in a carry flag
before execution of an
Before instruction
instruction 31 30 29 28 3 2 1 0
execution 1 0 1 1 1 0 1 1 0
After
instruction 0 1 1 0 1 1 0 1
execution
Information in a carry flag is stored in the Information in a carry flag after
most significant bit. execution of an instruction
Program Example
RCRP
The RCRP and RCR instructions have different ways of detecting when to execute. In the
RCRP instruction, even when using a normally open instruction, only the upward transition
is detected, and the RCRP instruction is executed. Therefore, the RCRP instruction is
executed only for one scan, even when the bit remains ON.
Operand Settings
The following describes the specifiable content of operands S1, S2, D1 for the SUM/SUMP
instructions.
The actual number of steps in the SUM/SUMP instructions depends on the operand
specification method. The following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand S2 + Number of steps in
operand D1 + 1 = Total number of steps in one instruction
{Data_1 [0] = 2 steps} + {10 = 1 step} + {Result [0] = 2 steps} + {1 step} = 6 steps
One last step is included in the instruction. Be sure to add that one step.
Operand Settings
The following describes the specifiable content of Operand S1 in the SUM/SUMP
instructions
.
Name Type Condition Number of Possible: O
Steps in the Not
Operand Possible: X
External Bit ⎯ ⎯ X
Device Word Only a word is specified. ⎯ X
Address (Example: [PLC1]D0000)
Internal Bit ⎯ ⎯ X
Address Word Only a word is specified. ⎯ X
(Example:
[#INTERNAL]LS0000)
Symbol Bit ⎯ ⎯ X
Word ⎯ ⎯ X
Variable Bit Specify a bit ⎯ X
Format Specify bit array ([constant]) ⎯ X
Specify bit array ([variable]) ⎯ X
Integer Arrays and modifiers are not ⎯ X
(not including I/O) specified
Specify integer 2 O
variable[constant]
Specify integer variable 3 O
[Variable]
Specify integer ⎯ X
variable[constant/variable]
.B/W[constant/variable]
Float ⎯ ⎯ X
Specify float variable[constant] 2 O
Specify float variable[variable] 3 O
Continued
Operand Settings
The following describes the specifiable content of Operand S2 in the SUM/SUMP
instructions.
Operand Settings
The following describes the specifiable content of Operand D1 in the SUM/SUMP
instructions.
When operand D1 is an integer variable and you want to input hexadecimal values in
operand S2.
When 0x (zero and lower case x) is input, the following values are interpreted as
hexadecimal values.
Operand S1 Integer Variable (Array) Data_1 [0]
Operand S2 Integer Constant 0x5
Operand D1 Integer variable (Array) Data 2 [0]
(Notes)
When checking the result using system variables, make sure the check takes place after the
instruction has been executed.
When checking the state after multiple instructions have been executed, system variables will
store the result only of the last processed instruction.
Program Example
SUM
Totals 1 through 5 in Data_1 and saves the total in Data_2.
(1) When the positive transition instruction turns on and passes power to the SUM
instruction, it totals 5 data elements in Data_1 beginning with element 0 and stores the
result in D1 (Data_2).When using a normally open instruction, as long as the instruction
is passing power, the SUM instruction continually executes at each scan, performing the
sum operation.
Program Example
SUMP
(1) The SUMP and SUM instructions differ in how they detect the instruction start. The
SUMP instruction only detects the upward transition and executes the SUMP instruction
even when using a normally open instruction. Even if the variable of the NO instruction
stays ON, the SUMP instruction is executed only once (on the first scan).
AVE/AVEP (Average)
Symbols and Features
Ladder Instruction Ladder Symbol Feature Number of
Name Steps
AVE Operation 6 to 10
(Average -
Level Sensitive)
Operand Settings
The following describes the specifiable content of operands S1, S2 and D1 for the AVE/
AVEP instructions.
The actual number of steps in the AVE/AVEP instructions depends on the operand
specification method. The following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand S2 + Number of steps in
operand D1 + 1 = Total number of steps in one instruction
{Data_1 [0] = 2 steps} + {10 = 1 step} + {Result [0] = 2 steps} + {1 step} = 6 steps
One last step is included in the instruction. Be sure to add that one step.
Operand Settings
The following describes the specifiable content of Operand S1 in the AVE/AVEP
instructions.
Name Type Condition Number of Possible: O
Steps in the Not
Operand Possible: X
External Bit ⎯ ⎯ X
Device Word Only a word is specified. ⎯ X
Address (Example: [PLC1]D0000)
Internal Bit ⎯ ⎯ X
Address Word Only a word is specified. ⎯ X
(Example:
[#INTERNAL]LS0000)
Symbol Bit ⎯ ⎯ X
Word ⎯ ⎯ X
Variable Bit Specify a bit ⎯ X
Format Specify bit array ([constant]) ⎯ X
Specify bit array ([variable]) ⎯ X
Integer Arrays and modifiers are not ⎯ X
(not including I/O) specified
Specify integer 2 O
variable[constant]
Specify integer variable 3 O
[Variable]
Specify integer ⎯ X
variable[constant/variable]
.B/W[constant/variable]
Float ⎯ ⎯ X
Specify float variable[constant] 2 O
Specify float variable[variable] 3 O
Continued
Operand Settings
The following describes the specifiable content of Operand S2 in the AVE/AVEP
instructions.
Operand Settings
The following describes the specifiable content of Operand D1 in the AVE/AVEP
instructions.
When operand D1 is an integer variable and you want to input hexadecimal values in
operand S2.
When 0x (zero and lower case x) is input, the following values are interpreted as
hexadecimal values.
(Notes)
When checking the result using system variables, make sure the check takes place after the
instruction has been executed.
When checking the state after multiple instructions have been executed, system variables will
store the result only of the last processed instruction.
If There are no items to be calculated, the total is zero and the result is zero.
Program Example
AVE
Averages 1 through 5 in Data_1 and saves the result in Data_2.
(1) When the positive transition instruction turns ON, the AVE instruction will be executed.
When the AVE instruction is executed, the average of array elements 0 through 4 of Data
1 are calculated and the result at D1 is stored in Data_2.
When using a normally-open instruction, as long as the instruction variable is ON, the
AVE instruction is always executed.
Array Variable Data 1 5 Executed Save in Data 2
Name Instructions
Element Data_1[0] + → Data_2 [0]
Data_1 [1] + Data_2 [1]
Data_1 [2] + divide by 5 Data_2 [2]
Data_1 [3] + Data_2 [3]
Data_1 [4] + Data_2 [4]
Data_1 [5] Data_2 [5]
Data_1 [6] Data_2 [6]
Data_1 [7] Data_2 [7]
Data_1 [8] Data_2 [8]
Data_1 [9] Data_2 [9]
Data_1 [10] Data_2 [10]
Program Example
AVEP
(1) AVEP and AVE instructions differ in how they detect the instruction start. The AVEP
only detects the upward transition and executes the AVEP instruction even when using a
normally open instruction. Even if the variable of the NO instruction stays ON, the AVEP
instruction is executed only once (on the first scan).
Operand Settings
The following describes the specifiable content of Operands (S1 and D1) in the SQRT/
SQRTP instructions.
The actual number of steps in the SQRT/SQRTP instructions depends on the operand
specification method. The following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand D1 + 1 = Total number of steps
in the instruction.
One last step is included in the instruction. Be sure to add that one step.
Operand Settings
The following describes the specifiable content of Operands (S1 and D1) in the SQRT/
SQRTP instructions.
When calculating data in a specified array, specify the array with Data [0] or Data [N] (N is
an integer variable).
When operands S1 and D1 specify the entire array, an error will occur even if the variables
are the same type.
Data_1 Array size = 5
Result Array size = 5
The operand specification in the left diagram results in an
error.
(Notes)
When checking the result using system variables, make sure the check takes place after the
instruction has been executed.
When checking the state after multiple instructions have been executed, system variables will
store the result only of the last processed instruction.
Program Example
SQRT
(1) When the positive transition instruction turns ON, the SQRT instruction will be executed.
When the SQRT instruction is executed, the square root of Data_A is stored in the
calculation result (real/float variable) in D1.
When using a normally-open instruction, as long as the instruction variable is ON, the
SQRT instruction is always executed.
Program Example
SQRTP
(1) The SQRTP and SQRT instructions differ in how they detect the instruction start. The
SQRTP only detects the upward transition and executes the SQRTP instruction even when
using a normally open instruction. Even if the variable of the NO instruction stays ON,
the SQRTP instruction is executed only once (on the first scan).
Operand Settings
The following describes the specifiable content of operands S1 and D1 for the BCNT/
BCNTP instructions.
The actual number of steps in the BCNT/BCNTP instructions depends on the operand
specification method. The following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand D1 + 1 = Total number of steps
in one instruction
One last step is included in the instruction. Be sure to add that one step.
Operand Settings
The following table list the configurable conditions for Operands (S1 and D1) in the BCNT/
BCNTP instructions.
When operand D1 is an integer variable and you want to input hexadecimal values in
operand S2.
When 0x (zero and lower case x) is input, the following values will be interpreted as
hexadecimal values.
When calculating data in a specified array (integer variable array), use Data [0] or Data [N]
(N is an integer variable) to specify the array.
When operands S1 and D1 specify the entire array, an error will occur even if the variables
are the same type.
Data_1 Array size = 5
Result Array size = 5
The operand specification in the left diagram results in an
error.
(Notes)
When checking the result using system variables, make sure the check takes place after the
instruction has been executed.
When checking the state after multiple instructions have been executed, system variables will
store the result only of the last processed instruction.
Program Example
BCNT
Counts the number of bits that are ON, and saves the number in an integer variable.
When the positive transition instruction turns ON, the BCNT instruction will be executed.
When the BCNT instruction is executed, the ON bits in the value 10 (binary 1010) are
counted and the result of 2 is saved in the result data. The result data is configured in D1.
When using a normally-open instruction, as long as the instruction variable is ON, the
BCNT instruction is always executed.
Program Example
BCNTP
(1) The BCNTP and BCNT instructions differ in how they detect the instruction start, The
BCNTP only detects the upward transition and executes the BCNTP instruction even
when using a normally open instruction. Even if the variable of the NO instruction stays
ON, the BCNTP instruction is executed only once (on the first scan).
PID
Symbols and Features
Ladder Instruction Ladder Symbol Feature Number of
Name Steps
PID HP Operation 10 to 18
(PID - Level Sensitive)
PID Variable
PID Variable Variables Settings Description
VariableName.Q Bit Variable PID Instruction Processing
Completion Flag
VariableName.PF Bit Variable Processing Deadband Range Flag
VariableName.UO Bit Variable Output Values over the Upper
Limit
VariableName.TO Bit Variable Output Values over the Lower
Limit
VariableName.IF Bit Variable Integral Setting
VariableName.KP Integer Variable Proportional Constant
VariableName.TR Integer Variable Integral Calculus Time
VariableName.TD Integer Variable Differential Calculus Time
VariableName.PA Integer Variable Processing Deadband Range
VariableName.BA Integer Variable Bias (Offset)
VariableName.ST Integer Variable Frequency in Sampling
Other operands are as follows.
S1: Setpoint
S2: Preset Value
S3: Tieback Value (The set value is output when an instruction is disabled)
D1: Output Value
Operand Settings
The following describes the specifiable content of operands S1, S2, S3, and D1 for the PID
instruction. The actual number of steps in the PID instruction depends on the operand
specification method. The following describes how to calculate the number of steps.
Number steps in HP operand + Number of steps in operand S1 + Number of steps in operand
S2 + Number of steps in operand S3 + Number of steps in operand D1 + 5 = Total number of
steps in one instruction
{PID control = 1 step (PID variable in HP operand is fixed to 1 step)} + {Current value = 1
step} + {Setting = 1 step} + {Tieback value [N] = 3 steps} + {Output = 1 step} + {5 steps} =
12 steps
The last 5 steps are included in the PID instruction. Be sure to add 5 steps.
Operand Settings
The following describes the specifiable content of Operands (S1, S2, S3, and D1) in the PID
instruction.
Basic Function
The PID instruction compares the measured values (current values) and the set values (target
values). The measured values are based on analog input and temperature input. The
instruction then adjusts the output values to even the gap between the current values and the
target values. You can combine P control, I control, and D control in PID control. Specify
each below mentioned parameter to be controlled.
The output value calculated by the PID control is generally expressed by the following
formula.
∫0 ( E ) dt
t
CV = KP(E+Reset + Rate d(E) )
dt
KP: Proportional constant
E: Deviation (SP-PV or PV-SP)
Reset:Integral Cycles
Rate: Differential calculus time
Using the [Tuning] tab that will be described later, adjust the sampling time to reduce the
effect of noise on deviation. The following formula shows the result of filtering on the
deviation.
T
EFn = EFn-1 + TLoop (En−EFn-1)
Filter
EF : Result of filtering on deviation
Tloop: Frequency data
TFilter:Sampling Frequency
E: Deviation (SP-PV or PV-SP)
Function Summary
When the PID instruction is enabled, the PID is calculated and the operation volume is
adjusted and output (calculated). When the instruction is disabled as below, it outputs the
Tieback value. The Tieback value is specified in S3. Input the constant 0 if no output is
necessary when the instruction is disabled.
To use the PID instruction in a logic program, allocate variables to the PID variable operand
(HP) and the integer variable operands (S1, S2, S3 and D1) first.
PID Variable
When you allocate a variable to the PID instruction operand HP, a member is automatically
allocated to the variable.
PID Variable
PID Variable Variables Settings Description
VariableName.Q Bit Variable PID Instruction Processing Completion Flag
VariableName.PF Bit Variable Processing Deadband Range Flag
VariableName.UO Bit Variable Output Values over the Upper Limit
VariableName.TO Bit Variable Output Values over the Lower Limit
VariableName.IF Bit Variable Integral Setting
VariableName.KP Integer Variable Proportional Constant
VariableName.TR Integer Variable Integral Calculus Time
VariableName.TD Integer Variable Differential Calculus Time
VariableName.PA Integer Variable Processing Deadband Range
VariableName.BA Integer Variable Bias (Offset)
VariableName.ST Integer Variable Frequency in Sampling
• Values assigned to a proportional constant, integral calculus time, and differential calculus
time look different when input in "PID Monitor" from when input to each of the PID
variables in a program. When inputting the values in the program, multiply the values by
1000 for the proportional constant, the integral calculus times and the differential calculus
times.
For example Proportional constant 0.1 x 1000 -> 100 -> 100
(Notes)
All the PID variables are keep-type variables. Up to 8 PID instructions are allowed per
project.
1 PID instruction can be specified for 1 PID variable.
Explanation of the PID Variable Members
1 Bit
Output Sampling
Target Value
PID Processing
Deadband Range
PID Processing
Deadband Range Flag
(VariableName.PF) Sampling
VariableName.UO
VariableName.TO
Sampling
When the value is within the range, the VariableName.TO will not turn ON.
Settings range from 0.01 to 1000.00 Internal data are integer variables. Decimals cannot be
used.
To set 0.01, specify 0.01 x 1000 = 10.
Target Value
Deviation
Residual Deviation
Sampling
(Note) In the proportional control, the operation volume will be the maximum 100% if the
current value is smaller than the target value. The operation value will be 0% if the target
value and the current value match (no deviation).
Operation Volume*
ON
100%
OFF
0
Settings range from 0.100 to 3000.000 Internal data are integer variables. Decimals cannot
be used.
To set 0.1, specify 0.1 x 1000 = 100.
Target Value
Sampling
Target Value
Sampling
The setting range 0.00 to 3000.00 internal data becomes integer variables and decimals
become unavailable.
For setting 0.1, use 0.1 x 1000 =100.
Specify the value multiplied by 1000 for the variable name .TD.
Target Value
Sampling
Bias (VariableName.BA)
Sets the bias value (offset). This reduces any residual deviation incurred in the proportional
control.
Residual Deviation
When the bias value is not
specified
Sampling
Operation Volume*
When the bias value is specified
100%
Integral Setting
Specifies the upper and lower limits for the integral settings.
Control Setting
Loop Update Time: Sets the temporal frequency of obtaining S2 data. The frequency of
obtaining data is also the frequency of updating the D1 output.
You can use the filtering feature to specify the frequency. The sampling frequency must be
larger than the frequency of obtaining data.
Settings range from 10 to 65535 ms
Action:
Direct (D1−D2)
Used to control the increase in operation volume when the process variable is smaller than
the setpoint. (heating, and so on)
Target Value
Sampling
Reverse (D1−D2)
Used to control the increase in operation volume when the process variable is larger than the
setpoint, such as cooling.
Target Value
Sampling
Filter Settings
Specifies the upper and lower limits for the output value. If the value exceeds the range, the
value will be output as either the upper or lower limit. When the value exceeds the range, the
bits above the upper and lower limits (VariableName.UO, VariableName.TO) turn ON.
Settings Range Dependent on the Output Settings Range
Upper Limit Output Settings Range (upper limit) to 32767
Lower Limit Output Settings Range (lower limit) to −32768
Operation
Volume Sampling
Maximum
Temperature
Inclination (R)
R = Variation/t
Variation (%)
Time (minute)
Lost Time (L)
Insert the measured values for maximum temperature slope (R) and lost time (L) in the
following formula to calculate the proportional constant, integral calculus time, and
differential calculus time constants. Assign the calculated values to the values in the PID
monitor window.
"Proportional Constant" = 100/(0.83 . R . L) [%]
"Integral Calculus Time" = 1/(2 . L) [events/min] (formula = unidentified)
"Differential Calculus Time" = 0.5 . L [min]
Operand Settings
The following describes the specifiable content of operands S1 and D1 for the SIN and SINP
instructions.
The actual number of steps in the SIN and SINP instructions depends on the specified
operand. The following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand D1 + 1 = Total number of steps
in one instruction
One final step is required in the total number of steps in the instruction. Be sure to add 1 step.
Operand Settings
The following describes the specifiable content of Operands (S1) and (D1).
When calculating data in a specified array, specify the array with Data [0] or Data [N] (N is
an integer variable).
When operands S1 and D1 specify the entire array, an error will occur even if the variables
are the same type.
(Notes)
When checking the result using system variables, make sure the check takes place after the
instruction has been executed.
When checking the state after multiple instructions have been executed, system variables will
store the result only of the last processed instruction.
Program Example
SIN
(1) The SIN instruction is executed when the positive transition instruction turns ON. The
SIN instruction calculates the sine of Data_A and stores the result in D1.
When using a normally open instruction, the SIN instruction is always executed as long as
the normally open instruction is ON.
Program Example
SINP
(1) SINP and SIN instructions differ in when they run. In SINP instructions, Even when using
a normally open instruction, the SINP instruction executes only when it detects the
upward transition. Therefore, the SINP instruction is executed only for one scan, even
when the normally open instruction bit remains turn ON.
Operand Settings
The following describes the specifiable content of operands S1 and D1 for the COS and
COSP instructions.
The actual number of steps in the COS and COSP instructions depends on the specified
operand. The following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand D1 + 1 = Total number of steps
in one instruction
One final step is required in the total number of steps in the instruction. Be sure to add 1 step.
Operand Settings
The following describes the specifiable content of operands S1 and D1 for the COS and
COSP instructions.
When calculating data in a specified array, specify the array with Data [0] or Data [N] (N is
an integer variable).
When operands S1 and D1 specify the entire array, an error will occur even if the specified
variables are the same type.
(Notes)
When checking the result using system variables, make sure the check takes place after the
instruction has been executed.
When checking the state after multiple instructions have been executed, system variables will
store the result only of the last processed instruction.
Program Example
COS
(1) The COS instruction is executed when the positive transition instruction turns ON. The
COS instruction calculates the cosine of Data_A and stores the result in D1.
When using a normally open instruction, the COS instruction is always executed as long
as the normally open instruction bit is ON.
Program Example
COSP
(1) The COSP and COS instructions differ in when they run. In COSP instructions, Even
when using a normally open instruction, the COSP instruction executes only when it
detects the upward transition. Therefore, the COSP instruction is executed only for one
scan, even when the normally open instruction bit remains ON.
Operand Settings
The following describes the specifiable content of operands S1 and D1 for the TAN and
TANP instructions.
The actual number of steps in the TAN and TANP instructions depends on the specified
operand. The following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand D1 + 1 = Total number of steps
in one instruction
One last step is included in the instruction. Be sure to add that one step.
Operand Settings
The following describes the specifiable content of operands S1 and D1 for the TAN and
TANP instructions
.
Name Type Condition Number of Possible: O
Steps in the Not
Operand Possible: X
External Bit ⎯ ⎯ X
Device Word Specify by words only ⎯ X
Address (Example: [PLC1]D0000)
Internal Bit ⎯ ⎯ X
Address Word Specify by words only ⎯ X
(Example:
[#INTERNAL]LS0000)
Symbol Bit ⎯ ⎯ X
Word ⎯ ⎯ X
Variable Bit Specify a bit ⎯ X
Format Specify bit array ([constant]) ⎯ X
Specify bit array ([variable]) ⎯ X
Integer Arrays and modifiers are not ⎯ X
(not including I/O) specified
Specify integer ⎯ X
variable[constant]
Specify integer variable ⎯ X
[Variable]
Specify integer variable[constant/ ⎯ X
variable]
.B/W[constant/variable]
Float Float Variable 1 O
Specify float variable[constant] 2 O
Specify float variable[variable] 3 O
Real Real Variable 1 O
Specify real variable [constant] 2 O
Specify real variable [variable] 3 O
Continued
When calculating data in a specified array, specify the array with Data [0] or Data [N] (N is
an integer variable).
When operands S1 and D1 specify the entire array, an error will occur even if the specified
variables are the same type.
Data_1 Array size = 5
Result Array size = 5
The operand specification in the left diagram results in an
error.
(Notes)
When checking the result using system variables, make sure the check takes place after the
instruction has been executed.
When checking the state after multiple instructions have been executed, system variables will
store the result only of the last processed instruction.
Program Example
TAN
(1) The TAN instruction is executed when the positive transition instruction turns ON. The
TAN instruction calculates the tangent of Data_A and stores the result in D1.
When using a normally open instruction, the TAN instruction is always executed as long
as the normally open instruction bit is ON.
Program Example
TANP
(1) TANP and TAN instructions differ in when they run. In TANP instructions, even when
using a normally open instruction, the TANP instruction executes only when it detects the
upward transition. Therefore, the TANP instruction is executed only for one scan, even
when the normally open instruction bit remains ON.
Operand Settings
The following describes the specifiable content of operands S1 and D1 for the ASIN and
ASINP instructions.
The actual number of steps in the ASIN and ASINP instructions depends on the specified
operand. The following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand D1 + 1 = Total number of steps
in one instruction
One last step is included in the instruction. Be sure to add that one step.
Operand Settings
The following describes the specifiable content of operands S1 and D1 for the ASIN and
ASINP instructions.
When calculating data in a specified array, specify the array with Data [0] or Data [N] (N is
an integer variable).
When operands S1 and D1 specify the entire array, an error will occur even if the specified
variables are the same type.
(Notes)
When checking the result using system variables, make sure the check takes place after the
instruction has been executed.
When checking the state after multiple instructions have been executed, system variables will
store the result only of the last processed instruction.
Program Example
ASIN
(1) The ASIN instruction is executed when the positive transition instruction turns ON. The
ASIN instruction calculates the arc sine of Data_A and stores the result in D1.
When using a normally open instruction, the ASIN instruction is always executed as long
as the normally open instruction bit is ON.
Program Example
ASINP
(1) ASINP and ASIN instructions differ in when they run. In ASINP instructions, even when
using a normally open instruction, only the positive transition is detected and the ASINP
instruction is executed. Therefore, the ASINP instruction is executed only for one scan,
even when the normally open instruction bit remains ON.
Operand Settings
The following describes the specifiable content of operands S1 and D1 for the ACOS and
ACOSP instructions.
The actual number of steps in the ACOS and ACOSP instructions depends on the specified
operand. The following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand D1 + 1 = Total number of steps
in one instruction
One last step is included in the instruction. Be sure to add that one step.
Operand Settings
The following describes the specifiable content of operands S1 and D1 for the ACOS and
ACOSP instructions.
When calculating data in a specified array, specify the array with Data [0] or Data [N] (N is
an integer variable).
When operands S1 and D1 specify the entire array, an error will occur even if the specified
variables are the same type.
(Notes)
When checking the result using system variables, make sure the check takes place after the
instruction has been executed.
When checking the state after multiple instructions have been executed, system variables will
store the result only of the last processed instruction.
Program Example
ACOS
(1) The ACOS instruction is executed when the positive transition instruction turns ON. The
ACOS instruction calculates the arc cosine of Data_A and stores the result in D1.
When using a normally open instruction, the ACOS instruction is always executed as long
as the normally open instruction bit ON.
Program Example
ACOSP
(1) ACOSP and ACOS instructions differ in when they run. In ACOSP instructions, even
when using a normally open instruction, the ACOSP instruction executes only when it
detects the upward transition. Therefore, the ACOSP instruction is executed only for one
scan, even when the normally open instruction bit remains ON.
Operand Settings
The following describes the specifiable content of operands S1 and D1 for the ATAN and
ATANP instructions.
The actual number of steps in the ATAN and ATANP instructions depends on the specified
operand. The following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand D1 + 1 = Total number of steps
in one instruction
One last step is included in the instruction. Be sure to add that one step.
Operand Settings
The following describes the specifiable content of operands S1 and D1 for the ATAN and
ATANP instructions.
When calculating data in a specified array, specify the array with Data [0] or Data [N] (N is
an integer variable).
When operands S1 and D1 specify the entire array, an error will occur even if the specified
variables are the same type.
(Notes)
When checking the result using system variables, make sure the check takes place after the
instruction has been executed.
When checking the state after multiple instructions have been executed, system variables will
store the result only of the last processed instruction.
Program Example
ATAN
(1) The ATAN instruction will be executed when the positive transition instruction turns ON.
The ATAN instruction calculates the arc tangent of Data_A and stores the result in D1.
When using a normally open instruction, the ATAN instruction is always executed as long
as the normally open instruction bit remains ON.
Program Example
ATANP
(1) ATANP and ATAN instructions differ in when they run. In ATANP instructions, even
when using a normally open instruction, the ATANP instruction executes only when it
detects the upward transition. Therefore, the ATANP instruction is executed only for one
scan, even when the normally open instruction bit remains ON.
Operand Settings
The following describes the specifiable content of operands S1 and D1 for the COT and
COTP instructions.
The actual number of steps in the COT and COTP instructions depends on the specified
operand. The following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand D1 + 1 = Total number of steps
in one instruction
One last step is included in the instruction. Be sure to add that one step.
Operand Settings
The following describes the specifiable content of operands S1 and D1 for the COT and
COTP instructions.
When calculating data in a specified array, specify the array with Data [0] or Data [N] (N is
an integer variable).
When operands S1 and D1 specify the entire array, an error will occur even if the specified
variables are the same type.
(Notes)
When checking the result using system variables, make sure the check takes place after the
instruction has been executed.
When checking the state after multiple instructions have been executed, system variables will
store the result only of the last processed instruction.
Program Example
COT
(1) The COT instruction is executed when the positive transition instruction turns ON. The
COT instruction calculates the cotangent of Data_A and stores the result in D1.
When using a normally open instruction, the COT instruction is always executed as long
as the normally open instruction bit is ON.
Program Example
COTP
(1) COTP and COT instructions differ in when they run. In COTP instructions, even when
using a normally open instruction, the COTP instruction executes only when it detects the
upward transition. Therefore, the COTP instruction is executed only for one scan, even
when the normally open instruction bit remains ON.
Operand Settings
The following describes the specifiable content of operands S1 and D1 for the EXP and
EXPP instructions.
The actual number of steps in the EXP and EXPP instructions depends on the specified
operand. The following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand D1 + 1 = Total number of steps
in one instruction
One last step is included in the instruction. Be sure to add that one step.
Operand Settings
The following describes the specifiable content of operands S1 and D1 for the EXP and
EXPP instructions.
The EXP and EXPP instructions are always conducted. When using the EXP and EXPP
instructions, an error will occur if the variables specified in operands S1 and D1 are not the
same type. Specify the same variable type in operands S1 and D1.
Refer to the following for specifying a constant.
When calculating data in a specified array, specify the array with Data [0] or Data [N] (N is
an integer variable).
When operands S1 and D1 specify the entire array, an error will occur even if the specified
variables are the same type.
(Notes)
When checking the result using system variables, make sure the check takes place after the
instruction has been executed.
When checking the state after multiple instructions have been executed, system variables will
store the result only of the last processed instruction.
Program Example
EXP
(1) The EXP instruction is executed when the positive transition instruction turns ON. The
EXP instruction calculates the exponent of Data_A and stores the result in D1.
When using a normally open instruction, the EXP instruction is always executed as long
as the normally open instruction bit ON.
Program Example
EXPP
(1) The EXPP and EXP instructions differ in when they run. In EXPP instructions, even when
using a normally open instruction, the EXPP instruction executes only when it detects the
upward transition. Therefore, the EXPP instruction is executed only for one scan, even
when the normally open instruction bit remains ON.
Operand Settings
The following describes the specifiable content of operands S1 and D1 for the LN and LNP
instructions.
The actual number of steps in the LN and LNP instructions depends on the specified operand.
The following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand D1 + 1 = Total number of steps
in one instruction
One last step is included in the instruction. Be sure to add that one step.
Operand Settings
The following describes the specifiable content of operands S1 and D1 for the LN and LNP
instructions
.
Name Type Condition Number of Possible: O
Steps in the Not
Operand Possible: X
External Bit ⎯ ⎯ X
Device Word Specify by words only ⎯ X
Address (Example: [PLC1]D0000)
Internal Bit ⎯ ⎯ X
Address Word Specify by words only ⎯ X
(Example:
[#INTERNAL]LS0000)
Symbol Bit ⎯ ⎯ X
Word ⎯ ⎯ X
Variable Bit Specify a bit ⎯ X
Format Specify bit array ([constant]) ⎯ X
Specify bit array ([variable]) ⎯ X
Integer Arrays and modifiers are not ⎯ X
(not including I/O) specified
Specify integer ⎯ X
variable[constant]
Specify integer variable ⎯ X
[Variable]
Specify integer ⎯ X
variable[constant/variable]
.B/W[constant/variable]
Float Float Variable 1 O
Specify float variable[constant] 2 O
Specify float variable[variable] 3 O
Real Real Variable 1 O
Specify real variable [constant] 2 O
Specify real variable [variable] 3 O
Continued
When calculating data in a specified array, specify the array with Data [0] or Data [N] (N is
an integer variable).
When operands S1 and D1 specify the entire array, an error will occur even if the specified
variables are the same type.
(Notes)
When checking the result using system variables, make sure the check takes place after the
instruction has been executed.
When checking the state after multiple instructions have been executed, system variables will
store the result only of the last processed instruction.
Program Example
LN
(1) The LN instruction is executed when the positive transition instruction turns ON. The LN
instruction calculates the natural logarithmic function of Data_A and stores the result in
D1.
When using a normally open instruction, the LN instruction is always executed as long as
the normally open instruction bit is ON.
Program Example
LNP
(1) The LNP and LN instructions differ in when they run. In the LNP instructions, even when
using a normally open instruction, the LNP instruction executes only when it detects the
upward transition. Therefore, the LNP instruction is executed only for one scan, even
when the normally open instruction bit remains ON.
Operand Settings
The following describes the specifiable content of operands S1 and D1 for the LG10 and
LG10P instructions.
The actual number of steps in the LG10 and LG10P instructions depends on the specified
operand. The following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand D1 + 1 = Total number of steps
in one instruction
One last step is included in the instruction. Be sure to add that one step.
Operand Settings
The following describes the specifiable content of operands S1 and D1 for the LG10 and
LG10P instructions.
When calculating data in a specified array, specify the array with Data [0] or Data [N] (N is
an integer variable).
When operands S1 and D1 specify the entire array, an error will occur even if the specified
variables are the same type.
(Notes)
When checking the result using system variables, make sure the check takes place after the
instruction has been executed.
When checking the state after multiple instructions have been executed, system variables will
store the result only of the last processed instruction.
Program Example
LG10
(1) The LG10 instruction is executed when the positive transition instruction turns ON. The
LG10 instruction calculates the common logarithm function of Data_A and stores the
result in D1.
When using a normally open instruction, the LG10 instruction is always executed as long
as normally open instruction bit is ON.
Program Example
LG10P
(1) The LG10P and LG10 instructions differ in when they run. In the LG10P instructions,
even when using a normally open instruction, the LG10P instruction executes only when
it detects the upward transition. Therefore, the LG10P instruction is executed only for one
scan, even when the normally open instruction bit remains ON.
Operand Settings
The following describes the specifiable content of operands S1 and S2 for the EQ instruction.
The actual number of steps in the EQ instruction depends on the specified operand. The
following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand S2 +1 = Total number of steps
in one instruction
One last step is included in the instruction. Be sure to add that one step.
Operand Settings
The following describes the specifiable content of operands S1 and S2 for the EQ instruction.
When comparing data in a specified array (integer variable array) Specify the array using
Data[0] or Data[N] (N indicates an integer variable).
You cannot specify entire arrays for operands S1 or S2. An error will occur even if the
specified array variables are the same type.
Program Example
EQ
Compares integer variables and outputs the result in D1.
(1)Data_A and the operation result are compared to determine whether they are equal. If the
result of the EQ instruction is S1 = S2, the EQ instruction passes power, then the
instruction to the right of the EQ instruction is executed. In the above diagram, it's the
MOV instruction.
GT (>)
Symbols and Features
Ladder Instruction Ladder Symbol Feature Number of
Name Steps
GT Comparison 3 to 9
(Greater Than - Level
Sensitive)
Operand Settings
The following describes the specifiable content of operands S1 and S2 for the GT instruction.
The actual number of steps in the GT instruction depends on the specified operand. The
following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand S2 +1 = Total number of steps
in one instruction
One last step is included in the instruction. Be sure to add that one step.
Operand Settings
The following describes the specifiable content of operands S1 and S2 for the GT instruction.
When comparing data in a specified array (integer variable array) Specify the array using
Data[0] or Data[N] (N indicates an integer variable).
You cannot specify entire arrays for operands S1 or S2. An error will occur even if the
specified array variables are the same type.
Program Example
GT
Compares integer variables and outputs the result in D1.
(1)Data_A and the operation result are compared to determine whether Data_A is greater
than the operation result. If the result of the GT instruction is S1 > S2, the GT instruction
passes power. Then the instruction to the right of the GT instruction is executed. In the
above diagram, it's the MOV instruction.
LT (<)
Symbols and Features
Ladder Instruction Ladder Symbol Feature Number of
Name Steps
LT Comparison 3 to 9
(Less Than -
Level Sensitive)
Operand Settings
The following describes the specifiable content of operands S1 and S2 for the LT instruction.
The actual number of steps in the LT instruction depends on the specified operand. The
following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand S2 +1 = Total number of steps
in one instruction
One last step is included in the instruction. Be sure to add that one step.
Operand Settings
The following describes the specifiable content of operands S1 and S2 for the LT instruction.
When comparing data in a specified array (integer variable array) Specify the array using
Data[0] or Data[N] (N indicates an integer variable).
You cannot specify entire arrays for operands S1 or S2. An error will occur even if the
specified array variables are the same type.
Program Example
LT
Compares integer variables and outputs the result in D1.
(1)Data_A and the operation result are compared to determine whether Data_A is less than
the operation result. If the result of the LT instruction is S1 < S2, the LT instruction passes
power. Then the instruction to the right of the LT instruction is executed. In the above
diagram, it's the MOV instruction.
GE (>=)
Symbols and Features
Ladder Instruction Ladder Symbol Feature Number of
Name Steps
GE Comparison 3 to 9
(Greater Than or Equal To
-
Level Sensitive)
Operand Settings
The following describes the specifiable content of operands S1 and S2 for the GE instruction.
The actual number of steps in the GE instruction depends on the specified operand. The
following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand S2 +1 = Total number of steps
in one instruction
One last step is included in the instruction. Be sure to add that one step.
Operand Settings
The following describes the specifiable content of operands S1 and S2 for the GE instruction.
When comparing data in a specified array (integer variable array) Specify the array using
Data[0] or Data[N] (N indicates an integer variable).
You cannot specify entire arrays for operands S1 or S2. An error will occur even if the
specified array variables are the same type.
Data_1 Array size = 5
Data_2 Array Size = 5
The operand specification in the left diagram results in an
error.
Program Example
GE
Compares integer variables and outputs the result in D1.
(1)Data_A and the operation result are compared to determine whether Data_A is greater
than or equal the operation result. If the result of the GE instruction is S1 >= S2, the GE
instruction passes power. Then the instruction to the right of the GE instruction is
executed. In the above diagram, it's the MOV instruction.
LE (<=)
Symbols and Features
Ladder Instruction Ladder Symbol Feature Number of
Name Steps
LE Comparison 3 to 9
(Less Than or Equal To -
Level Sensitive)
Operand Settings
The following describes the specifiable content of operands S1 and S2 for the LE instruction.
The actual number of steps in the LE instruction depends on the specified operand. The
following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand S2 +1 = Total number of steps
in one instruction
One last step is included in the instruction. Be sure to add that one step.
Operand Settings
The following describes the specifiable content of the S1 and S2 operands for the LE
instruction.
Explanation of LE Instructions
The LE instruction is a compare instruction. The LE instruction compares S1 with S2. If the
result of the comparison is S1 <= S2, the instruction passes power.
Be careful when comparing real values. For example, if the operand is 2.000000000001, it is
not less than or equal to 2. When using the LE instruction, an error will occur if the variables
specified in operands S1 and S2 are not the same type. Specify the same variable type in
operands S1 and S2.
Refer to the following for specifying a constant.
When comparing data in a specified array (integer variable array) Specify the array using
Data[0] or Data[N] (N indicates an integer variable).
You cannot specify entire arrays for operands S1 or S2. An error will occur even if the
specified array variables are the same type.
Program Example
LE
Compares integer variables and outputs the result in D1.
(1)Data_A and the operation result are compared to determine whether Data_A is less than
or equal to the operation result. If the result of the LE instruction is S1 <= S2, the LE
instruction passes power. Then the instruction to the right of the LE instruction is
executed. In the above diagram, it's the MOV instruction.
NE (<>)
Symbols and Features
Ladder Instruction Ladder Symbol Feature Number of
Name Steps
NE Comparison 3 to 9
(Not Equal - Level
Sensitive)
Operand Settings
The following describes the specifiable content of operands S1 and S2 for the NE instruction.
The actual number of steps in the NE instruction depends on the specified operand. The
following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand S2 +1 = Total number of steps
in one instruction
One last step is included in the instruction. Be sure to add that one step.
Operand Settings
The following describes the specifiable content of operands S1 and S2 for the NE instruction.
Explanation of NE Instruction
The NE instruction is a compare instruction. The NE instruction compares S1 with S2. If the
result of the comparison is S1 <> S2, the instruction passes power.
Be careful when comparing real values. For example, if the operand value is
2.000000000001, it is not equal to 2. When using the NE instruction, an error will occur if
the variables specified in operands S1 and S2 are not the same type. Specify the same
variable type in operands S1 and S2.
Refer to the following for specifying a constant.
When comparing data in a specified array (integer variable array) Specify the array using
Data[0] or Data[N] (N indicates an integer variable).
You cannot specify entire arrays for operands S1 or S2. An error will occur even if the
specified array variables are the same type.
Program Example
NE
Compares integer variables and outputs the result in D1.
(1)Data_A and the operation result are compared to determine whether Data_A is not equal
to the operation result. If the result of the NE instruction is S1 <> S2, the NE instruction
passes power. Then the instruction to the right of the NE instruction is executed. In the
above diagram, it's the MOV instruction.
Operand Settings
The following shows the configurable conditions for Operands (S1, S2) in the JEQ
instruction.
The actual number of steps in the JEQ instruction depends on the specified operands. The
following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand S2 +1 = Total number of steps
in one instruction
One last step is included in the instruction. Be sure to add that one step.
Time Variable
Time Variable Variables Settings Description
VariableName.HR Integer Variable Hours are input in BCD.
VariableName.MIN Integer Variable Minutes are input in BCD.
VariableName.SEC Integer Variable Seconds are input in BCD.
Operand Settings
The following describes the specifiable content of Operands (S1, S2) in the JEQ instruction.
Program Example
JEQ
Compares the time variables and determines the result with the coil.
(1) Compares Data_1 to the current time to determine whether they are equal. If the result is
S1 = S2, the instruction passes power and an instruction to the right of the JEQ instruction
is executed. In the above chart, the OUT instruction to the right of the JEQ instruction is
executed.
JGT (>)
Symbols and Features
Ladder Instruction Ladder Symbol Feature Number of
Name Steps
JGT Time 3
(> Level Sensitive) Compare
Operand Settings
The following shows the configurable conditions for Operands (S1, S2) in the JGT
instruction.
The actual number of steps in the JGT instruction depends on the specified operands. The
following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand S2 +1 = Total number of steps
in one instruction
One last step is included in the instruction. Be sure to add that one step.
Operand Settings
The following shows the configurable conditions for Operands (S1, S2) in the JGT
instruction.
Program Example
JGT
Compares the time variables and determines the result with the coil.
(1) Compares Data_1 to the current time to determine whether Data_1 is greater. If the result
is S1 > S2, the instruction passes power and the instruction to the right of the JGT
instruction is executed. In the above chart, the OUT instruction to the right of the JGT
instruction is executed.
JLT (<)
Symbols and Features
Ladder Instruction Ladder Symbol Feature Number of
Name Steps
JLT Time 3
(< Level Sensitive) Compare
Operand Settings
The following shows the configurable conditions for Operands (S1, S2) in the JLT
instruction.
The actual number of steps in the JLT instruction depends on the specified operands. The
following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand S2 +1 = Total number of steps
in one instruction
One last step is included in the instruction. Be sure to add that one step.
Operand Settings
The following describes the specifiable content of Operands (S1, S2) in the JLT instruction.
Program Example
JLT
Compares the time variables and determines the result with the coil.
(1) Compares Data_1 to the current time to determine whether Data_1 is less. If the result is
S1 < S2, the instruction passes power and the instruction to the right of the JLT instruction
is executed. In the above chart, the OUT instruction to the right of the JLT instruction is
executed.
JGE (>=)
Symbols and Features
Ladder Instruction Name Ladder Symbol Feature Number of Steps
JGE Time Compare 3
(>= Level Sensitive)
Operand Settings
The following shows the configurable conditions for Operands (S1, S2) in the JGE
instruction.
The actual number of steps in the JGE instruction depends on the specified operands. The
following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand S2 +1 = Total number of steps
in one instruction
One last step is included in the instruction. Be sure to add that one step.
Operand Settings
The following describes the specifiable content of Operands (S1, S2) in the JGE instruction.
Program Example
JGE
Compares the time variables and determines the result with the coil.
(1) Compares Data_1 to the current time to determine whether Data_1 is greater or equal. If
the result is S1 >= S2, the instruction passes power and the instruction to the right of the
JGE instruction is executed. In the above chart, the OUT instruction to the right of the
JGE instruction is executed.
JLE (<=)
Symbols and Features
Ladder Instruction Ladder Symbol Feature Number of
Name Steps
JLE Time 3
(<= Level Sensitive) Compare
Operand Settings
The following shows the configurable conditions for Operands (S1, S2) in the JLE
instruction.
The actual number of steps in the JLE instruction depends on the specified operands. The
following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand S2 +1 = Total number of steps
in one instruction
One last step is included in the instruction. Be sure to add that one step.
Operand Settings
The following describes the specifiable content of Operands (S1, S2) in the JLE instruction.
Program Example
JLE
Compares the time variables and determines the result with the coil.
(1) Compares Data_1 to the current time to determine whether Data_1 is less or equal. If the
result is S1 <= S2, the instruction passes power and the instruction to the right of the JLE
instruction is executed. In the above chart, the OUT instruction to the right of the JLE
instruction is executed.
JNE (<>)
Symbols and Features
Ladder Instruction Ladder Symbol Feature Number of
Name Steps
JNE Time 3
(<> Level Sensitive) Compare
Operand Settings
The following shows the configurable conditions for Operands (S1, S2) in the JNE
instruction.
The actual number of steps in the JNE instruction depends on the specified operands. The
following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand S2 +1 = Total number of steps
in one instruction
One last step is included in the instruction. Be sure to add that one step.
Operand Settings
The following describes the specifiable content of Operands (S1, S2) in the JNE instruction.
Program Example
JNE
Compares the time variables and determines the result with the coil.
(1) Compares Data_1 to the current time to determine whether they are unequal. If the result
is S1 <> S2, the instruction passes power and the instruction to the right of the JNE
instruction is executed. In the above chart, the OUT instruction to the right of the JNE
instruction is executed.
Operand Settings
The following shows the configurable conditions for Operands (S1, S2) in the NEQ
instruction.
The actual number of steps in the NEQ instruction depends on the specified operands. The
following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand S2 +1 = Total number of steps
in one instruction
One last step is included in the instruction. Be sure to add that one step.
Operand Settings
The following describes the specifiable content of Operands (S1, S2) in the NEQ instruction.
Program Example
NEQ
Compares the date variables and determines the result with the coil.
(1) Compares Data_1 to the current date to determine whether they are equal. If the result is
S1 = S2, the instruction passes power and the instruction to the right of the NEQ
instruction is executed. In the above chart, the OUT instruction to the right of the NEQ
instruction is executed.
NGT (>)
Symbols and Features
Ladder Instruction Ladder Symbol Feature Number of
Name Steps
NGT Date 3
(> Level Sensitive) Compare
Operand Settings
The following shows the configurable conditions for Operands (S1, S2) in the NGT
instruction.
The actual number of steps in the NGT instruction depends on the specified operands. The
following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand S2 +1 = Total number of steps
in one instruction
One last step is included in the instruction. Be sure to add that one step.
Operand Settings
The following describes the specifiable content of Operands (S1, S2) in the NGT instruction.
Program Example
NGT
Compares the date variables and determines the result with the coil.
(1) Compares Data_1 to the current date to determine whether Data_1 is greater. If the result
is S1 > S2, the instruction passes power and the instruction to the right of the NGT
instruction is executed. In the above chart, the OUT instruction to the right of the NGT
instruction is executed.
NLT (<)
Symbols and Features
Ladder Instruction Ladder Symbol Feature Number of
Name Steps
NLT Date 3
(< Level Sensitive) Compare
Operand Settings
The following shows the configurable conditions for Operands (S1, S2) in the NLT
instruction.
The actual number of steps in the NLT instruction depends on the specified operands. The
following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand S2 +1 = Total number of steps
in one instruction
One last step is included in the instruction. Be sure to add that one step.
Operand Settings
The following describes the specifiable content of Operands (S1, S2) in the NLT instruction.
Program Example
NLT
Compares the date variables and determines the result with the coil.
(1) Compares Data_1 to the current date to determine whether Data_1 is less. If the result is
S1 < S2, the instruction passes power and the instruction to the right of the NLT
instruction is executed. In the above chart, the OUT instruction to the right of the NLT
instruction is executed.
NGE (>=)
Symbols and Features
Ladder Instruction Ladder Symbol Feature Number of
Name Steps
NGE Date 3
(>= Level Sensitive) Compare
Operand Settings
The following shows the configurable conditions for Operands (S1, S2) in the NGE
instruction.
The actual number of steps in the NGE instruction depends on the specified operands. The
following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand S2 +1 = Total number of steps
in one instruction
One last step is included in the instruction. Be sure to add that one step.
Operand Settings
The following describes the specifiable content of Operands (S1, S2) in the NGE instruction.
Program Example
NGE
Compares the date variables and determines the result with the coil.
(1) Compares Data_1 to the current date to determine whether Data_1 is greater or equal. If the
result is S1 >= S2, the instruction passes power and the instruction to the right of the NGE
instruction is executed. In the above chart, the OUT instruction to the right of the NGE
instruction is executed.
NLE (<=)
Symbols and Features
Ladder Instruction Ladder Symbol Feature Number of
Name Steps
NLE Date 3
(<= Level Sensitive) Compare
Operand Settings
The following shows the configurable conditions for Operands (S1, S2) in the NLE
instruction.
The actual number of steps in the NLE instruction depends on the specified operands. The
following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand S2 +1 = Total number of steps
in one instruction
One last step is included in the instruction. Be sure to add that one step.
Date Variable
Date Variable Variables Settings Description
VariableName.YR Integer Variable The year is input in BCD.
VariableName.MO Integer Variable The month is input in BCD.
VariableName.DAY Integer Variable The day is input in BCD.
Operand Settings
The following describes the specifiable content of Operands (S1, S2) in the NLE instruction.
Program Example
NLE
Compares the date variables and determines the result with the coil.
(1) Compares Data_1 to the current date to determine whether Data_1 is less or equal. If the
result is S1<= S2, the instruction passes power and the instruction to the right of the NLE
instruction is executed. In the above chart, the OUT instruction to the right of the NLE
instruction is executed.
NNE (<>)
Symbols and Features
Ladder Instruction Ladder Symbol Feature Number of
Name Steps
NNE Date 3
(<> Level Sensitive) Compare
Operand Settings
The following shows the configurable conditions for Operands (S1, S2) in the NNE
instruction.
The actual number of steps in the NNE instruction depends on the specified operands. The
following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand S2 +1 = Total number of steps
in one instruction
One last step is included in the instruction. Be sure to add that one step.
Date Variable
Date Variable Variables Settings Description
VariableName.YR Integer Variable The year is input in BCD
VariableName.MO Integer Variable The month is input in BCD
VariableName.DAY Integer Variable The day is input in BCD
Operand Settings
The following describes the specifiable content of Operands (S1, S2) in the NNE instruction.
Program Example
NNE
Compares the date variables and determines the result with the coil.
(1) Compares Data_1 to the current date to determine whether they are unequal. If the result
is S1 <> S2, the instruction passes power and the instruction to the right of the NNE
instruction is executed. In the above chart, the OUT instruction to the right of the NNE
instruction is executed.
Operand Settings
The following shows the configurable conditions for Operands (S1, D1) in the BCD/BCDP
instructions.
The actual number of steps in the BCD/BCDP instructions depends on the specified
operands. The following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand D1 + 1 = Total number of steps
in one instruction
Example:Calculate the number of steps in BCD/BCDP instructions (for the number of steps
in an operand, refer to the operand settings in the next section.)
One last step is included in the instruction. Be sure to add that one step.
Operand Settings
The following describes the specifiable content of Operands (S1, D1) in the BCD/BCDP
instructions.
When operand D1 is an integer variable and you want to input hexadecimal values in
operand S1.
When 0x (zero and lower case x) is input, the following values are interpreted as
hexadecimals.
Operand S1 Integer constant 0xF
Operand D1 Integer variable OUT2
When converting data in a specified array (integer variable array), specify the array with
Data [0] or Data [N] (N is an integer variable).
When operands S1 and D1 specify the entire array, an error will occur even if the variables
are the same type.
(Notes)
When checking the result using system variables, make sure the check takes place after the
instruction has been executed.
When checking the state after multiple instructions have been executed, system variables will
store the result only of the last processed instruction.
Program Example
BCD
Converts a constant to binary coded decimal and stores it in the result data.
When the positive transition instruction turns ON, the BCD instruction will be executed.
When the BCD instruction is executed, 10 (1010 in binary) is converted to a binary coded
decimal and the binary code 0001 0000 <F3> is stored in D1. When using a normally
open instruction, the BCD instruction is always executed as long as the normally open
instruction variable remains ON.
Program Example
BCDP
(1) The BCDP and BCD instructions have different ways of detecting when to execute. In the
BCDP instruction, only the upward transition is detected and the BCDP instruction is
executed even when using a normally open instruction. Even if the normally open
instruction variable remains ON, the BCDP instruction is executed only once (for 1 scan).
Bit Position
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Data_B
1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1
Operand Settings
The following shows the configurable conditions for Operands (S1, D1) in the BIN/BINP
instructions.
The actual number of steps in the BIN/BINP instructions depends on the specified operands.
The following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand D1 + 1 = Total number of steps
in one instruction
Operand Settings
The following shows the configurable conditions for Operands (S1, D1) in the BIN/BINP
instructions.
When operand D1 is an integer variable and you want to input hexadecimal values in
operand S1.
When 0x (zero and lower case x) is input, the following values are interpreted as
hexadecimals.
Operand S1 Integer constant 0xF
Operand D1 Integer variable OUT2
When converting data in a specified array (integer variable array), specify the array with
Data [0] or Data [N] (N is an integer variable).
When operands S1 and D1 specify the entire array, an error will occur even if the variables
are the same type.
(Notes)
When checking the result using system variables, make sure the check takes place after the
instruction has been executed.
When checking the state after multiple instructions have been executed, system variables will
store the result only of the last processed instruction.
Program Example
BIN
Converts a constant from BCD to binary and stores the converted value in the result data.
(1) When the positive transition instruction turns ON, the BIN instruction will be executed.
When the BIN instruction is executed, 0001 0000 (10 in hexadecimal) is converted to
binary and the value 1010 is stored in D1. When using a normally open instruction, the
BIN instruction is always executed as long as the normally open instruction variable
remains ON.
Program Example
BINP
(1) The BINP and BIN instructions have different ways of detecting when to execute. In the
BINP instruction, only the upward transition is detected and the BINP instruction is
executed even when using a normally open instruction. Even if the normally open
instruction variable remains ON, the BINP instruction is executed only once (for 1 scan).
Bit Position
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Data_B
0 0 0 0 0 1 0 1 1 1 1 1 0 1 0 1 1 1 1 0 0 0 0 0 1 1 1 1 1 1 1 1
ENCO/ENCOP (Encode)
Symbols and Features
Ladder Instruction Ladder Symbol Feature Number of
Name Steps
ENCO Data Convert 3 to 7
(Encode -
Level Sensitive)
Operand Settings
The following shows the configurable conditions for Operands (S1, D1) in the ENCO/
ENCOP instructions.
The actual number of steps in the ENCO/ENCOP instructions depends on the specified
operands. The following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand D1 + 1 = Total number of steps
in one instruction
One final step is required in the total number of steps in the instruction. Be sure to add 1 step.
Operand Settings
The following shows the configurable conditions for Operands (S1, D1) in the ENCO/
ENCOP instructions.
When operand D1 is an integer variable and you want to input hexadecimal values in
operand S1.
When 0x (zero and lower case "x") is input, the following values will be interpreted as
hexadecimal values.
Operand S1 Integer constant 0 x 10
Operand D1 Integer variable OUT2
To convert data in a specified array (integer variable array), you can either specify the entire
array with operands S1 and D1, or specify the array elements individually.
(Notes)
When checking the result using system variables, make sure the check takes place after the
instruction has been executed.
When checking the state after multiple instructions have been executed, system variables will
store the result only of the last processed instruction.
Program Example
ENCO
Converts a constant and stores the converted value in the result data.
When the positive transition instruction turns ON, the ENCO instruction will be executed.
When the ENCO instruction is executed, 0000 1000 (8 in hexadecimal) is converted and
the binary value 0011 (3) is stored in D1. When using a normally open, the ENCO
instruction is always executed as long as the normally open instruction variable remains
ON.
Program Example
ENCOP
(1) The ENCOP and ENCO instructions have different ways of detecting when to execute. In
the ENCOP instruction, only the upward transition is detected and the ENCOP instruction
is executed even when using a normally open instruction. Even if the normally open
instruction variable remains ON, the ENCOP instruction is executed only once (for 1
scan).
DECO/DECOP (Decode)
Symbols and Features
Ladder Instruction Ladder Symbol Feature Number of
Name Steps
DECO Data Convert 3 to 7
(Decode -
Level Sensitive)
Operand Settings
The following shows the configurable conditions for Operands (S1, D1) in the DECO/
DECOP instructions.
The actual number of steps in the DECO/DECOP instructions depends on the specified
operands. The following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand D1 + 1 = Total number of steps
in one instruction
One final step is required in the total number of steps in the instruction. Be sure to add 1 step.
Operand Settings
The following shows the configurable conditions for Operands (S1, D1) in the DECO/
DECOP instructions.
When operand D1 is an integer variable and you want to input hexadecimal values in
operand S1.
When 0x (zero and lower case "x") is input, the following values are interpreted as
hexadecimal values.
Operand S1 Integer constant 0 x 10
Operand D1 Integer variable OUT2
To convert data in a specified array (integer variable array), you can either specify the entire
array with operands S1 and D1, or specify the array elements individually.
(Notes)
When checking the result using system variables, make sure the check takes place after the
instruction has been executed.
When checking the state after multiple instructions have been executed, system variables will
store the result only of the last processed instruction.
Program Example
DECO
Converts a constant and stores the converted value in the result data.
When the positive transition instruction turns ON, the DECO instruction will be executed.
When the DECO instruction is executed, 0000 1000 (8 in hexadecimal) is converted and
the binary value 1 0000 0000 is stored in D1.
When using a normally open instruction, the DECO instruction is always executed as long
as the normally open instruction variable remains ON.
Program Example
DECOP
(1) The DECOP and DECO instructions have different ways of detecting when to execute. In
the DECOP instruction, only the upward transition is detected and the DECO instruction
is executed even when using a normally open instruction. Even if the normally open
instruction variable remains ON, the DECOP instruction is executed only once (for 1
scan).
Operand Settings
The following shows the configurable conditions for Operands (S1 and D1) in the RAD/
RADP instructions.
The actual number of steps in the RAD/RADP instructions depends on the specified
operands. The following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand D1 + 1 = Total number of steps
in one instruction
One last step is included in the instruction. Be sure to add that one step.
Operand Settings
The following shows the configurable conditions for Operands (S1 and D1) in the RAD/
RADP instructions.
Name Type Condition Number of Possible: O
Steps in the Not
Operand Possible: X
External Bit ⎯ ⎯ X
Device Word Specify by words only ⎯ X
Address (Example: [PLC1]D0000)
Internal Bit ⎯ ⎯ X
Address Word Specify by words only ⎯ X
(Example:
[#INTERNAL]LS0000)
Symbol Bit ⎯ ⎯ X
Word ⎯ ⎯ X
Variable Bit Specify a bit ⎯ X
Format Specify bit array ([constant]) ⎯ X
Specify bit array ([variable]) ⎯ X
Integer Arrays and modifiers are not ⎯ X
(not including I/O) specified
Specify integer ⎯ X
variable[constant]
Specify integer variable ⎯ X
[Variable]
Specify integer ⎯ X
variable[constant/variable]
.B/W[constant/variable]
Float Float Variable 1 O
Specify float variable[constant] 2 O
Specify float variable[variable] 3 O
Real Real Variable 1 O
Specify real variable [constant] 2 O
Specify real variable [variable] 3 O
Timer .PT/.ET only ⎯ X
Counter .PV/ .CV only ⎯ X
Date .YR/ .MO/ .DAY only ⎯ X
Time .HR/ .MIN/ .SEC only ⎯ X
PID .KP/ .TR/ .TD/ .PA/ .BA/ .ST only ⎯ X
Continued
When calculating data in a specified array, specify the array with Data [0] or Data [N] (N is
an integer variable).
When operands S1 and D1 specify the entire array, an error will occur even if the specified
variables are the same type.
(Notes)
When checking the result using system variables, make sure the check takes place after the
instruction has been executed.
When checking the state after multiple instructions have been executed, system variables will
store the result only of the last processed instruction.
Program Example
RAD
(1) When the positive transition instruction turns ON, the RAD instruction will be executed.
When the RAD instruction is executed, the result of Data_A is stored in D1.
When using a normally open, the RAD instruction is always executed as long as the
normally open instruction variable remains ON.
Program Example
RADP
(1) The RADP and RAD instructions have different ways of detecting when to execute. In the
RADP instruction, only the upward transition is detected and the RADP instruction is
executed even when using a normally open instruction. Even if the normally open
instruction variable remains ON, the RADP instruction is executed only once (for 1 scan).
Operand Settings
The following shows the configurable conditions for Operands (S1, D1) in the DEG/DEGP
instructions.
The actual number of steps in the DEG/DEGP instructions depends on the specified
operands. The following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand D1 + 1 = Total number of steps
in one instruction
One last step is included in the instruction. Be sure to add that one step.
Operand Settings
The following shows the configurable conditions for Operands (S1, D1) in the DEG/DEGP
instructions.
When calculating data in a specified array, specify the array with Data [0] or Data [N] (N is
an integer variable).
When operands S1 and D1 specify the entire array, an error will occur even if the specified
variables are the same type.
(Notes)
When checking the result using system variables, make sure the check takes place after the
instruction has been executed.
When checking the state after multiple instructions have been executed, system variables will
store the result only of the last processed instruction.
Program Example
DEG
(1) When the positive transition instruction turns ON, the DEG instruction will be executed.
When the DEG instruction is executed, the result of Data_A is stored in D1.
When using a normally open, the DEG instruction is always executed as long as the
normally open instruction variable remains ON.
Program Example
DEGP
(1) The DEGP and DEG instructions have different ways of detecting when to execute. In the
DEGP instruction, only the upward transition is detected and the DEGP is executed even
when using a normally open instruction. Even if the normally open instruction variable
remains ON, the DEGP instruction is executed only once (for 1 scan).
Operand Settings
The following shows the configurable conditions for Operands (S1, D1) in the SCL/SCLP
instructions.
The actual number of steps in the SCL/SCLP instruction depends on the specified operands.
The following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand D1 + 1 = Total number of steps
in one instruction
The last five steps are included in the instruction. Be sure to add those five steps.
Operand Settings
The following shows the configurable conditions for Operands (S1, D1) in the SCL/SCLP
instructions.
When calculating data in a specified array, specify the array with Data [0] or Data [N] (N is
an integer variable).
When operands S1 and D1 specify the entire array, an error will occur even if the specified
variables are the same type.
(Notes)
When checking the result using system variables, make sure the check takes place after the
instruction has been executed.
When checking the state after multiple instructions have been executed, system variables will
store the result only of the last processed instruction.
(Notes 1) When setting the maximum/minimum input values and output values A and B, you
cannot indirectly designate array elements.
Array Variable Name: Data
Array Size: 5
O Data [0] X Data [N]
(Note 2) When using real or float variables in operands S1 or D1, and using constants to
define the minimum/maximum input and output values in A and B, use "0r" and
"0f" to denote real and float values.
Program Example
SCL
Converting an analog input value (0 to 4095) to a current value in the range of 4 to 20 [ma]
and expressing the value as a decimal.
In the SCL instruction settings in the dialog box, set maximum input value = 0r4095,
minimum input value = 0r0, A = 0r20, and B =0r4.
(1) When the positive transition instruction turns ON, the SCL instruction will be executed.
When the SCL instruction is executed, the result of Data_A is stored in D1.
When using a normally open, the SCL instruction is always executed as long as the
normally open instruction variable remains ON.
Program Example
SCLP
(1) The SCLP and SCL instructions differ by when they run. In the SCLP instructions, even
when using a normally open instruction, only the positive transition is detected and the
SCLP instruction is executed. Therefore, the SCLP instruction is executed only for one
scan, even when the normally open instruction bit remains ON. 31
Operand Settings
The following shows the configurable conditions for Operands (S1, D1) in the I2F/I2FP
instructions.
The actual number of steps in the I2F/I2FP instructions depends on the specified operands.
The following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand D1 + 1 = Total number of steps
in one instruction
One last step is included in the instruction. Be sure to add that one step.
Operand Settings
The following describes the specifiable content of Operand (S1) in the I2F/I2FP instructions.
Operand Settings
The following describes the specifiable content of Operand (D1) in the I2F/I2FP instructions.
When operand S1 is an integer constant and you want to input a hexadecimal value
in operand S1.
When 0x (zero and lower case "x") is input, the following values become hexadecimal
values.
Operand S1 Integer constant 0xFF
Operand D1 Float variable OUT2
(Notes)
When checking the result using system variables, make sure the check takes place after the
instruction has been executed.
When checking the state after multiple instructions have been executed, system variables will
store the result only of the last processed instruction.
Program Example
I2F
(1) When the positive transition instruction turns ON, the I2F instruction will be executed.
When the I2F instruction is executed, the result of the I2F conversion of Data_A is stored
in D1.
When using a normally open instruction, the I2F instruction is always executed as long as
the normally open instruction variable remains ON.
Program Example
I2FP
(1) The I2FP and I2F instructions have different ways of detecting when to execute. In the
I2FP instruction, only the upward transition is detected and the I2FP instruction is
executed even when using a normally open instruction. Even if the normally open
instruction variable remains ON, the I2FP instruction is executed only once (for 1 scan).
Operand Settings
The following shows the configurable conditions of Operands (S1, D1) in the I2R/I2RP
instructions.
The actual number of steps in the I2R/I2RP instructions depends on the specified operands.
The following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand D1 + 1 = Total number of steps
in one instruction
One last step is included in the instruction. Be sure to add that one step.
Operand Settings
The following describes the specifiable content of Operand (S1) in the I2R/I2RP instructions.
Operand Settings
The following describes the specifiable content of Operand (D1) in the I2R/I2RP
instructions.
When operand S1 is an integer constant and you want to input a hexadecimal value
in operand S1.
When 0x (zero and lower case "x") is input, the following values become hexadecimal
values.
Operand S1 Integer constant 0xFF
Operand D1 Real variable OUT2
(Notes)
When checking the result using system variables, make sure the check takes place after the
instruction has been executed.
When checking the state after multiple instructions have been executed, system variables will
store the result only of the last processed instruction.
Program Example
I2R
(1) When the positive transition instruction turns ON, the I2R instruction will be executed.
When the I2R instruction is executed, the result of the I2R conversion of Data_A is stored
in D1.
When using a normally open instruction, the I2R instruction is always executed as long as
the normally open instruction variable remains ON.
Program Example
I2RP
(1) The I2RP and I2R instructions have different ways of detecting when to execute. In the
I2RP instruction, only the upward transition is detected and the I2RP instruction is
executed even when using a normally open instruction. Even if the normally open
instruction variable remains ON, the I2RP instruction is executed only once (for 1 scan).
Operand Settings
The following shows the configurable conditions for Operands (S1, D1) in the F2I/F2IP
instructions.
The actual number of steps in the F2I/F2IP instructions depends on the specified operands.
The following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand D1 + 1 = Total number of steps
in one instruction
One last step is included in the instruction. Be sure to add that one step.
Operand Settings
The following describes the specifiable content of Operand (S1) in the F2I/F2IP instructions.
Operand Settings
The following describes the specifiable content of Operand (D1) in the F2I/F2IP instructions.
(Notes)
When checking the result using system variables, make sure the check takes place after the
instruction has been executed.
When checking the state after multiple instructions have been executed, system variables will
store the result only of the last processed instruction.
Program Example
F2I
(1) When the positive transition instruction turns ON, the F2I instruction will be executed.
When the F2I instruction is executed, the result of the F2I conversion of Data_A is stored
in D1.
When using normally open instruction, the F2I instruction is always executed as long as
the normally open instruction variable remains ON.
Program Example
F2IP
(1) The F2IP and F2I instructions have different ways of detecting when to execute. In the
F2IP instruction, only the upward transition is detected and the F2IP instruction is
executed even when using a normally open instruction. Even if the normally open
instruction variable remains ON, the F2IP instruction is executed only once (for 1 scan).
Operand Settings
The following shows the configurable conditions for Operands (S1, D1) in the F2R/F2RP
instructions.
The actual number of steps in the F2R/F2RP instructions depends on the specified operands.
The following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand D1 + 1 = Total number of steps
in one instruction
One last step is included in the instruction. Be sure to add that one step.
Operand Settings
The following describes the specifiable content of Operand (S1) in the F2R/F2RP
instructions.
Operand Settings
The following describes the specifiable content of Operand (D1) in the F2R/F2RP
instructions.
(Notes)
When checking the result using system variables, make sure the check takes place after the
instruction has been executed.
When checking the state after multiple instructions have been executed, system variables will
store the result only of the last processed instruction.
Program Example
F2R
(1) When the positive transition instruction turns ON, the F2R instruction will be executed.
When the F2R instruction is executed, the result of the F2R conversion of Data_A is
stored in D1.
When using a normally open instruction, the F2R instruction is always executed as long
as the normally open instruction variable remains ON.
Program Example
F2RP
(1) The F2RP and F2R instructions have different ways of detecting when to execute. In the
F2RP instruction, only the upward transition is detected and the F2RP instruction is
executed even when using a normally open instruction. Even if the normally open
instruction variable remains ON, the F2RP instruction is executed only once (for 1 scan).
Operand Settings
The following shows the configurable conditions for Operands (S1, D1) in the R2I/R2IP
instructions.
The actual number of steps in the R2I/R2IP instructions depends on the specified operands.
The following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand D1 + 1 = Total number of steps
in one instruction
One last step is included in the instruction. Be sure to add that one step.
Operand Settings
The following describes the specifiable content of Operand (S1) in the R2I/R2IP instructions.
Operand Settings
The following describes the specifiable content of Operand (D1) in the R2I/R2IP
instructions.
(Notes)
When checking the result using system variables, make sure the check takes place after the
instruction has been executed.
When checking the state after multiple instructions have been executed, system variables will
store the result only of the last processed instruction.
Program Example
R2I
(1) When the positive transition instruction turns ON, the R2I instruction will be executed.
When the R2I instruction is executed, the result of the R2I conversion of Data_A is stored
in D1.
When using a normally open instruction, the R2I instruction is always executed as long as
the normally open instruction variable remains ON.
Program Example
R2IP
(1) The R2IP and R2I instructions have different ways of detecting when to execute. In the
R2IP instruction, only the upward transition is detected and the R2IP instruction is
executed even when using a normally open instruction. Even if the normally open
instruction variable remains ON, the R2IP instruction is executed only once (for 1 scan).
Operand Settings
The following shows the configurable conditions for Operands (S1, D1) in the R2F/R2FP
instructions.
The actual number of steps in the R2F/R2FP instructions depends on the specified operands.
The following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand D1 + 1 = Total number of steps
in one instruction
One last step is included in the instruction. Be sure to add that one step.
Operand Settings
The following describes the specifiable content of Operand (S1) in the R2F/R2FP
instructions.
Operand Settings
The following describes the specifiable content of Operand (D1) in the R2F/R2FP
instructions.
Name Type Condition Number of Possible: O
Steps in the Not
Operand Possible: X
External Bit ⎯ ⎯ X
Device Word Specify by words only ⎯ X
Address (Example: [PLC1]D0000)
Internal Bit ⎯ ⎯ X
Address Word Specify by words only ⎯ X
(Example:
[#INTERNAL]LS0000)
Symbol Bit ⎯ ⎯ X
Word ⎯ ⎯ X
Variable Bit Specify a bit ⎯ X
Format Specify bit array ([constant]) ⎯ X
∗(Notes 1)
Specify bit array ([variable]) ⎯ X
Output only
Integer Arrays and modifiers are not ⎯ X
∗(Notes 1) specified
Specify integer ⎯ X
variable[constant]
Specify integer variable ⎯ X
[Variable]
Specify integer ⎯ X
variable[constant/variable]
.B/W[constant/variable]
Float Float Variable 1 O
Specify float variable[constant] 2 O
Specify float variable[variable] 3 O
Real ⎯ ⎯ X
Specify real variable [constant] ⎯ X
Specify real variable [variable] ⎯ X
Continued
(Notes)
When checking the result using system variables, make sure the check takes place after the
instruction has been executed.
When checking the state after multiple instructions have been executed, system variables will
store the result only of the last processed instruction.
Program Example
R2F
(1) When the positive transition instruction turns ON, the R2F instruction will be executed.
When the R2F instruction is executed, the result of the R2F conversion of Data_A is
stored in D1.
When using a normally open instruction, the R2F instruction is always executed as long
as the normally open instruction variable remains ON.
Program Example
R2FP
(1) The R2FP and R2F instructions have different ways of detecting when to execute. In the
R2FP instruction, only the upward transition is detected and the R2FP instruction is
executed even when using a normally open instruction. Even if the normally open
instruction variable remains ON, the R2FP instruction is executed only once (for 1 scan).
Operand Settings
The following shows the configurable conditions for Operands (S1, D1) in the H2S/H2SP
instructions.
The actual number of steps in the H2S/H2SP instructions depends on the specified operands.
The following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand D1 + 1 = Total number of steps
in one instruction
One last step is included in the instruction. Be sure to add that one step.
Operand Settings
The following describes the specifiable content of Operand (S1) in the H2S/H2SP
instructions.
Operand Settings
The following describes the specifiable content of Operand (D1) in the H2S/H2SP
instructions.
(Notes)
When checking the result using system variables, make sure the check takes place after the
instruction has been executed.
When checking the state after multiple instructions have been executed, system variables will
store the result only of the last processed instruction.
Program Example
H2S
(1) When the positive transition instruction turns ON, the H2S instruction will be executed.
When the H2S instruction is executed, the result of the H2S conversion of Data_A is
stored in D1.
When using a normally open instruction, the H2S instruction is always executed as long
as the normally open instruction variable remains ON.
Program Example
H2SP
(1) The H2SP and H2S instructions have different ways of detecting when to execute. In the
H2SP, only the upward transition is detected and the H2SP instruction is executed even
when using a normally open instruction. Even if the normally open instruction variable
remains ON, the H2SP instruction is executed only once (for 1 scan).
Operand Settings
The following shows the configurable conditions for Operands (S1, D1) in the S2H/S2HP
instructions.
The actual number of steps in the S2H/S2HP instructions depends on the specified operands.
The following describes how to calculate the number of steps.
Number of steps in operand S1 + Number of steps in operand D1 + 1 = Total number of steps
in one instruction
One last step is included in the instruction. Be sure to add that one step.
Operand Settings
The following describes the specifiable content of Operand (S1) in the S2H/S2HP
instructions.
Operand Settings
The following describes the specifiable content of Operand (D1) in the S2H/S2HP
instructions.
(Notes)
When checking the result using system variables, make sure the check takes place after the
instruction has been executed.
When checking the state after multiple instructions have been executed, system variables will
store the result only of the last processed instruction.
Program Example
S2H
(1) When the positive transition instruction turns ON, the S2H instruction will be executed.
When the S2H instruction is executed, the result of the S2H conversion of Data_A is
stored in D1.
When using normally open instruction, the S2H instruction is always executed as long as
the normally open instruction variable remains ON.
Program Example
S2HP
(1) The S2HP and S2H instructions have different ways of detecting when to execute. In the
S2HP instruction, only the upward transition is detected and the S2HP instruction is
executed even when using a normally open instruction. Even if the normally open
instruction variable remains ON, the S2HP instruction is executed only once (for 1 scan).
Operand Settings
The following describes the specifiable content of operands S1 to S10, and D1 to D5 for I/O
Driver Instructions.
The number of steps in I/O Driver instructions depends on the specification method and the
number of operands used. The following describes how to calculate the number of steps.
3 + Number of steps in operand S1 + ... + Number of steps in operand S10 + Number of steps
in operand D1 + ... + Number of steps in operand D5 = Total number of steps in one
instruction
• For more information regarding each operand, please refer to the following.
) "30.7.6 Using I/O Driver Instructions" (page 30-180)
For example,Converting the number of steps in SDOR, SDOW, DGMT and DGMT
(For the number of steps in an operand, refer to the operand settings on the next page.)
SDOR
The first three steps are the number of steps required by all I/O Driver Instructions. Be sure to
add these three steps for I/O Driver Instructions.
GP-Pro EX Reference Manual 29-574
Instruction Descriptions
Operand Settings
The following describes the specifiable content of Operands (S1 to S10 and D1 to D5).
Restrictions
• An error occurs if these instructions are not set up with the CANopen driver, or when
operands are set up with invalid data types.
• You can use up to 15 I/O Driver instructions, which includes other I/O Drivers.
• These instructions can be used in the MAIN and SUB programs only. They cannot be
used in INIT.
• Instructions executed only at startup, such as MOVP, cannot be supported. To execute
instructions only at startup, use PT instructions.