Documente Academic
Documente Profesional
Documente Cultură
Programming Instructions
(LD/FBD/SFC/ST)
Unied Controller
nv Series
Integrated Controller
vseries
1226.3.1009
P
r
o
g
r
a
m
m
i
n
g
I
n
s
t
r
u
c
t
i
o
n
s
(
L
D
/
F
B
D
/
S
F
C
/
S
T
)
U
n
i
e
d
C
o
n
t
r
o
l
l
e
r
n
v
s
e
r
i
e
s
&
I
n
t
e
g
r
a
t
e
d
C
o
n
t
r
o
l
l
e
r
V
s
e
r
i
e
s
Unied Controller nv series & Integrated Controller V series
Programming Instructions (LD/FBD/SFC/ST)
September 30, 2010
Toshiba Corporation 2010
All Right Reserved.
No part of this document may be reproduced
without the prior written consent of Toshiba.
Transmission Distribution & Industrial Systems Company
Microelectronics & System Components Department - System Components Support Group
1, Toshiba-Cho, Fuchu-Shi, Tokyo, 183-8511, Japan Tel +81-42-333-2206
Third Edition
Notes
(1) The technical information provided herein describes typical operations and applications of the product and does not
guarantee the intellectual property rights or other rights of Toshiba or third parties nor allows license of its use.
(2) No part or the whole of this document may be reproduced without prior consent.
(3) The information herein may be changed in the future without notice.
(4) All possible measures have been taken to prepare the information herein. If you have any question, comment, or
nd any error, please contact us.
PROSEC, TOSLINE, TOSDIC, CIEMAC are trademarks or registered trademarks of Toshiba Corporation.
Microsoft, Windows are registered trademarks of Microsoft Corporation in the U.S. and other countries.
DeviceNet is a registered trademark of Open DeviceNet Vender Association Inc.
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
i
Restrictions on Application
This product is not developed/manufactured for use in systems involving devices that
directly affect human life (Note 1). Do not use them for such applications.
To use this product for systems that involve devices that significantly affect human safety
or maintenance of public functions (Note 2), special considerations (Note 3) are required
in system operation, maintenance, and management. In this case, contact one of
Toshiba's sales representatives.
(Note 1) Devices that directly affect human life include the following.
Medical devices such as life supporting devices and devices for surgical units.
(Note 2) Systems that involve devices that significantly affect human safety or
maintenance of public functions include the following.
Main unit control systems of nuclear power plants, safety protection systems of
nuclear facilities, and other systems that are critical for safety
Operation control systems of mass transportation systems and air traffic control
systems
(Note 3) Special considerations indicate sufficient discussions with Toshiba's engineers to
construct a safe system (e.g. employing fool-proof design, fail-safe design, or
redundant design).
Disclaimer
Toshiba shall not be responsible for any damage caused by fire or earthquake, acts of a
third party, other accidents, the user's willful acts or negligence, misuse, or use in
abnormal conditions.
Toshiba shall not be responsible for any incidental damage (loss of business profits,
interruption of business, change or loss of stored memory) caused by use of or being
unable to use this product.
Toshiba shall not be responsible for any damage caused by failure to observe the
information described in the operation manual.
Toshiba shall not be responsible for any damage caused by malfunctions due to
combination with any connected device.
Toshiba shall not be responsible for any damage caused by malfunctions due to
combination with any application program created by the customer.
Note
Use your cellular phone or PHS 1 meter or more away from the product main unit in operation,
various transmission cables, and I/O bus cable. Otherwise, the system may malfunction.
6F8C1226
ii
Creating control programs for Unified Controller nv series and Integrated Controller V series requires
dedicated engineering tools.
This manual describes instructions for programming languages which include ladder diagram language
(hereinafter referred to as LD language), function block diagram (hereinafter referred to as FBD
language), sequential function chart (herein after referred to as SFC) and structured text (herein after
referred to as ST). They are utilized to create control programs for Unified Controller nv series or
Integrated Controller V series using engineering tools.
The instructions found in this manual can be utilized in the following engineering tools:
Engineering tools Use
nv-Tool 4 client server version
nv-Tool 4 stand alone version
For Unified Controller nv series
nv-Tool 3 client server version
nv-Tool 3 stand alone version
For Integrated Controller V series
The L controller of Integrated Controller V series offers MCS connection version and DS connection
version which are described as follows in this manual:
Type V series Model Notation
MCS connection
version
Model2000 L2PU11/L2PU12 L2
Model3000 L3PU11 L3
DS connection
version
Model2000 L2PU22 L2DS
Model3000 P3PU21 L3DS
Instruction manuals regarding engineering tools include the following:
Unified Controller nv series Integrated Controller V series Engineering Tool 4 Setup 6F8C1291
Unified Controller nv series Integrated Controller V series Engineering Tool 4 Basic 6F8C1290
Integrated Controller V series Engineering Tool 3 Setup 6F8C1011
Integrated Controller V series Engineering Tool 3 Basic 6F8C1006
Introduction
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
iii
CONTENTS
Chapter 1
For
Programming
1
1.1 What are LD, FBD, SFC, and ST Languages? 3
1.2 Data 6
1.2.1 Data Type 6
1.2.2 Data Structure 8
1.2.3 Real Number Format 9
1.2.4 Variables 10
1.2.5 Variable Memory Allocation Rules 11
1.2.6 Variable Declaration Examples 11
1.2.7 Reading and Writing Variable 15
1.3 Program Structure 16
1.3.1 Task 16
1.3.2 POU (Program Organization Unit) 17
1.3.3 Program 18
1.3.4 Function 18
1.3.5 Function Block 22
1.4 Index Registers 25
1.5 System Flags 26
1.6 Handling of REAL Data 28
1.7 Introduction Behavior when Exceeding Data Boundary 30
1.8 Step Counting 31
1.9 How to Read Instruction Spec. 33
1.10 Instruction List 35
Chapter 2
LD/FBD
Instructions
51
2.1 Contacts & Coils 52
2.2 Execution Control 72
2.3 Counters 77
2.4 Timers 85
2.5 Flip-Flops 104
2.6 Moving 111
2.7 Comparison 124
2.8 Selection 145
2.9 Type Conversion 167
2.10 Numeric Function 237
2.11 Logical Operation 259
2.12 Bit Operation 278
2.13 Arithmetic Operation 291
2.14 Data Processing 321
6F8C1226
iv
2.15 I/O 333
2.16 Process Operation 371
2.17 Program Control 451
2.18 String Processing 465
2.19 Control Statements 485
2.20 Communication 524
2.21 Duplex Control 594
2.22 Process Control 603
2.23 Tag Operation 638
2.24 RAS 686
Chapter 3
SFC Instructions
699
Appendix A
Using Any
Function
731
INDEX
749
1
Chapter 1
For Programming
This manual describes the format and handling of the instructions. Read
Chapter 1 thoroughly for it provides knowledge required to understand this
manual.
1.1 What are LD, FBD, SFC, and ST Languages? 3
1.2 Data 6
1.2.1 Data Type 6
1.2.2 Data Structure 8
1.2.3 Real Number Format 9
1.2.4 Variables10
1.2.5 Variable Memory Allocation Rules11
1.2.6 Variable Declaration Examples 11
1.2.7 Reading and Writing Variable15
1.3 Program Structure16
1.3.1 Task16
1.3.2 POU (Program Organization Unit) 17
1.3.3 Program18
1.3.4 Function18
1.3.5 Function Block22
1.4 Index Registers25
1.5 System Flags26
1.6 Handling of REAL Data28
1.7 Introduction Behavior when Exceeding Data Boundary30
Chapter 1 For Programming
6F8C1226
2
1.8 Step Counting31
1.9 How to Read Instruction Spec. 33
1.10 Instruction List 35
1.1 What are LD, FBD, SFC, and ST Languages?
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
3
1.1 What are LD, FBD, SFC, and ST Languages?
LD Language
Ladder Diagram is a graphic language for commonly used Boolean operation and
described using a combination of contacts and coils.
The LD language can be treated in the same manner as electrical relay circuits and must
be connected to the left and right power rails.
Switch_1 Motor_On
ADD_INT
EN ENO
Done
Offset
LD
Value
LD
Value
SET
Switch_3
Switch_2
Switch_4
Horizontal link
Right power rail
Left power rail
Vertical link
Note: The characters LD, ST and SET are
displayed on the semi-graphic Program Editor,
but not displayed on the full-graphic one.
FBD Language
Function block diagram is a graphic language that expresses the flow of signals and
data and is described using a combination of function s and function blocks.
ADD_TIME
Timer_1
Switch2
LD
Switch1
LD
DelayTime
LD
AND_BOOL TON
preset
LD
IN
PT
Q
ET
T_Value
ST
Start
ST
Note: The characters LD, ST and SET are
displayed on the semi-graphic Program Editor,
but not displayed on the full-graphic one.
Chapter 1 For Programming
6F8C1226
4
SFC Language
Sequential Function Chart is a graphic language suited for sequential control and
consists of an SFC structure unit, which shows the control flow, action unit, which shows
the action performed at each step, and transition condition unit, which shows the
conditions for advancing through the steps.
START
T0
S1 S1
S2 Action_1 N
LED
S3
S1_ON S2_ON
S3_ON
T1
T2
ST language
Structured text (ST) is a text language similar to C and PASCAL. It supports variables,
multipliers, operators, assign statements, IF statements, CASE statements, FOR
statements, WHILE statements, REPEAT statements, and call statements of functions
and function blocks. It efficiently programs complicated control statements such as
arithmetic operations and repeat.
(* Initialize *)
XO[0]:=XOUT; (* Output value *)
XU[0]:=XIN; (* Input value *)
XOUT:=B[0]*XIN;
(* Conditional statement *)
IF RUN THEN
FOR XI:=M TO 0 BY -1 DO
XOUT:=XOUT+A[XI]*XO[XI];
REPEAT
A[XJ]:=A[XJ]+XO[XI];
UNTIL A[XJ]<100
END_REPEAT;
END_FOR;
ELSE
WHILE XIN<100 DO
XOUT:=XOUT+A[XI];
IF XOUT>200 THEN
EXIT;
END_IF;
END_WHILE;
END_IF;
CASE XK OF
0..9:
(*Function*)
XOUT:=FUN_XOUT(XIN,XK);
10,20:
(*Function block*)
FBK_XIN_1(XIN,XK);
XOUT:= FBK_XIN_1.OUT;
END_CASE;
Assign statement
Free comment
IF statement
FOR statement
Operator
WHILE statement
EXIT statement
CASE statement
Function call statement
Function block call statement
1.1 What are LD, FBD, SFC, and ST Languages?
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
5
The following operators can be used for structured text (ST):
Operation Description Priority
() Bracket expression 1
** Power 2
NOT, ~ Bitwise Boolean NOT 3
* Multiply 4
/ Divide 4
MOD Remainder 4
+ Add 5
- Subtract 5
<, >, <=, >= Comparison 6
=, <> Equality, inequality 7
AND, & Bitwise Boolean AND 8
XOR Bitwise Boolean XOR 9
OR Bitwise Boolean OR 10
Chapter 1 For Programming
6F8C1226
6
1.2 Data
1.2.1 Data Type
The following table shows the data types supported by the Unified Controller nv series
and Integrated Controller V series and their data range.
Notation
(Data Type)
Data type Bits
Constant
specification
Data range
BOOL Boolean 1
0(FALSE), 1(TRUE)
INT Integer 16
-32768 to 32767
DINT Double integer 32
-2147483648 to 2147483647
UINT Unsigned integer 16
0 to 65535
REAL Real numbers 32
-3.40282310
38
to -1.401298-10
-45
0
1.401298-10
-45
to 3.40282310
38
TIME Duration 32
-2147483648 to 2147483647ms
(-596h31m23s648ms to 596h31m23s647ms)
DATE
D(abbreviation)
Date 32
1998-01-01 to 2097-12-31 *3
TIME_OF_DAY
TOD(abbreviation)
Time of day 32
00:00:00.000 to 23:59:59.999 *3
DATE_AND_TIME
DT(abbreviation)
Date and time of
day
64
1998-01-01-00:00:00.000
to 2097-12-31-23:59:59.999 *3
STRING
Fixed-length
character string
Maximum number of characters: 256
Character code system: shift JIS
Possibility use only with the retained global variable
*2
WORD Bit string of length 16 16
0000 to FFFF
DWORD Bit string of length 32 32
00000000 to FFFFFFFF
PTR *1 Word pointer
PTRB *1 Bit pointer
*1 Unified Controller and the Integrated Controller supports this data type to enable flexible address handling and
provide compatibility with programs on conventional machines.
*2 When using string definition instruction DEF_STRING, it may be used in variable scope without retaining
specification. Refer to the Define String instruction page for details.
*3 In the DATE, TIME_OF_DAY(TOD), and DATE_AND_TIME(DT) types, an asterisk (*) is displayed in the V
engineering tool (program monitor, data value monitor) if data exceeding the range above is set. No setting is
allowed from the V engineering tool (e.g. data value monitoring).
1.2 Data
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
7
To program constants in one of the data types, do the following:
Specify the data type in <DataType>#.
<DataType># can be omitted in the types other than Duration, Date and Time of day.
Constants can be specified in binary (2#), decimal (default), octal (8#), or
hexadecimal(16#).
If a number is 16 in decimal, the value 2#10000 in binary specification, 8#20 in octal
specification, and 16#10 in hexadecimal specification are all equal.
Underscores _ can be inserted between numbers to make constants easy to read.
2#1_0000 in binary specification, 8#2_0 in octal specification, 16#1_0 in hexadecimal
specification are allowed.
The following table shows examples of constant specification:
Notation
(DataType)
Data type
DataType
can be
omitted?
Example of constant specification
BOOL Boolean Yes
BOOL#0, BOOL#FALSE,0, FALSE
BOOL#1, BOOL#TRUE, 1, TRUE
INT Integer Yes INT#15, 15, INT#16#F
DINT Double integer Yes DINT#15, 15, DINT#16#F
UINT Unsigned integer Yes UINT#15, 15, UINT#16#F
REAL Real numbers Yes REAL#15, 15, REAL#16#F, 15.0, 1.5E+1
TIME Duration No
d=Day, h=Hour, m=Minute, s=Second, ms=Millisecond
A decimal point can be used in the last field.
Each effective unit can overflow.
<DataType> can be specified in TIME#, T#.
TIME#6d_10m, TIME#16d_5h_4m_3s_21ms
T#6d_10m, T#12.34s
DATE
D (abbreviation)
Date No DATE#2007-12-10, D#2007-12-10
TIME_OF_DAY
TOD(abbreviation)
Time of day No TIME_OF_DAY#1:2:3.456, TOD#1:2:3
WORD
Bit string of
length 16
Yes WORD#4660, 4660, WORD#16#1234, 16#12_34
DWORD
Bit string of
length 32
Yes
DWORD#305419896, 305419896
DWORD#16#1234_5678, 16#12345678
Chapter 1 For Programming
6F8C1226
8
1.2.2 Data Structure
1) Integer (INT)/Unsigned integer (UINT)/Bit string of length 16 (WORD)
data
15 0
0
2) Double integer (DINT)/Real numbers (REAL)/Duration (TIME)/Time of day
(TOD)/Bit string of length 32 (DWORD)
data (H)
data (L)
15 0
0
1
3) Date (DATE)
year (INT)
15 0
month day
0
1
Example) 1999-10-11<year-month-day>
4) Date and time of day (DT)
year (INT)
15 0
month day
0
1
time of day (H)
time of day (L) 2
3
5) Fixed-length character string (STRING)
VAR length
15 0
1st stri ng 2nd string
0
1
2
3
String l ength (n)
3rd string 4th string
5th string 6th string 4
An example of 6 character data is shown at left.
Variables:
Variable Data type Dec.
SAMPLE STRING[6] VAR
6) Derived data type Array data (ARRAY)
data [0]
15 0
data [1]
data [2]
data [n-1]
2
n-1
0
1
An example of 16 bit data is shown at left. A 32 bit data is
stored every 4 bytes as (2) and (3).
Variables:
Variable Data type Dec.
data ARRAY[0..n-1] OF INT VAR
1.2 Data
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
9
7) Derived data type structure (STRUCT)
data (INT)
15 0
0
1
data1 (DINT H)
data1 (DINT L) 2
3
bit0 bit1
An example of INT+BOOL+DINT.
Variables:
Variable Data type Dec.
data typeSAMPLE VAR
Structures:
Data type Parent type
typeSAMPLE STRUCT
Members:
Member Data type
data INT
bit0 BOOL
bit1 BOOL
data1 DINT
1.2.3 Real Number Format
An arbitrary size single word real data is expressed as follows:
REAL value SM 2
E
Mantissa
Exponent
Sign
Where S is the sign, M is a decimal less than 1, and E is between -127 and +127. The
data format is as follows:
31 30 23 22
Exponent (8 bits) e Mantissa (23 bits) m
0
Sign (1 bit) s
From the above formula, a real value is obtained as :
S = s
M = 1+m 2
-23
E = e -127
REAL value = (s)(1+m 2
-23
)2
e-127
The range of real data is shown in [1.2.1 Data Type].
The following notation is used when the above data range is exceeded:
Infinity: Exponent e = 255, Mantissa m=0
NAN: Exponent e = 255, Mantissa m<>0
Note
For addition/subtraction of real data, if the absolute value of two data differ significantly
(difference in exponent 24), the result is the value of the data with larger absolute value.
Chapter 1 For Programming
6F8C1226
10
1.2.4 Variables
Variables used in applications are divided into local variables and global variables.
Major
classification
Minor classification Variable feature
Temporary variable
A variable that can be used only in the POU in which it is included.
The variable value cannot be retained because memory is reset
each time the POU is executed.
Initialization is required before using the variable.
Static variable
A variable that can be used only in the POU in which it is included.
The variable value is retained because memory is reserved
statically.
The initial operation varies depending on the setting in "Module
Parameter" - "Controller Operation Setting" - "Local Variable
Initialization."
If "Yes" is set, the variable is initialized to zero when the controller
starts up in RUN.
If "No" is set, the variable is not initialized when the controller starts
up in RUN, and starts from the previous operation result. *1
Local variable
Non-tracking type static
variable (Unified Controller
nv series only)
A variable that can be used only in the POU in which it is included.
The variable value is retained because memory is reserved
statically.
In the initialization operation, the variable is initialized to zero when
the controller starts up in RUN.
In a duplex system, this variable is not tracked.
Network variable
A variable that can be used if the stations are organically linked via
scan transmission, and managed in an integrated fashion. It is
used for exchanging information and data between different
stations. The scope of the variable is the system in which the
variable is used. Only scan memory such as TC-net and FL-net
can be network variables.
Station global variable
A variable that is used globally in the station, and used for referring
to information and data of the transmission modules in the station.
The scope of the variable is the station in which the variable is
used.
For a station variable declared as Boolean, available slots are
restricted.
[Integrated Controller V series]
Can be used only in Slot 0 and Slot 1.
[Unified Controller nv series]
Can be used only in Slot 0.
Global variable
Controller global variable
A variable that is used globally in the controller, and used for
exchanging information and data between different programs in the
controller. The scope of the variable is the controller in which the
variable is used.
Controller variables include controller-specific variables (special
registers, data registers), user-defined user variables, and I/O
variables.
*1 The local variable area (e.g. the area storing the previous value of the rising edge detection instruction and
instance of the timer instruction) that is automatically generated in the standard function block is initialized to
zero.
1.2 Data
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
11
1.2.5 Variable Memory Allocation Rules
Variables used within a program are allocated in internal memory in the order of their
definition. For example, consecutively defined BOOL type variables are allocated from
the least significant bit to optimize memory usage.
Variables:
Variable Data type Dec.
V1 BOOL VAR
V2 BOOL VAR
V3 INT VAR
V4 BOOL VAR
0
1
15 0
V3
2
V2
V4
V1
1.2.6 Variable Declaration Examples
The following restrictions apply to variable names:
A variable name must begin with an alphabet and consists of alphanumeric
characters or underscore. See the software model section in Chapter 1 of V
Engineering Tool Basic Instruction for details.
Upper and lower case are not distinguished.
The length must not exceed 20 characters.
Arrays are allowed with brackets used to denote the elements. Array index starts from
0.
Structures are allowed with period used to denote the elements.
Reserved words may not be used as variable name.
Reserved word Description
N, R, S, L, D, P, P0, P1, SD, DS, SL, NH, SH,
LH, DH
Action qualifier
ACTION ... END_ACTION Action declaration
ARRAY OF Derived data type array variable declaration
AT Variable declaration (memory address specification)
CASE ... OF ... ELSE ... END_CASE CASE statement
CONFIGURATION ... END_CONFIGURATION Configuration declaration
CONSTANT Variable declaration (constant declaration)
BOOL, SINT, INT, DINT, LINT, USINT, UINT,
UDINT, ULINT, REAL, LREAL, TIME, DATE,
TIME_OF_DAY, TOD, DATE_AND_TIME,
DT, STRING, BYTE, WORD,
DWORD, LWORD, PTR, PTRB
Data type
EN, ENO Function execution control in LD
EXIT FOR, WHILE, REPEAT statements
FALSE, TRUE FALSE/TRUE or Boolean constants
F_EDGE Falling edge detector qualifier
FOR ... TO ... BY ... DO ... END_FOR FOR statement
FUNCTION ... END_FUNCTION Function
Chapter 1 For Programming
6F8C1226
12
Reserved word Description
Function, Function block name
Function or function block names such as SIN, COS,
TAN, TON, CTU.
FUNCTION BLOCK ...
END_FUNCTION BLOCK
Function block declaration
IF ... THEN ... ELSEIF ... ELSE ... END_IF IF statement
INITIAL_STEP ... END_STEP Initial step declaration
PROGRAM ... WITH ... Program allocation
PROGRAM ... END_PROGRAM Program declaration
R_EDGE Rising edge detector qualifier
READ_ONLY, READ_WRITE Access path instruction
REPEAT ... UNTIL ... END_REPEAT REPEAT statement
RESOURCE ... ON ... END_RESOURCE Resource declaration
RETAIN Variable declaration (retained variable specification)
RETURN Return from function or function block
STEP ... END_STEP Step declaration
STRUCT ... END_STRUCT Derived data type structure declaration
TASK Task declaration
IL language text operator Operators such as LD, ST, AND
ST language text operator Operators such as NOT, MOD
TRANSITION ... FROM ... TO ...
END_TRANSITION
Transition declaration
TYPE ... END_TYPE Derived data declaration
VAR ... END_VAR
VAR_TEMP ... END_VAR
VAR_INPUT ... END_VAR
VAR_OUTPUT ... END_VAR
VAR_IN_OUT ... END_VAR
VAR_GLOBAL ... END_VAR
VAR_EXTERNAL ... END_VAR
VAR_ACCESS ... END_VAR
Variable declaration
WHILE ... DO ... END_WHILE WHILE statement
WITH Program or function block task association
XI, XJ, XK, XL, XM, XN, XP, XQ Index registers
Static variable
Static variables used within POU* are declared using the keyword VAR.
Variables:
Variable Data type Dec.
LOCAL_VAR_1 INT VAR
LOCAL_VAR_2 WORD VAR
* POU stands for Program Organization Unit. See section [1.3.2
POU (Program Organization Unit)] for details.
1.2 Data
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
13
Non-tracking type static variable (Unified Controller nv series only)
Non-tracking type static variables used within POU are declared using the keyword
VAR (Non Tracking).
Variables:
Variable Date type Dec.
LOCAL_NT_VAR_1 INT VAR(NonTracking)
LOCAL_NT_VAR_2 WORD VAR(NonTracking)
Temporary variable
Temporary variables used within POU are declared using the keyword VAR_TEMP.
Variables:
Variable Date type Dec.
TEMP_VAR_1 INT VAR_TEMP
TEMP_VAR_2 WORD VAR_TEMP
Input parameter
Represent the input arguments for POU and are declared using the keyword
VAR_INPUT.
Variables:
Variable Date type Dec.
INPUT_VAR_1 INT VAR_INPUT
INPUT_VAR_2 WORD VAR_INPUT
Output parameter
Represent the output arguments for POU and are declared using the keyword
VAR_OUTPUT.
Variables:
Variable Date type Dec.
OUTPUT_VAR_1 INT VAR_OUTPUT
OUTPUT_VAR_2 WORD VAR_OUTPUT
Input/Output parameter
Represent the input/output arguments for POU and are declared using the keyword
VAR_IN_OUT.
Variables:
Variable Date type Dec.
INOUT_VAR_1 INT VAR_IN_OUT
INOUT_VAR_2 WORD VAR_IN_OUT
Chapter 1 For Programming
6F8C1226
14
Global variable
When using global variables, declare them as network, station, I/O and controller
variables.
Variables:
Variable Date type
GLOBAL_VAR_1 INT
GLOBAL_VAR_2 WORD
Derived data type Array declaration
The ARRAYOF keyword is used to declare arrays to be used within POU.
For example, an INT array with ten elements is declared as follows:
Variables:
Variable Date type Dec.
ARRAY_VAR ARRAY[0..9] OF INT VAR
Derived data type structure declaration
The STRUCT keyword is used to declare structures to be used within POU.
Variables:
Variable Date type Dec.
data STRUCT_NAME VAR
Structures
Data type Parent type
STRUCT_NAME STRUCT
Members:
Member Data type
VAL1 INT
VAL_ARY ARRAY[0..9] OF BOOL
VAL2 DINT
1.2 Data
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
15
1.2.7 Reading and Writing Variable
The following instructions are used to read from and write to variables. See section
[1.3.4 Function] for details. Furthermore, they may be used in combination with Gate
instructions. Refer to the [Normally Open Contact] and the [Normally Close Contact]
instruction description page for details.
Function Instruction Symbol Description
Read
Load
instruction
LD
LD instruction is used to specify input arguments to
function or function block.
Store
instruction
ST
ST instruction is used to write the result of function or
function block without execution control to a variable.
Write
Set store
instruction
SET
SET instruction is used to write the result of function with
execution control to a variable.
ADD_INT
SAMPLE1
LD
SAMPLE2
LD
SAMPLE3
ST
ADD_INT
EN ENO
SAMPLE1
LD
SAMPLE2
LD
SAMPLE3
SET
SIGNAL1
Use ST instruction
Use SET instruction
SAMPLE1
LD
SAMPLE2
ST
SIGNAL1
When SIGNAL1=FALSE(OFF) : SAMPLE2=0
When SIGNAL1=TRUE(ON) : SAMPLE2=SAMPLE1
When SIGNAL1=FALSE(OFF) : SAMPLE2=Previous value
When SIGNAL1=TRUE(ON) : SAMPLE2=SAMPLE1
SIGNAL2
SAMPLE1
LD
SAMPLE2
SET
SIGNAL1
Combination with function
Function without execution control
Function with execution control
Combination with gate instruction
Example of normally open contact gate and store instruction
Example of normally open contact gate and SET store instruction
Chapter 1 For Programming
6F8C1226
16
1.3 Program Structure
1.3.1 Task
The integrated controller control application programs in units called task. This
represents a program execution unit. Any program can be executed by including it in a
task.
[Number of programs that can be registered in each task in the Integrated Controller V series]
Controller
Task name Priority
S3 S2
L3
(L3DS)
L2
(L2DS)
L1
Execution
method
Event task EV 1 8 8
8
(16)
8
(16)
Event
Super high
speed task
SS 2 1 1
1
()
1
()
Scan
Interrupt task IP 3 8 8
8
(32)
8
(32)
Event
Highspeed task HS 4 1 32
32
(128)
8
(128)
Scan
Main task MS 5 256 256
256
(256)
64
(256)
8 Scan
Background task BG 6 4 4
4
(4)
1
(4)
Event or scan
*1 S3PU21/S3PU45 : 32S3PU55/S3PU65 : 128
Number of programs that can be registered in each task in the Unified Controller nv series
Controller
Task name Priority
type1 type2
Execution method
Event task EV 8 8
1
Event (select EV or IP)
Interrupt task *1 IP 16 16
Event
Super high
speed task
SS 1 2
Scan
(select IP, SS, or
RIO)
RIOt task *2*3 RIO 0
Highspeed task HS
3
128 128
Scan (select HS or RIO)
Main task MS 4 256 512 Scan
*1 An interrupt task can be selected in Priority 1 or Priority 2.
*2 Only type1 can be selected. An RIO task can be selected in Priority 2 or Priority 3.
*3 Selection of RIO task in Priority 2 is supported by type1 controller version: V01.50.
1.3 Program Structure
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
17
1.3.2 POU (Program Organization Unit)
Programs, functions, and function blocks are referred to as Program Organization Unit
(POU). Refer to the subsequent sections for details.
[Number of POUs that can be registered in the Integrated Controller V series]
Controller POU (Program
Organization
Unit)
Instance
S3 S2
L3
(L3DS)
L2
(L2DS)
L1
Static
variable
Temporary
variable
Task
registration
Function
value
Argument
Program
Program
instance
Function
Function block
Function block
instance
1
437
2048
(2048)
512
(2048)
64
1 S3PU21 : 437S3PU45 : 821S3PU55/S3PU65 : 917
[Number of POUs that can be registered in the Unified Controller nv series]
Controller
POU (Program
Organization
Unit)
Instance
type1 type2
Static
variable
Temporary
variable
Task
registration
Function
value
Argument
Program Program instance
Function
Function block
Function block
instance
940 2000
Chapter 1 For Programming
6F8C1226
18
1.3.3 Program
A program is a combination of program body, functions, and function blocks. Functions
and function blocks may be used in common among several programs and function
blocks.
Task
Function block
Program
Function block
Program Program Program
Function
Function Function
Function block
1.3.4 Function
What is Function?
A function is executed with specific arguments and outputs a function value. In other
words it always produces the same operation result for the same input and does not
have internal storage. Instructions such as SIN and COS defined by IEC611313 are
examples of functions.
Function Execution Control with EN/ENO
Functions can have EN input and ENO output. They control the execution of the function.
ST language does not support EN input and ENO output.
<Example without execution control> <Example with execution control>
ADD_INT SAMPLE1
LD
SAMPLE2
LD
SAMPLE3
ST
ADD_INT
EN ENO
SAMPLE1
LD
SAMPLE2
LD
SAMPLE3
SET
SIGNAL1 SIGNAL2
1.3 Program Structure
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
19
Instructions to store the result to be connected to a function are divided into Store
instruction (ST) and Set Store instruction (SET).
The following rules apply to these instructions:
EN input Function processing ENO output
Set Store (SET)
instruction action
Store (ST)
Instruction action
Remarks
FALSE
(OFF)
Not executed (Output 0) FALSE(OFF) No data update
Update with
default value (0)
1
Normal
completion
TRUE(ON)
Yes
TRUE
(ON)
Executed
(Outputs
operation result)
Error
completion
(Error)
Depend on
function *2
Update with
operation result
Update with
operation result
No Executed Not available
Update with
operation result
(*1) When EN input is FALSE(OFF), function output is 0 and if that output is used directly as input to another
instruction, the input to that instruction is 0. For example, if a coil instruction is connected to a BOOL output
type function, that coil becomes FALSE(OFF). However, if that instruction is a Set Store instruction, 0 is not
stored and no data update is performed as shown in the above table.
(*2) In the function description, if there is no description of ENO output, the EN input state is output as the ENO
output.
When the function output is BOOL variable
In case where SAMPLE1SAMPLE2:
When SIGNAL1=FALSE(OFF)
SIGNAL2 FALSE(OFF)
SIGNAL3 is unchanged
When SIGNAL1=TRUE(ON)
SIGNAL2 TRUE(ON)
SIGNAL3 TRUE(ON)
In case where SAMPLE1SAMPLE2
When SIGNAL1=FALSE(OFF)
SIGNAL2 FALSE(OFF)
SIGNAL3 FALSE(OFF)
When SIGNAL1=TRUE(ON)
SIGNAL2 TRUE(ON)
SIGNAL3 TRUE(ON)
SAMPLE1
LD
SIGNAL1
SAMPLE2
LD
SIGNAL2
SIGNAL3
SET
SAMPLE1
LD
SIGNAL1
SAMPLE2
LD
SIGNAL2
GT_INT
EN ENO
GT_INT
EN ENO
SIGNAL3
When the function output is not BOOL variable
When SIGNAL1=FALSE(OFF)
SIGNAL2 FALSE(OFF)
SAMPLE3 is unchanged
When SIGNAL1=TRUE(ON)
SIGNAL2 TRUE(ON)
SAMPLE3 SAMPLE1+SAMPLE2
SAMPLE1
LD
SIGNAL1
SAMPLE2
LD
SIGNAL2
SAMPLE3
SET
ADD_INT
EN ENO
Chapter 1 For Programming
6F8C1226
20
Example of execution control with EN,ENO
When SIGNAL1=FALSE(OFF)
SIGNAL2 FALSE(OFF)
SAMPLE4 is unchanged
When SIGNAL1=TRUE(ON)
SIGNAL2 TRUE(ON)
SAMPLE4 (SAMPLE1+SAMPLE2)SAMPLE3
SAMPLE1
LD
SI GNAL1
SAMPLE2
LD
SIGNAL2
SAMPLE4
SET
ADD_INT
EN ENO
MUL_INT
EN ENO
SAMPLE3
LD
ENO and EN on the same circuit are used connected.
When EN is FALSE(OFF), 0 is output.
User Defined Function
The user can define a new function by combining existing functions. This enables
program components to be packaged for reuse.
SAMPLE1
LD
SAMPLE2
LD
SAMPLE3
ST
USR_FUN
DATA1
DATA2
DATA1
LD
DATA1
LD
MUL_REAL
MUL_REAL
DATA2
LD
DATA2
LD
SUB_REAL USR_FUN
ST
SQRT
User defined function blockUSR_FUN
USR FUN
SAMPLE SAMPLE
_
2 2
1 2
1.3 Program Structure
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
21
Important
With regard to input arguments, output arguments, I/O arguments, and function return values,
when an argument is specified as indicated in the below table () and the argument and return
value is referenced or updated in the user defined function, it would take longer to process the
instruction. For details, refer to the Run time of Instruction Word in appendix of each controller
functional manual.
Data type VAR_IPUT VAR_OUTPUT VAR_IN_OUT
Return
value
BOOL
INT
DINT
UINT
REAL
TIME
DATE
TOD
DT
WORD
DWORD
STRING
PTR
PTRB
Derived ARRAY data
Derived structure
2 P.87
Off-Delay Timer (0.1ms) TOF_100us
STC 2 P.90
Off-Delay Timer (1ms) TOF
1 P.90
Off-Delay Timer (10ms) TOF_10ms
2 P.90
Off-Delay Timer (100ms) TOF_100ms
2 P.90
Off-Delay Timer (0.1
minute)
TOFM_P
2 P.90
Pulse Timer (0.1ms) TP_100us
STC 2 P.93
Pulse Timer (1ms) TP
1 P.93
Pulse Timer (10ms) TP_10ms
2 P.93
Pulse Timer (100ms) TP_100ms
2 P.93
Single Shot (100ms) SS_P
2 P.96
Single Shot (0.1 minute) SSM_P
2 P.96
Real Time Clock RTC
2 P.98
Real Time Clock RTC_N
2 P.100
On/Off-Delay Timer DEL_L
2.30
2 P.102
Flip-Flops
P104
Set Type Flip-Flop SR
2 P105
Reset Type Flip-Flop RS
2 P107
Semaphore SEMA
2 P109
Moving P.111
Normally Open Contact
Gate
1 P.112
Normally Closed
Contact Gate
1 P.114
1.10 Instruction List
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
37
Instruction nv series V series
ContactCoil
Symbol
t
y
p
e
1
t
y
p
e
2
S
3
S
2
L
3
L
3
D
S
L
2
L
2
D
S
L
1
S
t
e
p
P
a
g
e
Moving
P111
MOVE_INT
1.30 1.10 2.30
1 P.116
MOVE_DINT
1.30 1.10 2.30
1 P.116
MOVE_UINT
1.30 1.10 2.30
1 P.116
MOVE_REAL
1.30 1.10 2.30
1 P.116
MOVE_WORD
1.30 1.10 2.30
1 P.116
MOVE_DWORD
1.30 1.10 2.30
1 P.116
MOVE_TIME
1.30 1.10 2.30
1 P.116
MOVE_TOD
1.30 1.10 2.30
1 P.116
MOVE_DATE
1.30 1.10 2.30
1 P.116
MOVE_DT
1.30 1.10 2.30
1 P.116
Move Data
MOVE_STRING 1 P.116
Move Table Data TMOV
2.30 1 P.118
XCHG_INT
2 P.120
XCHG_DINT
2 P.120
XCHG_UINT
2 P.120
XCHG_REAL
2 P.120
XCHG_WORD
2 P.120
XCHG_DWORD
2 P.120
XCHG_TIME
2 P.120
XCHG_TOD
2 P.120
Data Exchange
XCHG_DATE
2 P.120
TINZ_INT
1 P.122
TINZ_DINT
1 P.122
TINZ_UINT
1 P.122
TINZ_REAL
1 P.122
TINZ_WORD
1 P.122
TINZ_DWORD
1 P.122
TINZ_TIME
1 P.122
TINZ_TOD
1 P.122
TINZ_DATE
1 P.122
Initialize Table Data
TINZ_DT 1 P.122
Comparison P.124
GT_INT
1 P.125
GT_DINT
1 P.125
GT_UINT
1 P.125
GT_REAL
1 P.125
GT_WORD
1 P.125
GT_DWORD
1 P.125
GT_TIME
1 P.125
GT_TOD
1 P.125
GT_DATE 1 P.125
Greater Than
GT_DT 1 P.125
Chapter 1 For Programming
6F8C1226
38
nv series V series
Instruction Symbol
t
y
p
e
1
t
y
p
e
2
S
3
S
2
L
3
L
3
D
S
L
2
L
2
D
S
L
1
S
t
e
p
P
a
g
e
Comparison P.124
GE_INT
1 P.127
GE_DINT
1 P.127
GE_UINT
1 P.127
GE_REAL
1 P.127
GE_WORD
1 P.127
GE_DWORD
1 P.127
GE_TIME
1 P.127
GE_TOD
1 P.127
GE_DATE 1 P.127
Greater Than or Equal
GE_DT 1 P.127
EQ_INT
1 P.129
EQ_DINT
1 P.129
EQ_UINT
1 P.129
EQ_REAL
1 P.129
EQ_WORD
1 P.129
EQ_DWORD
1 P.129
EQ_TIME
1 P.129
EQ_TOD
1 P.129
EQ_DATE
1 P.129
Equal
EQ_DT 1 P.129
LE_INT
1 P.131
LE_DINT
1 P.131
LE_UINT
1 P.131
LE_REAL
1 P.131
LE_WORD
1 P.131
LE_DWORD
1 P.131
LE_TIME
1 P.131
LE_TOD
1 P.131
LE_DATE 1 P.131
Less Than or Equal
LE_DT 1 P.131
LT_INT
1 P.133
LT_DINT
1 P.133
LT_UINT
1 P.133
LT_REAL
1 P.133
LT_WORD
1 P.133
LT_DWORD
1 P.133
LT_TIME
1 P.133
LT_TOD
1 P.133
LT_DATE 1 P.133
Less Than
LT_DT 1 P.133
1.10 Instruction List
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
39
nv series V series
Instruction Symbol
t
y
p
e
1
t
y
p
e
2
S
3
S
2
L
3
L
3
D
S
L
2
L
2
D
S
L
1
S
t
e
p
P
a
g
e
Comparison P.124
NE_INT
1 P.135
NE_DINT
1 P.135
NE_UINT
1 P.135
NE_REAL
1 P.135
NE_WORD
1 P.135
NE_DWORD
1 P.135
NE_TIME
1 P.135
NE_TOD
1 P.135
NE_DATE
1 P.135
Not Equal
NE_DT 1 P.135
Comparison with Hysteresis
(greater than)
GT_L 2.30 2 P.137
Comparison with Hysteresis
(less than)
LT_L 2.30 2 P.139
Comparison with Hysteresis
(greater than or equal)
GE_L 2.30 2 P.141
Comparison with Hysteresis
(less than or equal)
LE_L 2.30 2 P.143
Selection P.145
MAX_INT
1 P.146
MAX_DINT
1 P.146
MAX_UINT
1 P.146
MAX_REAL
1 P.146
MAX_WORD
1 P.146
MAX_DWORD
1 P.146
MAX_TIME
1 P.146
MAX_TOD
1 P.146
MAX_DATE 1 P.146
Maximum
MAX_DT 1 P.146
MAXL_INT
1 P.148
MAXL_DINT
1 P.148
MAXL_UINT
1 P.148
MAXL_REAL
1 P.148
MAXL_TIME
1 P.148
MAXL_TOD
1 P.148
MAXL_DATE 1 P.148
Maximum of Table Data
MAXL_DT 1 P.148
MIN_INT
1 P.150
MIN_DINT
1 P.150
MIN_UINT
1 P.150
MIN_REAL
1 P.150
MIN_WORD
1 P.150
MIN_DWORD
1 P.150
MIN_TIME
1 P.150
MIN_TOD
1 P.150
MIN_DATE 1 P.150
Minimum
MIN_DT 1 P.150
Chapter 1 For Programming
6F8C1226
40
nv series V series
Instruction Symbol
t
y
p
e
1
t
y
p
e
2
S
3
S
2
L
3
L
3
D
S
L
2
L
2
D
S
L
1
S
t
e
p
P
a
g
e
Selection P.145
MINL_INT
1 P.152
MINL_DINT
1 P.152
MINL_UINT
1 P.152
MINL_REAL
1 P.152
MINL_TIME
1 P.152
MINL_TOD
1 P.152
MINL_DATE 1 P.152
Minimum of Table Data
MINL_DT 1 P.152
AVE_INT
1 P.154
AVE_DINT
1 P.154
AVE_UINT
1 P.154
AVE_REAL
1 P.154
Average Value
AVE_TIME
1 P.154
AVEL_INT
1 P156
AVEL_DINT
1 P.156
AVEL_UINT
1 P.156
AVEL_REAL
1 P.156
Average of Table Data
AVEL_TIME
1 P.156
LIMIT_INT
1 P.158
LIMIT_DINT
1 P.158
LIMIT_UINT
1 P.158
LIMIT_REAL
1 P.158
LIMIT_WORD
1 P.158
LIMIT_DWORD
1 P.158
LIMIT_TIME
1 P.158
LIMIT_TOD
1 P.158
LIMIT_DATE 1 P.158
Limiter
LIMIT_DT 1 P.158
SEL_BOOL
1 P.161
SEL_INT
1 P.161
SEL_DINT
1 P.161
SEL_UINT
1 P.161
SEL_REAL
1 P.161
SEL_WORD
1 P.161
SEL_DWORD
1 P.161
SEL_TIME
1 P.161
SEL_TOD
1 P.161
SEL_DATE
1 P.161
Selector
SEL_DT 1 P.161
1.10 Instruction List
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
41
nv series V series
Instruction Symbol
t
y
p
e
1
t
y
p
e
2
S
3
S
2
L
3
L
3
D
S
L
2
L
2
D
S
L
1
S
t
e
p
P
a
g
e
Selection P.145
MUX_BOOL
1 P.163
MUX_INT
1 P.163
MUX_DINT
1 P.163
MUX_UINT
1 P.163
MUX_WORD
1
P.163
MUX_DWORD
1 P.163
MUX_REAL
1 P.163
MUX_TIME
1 P.163
MUX_TOD
1 P.163
MUX_DATE
1 P.163
Multiplex
MUX_DT 1 P.163
MPX_INT
1 P.165
MPX_DINT
1 P.165
MPX_UINT
1 P.165
MPX_WORD
1 P.165
MPX_DWORD
1 P.165
MPX_REAL
1 P.165
MPX_TIME
1 P.165
MPX_TOD
1 P.165
MPX_DATE
1 P.165
Multiplex of Table
Data
MPX_DT 1 P.165
Type Conversion P.167
INT_TO_DINT
1.30 1.10 2.30
2.30 1 P.169
INT_TO_UINT
2.50 2.53 1 P.169
DINT_TO_INT
1.30 1.10 2.30
2.30 1 P.169
DINT_TO_UINT
2.50 2.53 1 P.169
UINT_TO_INT
2.50 2.53 1.30 1.10 2.30
2.30 1 P.169
Integer-Integer
Conversion
UINT_TO_DINT
2.50 2.53 1.30 1.10 2.30
2.30 1 P.169
INT_TO_REAL
1 P.171
DINT_TO_REAL
1 P.171
Integer-Real
Numbers
Conversion
UINT_TO_REAL
2.50 2.53 1.30 1.10 2.30
1.03 1 P.171
INT_TO_WORD
1.03 1 P.172
INT_TO_DWORD
2.50 2.53
1.03 1 P.172
DINT_TO_WORD
2.50 2.53 1 P.172
DINT_TO_DWORD
1.03 1 P.172
UINT_TO_WORD
1.03 1 P.172
Integer-Bit String
Conversion
UINT_TO_DWORD
2.50 2.53
1.03 1 P.172
INT_TO_BCD_WORD
2.50 2.53 1 P.174
INT_TO_BCD_DWORD
2.50 2.53 1 P.174
DINT_TO_BCD_WORD
2.50 2.53 1 P.174
DINT_TO_BCD_DWORD
1 P.174
UINT_TO_BCD_WORD
1 P.174
Integer-BCD
Conversion
UINT_TO_BCD_DWORD
2.50 2.53 1 P.174
Chapter 1 For Programming
6F8C1226
42
nv series V series
Instruction Symbol
t
y
p
e
1
t
y
p
e
2
S
3
S
2
L
3
L
3
D
S
L
2
L
2
D
S
L
1
S
t
e
p
P
a
g
e
Type Conversion P.167
INT_TO_TIME
2.50 2.53 1.30 1.10 2.30
2.30 1 P.176
DINT_TO_TIME
2.50 2.53 1.30 1.10 2.30
2.30 1 P.176
Integer-Duration
Conversion
UINT_TO_TIME
2.50 2.53 1.30 1.10 2.30
2.30 1 P.176
REAL_TO_INT
1 P.177
REAL_TO_DINT
1 P.177
Real Numbers Integer
Conversion
REAL_TO_UINT
2.50 2.53 1 P.177
REAL_TO_BCD_WORD
2.50 2.53 1 P.179 Real Numbers-BCD
Conversion REAL_TO_BCD_DWORD
2.50 2.53 1 P.179
Real
Numbers-Duration
Conversion
REAL_TO_TIME
2.50 2.53 1.30 1.10 2.30
1.03 1 P.181
WORD_TO_INT
1.03 1 P.183
WORD_TO_DINT
2.50 2.53
1.03 1 P.183
WORD_TO_UINT
1.03 1 P.183
DWORD_TO_INT
2.50 2.53 1 P.183
DWORD_TO_DINT
1.03 1 P.183
Bit String-Integer
Conversion
DWORD_TO_UINT
2.50 2.53 1 P.183
WORD_TO_DWORD
1.30 1.10 2.30
2.30 1 P.185 Bit String-Bit String
Conversion DWORD_TO_WORD
1.30 1.10 2.30
2.30 1 P.185
WORD_BCD_TO_INT
2.50 2.53 1 P.187
WORD_BCD_TO_DINT
2.50 2.53 1 P.187
WORD_BCD_TO_UINT
1 P.187
DWORD_BCD_TO_INT
2.50 2.53 1 P.187
DWORD_BCD_TO_DINT
1 P.187
BCD-Integer
Conversion
DWORD_BCD_TO_UINT
2.50 2.53 1 P.187
WORD_BCD_TO_REAL
2.50 2.53 1 P.189 BCD-Real Numbers
Conversion DWORD_BCD_TO_REAL
2.50 2.53 1 P.189
WORD_BCD_TO_TIME
2.50 2.53 1 P.191 BCD-Duration
Conversion DWORD_BCD_TO_TIME
2.50 2.53 1 P.191
TIME_TO_INT
2.50 2.53 1.30 1.10 2.30
2.30 1 P.193
TIME_TO_DINT
2.50 2.53 1.30 1.10 2.30
2.30 1 P.193
Duration-Integer
Conversion
TIME_TO_UINT
2.50 2.53
1 P.193
Duration-Real
Numbers Conversion
TIME_TO_REAL
2.50 2.53 1.30 1.10 2.30
1.03 1 P.195
TIME_TO_BCD_WORD
2.50 2.53 1 P.196 Duration-BCD
Conversion TIME_TO_BCD_DWORD
2.50 2.53 1 P.196
TRUNC_INT
1 P.198
TRUNC_DINT
1 P.198 Truncation
TRUNC_UINT
2.50 2.53 1 P.198
NEG_INT
1 P.200
NEG_DINT
1 P.200 Sign Negative
NEG_REAL
1 P.200
DEG-RAD Conversion DEG_TO_RAD
1 P.202
RAD-DEG Conversion RAD_TO_DEG
1 P.203
BIN_INT_P
1 P.204 BIN Conversion
BIN_DINT_P
1 P.204
1.10 Instruction List
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
43
nv series V series
Instruction Symbol
t
y
p
e
1
t
y
p
e
2
S
3
S
2
L
3
L
3
D
S
L
2
L
2
D
S
L
1
S
t
e
p
P
a
g
e
Type Conversion P.167
DT_TO_TOD
2.50 2.53 1 P.206
Time Data Type Conversion
DT_TO_DATE
2.50 2.53 1 P.206
Concatenate Time Data CONCAT_D_TOD
2.50 2.53 1 P.208
ASCII-HEX Conversion ATOH_T
1 P.210
HEX-ASCII Conversion HTOA_T
1 P.212
ASCII-Real Numbers Conversion ASC_TO_REAL
1 P.214
Real Numbers-ASCII Conversion REAL_TO_ASC
1 P.216
ASCII (decimal)-Double Integer Conversion ASCDEC_TO_DINT
2.50 2.53 1 P.219
ASCII (hexadecimal)-Double
Integer Conversion
ASCHEX_TO_DINT
2.50 2.53 1 P.222
Double Integer-ASCII (decimal) Conversion DINT_TO_ASCDEC
2.50 2.53 1 P.225
Double Integer-ASCII
(hexadecimal) Conversion
DINT_TO_ASCHEX
2.50 2.53 1 P.228
Array-String Conversion ARRAY_TO_STRING 1 P.231
String-Array Conversion STRING_TO_ARRAY 1 P.233
Tag Number Conversion TO_INDEX
1.1A 1.18 2.23 1 P.235
Numeric Function P.237
Square Root SQRT
1 P.238
Exponential EXP
1 P.239
Common Logarithms LOG
1 P.241
Natural Logarithms LN
1 P.243
ABS_INT
1 P.245
ABS_DINT
1 P.245 Absolute Value
ABS_REAL
1 P.245
Sine SIN
1 P.247
Cosine COS
1 P.249
Tangent TAN
1 P.251
Arcsine ASIN
1 P.253
Arccosine ACOS
1 P.255
Arctangent ATAN
1 P.257
Logical Operation P.259
AND_BOOL
1 P.260
AND_WORD
1 P.260 Bitwise Boolean AND
AND_DWORD
1 P.260
Bitwise Boolean AND of Table Data TAND
2.50 2.53 1 P.262
OR_BOOL
1 P.264
OR_WORD
1 P.264 Bitwise Boolean OR
OR_DWORD
1 P.264
Bitwise Boolean OR of Table Data TOR
2.50 2.53 1 P.266
NOT_BOOL
1 P.268
NOT_WORD
1 P.268 Bitwise Boolean NOT
NOT_DWORD
1 P.268
Bitwise Boolean NOT of Table Data TNOT
2.50 2.53 1 P.269
XOR_BOOL
1 P.271
XOR_WORD
1 P.271 Bitwise Boolean XOR
XOR_DWORD
1 P.271
Chapter 1 For Programming
6F8C1226
44
nv series V SERIES
Instruction Symbol
t
y
p
e
1
t
y
p
e
2
S
3
S
2
L
3
L
3
D
S
L
2
L
2
D
S
L
1
S
t
e
p
P
a
g
e
Logical Operation P.259
Bitwise Boolean XOR of
Table Data
TXOR
2.50 2.53 1 P.273
Bitwise Boolean NOT
XOR of Table Data
TXNR
2.50 2.53 1 P.275
TEST_WORD
1 P.277
Test
TEST_DWORD
1 P.277
Bit Opeation P.278
SHR_WORD
1 P.279
Shift Bits Right
SHR_DWORD
1 P.279
SHL_WORD
1 P.281
Shift Bits Left
SHL_DWORD
1 P.281
ROR_WORD
1 P.283
Rotate Bits Right
ROR_DWORD
1 P.283
ROL_WORD
1 P.285
Rotate Bits Left
ROL_DWORD
1 P.285
SFA_WORD_P
1 P.287
Arithmetic Shift
SFA_DWORD_P
1 P.287
SFL_WORD_P
1 P.289
Logical Shift
SFL_DWORD_P
1 P.289
Arithmetic Operation P.291
ADD_INT
1 P.292
ADD_DINT
1 P.292
ADD_UINT
1 P.292
Add
ADD_REAL
1 P.292
ADC_INT
1 P.294
Add with Carry
ADC_DINT
1 P.294
SUB_INT
1 P.296
SUB_DINT
1 P.296
SUB_UINT
1 P.296
Subtract
SUB_REAL
1 P.296
SBB_INT
1 P.298
Subtract with Carry
SBB_DINT
1 P.298
MUL_INT
1 P.300
MUL_DINT
1 P.300
MUL_UINT
1 P.300
MUL_REAL
1 P.300
Multiply
MUL_INT_DINT
1 P.302
DIV_INT
1 P.303
DIV_DINT
1 P.303
DIV_UINT
1 P.303
Divide
DIV_REAL
1 P.303
MOD_INT
1 P.305
MOD_DINT
1 P.305 Remainder
MOD_UINT
1 P.305
1.10 Instruction List
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
45
nv series V SERIES
Instruction Symbol
t
y
p
e
1
t
y
p
e
2
S
3
S
2
L
3
L
3
D
S
L
2
L
2
D
S
L
1
S
t
e
p
P
a
g
e
Arithmetic Operation P.291
INC_INT
1 P.307
INC_DINT
1 P.307
INC_UINT 1 P.307
INC_REAL 1 P.307
Increment
INC_TIME 1 P.307
DEC_INT
1 P.309
DEC_DINT
1 P.309
DEC_UINT 1 P.309
DEC_REAL 1 P.309
Decrement
DEC_TIME 1 P.309
EXPT_INT
1 P.311
EXPT_DINT
1 P.311
EXPT_UINT
1 P.311
Power
EXPT_REAL
1 P.311
ADD_T_T 1 P.313
ADD_TOD_T 1 P.313
ADD_DT_T 1 P.313
ADD_D_INT 1 P.313
ADD_D_DINT 1 P.313
Add Time Data
ADD_D_UINT 1 P.313
SUB_T_T 1 P.315
SUB_D_D 1 P.315
SUB_TOD_T 1 P.315
SUB_TOD_TOD 1 P.315
SUB_DT_T 1 P.315
SUB_DT_DT 1 P.315
SUB_D_D_INT 1 P.315
SUB_D_D_DINT 1 P.315
SUB_D_D_UINT 1 P.315
SUB_D_INT 1 P.315
SUB_D_DINT 1 P.315
Subtract Time Data
SUB_D_UINT 1 P.315
MUL_T_INT 1 P.317
MUL_T_DINT 1 P.317 Multiply Time Data
MUL_T_UINT 1 P.317
DIV_T_INT 1 P.319
DIV_T_DINT 1 P.319 Divide Time Data
DIV_T_UINT 1 P.319
Data Processing P.321
Set Carry SETC
1 P.322
Reset Carry RSTC
1 P.323
Chapter 1 For Programming
6F8C1226
46
nv series V SERIES
Instruction Symbol
t
y
p
e
1
t
y
p
e
2
S
3
S
2
L
3
L
3
D
S
L
2
L
2
D
S
L
1
S
t
e
p
P
a
g
e
Data Processing P.321
ENC_WORD_INT
2.50 2.53 1 P.324
ENC_WORD_DINT
2.50 2.53 1 P.324
ENC_DWORD_INT
2.50 2.53 1 P.324
Encode
ENC_DWORD_DINT
2.50 2.53 1 P.324
DEC_INT_WORD
2.50 2.53 1 P.326
DEC_INT_DWORD
2.50 2.53 1 P.326
DEC_DINT_WORD
2.50 2.53 1 P.326
Decode
DEC_DINT_DWORD
2.50 2.53 1 P.326
BC_WORD
2.50 2.53 1 P.328
Bit Counter
BC_DWORD
2.50 2.53 1 P.328
TSET_INT
2.50 2.53 1 P.329
TSET_DINT
2.50 2.53 1 P.329
TSET_WORD
2.50 2.53 1 P.329
Table Bit Set
TSET_DWORD
2.50 2.53 1 P.329
TRST_INT
2.50 2.53 1 P.331
TRST_DINT
2.50 2.53 1 P.331
TRST_WORD
2.50 2.53 1 P.331
Table Bit Reset
TRST_DWORD
2.50 2.53 1 P.331
I/O P.333
I/O Memory Read MREAD
1.35 1.10 2.10
1 P.334
I/O Memory Write MWRITE
1.35 1.10 2.10
1 P.337
I/O Memory Read (nv) MREAD_N 1.20 1.70 2 P.340
I/O Memory Write (nv) MWRITE_N 1.20 1.70 2 P.343
ASC Module String Data Input ASCREAD 1 P.346
ASC Module String Data Output ASCWRITE 1 P.349
State Change Detection Read GET_IP_INF
2.06 2.52 1 P.352
Direct I/O IO_T 2.50 2.53 1 P.355
I/O Node State Read GET_SIO_STS
1 P357
I/O Module State Read GET_IO_STS
1 P.361
I/O Fallback Request IOFB_REQ
1 P.365
I/O Fallback Recovery Request IORC_REQ
1 P.367
Drive Device State Read GET_DRV_STS 1.20 1 P.369
Process Operation P.371
DB_INT
1 P.372
DB_DINT
1 P.372 Dead Band
DB_REAL
1 P.372
Derivative DIF2
2 P.374
Integrator INTG
2 P.377
Super Two Degrees of
Freedom PID
PID2
2 P.380
MV Calculation MVS
2 P.385
Fix MV MVF
2.50 2.53
1 P.388
PLN_INT
1 P.390 Polygonal Line
Function PLN_REAL
1 P.390
Polygonal Line Function
(high-speed version)
PLN_REAL2 1.20 1 P.393
1.10 Instruction List
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
47
nv series V SERIES
Instruction Symbol
t
y
p
e
1
t
y
p
e
2
S
3
S
2
L
3
L
3
D
S
L
2
L
2
D
S
L
1
S
t
e
p
P
a
g
e
Process Operation P.371
ILNL_INT
2.50 2.53 1 P.395 Inverse Polygonal
Line Function ILNL_REAL
2.50 2.53
1 P.395
Inverse Polygonal Line Function
(highspeed version)
ILNL_REAL2 1.20 1 P.399
Dead Time DT
1 P.402
Moving Average (highspeed version) MAV
2.50 2.53
1 P.406
Moving Average
(low-speed version)
MAV_N
1.32/
3.10
1 P.410
DLM_INT
2 P.414
DLM_DINT
2 P.414 Rate Limiter
DLM_REAL
2 P.414
Lag/Lead Filter LAG2
2 P.416
Engineering Unit Conversion UNT
2.50 2.53
1 P.418
Percent Conversion PCT
2.50 2.53
1 P.420
Essential Succession PID PID3
2.50 2.53 2 P.422
Estimate with Reset RSM_L 2.30 2 P.430
Parameter Structure P.433
Program Control P.451
Return RETURN
1 P.452
User Defined Function
1 P.453
User Defined Function Block
2/3 P.454
Program Enable EN_P
1 P.456
Program Disable DIS_P
1 P.458
Event Program Startup START_P
1 P.460
Interrupt Enable EI_T
1 P.463
Interrupt Disable DI_T
1 P.464
String Processing P.465
String Length LEN 1 P.466
Leftmost extract string LEFT 1 P.467
Rightmost extract string RIGHT 1 P.469
Extract String MID 1 P.471
Concatenate string CONCAT_STRING 1 P.473
Insert String INSERT 1 P.475
Delete String DELETE 1 P.477
Replace String REPLACE 1 P.479
Find String FIND 1 P.481
Define String DEF_STRING 1 P.483
Control Statements P.485
IF IF
1 P.486
THEN THEN
1 P.488
ELSE (IFstatement) ELSE
1 P.490
ELSEIF ELSEIF
1 P.492
END_IF END_IF
1 P.494
CASE CASE
1 P.495
1 P.497
. . . .
1 P.499
Chapter 1 For Programming
6F8C1226
48
nv series V SERIES
Instruction Symbol
t
y
p
e
1
t
y
p
e
2
S
3
S
2
L
3
L
3
D
S
L
2
L
2
D
S
L
1
S
t
e
p
P
a
g
e
Control Statements P.485
, ,
1 P.501
. . , . . ,
1 P.503
ELSE (CASE statement) ELSE
1 P.505
END_CASE END_CASE
1 P.507
FOR_DO FOR_DO
1 P.509
EXIT (FOR statement) EXIT
1 P.511
END_FOR END_FOR
1 P.513
WHILE WHILE
1 P.514
DO DO
1 P.515
EXIT (WHILE statement) EXIT
1 P.516
END_WHILE END_WHILE
1 P.518
REPEAT REPEAT
1 P.519
UNTIL UNTIL
1 P.520
EXIT (REPEAT statement) EXIT
1 P.521
END_REPEAT END_REPEAT
1 P.523
Communication P.524
Socket Communication Send USEND_T
1.20 2 P.525
Socket Communication Send USEND_N
2 P.542
Socket Communication Receive URCV_T
1.20 2 P.558
Socket Communication Receive URCV_N
2 P.570
Communication FB (XMIT_T) XMIT_T 2.50 2.50 2 P.590
Communication FB (XMIT_N) XMIT_N 1.20 2 P.592
Duplex Control P.594
Duplex Online-Standby Change DUPLEX_CHG
1.37 1.10 2.35
1 P.595
Duplex Self-System Down DUPLEX_DOWN
1.37 1.10 2.35
1 P.597
Partial Equalizer
(variable specification)
EQUALIZE_VAR 2.50 2.53 1 P.599
Partial Equalizer (address
specification)
EQUALIZE_ADDR 2.50 2.53 1 P.601
Process Control P.603
Current Output PID PID_P
1.10
2.00 2 P.605
Current Output Sample PI SPI_P
2 P.612
Pulse Output PID PIDP_P
1.10
2.00 2 P.618
Pulse Output Sample PI SPIP_P
2 P.623
Feed Forward FFD_P
2 P.629
Double Cross Limit DCL_P
1.10
2.00 2 P.633
Tag Operation P.638
Change Adjuster Mode CMLP_P
1.10
1 P.639
Change Push Button Mode CMPB_P
1.10
1 P.641
Change Sequence Mode CMSQ_P
1.10
1 P.643
Set SV SSV_P
1.10
1 P.645
Reset SV RSV_P
1.10
1 P.649
Set MV SMV_P
1.10
1 P.651
1.10 Instruction List
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
49
nv series V SERIES
Instruction Symbol
t
y
p
e
1
t
y
p
e
2
S
3
S
2
L
3
L
3
D
S
L
2
L
2
D
S
L
1
S
t
e
p
P
a
g
e
Tag Operation P.638
Reset MV RMV_P
1.10
1 P.655
Shut CV SCV_P
1.10
1 P.657
Push Button ON PB_P
1.10
1 P.661
Push Button Lock LB_P
1.10
1 P.664
Action Timer ACT_P
1.10
1 P.666
Action Counter ACC_P
1.10
1 P.670
Self Step Jump SJ_P
1.10
1 P.674
Reset Jump RJ_P
1.10
1 P.678
Reset Jump2 RJ_P2 1.60 1 P.682
SFC Initialize INI_STEP 1.60 1 P.684
RAS P.686
Cyclic Trace DATALOGC
2.17 2.52 2 P.687
Calendar Data Acquisition GET_CLND
1 P.689
Interlock Diagnosis DIAG_D
2.75 2 P.691
Interlock Diagnosis with First Fault
Diagnosis Permission Input
DIAG_D2 1.50
2.7J/
3.7E
2 P.694
SFC P.699
Step
1 P.701
Initial Step
2 P.703
Transition
2 P.704
Divergence/Conver
gence of Sequence
2 P.706
Divergence/Conver
gence of Simultaneous Sequences
2 P.707
Link
2 P.708
Action (BOOL type)
3 P.710
Action (User defined type)
3/5 P.710
Sequence
2 P.717
Phase Step
5 P.720
Chapter 1 For Programming
6F8C1226
50
nv series V SERIES
Instruction Symbol
t
y
p
e
1
t
y
p
e
2
S
3
S
2
L
3
L
3
D
S
L
2
L
2
D
S
L
1
S
t
e
p
P
a
g
e
SFC P.699
Phase End Step
1 P.723
Answer Step
3 P.725
Phase Step 2 1.60 4 P.727
Answer Step 2 1.60 3 P.729
2
Ph2
51
Chapter 2
LD/FBD Instructions
2.1 Contacts & Coils52
2.2 Execution Control 72
2.3 Counters 77
2.4 Timers85
2.5 FlipFlops 104
2.6 Moving111
2.7 Comparison 124
2.8 Selection 145
2.9 Type Conversion 167
2.10 Numeric Function 237
2.11 Logical Operation 259
2.12 Bit Operation 278
2.13 Arithmetic Operation 291
2.14 Data Processing 321
2.15 I/O 333
2.16 Process Operation 371
2.17 Program Control 451
2.18 String Processing 465
2.19 Control Statements 485
2.20 Communication 524
2.21 Duplex Control 594
2.22 Process Control 603
2.23 Tag Operation 638
2.24 RAS 686
Chapter 2 LD/FBD Instructions
6F8C1226
52
2.1 Contacts & Coils
No. Instruction Remarks
1
Normally Open Contact
2
Normally Closed Contact
3
Positive Transition-sensing
Contact
4
Negative Transition-sensing
Contact
5
Rising Edge Detector
6
Falling Edge Detector
7
Inverter
8
Coil
9
Negated Coil
10
SET Coil
11
RESET Coil
12
Positive Transition-sensing
Coil
13
Negative Transition-sensing
Coil
14
Forced Coil
15
Forced Negated Coil
16
Forced SET Coil
17
Forced RESET Coil
18
Forced Positive
Transition-sensing Coil
19
Forced Negative
Transition-sensing Coil
2.1 Contacts & Coils
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
53
Normally Open Contact
Contacts & Coils Normally Open Contact
LD/FBD language
notation
Variable (BOOL)
Input Output
EN input Edge execution Index modification
Modifier
Function
Normally open contact of variable (BOOL).
Input Condition Output
FALSE(OFF) Regardless of variable (BOOL) state FALSE(OFF)
Variable (BOOL)=FALSE(OFF) FALSE(OFF)
TRUE(ON)
Variable (BOOL)=TRUE(ON) TRUE(ON)
Program example
SIGNAL2 SIGNAL3
SIGNAL1
Coil SIGNAL3 is TRUE(ON) only when states of SIGNAL1 and SIGNAL2 are both
TRUE(ON).
SIGNAL1
SIGNAL2
SIGNAL3
Error information
When there is a boundary error due to index modification, the value of variable
(BOOL) is treated as FALSE(OFF) and the data boundary is exceeded.
Chapter 2 LD/FBD Instructions
6F8C1226
54
Normally Closed Contact
Contacts & Coils Normally Closed Contact
LD/FBD language
notation
Variable (BOOL)
Input Output
EN input Edge execution Index modification
Modifier
Function
Relay coil b contact (normally closed contact) corresponding to variable (BOOL).
Input Condition Output
FALSE(OFF) Regardless of variable (BOOL) state FALSE(OFF)
Variable (BOOL) = FALSE(OFF) TRUE(ON)
TRUE(ON)
Variable (BOOL) = TRUE(ON) FALSE(OFF)
Program example
SIGNAL2 SIGNAL3 SIGNAL1
Coil SIGNAL3 is TRUE(ON) only when states of both SIGNAL1, SIGNAL2 are
FALSE(OFF).
SIGNAL1
SIGNAL2
SIGNAL3
Error information
When there is a boundary error due to index modification, the value of variable
(BOOL) is treated as FALSE(OFF) and the data boundary is exceeded.
2.1 Contacts & Coils
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
55
Positive Transitionsensing Contact
Contacts & Coils Positive Transitionsensing Contact
LD/FBD language
notation
Variable (BOOL)
P Input Output
EN input Edge execution Index modification
Modifier
Function
The output is kept TRUE(ON) for one scan time only when the input is
TRUE(ON) and the variable (BOOL) changes from FALSE(OFF) to TRUE(ON).
Input Condition Output
FALSE (OFF) Regardless of variable (BOOL) state FALSE(OFF)
Variable (BOOL) = FALSE(OFF) FALSE(OFF) FALSE(OFF)
Variable (BOOL) = TRUE(ON) FALSE(OFF) FALSE(OFF)
Variable (BOOL) = FALSE(OFF) TRUE(ON) TRUE(ON)
TRUE (ON)
Variable (BOOL) = TRUE(ON) TRUE(ON) FALSE(OFF)
Program example
P
SIGNAL2 SIGNAL3
SIGNAL1
When the SIGNAL1 is TRUE(ON) and SIGNAL2 changes from FALSE(OFF)
to TRUE (ON), coil SIGNAL3 keeps TRUE(ON) for one scan time only.
t t t : 1 scan time
SIGNAL2
SIGNAL3
SIGNAL1
Error information
When there is a boundary error due to index modification, the value of variable
(BOOL) is treated as FALSE(OFF) and the data boundary is exceeded.
Chapter 2 LD/FBD Instructions
6F8C1226
56
Negative Transitionsensing Contact
Contacts & Coils Negative Transitionsensing Contact
LD/FBD language
notation
Variable (BOOL)
N Input Output
EN input Edge execution Index modification
Modifier
Function
The output is kept TRUE(ON) for one scan time when the input is TRUE(ON) and
variable (BOOL) changes from TRUE(ON) to FALSE(OFF).
Input Condition Output
FALSE(OFF) Regardless of variable (BOOL) state FALSE(OFF)
Variable (BOOL) = FALSE(OFF) FALSE(OFF) FALSE(OFF)
Variable (BOOL) = TRUE(ON) FALSE(OFF) TRUE(ON)
Variable (BOOL) = FALSE(OFF) TRUE(ON) FALSE(OFF)
TRUE(ON)
Variable (BOOL) = TRUE(ON) TRUE(ON) FALSE(OFF)
Program example
N
SIGNAL2 SIGNAL3
SIGNAL1
When the SIGNAL1 is TRUE(ON) and SIGNAL2 changed from TRUE(ON) to FALSE
(OFF), coil SIGNAL3 keeps TRUE(ON) for one scan time only.
t t t : 1 scan time
SIGNAL2
SIGNAL3
SIGNAL1
Error information
When there is a boundary error due to index modification, the value of variable
(BOOL) is treated as FALSE(OFF) and the data boundary is exceeded.
2.1 Contacts & Coils
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
57
Rising Edge Detector
Contacts & Coils Rising Edge Detector
LD/FBD language
notation
Input Output
EN input Edge execution Index modification
Modifier
Function
The output is kept TRUE(ON) for one scan time, when the input changes from
FALSE(OFF) to TRUE(ON).
Input Condition Output
FALSE(OFF) Regardless of previous input state FALSE(OFF)
Previous input = FALSE(OFF) TRUE(ON)
TRUE(ON)
Previous input = TRUE(ON) FALSE(OFF)
Program example
SIGNAL2
SIGNAL1
The coil SIGNAL2 keeps TRUE(ON) for one scan time only when SIGNAL1
changes from FALSE(OFF) to TRUE(ON).
t t t
t1 scan time
SIGNAL2
SIGNAL1
Chapter 2 LD/FBD Instructions
6F8C1226
58
Falling Edge Detector
Contacts & Coils Falling Edge Detector
LD/FBD language
notation
Input Output
EN input Edge execution Index modification
Modifier
Function
The output is kept TRUE(ON) for one scan time, when the input changes from
TRUE(ON) to FALSE(OFF).
Input Condition Output
Previous input = FALSE(OFF) FALSE(OFF)
FALSE(OFF)
Previous input = TRUE(ON) TRUE(ON)
TRUE(ON) Regardless of previous input state FALSE(OFF)
Program example
SIGNAL2
SIGNAL1
The coil SIGNAL2 keeps TRUE(ON) for one scan time only when the SIGNAL1
changes from TRUE(ON) to FALSE(OFF).
t t t
t : 1 scan time
SIGNAL2
SIGNAL1
2.1 Contacts & Coils
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
59
Inverter
Contacts & Coils Inverter
LD/FBD language
notation
I Input Output
EN input Edge execution Index modification
Modifier
Function
When the input is TRUE(ON), output is FALSE(OFF). When the input is FALSE (OFF),
the output is TRUE(ON).
Input Condition Output
FALSE(OFF) TRUE(ON)
TRUE(ON) FALSE(OFF)
Program example
I
SIGNAL2
SIGNAL1
When the SIGNAL1 is TRUE(ON), coil SIGNAL2 is FALSE(OFF).
When the SIGNAL1 is FALSE(OFF), coil SIGNAL2 is TRUE(ON).
SIGNAL2
SIGNAL1
Chapter 2 LD/FBD Instructions
6F8C1226
60
Coil
Contacts & Coils Coil
LD/FBD language
notation
Variable (BOOL)
Input
EN input Edge execution Index modification
Modifier
Function
Relay coil of a variable (BOOL) that stores the input state in the variable (BOOL).
Input Action Output
FALSE(OFF) Variable (BOOL)=FALSE(OFF)
TRUE(ON) Variable (BOOL)=TRUE(ON)
Program example
SIGNAL2 SIGNAL3
SIGNAL1
The coil SIGNAL3 is TRUE(ON) only when the state of both SIGNAL1 and SIGNAL2
are TRUE(ON).
SIGNAL2
SIGNAL3
SIGNAL1
Error information
When there is a boundary error due to index modification, the value of variable
(BOOL) is unchanged and the data boundary is exceeded.
2.1 Contacts & Coils
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
61
Negated Coil
Contacts & Coils Negated Coil
LD/FBD language
notation
Variable (BOOL)
Input
EN input Edge execution Index modification
Modifier
Function
The negated coil of a variable (BOOL) that stores the negated input state in the
variable (BOOL).
Input Action Output
FALSE(OFF) Variable (BOOL)=TRUE(ON)
TRUE(ON) Variable (BOOL)=FALSE(OFF)
Program example
SIGNAL2 SIGNAL3
SIGNAL1
The coil SIGNAL 3 is FALSE(OFF) only when the state of both SIGNAL1 and
SIGNAL2 are TRUE(ON).
SIGNAL2
SIGNAL3
SIGNAL1
Error information
When there is a boundary error due to index modification, the value of variable
(BOOL)is unchanged and the data boundary is exceeded.
Chapter 2 LD/FBD Instructions
6F8C1226
62
SET Coil
Contacts & Coils SET Coil
LD/FBD language
notation
Variable (BOOL)
S Input
EN input Edge execution Index modification
Modifier
Function
Set coil of a variable (BOOL) that sets variable (BOOL) to TRUE(ON) when the input
state is TRUE(ON).
Input Action Output
FALSE(OFF) Variable (BOOL)=unchanged
TRUE(ON) Variable (BOOL)=TRUE(ON)
Program example
SIGNAL2 SIGNAL3
SIGNAL1
S
The coil SIGNAL3 is set when the state of both SIGNAL1 and SIGNAL2 are
TRUE(ON). Then, SIGNAL3 remains TRUE(ON) even when SET coil input is
FALSE(OFF).
SIGNAL2
SIGNAL3
SIGNAL1
Error information
When there is a boundary error due to index modification, the value of variable
(BOOL) is unchanged and the data boundary is exceeded.
2.1 Contacts & Coils
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
63
RESET Coil
Contacts & Coils RESET Coil
LD/FBD language
notation
Variable (BOOL)
R Input
EN input Edge execution Index modification
Modifier
Function
Reset coil of a variable (BOOL) that resets variable (BOOL) to FALSE(OFF) when the
input state is TRUE(ON).
Input Action Output
FALSE(OFF) Variable (BOOL)=unchanged
TRUE(ON) Variable (BOOL)=FALSE(OFF)
Program example
SIGNAL2 SIGNAL3
SIGNAL1
R
The coil SIGNAL3 is reset when the state of both SIGNAL1 and SIGNAL2 are
TRUE(ON). Then, SIGNAL3 remains FALSE(OFF) even when RESET coil input is
FALSE(OFF).
SIGNAL2
SIGNAL3
SIGNAL1
Error information
When there is a boundary error due to index modification, the value of variable
(BOOL) is unchanged and the data boundary is exceeded.
Chapter 2 LD/FBD Instructions
6F8C1226
64
Positive Transition-sensing Coil
Contacts & Coils Positive Transition-sensing Coil
LD/FBD language
notation
Variable (BOOL)
P Input
EN input Edge execution Index modification
Modifier
Function
When the input changes from FALSE(OFF) to TRUE(ON), variable (BOOL) is kept to
TRUE(ON) for one scan time only.
Input Action Output
FALSE(OFF) Variable (BOOL)=FALSE(OFF)
When previous input=FALSE(OFF), variable
(BOOL)=TRUE(ON)
TRUE(ON)
When previous Input=TRUE(ON), variable
(BOOL)=FALSE(OFF)
Program example
SIGNAL2 SIGNAL1
P
The SIGNAL2 is kept to TRUE(ON) only when the SIGNAL1 changes from
FALSE(OFF) to TRUE(ON).
t t t
t : 1 scan time
SIGNAL2
SIGNAL1
Error information
When there is a boundary error due to index modification, the value of variable
(BOOL) is unchanged and the data boundary is exceeded. However, the input state for
pulse operation is saved.
2.1 Contacts & Coils
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
65
Negative Transition-sensing Coil
Contacts & Coils Negative Transition-sensing Coil
LD/FBD language
notation
Variable (BOOL)
N Input
EN input Edge execution Index modification
Modifier
Function
When the input changed from TRUE(ON) to FALSE(OFF), the variable (BOOL) is kept
to TRUE(ON) for one scan time only.
Input Action Output
When previous Input=FALSE(OFF),variable (BOOL)=FALSE(OFF)
FALSE(OFF)
When previous Input=TRUE(ON), variable (BOOL)=TRUE(ON)
TRUE(ON) Variable (BOOL)=FALSE(OFF)
Program example
SIGNAL2 SIGNAL1
N
The SIGNAL2 is TRUE(ON) for only one scan time, only when SIGNAL1 changes
from TRUE(ON) to FALSE(OFF).
t t t
t : 1 scan time
SIGNAL2
SIGNAL1
Error information
When there is a boundary error due to index modification, the value of variable
(BOOL) is unchanged and the data boundary is exceeded. However, the input state for
pulse operation is saved.
Chapter 2 LD/FBD Instructions
6F8C1226
66
Forced Coil
Contacts & Coils Forced Coil
LD/FBD language
notation
Input
Variable (BOOL)
EN input Edge execution Index modification
Modifier
Function
A coil that retains the state of a variable (BOOL) when forced, regardless of the input
state.
The operation as forced coil is not guaranteed when the same variable is used as coil
in more than one place.
Input Action Output
FALSE(OFF) Variable (BOOL)=retains previous state
TRUE(ON) Variable (BOOL)=retains previous state
Program example
SIGNAL2 SIGNAL1
The forced set state of SIGNAL2 is retained regardless of the state of SIGNAL1.
If the state of SIGNAL2 just before being forced set is TRUE(ON), the forced coil
retains the TRUE(ON) state (see Ex. 1).
If the state of SIGNAL2 just before being forced set is FALSE(OFF), the forced coil
retains the FALSE(OFF) state (see Ex. 2).
SIGNAL1
SIGNAL2
Set forced
Ex.1 Ex.2
Set forced Reset
forced
Reset
f orced
Error information
When there is a boundary error due to index modification, the value of variable
(BOOL) is unchanged and the data boundary is exceeded.
2.1 Contacts & Coils
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
67
Forced Negated Coil
Contacts & Coils Forced Negated Coil
LD/FBD language
notation
Input
Variable (BOOL)
EN input Edge execution Index modification
Modifier
Function
A negated coil that retains the state of a variable (BOOL) when forced, regardless of
the input state.
The operation as forced negated coil is not guaranteed when the same variable is
used as coil in more than one place.
Input Action Output
FALSE(OFF) Variable (BOOL)=retains previous
state
TRUE(ON) Variable (BOOL)=retains previous
state
Program example
SIGNAL2 SIGNAL1
The forced set state of SIGNAL2 is retained regardless of the state of SIGNAL1.
If the state of SIGNAL2 just before being forced set is FALSE(OFF), the forced
negated coil retains the FALSE(OFF) state (see Ex. 1).
If the state of SIGNAL2 just before being forced set is TRUE(ON), the forced negated
coil retains the TRUE(ON) state (see Ex. 2).
Ex.1 Ex.2
Set forced Set forced Reset
forced
Reset
forced
SIGNAL2
SIGNAL1
Error information
When there is a boundary error due to index modification, the value of variable
(BOOL) is unchanged and the data boundary is exceeded.
Chapter 2 LD/FBD Instructions
6F8C1226
68
Forced SET Coil
Contacts & Coils Forced SET Coil
LD/FBD language
notation
S Input
Variable (BOOL)
EN input Edge execution Index modification
Modifier
Function
A SET coil that retains the state of a variable (BOOL) when forced, regardless of the
input state.
The operation as forced SET coil is not guaranteed when the same variable is used as
coil in more than one place.
Input Action Output
FALSE(OFF) Variable (BOOL) = retains previous state
TRUE(ON) Variable (BOOL) = retains previous state
Program example
SIGNAL2 SIGNAL1
S
The forced set state of SIGNAL2 is retained regardless of the state of SIGNAL1.
If the state of SIGNAL2 just before being forced set is FALSE(OFF), the forced SET
coil retains the FALSE(OFF) state (see Ex. 1).
If the state of SIGNAL2 just before being forced set is TRUE(ON), the forced SET coil
retains the TRUE(ON) state (see Ex. 2).
SIGNAL1
SIGNAL2
Ex.1 Ex.2
Set forced Reset
forced
Set forced Reset
forced
Error information
When there is a boundary error due to index modification, the value of variable
(BOOL) is unchanged and the data boundary is exceeded.
2.1 Contacts & Coils
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
69
Forced RESET Coil
Contacts & Coils Forced RESET Coil
LD/FBD
language notation
R Input
Variable (BOOL)
EN input Edge execution Index modification
Modifier
Function
A RESET coil that retains the state of a variable (BOOL) when forced, regardless of
the input state.
The operation as forced RESET coil is not guaranteed when the same variable is used
as coil in more than one place.
Input Action Output
FALSE(OFF) Variable (BOOL) = retains previous state
TRUE(ON) Variable (BOOL) = retains previous state
Program example
SIGNAL2 SIGNAL1
R
The forced set state of SIGNAL2 is retained regardless of the state of SIGNAL1.
If the state of SIGNAL2 just before being forced set is TRUE(ON), the forced RESET
coil retains the TRUE(ON) state (see Ex. 1).
If the state of SIGNAL2 just before being forced set is FALSE(OFF), the forced RESET
coil retains the FALSE(OFF) state (see Ex. 2).
SIGNAL1
SIGNAL2
Ex.1 Ex.2
Reset
forced
Set forced Set forced Reset
forced
Error information
When there is a boundary error due to index modification, the value of variable
(BOOL) is unchanged and the data boundary is exceeded.
Chapter 2 LD/FBD Instructions
6F8C1226
70
Forced Positive Transition-sensing Coil
Contacts & Coils Forced Positive Transition-sensing Coil
LD/FBD language
notation
P Input
Variable (BOOL)
EN input Edge execution Index modification
Modifier
Function
A forced positive transitionsensing coil that retains the state of a variable (BOOL)
when forced, regardless of the input state.
The operation as forced positive transitionsensing coil is not guaranteed when the
same variable is used as coil in more than one place.
Input Action Output
FALSE(OFF) Variable (BOOL) = retains previous state
TRUE(ON) Variable (BOOL) = retains previous state
Program example
SIGNAL2 SIGNAL1
P
The forced set state of SIGNAL2 is retained regardless of the state of SIGNAL1.
If the state of SIGNAL2 just before being forced set is FALSE(OFF), the forced positive
transitionsensing coil retains the FALSE(OFF) state (see Ex. 1).
If the state of SIGNAL2 just before being forced set is TRUE(ON), the forced positive
transitionsensing coil retains the TRUE(ON) state (see Ex. 2).
SIGNAL1
SIGNAL2
Ex.1 Ex.2
t t
t : 1 scan time Set forced Reset
forced
Set forced Reset
forced
Error information
When there is a boundary error due to index modification, the value of variable
(BOOL) is unchanged and the data boundary is exceeded. However, the input state for
pulse operation is saved.
2.1 Contacts & Coils
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
71
Forced Negative Transition-sensing Coil
Contacts & Coils Forced Negative Transition-sensing Coil
LD/FBD language
notation
N Input
Variable (BOOL)
EN input Edge execution Index modification
Modifier
Function
A forced negative transition-sensing coil that retains the state of a variable (BOOL)
when forced, regardless of the input state.
The operation as forced negative transition-sensing coil is not guaranteed when the
same variable is used as coil in more than one place.
Input Action Output
FALSE(OFF) Variable (BOOL) = retains previous state
TRUE(ON) Variable (BOOL) = retains previous state
Program example
SIGNAL2 SIGNAL1
N
The forced set state of SIGNAL2 is retained regardless of the state of SIGNAL1.
If the state of SIGNAL2 just before being forced set is TRUE(ON), the forced negative
transitionsensing coil retains the TRUE(ON) state (see Ex. 1).
If the state of SIGNAL2 just before being forced set is FALSE(OFF), the forced
negative transitionsensing coil retains the FALSE(OFF) state (see Ex. 2).
SIGNAL2
SIGNAL1
Ex.1
Ex.2
t t
t : 1 scan time
t
Set forced Set forced Reset
forced
Reset
forced
Error information
When there is a boundary error due to index modification, the value of variable
(BOOL) is unchanged and the data boundary is exceeded. However, the input state for
pulse operation is saved.
Chapter 2 LD/FBD Instructions
6F8C1226
72
2.2 Execution Control
No. Instruction Remarks
1 Jump Control Set JCS
2 Jump Control Reset JCR
3 Jump
4 Label LABEL
5 Conditional Execution Instruction
6
End of Conditional Execution
Instruction
7 Master Control Set MCS
8 Master Control Reset MCR
2.2 Execution Control
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
73
Jump Control Set/Reset
Execution Control Jump Control Set/Reset
LD/FBD language
notation
Condition input JCS
Circuit P
JCR
EN input Edge execution Index modification
Modifier
Function
When the input to JCS is TRUE(ON), instructions between JCS and JCR are skipped
and instructions are executed from JCR.
When the input to JCS is FALSE(OFF), instructions between JCS and JCR are
executed.
JCS and JCR must be used as pair. JCS must always be described before JCR.
The JCS-JCR combination may be nested.
Input Action Output
FALSE(OFF) Jump not performed
TRUE(ON) Jump performed
Program example
SIGNAL1
JCS
JCR
Circuit A
Circuit B
When the SIGNAL1 is FALSE(OFF), Circuit A and Circuit B instructions are executed.
When the SIGNAL1 is TRUE(ON), Circuit A is not executed and instructions are
executed from Circuit B.
Chapter 2 LD/FBD Instructions
6F8C1226
74
Jump/Label
Execution Control Jump/Label
LD/FBD language
notation
Condition input
Circuit P
Label
Label
LABEL:
EN input Edge execution Index modification
Modifier
Function
When the input to jump instruction is TRUE(ON), instructions between Jump and
Label are skipped and instructions are executed from Label instruction.
When the input to jump instruction is FALSE(OFF), instructions between jump and
label are executed.
Jump and Label instructions must be used as pair. The JumpLabel instructions may
be nested.
Input Action Output
FALSE(OFF) Jump not performed
TRUE(ON) Jump performed
Program example
SIGNAL1
Circuit A
Circuit B
JMP_A
LABEL
JMP_A
When the SIGNAL1 is FALSE(OFF), Circuit A and Circuit B instructions are executed.
When the SIGNAL1 is TRUE(ON), Circuit A is not executed and instructions are
executed from Circuit B.
2.2 Execution Control
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
75
Conditional Execution Instruction/End of Conditional Execution Instruction
Execution Control
Conditional Execution Instruction/End of Conditional
Execution Instruction
LD/FBD language
notation
Condition
input
Circuit P
EN input Edge execution Index modification
Modifier
Function
When the input to Conditional execution instruction is FALSE(OFF), instructions
between Conditional execution instruction and End of conditional execution instruction
are skipped and instructions are executed from End of conditional execution
instruction.
When the input to Conditional execution instruction is TRUE(ON), instructions
between Conditional execution instruction and End of conditional execution instruction
are executed.
Conditional execution instruction and End of conditional execution instruction must be
used as pair.
The Conditional execution instruction and end of conditional execution instruction may
be nested.
Input Action Output
FALSE(OFF) Jump performed
TRUE(ON) Jump not performed
Program example
SIGNAL1
Circuit A
Circuit B
When SIGNAL1 is TRUE(ON), Circuit A and Circuit B instructions are executed.
When SIGNAL1 is FALSE(OFF), Circuit A is not executed and instructions are
executed from Circuit B.
Chapter 2 LD/FBD Instructions
6F8C1226
76
Master Control Set/Reset
Execution Control Master Control Set/Reset
LD/FBD
language notation
Condition input MCS
Circuit P
MCR
EN input Edge execution Index modification
Modifier
Function
When input to MCS is FALSE(OFF), the power rail input between MCS and MCR is
reset to FALSE(OFF).
When input to MCS is TRUE(ON), normal operation is performed.
MCS and MCR must be used as pair. MCS must always come before MCR. MCS
MCR combination cannot be nested.
Input Action Output
FALSE(OFF) Power rail input FALSE(OFF)
TRUE(ON) Normal operation
Program example
Circuit A1
Circui t A2
SIGNAL1
MCS
MCR
Circuit B
MOVE_INT SAMPLE1
ST
1234
LD
MOVE_INT
EN ENO
5678
LD
SIGNAL2
SIGNAL3
SAMPLE2
SET
When SIGNAL1 is FALSE(OFF):
Circuit A1, Circuit B : Normal operation
Circuit A2 : Operates as SIGNAL2 input=FALSE(OFF) with
SIGNAL3=FALSE(OFF) and SAMPLE2=previous value.
When SIGNAL1 is TRUE(ON), Circuit A1, Circuit A2 and Circuit B operate normally.
2.3 Counters
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
77
2.3 Counters
No. Instruction Remarks
1 Up Counter CTU
2 Down Counter CTD
3 Up Down Counter CTUD
Chapter 2 LD/FBD Instructions
6F8C1226
78
Up Counter
Counters Up Counter
LD/FBD language
notation
Instance name
CTU
Count up command
Reset command
Preset value
Count up status
Current value
CU
R
PV
Q
CV
EN input Edge execution Index modification
Modifier
ST language notation [Instance name] ( CU, R, PV );
[Variable name]: = [Instance name]. Q;
[Variable name]: = [Instance name]. CV;
Arguments
Arg. Operand Type Const. Description
CU BOOL
Count up command
R BOOL
Preset value
Q BOOL Count up status
Output
CV INT Current value
Instance structure
Name Type Description Remarks
Q BOOL Count up status
CV INT Current value
Can be accessed from the user program.
Function
When the Reset command R is TRUE(ON), the current value CV is initialized to 0.
However, count up at the rising edge of the count up command is not performed while
R=TRUE(ON).
When the Reset command R is FALSE(OFF), count up is performed at the rising edge
of the count up input.
When the current value CV reaches a preset value PV, count up status Q is set to
TRUE(ON).
Input Output
CU R
Action
Q CV
TRUE(ON) Not executed 0
FALSE(OFF)
TRUE(ON)
CV=CV+1 until PV is reached.
Otherwise
FALSE(OFF)
When CV<PV
FALSE(OFF)
When CV=PV
TRUE(ON)
Current
CV
2.3 Counters
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
79
Program example
[LD/FBD language notation]
Up_Ctr
CTU
SAMPLE1
LD
SIGNAL1
SIGNAL2
SIGNAL3
SAMPLE2
ST
SIGNAL1
SAMPLE2
SIGNAL2
SIGNAL3
SAMPLE1
CU
R
PV
Q
CV
[ST language notation]
Up_Ctr( SIGNAL1, SIGNAL2, SAMPLE1);
SIGNAL3 := Up_Ctr.Q;
SAMPLE2 := Up_Ctr.CV;
While SIGNAL2 is TRUE(ON), SAMPLE2 becomes 0 because current value CV is
initialized.
When SIGNAL2 is FALSE(OFF), count up is performed when SIGNAL1 changes from
FALSE(OFF) to TRUE(ON).
When the preset value of SAMPLE1 is equal to the current value, SIGNAL3 becomes
TRUE(ON) because count up status Q becomes TRUE(ON).
Remark
Positive transitionsensing contact or rising edge detector need not be programmed prior to
number up input CU because number up input CU detects the rising edge with Up counter
instruction.
Error information
If preset value PV is less than 0, Up Counter instruction is executed with 0 as the
limit.
Chapter 2 LD/FBD Instructions
6F8C1226
80
Down Counter
Counters Down Counter
LD/FBD language
notation
Instance name
CTD
Count down command
Load command
Preset value
Count down status
Current value
CD
LD
PV
Q
CV
EN input Edge execution Index modification
Modifier
ST language notation [Instance name] ( CD, LD, PV );
[Variable name] : =[Instance name]. Q;
[Variable name : =[Instance name]. CV;
Arguments
Arg. Operand Type Const. Description
CD BOOL
Preset value
Q BOOL Count down status
Output
CV INT Current value
Instance structure
Name Type Description Remarks
Q BOOL Count down status
CV INT Current value
Can be accessed from the user program.
Function
When the Load command LD is TRUE(ON), the current value CV is initialized with
preset value PV. However, while LD = TRUE(ON), count down is not performed at
the rising edge of the Count Down command.
When the Load command LD is FALSE(OFF), count down is performed at the rising
edge of the count down input.
When the current value CV reaches 0, the count down status Q is set to TRUE(ON).
Input Output
CD LD
Action
Q CV
TRUE(ON) Not executed PV
FALSE(OFF)
TRUE(ON)
CV=CV-1 until 0 is reached
Otherwise
FALSE(OFF)
When CV>0
FALSE(OFF)
When CV=0
TRUE(ON)
Current
CV
2.3 Counters
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
81
Program example
[LD/FBD language notation]
Dn_Ctr
CTD
SAMPLE1
LD
SIGNAL1
SIGNAL2
SIGNAL3
SAMPLE2
ST
SIGNAL1
SAMPLE2
SIGNAL2
SIGNAL3
SAMPLE1
CD
LD
PV
Q
CV
[ST language notation]
Dn_Ctr (SIGNAL1, SIGNAL2, SAMPLE1);
SIGNAL3 := Dn_Ctr.Q;
SAMPLE2 := Dn_Ctr.CV;
While SIGNAL2 is TRUE(ON), SAMPLE2 becomes preset value PV because current
value CV is initialized.
When SIGNAL2 is FALSE(OFF), count down is performed when SIGNAL1 changes
from FALSE(OFF)TRUE(ON). The current value is stored in SAMPLE2.
When SAMPLE2 which is the current value becomes 0, SIGNAL3 becomes
TRUE(ON) because the count down status Q becomes TRUE(ON).
Remark
Positive transitionsensing contact or rising edge detector need not be programmed prior to
number down input CU because count down input CD detects the rising edge with Down
Counter instruction.
Error information
If preset value PV is less than 0, Down Counter instruction is executed with 0 as the
limit.
Chapter 2 LD/FBD Instructions
6F8C1226
82
Up Down Counter
Counters Up Down Counter
LD/FBD language
notation
Instance name
CTUD
Reset command
Preset value
CU
CD
R
LD
PV
QU
QD
CV
Count down command
Load command
Count up command
Count down status
Count up status
Current value
EN input Edge execution Index modification
Modifier
ST language notation [Instance name]( CU, CD, R, LD, PV );
[Variable name] : = [Instance name]. QU;
[Variable name] : = [Instance name]. QD;
[Variable name] : = [Instance name]. CV;
Arguments
Arg. Operand Type Const. Description
CU BOOL
Count d command
CD BOOL
Reset command
LD BOOL
Load command
Input
PV INT
Preset value
QU BOOL Count up status
QD BOOL Count down status Output
CV INT Current value
Instance structure
Name Type Description Remarks
QU BOOL Count up status
QD BOOL Count down status
CV INT Current value
Can be accessed from the user program.
Function
When the Reset command R is TRUE(ON), current value CV is initialized to 0.
When the Load command LD is TRUE(ON) and the Reset command R is
FALSE(OFF), the current value CV is initialized with preset value PV.
While R= TRUE(ON) or LD= TRUE(ON), count at the rising edge of the count up
command and count down command are not performed.
2.3 Counters
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
83
When the Reset command R and Load command LD are FALSE(OFF), count up is
performed at the rising edge of the count up input.
When the Reset command R and Load command LD are FALSE(OFF), count down is
performed at the rising edge of the count down input.
When the current value CV reaches a preset value PV, count up status QU is set to
TRUE(ON).
When the current value CV reaches 0, count down status QD is set to TRUE(ON).
When both the count up input CU and count down input CD are TRUE(ON), count
operation is not performed.
Input Output
CU CD R LD
Action
QU QD CV
TRUE(ON) 0
FALSE(OFF) TRUE(ON)
Not executed
PV
TRUE(ON) TRUE(ON)
When CV<PV
FALSE(OFF)
When CV>0
FALSE(OFF)
FALSE(OFF)
TRUE(ON)
FALSE(OFF)
CV=CV+1 until
PV is reached
FALSE(OFF)
FALSE(OFF)
TRUE(ON)
FALSE(OFF) FALSE(OFF)
CV=CV -1 until
0 is reached
When
CV=PV
TRUE(ON)
When CV=0
TRUE(ON)
Current
CV
Program example
[LD/FBD language notation]
Ud_Ctr
CTUD
SAMPLE1
LD
SIGNAL1
SIGNAL2
SIGNAL5
SAMPLE2
ST
SIGNAL1
SAMPLE2
SIGNAL2
SIGNAL5
SAMPLE1
CU
CD
R
SIGNAL6
LD
PV
QU
QD
CV
SIGNAL3
SIGNAL4
SIGNAL3
SIGNAL4
SIGNAL6
[ST language notation]
Ud_Ctr( SIGNAL1, SIGNAL2, SIGNAL3, SIGNAL4, SAMPLE1);
SIGNAL5 := Ud_Ctr.QU;
SIGNAL6 := Ud_Ctr.QD;
SAMPLE2 := Ud_Ctr.CV;
While SIGNAL3 is TRUE(ON), SAMPLE2 becomes 0 because current value CV is
initialized.
Chapter 2 LD/FBD Instructions
6F8C1226
84
While SIGNAL3 is FALSE(OFF) and SIGNAL4 is TRUE(ON), SAMPLE2 becomes
preset value PV because current value CV is initialized.
Count up is performed when SIGNAL1 changes from FALSE(OFF) to TRUE(ON) and
count down is performed when SIGNAL2 changes from FALSE(OFF) to TRUE(ON).
The current value is stored in SAMPLE2. However, count is not performed when
SIGNAL1 and SIGNAL2 are both TRUE(ON).
When SAMPLE2 which is the current value reaches the preset value PV, SIGNAL5
becomes TRUE(ON).
When SAMPLE2 which is the current value reaches 0, SIGNAL6 becomes
TRUE(ON).
Remark
Positive transition-sensing contact or rising edge detector need not be programmed prior to
count up input CU or count down input CD because count up input CU and number down input
CD detect the rising edge with Up Down Counter instruction.
Error information
If preset value PV is less than 0, Up Down Counter instruction is executed with 0 as
the limit.
2.4 Timers
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
85
2.4 Timers
No. Instruction Remarks
1 On-Delay Timer (0.1ms) TON_100us
2 On-Delay Timer (1ms) TON
3 On-Delay Timer (10ms) TON_10ms
4 On-Delay Timer (100ms) TON_100ms
5
On-Delay Timer (0.1 minute)
TONM_P
PCS compatible
instruction
6 Off-Delay Timer (0.1ms) TOF_100us
7 Off-Delay Timer (1ms) TOF
8 Off-Delay Timer (10ms) TOF_10ms
9 Off-Delay Timer (100ms) TOF_100ms
10
Off-Delay Timer (0.1 minute)
TOFM_P
PCS compatible
instruction
11 Pulse Timer (0.1ms) TP_100us
12 Pulse Timer (1ms) TP
13 Pulse Timer (10ms) TP_10ms
14 Pulse Timer (100ms) TP_100ms
15
Single Shot (100ms)
SS_P
PCS compatible
instruction
16
Single Shot (0.1 minute)
SSM_P
PCS compatible
instruction
17 Real Time Clock RTC V dedicated instruction
18 Real Time Clock RTC_N nv dedicated instruction
19 On/Off-Delay Timer (REAL) DEL_L
TOSDIC compatible
instruction
Chapter 2 LD/FBD Instructions
6F8C1226
86
Important
For Integrated Controller V series, change the preset time in the timer stop state (*1).
If it is changed in the time up state (Preset time (PT) Duration (CT)), the output may change in
a controller in which "PT change support in time up state" has not been done.
PT change support in time up state Timer setting
value Not supported Supported
PT >ET
Restarts clock until ETPT; Output (Q)
changes depending on the relation
between PT and ET.
PT<ET Limits ET to PT.
Holds both Output (Q) and Duration
(ET).
New setting value (PT) becomes
effective upon restart after the timer
stops.
*1 : Timer stop state
Timer
instruction
Timer activation
command IN
TON*** FALSE(OFF)
TOF*** TRUE(ON)
TP*** FALSE(OFF)
SS*** FALSE(OFF)
OT change support in time up state version in the [Integrated Controller V series]
Version
Controller Not
supported
Supported
S2PU22/32/72 Up to V02.03 V02.04 -
S2PU22A/32A/72A/72D N/A V02.50 -V03.70 - S2
S2PU82 N/A V02.00 -V03.00 -
S3PU** Up to V02.05 V02.06 -V02.10 -
S3
S3PU**A N/A V02.50 -V03.70 -
L1 L1PU1*HLC5** Up to V02.49 V02.50 -
L2PU1* Up to V03.00 V03.10 -
L2
L2PU22 Up to V03.0D V03.10 -
L3PU11 Up to V03.00 V03.10 -
L3
L3PU21 Up to V03.0K V03.10 -
2.4 Timers
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
87
OnDelay Timer (0.1ms/1ms/10ms/100ms/0.1min)
Timers
OnDelay Timer
(0.1ms/1ms/10ms/100ms/0.1min)
*1
LD/FBD language
notation
TON
Instance name
Timer activation command
Preset time
Time up status
Duration PT
IN Q
ET
TON_
Instance name
Timer activation command
Preset time
Time up status
Duration PT
IN Q
ET
TONM_P
Instance name
Timer activation command
Preset time
Tim up status
Duration PT
IN Q
ET
*1) PCS compatible instruction
EN input Edge execution Index modification Modifier
ST language notation [Instance name] ( IN, PT );
[Variable name] : = [Instance name]. Q;
[Variable name] : = [Instance name]. ET;
Arguments
TON (1ms unit)
Arg. Operand Type Const. Description
IN BOOL
Preset time
Q BOOL Time up status
Output
ET TIME Duration
TON_TONM_P[ indicates 100us (0.1ms unit), 10ms (10ms unit) or 100ms
(100ms unit)].
Arg. Operand Type Const. Description
IN BOOL
Preset time
Q BOOL Time up status
Output
ET DINT Duration
Chapter 2 LD/FBD Instructions
6F8C1226
88
Instance structure
TON (1ms unit)
Name Type Description Remarks
Q BOOL Time up status
ET TIME Duration
Can be accessed from the user program.
TON_/TONM_P[ indicates 100us (0.1ms unit), 10ms (10ms unit) or 100ms
(100ms unit)]
Name Type Description Remarks
Q BOOL Time up status
ET DINT Duration
Can be accessed from the user program.
Function
When timer activation command IN is TRUE(ON), time up status Q set to TRUE(ON).
Duration ET is added.
When timer activation command IN is FALSE(OFF)m duration ET is cleared to 0.
The setting range of preset time PT is as follows:
TON_100us (0.1ms timer) : 0 to 21474836470.1ms [59h39m8s364.7ms
(2.48551348day)]
TON (1ms timer) : 0 to 2147483647ms [596h31m23s647ms
(24.8551348day)]
TON_10ms (10ms timer) : 0 to 214748364710ms [5965h13m56s470ms
(248.551348day)]
TON_100ms (100ms timer) : 0 to 2147483647100ms [59652h19m24s700ms
(2485.51348day)]
TONM_P (0.1min timer) : 0 to 21474836470.1 min [3579139h24m42s
(149130.8088day)]
The data type of PT/ET is TIME for TON, and DINT for TON_100us/ TON_10ms/
TON_100ms/ TONM_P.
Output Input
IN
Action
Q ET
FALSE(OFF) Not executed FALSE(OFF) 0
Duration<Preset time FALSE(OFF)
TRUE(ON) Executed
DurationPreset time TRUE(ON)
Current ET
2.4 Timers
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
89
Program example
[LD/FBD language notation]
Ondelay_1
TON
IN Q
PT ET
SAMPLE1
LD
SIGNAL1
SIGNAL2
SAMPLE2
ST
SIGNAL1
SAMPLE2
SIGNAL2
SAMPLE1
[ST language notation]
Ondelay_1( SIGNAL1, SAMPLE1);
SIGNAL2 := Ondelay_1.Q;
SAMPLE2 := Ondelay_1.ET;
After SIGNAL1 becomes TRUE(ON), SIGNAL2, which is time up status, is set to
TRUE(ON) after the preset time specified with SAMPLE1 elapses. Duration is stored
to SAMPLE2
The content of duration after duration ET reaches the preset time specified with
SAMPLE1 is held as long as SIGNAL1 is TRUE(ON).
When SIGNAL1 is FALSE(OFF), duration ET is cleared, SAMPLE2 becomes 0 , and
SIGNAL2, which is time up status, is set to FALSE(OFF).
Error information
If preset time PT is less than 0, Off-Delay timer instruction takes an absolute value for
operation.
For the Integrated Controller V series L controller, the internal timer minimum unit is
100ms, so update is made in units of 100ms even if TON instruction of 1ms unit is
used.
Chapter 2 LD/FBD Instructions
6F8C1226
90
Off-Delay Timer (0.1ms/1ms/10ms/100ms/0.1min)
Timers Off-Delay Timer(0.1ms /1ms/10ms/100ms/0.1min) *1
LD/FBD language
notation
TOF
Instance name
Timer activation
command
Preset time
Time up status
Duration PT
IN Q
ET
TOF_
Instance name
Timer activation
command
Preset time
Time up status
Duration PT
IN Q
ET
TOFM_P
Instance name
Preset time
Time up status
Duration PT
IN Q
ET
(1*) CS-compatible
instruction
Timer activation
command
EN input Edge execution Index modification Modifier
ST language notation [Instance name] ( IN, PT );
[Variable name] : = [Instance name]. Q;
[Variable name] : = [Instance name]. ET;
Arguments
TOF (1ms unit)
Arg. Operand Type Const. Description
IN BOOL
Preset time
Q BOOL Time up status
Output
ET TIME Duration
TOF_TOFM_P[ indicates 100us(0.1ms unit), 10ms (10ms unit) or 100ms
(100ms unit)]
Arg. Operand Type Const. Description
IN BOOL
Preset time
Q BOOL Time up status
Output
ET DINT Duration
2.4 Timers
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
91
Instance structure
TOF (1ms unit)
Name Type Description Remarks
Q BOOL Time up status
ET TIME Duration
Can be accessed from the user program.
TOF_/TOFM_P[ indicates 100us (0.1ms unit), 10ms (10ms unit) or 100ms
(100ms unit)]
Name Type Description Remarks
Q BOOL Time up status
ET DINT Duration
Can be accessed from the user program.
Function
After timer activation command IN becomes FALSE(OFF), time up status Q is set to
FALSE(OFF) after preset time elapses.
Duration ET is added.
The setting range of preset time PT is as follows:
TOF_100us (0.1ms timer) : 0 to 21474836470.1ms [59h39m8s364.7ms
(2.48551348day)]
TOF (1ms timer) : 0 to 2147483647ms [596h31m23s647ms
(24.8551348day)]
TOF_10ms (10ms timer) : 0 to 214748364710ms [5965h13m56s470ms
(248.551348day)]
TOF_100ms (100ms timer) : 0 to 2147483647100ms [59652h19m24s700ms
(2485.51348day)]
TOFM_P (0.1 min timer) : 0 to 21474836470.1 min [3579139h24m42s
(149130.8088day)]
The data type of PT/ET is TIME for TOF, and DINT for TOF_100us/TOF_10ms/TOF_
100ms/TOFM_P.
Output Input
IN
Action
Q ET
Duration<Preset time TRUE(ON)
FALSE(OFF) Executed
DurationPreset time FALSE(OFF)
Current ET
TRUE(ON) Not executed TRUE(ON) 0
Chapter 2 LD/FBD Instructions
6F8C1226
92
Program example
[LD/FBD language notation]
Offdelay_1
TOF
IN Q
PT ET
SAMPLE1
LD
SIGNAL1
SIGNAL2
SAMPLE2
ST
SIGNAL1
SAMPLE2
SIGNAL2
SAMPLE1
[ST language notation]
Offdelay_1( SIGNAL1, SAMPLE1);
SIGNAL2 := Offdelay_1.Q;
SAMPLE2 := Offdelay_1.ET;
After SIGNAL1 becomes FALSE(OFF), SIGNAL2 is set to FALSE(OFF) after the
preset time specified with SAMPLE1 elapses. Duration is stored to SAMPLE2.
The content of duration ET after duration reaches the preset time specified with
SAMPLE1 is held as long as SIGNAL1 is FALSE(OFF).
When SIGNAL1 is TRUE(ON), duration ET is cleared, SAMPLE2 becomes 0, and
SIGNAL2, which is time up status, is set to TRUE(ON).
Error information
If preset time PT is less than 0, Pulse Timer instruction takes an absolute value for
operation.
For the Integrated Controller V series L controller, the internal timer minimum unit is
100ms, so update is made in units of 100ms even if TOF instruction of 1ms unit is
used.
2.4 Timers
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
93
Pulse Timer (0.1ms/1ms/10ms/100ms)
Timers Pulse Timer (0.1ms/1ms/10ms/100ms)
LD/FBD language
notation
TP
Instance name
Timer activation command
Preset time
Time up status
Duration PT
IN Q
ET
TP_
Instance name
Timer activation command
Preset time
Time up status
Duration PT
IN Q
ET
EN input Edge execution Index modification Modifier
ST language notation [Instance name] ( IN, PT );
[Variable name]:=[Instance name]. Q;
[Variable name]:=[Instance name]. ET;
Arguments
TP (1ms unit)
Arg. Operand Type Const. Description
IN BOOL
Timer activation command
Input
PT TIME
Preset time
Q BOOL Time up status
Output
ET TIME Duration
TP_[ indicates 100us(0.1ms unit), 10ms (10ms unit) or 100ms (100ms unit)]
Arg. Operand Type Const. Description
IN BOOL
Preset time
Q BOOL Time up status
Output
ET DINT Duration
Chapter 2 LD/FBD Instructions
6F8C1226
94
Instance structure
TP (1ms unit)
Name Type Description Remarks
Q BOOL Time up status
ET TIME Duration
Can be accessed from the user program.
TP_ [ indicates 100us(0.1ms unit), 10ms (10ms unit) or 100ms (100ms unit)]
Name Type Description Remarks
Q BOOL Time up status
ET DINT Duration
Can be accessed from the user program.
Function
After timer activation command IN becomes TRUE(ON), time up status Q is set to
TRUE(ON) until the preset time elapses.
Duration ET is added.
When timer activation command becomes FALSE(OFF) after the preset time elapses,
duration ET is cleared.
The setting range of preset time PT is as follows:
TP_100us (0.1mstimer) 0 to 21474836470.1ms [59h39m8s364.7ms
(2.48551348day)]
TP (1mstimer) 0 to 2147483647ms [596h31m23s647ms
(24.8551348day)]
TP_10ms (10mstimer) 0 to 214748364710ms [5965h13m56s470ms
(248.551348day)]
TP_100ms (100mstimer) 0 to 2147483647100ms [59652h19m24s700ms
(2485.51348day)]
The data type of PT/ET is TIME for TP and DINT for TP_100us/TP_10ms/TP_100ms.
Output Input
IN
Action
Q ET
FALSE(OFF) Not executed FALSE(OFF) 0
Duration<Preset time TRUE(ON)
TRUE(ON) Executed
DurationPreset time FALSE(OFF)
Current ET
2.4 Timers
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
95
Program example
[LD/FBD language notation]
Plstimer_1
TP
IN Q
PT ET
SAMPLE1
LD
SIGNAL1
SIGNAL2
SAMPLE2
ST
SIGNAL1
SAMPLE2
SIGNAL2
SAMPLE1
[ST language notation]
Plstimer_1( SIGNAL1, SAMPLE1);
SIGNAL2 := Plstimer_1.Q;
SAMPLE2 := Plstimer_1.ET;
After SIGNAL1 becomes TRUE(ON), SIGNAL2 is set to TRUE(ON) until the preset
time specified with SAMPLE1 elapses. After duration reaches the preset time,
SIGNAL2 becomes FALSE(OFF). Duration is stored to SAMPLE2.
Duration ET is still updated even if SIGNAL1 becomes FALSE(OFF) before duration
ET reaches the preset time specified with SAMPLE1.
The content of duration after duration ET reaches the preset time specified with
SAMPLE1 is held as long as SIGNAL1 is TRUE(ON). When SIGNAL1 becomes
FALSE(OFF), duration is cleared to 0 and 0 is stored to SAMPLE2 as the result.
Error information
If preset time PT is less than 0, Pulse Timer instruction takes an absolute value for
operation.
For the Integrated Controller V series L controller, the internal timer minimum unit is
100ms, so update is made in units of 100ms even if TP instruction of 1ms unit is used.
Chapter 2 LD/FBD Instructions
6F8C1226
96
Timers Single Shot (100ms/0.1min)
PCS
compatible
instruction
LD/FBD language
notation
SS_P
Instance name
Timer activation command
Preset time
Time up status
Duration PT
IN Q
ET
SSM_P
Instance name
Timer activation command
Preset time
Time up status
Duration PT
IN Q
ET
EN input Edge execution Index modification Modifier
ST language notation [Instance name] ( IN, PT );
[Variable name] : = [Instance name]. Q;
[Variable name] : = [Instance name]. ET;
Arguments
Arg. Operand Type Const. Description
IN BOOL
Preset time
Q BOOL Time up status
Output
ET DINT Duration
Instance structure
Name Type Description Remarks
Q BOOL Time up status
ET DINT Duration
Can be accessed from the user program.
Function
After Timer activation command IN becomes TRUE(ON), time up status Q is set to
TRUE(ON) until preset time elapses.
Duration ET is added.
If timer activation command becomes FALSE(OFF) before the timer expires, the time
up status also becomes FALSE(OFF).
After preset time has elapsed, duration ET is cleared when Timer activation command
becomes FALSE(OFF).
Single Shot (100ms/0.1min)
2.4 Timers
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
97
The setting range of preset time PT is as follows:
SS_P (100ms timer) 0 to 2147483647100ms [59652h19m24s700ms
(2485.51348day)]
SSM_P (0.1min timer) 0 to 21474836470.1 min [3579139h24m42s
(149130.8088day)]
Output Input
IN
Action
Q ET
FALSE(OFF) Not executed FALSE(OFF) 0
Duration<Preset time TRUE(ON)
TRUE(ON) Executed
DurationPreset time FALSE(OFF)
Current ET
Program example
[LD/FBD language notation]
SS_1
SS_P
IN Q
PT ET
SAMPLE1
LD
SIGNAL1
SIGNAL2
SAMPLE2
ST
SIGNAL1
SAMPLE2
SIGNAL2
SAMPLE1
[ST language notation]
SS_1( SIGNAL1, SAMPLE1);
SIGNAL2 := SS_1.Q;
SAMPLE2 := SS_1.ET;
After SIGNAL1 becomes TRUE(ON), SIGNAL2 is TRUE(ON) until preset time
specified with SAMPLE1 elapses. After the duration reaches a preset time, SIGNAL2
becomes FALSE(OFF). Duration is stored in SAMPLE2.
When SIGNAL1 becomes FALSE(OFF) before duration ET reaches the preset time
specified with SAMPLE1, SAMPLE2 which is the duration becomes 0. SIGNAL2
which is the time up status also becomes FALSE(OFF).
After duration ET has reached the preset time specified with SAMPLE1, its content is
retained while SIGNAL1 is TRUE(ON). When SIGNAL1 becomes FALSE(OFF),
duration is cleared to 0 and 0 is stored in SAMPLE2.
Error information
When preset time PT is less than 0, the Pulse timer instruction operates on the
absolute value. When preset time PT=0, the time up status becomes TRUE(ON) for
just one scan.
Chapter 2 LD/FBD Instructions
6F8C1226
98
Real Time Clock
Timers Real Time Clock
V dedicated
instruction
LD/FBD language
notation
Instance name
RTC
Date and time of day
update command
Preset date and time of day
Output
Current date and
time of day
PDT
IN Q
CDT
EN input Edge execution Index modification Modifier
ST language notation [Instance name] ( IN, PDT, CDT );
[Variable name] : = [Instance name]. Q;
Arguments
Arg. Operand Type Const. Description
IN BOOL
Date and time of day update
command Input
PDT DT Preset date and time of day
Q BOOL Output
Output
CDT DT Current date and time of day
Instance structure
Name Type Description Remarks
Q BOOL Output Can be accessed from the user program.
Function
When the Date and time of day update command IN changes from FALSE(OFF) to
TRUE(ON), the calendar is updated with the specified preset date and time of day
PDT. (The millisecond part of PDT is ignored, and the calendar is updated with the
PDT value).
When Date and time of day update command IN is TRUE(ON), the current calendar
content is output to current date and time of day CDT.
The state of Date and time of day update command IN is output to Output Q.
Output Input
IN
Action
Q CDT
FALSE(OFF) Not executed FALSE(OFF) Not updated
Previous input = FALSE(OFF) :
Update calendar (PDTCDT)
TRUE(ON) Executed
Previous inputTRUE(ON) :
Current date and time of dayCDT
TRUE(ON) CDT
2.4 Timers
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
99
Program example
[LD/FBD language notation]
RTC_1
RTC
IN Q
PDT CDT
SAMPLE1
LD
SIGNAL1
SIGNAL2
SAMPLE2
ST
[ST language notation]
RTC_1( SIGNAL1, SAMPLE1, SAMPLE2);
SIGNAL2 := RTC_1.Q;
When SIGNAL1 changes from FALSE(OFF) to TRUE(ON), the calendar is updated
with the preset date and time of day specified with SAMPLE1.
While SIGNAL1 is TRUE(ON), the current time is output to SAMPLE2.
SIGNAL2 becomes TRUE(ON) when SIGNAL1 is TRUE(ON) and SIGNAL2 becomes
FALSE(OFF) when SIGNAL1 is FALSE(OFF).
Error information
The calendar is not updated when the content of preset date and time of day PDT is
abnormal.
Chapter 2 LD/FBD Instructions
6F8C1226
100
Real Time Clock
Timers Real Time Clock
nv dedicated
instruction
LD/FBD language
notation
Instance name
RTC_N
Date and time of day
update command
Preset date/time
Output complete
Current date/time PDT
IN Q
CDT
EN input Edge execution Index modification Modifier
ST language notation [Instance name] ( IN, PDT, CDT );
[Variable name] : = @[Instance name]. Q;
Argument
Arg. Operand Type Const. Description
IN BOOL
Date and time of day update
command Input
PDT DT Preset date/time
Q BOOL Output complete
Output
CDT DT Current date/time
Instance structure
Name Type Description Remarks
Q BOOL
Output
complete
Can be accessed from the user program.
Function
When the date and time of day command IN changes from FALSE(OFF) to TRUE(ON),
the calendar is updated with the specified preset date and time of day PDT.
When the date and time of day command IN is TRUE(ON), the current calendar
content is output to the current date and time of day CDT.
When date and time of day update is complete, output Q is set to TRUE(ON).
Output Input
IN
Action
Q CDT
FALSE(OFF) Not executed FALSE(OFF)
revious input=FALSE(OFF) :
Calendar is updated
FALSE(OFF)
Not updated
TRUE(ON) Executed
Previous input=TRUE(ON) :
Current date/timeCDT
TRUE(ON) Current CDT
2.4 Timers
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
101
Program example
[LD/FBD language notation]
RTC_1
RTC_N
IN Q
PDT CDT
SAMPLE1
LD
SIGNAL1
SIGNAL2
SAMPLE2
ST
[ST language notation]
RTC_1( SIGNAL1, SAMPLE1, SAMPLE2);
SIGNAL2 :=@RTC_1.Q;
When SIGNAL1 changes from FALSE(OFF) to TRUE(ON), the calendar is updated
with the preset date and time of day specified with SAMPLE1. After the calendar is
updated, completion output SIGNAL2 becomes TRUE(ON).
Current day/time is output to SAMPLE2, after SIGNAL1 becomes TRUE(ON) and the
calendar is updated.
Error information
The calendar is not updated when the content of preset date and time of day PDT is
abnormal. Completion output outputs the state of Date and time of day update
command IN.
Chapter 2 LD/FBD Instructions
6F8C1226
102
On/Off-Delay Timer
timers On/Off-Delay Timer
TOSDIC compatible
instruction
LD/FBD language
notation
Instance name
DEL_L
Input flag
On-delay time
Result output
On-delay elapsed time H1
U1 Y
ON
Off-delay time H2 OFF Off-delay elapsed time
EN input Edge execution Index modification Modifier
ST language notation [Instance name] ( U1, H1, H2 );
[Variable name] : = [Instance name]. Y;
[Variable name] : = [Instance name]. ON;
[Variable name] : = [Instance name]. OFF;
Arguments
Arg. Operand Type Const. Description
U1 BOOL
Input flag
H1 REAL
Off-delay time(0)[sec]
Y BOOL Result output
ON REAL On-delay elapsed time[sec] Output
OFF REAL Off-delay elapsed time[sec]
Instance structure
Name Type Description Remarks
Y BOOL Result output
ON REAL On-delay elapsed time[sec]
OFF REAL Off-delay elapsed time[sec]
Can be accessed from the user program.
Function
After input flag U1 becomes TRUE(ON), result output is set to TRUE(ON) after
on-delay time H1. After input flag U1 becomes FALSE(OFF), result output is set to
FALSE(OFF) after off-delay time H2.
After input flag U1 becomes TRUE(ON), result output Y is set to TRUE(ON) after
on-delay time H1.
After input flag U1 becomes FALSE(OFF), result output Y is set to FALSE(OFF) after
off-delay time H2.
2.4 Timers
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
103
When the input becomes OFF during on-delay, off-delay time measurement starts
while continuing on-delay.
When the input becomes ON during off-delay, off-delay is stopped, the output is
inversed, and then on-delay is started.
When the input becomes OFF during on-delay and becomes ON again during
off-delay, off-delay is stopped and on-delay is started again.
If off-delay is shorter than on-delay (off-delay is stopped during on-delay operation),
there is no output.
Time
Input U1
OutputY
On-delay time
Off-delay time
Input becomes OFF
during on-delay
Normal
operation
Input becomes ON
during off-delay
Input is changed during
on/off-delay
Off-delay is stopped
during on-delay
On/Off delay time is
measured at the same time
On-delay is
stopped output
is inversed
On-delay is started
again, off-delay is
stopped
Program example
[LD/FBD language notation]
DEL_1
DEL_L
U1 Y
H1 ON
H2 OFF
DP11LD
S1
S2
DP12LD
ON_TIME ST
OFF_TIME ST
[ST language notation]
DEL_1( S1, DP11, DP12);
S2 := DEL_1.Y;
ON_TIME := DEL_1.ON;
OFF_TIME := DEL_1.OFF;
S2, where ON change of S1 is delayed for DP11 [sec] and OFF change of S1 is
delayed for DP12 [sec], is output.
Error information
If on/off-delay time is a negative number, On/Off-Delay Timer instruction takes an
absolute value for operation.
When on/offdelay time =0, Input U1=Output Y.
If on/off-delay time is nonnumeric, nonnumeric abnormal is set to TRUE(ON), and the
instruction itself is not processed.
Chapter 2 LD/FBD Instructions
6F8C1226
104
2.5 Flip-Flops
No. Instruction Remarks
1 Set Type Flip-Flop SR
2 Reset Type Flip-Flop RS
3 Semaphore SEMA
2.5 Flip-Flops
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
105
Set Type Flip-Flop
FlipFlops Set Type Flip-Flop
LD/FBD language
notation
Instance name
SR
Set input
Reset input
Output
R
S1 Q1
EN input Edge execution Index modification Modifier
ST language notation [Instance name] ( S1, R );
[Variable name] : = [Instance name]. Q1;
Arguments
Arg. Operand Type Const. Description
S1 BOOL
Set input
Input
R BOOL
Reset input
Output Q1 BOOL Output
Instance structure
Name Type Description Remarks
Q1 BOOL Output Can be accessed from the user program.
Function
When set input S1 is TRUE(ON), output Q1 is set to TRUE(ON) regardless of the
input state of reset input R.
When set input S1 is FALSE(OFF) and reset input R is TRUE(ON), output Q1 is reset
to FALSE(OFF).
Output Q1 is unchanged when set input S1 and reset input R are both FALSE(OFF).
Input Output
S1 R
Action
Q1
FALSE(OFF) FALSE(OFF) Not executed
Retain
previous value
FALSE(OFF) TRUE(ON) FALSE(OFF)
TRUE(ON)
Executed
TRUE(ON)
Chapter 2 LD/FBD Instructions
6F8C1226
106
Program example
[LD/FBD language notation]
FF_1
SR
S1 Q1
R
SIGNAL1
SIGNAL2
SIGNAL3
SIGNAL1
SIGNAL2
SIGNAL3
[ST language notation]
FF_1 ( SIGNAL1, SIGNAL2);
SIGNAL3 := FF_1.Q1;
When SIGNAL1 is TRUE(ON), SIGNAL3 becomes TRUE(ON).
When SIGNAL1 is FALSE(OFF) and SIGNAL2 is TRUE(ON), SIGNAL3 becomes
FALSE(OFF).
When SIGNAL1 and SIGNAL2 are both FALSE(OFF), SIGNAL3 retains the previous
value.
2.5 Flip-Flops
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
107
Reset Type Flip-Flop
FlipFlop Reset Type Flip-Flop
LD/FBD language
notation
Instance name
RS
Set input
Reset input
Output
R1
S Q1
EN input Edge execution Index modification Modifier
ST language notation [Instance name] ( S, R1 );
[Variable name] : = [Instance name] . Q1;
Argument
Arg. Operand Type Const. Description
S BOOL
Set input
Input
R1 BOOL
Reset input
Output Q1 BOOL Output
Instance structure
Name Type Description Remarks
Q1 BOOL Output Can be accessed from the user program.
Function
When reset input R1 is TRUE(ON), output Q1 is reset to FALSE(OFF) regardless of
the input state of set input S.
When reset input R1 is FALSE(OFF) and set input S is TRUE(ON), output Q1 is set to
TRUE(ON).
Output Q1 is unchanged when set input S and reset input R1 are both FALSE(OFF).
Input Output
S R1
Action
Q1
FALSE(OFF) FALSE(OFF) Not executed
Retains
previous value
* TRUE(ON) FALSE(OFF)
TRUE(ON) FALSE(OFF)
Executed
TRUE(ON)
Chapter 2 LD/FBD Instructions
6F8C1226
108
Program example
[LD/FBD language notation]
FF_1
RS
S Q1
R1
SIGNAL1
SIGNAL2
SIGNAL3
SIGNAL1
SIGNAL2
SIGNAL3
[ST language notation]
FF_1( SIGNAL1, SIGNAL2);
SIGNAL3 := FF_1.Q1;
When SIGNAL2 is TRUE(ON), SIGNAL3 is reset to FALSE(OFF).
When SIGNAL2 is FALSE(OFF) and SIGNAL1 is TRUE(ON), SIGNAL3 becomes
TRUE(ON).
When SIGNAL1 and SIGNAL2 are both FALSE(OFF), SIGNAL3 retains the previous
value.
2.5 Flip-Flops
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
109
Semaphore
FlipFlop Semaphore
LD/FBD language
notation
Instance name
SEMA
Test and set
command
Release command
Semaphore status
output
CLAIM
RELEASE
BUSY
EN input Edge execution Index modification Modifier
ST language notation [Instance name] ( CLAIM, RELEASE );
[Variable name] := [Instance name]. BUSY;
Argument
Arg. Operand Type Const. Description
CLAIM BOOL
Release command
Output BUSY BOOL Semaphore status output
Instance structure
Name Type Description Remarks
BUSY BOOL Semaphore status output Can be accessed from the user program.
X BOOL Internal variable
Cannot be accessed from the user
program.
Function
Initially, resets internal variable X to FALSE(OFF).
State of internal variable X is output to semaphore status output BUSY.
After internal variable X is output to semaphore status output BUSY, internal variable X
is set to TRUE(ON) when test and set command CLAIM is TRUE(ON).
When test and set command CLAIM is FALSE(OFF) and release command RELEASE
is TRUE(ON) after internal variable X is output to semaphore status output BUSY,
semaphore state output BUSY and internal variable X are reset to FALSE(OFF)
Input Output
CLAIM RELEASE
Action
BUSY
FALSE(OFF) FALSE(OFF) BUSY=Internal variable Xn1
TRUE(ON)
BUSY=Internal variable Xn1
Internal variable XnTRUE(ON)
Previous Xn1
FALSE(OFF) TRUE(ON)
Semaphore state output =
FALSE(OFF)
Internal variable Xn = FALSE(OFF)
FALSE(OFF)
Chapter 2 LD/FBD Instructions
6F8C1226
110
Program example
[LD/FBD language notation]
SEMA_1
SEMA
CLAIM BUSY
RELEASE
SIGNAL1
SIGNAL2
SIGNAL3
SIGNAL1
SIGNAL2
X
SEMA_1 Execution timing
SIGNAL3
[ST language notation]
SEMA_1 ( SIGNAL1, SIGNAL2);
SIGNAL3 := SEMA_1.BUSY;
The state of internal variable X after executing previous SEMA_1 is output to SIGNAL3.
Except when SIGNAL1= FALSE(OFF) and SIGNAL2 = TRUE(ON).
When SIGNAL1 is TRUE(ON), internal variable X is set to TRUE(ON).
When SIGNAL1 is FALSE(OFF) and SIGNAL2 is TRUE(ON), internal variable X and
SIGNAL3 become FALSE(OFF).
2.6 Moving
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
111
2.6 Moving
No. Instruction Remarks
1 Normally Open Contact Gate
2 Normally Closed Contact Gate
3 Move Data MOVE
4 Move Table Data TMOV
5 Data Exchange XCHG
6 Initialize Table Data TINZ
Chapter 2 LD/FBD Instructions
6F8C1226
112
Normally Open Contact Gate
Moving Normally Open Contact Gate
LD/FBD language
notation
Inaput
Variable (BOOL)
Output
EN input Edge execution Index modification
Modifier
Arguments
The following data types are supported for input and output:
Arg. Operand Type Const. Description Remarks
Input
Input
Output
See below
Output
Input Output
INT INT
DINT DINT
UINT UINT
REAL REAL
WORD WORD
DWORD DWORD
TIME TIME
TOD TOD
DATE DATE
Input
Variable
Output
Function
Combination of Normally Open Contact Gate instruction and ST instruction or function
and function block input.
When variable (BOOL) is TRUE(ON), input data is output as the result.
When variable (BOOL) is FALSE(OFF), output is set to 0.
Variable (BOOL) Action Output
FALSE(OFF) 0
TRUE(ON)
Executed
Input data
2.6 Moving
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
113
Combination of Normally Open Contact Gate instruction and SET instruction
When variable (BOOL) is TRUE(ON), input data is output as the result.
When variable (BOOL) is FALSE(OFF), previous value is retained.
Variable (BOOL) Action Output
FALSE(OFF)
Retain
previous value
TRUE(ON)
Executed
Input data
Program example
Normally Open Contact Gate instruction + ST instruction
SIGNAL1
SAMPLE1
LD
SAMPLE2
ST
When SIGNAL1 is TRUE(ON), content of SAMPLE1 is moved to SAMPLE2.
When SIGNAL1 is FALSE(OFF), 0 is moved to SAMPLE2.
Normally Open Contact Gate instruction + SET instruction
SIGNAL1
SAMPLE1
LD
SAMPLE2
SET
When SIGNAL1 is TRUE(ON), content of SAMPLE1 is moved to SAMPLE2.
When SIGNAL1 is FALSE(OFF), SAMPLE2 retains the previous value.
Error information
When there is a boundary error due to index modification, Normally Open
Contact Gate instruction is executed with the value of variable (BOOL) reset to
FALSE(OFF) and the data boundary is exceeded.
Chapter 2 LD/FBD Instructions
6F8C1226
114
Normally Closed Contact Gate
Moving Normally Closed Contact Gate
LD/FBD language
notation
Input
Variable (BOOL)
Output
EN input Edge execution Index modification
Modifier
Arguments
The following data types are supported for input and output:
Arg. Operand Type Const. Description Remarks
Input
Input
Output
See below
Output
Input Output
INT INT
DINT DINT
UINT UINT
REAL REAL
WORD WORD
DWORD DWORD
TIME TIME
TOD TOD
DATE DATE
Variable
Input Output
Function
Combination of Normally Closed Contact Gate instruction and ST instruction or
function and function block input
When variable (BOOL) is FALSE(OFF), input data is output as result.
When variable (BOOL) is TRUE(ON), output is set to 0.
Variable (BOOL) Action Output
FALSE(OFF) Input data
TRUE(ON)
Executed
0
2.6 Moving
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
115
Combination of Normally Closed Contact Gate instruction and SET instruction
When variable (BOOL) is FALSE(OFF), input data is output as result.
When variable (BOOL) is TRUE(ON), previous value is retained.
Variable (BOOL) Action Output
FALSE(OFF) Input data
TRUE(ON)
Executed Retain
previous value
Program example
Normally Closed Contact Gate instruction + ST instruction
SIGNAL1
SAMPLE1
LD
SAMPLE2
ST
When SIGNAL1 is FALSE(OFF), content of SAMPLE1 is moved to SAMPLE2.
When SIGNAL1 is TRUE(ON), 0 is moved to SAMPLE2.
Normally Closed Contact Gate instruction + SET instruction
SIGNAL1
SAMPLE1
LD
SAMPLE2
SET
When SIGNAL1 is FALSE(OFF), content of SAMPLE1 is moved to SAMPLE2.
When SIGNAL1 is TRUE(ON), SAMPLE2 retains the previous value.
Error information
When there is a boundary error due to index modification, Normally Closed Contact
Gate instruction is executed with the value of variable (BOOL) reset to FALSE(OFF)
and the data boundary is exceeded.
Chapter 2 LD/FBD Instructions
6F8C1226
116
Move Data
Moving Move Data
LD/FBD language
notation Input Output MOVE_
EN input Edge execution Index modification Modifier
ST language notation Output := MOVE_
( Input );
Arguments
The following data types are supported for input and output arguments and the
instruction symbol depends on the data type:
Arg. Operand Type Const. Description Remarks
Input
Input
Output
See below
Output
Input Output
MOVE_
Input Symbol(_
) Output
INT MOVE_INT INT
DINT MOVE_DINT DINT
UINT MOVE_UINT UINT
REAL MOVE_REAL REAL
WORD MOVE_WORD WORD
DWORD MOVE_DWORD DWORD
TIME MOVE_TIME TIME
TOD MOVE_TOD TOD
DATE MOVE_DATE DATE
DT MOVE_DT DT
STRING MOVE_STRING STRING
Function
Input data is output as result.
The following variables can be specified for input and output for MOVE_DT and
MOVE_STRING instructions:
Controller Instruction Variable
Integrated Controller V series MOVE_STRING
Unified Controller nv series
MOVE_DT
MOVE_STRING
Variables other than direct I/O
variables
2.6 Moving
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
117
Program example
[LD/FBD language notation]
SAMPLE1
1234
LD
SAMPLE2
1234
ST
MOVE_INT
[ST language notation]
SAMPLE2 := MOVE_INT( SAMPLE1 );
Content of SAMPLE1 1234 is moved to SAMPLE2.
Error information
During MOVE_DT, MOVE_STRING instructions, if the input table or output table
exceeds the specified range, table transfer is not performed and the data boundary is
exceeded.
During MOVE_DT, MOVE_STRING instructions, table transfer is not performed if
direct I/O variable is specified for input table or output table.
Controller Instruction Variable
Integrated Controller V series MOVE_STRING
Transfer is not executed.
Error flag is set to TRUE(ON).
Unified Controller nv series
MOVE_DT
MOVE_STRING
Transfer is not executed.
Error flag and table operation
error flag are set to TRUE(ON).
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
Chapter 2 LD/FBD Instructions
6F8C1226
118
Move Table Data
Moving Move Table Data
LD/FBD language
notation
Input table Output table
TMOV
Transfer word
number
TBL
N
EN input Edge execution Index modification Modifier
ST language notation TMOV( TBL, N, output table );
Arguments
Arg. Operand Type Const. Description Remarks
TBL PTR Input table
Input
N UINT
Transfer word
number
1N1024
Output PTR Output table
Function
N data words starting at input table are transferred as block to output table.
One to 1024 words may be transferred. If N=0, no table transfer is performed.
When transferring 2W length data such as DINT, REAL, TIME, TOD, DATE or
DWORD, up to 512 data can be transferred by specifying transfer words 2.
Following operation is performed if input table and output table overlap.
Controller Action
S controller
The content of input table is transferred to output
table.
Integrated Controller
L controller
Overlapped data of input and output tables cannot be
transferred.
Unified Controller nv series
The content of input table is transferred to output
table.
Direct I/O variable cannot be specified for input table or output table.
Batch
transfer
Output table
Input table
N word N word
2.6 Moving
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
119
Important
Move Table Data instruction (TMOV) is to transfer memory images as block at high speed. It is
recommended to convert input table and output table to variables declared by array and
structure.
Program example
[LD/FBD language notation]
ARRAY1
LD
ARRAY2
ST
TMOV
TBL
N
8
LD
1234
2345
3456
4567
5678
6789
7890
8901
ARRAY1 ARRAY2
1234
2345
3456
4567
5678
6789
7890
8901
8 words
[ST language notation]
TMOV( ARRAY1, 8, ARRAY2);
The eight words source data starting from ARRAY1 are transferred as block to
destination starting at ARRAY2.
Error information
If the number of transfer words exceed 1024, operation is performed with 1024 as the
limit.
If the input table or output table exceeds the specified range, table transfer is not
performed and the data boundary is exceeded.
The following operation is performed if direct I/O variable is specified for input and
output tables.
Controller Action
S controller
Table transfer is not executed.
Error flag is set to TRUE(ON)
Integrated Controller
V series
L controller
Table transfer is not executed.
Error flag and table operation error flag are set to
TRUE(ON).
Unified Controller nv series
Table transfer is not executed.
Error flag and table operation error flag are set to
TRUE(ON).
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
Chapter 2 LD/FBD Instructions
6F8C1226
120
Data Exchange
Moving Data Exchange
LD/FBD language
notation
Input 1 Output 1
XCHG_
Input 2 Output 2
Instance name
IN1
IN2
OUT1
OUT2
EN input Edge execution Index modification Modifier
ST language notation [Instance name] ( IN1, IN2 );
[Variable name] : = [Instance name]. OUT1;
[Variable name] : = [Instance name]. OUT2;
Arguments
The following data types are supported for input and output arguments and the
instruction symbol depends on the data type:
Arg. Operand Type Const. Description
IN1
Input1
Input
IN2
Input2
OUT1 Output1
Output
OUT2
See below
Output2
Input 1,2 Symbol (_
) Output 1,2
INT XCHG_INT INT
DINT XCHG_DINT DINT
UINT XCHG_UINT UINT
REAL XCHG_REAL REAL
WORD XCHG_WORD WORD
DWORD XCHG_DWORD DWORD
TIME XCHG_TIME TIME
TOD XCHG_TOD TOD
DATE XCHG_DATE DATE
Instance structure
Name Type Description Remarks
OUT1 See above Output1
OUT2 See above Output2
Can be accessed from the user program.
Input 1 Output 1
Input 2 Output 2
XCHG_
IN1
IN2
OUT1
OUT2
2.6 Moving
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
121
Function
Input data IN1 is output to OUT2 and IN2 is output to OUT1.
Input data IN1
Input data IN2
Output data OUT1
Output data OUT2
Program example
[LD/FBD language notation]
SAMPLE1
1234
LD
SAMPLE1
5678
ST
XCHG_INT
IN1 OUT1
IN2 OUT2
SAMPLE2
5678
LD
Xchg_1
SAMPLE2
1234
ST
[ST language notation]
Xchg_1( SAMPLE1, SAMPLE2);
SAMPLE1 := Xchg_1.OUT1;
SAMPLE2 := Xchg_1.OUT2;
Contents of SAMPLE1 and SAMPLE2 are exchanged.
Chapter 2 LD/FBD Instructions
6F8C1226
122
Initialize Table Data
Moving Initialize Table Data
LD/FBD language
notation
Initialization data Output table
TINZ_
Count
IN
N
EN input Edge execution Index modification Modifier
ST language notation TINZ_
Initialization
data
Input
N UINT
Count 1N1024
Output PTR Output table
Initialization data Symbol(_
)
INT TINZ_INT
DINT TINZ_DINT
UINT TINZ_UINT
REAL TINZ_REAL
WORD TINZ_WORD
DWORD TINZ_DWORD
TIME TINZ_TIME
TOD TINZ_TOD
DATE TINZ_DATE
DT TINZ_DT
Initialization data Output table
TINZ_
IN
N
Count
Function
An N word block starting at output table is initialized with initialization data IN.
One to 1024 words may be transferred. If N=0, no table initialization is performed.
Direct I/O variable cannot be specified for output table.
2.6 Moving
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
123
Initi al izati on data
IN
Output table
N words
Program example
[LD/FBD language notation]
SAMPLE1
LD
ARRAY1
ST
TINZ_INT
IN
N
8
LD
1234
SAMPLE1 ARRAY1
1234
1234
1234
1234
1234
1234
1234
1234
8 words
[ST language notation]
TINZ_INT( SAMPLE1, 8, ARRAY1);
Eight words block starting at variable ARRAY1 is initialized with content of
SAMPLE1 1234.
Error information
If the number of transfer words exceed 1024, operation is performed with 1024 as the
limit.
If the input table or output table exceeds the specified range, table transfer is not
performed and the data boundary is exceeded.
The following operation is performed if direct I/O variable is specified for input and
output tables:
Controller Action
S controller
Table transfer is not executed.
Error flag is set to TRUE(ON).
Integrated Controller
V series
L controller
Table transfer is not executed.
Error flag and table operation error flag are set to
TRUE(ON).
Unified Controller nv series
Table transfer is not executed.
Error flag and table operation error flag are set to
TRUE(ON).
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
Chapter 2 LD/FBD Instructions
6F8C1226
124
2.7 Comparison
No. Instruction Remarks
1 Greater Than GT
2 Greater Than or Equal GE
3 Equal EQ
4 Less Than or Equal LE
5 Less Than LT
6 Not Equal NE
7 Comparison with Hysteresis (greater than) GT_L
TOSDIC compatible
instruction
8 Comparison with Hysteresis (less than) LT_L
TOSDIC compatible
instruction
9
Comparison with Hysteresis
(greater than or equal)
GE_L
TOSDIC compatible
instruction
10
Comparison with Hysteresis
(less than or equal)
LE_L
TOSDIC compatible
instruction
2.7 Comparison
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
125
Greater Than
Comparison Greater Than
LD/FBD language
notation
Input 1 Output
GT_
Input 2
Input n
EN input Edge execution Index modification Modifier
ST language notation Output := GT_
Input1n 2n15
Output BOOL Output
Input 1n Symbol (_
)
INT GT_INT
DINT GT_DINT
UINT GT_UINT
REAL GT_REAL
WORD GT_WORD
DWORD GT_DWORD
TIME GT_TIME
TOD GT_TOD
DATE GT_DATE
DT GT_DT
Input 1 Output
GT_
Input 2
Input n
Function
Compares the value of input data and outputs the comparison result.
Input Condition Output
Input1>Input2>>Input n is satisfied TRUE(ON) Input data
Input 1Input n Input1>Input2>>Input n is not satisfied FALSE(OFF)
Chapter 2 LD/FBD Instructions
6F8C1226
126
Up to 15 input data are allowed.
Input1 to n must have the same data type.
The following operation is performed when the input data type is REAL:
Controller Action
Integrated Controller V series
Input data up to INF compare the magnitude relation.
NAN input data do not compare the magnitude relation.
Unified Controller nv series
INF and NAN input data is limited by the maximum value to
compare the magnitude relation.
Program example
[LD/FBD language notation]
SAMPLE1
7777
LD
GT_INT
SAMPLE2
6666
LD
SAMPLE3
5555
LD
SAMPLE4
4444
LD
SIGNAL1
1
ST
[ST language notation]
SIGNAL1 := GT_INT( SAMPLE1, SAMPLE2, SAMPLE3, SAMPLE4);
Compares the data in SAMPLE1 to 4 and outputs TRUE(ON) to SIGNAL1 because
the condition SAMPLE1 SAMPLE2 SAMPLE3 SAMPLE4 is satisfied.
Error information
The following operation is performed when the input data type is REAL:
Controller Action
Integrated Controller V series FALSE(OFF) is output as the result if NAN is input.
Unified Controller nv series NAN and INF data are limited by the maximum value.
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
2.7 Comparison
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
127
Greater Than or Equal
Comparison Greater Than or Equal
LD/FBD language
notation
Input 1 Output
GE_
Input 2
Input n
EN input Edge execution Index modification Modifier
ST language notation Output := GE_
Input1n 2n15
Output BOOL Output
Input 1n Symbol(_
)
INT GE_INT
DINT GE_DINT
UINT GE_UINT
REAL GE_REAL
WORD GE_WORD
DWORD GE_DWORD
TIME GE_TIME
TOD GE_TOD
DATE GE_DATE
DT GE_DT
Input 1 Output
GE_
Input 2
Input n
Chapter 2 LD/FBD Instructions
6F8C1226
128
Function
Compares the value of input data and outputs the comparison result.
Input Condition Output
Input1Input2Input is satisfied TRUE(ON)
Input data
Input 1Input n
Input1Input2Input n is not
satisfied
FALSE(OFF)
Up to 15 input data are allowed.
Input1 to n must have the same data type.
The following operation is performed when the input data type is REAL:
Controller Action
Integrated Controller V series
Input data up to INF compare the magnitude relation.
NAN input data do not compare the magnitude
relation.
Unified Controller nv series
INF and NAN input data are limited by the maximum
value to compare the magnitude relation.
Program example
[LD/FBD language notation]
SAMPLE1
7777
LD
GE_INT
SAMPLE2
6666
LD
SAMPLE3
6666
LD
SAMPLE4
5555
LD
SIGNAL1
1
ST
[ST language notation]
SIGNAL1 := GE_INT( SAMPLE1, SAMPLE2, SAMPLE3, SAMPLE4);
Compares the data in SAMPLE1 to 4 and outputs TRUE(ON) to SIGNAL1 because
the condition SAMPLE1 SAMPLE2 SAMPLE3 SAMPLE4 is satisfied.
Error information
The following operation is performed when the input data type is REAL:
Controller Action
Integrated Controller V series FALSE(OFF) is output as the result if NAN is input.
Unified Controller nv series
NAN and INF data are limited by the maximum
value.
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
2.7 Comparison
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
129
Equal
Comparison Equal
LD/FBD language
notation
Input 1 Output
EQ_
Input 2
Input n
EN input Edge execution Index modification Modifier
ST language notation Output := EQ_
Input1n 2n15
Output BOOL Output
Input 1n Symbol (_)
INT EQ_INT
DINT EQ_DINT
UINT EQ_UINT
REAL EQ_REAL
WORD EQ_WORD
DWORD EQ_DWORD
TIME EQ_TIME
TOD EQ_TOD
DATE EQ_DATE
DT EQ_DT
Input 1 Output
EQ_
Input 2
Input n
Chapter 2 LD/FBD Instructions
6F8C1226
130
Function
Compares the value of input data and outputs the comparison result.
Input Condition Output
Input1 = Input2 == Input n is satisfied TRUE(ON) Input data
Input 1Input n Input1 = Input2 == Input n is not satisfied FALSE(OFF)
Up to 15 input data are allowed.
Input1 to n must have the same data type.
The following operation is performed when the input data type is REAL:
Controller Action
Integrated Controller V series
Input data up to INF compare the magnitude relation.
NAN input data do not compare the magnitude
relation.
Unified Controller nv series
INF and NAN input data are limited by the maximum
value to compare the magnitude relation.
Program example
[LD/FBD language notation]
SAMPLE1
1234
LD
EQ_INT
SAMPLE2
1234
LD
SAMPLE3
1234
LD
SAMPLE4
1234
LD
SIGNAL1
1
ST
[ST language notation]
SIGNAL1 := EQ_INT( SAMPLE1, SAMPLE2, SAMPLE3, SAMPLE4);
Compares the data in SAMPLE1 to 4 and outputs TRUE(ON) to SIGNAL1
because the condition SAMPLE1=SAMPLE2=SAMPLE3=SAMPLE4 is
satisfied.
Error information
The following operation is performed when the input data type is REAL:
Controller Action
Integrated Controller V series FALSE(OFF) is output as the result if NAN is input.
Unified Controller nv series NAN and INF data are limited by the maximum value.
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
2.7 Comparison
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
131
Less Than or Equal
Comparison Less Than or Equal
LD/FBD language
notation
Input 1 Output
LE_
Input 2
Input n
EN input Edge execution Index modification Modifier
ST language notation Output := LE_
Input1n 2n15
Output BOOL Output
Input 1n Symbol (_
)
INT LE_INT
DINT LE_DINT
UINT LE_UINT
REAL LE_REAL
WORD LE_WORD
DWORD LE_DWORD
TIME LE_TIME
TOD LE_TOD
DATE LE_DATE
DT LE_DT
Input 1 Output
LE_
Input 2
Input n
Chapter 2 LD/FBD Instructions
6F8C1226
132
Function
Compares the value of input data and outputs the comparison result.
Input Condition Output
Input1Input2Input n is satisfied TRUE(ON)
Input data
Input 1Input n
Input1Input2Input n is not
satisfied
FALSE(OFF)
Up to 15 input data are allowed.
Input1 to n must have the same data type.
The following operation is performed when the input data type is REAL:
Controller Action
Integrated Controller V series
Input data up to INF compare the magnitude relation.
NAN input data do not compare the magnitude
relation.
Unified Controller nv series
INF and NAN input data are limited by the maximum
value to compare the magnitude relation.
Program example
[LD/FBD language notation]
SAMPLE1
1111
LD
LE_INT
SAMPLE2
2222
LD
SAMPLE3
2222
LD
SAMPLE4
3333
LD
SIGNAL1
1
ST
[ST language notation]
SIGNAL1 := LE_INT (SAMPLE1, SAMPLE2, SAMPLE3, SAMPLE4);
Compares the data in SAMPLE1 to 4 and outputs TRUE(ON) to SIGNAL1 because
the condition SAMPLE1 SAMPLE2 SAMPLE3 SAMPLE4 is satisfied.
Error information
The following operation is performed when the input data type is REAL:
Controller Action
Integrated Controller V series When NAN is input, the result is FALSE(OFF).
Unified Controller nv series
NAN and INF data are limited by the maximum
value.
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
2.7 Comparison
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
133
Less Than
Comparison Less Than
LD/FBD language
notation
Input 1 Output
LT_
Input 2
Input n
EN input Edge execution Index modification Modifier
ST language notation Output := LT_
Input1n 2n15
Output BOOL Output
Input 1n Symbol(_
)
INT LT_INT
DINT LT_DINT
UINT LT_UINT
REAL LT_REAL
WORD LT_WORD
DWORD LT_DWORD
TIME LT_TIME
TOD LT_TOD
DATE LT_DATE
DT LT_DT
Input 1 Output
LT_
Input 2
Input n
Chapter 2 LD/FBD Instructions
6F8C1226
134
Function
Compares the value of input data and outputs the comparison result.
Input Condition Output
Input1<Input2<<Input n is satisfied TRUE(ON)
Input data
Input1Inputn
Input1<Input2<<Input n is not
satisfied
FALSE(OFF)
Up to 15 input data are allowed.
Input1 to n must have the same data type.
The following operation is performed when the input data type is REAL:
Controller Action
Integrated Controller V series
Input data up to INF compare the magnitude relation.
NAN input data do not compare the magnitude
relation.
Unified Controller nv series
INF and NAN input data are limited by the maximum
value to compare the magnitude relation.
Program example
[LD/FBD language notation]
SAMPLE1
1111
LD
LT_INT
SAMPLE2
2222
LD
SAMPLE3
3333
LD
SAMPLE4
4444
LD
SIGNAL1
1
ST
[ST language notation]
SIGNAL1 := LT_INT( SAMPLE1, SAMPLE2, SAMPLE3, SAMPLE4);
Compares the data in SAMPLE1 to 4 and outputs TRUE(ON) to SIGNAL1 because
the condition SAMPLE1 < SAMPLE2 < SAMPLE3 < SAMPLE4 is satisfied.
Error information
The following operation is performed when the input data type is REAL:
Controller Action
Integrated Controller V series When NAN is input, the result is FALSE(OFF).
Unified Controller nv series NAN and INF data are limited by the maximum value.
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
2.7 Comparison
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
135
Not Equal
Comparison Not Equal
LD/FBD language
notation
Input 1 Output
NE_
Input 2
EN input Edge execution Index modification Modifier
ST language notation Output := NE_
( Input1, Input2 );
Arguments
The following data types are supported for input and output arguments and the
instruction symbol depends on the data type:
Arg. Operand Type Const. Description Remarks
Input See below
)
INT NE_INT
DINT NE_DINT
UINT NE_UINT
REAL NE_REAL
WORD NE_WORD
DWORD NE_DWORD
TIME NE_TIME
TOD NE_TOD
DATE NE_DATE
DT NE_DT
Input 1 Output NE_
Input 2
Function
Compares the value of input data and outputs the comparison result.
Input Condition Output
Input1Input2 is satisfied TRUE(ON) Input data
Input1, Input2 Input1Input2 is not satisfied FALSE(OFF)
Number of input data must be 2.
Input 1 and Input 2 must have the same data type.
Chapter 2 LD/FBD Instructions
6F8C1226
136
The following operation is performed when the input data type is REAL:
Controller Action
Integrated Controller V series
Input data up to INF compare the magnitude relation.
NAN input data do not compare the magnitude relation.
Unified Controller nv series
INF and NAN input data are limited by the maximum
value to compare the magnitude relation.
Program example
[LD/FBD language notation]
SAMPLE1
1111
LD
NE_INT
SAMPLE2
2222
LD
SIGNAL1
1
ST
[ST language notation]
SIGNAL1 := NE_INT( SAMPLE1, SAMPLE2);
Compares the data in SAMPLE1 and SAMPLE2 and outputs TRUE(ON) to SIGNAL1
because the condition SAMPLE1SAMPLE2 is satisfied.
Error information
The following operation is performed when the input data type is REAL:
Controller Action
Integrated Controller V series When NAN is input, the result is FALSE(OFF).
Unified Controller nv series NAN and INF data are limited by the maximum value.
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
2.7 Comparison
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
137
Comparison with Hysteresis (greater than)
Comparison Comparison with Hysteresis (greater than)
TOSDIC compatible
instruction
LD/FBD language
notation
Input data Output
GT_L
U1 Y
U2
H1
H2
H3
Comparison data
Coefficient
Bias
Hysteresis width
Instance name
EN input Edge execution Index modification Modifier
ST language notation [Instance name] ( U1, U2, H1, H2, H3 );
[Variable name] : = [Instance name]. Y;
Arguments
Arg. Operand Type Const. Description Remarks
U1 REAL
Input data
U2 REAL
Comparison data
H1 REAL
Coefficient
H2 REAL
Bias
Input
H3 REAL
Input data
U2 REAL
Comparison data
H1 REAL
Coefficient
H2 REAL
Bias
Input
H3 REAL
Input data
U2 REAL
Comparison data
H1 REAL
Coefficient
H2 REAL
Bias
Input
H3 REAL
Input data
U2 REAL
Comparison data
H1 REAL
Coefficient
H2 REAL
Bias
Input
H3 REAL
ST language notation Output := MAX_
Input1n 2n15
Output
See below
Output
Input 1n Symbol(_) Output
INT MAX_INT INT
DINT MAX_DINT DINT
UINT MAX_UINT UINT
REAL MAX_REAL REAL
WORD MAX_WORD WORD
DWORD MAX_DWORD DWORD
TIME MAX_TIME TIME
TOD MAX_TOD TOD
DATE MAX_DATE DATE
DT MAX_DT DT
Input 1 Output
MAX_
Input 2
Input n
2.8 Selection
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
147
Function
The maximum value of input data Input 1 to Input n is obtained and output as result.
Up to 15 input data are allowed.
Input1 to n must have the same data type.
The following operation is performed when the input data is REAL:
Controller Action
Integrated Controller V series
Input data up to INF compare the magnitude relation.
NAN input data do not compare the magnitude
relation.
Unified Controller nv series
INF and NAN input data are limited by the maximum
value to compare the magnitude relation.
Program example
[LD/FBD language notation]
SAMPLE1
-1111
LD
MAX_INT
SAMPLE2
6666
LD
SAMPLE3
-5555
LD
SAMPLE4
4444
LD
SAMPLE5
6666
ST
[ST language notation]
SAMPLE5 := MAX_INT( SAMPLE1, SAMPLE2, SAMPLE3, SAMPLE4);
The maximum value of input data SAMPLE1 to SAMPLE4 is obtained and the
maximum value 6666 is stored in SAMPLE5
Error information
The following operation is performed when the input data type is REAL:
Controller Action
Integrated Controller V series If NAN data is entered as input, the result is NAN.
Unified Controller nv series NAN and INF data are limited by the maximum value.
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
Chapter 2 LD/FBD Instructions
6F8C1226
148
Maximum of Table Data
Selection Maximum of Table Data
LD/FBD language
notation
Input table Output
MAXL_
Number
TBL
N
EN input Edge execution Index modification Modifier
ST language notation Output : = MAXL_
( TBL, N );
Arguments
The following data types are supported for output arguments and the instruction
symbol depends on the data type.
Arg. Operand Type Const. Description Remarks
TBL PTR Input table
Input
N UINT
Number 1N256
Output See below Output
Symbol(_
) Output
MAXL_INT INT
MAXL_DINT DINT
MAXL_UINT UINT
MAXL_REAL REAL
MAXL_TIME TIME
MAXL_TOD TOD
MAXL_DATE DATE
MAXL_DT DT
Input table Output
MAXL_
TBL
N Number
Function
The maximum value is obtained out of N data starting from the variable specified with
input table TBL and the result is output. Also, the table pointer of the maximum value is
output to index register XL.
The allowed range of number N is 1 N 256.
If number N=0, the top data of the input table is output as result and index register XL
is set to 0.
If there is more than one maximum, the one with the smallest table pointer No. is
output to index register XL.
2.8 Selection
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
149
Direct I/O variable cannot be specified for the input table.
The following operation is performed when the input data type is REAL:
Controller Action
Integrated Controller V series
Input data up to INF compare the magnitude relation.
NAN input data do not compare the magnitude relation.
Unified Controller nv series
INF and NAN input data are limited by the maximum
value to compare the magnitude relation.
Program example
[LD/FBD language notation[
2
ARRAY1
LD
MAXL_INT
TBL
N
6
LD
SAMPLE1
100
ST
ARRAY1
-98
65
23
-51
100
-125
199
100
SAMPLE1
2
Index register XL
Pointer
1
3
4
5
6
7
8
100
[ST language notation]
SAMPLE1 := MAXL_INT( ARRAY1, 6);
The maximum value is obtained from six data in input table ARRAY1 and the
maximum value 100 is stored in SAMPLE1. Also, the table pointer 2 of the
maximum value is output to index register XL.
Error information
When the input table exceeds the variable area, the maximum of table data is not
processed and the data boundary is exceeded.
If N exceeds 256, N is limited to 256.
The following operation is performed when the input data type is REAL:
Controller Action
Integrated Controller V series If NAN data is entered as input, the result is NAN.
Unified Controller nv series
NAN and INF data are limited by the maximum
value.
The following operation is performed when direct I/O variable is specified for the input
table:
Controller Action
Integrated
Controller V series
S Controller Error flag is set to TRUE(ON) and the result is 0.
Unified Controller nv series
Error flag and table operation error flag are set to
TRUE(ON) and the result is 0.
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
Chapter 2 LD/FBD Instructions
6F8C1226
150
Minimum
Selection Minimum
LD/FBD language
notation
Input 1 Output
MIN_
Input 2
Input n
EN input Edge execution Index modification Modifier
ST language notation Output := MIN_
) Output
INT MIN_INT INT
DINT MIN_DINT DINT
UINT MIN_UINT UINT
REAL MIN_REAL REAL
WORD MIN_WORD WORD
DWORD MIN_DWORD DWORD
TIME MIN_TIME TIME
TOD MIN_TOD TOD
DATE MIN_DATE DATE
DT MIN_DT DT
Input 1 Output
MIN_
Input 2
Input n
Function
The minimum value of input data Input 1 to Input n is obtained and output as result.
Up to 15 input data are allowed.
Input1 to n must have the same data type.
The following operation is performed when the input data type is REAL:
2.8 Selection
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
151
Controller Action
Integrated Controller V series
Input data up to INF compare the magnitude relation.
NAN input data do not compare the magnitude relation.
Unified Controller nv series
INF and NAN input data are limited by the maximum
value to compare the magnitude relation.
Program example
[LD/FBD language notation]
SAMPLE1
-1111
LD
MIN_INT
SAMPLE2
6666
LD
SAMPLE3
-5555
LD
SAMPLE4
4444
LD
SAMPLE5
-5555
ST
[ST language notation]
SAMPLE5 := MIN_INT( SAMPLE1, SAMPLE2, SAMPLE3, SAMPLE4);
The minimum value of input data SAMPLE1 to SAMPLE4 is obtained and the
minimum value -5555 is stored in SAMPLE5.
Error information
The following operation is performed when the input data type is REAL:
Controller Action
Integrated Controller V series If NAN data is entered as input, the result is NAN.
Unified Controller nv series NAN and INF data are limited by the maximum value.
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
Chapter 2 LD/FBD Instructions
6F8C1226
152
Minimum of Table Data
Selection Minimum of Table Data
LD/FBD language
notation
Input table Output
MINL_
Number
TBL
N
EN input Edge execution Index modification Modifier
ST language notation Output := MINL_
( TBL, N );
Arguments
The following data types are supported for output arguments and the instruction
symbol depends on the data type:
Arg. Operand Type Const. Description Remarks
TBL PTR Input table
Input
N UINT
Number 1N256
Output See below Output
Symbol(_
) Output
MINL_INT INT
MINL_DINT DINT
MINL_UINT UINT
MINL_REAL REAL
MINL_TIME TIME
MINL_TOD TOD
MINL_DATE DATE
MINL_DT DT
Input table Output
MINL_
TBL
N Number
Function
The minimum value is obtained out of N data starting from the variable specified with
input table TBL and the minimum value is output as result. Also, the table pointer of the
minimum value is output to index register XL.
The allowed range of number N is 1 N 256.
If number N=0, the top data of the input table is output as result and index register XL
is set to 0.
If there is more than one minimum, the one with the smallest table pointer No. is output
to index register XL.
2.8 Selection
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
153
Direct I/O variables cannot be specified for the input table.
The following operation is performed when the input data type is REAL:
Controller Action
Integrated Controller V series
Input data up to INF compare the magnitude relation.
NAN input data do not compare the magnitude
relation.
Unified Controller nv series
INF and NAN input data are limited by the maximum
value to compare the magnitude relation.
Program example
[LD/FBD language notation]
2
ARRAY1
LD
MINL_INT
TBL
N
6
LD
SAMPLE1
-100
ST
ARRAY1
98
65
23
-51
-100
-125
199
-100
SAMPLE1
2
Index registerXL
pointer
1
3
4
5
6
7
8
-100
[ST language notation]
SAMPLE1 := MINL_INT( ARRAY1, 6);
The minimum value is obtained from six data in input table ARRAY1 and the minimum
value -100 is stored in SAMPLE1. Also, the table pointer 2 of the minimum value
is output to index register XL.
Error information
When the input table exceeds the variable area, the minimum of table data is not
processed and the data boundary is exceeded.
If N exceeds 256, N is limited to 256.
The following operation is performed when the input data type is REAL:
Controller Action
Integrated Controller If NAN data is entered as input, the result is NAN.
Unified Controller nv series NAN and INF data are limited by the maximum value.
The following operation is performed when direct I/O variable is specified for the input
table:
Controller Action
Integrated Controller
V series
S Controller Error flag is set to TRUE(ON) and the result is 0.
Unified Controller nv series
Error flag and table operation error flag are set to
TRUE(ON) and the result is 0.
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
Chapter 2 LD/FBD Instructions
6F8C1226
154
Average Value
Selection Average Value
LD/FBD language
notation
Input 1 Output
AVE_
Input 2
Input n
EN input Edge execution Index modification Modifier
ST language notation Output := AVE_
Input1n 2n15
Output
See below
Output
Input 1n Symbol(_
) Output
INT AVE_INT INT
DINT AVE_DINT DINT
UINT AVE_UINT UINT
REAL AVE_REAL REAL
TIME AVE_TIME TIME
Input 1 Output
AVE_
Input 2
Input n
Function
The minimum value of input data Input 1 to Input n is obtained and output as result.
Up to 15 input data are allowed.
Input1 to n must have the same data type.
Input1 + Input2 + + Inputn
Output =
n
2.8 Selection
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
155
Program example
[LD/FBD language notation]
SAMPLE1
-1111
LD
AVE_INT
SAMPLE2
6666
LD
SAMPLE3
-5555
LD
SAMPLE4
4444
LD
SAMPLE5
1111
ST
[ST language notation]
SAMPLE5 := AVE_INT( SAMPLE1, SAMPLE2, SAMPLE3, SAMPLE4);
The average value of input data SAMPLE1 to SAMPLE4 is obtained and the average
value 1111 is stored in SAMPLE5.
Error information
The following operation is performed when the input data type is REAL:
Controller Action
Integrated Controller V series
If NAN data is entered as input, the result is NAN.
If INF is input or when it is INF during summation
operation, the result is INF.
Unified Controller nv series NAN and INF data are limited by the maximum value.
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
Chapter 2 LD/FBD Instructions
6F8C1226
156
Average of Table Data
Selection Average of Table Data
LD/FBD language
notation
Input table Output
AVEL_
Number
TBL
N
EN input Edge execution Index modification Modifier
ST language notation Output := AVEL_
( TBL, N );
Arguments
The following data types are supported for output arguments and the instruction
symbol depends on the data type:
Arg. Operand Type Const. Description Remarks
TBL PTR Input table
Input
N UINT
Number 1N256
Output See below Output
Symbol(_) Output
AVEL_INT INT
AVEL_DINT DINT
AVEL_UINT UINT
AVEL_REAL REAL
AVEL_TIME TIME
Input table Output
AVEL_
TBL
N Number
Function
The average value is obtained from N data starting from the variable specified with
input table TBL and the result is output.
The allowed range of number N is 1 N 256.
If number N=0, the top data of the input table is output as result.
Direct I/O variable cannot be specified for the input table.
TBL[0]+TBL[1] + + TBL[N-1]
Output =
n
2.8 Selection
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
157
Program example
[LD/FBD language notation]
2
ARRAY1
LD
AVEL_INT
TBL
N
6
LD
SAMPLE1
-10
ST
ARRAY1
98
65
23
-51
-100
-125
199
-10
SAMPLE1 pointer
1
3
4
5
6
7
8
-100
[ST language notation]
SAMPLE1 := AVEL_INT( ARRAY1, 6);
The average value is obtained from six data in input table ARRAY1 and the average
value -10 is stored in SAMPLE1.
Error information
When the input table exceeds the variable area, the average of table data is not
processed and the data boundary is exceeded.
If N exceeds 256, N is limited to 256.
The following operation is performed when the input data type is REAL:
Controller Action
Integrated Controller
If NAN data is entered as input, the result is NAN.
If INF is input or when it is INF during summation
operation, the result is INF.
Unified Controller nv series NAN and INF data are limited by the maximum value.
The following operation is performed when direct I/O variable is specified for the input
table:
Controller Action
Integrated Controller
V series
S Controller Error flag is set to TRUE(ON) and the result is 0.
Unified Controller nv series
Error flag and table operation error flag are set to
TRUE(ON) and the result is 0.
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
Chapter 2 LD/FBD Instructions
6F8C1226
158
Limiter
Selection Limiter
LD/FBD language
notation
Minimum Output
LIMIT_
Input value
Maximum
MN
IN
MX
EN input Edge execution Index modification Modifier
ST language notation Output := LIMIT_
( MN, IN, MX );
Arguments
The following data types are supported for input and output arguments and the
instruction symbol depends on the data type:
Arg. Operand Type Const. Description Remarks
MN
Minimum
IN
Maximum
Output
See below
Output
Minimum, Input value,
Maximum
Symbol(_) Output
INT LIMIT_INT INT
DINT LIMIT_DINT DINT
UINT LIMIT_UINT UINT
REAL LIMIT_REAL REAL
WORD LIMIT_WORD WORD
DWORD LIMIT_DWORD DWORD
TIME LIMIT_TIME TIME
TOD LIMIT_TOD TOD
DATE LIMIT_DATE DATE
DT LIMIT_DT DT
Minimum Output
LIMIT_
MN
IN
MX
Input value
Maximum
2.8 Selection
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
159
Function
If input value IN is within maximum MX and minimum MN (minimum MN input value
IN maximum MX) the input value is output as result.
If IN is greater than maximum MX, maximum MX is output as result.
If IN is less than minimum MN, minimum MN is output as result.
When minimum MN maximum MX, maximum MX is output as result.
Input data cannot have mixed data types.
The following operation is performed when the input data type is REAL:
Controller Action
Integrated Controller V series
Input data up to INF compare the magnitude relation.
NAN input data do not compare the magnitude relation.
Unified Controller nv series
INF and NAN input data are limited by the maximum
value to compare the magnitude relation.
OUT = MIN{MAX(IN, MN), MX}
Program example
[LD/FBD language notation]
SAMPLE1
1000
LD
LIMIT_INT
MN
IN
MX
SAMPLE2
2500
LD
SAMPLE3
4000
LD
SAMPLE4
2500
ST
[ST language notation]
SAMPLE4 := LIMIT_INT (SAMPLE1, SAMPLE2, SAMPLE3);
Checks whether the input value 2500 in SAMPLE2 is between minimum 1000 in
SAMPLE1 and maximum 4000 in SAMPLE3. Because SAMPLE2 is between the
maximum and minimum, 2500 is stored in SAMPLE4 as result.
Error information
The following operation is performed when the input data type is REAL:
Controller Action
Integrated Controller V series
If NAN data is entered as input, the result is NAN (see
Important).
Unified Controller nv series NAN and INF data are limited by the maximum value.
Chapter 2 LD/FBD Instructions
6F8C1226
160
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
Important
Error processing is updated from the following controller versions.
Controller S3 S2 S2PU82 L3 L3DS L2 L2DS L1
Version V02.75 V02.68 V02.01 V02.40
The input data IN is limited to + Infinity or - Infinity INF before LIMIT processing.
The condition is as follows:
The Input value IN is REAL type.
The value NAN or INF is set as the data MN, IN and MX.
Input data
MN, IN, MX
Hex.
Limited data
MN, IN, MX
+NAN 16#7F80_0001 to 16#7FFF_FFFF
+INF 16#7F80_0000
+ Maximum
+MAX 16#7F7F_FFFF
:
+MIN 16#0000_0001
16#0000_0000
0
16#8000_0000
-MIN 16#8000_0001
:
-MAX 16#FF7F_FFFF
Input data
-INF 16#FF80_0000
-NAN 16#FF80_0001 to 16#FFFF_FFFF
-MAX
2.8 Selection
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
161
Selector
Selection Selector
LD/FBD language
notation
Select input Output
SEL_
G
IN0
IN1
Input 0
Input 1
EN input Edge execution Index modification Modifier
ST language notation Output := SEL_
Select input
IN0
Input0 Input
IN1
Input1
Output
See below
Output
Input 0, Input 1 Symbol(_) Output
BOOL SEL_BOOL BOOL
INT SEL_INT INT
DINT SEL_DINT DINT
UINT SEL_UINT UINT
REAL SEL_REAL REAL
WORD SEL_WORD WORD
DWORD SEL_DWORD DWORD
TIME SEL_TIME TIME
TOD SEL_TOD TOD
DATE SEL_DATE DATE
DT SEL_DT DT
Select input Output
SEL_
G
IN0
IN1
Input 0
Input 1
Chapter 2 LD/FBD Instructions
6F8C1226
162
Function
Input 0 or Input 1 is selected depending on the status of select input G.
When select input G = FALSE(OFF), Input 0 is selected and output as result.
When select input G = TRUE(ON), Input 1 is selected and output as result.
Input 0 and Input 1 must have the same data type.
Program example
[LD/FBD language notation]
SIGNAL1
1
LD
SEL_INT
SAMPLE1
1000
LD
SAMPLE2
2000
LD
SAMPLE3
2000
ST
G
IN0
IN1
[ST language notation]
SAMPLE3 := SEL_INT (SIGNAL1, SAMPLE1, SAMPLE2);
Because select input SIGNAL1 is TRUE(ON), 2000 is stored in SAMPLE3 as result.
2.8 Selection
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
163
Multiplex
Selection Multiplex
LD/FBD language
notation
Input point Output
MUX_
K
Input 0
Input (n-1)
EN input Edge execution Index modification Modifier
ST language notation Output := MUX_
( K, Input0, , Input(n1) );
Arguments
The following data types are supported for input and output arguments and the
instruction symbol depends on the data type:
Arg. Operand Type Const. Description Remarks
K UINT
Input0(n-1) 1n14
Output
See below
Output
Input 0 (n-1) Symbol(_
) Output
BOOL MUX_BOOL BOOL
INT MUX_INT INT
DINT MUX_DINT DINT
UINT MUX_UINT UINT
WORD MUX_WORD WORD
DWORD MUX_DWORD DWORD
REAL MUX_REAL REAL
TIME MUX_TIME TIME
TOD MUX_TOD TOD
DATE MUX_DATE DATE
DT MUX_DT DT
Input point No. Output
MUX_
K
Input 0
Input (n-1)
Chapter 2 LD/FBD Instructions
6F8C1226
164
Function
Selects input data specified with input point No. K. Input 0 is selected if input point No.
K=0 and Input (n-1) is selected if input point No. K =(n-1).
Up to 14 input data are allowed.
Input 0 to (n-1) must have the same data type.
Program example
[LD/FBD language notation]
SAMPLE1
2
LD
MUX_INT
K
SAMPLE2
1234
LD
SAMPLE3
5678
LD
SAMPLE4
-9876
LD
SAMPLE5
-9876
ST
Input point No.
0
1
2
1234
5678
-9876
-9876
Result K=2
[ST language notation]
SAMPLE5 := MUX_INT (SAMPLE1, SAMPLE2, SAMPLE3, SAMPLE4);
Because the input point No. specified by SAMPLE1 is 2, -9876 which is the content
of SAMPLE4 is stored in SAMPLE5.
Error information
When input point No. K. Input number, operation is performed with K limited to (Input
number-1).
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
2.8 Selection
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
165
Multiplex of Table Data
Selection Multiplex of Table Data
LD/FBD language
notation
Input table Output
MPX_
TBL
K
N
Selection
Table word number
EN input Edge execution Index modification Modifier
ST language notation Output := MPX_
( TBL, K, N );
Arguments
The following data types are supported for output arguments and the instruction
symbol depends on the data type:
Arg. Operand Type Const. Description Remarks
TBL PTR Input table
K UINT
_TO_
(Input );
Arguments
The following data types are supported for input and output arguments and the
instruction symbol depends on the data type:
Arg. Operand Type Const. Description Remarks
Input
Input
Output
See below
Output
Input Output
_TO_
Input Symbol(
) Output
INT INT_TO_DINT INT
INT INT_TO_UINT INT
DINT DINT_TO_INT DINT
DINT DINT_TO_UINT DINT
UNIT UINT_TO_INT UNIT
UNIT UINT_TO_DINT UNIT
Input Output
_TO_
Chapter 2 LD/FBD Instructions
6F8C1226
170
Function
The entered integer data is converted to specified integer data.
The conversion range and limits are shown below:
Instruction Input Output Limit
INT_TO_DINT -32768 to 32767 -32768 to 32767
0 to 32767 0 to 32767
INT_TO_UINT
Input<0 0
-32768 to 32767 -32768 to 32767
Input<-32768 -32768
DINT_TO_INT
Input>32767 32767
0 to 65535 0 to 65535
Input<0 0
DINT_TO_UINT
Input>65535 65535
0 to 32767 0 to 32767
UINT_TO_INT
Input>32767 32767
UINT_TO_DINT 0 to 65535 0 to 65535
Program example
[LD/FBD language notation]
Normal execution
SAMPLE1
1234
LD
DINT_TO_INT SAMPLE2
1234
ST
Input data -1234 in SAMPLE1 is converted to INT and the result -1234 is stored in
SAMPLE2.
Limit execution
SAMPLE1
40000
LD
DINT_TO_INT SAMPLE2
32768
ST
Because input data -40000 in SAMPLE1 exceeds the valid data range for INT, the
result -32768 is stored in SAMPLE2.
[ST language notation]
SAMPLE2 := DINT_TO_INT(SAMPLE1);
Error information
If the conversion result of the input data exceeds the valid range of the output data
type, the limit of the output data type is output.
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
2.9 Type Conversion
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
171
Integer-Real Numbers Conversion
Type Conversion Integer-Real Numbers Conversion
LD/FBD language
notation
EN input Edge execution Index modification Modifier
ST language notation Output :=
_TO_REAL( Input );
Arguments
The following data types are supported for input and output arguments and the
instruction symbol depends on the data type:
Arg. Operand Type Const. Description Remarks
Input See below
Input
Output REAL Output
Input Output
_TO_REAL
Input Symbol(
_)
INT
INT_TO_REAL
DINT
DINT_TO_REAL
UINT
UINT_TO_REAL
Function
The entered integer data is converted to REAL data.
If input is DINT, integer data between 16777215 and 16777215 is converted precisely
to REAL.
Program example
[LD/FBD language notation]
SAMPLE1
1234
LD
INT_TO_REAL SAMPLE2
1234.0
ST
[ST language notation]
SAMPLE2 := INT_TO_REAL( SAMPLE1);
Input data 1234 in SAMPLE1 is converted to REAL and the result 1234.0 is stored
in SAMPLE2.
Input Output
_TO_ REAL
Chapter 2 LD/FBD Instructions
6F8C1226
172
Integer-Bit String Conversion
Type Conversion Integer-Bit String Conversion
LD/FBD language
notation
EN input Edge execution Index modification Modifier
ST language notation Output :=
_TO_
( Input );
Arguments
The following data types are supported for input and output arguments and the
instruction symbol depends on the data type:
Arg. Operand Type Const. Description Remarks
Input Input
Output
See below
Output
Input Output
_TO_
Input Symbol(
) Output
INT
INT_TO_WORD
WORD
INT
INT_TO_DWORD
DWORD
DINT
DINT_TO_WORD
WORD
DINT
DINT_TO_DWORD
DWORD
UNIT
UINT_TO_WORD
WORD
UNIT
UINT_TO_DWORD
DWORD
Function
The entered integer data is converted to specified bit string data.
The conversion range and limits are shown below:
Instruction Input Output Limit
INT_TO_WORD -32768 to 32767 16#8000 to16#7FFF
INT_TO_DWORD -32768 to 32767 16#FFFF8000 to16#00007FFF
-32768 to 32767 16#8000 to16#7FFF
Input<-32768 16#8000
DINT_TO_WORD
Input>32767 16#7FFF
DINT_TO_DWORD -2147483648 to 2147483647 16#80000000 to16#7FFFFFFF
UINT_TO_WORD 0 to 65535 16#0 to16#FFFF
UINT_TO_DWORD 0 to 65535 16#0 to16#0000FFFF
Input Output
_TO_
2.9 Type Conversion
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
173
Program example
[LD/FBD language notation]
SAMPLE1
-1234
LD
INT_TO_WORD SAMPLE2
16#FB2E
ST
[ST language notation]
SAMPLE2 := INT_TO_WORD( SAMPLE1);
Input data -1234 in SAMPLE1 is converted to WORD and the result 16#FB2E is
stored in SAMPLE2.
Error information
If the conversion result of the input data exceeds the valid range of the output data
type, the limit of the output data type is output.
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
Chapter 2 LD/FBD Instructions
6F8C1226
174
Integer-BCD Conversion
Type Conversion Integer-BCD Conversion
LD/FBD language
notation
EN input Edge execution Index modification Modifier
ST language notation Output :=
_TO_BCD_
( Input );
Arguments
The following data types are supported for input and output arguments and the
instruction symbol depends on the data type:
Arg. Operand Type Const. Description Remarks
Input
Input
Output
See below
Output
Input Symbol(
) Output
INT
INT_TO_BCD_WORD
WORD
INT
INT_TO_BCD_DWORD
DWORD
DINT
DINT_TO_BCD_WORD
WORD
DINT
DINT_TO_BCD_DWORD
DWORD
UNIT
UINT_TO_BCD_WORD
WORD
UNIT
UINT_TO_BCD_DWORD
DWORD
Function
The entered integer data is converted to BCD data.
The conversion range and limits are shown below:
Instruction Input Output Limit BCD error
0 to 9999 16#0 to16#9999
Input<0 16#0
TRUE(ON) INT_TO_BCD_WORD
Input>9999 16#9999
TRUE(ON)
0 to 32767 16#0 to16#32767
INT_TO_BCD_DWORD
Input<0 16#0
TRUE(ON)
0 to 9999 16#0 to16#9999
Input<0 16#0
TRUE(ON) DINT_TO_BCD_WORD
Input>9999 16#9999
TRUE(ON)
Input Output
_TO_BCD_
Input Output
_TO_BCD_
2.9 Type Conversion
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
175
Instruction Input Output Limit BCD error
0 to 99999999 16#0 to16#99999999
Input<0 16#0
TRUE(ON) DINT_TO_BCD_DWORD
Input>99999999 16#99999999
TRUE(ON)
0 to 9999 16#0 to16#9999
UINT_TO_BCD_WORD
Input>9999 16#9999
TRUE(ON)
UINT_TO_BCD_DWORD 0 to 65535 16#0 to16#65535
Program example
[LD/FBD language notation]
Normal execution
SAMPLE1
1234
LD
UINT_TO_BCD_WORD SAMPLE2
16#1234
ST
The input data 1234 in SAMPLE1 is converted to BCD and the result 16#1234 is
stored in SAMPLE2.
Limit execution
SAMPLE1
12345
LD
UINT_TO_BCD_WORD SAMPLE2
16#9999
ST
Because input data 12345 in SAMPLE1 exceeds the valid range, the result 16#9999
is stored in SAMPLE2.
[ST language notation]
SAMPLE2 := UINT_TO_BCD_WORD( SAMPLE1);
Error information
If the BCD data after conversion exceeds the valid range of the output data, the
conversion result is limited by:
WORD: 16#0 or 16#9999
DWORD: 16#0 or 16#99999999
Also the specific register BCD error flag and error flags are set to TRUE(ON).
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
Chapter 2 LD/FBD Instructions
6F8C1226
176
Integer-Duration Conversion
Type Conversion Integer-Duration Conversion
LD/FBD language
notation
EN input Edge execution Index modification Modifier
ST language notation Output :=
_TO_TIME( Input );
Arguments
The following data types are supported for input and output arguments and the
instruction symbol depends on the data type:
Arg. Operand Type Const. Description Remarks
Input See below
Input
Output TIME Output
Input Output
_TO_TIME
Input Symbol(
_)
INT INT_TO_TIME
DINT DINT_TO_TIME
UINT UINT_TO_TIME
Function
The entered integer data is converted to TIME data.
Input data is converted as ms unit.
Program example
[LD/FBD language notation]
SAMPLE1
1234
LD
INT_TO_TIME SAMPLE2
T#1234ms
ST
[ST language notation]
SAMPLE2 := INT_TO_TIME( SAMPLE1);
Input data 1234 in SAMPLE1 is converted to TIME and the result T#1234ms is
stored in SAMPLE2.
Input Output
_TO_TIME
2.9 Type Conversion
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
177
Real Numbers-Integer Conversion
Type Conversion Real Numbers-Integer Conversion
LD/FBD language
notation
EN input Edge execution Index modification Modifier
ST language notation Output := REAL_TO_
( Input );
Arguments
The following data types are supported for input and output arguments and the
instruction symbol depends on the data type:
Arg. Operand Type Const. Description Remarks
Input REAL
Input
Output See below Output
Symbol(_
) Output
REAL_TO_INT INT
REAL_TO_DINT DINT
REAL_TO_UINT UINT
Function
The entered REAL data is converted to fixed point integer data.
Fractions are rounded according to IEC60559.
2.6 3
3.4 3
-2.4 -2
The range of integer data after conversion is as follows. If the conversion result
exceeds this range, the limit of the output data type is output.
INT conversion : -32768 to 32767
DINT conversion: : -2147483648 to 2147483647
UNIT conversion : 0 to 65535
Input Output
REAL_TO_
Input Output
REAL_TO_
Chapter 2 LD/FBD Instructions
6F8C1226
178
Program example
[LD/FBD language notation]
Normal execution
SAMPLE1
4.567
LD
REAL_TO_INT SAMPLE2
5
ST
Input data 4.567 in SAMPLE1 is converted to INT and the result 5 is stored in
SAMPLE2.
Limit execution
SAMPLE1
54321.0
LD
REAL_TO_INT SAMPLE2
32767
ST
Input data 54321.0 in SAMPLE1 is converted to INT, but the result 32767 is stored
in SAMPLE2 because the valid data range of SAMPLE2 is exceeded.
[ST language notation]
SAMPLE2 := REAL_TO_INT( SAMPLE1);
Error information
If the conversion result of the input data exceeds the valid range of the output data
type, the limit of the output data type is output.
The following operation is performed when the input data type is REAL:
Controller Action
Integrated Controller V series
When NAN is input, the result is 0.
When INF is input, the result is the maximum value.
Unified Controller nv series NAN and INF data are limited by the maximum value.
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
2.9 Type Conversion
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
179
Real Numbers-BCD Conversion
Type Conversion Real Numbers-BCD Conversion
LD/FBD language
notation
Input Output
REAL_TO_BCD_
EN input Edge execution Index modification Modifier
ST language notation Output := REAL_TO_BCD_
( Input );
Arguments
The following data types are supported for input and output arguments and the
instruction symbol depends on the data type:
Arg. Operand Type Const. Description Remarks
Input REAL
Input
Output See below Output
Input Output
REAL_TO_BCD_
Symbol(_
) Output
REAL_TO_BCD_WORD WORD
REAL_TO_BCD_DWORD DWORD
Function
The entered REAL data is rounded at the first decimal place and the result is
converted to BCD data.
The conversion range and limits are shown below:
Instruction Input Output Limit BCD error
0.0 to 9999.0 16#0 to16#9999
Input<0.0 16#0
TRUE(ON) REAL_TO_BCD_WORD
Input>9999.0 16#9999
TRUE(ON)
0.0 to 99999995.0 16#0 to16#99999992
Input<0.0 16#0
TRUE(ON) REAL_TO_BCD_DWORD
Input>99999995.0 16#99999999
TRUE(ON)
Chapter 2 LD/FBD Instructions
6F8C1226
180
Program example
[LD/FBD language notation]
Normal execution
SAMPLE1
1234.0
LD
REAL_TO_BCD_WORD SAMPLE2
16#1234
ST
Converts input data 1234.0 in SAMPLE1 to BCD and stores the result 16#1234 in
SAMPLE2.
Limit execution
SAMPLE1
12345.0
LD
REAL_TO_BCD_WORD SAMPLE2
16#9999
ST
Stores the result 16#9999 in SAMPLE2 because input data 12345.0 in SAMPLE1
exceeds the valid range.
[ST language notation]
SAMPLE2 := REAL_TO_BCD_WORD(SAMPLE1);
Error information
If the BCD data after conversion exceeds the valid range of the output data, the
conversion result is limited by:
WORD16#0 or 16#9999
DWORD16#0 or 16#99999999
Also, the special register BCD error flag and error flag are set to TRUE(ON).
The following operation is performed when the input data type is REAL:
Controller Action
Integrated Controller V series
When NAN is input, the result is 0.
When + INF is input the result is maximum value and
when - INF is input, the result is 0.
BCD error flag and error flag are set to TRUE(ON).
Unified Controller nv series NAN and INF data is limited by the maximum value.
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
2.9 Type Conversion
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
181
Real Numbers-Duration Conversion
Type Conversion Real Numbers-Duration Conversion
LD/FBD language
notation
Input Output
REAL_TO_TIME
EN input Edge execution Index modification Modifier
ST language notation Output := REAL_TO_TIME(Input );
Arguments
Arg. Operand Type Const. Description Remarks
Input REAL
Input
Output TIME Output
Function
The entered REAL data is rounded at the first decimal place and the result is
converted to TIME data.
Input data is converted as ms unit.
After conversion, the range of duration data is from T# -2147483648ms to
T#2147483647ms. If the conversion result exceeds this range, the limit of the output
data type is output.
Program example
[LD/FBD language notation]
Normal execution
SAMPLE1
4.567
LD
REAL_TO_TIME SAMPLE2
T#5ms
ST
Input data 4.567 in SAMPLE1 is converted to elapsed time and the result T#5ms is
stored in SAMPLE2.
Limit execution
SAMPLE1
3.4E+20
LD
REAL_TO_TIME SAMPLE2
T#2147483647ms
ST
Converts input data 3.4E+20 in SAMPLE1 to elapsed time, but stores the result
T#2147483647ms in SAMPLE2 because valid data range of SAMPLE2 is exceeded.
[ST language notation]
SAMPLE2 := REAL_TO_TIME( SAMPLE1);
Chapter 2 LD/FBD Instructions
6F8C1226
182
Error information
If the conversion result of the input data exceeds the valid range of the output data
type, the limit of the output data type is output.
The following operation is performed when the input data type is REAL:
Controller Action
Integrated Controller V series
When NAN is input, the result is 0.
When INF is input, the result is the maximum value.
Unified Controller nv series NAN and INF data is limited by the maximum value.
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
2.9 Type Conversion
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
183
Bit String-Integer Conversion
Type Conversion Bit String-Integer Conversion
LD/FBD language
notation
EN input Edge execution Index modification Modifier
ST language notation Output :=
_TO_
( Input );
Arguments
The following data types are supported for input and output arguments and the
instruction symbol depends on the data type:
Arg. Operand Type Const. Description Remarks
Input
Input
Output
See below
Output
Input Output
_TO_
Input Symbol(
) Output
WORD WORD_TO_INT INT
WORD WORD_TO_DINT DINT
WORD WORD_TO_UINT UINT
DWORD DWORD_TO_INT INT
DWORD DWORD_TO_DINT DINT
DWORD DWORD_TO_UINT UINT
Input Output
_TO_
Chapter 2 LD/FBD Instructions
6F8C1226
184
Function
The entered bit string data is converted to integer data.
The conversion range and limits are shown below:
Instruction Input Output Limit
16#0 to16#7FFF 0 to 32767
WORD_TO_INT
16#8000 to16#FFFF -32768 to -1
16#0 to16#7FFF 0 to 32767
WORD_TO_DINT
16#8000 to16#FFFF -32768 to -1
WORD_TO_UINT 16#0 to16#FFFF 0 to 65535
16#0 to16#7FFF 0 to 32767
16#7FFF<Input16#7FFFFFFF 32767
16#7FFFFFFF<Input<16#FFFF8000 -32768
DWORD_TO_INT
16#FFFF8000Input16#FFFFFFFF -32768 to -1
16#0 to16#7FFFFFFF 0 to 2147483647
DWORD_TO_DINT
16#80000000 to16#FFFFFFFF -2147483648 to -1
16#0 to16#FFFF 0 to 65535
DWORD_TO_UINT
Input>16#FFFF
0 to 65535
(low order word is treated as UINT
data)
Program example
[LD/FBD language notation]
SAMPLE2
1234
ST
WORD_TO_INT SAMPLE1
16#FB2E
LD
[ST language notation]
SAMPLE2 := WORD_TO_INT(SAMPLE1);
The input data 16#FB2E in SAMPLE1 is converted to INT and the result -1234 is
stored in SAMPLE2.
Error information
If the conversion result of the input data exceeds the valid range of the output data
type, the limit of the output data type is output.
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
2.9 Type Conversion
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
185
Bit String-Bit-String Conversion
Type Conversion Bit String-Bit String Conversion
LD/FBD language
notation
EN input Edge execution Index modification Modifier
ST language notation Output :=
_TO_
( Input );
Arguments
The following data types are supported for input and output arguments and the
instruction symbol depends on the data type:
Arg. Operand Type Const. Description Remarks
Input Input
Output
See below
Output
Input Output
Input Symbol(
) Output
WORD WORD_TO_DWORD DWORD
DWORD DWORD_TO_WORD WORD
Function
The entered bit string data is converted to specified bit string data.
The conversion range and limits are shown below:
Instruction Input Output Limit
WORD_TO_DWORD 16#0 to16#FFFF 16#0 to16#FFFF
16#0 to16#FFFF 16#0 to16#FFFF
DWORD_TO_WORD
Input>16#FFFF
Low order 16 bits are
output
Input Output
_TO_
_TO_
Chapter 2 LD/FBD Instructions
6F8C1226
186
Program example
[LD/FBD language notation]
Normal execution
SAMPLE1
16#00001234
LD
DWORD_TO_WORD SAMPLE2
16#1234
ST
The input data 16#00001234 in SAMPLE1 is converted to WORD and the result
1234 is stored in SAMPLE2.
Limit execution
SAMPLE1
16#00012345
LD
DWORD_TO_WORD SAMPLE2
16#2345
ST
Because the input data 16#00012345 in SAMPLE1 exceeds the valid data range for
WORD variable, the result 16#2345 is stored in SAMPLE2. If EN is used, ENO is
reset to FALSE(OFF).
[ST language notation]
SAMPLE2 := DWORD_TO_WORD( SAMPLE1);
Error information
If the conversion result of the input data exceeds the valid range of the output data
type, the low order 16 bits of the input data is output.
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
2.9 Type Conversion
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
187
BCD-Integer Conversion
Type Conversion BCD-Integer Conversion
LD/FBD language
notation
Input Output
EN input Edge execution Index modification Modifier
ST language notation Output :=
_BCD_TO_
( Input );
Arguments
The following data types are supported for input and output arguments and the
instruction symbol depends on the data type:
Arg. Operand Type Const. Description Remarks
Input
Input
Output
See below
Output
Input Output
Input Symbol(
) Output
WORD WORD_BCD_TO_INT INT
WORD WORD_BCD_TO_DINT DINT
WORD WORD_BCD_TO_UINT UNIT
DWORD DWORD_BCD_TO_INT INT
DWORD DWORD_BCD_TO_DINT DINT
DWORD DWORD_BCD_TO_UINT UNIT
Function
The entered BCD data is converted to integer data.
Data between 16#A and 16#F is invalid in each digit of input data.
The conversion range and limits are shown below. The result is 0 if 16#A to16#F is
present in each digit.
Instruction Input Output Limit BCD error
16#0 to16#9999 0 to 9999
WORD_BCD_TO_INT
Each digit input>16#9 0 TRUE(ON)
16#0 to16#9999 0 to 9999
WORD_BCD_TO_DINT
Each digit input>16#9 0 TRUE(ON)
16#0 to16#9999 0 to 9999
WORD_BCD_TO_UINT
Each digit input>16#9 0 TRUE(ON)
_BCD_TO_
_BCD_TO_
Chapter 2 LD/FBD Instructions
6F8C1226
188
Instruction Input Output Limit BCD error
16#0 to16#32767 0 to 32767
Input>16#32767 32767
TRUE(ON) DWORD_BCD_TO_INT
Each digit input>16#9 0 TRUE(ON)
16#0 to16#99999999 0 to 99999999
DWORD_BCD_TO_DINT
Each digit input>16#9 0 TRUE(ON)
16#0 to16#65535 0 to 65535
Input>16#65535 65535
TRUE(ON) DWORD_BCD_TO_UINT
Each digit input>16#9 0 TRUE(ON)
Program example
[LD/FBD language notation]
Normal execution
SAMPLE1
16#1234
LD
WORD_BCD_TO_UINT SAMPLE2
1234
ST
The input data 16#00001234 in SAMPLE1 is converted to WORD and the
result1234 is stored in SAMPLE2.
Invalid data input
SAMPLE1
16#1A39
LD
WORD_BCD_TO_UINT SAMPLE2
0
ST
Stores the result 0 in SAMPLE2 because the input data 16#1A39 in SAMPLE1
contains invalid data A.
[ST language notation]
SAMPLE2 := WORD_BCD_TO_UINT( SAMPLE1);
Error information
If the input BCD data contains invalid data between 16#A and 16#F, the conversion
result is 0. Also the specific register BCD error flag and error flag are set to
TRUE(ON).
If the conversion result of the input data exceeds the valid range of the output data
type, the limit of the output data type is output.
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
2.9 Type Conversion
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
189
BCD-Real Numbers Conversion
Type Conversion BCD-Real Numbers Conversion
LD/FBD language
notation
Input Output
EN input Edge execution Index modification Modifier
ST language notation Output :=
_BCD_TO_REAL( Input );
Arguments
The following data types are supported for input and output arguments and the
instruction symbol depends on the data type:
Arg. Operand Type Const. Description Remarks
Input See below
Input
Output REAL Output
Input Output
Input Symbol(
_)
WORD WORD_BCD_TO_REAL
DWORD DWORD_BCD_TO_REAL
Function
The entered BCD data is converted to REAL data.
Data between 16#A and 16#F is invalid in each digit of input data.
The conversion range is shown below. The result is 0 if 16#A to16#F is present in each
digit.
Instruction Input Output BCD error
16#0 to16#9999 0.0 to 9999.0
WORD_BCD_TO_REAL
Each digit input>16#9 0.0 TRUE(ON)
16#0 to16#99999999 0.0 to 100000000.0
DWORD_BCD_TO_REAL
Each digit input>16#9 0.0 TRUE(ON)
_BCD_TO_REAL
_BCD_TO_REAL
Chapter 2 LD/FBD Instructions
6F8C1226
190
Program example
[LD/FBD language notation]
Normal execution
SAMPLE1
16#1234
LD
WORD_BCD_TO_REAL SAMPLE2
1234.0
ST
Input data 16#1234 in SAMPLE1 is converted to REAL and the result 1234.0 is
stored in SAMPLE2.
Invalid data input
SAMPLE1
16#1A39
LD
WORD_BCD_TO_REAL SAMPLE2
0.0
ST
Stores the result 0.0 in SAMPLE2 because the input data 16#1A39 in SAMPLE1
contains invalid data A.
[ST language notation]
SAMPLE2 := WORD_BCD_TO_REAL( SAMPLE1);
Error information
If the input BCD data contains invalid data between 16#A and 16#F, the conversion
result is 0. Also, the special register BCD error flag and error flag are set to
TRUE(ON).
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
2.9 Type Conversion
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
191
BCD-Duration Conversion
Type Conversion BCD-Duration Conversion
LD/FBD language
notation
Input Output
EN input Edge execution Index modification Modifier
ST language notation Output :=
_BCD_TO_TIME( Input );
Arguments
The following data types are supported for input and output arguments and the
instruction symbol depends on the data type:
Arg. Operand Type Const. Description Remarks
Input See below
Input
Output TIME Output
Input Output
Input Symbol(
_)
WORD WORD_BCD_TO_TIME
DWORD DWORD_BCD_TO_TIME
Function
The entered BCD data is converted to TIME data.
Input data is converted as ms unit.
Data between 16#A and 16#F is invalid in each digit of input data.
The conversion range is shown below. The result is 0 if 16#A to 16#F is present in
each digit.
Instruction Input Output BCD error
16#0 to16#9999 T#0ms to T#9999ms
WORD_BCD_TO_TIME
Each digit input>16#9 T#0ms TRUE(ON)
16#0 to16#99999999
T#0ms to
T#99999999ms
DOWRD_BCD_TO_TIME
Each digit input>16#9 T#0ms TRUE(ON)
_BCD_TO_TIME
_BCD_TO_TIME
Chapter 2 LD/FBD Instructions
6F8C1226
192
Program example
[LD/FBD language notation]
Normal execution
SAMPLE1
16#1234
LD
WORD_BCD_TO_TIME SAMPLE2
T#1234ms
ST
Input data 16#1234 in SAMPLE1 is converted to elapsed time and the result
T#1234ms is stored in SAMPLE2.
Invalid data input
SAMPLE1
16#1A39
LD
WORD_BCD_TO_TIME SAMPLE2
T#0ms
ST
Stores the result T#0ms in SAMPLE2 because the input data 16#1A39 in SAMPLE1
contains invalid data A.
[ST language notation]
SAMPLE2 := WORD_BCD_TO_TIME( SAMPLE1);
Error information
If the input BCD data contains invalid data between 16#A and 16#F, the conversion
result is 0. Also the special register BCD error flag and error flag is set to TRUE(ON).
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
2.9 Type Conversion
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
193
Duration-Integer Conversion
Type Conversion Duration-Integer Conversion
LD/FBD language
notation
Input Output
EN input Edge execution Index modification Modifier
ST language notation Output := TIME_TO_
( Input );
Arguments
The following data types are supported for input and output arguments and the
instruction symbol depends on the data type:
Arg. Operand Type Const. Description Remarks
Input TIME
Input
Output See below Output
Input Output
Symbol(_
) Output
TIME_TO_INT INT
TIME_TO_DINT DINT
TIME_TO_UINT UINT
Function
The entered TIME data is converted to specified integer data.
Converts with output in ms unit.
The conversion range and limits are shown below:
Instruction Input Output Limit
-T#32768ms to
T#32767ms
-32768 to 32767
Input<-T#32768ms -32768
TIME_TO_INT
Input>T#32767ms 32767
TIME_TO_DINT
-T#2147483648ms to
T#2147483647ms
-2147483648 to
2147483647
T#0ms to T#65535ms 0 to 65535
Input<T#0ms 0
TIME_TO_UINT
Input>T#65535ms 65535
TIME _TO_
TIME _TO_
Chapter 2 LD/FBD Instructions
6F8C1226
194
Program example
[LD/FBD language notation]
Normal execution
SAMPLE1
T#1234ms
LD
TIME_TO_INT SAMPLE2
1234
ST
Converts input data -T#1234ms in SAMPLE1 to INT and stores the result -1234 in
SAMPLE2.
Limit execution
SAMPLE1
T#40000ms
LD
TIME_TO_INT SAMPLE2
32768
ST
Stores the result -32768 in SAMPLE2 because input data -T#40000ms in SAMPLE1
exceeds the valid data range for INT.
[ST language notation]
SAMPLE2 := TIME_TO_INT( SAMPLE1);
Error information
If the conversion result of the input data exceeds the valid range of the output data
type, the limit of the output data type is output.
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
2.9 Type Conversion
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
195
Duration-Real Numbers Conversion
Type Conversion Duration-Real Numbers Conversion
LD/FBD language
notation
Input Output
TIME_TO_REAL
EN input Edge execution Index modification Modifier
ST language notation Output := TIME_TO_REAL( Input );
Arguments
Arg. Operand Type Const. Description Remarks
Input TIME
Input
Output REAL Output
Function
The entered TIME data is converted to REAL data.
Converts with output in ms unit.
TIME data between -T#16777215ms and T#16777215ms will be accurate when
converted to REAL.
Program example
[LD/FBD language notation]
SAMPLE1
T#1234ms
LD
TIME_TO_REAL SAMPLE2
1234.0
ST
[ST language notation]
SAMPLE2 := TIME_TO_REAL( SAMPLE1);
Input data T#1234ms in SAMPLE1 is converted to REAL and the result 1234.0 is
stored in SAMPLE2.
Chapter 2 LD/FBD Instructions
6F8C1226
196
Duration-BCD Conversion
Type Conversion Duration-BCD Conversion
LD/FBD language
notation
Input Output
EN input Edge execution Index modification Modifier
ST language notation Output := TIME_TO_BCD_
( Input );
Arguments
The following data types are supported for input and output arguments and the
instruction symbol depends on the data type:
Arg. Operand Type Const. Description Remarks
Input TIME
Input
Output See below Output
Input Output
Symbol(_
) Output
TIME_TO_BCD_WORD WORD
TIME_TO_BCD_DWORD DWORD
Function
The entered TIME data is converted to BCD data.
The conversion range and limits are shown below:
Instruction Input Output Limit BCD error
T#0ms toT#9999ms 16#0 to16#9999
Input<T#0ms 16#0
TRUE(ON) TIME_TO_BCD_WORD
Input>T#9999ms 16#9999
TRUE(ON)
T#0ms to
T#99999999ms
16#0 to
16#99999999
Input<T#0ms 16#0
TRUE(ON)
TIME_TO_BCD_DWORD
Input>T#99999999ms 16#99999999
TRUE(ON)
TIME _TO_BCD_
TIME _TO_BCD_
2.9 Type Conversion
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
197
Program example
[LD/FBD language notation]
Normal execution
SAMPLE1
T#1234ms
LD
TIME_TO_BCD_WORD SAMPLE2
16#1234
ST
Converts input data T#1234ms in SAMPLE1 to BCD and stores the result 16#1234 in
SAMPLE2.
Limit execution
SAMPLE1
T#12345ms
LD
TIME_TO_BCD_WORD SAMPLE2
16#9999
ST
Stores the result 16#9999 in SAMPLE2 because input data T#12345ms in SAMPLE1
exceeds the valid range.
[ST language notation]
SAMPLE2 := TIME_TO_BCD_WORD( SAMPLE1);
Error information
If the BCD data after conversion exceeds the valid range of the output data, the
conversion result is limited by:
WORD 16#0 or 16#9999
DWORD 16#0 or 16#99999999
Also the special register BCD error flag and error flag are set to TRUE(ON).
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
Chapter 2 LD/FBD Instructions
6F8C1226
198
Truncation
Type Conversion Truncation
LD/FBD language
notation
Input Output
TRUNC_
EN input Edge execution Index modification Modifier
ST language notation Output := TRUNC_
( Input );
Arguments
The following data types are supported for input and output arguments and the
instruction symbol depends on the data type:
Arg. Operand Type Const. Description Remarks
Input REAL
Input
Output See below Output
Symbol(_) Output
TRUNC_INT INT
TRUNC_DINT DINT
TRUNC_UINT UINT
Input Output Input Output
Function
The entered REAL data is converted for fixed point integer data. Fractions are
truncated.
2.6 2
-1.5 -1
-2.4 -2
The range of integer data after conversion is as follows. If the conversion result
exceeds this range, the limit of the output data type is output.
INT conversion : -32768 to 32767
DINT conversion : -2147483648 to 2147483647
UINT conversion : 0 to 65535
TRUNC_
2.9 Type Conversion
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
199
Program example
[LD/FBD language notation]
Normal execution
SAMPLE1
4.567
LD
TRUNC_INT SAMPLE2
4
ST
Input data 4.567 in SAMPLE1 is converted to INT and the result 4 is stored in
SAMPLE2.
Limit execution
SAMPLE1
54321.0
LD
TRUNC_INT SAMPLE2
32767
ST
Input data 54321.0 in SAMPLE1 is converted to INT, but the result 32767 is stored in
SAMPLE2 because the valid data range of SAMPLE2 is exceeded.
[ST language notation]
SAMPLE2 := TRUNC_INT( SAMPLE1);
Error information
If the conversion result of the input data exceeds the valid range of the output data
type, the limit of the output data type is output.
The following operation is performed when the input data type is REAL:
Controller Action
Integrated Controller V series
When NAN is input, the result is 0.
When INF is input, the result is the maximum value.
Unified Controller nv series NAN and INF data is limited by the maximum value.
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
Chapter 2 LD/FBD Instructions
6F8C1226
200
Sign Negative
Type Conversion Sign Negative
LD/FBD language
notation
Input Output
NEG_
EN input Edge execution Index modification Modifier
ST language notation Output := NEG_
( Input );
Arguments
The following data types are supported for input and output arguments and the
instruction symbol depends on the data type:
Arg. Operand Type Const. Description Remarks
Input
Input
Output
See below
Output
Input Symbol Output
INT NEG_INT INT
DINT NEG_DINT DINT
REAL NEG_REAL REAL
Input Output
Function
The sign of the input data is negated and the result is output.
Program example
[LD/FBD language notation]
Normal execution
SAMPLE1
1234
LD
NEG_INT SAMPLE2
1234
ST
The sign of the input data 1234 in SAMPLE1 is inverted and the result -1234 is
stored in SAMPLE2.
NEG_
2.9 Type Conversion
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
201
Limit execution
SAMPLE1
32768
LD
NEG_INT SAMPLE2
32767
ST
The sign of the input data -32768 in SAMPLE1 is inverted, but the result 32767 is
stored in SAMPLE2 because the valid data range of SAMPLE2 is exceeded.
[ST language notation]
SAMPLE2 := NEG_INT( SAMPLE1);
Error information
If the conversion result of the input data exceeds the valid range of the output data
type, the limit of the output data type is output.
The following operation is performed when the input data type is REAL:
Controller Action
Integrated Controller V series If NAN data is entered as input, the result is NAN.
Unified Controller nv series NAN and INF data is limited by the maximum value.
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
Chapter 2 LD/FBD Instructions
6F8C1226
202
DEG-RAD Conversion
Type Conversion DEG-RAD Conversion
LD/FBD language
notation
Input Output
DEG_TO_RAD
EN input Edge execution Index modification Modifier
ST language notation Output := DEG_TO_RAD( Input );
Arguments
Arg. Operand Type Const. Description Remarks
Input REAL
Input
Output REAL Output
Function
The entered angle data is converted to radian data.
Output = Angle / 180
Program example
[LD/FBD language notation]
SAMPLE1
90.0
LD
DEG_TO_RAD SAMPLE2
1.57079
ST
[ST language notation]
SAMPLE2 := DEG_TO_RAD( SAMPLE1);
The input data 90 in SAMPLE1 is converted to radian and the result 1.57079 is
stored in SAMPLE2.
Error information
The following operation is performed when the input data type is REAL:
Controller Action
Integrated Controller V series
If NAN data is entered as input, the result is NAN.
If INF data is entered as input, the result is INF.
Unified Controller nv series NAN and INF data is limited by the maximum value.
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
2.9 Type Conversion
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
203
RAD-DEG Conversion
Type Conversion RAD-DEG Conversion
LD/FBD language
notation
Input Output
RAD_TO_DEG
EN input Edge execution Index modification Modifier
ST language notation Output := RAD_TO_DEG( Input );
Arguments
Arg. Operand Type Const. Description Remarks
Input REAL
Input
Output REAL Output
Function
The entered radian data is converted to angle data.
Output = Radian data 180 /
Program example
[LD/FBD language notation]
SAMPLE1
1.57079
LD
RAD_TO_DEG SAMPLE2
90.0
ST
[ST language notation]
SAMPLE2 := RAD_TO_DEG( SAMPLE1);
The input data 1.57079 in SAMPLE1 is converted to angle and the result 90 is
stored in SAMPLE2.
Error information
The following operation is performed when the input data type is REAL:
Controller Action
Integrated Controller V series
If NAN data is entered as input, the result is NAN.
If INF data is entered as input, the result is INF.
Unified Controller nv series NAN and INF data is limited by the maximum value.
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
Chapter 2 LD/FBD Instructions
6F8C1226
204
BIN Conversion
Type Conversion BIN Conversion
PCS
compatible
instruction
LD/FBD language
notation
Input Output
BIN__P
EN input Edge execution Index modification Modifier
ST language notation Output := BIN_
_P( Input );
Arguments
The following data types are supported for input and output arguments and the
instruction symbol depends on the data type:
Arg. Operand Type Const. Description Remarks
Input
Input
Output
See below
Output
Input Output
Input Symbol(_
) Output
WORD BIN_INT_P INT
DWORD BIN_DINT_P DINT
Function
The entered BCD data is converted to INT data.
The valid range of input data and the limit of output data are as follows. Input data
between 16#A and 16#F are invalid.
BIN_INT_P : 16#0 to 16#9999
[When each digit>9; limit each digit to 9]
BIN_DINT_P : 16#0 to16#99999999
[When each digit>9; limit each digit to 9]
BIN__P
2.9 Type Conversion
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
205
Instruction Input Output Limit
Valid input : Each digit 16#0 to 16#9 0 to 9999
BIN_INT_P
Invalid input : Each digit > 16#9 Limit each digit: 9
Valid input : Each digit 16#0 to 16#9 0 to 99999999
BIN_DINT_P
Invalid input : Each digit > 16#9 Limit each digit: 9
Program example
[LD/FBD language notation]
Normal execution
SAMPLE1
16#1234
LD
BIN_INT_P SAMPLE2
1234
ST
The input data 16#1234 in SAMPLE1 is converted to BIN and the result 1234 is
stored in SAMPLE2.
Limit execution
SAMPLE1
16#1A39
LD
BIN_INT_P SAMPLE2
1939
ST
Stores the result 1939 in SAMPLE2 because the input data 16#1A39 in SAMPLE1
contains invalid data A.
[ST language notation]
SAMPLE2 := BIN_INT_P( SAMPLE1);
Error information
If the input BCD data contains invalid data between 16#A and 16#F, the abnormal digit
is limited to 9.
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
Chapter 2 LD/FBD Instructions
6F8C1226
206
Time Data Type Conversion
Type Conversion Time Data Type Conversion
LD/FBD language
notation
Input Output
DT_TO_
EN input Edge execution Index modification Modifier
ST language notation Output := DT_TO_
( Input );
Arguments
The following data types are supported for input and output arguments and the
instruction symbol depends on the data type:
Arg. Operand Type Const. Description Remarks
Input T
Input
Output See below Output
Input Output
Symbol(_
) Output
DT_TO_TOD TOD
DT_TO_DATE DATE
Function
The entered DT data is converted to specified TOD data or DATE data.
Direct I/O variable cannot be specified for the input (Unified Controller nv series).
Program example
DT_TO_TOD
[LD/FBD language notation]
SAMPLE1
DT#1999-8-24-17:34:56
LD
DT_TO_TOD SAMPLE2
TOD#17:34:56
ST
[ST language notation]
SAMPLE2 := DT_TO_TOD( SAMPLE1);
The time of day data is extracted from input data DT#1999-8-24-17:34:56 in
SAMPLE1 and the result TOD#17:34:56 is stored in SAMPLE2.
DT_TO_
2.9 Type Conversion
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
207
DT_TO_DATE
[LD/FBD language notation]
SAMPLE1
DT#1999-8-24-17:34:56
LD
DT_TO_DATE SAMPLE2
DATE#1999-8-24
ST
[ST language notation]
SAMPLE2 := DT_TO_DATE( SAMPLE1);
The date data is extracted from input data DT#1999-8-24-17:34:56 in SAMPLE1 and
the result DATE#1999-8-24 is stored in SAMPLE2.
Error information
When the input exceeds the variable area, the time data type conversion is not
processed and the data boundary is exceeded.
The following operation is performed if direct I/O variable is specified for the input
(Unified Controller nv series):
Controller Action
Unified Controller nv series
Error flag and table operation error flag are set to
TRUE(ON) and the result is 0.
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
Chapter 2 LD/FBD Instructions
6F8C1226
208
Concatenate Time Data
Type Conversion Concatenate Time Data
LD/FBD language
notation
Input 1 Output
CONCAT_D_TOD
Input 2
EN input Edge execution Index modification Modifier
ST language notation CONCAT_D_TOD ( Input1, Input2, Output );
Arguments
Arg. Operand Type Const. Description Remarks
DATE
Input2 (Time of day
data)
Output DT Output
Function
The date data Input 1 is concatenated with time of day data Input 2 and the result is
output.
Direct I/O variable cannot be specified for the output (Unified Controller nv series).
Program example
[LD/FBD language notation]
SAMPLE3
DT#1999-8-24-17:34:56
ST
CONCAT_D_TOD
SAMPLE2
TOD#17:34:56
LD
SAMPLE1
DATE#1999-8-24
LD
[ST language notation]
CONCAT_D_TOD ( SAMPLE1, SAMPLE2, SAMPLE3);
The date data DATE#1999-8-24 in SAMPLE1 is concatenated with time data
TOD#17:34:56 in SAMPLE2 and the result DT#1999-8-24-17:34:56 is stored in
SAMPLE3.
2.9 Type Conversion
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
209
Error information
When the output exceeds the variable area, concatenate time data is not processed
and the data boundary is exceeded.
The following operation is performed if direct I/O variable is specified for the output-
(Unified Controller nv series):
Controller Action
Unified Controller nv series
Concatenation of time data is not executed.
Error flag and table operation error flag are set to TRUE (ON).
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
Chapter 2 LD/FBD Instructions
6F8C1226
210
ASCII-HEX Conversion
Type Conversion ASCII-HEX Conversion
T compatible
instruction
LD/FBD language
notation
Source table Destination table
ATOH_T
Table size
TBL
N
EN input Edge execution Index modification Modifier
ST language notation ATOH_T ( TBL, N, destination table);
Arguments
Arg. Operand Type Const. Description Remarks
TBL PTR Source table
Input
N UINT
ST language notation HTOA_T ( TBL, N, destination table );
Arguments
Arg. Operand Type Const. Description Remarks
TBL PTR Source table
Input
N UINT
ST language notation Output := ASC_TO_REAL ( Input string, N );
Arguments
Arg. Operand Type Const. Description Remarks
STRING Input string
Input
N UINT
Converted
characters
1N64
Output REAL Output
Function
N characters from the beginning of the entered input string are converted to REAL.
The input string may be expressed in numerical or exponential format.
Numerical format123.456
Exponential format-123.456E+2
The valid range of converted characters is 1 N 64. If N=0, no conversion is
performed.
The following characters may be converted. However, spaces are valid only when
they are at the beginning of the string. A space character is also counted as one
character.
+, -, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, E, e, .(period), (space)
The entered character string is analyzed as follows:
Direct I/O variable cannot be specified for the input string (Integrated Controller, S
Controller, Unified Controller).
SP
e
+
Number
.
Number
.
E
+
Number
2.9 Type Conversion
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
215
Program example
[LD/FBD language notation]
When the input string is specified in numerical format:
SAMPLE3
162.25
ST
ASC_TO_REAL
SAMPLE2
6
LD
SAMPLE1
162.25
LD
N
Six characters (specified by SAMPLE2) starting from the beginning of string 162.25
in SAMPLE1 are converted to REAL and the result 162.25 is stored in SAMPLE3.
When the input string is specified in exponential format:
SAMPLE3
0.125
ST
ASC_TO_REAL
SAMPLE2
7
LD
SAMPLE1
12.5E-23
LD
N
Seven characters (specified by SAMPLE2) starting from the beginning of string
12.5E-23 in SAMPLE1 are converted to REAL and the result 0.125 is stored in
SAMPLE3.
[ST language notation]
SAMPLE3 := ASC_TO_REAL (SAMPLE1, SAMPLE2);
Error information
When the input string exceeds the variable area, ASCII-real numbers conversion is not
processed and the data boundary is exceeded.
If there is a character code that cannot be converted within N characters from the
beginning of the input string, 0 is output as the result.
When the number of input characters is greater than the converted characters N, N is
limited to the number of entered characters.
If the converted data exceeds the range of REAL data, 0 is output as the result.
If converted characters N exceeds 64, it is limited to N=64.
The following operation is performed if direct I/O variable is specified for the input
string:
Controller Action
Integrated Controller
V series
S Controller Error flag is set to TRUE(ON) and the result is 0.
Unified Controller nv series
Error flag and table operation error flag are set to
TRUE(ON) and the result is 0.
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
Chapter 2 LD/FBD Instructions
6F8C1226
216
Real Numbers-ASCII Conversion
Type Conversion Real Numbers-ASCII Conversion
LD/FBD language
notation
Input data Output
REAL_TO_ASC
Output char SIZE
Decimal characte N
EN input Edge execution Index modification Modifier
ST language notation REAL_TO_ASC (Input data, SIZE, N, Output );
Arguments
Arg. Operand Type Const. Description Remarks
REAL
Input data
SIZE UINT
Output characters
Input0 : 0SIZE9
Input<0 : 0SIZE10 Input
N UINT
Decimal
characters
0N7
Output REAL Output
Function
The entered REAL data is converted to fixed point decimal string format specified by
SIZE and N and the result is output.
SIZE specifies the number of output characters including the decimal characters N
and the valid range depends on whether the input data is positive or negative.
Input data 0 :0 SIZE 9
Input data < 0 :0 SIZE 10
N specifies the number of decimal characters in the output string and the valid range is
0 N 7.
Largest value that can be converted: 9999999.0 (Positive: SIZE=9, N=1 specified,
Negative: SIZE=10, N=1 specified)
Smallest value that can be converted: 0.0000001 (Positive: SIZE=9, N=7 specified,
Negative: SIZE=10, N=7 specified)
If the converted result cannot be stored in the output string format specified by SIZE
and N, an error flag in the specific register is set to TRUE(ON) to indicate that
characters are truncated.
When SIZE=0, the result is NULL.
.
N
SIZE
Direct I/O variable cannot be specified for the output string (Integrated Controller, S
Controller, Unified Controller).
2.9 Type Conversion
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
217
Program example
[LD/FBD language notation]
Normal execution
SAMPLE4
162.2
ST
REAL_TO_ASC
SAMPLE2
5
LD
SAMPLE1
162.25
LD
SAMPLE3
1
LD
SIZE
N
REAL data 162.25 in SAMPLE1 is converted to string using output characters 5 in
SAMPLE2 and decimal characters 1 in SAMPLE3 and the result 162.2 is stored in
SAMPLE4.
Abnormal execution
SAMPLE4
-12.3
ST
REAL_TO_ASC
SAMPLE2
5
LD
SAMPLE1
-12.345
LD
SAMPLE3
2
LD
SIZE
N
REAL data -12.345 in SAMPLE1 is converted to string using output characters 5 in
SAMPLE2 and decimal characters 2 in SAMPLE3 and the result -12.3 is stored in
SAMPLE4. The error flag in specific register is set to TRUE(ON) to indicate that
characters are truncated.
[ST language notation]
REAL_TO_ASC ( SAMPLE1, SAMPLE2, SAMPLE3, SAMPLE4);
Chapter 2 LD/FBD Instructions
6F8C1226
218
Error information
When the output exceeds the variable area, real numbers-ASCII conversion is not
processed and the data boundary is exceeded.
If the converted result cannot be stored within SIZE, an error flag in the specific
register is set to TRUE(ON) to indicate that characters are truncated.
No conversion is performed when SIZE is greater than the defined string size.
The following operation is performed when the input data is NAN:
Controller Action
Integrated Controller V series Not converted when NAN is input.
Unified Controller nv series NAN and INF data is limited by the maximum value.
If SIZE and N specifying the output string format exceed the valid range, they are
limited by the maximum valid value.
When |input data| > 9999999, input data is limited to 9999999.
The following operation is performed when direct I/O variable is specified for the output
string:
Controller Action
Integrated Controller
V series
S Controller
Real Numbers-ASCII conversion is not executed.
Error flag is set to TRUE(ON).
Unified Controller nv series
Real Numbers-ASCII conversion is not executed.
Error flag and table operation error flag are set to
TRUE(ON).
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
2.9 Type Conversion
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
219
ASCII (decimal)-Double Integer Conversion
Type Conversion ASCII(decimal)-Double Integer Conversion
LD/FBD language
notation
Conversion table Output
ASCDEC_TO_DINT
Table size
TBL
N
EN input Edge execution Index modification Modifier
ST language notation Output := ASCDEC_TO_DINT ( TBL, N );
Arguments
Arg. Operand Type Const. Description Remarks
TBL PTR Conversion table
Input
N UINT
ST language notation Output := ASCHEX_TO_DINT ( TBL, N );
Arguments
Arg. Operand Type Const. Description Remarks
TBL PTR Conversion table
Input
N UINT
ST language notation DINT_TO_ASCDEC ( IN, N, Destination table );
Arguments
Arg. Operand Type Const. Description Remarks
IN DINT Conversion data
Input
N UINT
ST language notation DINT_TO_ASCHEX ( IN, N, Destination table );
Arguments
Arg. Operand Type Const. Description Remarks
IN DINT Conversion data
Input
N UINT
ST language notation ARRAY_TO_STRING ( IN, N, Destination string variable );
Arguments
Arg. Operand Type Const. Description Remarks
IN PTR Array data
Input
N UINT
ST language notation STRING_TO_ARRAY ( IN, L, P, Destination array );
Arguments
Arg. Operand Type Const. Description Remarks
IN STRING Input string
L UINT
Converted
characters
Input
P UINT
Start of converted
characters
Output PTR Destination array
Function
L character codes from the P character of the input string IN are stored in the specified
array.
CR code (16#0D) is appended at the end of the converted character code.
No operation is performed when L=0.
The data formats of the input string and destination are as follows:
0
1
2
3
4
5
3 (16#33) 2 (16#32)
5 (16#35) 4 (16#34)
CR (16#0D)
0
1
2
3
4
5
6 (16#36) 7 (16#37)
4 (16#34) 5 (16#35)
CR (16#0D) 3 (16#33)
0
1
2
3
4
5
2 (16#32) 1 (16#31)
4 (16#34) 3 (16#33)
6 (16#36) 5 (16#35)
8 (16#38) 7 (16#37)
STRING length=8
VAR length=6
7
6
0
1 STRING length=9
VAR length=6
2
3
4
5
6
7
8 (16#38) - (16#2D)
6 (16#36) 7 (16#37)
4 (16#34) 5 (16#35)
2 (16#32) 3 (16#33)
1 (16#31)
Ex. when string variable is declared as
follows:
Var. Data type Dec.
A STRING[12] VAR
<Input string>
<Destination array>
Character code storage area words as STRING[12]
Number of Stored character
Stored character code
1) 12345678 2) -87654321
When L=4, P=2 When L=5, P=3
Direct I/O variable cannot be specified for the input string and destination array
(Integrated Controller, S Controller, Unified Controller).
Chapter 2 LD/FBD Instructions
6F8C1226
234
Program example
[LD/FBD language notation]
TBL1
ST
STRING_TO_ARRAY
SAMPLE2
3
LD
SAMPLE1
LD
IN
L
TBL1 result
0 "1" (16#31)
1 "3" (16#33)
"2" (16#32)
2
CR(16#0D)
SAMPLE1 structure
0
"1" (16#31) "5" (16#35)
1
"3" (16#33) "2" (16#32)
2
"4" (16#34)
String length=5
VAR length=6
3
4
5
6
7
3
SAMPLE3
2
LD
P
<Variable declaration>
Variable Data type Dec.
SAMPLE1 STRING [12] VAR
[ST language notation]
STRING_TO_ARRAY ( SAMPLE1, SAMPLE2, SAMPLE3, TBL1);
In the source input string SAMPLE1, 3 characters specified by SAMPLE2 from
character start position 2 specified by SAMPLE3 are output to destination array TBL1
with end code CR appended.
Error information
When the input string and destination array exceed the variable area, the stringarray
conversion is not processed and the data boundary is exceeded.
When the conversion character position P=0, L characters from the beginning are
stored in the array.
When conversion character position P > storage character count, only CR code is
stored in the array.
The following operation is performed when direct I/O variable is specified for the input
string and destination array:
Controller Action
Integrated Controller
V series
S Controller
Stringarray conversion is not executed.
Error flag is set to TRUE(ON).
Unified Controller nv series
Stringarray conversion is not executed.
Error flag and table operation error flag are set to
TRUE(ON).
When EN is used, ENO is reset to FALSE(OFF) when the above error occurs.
2.9 Type Conversion
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
235
Tag Number Conversion
Type Conversion Tag Number Conversion
LD/FBD language
notation
Tag variable Tag
TO_INDEX
Tag type
TAG
TYPE
EN input Edge execution Index modification Modifier
ST language notation Tag number := TO_INDEX ( TAG, TYPE );
Arguments
Arg. Operand Type Const. Description Remarks
TAG PTR
Tag variable
(parameter)
Input
TYPE UINT
Tag type
0 : PV 1 : LP
2 : PB 3 : SQ
Output DINT Tag number
Function
The variable specified with tag variable TAG is converted to an array number within
the type specified with tag type TYPE, and the result is output.
The range of the tag type is from 0 to 3 (from 0 to 2 for the MCS type tag controller
(model1000) because SQ is not included.
Direct I/O variable cannot be specified for the tag variable.
Array type notation (e.g. PV_PARA[0]) and Tag No. notation (e.g. FIC101) can be
specified for tag variable.
This instruction is useful when processes using tags are standardized (user FB) and
tag variables are switched. For details, refer to "Program example.
Note
For the DS type tag controller, tag numbers of PV and LP are different, so no extension
is required (e.g. FIC101. TAG). For the MCS type tag controller (model 1000), tag
numbers of PV and LP are common, so Tag No. notation without extension (e.g.
FIC101) is not interpreted correctly. Therefore, specify tag numbers with extension
(e.g. FIC101.PVP and FIC101.ALP for LP, FIC101.TAG for PV).
Chapter 2 LD/FBD Instructions
6F8C1226
236
Program example
[LD/FBD language notation]
User FB(TAG_FB) caller
Variable Data type Val Dec.
PV1 REAL 0 VAR
PV2 REAL 0 VAR
TAG_FB_1 TAG_FB VAR
TAG_FB_2 TAG_FB VAR
IND01.TAG: PV_PARA[0]
IND02.TAG: PV_PARA[1]
User FB(TAG_FB)
Variable Data type Val Dec.
TAG PTR VAR_INPUT
OUT REAL VAR_OUTPUT
IND01.RH=200.0 IND01.RL=0.0 IND01.PV=24.0
IND02.RH=100.0 IND02.RL=-100.0 IND02.PV=24.0
IND01.TAG
LD
TAG_FB
TAG OUT
PV1
12
ST
TAG_FB_1
IND02.TAG
LD
TAG_FB
TAG OUT
PV2
62
ST
TAG_FB_2
TAG{INT}[0]
LD
0
LD
TO_INDEX
TAG
TYPE
XI
ST
PV_DATA[XI].
PV
LD
PV_PARA[XI].
RH
LD
PCT
IN
PV_RH
OUT
ST
IND01: 0
IND02: 1
IND01: 24.0
IND02: 24.0
IND01:12.0
IND02:62.0
[ST language notation]
TAG_FB_1 ( IND01.TAG); XI := TO_INDEX ( TAG{INT}[0], 0);
PV1 := TAG_FB_1.OUT; OUT := PCT ( PV_DATA[XI].PV, PV_PARA[XI].RH);
TAG_FB_2 (IND02.TAG);
PV2 := TAG_FB_2.OUT;
The user function block (TAG_FB) that has tag No. (TAG) as an input argument is
executed twice.
If IND01.TAG is specified, XI=0 in TAG_FB. If IND02.TAG is specified, XI=1. The
specified tag variable is accessed in each case.
Error information
If anything other than 0 to 3 (0 to 2 for the MCS type tag controller (model1000)) is
specified for tag type TYPE, or if tag variable TAG is out of range, a table operation
error occurs and the result output is "-1".
The following operation is performed if direct I/O is specified for the tag variable:
Controller Action
Integrated Controller
V series
S Controller
Table operation error flag is set to TRUE(ON) and the
result is -1.
Unified Controller nv series
Error flag and table operation error flag are set to
TRUE(ON) and the result is -1.
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
2.10 Numeric Function
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
237
2.10 Numeric Function
No. Instruction Remarks
1
Square Root SQRT
2
Exponential EXP
3
Common Logarithms LOG
4
Natural Logarithms LN
5
Absolute Value ABS
6
Sine SIN
7
Cosine COS
8
Tangent TAN
9
Arcsine ASIN
10
Arccosine ACOS
11
Arctangent ATAN
Chapter 2 LD/FBD Instruction
6F8C1226
238
Square Root
Numeric Function Square Root
LD/FBD language
notation
Input Output
SQRT
EN input Edge execution Index modification Modifier
ST language notation Output := SQRT( Input );
Arguments
Arg. Operand Type Const. Description
Input REAL
Input
Output REAL Output
Function
The square root of the input REAL data is obtained and the result is output.
input input of sign Output
Program example
[LD/FBD language notation]
SAMPLE1
3.0
LD
SQRT
SAMPLE2
1.732051
ST
[ST language notation]
SAMPLE2 := SQRT (SAMPLE1);
The square root of the input data 3 in SAMPLE1 is obtained and the result
1.732051 is stored in SAMPLE2.
Error information
The following operation is performed when the input data type is REAL:
Controller Action
Integrated Controller V series
If NAN data is entered as input, the result is NAN.
If INF data is entered as input, the result is INF.
Unified Controller nv series NAN and INF data are limited by the maximum value.
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
2.10 Numeric Function
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
239
Exponential
Numeric Function Exponential
LD/FBD language
notation
Input Output
EXP
EN input Edge execution Index modification Modifier
ST language notation Output := EXP( Input );
Arguments
Arg. Operand Type Const. Description
Input REAL
Input
Output REAL Output
Function
The exponential of the input REAL data is obtained and the result is output.
input exp Output
88.7228 0
1
3.40282E+38
Input data
Result output
Program example
[LD/FBD language notation]
SAMPLE1
3.0
LD
EXP
SAMPLE2
20.08553
ST
[ST language notation]
SAMPLE2 := EXP (SAMPLE1);
The exponential of the input data 3 in SAMPLE1 is obtained and the result
20.08553 is stored in SAMPLE2.
Chapter 2 LD/FBD Instruction
6F8C1226
240
Error information
The following operation is performed when the input data type is REAL:
Controller Action
Integrated Controller V series
If NAN data is entered as input, the result is NAN.
If INF data is entered as input, the result is INF.
Unified Controller nv series NAN and INF data are limited by the maximum value.
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
2.10 Numeric Function
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
241
Common Logarithms
Numeric Function Common Logarithms
LD/FBD language
notation
Input Output
LOG
EN input Edge execution Index modification Modifier
ST language notation Output := LOG( Input );
Arguments
Arg. Operand Type Const. Description
Input REAL
Input
Output REAL Output
Function
The common logarithm of the input REAL data is obtained and the result is output.
If the input data is 0, the result is 0.
Output=log( | input | )
0
-3.40282E+38
38.53184
Input data
Result output
3.40282E+38
Program example
[LD/FBD language notation]
SAMPLE1
3.0
LD
LOG
SAMPLE2
0.4771213
ST
[ST language notation]
SAMPLE2 := LOG( SAMPLE1);
The common logarithm of the input data 3 in SAMPLE1 is obtained and the result
0.4771213 is stored in SAMPLE2.
Chapter 2 LD/FBD Instruction
6F8C1226
242
Error information
The following operation is performed when the input data type is REAL:
Controller Action
Integrated Controller V series
If NAN data is entered as input, the result is NAN.
If INF data is entered as input, the result is INF.
Unified Controller nv series NAN and INF data are limited by the maximum value.
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
2.10 Numeric Function
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
243
Natural Logarithms
Numeric Function Natural Logarithms
LD/FBD language
notation
Input Output
LN
EN input Edge execution Index modification Modifier
ST language notation Output := LN( Input );
Arguments
Arg. Operand Type Const. Description
Input REAL
Input
Output REAL Output
Function
The natural logarithm of the input REAL data is obtained and the result is output.
If the input data is 0, the result is 0.
Outputln ( | input | )
0
-3.40282E+38
88.7228
Input data
Result output
3.40282E+38
Program example
[LD/FBD language notation]
SAMPLE1
3.0
LD
LN
SAMPLE2
1.098612
ST
[ST language notation]
SAMPLE2 := LN( SAMPLE1);
The natural logarithm of the input data 3 in SAMPLE1 is obtained and the result
1.098612 is stored in SAMPLE2.
Chapter 2 LD/FBD Instruction
6F8C1226
244
Error information
The following operation is performed if the input data type is REAL:
Controller Action
Integrated Controller V series
If NAN data is entered as input, the result is NAN.
If INF data is entered as input, the result is INF.
Unified Controller nv series NAN and INF data are limited by the maximum value.
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
2.10 Numeric Function
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
245
Absolute Value
Numeric Function Absolute Value
LD/FBD language
notation
Input Output
ABS_
EN input Edge execution Index modification Modifier
ST language notation Output := ABS_
( Input );
Arguments
The following data types are supported for input and output arguments and the
instruction symbol depends on the data type:
Arg. Operand Type Const. Description
Input
Input
Output
See below
Output
Input Symbol(_ ) Output
INT ABS_INT INT
DINT ABS_DINT DINT
REAL ABS_REAL REAL
Function
The absolute value of the input data is obtained and the result is output.
For INT data, the absolute value of the maximum negative value is the maximum
positive value.
Input data Result output
ABS_INT 32768 32767
ABS_DINT 2147483648 2147483647
Input Output
ABS_
Chapter 2 LD/FBD Instruction
6F8C1226
246
Program example
[LD/FBD language notation]
SAMPLE1
-1234
LD
ABS_INT
SAMPLE2
1234
ST
[ST language notation]
SAMPLE2 := ABS_INT (SAMPLE1);
The absolute value of the input data -1234 in SAMPLE1 is obtained and the result
1234 is stored in SAMPLE2.
Error information
The following operation is performed when the input data type is REAL:
Controller Action
Integrated Controller V series If NAN data is entered as input, the result is NAN.
Unified Controller nv series NAN and INF data are limited by the maximum value.
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
2.10 Numeric Function
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
247
Sine
Numeric Function Sine
LD/FBD language
notation Input Output
SIN
EN input Edge execution Index modification Modifier
ST language notation Output := SIN( Input );
Arguments
Arg. Operand Type Const. Description
Input REAL
Input
Output REAL Output
Function
The sine of the input REAL data is obtained and the result is output.
The input data must be in radians.
Output = Sin (input)
-4
0
Input data
Resul t output
-2 - -3 2 3 4
1.0
-1.0
Program example
[LD/FBD language notation]
SAMPLE1
1.047198
LD
SIN
SAMPLE2
0.8660254
ST
[ST language notation]
SAMPLE2 := SIN (SAMPLE1);
The sine of the input data 1.047198 in SAMPLE1 is obtained and the result
0.8660254 is stored in SAMPLE2.
Chapter 2 LD/FBD Instruction
6F8C1226
248
Error information
The following operation is performed when the input data type is REAL:
Controller Action
Integrated Controller V series
If NAN data is entered as input, the result is NAN.
If INF data is entered as input, the result is INF.
Unified Controller nv series NAN and INF data are limited by the maximum value.
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
2.10 Numeric Function
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
249
Cosine
Numeric Function Cosine
LD/FBD language
notation
Input Output
COS
EN input Edge execution Index modification Modifier
ST language notation Output := COS( Input );
Arguments
Arg. Operand Type Const. Description
Input REAL
Input
Output REAL Output
Function
The cosine of the input REAL data is obtained and the result is output.
The input data must be in radians.
Output = Cos (input)
0
Input data
Result output
-2 - -3 2 3
1.0
-1.0
Program example
[LD/FBD language notation]
SAMPLE1
1.047198
LD
COS
SAMPLE2
0.5
ST
[ST language notation]
SAMPLE2 := COS( SAMPLE1);
The cosine of the input data 1.047198 in SAMPLE1 is obtained and the result 0.5
is stored in SAMPLE2.
Chapter 2 LD/FBD Instruction
6F8C1226
250
Error information
The following operation is performed when the input data type is REAL:
Controller Action
Integrated Controller V series
If NAN data is entered as input, the result is NAN.
If INF data is entered as input, the result is INF.
Unified Controller nv series NAN and INF data are limited by the maximum value.
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
2.10 Numeric Function
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
251
Tangent
Numeric Function Tangent
LD/FBD language
notation Input Output
TAN
EN input Edge execution Index modification Modifier
ST language notation Output := TAN( Input );
Arguments
Arg. Operand Type Const. Description
Input REAL
Input
Output REAL Output
Function
The tangent of the input REAL data is obtained and the result is output.
The input data must be radians.
OutputTan (input)
0
Result output
-2 - -3 2 3 4
-Infinity
+Infinity
Input data
-4
Program example
[LD/FBD language notation]
SAMPLE1
1.047198
LD
TAN
SAMPLE2
1.732051
ST
[ST language notation]
SAMPLE2 := TAN( SAMPLE1);
The tangent of the input data 1.047198 in SAMPLE1 is obtained and the result
1.732051 is stored in SAMPLE2.
Chapter 2 LD/FBD Instruction
6F8C1226
252
Error information
The following operation is performed when the input data type is REAL:
Controller Action
Integrated Controller V series
If NAN data is entered as input, the result is NAN.
If INF data is entered as input, the result is INF.
Unified Controller nv series NAN and INF data are limited by the maximum value.
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
2.10 Numeric Function
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
253
Arcsine
Numeric Function Arcsine
LD/FBD language
notation
Input Output
ASIN
EN input Edge execution Index modification Modifier
ST language notation Output := ASIN( Input );
Arguments
Arg. Operand Type Const. Description
Input REAL
Input
Output REAL Output
Function
The arcsine of the input REAL data is obtained and the result is output.
The output data is in radians.
Input data must be between -1.000000 and +1.000000.
If Input data > 1.000000, Input data is assumed to be 1.000000.
If Input data < -1.000000, Input data is assumed to be -1.000000
Output = Asin (input)
-2.0
0
Input data
Result output
-1.0
-0.5
-1.5 0.5 1.0 1.5 2.0
1.0
2.0
-1.0
-2.0
Chapter 2 LD/FBD Instruction
6F8C1226
254
Program example
[LD/FBD language notation]
SAMPLE1
0.5
LD
ASIN
SAMPLE2
0.5235988
ST
[ST language notation]
SAMPLE2 := ASIN( SAMPLE1);
The arcsine of the input data 0.5 in SAMPLE1 is obtained and the result 0.5235988
is stored in SAMPLE2.
Error information
The following operation is performed when the input data type is REAL:
Controller Action
Integrated Controller V series
If NAN data is entered as input, the result is NAN.
If INF data is entered as input, the result is INF.
Unified Controller nv series NAN and INF data are limited by the maximum value.
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
2.10 Numeric Function
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
255
Arccosine
Numeric Function Arccosine
LD/FBD language
notation
Input Output
ACOS
EN input Edge execution Index modification Modifier
ST language notation Output := ACOS( Input );
Arguments
Arg. Operand Type Const. Description
Input REAL
Input
Output REAL Output
Function
The arccosine of the input REAL data is obtained and the result is output.
The output data is in radians.
Input data must be between -1.000000 and +1.000000.
If Input data > 1.000000, Input data is assumed to be 1.000000.
If Input data < -1.000000, Input data is assumed to be -1.000000.
Output = Acos (input)
-2.0
0
Input data
Result ouput
-1.0 -0.5 -1.5 0.5 1.0 1.5 2.0
3.0
4.0
2.0
1.0
Chapter 2 LD/FBD Instruction
6F8C1226
256
Program example
[LD/FBD language notation]
SAMPLE1
0.5
LD
ACOS
SAMPLE2
1.047198
ST
[ST language notation]
SAMPLE2 := ACOS( SAMPLE1);
The arccosine of the input data 0.5 in SAMPLE1 is obtained and the result
1.047198 is stored in SAMPLE2.
Error information
The following operation is performed when the input data type is REAL:
Controller Action
Integrated Controller V series
If NAN data is entered as input, the result is NAN.
If INF data is entered as input, the result is INF.
Unified Controller nv series NAN and INF data are limited by the maximum value.
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
2.10 Numeric Function
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
257
Arctangent
Numeric Function Arctangent
LD/FBD language
notation
Input Output
ATAN
EN input Edge execution Index modification Modifier
ST language notation Output := ATAN( Input );
Arguments
Arg. Operand Type Const. Description
Input REAL
Input
Output REAL Output
Function
The arctangent of the input REAL data is obtained and the result is output.
The output data is in radians.
Output = Atan (input data)
0
Input data
Result output
1.0
2.0
-1.0
-2.0
Program example
[LD/FBD language notation]
SAMPLE1
0.5
LD
ATAN
SAMPLE2
0.4636476
ST
[ST language notation]
SAMPLE2 := ATAN( SAMPLE1);
The arctangent of the input data 0.5 in SAMPLE1 is obtained and the result
0.4636476 is stored in SAMPLE2.
Chapter 2 LD/FBD Instruction
6F8C1226
258
Error information
The following operation is performed when the input data type is REAL:
Controller Action
Integrated Controller V series
If NAN data is entered as input, the result is NAN.
If INF data is entered as input, the result is INF.
Unified Controller nv series NAN and INF data are limited by the maximum value.
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
2.11 Logical Operation
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
259
2.11 Logical Operation
No. Instruction Remarks
1 Bitwise Boolean AND AND
2 Bitwise Boolean AND of Table Data TAND
3 Bitwise Boolean OR OR
4 Bitwise Boolean OR of Table Data TOR
5 Bitwise Boolean NOT NOT
6 Bitwise Boolean NOT of Table Data TNOT
7 Bitwise Boolean XOR XOR
8 Bitwise Boolean XOR of Table Data TXOR
9 Bitwise Boolean NOT XOR of Table Data TXNR
10 Test TEST
Chapter 2 LD/FBD Instructions
6F8C1226
260
Bitwise Boolean AND
Logical Operation Bitwise Boolean AND
LD/FBD language
notation
Input 1 Output
AND_
Input 2
Input n
EN input Edge execution Index modification Modifier
ST language notation Output := AND_
Input1n 2n15
Output
See below
Output
Input 1n Symbol(_ ) Output
BOOL AND_BOOL BOOL
WORD AND_WORD WORD
DWORD AND_DWORD DWORD
Function
The Bitwise Boolean AND of input data Input 1 to Input n is obtained and the result is
output.
Up to 15 input data are allowed.
Input 1 to n must have the same data type.
Input 1
Output AND_
Input 2
Input n
ST language notation TAND( TBL1, TBL2 , N, Output table );
Arguments
Arg. Operand Type Const. Description Remarks
TBL1 PTR Input table 1
TBL2 PTR Input table 2 Input
N UINT
ST language notation Output := OR_
Input1 n 2n15
Output
See below
Output
Input 1n Symbol(_ ) Output
BOOL OR_BOOL BOOL
WORD OR_WORD WORD
DWORD OR_DWORD DWORD
Input 1 Output
OR_
Input 2
Input n
Function
The Bitwise Boolean OR of input data Input 1 to Input n is obtained and the result is
output.
Up to 15 input data are allowed.
Input 1 to n must have the same data type.
ST language notation TOR( TBL1, TBL2 , N, Output table );
Arguments
Arg. Operand Type Const. Description Remarks
TBL1 PTR Input table 1
TBL2 PTR Input table 2 Input
N UINT
[ST language notation]
TOR (TABLE1, TABLE2, 3, TABLE3);
The Bitwise Boolean OR of 3 words data starting from input tables TABLE1 and
TABLE2 is obtained and the result is stored in output table TABLE3.
Error information
When the input table and out table exceed the variable area, bitwise Boolean OR of
table data is not processed and the data boundary is exceeded.
If N exceeds 64, it is limited to N=64
The following operation is performed when direct I/O variable is specified for the input
table and output table:
Controller Action
Integrated Controller
V series
S Controller
Bitwise Boolean OR of table data is not executed.
Error flag is set to TRUE(ON).
Unified Controller nv series
Bitwise Boolean OR of table data is not executed.
Error flag and table operation error flag are set to
TRUE(ON).
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
Chapter 2 LD/FBD Instructions
6F8C1226
268
Bitwise Boolean NOT
Logical Operation Bitwise Boolean NOT
LD/FBD language
notation
Input
Output
NOT_
EN input Edge execution Index modification Modifier
ST language notation Output := NOT_
( Input );
Arguments
The following data types are supported for input and output arguments and the
instruction symbol depends on the data type:
Arg. Operand Type Const. Description Remarks
Input
Input
Output
See below
Output
Input Symbol(_ ) Output
BOOL NOT_BOOL BOOL
WORD NOT_WORD WORD
DWORD NOT_DWORD DWORD
Input Output
NOT_
Function
The Bitwise Boolean NOT of input data is obtained and the result is output.
Program example
[LD/FBD language notation]
SAMPLE1
16#1234
LD
NOT_WORD
SAMPLE2
16#EDCB
ST
[ST language notation]
SAMPLE2 := NOT_WORD(SAMPLE1);
The Bitwise Boolean NOT of input data 16#1234 in SAMPLE1 is obtained and the
result 16#EDCB is stored in SAMPLE2.
ST language notation TNOT( TBL , N, Output table );
Arguments
Arg. Operand Type Const. Description Remarks
TBL PTR Input table
Input
N UINT
ST language notation Output := XOR_
Input1 n 2n15
Output
See below
Output
Input 1 n Symbol(_ ) Output
BOOL XOR_BOOL BOOL
WORD XOR_WORD WORD
DWORD XOR_DWORD DWORD
Input 1 Output
XOR_
Input 2
Input n
Function
The Bitwise Boolean XOR of input data Input 1 to Input n is obtained and the result is
output.
Up to 15 input data are allowed.
Input 1 to n must have the same data type.
ST language notation TXOR( TBL1, TBL2, N, Output table );
Arguments
Arg. Operand Type Const. Description Remarks
TBL1 PTR Input table1
TBL2 PTR Input table2 Input
N UINT
[ST language notation]
TXOR (TABLE1, TABLE2, 3, TABLE3);
The Bitwise Boolean XOR of 3 words data starting from Input table TABLE1 and
TABLE2 is obtained and the result is stored in output table TABLE3.
Error information
When the input table and output table exceed the variable area, the bitwise Boolean
XOR of table data is not processed and the data boundary is exceeded.
If N exceeds 64, it is limited to N=64.
The following operation is performed when direct I/O variable is specified for the input
table and output table:
Controller Action
Integrated Controller
V series
S Controller
Bitwise Boolean XOR of table data is not executed.
Error flag is set to TRUE(ON).
Unified Controller nv series
Bitwise Boolean XOR of table data is not executed.
Error flag and table operation error flag are set to
TRUE(ON).
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
2.11 Logical Operation
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
275
Bitwise Boolean NOT XOR of Table Data
Logical Operation Bitwise Boolean NOT XOR of Table Data
LD/FBD language
notation
Input table 1 Output table
TXNR
TBL1
TBL2
N
Table word number
Input table 2
EN input Edge execution Index modification Modifier
ST language notation TXNR( TBL1, TBL2 , N, Output table );
Arguments
Arg. Operand Type Const. Description Remarks
TBL1 PTR Input table1
TBL2 PTR Input table2 Input
N UINT
[ST language notation]
TXNR( TABLE1, TABLE2, 3, TABLE3);
The Bitwise Boolean NOT XOR of 3 words data starting from Input table TABLE1 and
TABLE2 is obtained and the result is stored in output table TABLE3.
Error information
When the input table and output table exceed the variable area, the bitwise Boolean
NOT XOR of table data is not processed and the data boundary is exceeded.
If N exceeds 64, it is limited to N=64.
The following operation is performed when direct I/O variable is specified for the input
table and output table.
Controller Action
Integrated Controller
V series
S Controller
Bitwise Boolean NOT XOR of table data is not
executed.
Error flag is set to TRUE(ON).
Unified Controller nv series
Bitwise Boolean NOT XOR of table data is not
executed.
Error flag and table operation error flag are set to
TRUE(ON).
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
2.11 Logical Operation
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
277
Test
Logical Operation Test
LD/FBD language
notation
Input 1 Output TEST_
Input 2
EN input Edge execution Index modification Modifier
ST language notation Output := TEST_
( Input1, Input2 );
Arguments
The following data types are supported for input and output arguments and the
instruction symbol depends on the data type:
Arg. Operand Type Const. Description Remarks
Input
ST language notation Output := SHR_
( IN, N );
Arguments
The following data types are supported for input and output arguments and the
instruction symbol depends on the data type:
Arg. Operand Type Const. Description Remarks
IN See below
Input
Input
N UINT
Shift number
Output See below Output
Input Symbol (_ ) Output
WORD SHR_WORD WORD
DWORD SHR_DWORD DWORD
Input Output
Shift
number
SHR_
Function
Right shifts the input data by shift number N and outputs the result.
Empty bits after shifting are padded with 0.
The bit that is shifted out last is input to the specific register carry flag.
The shift number N is as follows. The data is not shifted when shift number N=0.
Symbol Shift number
SHR_WORD MOD(N/16)
SHR_DWORD MOD(N/32)
ST language notation Output := SHL_
( IN, N );
Arguments
The following data types are supported for input and output arguments and the
instruction symbol depends on the data type:
Arg. Operand Type Const. Description Remarks
IN See below
Input
Input
N UINT
Shift number
Output See below Output
Input Symbol (_ ) Output
WORD SHL_WORD WORD
DWORD SHL_DWORD DWORD
Input Output
SHL_
IN
N
Shift
number
Function
Left shifts the input data by shift number N and outputs the result.
Empty bits after shifting are padded with 0.
The bit that is shifted out last is input to the specific register carry flag.
The shift number N is as follows. The data is not shifted when shift number N=0.
Symbol Shift number
SHL_WORD MOD(N/16)
SHL_DWORD MOD(N/32)
ST language notation Output := ROR_
( IN, N );
Arguments
The following data types are supported for input and output arguments and the
instruction symbol depends on the data type:
Arg. Operand Type Const. Description Remarks
IN See below
Input
Input
N UINT
Rotate number
Output See below Output
Input Symbol(_ ) Output
WORD ROR_WORD WORD
DWORD ROR_DWORD DWORD
Input Output
ROR_
IN
N
Rotate
number
Function
Right rotates the input data by rotate number N and outputs the result.
The last bit data rotated from the least significant bit is input to the specific register
carry flag.
Rotate number N is as follows. No bit is rotated if rotate number N=0.
Symbol Rotate
number
ROR_WORD MOD(N/16)
ROR_DWORD MOD(N/32)
F E D C B A 9 8 7 6 5 4 3 2 1 0
1 0 0 1 1 0 0 0 0 1 1 1 0 1 1 0
F E D C B A 9 8 7 6 5 4 3 2 1 0
1 0 0 1 1 0 0 0 0 1 1 1 0 1 0 1
CF
1
[ST language notation]
SAMPLE3 := ROR_WORD( SAMPLE1, SAMPLE2);
Right rotates the input data 16#9876 in SAMPLE1 by rotate number (=MOD(18/16))
specified by SAMPLE2 and stores the rotated result 16#A61D in SAMPLE3. The
last bit data TRUE(ON) rotated from the least significant bit is stored in specific
register carry flag.
2.12 Bit Operation
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
285
Rotate Bits Left
Bit Operation Rotate Bits Left
LD/FBD language
notation
Input Output
ROL_
IN
N Rotate number
EN input Edge execution Index modification Modifier
ST language notation Output := ROL_
( IN, N );
Arguments
The following data types are supported for input and output arguments and the
instruction symbol depends on the data type:
Arg. Operand Type Const. Description Remarks
IN See below
Input
Input
N UINT
Rotate number
Output See below Output
Input Symbol(_ ) Output
WORD ROL_WORD WORD
DWORD ROL_DWORD DWORD
Input Output
ROL_
IN
N
Rotate
number
Function
Rotates input data left by N bits and outputs the result.
The last bit data rotated from the most significant bit is input to specific register carry
flag.
Rotate number N is as follows. No bit is rotated if rotate number N=0.
Symbol Rotate
number
ROL_WORD MOD(N/16)
ROL_DWORD MOD(N/32)
ST language notation Output := SFA_
_P( IN, N );
Arguments
The following data types are supported for input and output arguments and the
instruction symbol depends on the data type:
Arg. Operand Type Const. Description Remarks
IN See below
Input
Input
N INT
Shift number
Output See below Output
Input Symbol(_ ) Output
WORD SFA_WORD_P WORD
DWORD SFA_DWORD_P DWORD
Input Output
SFA_ _P
IN
N
Shift
number
Function
Arithmetic shifts the input data by shift number N and outputs the result.
If shift right is specified, the most significant bit is fixed as sign and the state of the
most significant bit is inserted in most significant bit-1.
If shift left is specified, the most significant bit is fixed as sign and the bits starting from
the most significant bit-1 are shifted left.
If shift left is specified, the most significant bit is fixed as sign and the bits starting from
the most significant bit-1 are shifted left.
Symbol Shift
number
Shift direction
SFA_WORD_P MOD(N/16)
SFA_DWORD_P MOD(N/32)
N<0: Left
N>0: Right
ST language notation Output := SFL_
_P( IN, N );
Arguments
The following data types are supported for input and output arguments and the
instruction symbol depends on the data type:
Arg. Operand Type Const. Description Remarks
IN See below
Input
Input
N INT
Shift number
Output See below Output
Input Symbol(_ ) Output
WORD SFL_WORD_P WORD
DWORD SFL_DWORD_P DWORD
Input Output
SFL_ _P
IN
N
Shift
number
Function
Logical shifts the input data by shift number N and outputs the result.
Shift number N specifies the shift number and shift direction. No shift is performed if shift
number=0.
Symbol Shift
number
Shift direction
SFL_WORD_P MOD(N/16)
SHL_DWORD_P MOD(N/32)
N<0: Left
N>0: Right
ST language notation Output := ADD_
Input1n 2n15
Output
See below
Output
Input 1 n Symbol(_ ) Output
INT ADD_INT INT
DINT ADD_DINT DINT
UINT ADD_UINT UINT
REAL ADD_REAL REAL
Input 1 Output
ADD_
Input 2
Input n
Function
Input data Input 1 to Input n are added and the result is output.
Up to 15 input data are allowed.
Input 1 to n must have the same data type.
Output = Input 1 + Input 2 +...+ Input n
Important
With ADD_REAL, if the absolute value of addend and augend differ significantly (difference in
exponent 24), the result is the value of the data with larger absolute value.
ST language notation Output := ADC_( Input1, Input2 );
Arguments
The following data types are supported for input and output arguments and the
instruction symbol depends on the data type:
Arg. Operand Type Const. Description Remarks
Input
Input1,2
Output
See below
Output
Input I, 2 Symbol(_ ) Output
INT ADC_INT INT
DINT ADC_DINT DINT
Input 1 Output
ADC_
Input 2
Function
Input data Input 1 and Input 2 are added with carry including the specific register S
register carry flag and the result is output.
The carry flag is processed as follows:
When there is carry from most significant bit (carry out): carry flag is set to TRUE
(ON)
When there is no carry from most significant bit (no carry out): carry flag is reset to FALSE
(OFF)
When EN is used, ENO output is set as follows:
Carry from most significant bit (carry out) or carry from most significant bit1 to
most significant bit: ENO output is reset to FALSE(OFF).
Input 1 and input 2 must have the same data type.
Output=Input 1+Input 2+carry flag
ST language notation Output := SUB_( Input1, Input2 );
Arguments
The following data types are supported for input and output arguments and the
instruction symbol depends on the data type:
Arg. Operand Type Const. Description Remarks
Input Input1, 2
Output
See below
Output
Input 1,2 Symbol(_ ) Output
INT SUB_INT INT
DINT SUB_DINT DINT
UINT SUB_UINT UINT
REAL SUB_REAL REAL
Input 1 Output
SUB_
Input 2
Function
Input data of Input1 and Input2 are subtracted and the result is output.
Input1 and Input2 must have the same data type.
OutputInput1-Input2
Important
With SUB_REAL, if the absolute value of subtrahend and minuend differs significantly (difference
in exponent 24), the result is the value of the data with larger absolute value.
ST language notation Output := SBB_( Input1, Input2 );
Arguments
The following data types are supported for input and output arguments and the
instruction symbol depends on the data type:
Arg. Operand Type Const. Description Remarks
Input
Input1, 2
Output
See below
Output
Input 1,2 Symbol(_ ) Output
INT SBB_INT INT
DINT SBB_DINT DINT
Input 1 Output
SBB_
Input 2
Function
Input data Input 2 is subtracted from Input 1 with carry including the specific register
carry flag and the result is output.
Carry flag is processed as follows:
When there is borrow to the most significant bit (borrow in): carry flag is set to
TRUE(ON).
When there is no borrow to the most significant bit (no borrow in): carry flag is reset to
FALSE(OFF).
When EN is used, ENO output is set as follows:
When there is borrow to the most significant bit (borrow in) or when there is borrow
from the most significant bit to most significant bit-1: ENO output=FALSE(OFF).
Input 1 and input 2 must have the same data type.
Output=Input 1-Input 2-carry flag
ST language notation Output := MUL_( Input1, Input2, , Inputn );
Arguments
The following data types are supported for input and output arguments and the
instruction symbol depends on the data type.
Arg. Operand Type Const. Description Remarks
Input
Input1 n 2n15
Output
See below
Output
Input 1 n Symbol(_ ) Output
INT MUL_INT INT
DINT MUL_DINT DINT
UINT MUL_UINT UINT
REAL MUL_REAL REAL
Input 1 Output
MUL_
Input 2
Input n
Function
Input data Input 1 to Input n are multiplied and the result is output.
Up to 15 input data are allowed.
Input 1 to n must have the same data type.
Output=Input 1 * Input 2 * * Input n
ST language notation Output := MUL_INT_DINT( Input1, Input2 );
Arguments
Arg. Operand Type Const. Description Remarks
Input INT
Input1, 2
Output DINT Output
Function
INT input data Input 1 and Input 2 are multiplied and the result is output as DINT.
The number of input data is fixed at 2.
Input 1 and input 2 must have the same data type.
Output=Input 1 * Input 2
Program example
[LD/FBD language notation]
SAMPLE1
129
LD
MUL_INT_DINT
SAMPLE2
-3265
LD
SAMPLE5
-421185
ST
[ST language notation]
SAMPLE5 := MUL_INT_DINT( SAMPLE1, SAMPLE2);
The input data 129 in SAMPLE1 is multiplied with 3265 in SAMPLE2 and the result
-421185 is stored in SAMPLE5.
2.13 Arithmetic Operation
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
303
Divide
Arithmetic Operation Divide
LD/FBD language
notation
Input 1 Output
DIV_
Input 2
EN input Edge execution Index modification Modifier
ST language notation Output := DIV_( Input1, Input2 );
Arguments
The following data types are supported for input and output arguments and the
instruction symbol depends on the data type.
Arg. Operand Type Const. Description Remarks
Input
Input1, 2
Output
See below
Output
Input 1, 2 Symbol(_ ) Output
INT DIV_INT INT
DINT DIV_DINT DINT
UINT DIV_UINT UINT
REAL DIV_REAL REAL
Input 1 Output
DIV_
Input 2
Function
Input data Input 1 is divided with Input 2 and the result is output.
Input 1 and Input 2 must have the same data type.
Output=Input 1/ Input 2
ST language notation Output := MOD_( Input1, Input2 );
Arguments
The following data types are supported for input and output arguments and the
instruction symbol depends on the data type:
Arg. Operand Type Const. Description Remarks
Input
Input1, 2
Output
See below
Output
Input 1,2 Symbol(_ ) Output
INT MOD_INT INT
DINT MOD_DINT DINT
UINT MOD_UINT UINT
Input 1 Output
MOD_
Input 2
Function
Input data Input 1 is divided by Input 2 and the remainder is output.
Input 1 and Input 2 must have the same data type.
Output=MOD (Input 1/ Input 2)
ST language notation Output := INC_( V );
Arguments
The following data types are supported for input/output and output arguments and the
instruction symbol depends on the data type.
Arg. Operand Type Const. Description Remarks
I/O Input/Output1
Output
See below
Output
Input_Output 1
Symbol(_ ) Output
INT INC_INT INT
DINT INC_DINT DINT
UINT INC_UINT UINT
REAL INC_REAL REAL
Input_
Output 1
Output
INC_
V V
Input_Output 1
Function
The input/output data Input_Output 1 is incremented and the result is output.
The result is not limited even if the result exceeds the data range.
Direct I/O variable cannot be specified for Input/Output 1 (Unified Controller).
Output=Input_Output 1+1
ST language notation Output := DEC_( V );
Arguments
The following data types are supported for input/output and output arguments and the
instruction symbol depends on the data type:
Arg. Operand Type Const. Description Remarks
Input/
Output
Input/Output1
Output
See below
Output
Input_Output 1
Symbol(_ ) Output
INT DEC_INT INT
DINT DEC_DINT DINT
UINT DEC_UINT UINT
REAL DEC_REAL REAL
Input_Output 1
Output
DEC_
V V
Input_Output 1
Function
The input/output data Input_Output 1 is decremented and the result is output.
The result is not limited even if the result exceeds the data range.
Direct I/O variable cannot be specified for the Input/Output1 (Unified Controller).
Output=Input_Output 1 - 1
ST language notation Output := EXPT_( Input1, Input2 );
Arguments
The following data types are supported for input and output arguments and the
instruction symbol depends on the data type:
Arg. Operand Type Const. Description Remarks
Input1 REAL
Input1
Input
Input2 See below
Input2
Output REAL Output
Input 2 Symbol(_ )
INT EXPT_INT
DINT EXPT_DINT
UINT EXPT_UINT
REAL EXPT_REAL
Input 1 Output
EXPT_
Input 2
Function
Input data Input 1 is raised to the Input 2 power and the result is output.
Output=(Input 1)
Input 2
ST language notation Output := ADD_( Input1, Input2 );
Arguments
The following data types are supported for input and output arguments and the
instruction symbol depends on the data type:
Arg. Operand Type Const. Description Remarks
Input
*1 Input1, 2
Output
See below
Output
Note: For constant specification of input 1, constant specification is not allowed for DT type.
Input 1 Output 2 Symbol(_ ) Output
TIME TIME ADD_T_T TIME
TOD TIME ADD_TOD_T TOD
DT TIME ADD_DT_T DT
DATE INT ADD_D_INT DATE
DATE DINT ADD_D_DINT DATE
DATE UINT ADD_D_UINT DATE
Input 1 Output
ADD_
Input 2
Function
Input data Input 1 is added and Input 2 and the result is output.
The number of input data is fixed at two.
In case of addition of DT type and integer data, integer data is assumed to be number
of days.
Output=Input1+Input2
ST language notation Output := SUB_( Input1, Input2 );
Arguments
The following data types are supported for input and output arguments and the
instruction symbol depends on the data type.
Arg. Operand Type Const. Description Remarks
Input
*1 Input1, 2
Output
See below
Output
* For constant specification of input 1, constant specification is not allowed for DT type.
Input 1 Input 2 Symbol(_ ) Output
TIME TIME SUB_T_T TIME
DATE DATE SUB_D_D TIME
TOD TIME SUB_TOD_T TOD
TOD TOD SUB_TOD_TOD TIME
DT TIME SUB_DT_T DATE
DT DT SUB_DT_DT TIME
DATE DATE SUB_D_D_INT INT
DATE DATE SUB_D_D_DINT DINT
DATE DATE SUB_D_D_UINT UINT
DATE INT SUB_D_INT DATE
DATE DINT SUB_D_DINT DATE
DATE UINT SUB_D_UINT DATE
Input 1 Output
SUB_
Input 2
Function
Input data Input 2 is subtracted from Input 1 and the result is output.
The number of input data is fixed at two.
For subtraction of integer type data, integer data is assumed to be number of days.
Output=Input1-Input2
ST language notation Output := MUL_( Input1, Input2 );
Arguments
The following data types are supported for input and output arguments and the
instruction symbol depends on the data type:
Arg. Operand Type Const. Description Remarks
Input1 TIME
Input1
Input
Input2 See below
Input2
Output TIME Output
Input 2 Symbol(_ )
INT MUL_T_INT
DINT MUL_T_DINT
UINT MUL_T_UINT
Input 1 Output
MUL_
Input 2
Function
Input data Input 1 is multiplied with Input 2 as time data and the result is output.
Output=Input1Input2
ST language notation Output := DIV_( Input1, Input2 );
Arguments
The following data types are supported for input and output arguments and the
instruction symbol depends on the data type:
Arg. Operand Type Const. Description Remarks
Input1 TIME
Input1
Input
Input2 See below
Input2
Output TIME Output
Input 2 Symbol(_ )
INT DIV_T_INT
DINT DIV_T_DINT
UINT DIV_T_UINT
Input 1 Output
DIV_
Input 2
Function
Input data Input 1 is divided by Input 2 as time data and the result is output.
Output=Input1/Input2
Input
Output BOOL Output
Function
When the input is TRUE(ON), the specific register carry flag is reset to FALSE(OFF).
When the input is FALSE(OFF), the specific register carry flag is unchanged.
The state of the input is output as the result.
Input Action Output
FALSE(OFF) Not executed (carry flag retains previous
value).
FALSE(OFF)
TRUE(ON) Executed (carry flag=FALSE(OFF)) TRUE(ON)
Program example
[LD/FBD language notation]
SIGNAL1
1
LD
RSTC
SIGNAL2
1
ST
[ST language notation]
SIGNAL2 := RSTC( SIGNAL1);
When SIGNAL1 is TRUE(ON), the carry flag is reset to FALSE(OFF) and TRUE(ON)
is output to SIGNAL2.
Chapter 2 LD/FBD Instructions
6F8C1226
324
Encode
Data Processing Encode
LD/FBD language
notation
Input data Bit No. output
ENC_
EN input Edge execution Index modification Modifier
ST language notation Bit No. output := ENC_
( Input data );
Arguments
The following data types are supported for input and output arguments and the
instruction symbol depends on the data type:
Arg. Operand Type Const. Description Remarks
Input
Input data
Output
See below
Bit No. output
Input data Symbol(_ ) Bit No. output
WORD ENC_WORD_INT INT
WORD ENC_WORD_DINT DINT
DWORD ENC_DWORD_INT INT
DWORD ENC_DWORD_DINT DINT
Input data Bit No. output
ENC_
Function
Searches the input data from the most significant bit and outputs the number of the
first bit that is TRUE(ON).
he output bit number depends on the data type of the input data as follows:
WORD :0 to 15
DWORD :0 to 31
If the input data has no TRUE(ON) bit, -1 is output. The error flag and encode error
flag are set to TRUE(ON).
ST language notation Result output := DEC_
ST language notation Bit count output := BC_
( Input data );
Arguments
The following data types are supported for input and output arguments and the
instruction symbol depends on the data type:
Arg. Operand Type Const. Description Remarks
Input See below
Input data
Output INT
Bit count
output
Input data Symbol(_ )
WORD BC_WORD
DWORD BC_DWORD
Input data Bit count output
BC_
Function
Counts the number of bits in the input data that are TRUE(ON) and output the result.
Program example
[LD/FBD language notation]
Bit No. 15 12 8 4 0
0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0
WORD
SAMPLE1
16#1234
LD
SAMPLE2
5
ST
BC_WORD
[ST language notation]
SAMPLE2 := BC_WORD( SAMPLE1);
Counts the number of bits in input data SAMPLE1 and stores 5 as the result in
SAMPLE2.
ST language notation TSET_
Bit pointer
Input
N UINT
ST language notation TRST_
Bit pointer
Input
N UINT
Bus/Unit/Slot
TADDR WORD
Extended memory top
address
0 to 7FFFH
P PTR
Transfer destination
variable
Input
N UINT
Bus/Unit/Slot
TADDR WORD
Extended memory top
address
0 to 7FFFH
P PTR
Transfer destination
variable
Input
N UINT
Execution request
T DWORD
Basic unit slot / node /
unit / slot
TADDR WORD
Bus/Unit/Slot
TADDR WORD
Extended memory top
address
0 to 7FFFH
P STRING
Transfer destination
variable
N UINT
Bus/Unit/Slot
TADDR WORD
Extended memory top
address
0 to 7FFFH
P STRING Transfer source variable
N UINT
ST language notation Execution output:= IO_T( Batch I/O specification, N );
Arguments
Arg. Operand Type Const. Description Valid range
PTR
Batch I/O
specification
Input
N UINT
ST language notation I/O node state := GET_SIO_STS( BASESLOT, NODE );
Arguments
Arg. Operand Type Const. Description Valid range
BASESLOT UINT
XI MIN3
MAX34 STEP 1
GET_SIO_STS
BASESLOT
NODE DINT_TO_UINT XI
0
/* I/O node abnormal of one unit*/
/*I/O node abnormal of multiple units*/
NODE_OK
END_FOR
ENDIF
NODE_OK
Describes the processing related to the I/O node No.
/*Searches for I/O node abnormal detection in nodes 3 to 34*/
Indicates the I/O node where the following information is abnormal. Describes the processing related to the node.
1) SW[355] :I/O node fallback recovery information(Main slot No.), 2) SW[356] :I/O node fallback recovery information (Node No.).
IF
S[350].B[1]
S[350].B[3]
VAL1
THEN
ELSEIF
S[350].B[1]
S[350].B[3]
VAL1
THEN
FOR_DO
INDEX XI MIN 3
MAX 34
STEP 1
GET_SIO_STS
BASESLOT
NODE DINT_TO_UINT XI
0
/* I/O node abnormal recovery of one unit*/
/*I/O node abnormal recovery of multiple units*/
NODE_OK
END_FOR
ENDIF
NODE_OK
Describes the processing related to the I/O node No.
/*Searches for I/O node abnormal recovery
Event task - I/O fallback task (EV4) : [Example for type1]
Event task - I/O fallback recovery task (EV6): [Example for type 1]
detection in nodes 3 to 34*/
Chapter 2 LD/FBD Instructions
6F8C1226
360
NODE_OK := GET_SIO_STS( 0, Z1)
IF NODE_OK = FALSE THEN
(* processing related to the I/O node No. *)
END_IF
END_FOR;
END_IF;
(* Event task - I/O fallback recovery task (EV6):[Example for type1] *)
IF S[350].B[1] AND NOT(S[350].B[3]) THEN
(* I/O node abnormal recovery of one unit *)
ELSEIF S[350].B[1] AND S[350].B[3] THEN
(* I/O node abnormal recovery of multiple units *)
FOR XI := 3 TO 34 BY 1 DO
Z1 := DINT_TO_UINT( XI);
NODE_OK := GET_SIO_STS( 0, Z1)
IF NODE_OK THEN
(* processing related to the I/O node No. *)
END_IF
END_FOR;
END_IF;
Description of operation for I/O fallback task (EV4)
When I/O node fallback of multiple units is detected in I/O fallback task (EV4), it can be
determined if the specified I/O node is a target of fallback by using GET_SIO_STS
instruction in EV4 task.
GET_SIO_STS instruction output becomes FALSE(OFF) if the specified I/O node is a
target of fallback, or TRUE(ON) otherwise.
Description of operation for I/O fallback recovery task (EV6)
When I/O node fallback recovery of multiple units is detected in I/O fallback recovery
task (EV6), It can be determined if the specified I/O node is a target of fallback
recovery by using GET_SIO_STS instruction in EV6 task.
GET_SIO_STS instruction output becomes TRUE(ON) if the specified I/O node is a
target of fallback recovery, or FALSE(OFF) otherwise.
Description of operation for tasks other than I/O fallback task (EV4) / I/O fallback
recovery task (EV6)
When GET_SIO_STS instruction is used in a task other than I/O fallback task (EV4) /
I/O fallback recovery task (EV6), the specified I/O node state can be determined.
GET_SIO_STS instruction output becomes TRUE(ON) if the specified I/O node is
normal, or FALSE(OFF) otherwise.
Error information
If the specified I/O node is not registered, or if basic unit slot number or I/O node number
exceeds the specification range, the result is set to FALSE(OFF).
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
2.15 I/O
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
361
I/O Module State Read
I/O I/O Module State Read
nv dedicated
instruction
LD/FBD language
notation
I/O module state
GET_IO_STS
Basic unit slot
I/O node number
Unit number
Slot number
BASESLOT
NODE
UNIT
SLOT
EN input Edge execution Index modification Modifier
ST language notation I/O module state := GET_IO_STS( BASESLOT, NODE, UNIT,
SLOT );
Arguments
Arg.
Operan
d
Type
Const
.
Description
Valid
range
BASESL
OT
UINT
Unit number 1 to 7
Input
SLOT UINT
Slot number 0 to 15
Output BOOL I/O module state (1Normal, 0Abnormal)
Function
I/O module state specified with basic unit slot (BASESLOT), I/O node number (NODE),
unit number (UNIT), and slot number (SLOT) is read. The output (I/O module state)
varies depending on the task using this instruction.
I/O module state output value
Task
TRUE(ON) FALSE(OFF)
Event task
- I/O fallback task (EV4)
I/O abnormal is not detected upon EV4
startup, so it is not the target of I/O node
fallback.
(Normal, or abnormal detection has
been done)
I/O abnormal is detected upon EV4
startup, so it is the target of I/O fallback.
Event task
- I/O fallback recovery task
(EV6)
I/O abnormal recovery is detected upon
EV6 startup, so it is the target of I/O
fallback recovery.
I/O abnormal recovery is not detected
upon EV6 startup, so it is not the target of
I/O fallback recovery.
(Normal, or abnormal detection has been
done)
Other than above Specified I/O module state is normal.
I/O module serious failure occurred, or I/O
fallback occurred due to an I/O fallback
request.
Chapter 2 LD/FBD Instructions
6F8C1226
362
Therefore, in event task - I/O fallback task (EV4), the I/O module that was abnormal
this time can be identified with this instruction and special register (SW), or system
variable (ZW) I/O fallback information.
In event task - I/O fallback recovery task (EV6), the I/O node that recovered can be
identified with this instruction and special register (SW), or system variable (ZW) I/O
fallback recovery information.
I/O fallback information and I/O fallback recovery information is referenced by the
following special register (SW) or system variable (ZW). See the function manuals of
controllers for data structure details.
Controller
I/O fallback information
type1 type2
TCnet I/O SW[340..346] ZW[300..306] I/O fallback
information G3I/O SW[680..691] ZW[320..331]
TCnet I/O SW[350..356] ZW[310..316] I/O fallback
recovery
information
G3I/O SW[700..711] ZW[340..351]
For basic unit slot (BASESLOT), "0" (I/O directly under the controller) is specified.
For I/O node number (NODE), I/O node number (3 to 34) is specified.
For unit number (UNIT), unit number (1 to 7) is specified.
For slot number (SLOT), slot number (0 to 15) is specified.
Program example
[LD/FBD language notation]
S[340].B[0] S[340].B[2] VAL1
/* Searches for I/O module abnormal detection in nodes 3 to 34
of slot 0 to 15 */
/* I/O module abnormal of one unit*/
Describes the processing related to the I/O module.
IF
THEN
ELSEIF
S[340].B[0] S[340].B[2] VAL1
THEN
FOR_DO
GET_IO_STS
BASESLOT
NODE
UNIT
SLOT
DINT_TO_UINT
END_FOR
ENDIF
IO_OK
FOR_DO
DINT_TO_UINT
END_FOR
Indicates the I/O module where the following information is abnormal. Describes the processing related to the I/O module.
1) SW[341] to SW[344]: I/O fallback information (Main slot No./node No./unit No./slot No.)
/* I/O module abnormal of multiple units */
INDEX XI MIN 3 MAX 34 STEP 1
INDEX XJ MIN 0 MAX15 STEP 1
XI
0
XJ
0
IO_OK
Event task - I/O fallback task (EV4) :[Example for type1]
2.15 I/O
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
363
[ST language notation]
(* Event task I/O fallback task (EV4):[Example for type1] *)
IF S[340].B[0] AND NOT(S[340].B[2]) THEN
(* I/O module abnormal of one unit *)
ELSEIF S[340].B[0] AND S[340].B[2] THEN
(* I/O module abnormal of multiple units *)
FOR XI := 3 TO 34 BY 1 DO
FOR XJ := 0 TO 15 BY 1 DO
Z1 := DINT_TO_UINT( XI);
Z2 := DINT_TO_UINT( XJ);
IO_OK := GET_IO_STS( 0, Z1, 1, Z2)
IF IO_OK = FALSE THEN
(* processing related to the I/O module *)
END_IF
END_FOR;
END_FOR;
END_IF;
[LD/FBD language notation]
/*Searches for I/O module abnormal recovery
detection in nodes 3 to 34 of slot 0 to 15*/
/* I/O module abnormal recovery of one unit*/
Describes the processing related to the I/O module.
IF
THEN
ELSEIF
S[350].B[0] S[350].B[2] VAL1
THEN
FOR_DO
GET_IO_STS
BASESLOT
NODE
UNIT
SLOT
DINT_TO_UINT
IO_OK
END_FOR
ENDIF
IO_OK
FOR_DO
DINT_TO_UINT
END_FOR
Indicates the I/O module where the following information is abnormal recovery. Describes the processing related to the I/O module.
1)SW[351] to SW[354]: I/O fallback recovery information (Main slot No./node No./unit No./slot No.)
/* I/O module abnormal recovery of multiple units*/
S[350].B[0] S[350].B[2] VAL1
INDEX XI MIN 3 MAX34 STEP1
INDEX XJ MIN 0 MAX15 STEP1
X
0
XJ
0
Event task I/O fallback recovery task EV6:[Example for type1]
Chapter 2 LD/FBD Instructions
6F8C1226
364
[ST language notation]
(* Event task - I/O fallback recovery task (EV6):[Example for type1] *)
IF S[350].B[0] AND NOT(S[350].B[2]) THEN
(* I/O module abnormal recovery of one unit *)
ELSEIF S[350].B[0] AND S[350].B[2] THEN
(* I/O module abnormal recovery of multiple units *)
FOR XI := 3 TO 34 BY 1 DO
FOR XJ := 0 TO 15 BY 1 DO
Z1 := DINT_TO_UINT( XI);
Z2 := DINT_TO_UINT( XJ);
IO_OK := GET_IO_STS( 0, Z1, 1, Z2)
IF IO_OK THEN
(* processing related to the I/O module *)
END_IF
END_FOR;
END_FOR;
END_IF;
Description of operation for I/O fallback task (EV4)
When I/O fallback of multiple units is detected in I/O fallback task (EV4), it can be
determined if the specified I/O module is a target of fallback by using GET_SIO_STS
instruction in EV4 task.
GET_SIO_STS instruction output becomes FALSE(OFF) if the specified I/O module is
a target of fallback
Description of operation for I/O fallback recovery task (EV6)
When I/O module fallback recovery of multiple units is detected in I/O fallback recovery
task (EV6), it can be determined if the specified I/O module is a target of fallback
recovery by using GET_SIO_STS instruction in EV6 task.
GET_SIO_STS instruction output becomes TRUE(ON) if the specified I/O module is a
target of fallback recovery, or FALSE(OFF) otherwise.
Description of operation for tasks other than I/O fallback task (EV4) / I/O fallback
recovery task (EV6)
When GET_SIO_STS instruction is used in a task other than I/O fallback task (EV4) /
I/O fallback recovery task (EV6), the specified I/O module state can be determined.
GET_SIO_STS instruction output becomes TRUE(ON) if the specified I/O module is
normal, or FALSE(OFF) otherwise.
Error information
If the specified I/O module is not registered, or if basic unit slot number or I/O node
number exceeds the specification range, or if unit number or slot number exceeds the
specification range, the result is set to FALSE(OFF).
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
2.15 I/O
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
365
I/O Fallback Request
I/O I/O Fallback Request
nv dedicated
instruction
LD/FBD language
notation
Execution
output
IOFB_REQ
Basic unit slot
I/O node number
Unit number
Slot number
BASESLOT
NODE
UNIT
SLOT
EN input Edge execution Index modification Modifier
ST language notation Execution output := IOFB_REQ( BASESLOT, NODE, UNIT, SLOT );
Arguments
Arg. Operand Type Const. Description Valid range
BASESLOT UINT
Unit number 1 to 7
Input
SLOT UINT
Slot number 0 to 15
Output BOOL Execution output
Function
A fallback request is made to the I/O module specified with basic unit slot
(BASESLOT), I/O node number (NODE), unit number (UNIT), and slot number
(SLOT).
For basic unit slot (BASESLOT), 0(I/O directly under the controller) is specified.
For I/O node number (NODE), I/O node number (3 to 34) is specified.
For unit number (UNIT), unit number (1 to 7) is specified.
For slot number (SLOT), slot number (0 to 15) is specified.
Chapter 2 LD/FBD Instructions
6F8C1226
366
Program example
[LD/FBD language notation]
IOFB_REQ
NODE
BASESLOT
SAMPLE1
0
LD
SAMPLE2
3
LD
SIGNAL1
UNIT
SAMPLE3
1
LD
SLOT
SAMPLE4
5
LD
[ST language notation]
SIGNAL1 := IOFB_REQ( SAMPLE1, SAMPLE2, SAMPLE3, SAMPLE4);
The basic unit slot CPU is specified with SAMPLE1, I/O node number =3 is specified with
SAMPLE2, unit number =1 is specified with SAMPLE3, and slot number =5 is specified with
SAMPLE4.
A fallback request of the I/O module specified with BASESLOT, NODE, UNIT, and SLOT is made.
Error information
If the specified I/O module is not registered, or if basic unit slot number or I/O node number
exceeds the specification range, or if unit number or slot number exceeds the specification
range, the result is set to FALSE(OFF).
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
2.15 I/O
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
367
I/O Fallback Recovery Request
I/O I/O Fallback Recovery Request
nv dedicated
instruction
LD/FBD language
notation
Execution
output
IORC_REQ
Basic unit slot
I/O node number
Unit number
Slot number
BASESLOT
NODE
UNIT
SLOT
EN input Edge execution Index modification Modifier
ST language notation Execution output := IORC_REQ( BASESLOT, NODE, UNIT, SLOT );
Arguments
Arg. Operand Type Const. Description Valid range
BASESLO
T
UINT
Unit number 1 to 7
Input
SLOT UINT
Slot number 0 to 15
Output BOOL Execution output
Function
A fallback recovery request is made to the I/O module specified with basic unit slot
(BASESLOT), I/O node number (NODE), unit number (UNIT), and slot number
(SLOT).
For basic unit slot (BASESLOT), 0(I/O directly under the controller) is specified.
For I/O node number (NODE), I/O node number (3 to 34) is specified.
For unit number (UNIT), unit number (1 to 7) is specified.
For slot number (SLOT), slot number (0 to 15) is specified.
Chapter 2 LD/FBD Instructions
6F8C1226
368
Program example
[LD/FBD language notation]
IORC_REQ
NODE
BASESLOT
SAMPLE1
0
LD
SAMPLE2
3
LD
SIGNAL1
UNIT
SAMPLE3
1
LD
SLOT
SAMPLE4
5
LD
[ST language notation]
SIGNAL1 := IORC_REQ( SAMPLE1, SAMPLE2, SAMPLE3, SAMPLE4);
The basic unit slot CPU is specified with SAMPLE1, I/O node number 3 is specified
with SAMPLE2, unit number 1 is specified with SAMPLE3, and slot number 5 is
specified with SAMPLE4.
A fallback recovery request of the I/O module specified with BASESLOT, NODE, UNIT,
and SLOT is made.
Error information
If the specified I/O module is not registered, or if basic unit slot number or I/O node
number exceeds the specification range, or if unit number or slot number exceeds the
specification range, the result is set to FALSE(OFF).
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
2.15 I/O
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
369
Drive Device State Read
I/O Drive Device State Read
nv dedicated
instruction
LD/FBD language
notation
Drive device state
GET_DRV_STS
Drive network ID
DRV
EN input Edge execution Index modification Modifier
ST language notation Execution output := GET_DRV_STS(DRV);
Arguments
Arg. Operand Type Const. Description Valid range
Input DRV UINT
( IN, H);
Arguments
The following data types are supported for input and output arguments and the
instruction symbol depends on the data type:
Arg. Operand Type Const. Description
IN See below
Data input
Input
H See below
Execution flag
IN REAL
Execution flag
IN REAL
Data input
T REAL
Initial value
Output OUT REAL Output
Instance structure
Name Type Description Remarks
OUT REAL Integral result output Can be accessed from the user program.
B4Y REAL Previous output (Yn-1)
Cannot be accessed from the user
program.
Function
When execution flag E is FALSE(OFF), initial value INI is output.
When execution flag E is TRUE(ON), integration is performed.
The unit of integral time T is seconds. The absolute value of the input data is used as
integral time T.
Chapter 2 LD/FBD Instructions
6F8C1226
378
Execution flag E
INTG instance
preprocessing
Action
FALSE(OFF)
Result = INI
Yn-1 = INI
TRUE(ON)
In case T=0 : Yn-1
In case T 0 : IN* CT / T + Yn-1
Result = Yn-1
CT :Control cycle
Yn-1 :Previous output
Important
The scan cycle of the task using this instruction must be in constant scan mode(Integrated
Controller and S Controller only).
Program example
[LD/FBD language notation]
INTG SAMPLE4
50.0
ST
SAMPLE1
100.0
LD
SAMPLE2
1.0
LD
SAMPLE3
0.0
LD
E
IN
T
SIGNAL1
INI
INTG_01
OUT
[ST language notation]
INTG_01( SIGNAL1, SAMPLE1, SAMPLE2, SAMPLE3);
SAMPLE4 := INTG_01.OUT;
Control cycle CT = 0.5 sec.
Instance content(INTG_01) (beforeafter operation)
B4Y(Y
n-1
):0.0 50.0
When SIGNAL1 is TRUE(ON), performs integration operation using input data 1000.0
in SAMPLE1, integral time 1.0 in SAMPLE2, initial value 0.0 in SAMPLE3, and
instance variable INTG_01, and stores the integration result 50.0 in SAMPLE4.
2.16 Process Operation
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
379
Error information
The following operation is performed when the input data type is REAL:
Controller Action
S Controller Up to V02.5*
L Controller
If NAN data is entered as input, the result is
NAN.
If INF data is entered as input, the result is
INF.
Integrated Controller
V series
S Controller After V02.60
Unified Controller nv series
NAN and INF data are limited by the
maximum value.
If the scan cycle of the task using this instruction is in floating scan mode, no operation
is performed and the error flag is set to TRUE(ON). (Integrated Controller and S
Controller only).
Chapter 2 LD/FBD Instructions
6F8C1226
380
Super Two Degrees of Freedom PID
Process Operation Super Two Degrees of Freedom PID
LD/FBD language
notation
Execution flag MV output
PID2
SV input
PV input
PV parameter
variable
Instance name
LP parameter
variable
E D_MV
SV
PV
PV_P
LP_P
EN input Edge execution Index modification Modifier
ST language notation [Instance name]( E, SV, PV, PV_P, LP_P );
[Variable name]:= [Instance name] . D_MV;
Arguments
Arg. Operand Type Const. Description
E BOOL
Execution flag
SV REAL
SV input[Engineering value]
PV REAL
PV input[Engineering value]
PV_P PTR PV parameter variable
Input
LP_P PTR LP parameter variable
Output D_MV REAL PID2 result output (MV)[%]
Pointers to tag table are placed in PV parameter variable and LP parameter table.
The following symbols are referenced by PV_P and LP_P. The structures of the
PV/LP parameters are described at the end of this section.
Operand Symbol Type R/W Description
RH REAL R PV range high [Engineering unit] PV_P
(PV_PARA) RL REAL R PV range low [Engineering unit]
KP REAL R Proportional gain
TI REAL R Integral time [minute]
TD REAL R Rate time [minute]
ALP REAL R 2DOF proportionality coefficient
LP_P
(LP_PARA)
CDR BOOL R Control direction (reverse=0/direct=1)
R=Read only, W=Write only, RW=Read/Write
2.16 Process Operation
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
381
Instance structure
Name Type Description Remarks
D_MV REAL
MV difference output (AMV)[%]
Can be accessed from the user
program.
B4SV REAL SV previous value (SV
n-1
) [%]
SVF REAL SV calculation intermediate value [%]
B4E REAL Deviation previous value (E
n-1
) [%]
B4D REAL Differential previous value (D
n-1
) [%]
B4PV REAL PV previous value (PV
n-1
) [%]
Cannot be accessed from the user
program.
Function
When the execution flag E is FALSE(OFF), initializes the PID2 instance area.
When execution flag E is TRUE(ON), performs two degrees of freedom PID operation.
Super two degrees of freedom PID (where |=1.0 and =0) is used for PID operation.
Backward difference method is used for operation of the derivative term. (q=0.1).
The following variable can be specified for PV parameter and LP parameter:
Controller Variable
SController Variable other than direct I/O variable Integrated Controller
V series LController Tag parameter variable of PV/LP
type1 Variable other than direct I/O variable Unified Controller
nv series type2 Tag parameter variable of PV/LP
Chapter 2 LD/FBD Instructions
6F8C1226
382
Execution
flag E
PID2 instance
preprocessing
Action
FALSE(OFF)
Initialization
SVn-1 = SVn
SVF = SVn
en-1 = SVF-PVn
Dn-1 = 0
PVn-1 = PVn
TRUE(ON) No initialization
SVF = SVn CT/(CT+TI)+(SVnSVn-1) TI/(CT+TI)+SVFTI/(CT+TI)
MV = (SVFPVn) en-1
en = SVFPVn
When TI<>0:
MV = MV+CT en / TI
When TD<>0:
D = (PVn+PVn-1) TD/(CT+0.1TD) Dn-1CT/(CT+0.1TD)
MV = MV+D
Dn = Dn+D
When TD = 0:
Dn = 0
MV = MVKp
When CDR = 1:
MV = MV
Kp : Proportional gain
TI : Integral time
TD : Rate time
CT : Control cycle
: Two degrees of freedom coefficient
SVn : Current setting value (%)
SVn-1 : Previous setting value (%)
en : Current deviation
en-1 : Previous deviation
PVn : Current process value(%)
PVn-1 : Previous process value(%)
AMV : Output
AD : Differential term
Dn : Current differential term
Dn-1 : Previous differential term
The input setting values and process values are in engineering unit and are
converted to percent before calculation.
Important
The scan cycle of the task using this instruction must be in constant scan mode (Integrated
Controller and S Controller only).
2.16 Process Operation
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
383
Program example
[LD/FBD language notation]
PI D2
SAMPLE4
73.61369
ST
SAMPLE1
500. 0
LD
SAMPLE2
0.0
LD
PV_PARA
[n].TAG
LD
E
SV
PV
PV_P
SIGNAL1
Control cycle CT=0.5 sec.
PID2_01
LP_PARA
[m] .TAG
LD
LP_P
D_MV
[ST language notation]
PID2_01( SIGNAL1, SAMPLE1, SAMPLE2, PV_PARA[n].TAG, LP_PARA[m].TAG);
SAMPLE4 := PID2_01.D_MV
When SIGNAL1 is TRUE(ON), performs two degrees of freedom PID operation using
SV input data 500.0 in SAMPLE1, PV input data 0.0 in SAMPLE2, PV parameter
variable PV_P, and LP parameter variable LP_P and stores the result in SAMPLE4.
Error information
When the PV parameter and LP parameter exceed the variable area, the super two
degrees of freedom PID is not processed and the data boundary is exceeded.
The following operation is performed when the input data type is REAL:
Controller Action
S Controller Up to V02.5*
L Controller
If NAN data is entered as input, the result is NAN.
If INF data is entered as input, the result is INF.
Integrated
Controller V series
S Controller After V02.60
Unified Controller nv series
NAN and INF data are limited by the maximum
value.
If RH=RL, the divide error flag is set to TRUE(ON) and 0 is output.
The following operation is performed if the PV parameter or LP parameter specification
is invalid:
Chapter 2 LD/FBD Instructions
6F8C1226
384
Controller Action
S Controller
Super two degrees of freedom PID is not executed when
direct I/O variable is specified.
Error flag is set to TRUE(ON). Integrated Controller
V series
L Controller
When variables other than PV/LP tag parameters are
specified, the table operation error flag is set to
TRUE(ON) and the result is 0.
type1
Super two degrees of freedom PID is not executed when
direct I/O variable is specified.
Error flag and table operation error flag are set to
TRUE(ON).
Unified Controller
nv series
type2
When variables other than PV/LP tag parameters are
specified, error flag and table operation error flag are set
to TRUE(ON) and the result is 0.
If the scan cycle of the task using this instruction is in floating scan mode, no operation
is performed and the error flag is set to TRUE(ON) (Integrated Controller and S
Controller only).
2.16 Process Operation
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
385
MV Calculation
Process Operation MV Calculation
LD/FBD language
notation
Execution flag Output
MVS
MV difference input
MV initial value
MV input
Instance name
LP parameter variable
E OUT
IN
MV0
MV
LP_P
EN input Edge execution Index modification Modifier
ST language notation [Instance name]( E, IN, MV0, MV, LP_P );
[Variable name]:= [Instance name]. OUT;
Arguments
Arg. Operand Type Const. Description
E BOOL
Execution flag
IN REAL
MV initial value[%]
MV REAL
MV input[%]
Input
LP_P PTR LP parameter variable
Output OUT REAL Output (MV) [%]
A pointer to tag table is placed in LP parameter variable.
The following symbols are referenced by LP_P. The structures of the LP parameters
are described at the end of this section.
Operand Symbol Type R/W Description
DMV REAL R MV rate limit [%]
MH REAL R MV high limit [%]
LP_P
(LP_PARA)
ML REAL R MV low limit [%]
R=Read only, W=Write only, RW=Read/Write
Instance structure
Name Type Description Remarks
OUT REAL Output (MV) [%] Can be accessed from the user program.
MVW REAL MV work [%] Cannot be accessed from the user program.
Chapter 2 LD/FBD Instructions
6F8C1226
386
Function
When the execution flag is FALSE(OFF), performs MV operation and outputs the result.
When the execution flag is TRUE(ON), performs tracking operation and outputs the result.
The MVS instruction does not set output in MV of LP tag data. Store instruction must be
used to set the output of the MVS instruction to MV of the LP tag data.
The following variables can be specified for the LP parameter:
Controller Variable
S Controller Variable other than direct I/O variable Integrated Controller
V series L Controller LP tag parameter variable
type1 Variable other than direct I/O variable Unified Controller
nv series type2 LP tag parameter variable
Execution
flag E
MVS instance
preprocessing
Action
FALSE(OFF)
MVW=MVW+IN
MV rate limit
When |MVW-MV|>DMV
When in increase direction
Work=MV+DMV
when in decrease direction
work=MV-DMV
When |MVW-MV| DMV
work=MVW
TRUE(ON)
MVW=MV0
work=MVW
MV high limit
When work<MH
work=MH
MV low limit
When work<ML
work=ML
Result output=work
ML :MV low limit
MH :MV high limit
DMV :MV rate limit
MVW :MV work
work :MV calculation work
Program example
[LD/FBD language notation]
Before operation
Instance (MVS_01)
50.0 MVW
After operation
Instance (MVS_01)
60.0 MVW
LP_DATA[m].MV
50.0
LD
MVS
LP_DATA[m].MV
60.0
ST
SIGNAL1
0
LD
SAMPLE1
10.0
LD
E
MV
IN
MV0
SAMPLE2
50.0
LD
LP_P
LP_PARA
[m].TAG
LD
MVS_01
OUT
LP parameter(LP_P)
125.0 MH
-25.0 ML
100.0 DMV
2.16 Process Operation
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
387
[ST language notation]
MVS_01( SIGNAL1, SAMPLE1, SAMPLE2, LP_DATA[m].MV, LP_PARA[m].TAG);
LP_DATA[m].MV := MVS_01.OUT
When the SIGNAL1 is FALSE(OFF), MV operation is performed against the MV
difference input 10.0 in SAMPLE1 using the MV input and LP parameter LP_P, and the
result 60.0 is stored in LP_DATA[m].MV.
Error information
When the LP parameter exceeds the variable area, the MV calculation is not
processed and the data boundary is exceeded.
The following operation is performed when the input data type is REAL:
Controller Action
S Controller Up to V02.5*
L Controller
If NAN data is entered as input, the result is
NAN.
If INF data is entered as input, the result is
INF.
Integrated Controller
V series
S Controller After V02.60
Unified Controller nv series
NAN and INF data are limited by the
maximum value.
The following operation is performed if the LP parameter specification is invalid:
Controller Action
S Controller
MV calculation is not executed when direct I/O
variable is specified.
Error flag is set to TRUE(ON). Integrated Control
V series
L Controller
When variables other than LP tag parameters are
specified, the table operation error flag is set to
TRUE(ON) and the result is 0.
type1
MV calculation is not executed when direct I/O
variable is specified.
Error flag and table operation error flag are set to
TRUE(ON).
Unified Controller nv
series
type2
When variables other than LP tag parameters are
specifiederror flag and table operation error flag are
set to TRUE(ON) and the result is 0.
Chapter 2 LD/FBD Instructions
6F8C1226
388
Fix MV
Process Operation Fix MV
LD/FBD language
notation
Execution flag Output
MVF
MV fixed value
LP data variable LP data variable
E
IN
LP_D LP_D
EN input Edge execution Index modification Modifier
ST language notation Output := MVF( E, IN, LP_D );
Arguments
Arg. Operand Type Const. Description
E BOOL
Execution flag
Input
IN REAL
MV fixed value[%]
Input/O
utput
LP_D PTR
LP data variable
Output REAL Output
A pointer to tag table is placed in LP data variable.
The following symbols are referenced by LP_D. The structure of the LP data is
described at the end of this section.
Operand Symbol Type R/W Description
MV REAL W MV value[%] LP_D
(LP_DATA) SMV BOOL W SEQ-MV operation
R : Read only, W: Write only, RW=Read/Write
Function
When execution flag E is TRUE(ON), registers the MV fixed value (set SMV flag).
When execution flag E is FALSE(OFF), unregisters the MV fixed value (reset SMV
flag).
The following variables can be specified for the LP data:
Controller Variable
S Controller Variable other than direct I/O variable Integrated Controller V
series L Controller LP tag data variable
type1 Variable other than direct I/O variable Unified Controller nv
series type2 LP tag data variable
Important
When the MVF instruction is used, the LP data variable SMV flag is used exclusively (ON when E
input is TRUE and OFF when FALSE). To use the SMV flag in other applications, the MVF
instruction must be removed or processing must be stopped by resetting EN to OFF.
2.16 Process Operation
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
389
Program example
[LD/FBD language notation]
MVF SAMPLE3
80.0
ST
SIGNAL1
0
LD
SAMPLE1
80.0
LD
E
IN
LP_DATA
[m].SV
LD
LP_DATA
[m].SV
ST
LP_D LP_D
[ST language notation]
SAMPLE3 := MVF( SIGNAL1, SAMPLE1, LP_DATA[m].SV);
When SIGNAL1 is TRUE(ON), stores the MV input 80.0 specified with SAMPLE1 in
LP data MV and sets the SMV flag. When SIGNAL1 is FALSE(OFF), the SMV flag is
reset.
Input value SAMPLE1 is output to SAMPLE3 unchanged.
Error information
When the LP data exceeds the variable area, the fix MV is not processed and the data
boundary is exceeded.
The following operation is performed when the input data type is REAL:
Controller Action
Integrated Controller V series
If NAN data is entered as input, the result is NAN.
If INF data is entered as input, the result is INF.
Unified Controller nv series
NAN and INF data are limited by the maximum
value.
The following operation is performed if the LP data specification is invalid:
Controller Action
S Controller
When direct I/O variable is specified, the result is 0.
Error flag is set to TRUE(ON).
Integrated Controller
V series
L Controller
When variables other than LP tag parameters are
specified, the table operation error flag is set to
TRUE(ON) and the result is 0.
type1
When direct I/O variable is specified, the error flag and
table operation error flag are set to TRUE(ON) and the
result is 0. Unified Controller nv
series
type2
When variables other than LP tag parameters are
specified, the error flag and table operation error flag are
set to TRUE(ON) and the result is 0.
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
Chapter 2 LD/FBD Instructions
6F8C1226
390
Polygonal Line Function
Process Operation Polygonal Line Function
LD/FBD language
notation
IN
TBL
Data input Output
PLN_
Polygonal line table
EN input Edge execution Index modification Modifier
ST language notation Output := PLN_
( IN, TBL );
Arguments
The following data types are supported for input and output arguments and the
instruction symbol depends on the data type:
Arg. Operand Type Const. Description
IN See below
Data input
Input
TBL PTR Polygonal line table
Output See below Output
Input Symbol(_ ) Output
INT PLN_INT INT
REAL PLN_REAL REAL
Data input Output
PLN_
IN
TBL Polygonal
line table
ST language notation Output := PLN_REAL2 ( IN, TBL );
Arguments
Arg. Operand Type Const. Description
IN See below
Data input
Input
TBL PTR Polygonal line table
Output See below Output
Function
With the input data IN as X axis input, the Y axis approximation result is output using
the function table specified with the polygonal line table TBL.
The size and structure of the polygonal line table are as follows:
Polygonal line table data type
Item Data type
Point count DINT
Point data REAL
0 31
Number of pointsn
X0
Y0
X1
Y1
Xn-1
Yn-1
Maximum points:11, Table top address: Point n
11 points maximum
Data must be stored in the polygonal line table such that X
0
< X
1
<X
n-1.
When data input IN X0, the corresponding Y value is Y
0
and when data input IN
X
n-1
, the Y value is Y
n-1.
Direct I/O variable cannot be specified for the polygonal line table.
Output = (IN-X
n-1
) - (Y
n
-Y
n-1
)/(X
n
-X
n-1
)+Y
n-1
Where X
n-1
and X
n
are values enclosing input data IN (X
n-1
IN<X
n
) and Y
n-1
and Y
n
correspond to X
n-1
and X
n.
Chapter 2 LD/FBD Instructions
6F8C1226
394
When point count 0 is specified, Result Input data.
Program example
[LD/FBD language notation]
SAMPLE2 : Polygonal line table
PLN_REAL2
SAMPLE3
80
ST
SAMPLE1
40
LD
SAMPLE2
5
LD
IN
TBL
IN
SAMPLE3:80
100
100
-100
-100
X
Y
Structure declarationtype PLN_REAL2
Member Data type
NUM DINT
POINT typeP_PARA
Variable declaration
Variable Data type Dec.
SAMPLE1 REAL VAR
SAMPLE2 type PLN_REAL2 VAR
-100
50
-50
-100
0
0
50
100
100
-100
X0
Y0
X1
Y1
X2
Y2
X3
Y3
X4
Y4
NUM 5
[ST language notation]
SAMPLE3 := PLN_REAL2 ( SAMPLE1, SAMPLE2);
For input data in SAMPLE1, the Y corresponding to input data 40 is calculated based
on polygonal line table specified with SAMPLE2. The result "80" is stored to
SAMPLE3.
Error information
When the polygonal line table exceeds the variable area, polygonal line function is not
processed and the data boundary is exceeded.
The following operation is performed when the input data type is REAL:
Controller Action
Unified Controller nv series NAN and INF data are limited by the maximum value.
The following operation is performed when direct I/O variable is specified for the
polygonal line table:
Controller Action
Unified Controller nv series
Error flag and table operation error flag are set to
TRUE(ON) and the result is 0.
When the specified number of points exceeds 11, the point number is limited to 11.
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
2.16 Process Operation
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
395
Inverse Polygonal Line Function
Process Operation Inverse Polygonal Line Function
LD/FBD language
notation
IN
TBL
Data input Output
ILNL_
Polygonal
line table
EN input Edge execution Index modification Modifier
ST language notation Output := ILNL_
( IN, TBL );
Arguments
The following data types are supported for input and output arguments and the
instruction symbol depends on the data type:
Argu. Operand Type Const. Description
IN See below
Data input
Input
TBL PTR Polygonal line table
Output See below Output
Input Symbol(_ ) Output
INT ILNL_INT INT
REAL ILNL_REAL REAL
Data input Output
ILNL_
IN
TBL
Polygonal
line table
Function
With the input data IN as Y axis input, outputs the X axis approximation result using
the function table specified with the polygonal line table TBL.
ST language notation Output := ILNL_REAL2 ( IN, TBL );
Arguments
Arg. Operand Type Const. Description
IN See below
Data input
Input
TBL PTR Polygonal line table
Output See below Output
Function
With the input data IN as Y axis input, the X axis approximation result is output using
the function table specified with the polygonal line table TBL.
The size and structure of the polygonal line table are as follows:
Polygonal line table data type
Item Data type
Point count DINT
Point data REAL
0 31
Number of points n
X0
Y0
X1
Y1
Xn-1
Yn-1
Maximum points: 11, Table top address: Points n
11 points maximum
Data must be stored in the polygonal line table such that X0 < X1 < X
n-1.
If data input IN intersects the polygonal line at two or more places, the one with the smallest X
value has priority.
Chapter 2 LD/FBD Instructions
6F8C1226
400
X
Y
a
Output
If data input IN is outside the range of Y axis on the polygonal line table, the X value for
the maximum (or minimum) Y value on the polygonal line table is output.
X
Y
(X0,Y0)
(X1,Y1)
(X2,Y2)
(X3,Y3)
(X4,Y4)
(X5,Y5)
a
b
Output X5 when input value is a
Output X2 when input value is b
X5 X2
Direct I/O variable cannot be specified for the polygonal line table.
X
n
-X
n-1
f(x)=(IN-Y
n-1
) -
Y
n
-Y
n-1
+X
n-1
Where Y
n-1
and Y
n
are values enclosing input data IN (Y
n-1
IN<Y
n
) and X
n-1
and X
n
correspond to Y
n-1
and Y
n.
When point count =0 is specified, result = Input data.
2.16 Process Operation
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
401
Program example
[LD/FBD language notation]
SAMPLE2: Polygonal line table
ILNL_REAL2
SAMPLE3
80
ST
SAMPLE1
80
LD
SAMPLE2
5
LD
IN
TBL
Structure declarationtype ILNL_REAL2
Member Data type
NUM DINT
POINT typeP_PARA
Variable declaration
Variable Data type Dec.
SAMPLE1 REAL VAR
SAMPLE2 type ILNL_REAL2 VAR
-100
50
-50
-100
0
0
50
100
100
-100
X0
Y0
X1
Y1
X2
Y2
X3
Y3
X4
Y4
NUM 5
IN
SAMPLE3:40
100
100
-100
-100
X
Y
[ST language notation]
SAMPLE3 := ILNL_REAL2 ( SAMPLE1, SAMPLE2);
For input data in SAMPLE1, the X corresponding to input data 80 is calculated based
on polygonal line table specified with SAMPLE2. The result 40 is stored to
SAMPLE3.
Error information
When the polygonal line table exceeds the variable area, inverse polygonal line
function is not processed and the data boundary is exceeded.
The following operation is performed when the input data type is REAL:
Controller Action
Unified Controller nv series NAN and INF data are limited by the maximum value.
The following operation is performed when direct I/O variable is specified for the
polygonal line table.
Controller Action
Unified Controller nv series
Error flag and table operation error flag are set to
TRUE(ON) and the result is 0.
When the specified number of points exceeds 11, the point number is limited to 11.
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
Chapter 2 LD/FBD Instructions
6F8C1226
402
Dead Time
Process Operation Dead Time
LD/FBD language
notation
Execution flag Output
DT
Data input
Sample number
Sampling time
Work Work
E
IN
I
T
M M
EN input Edge execution Index modification Modifier
ST language notation Output := DT( E, IN, I, T, M ) ;
Arguments
Arg. Operand Type Const. Description
E BOOL
Execution flag
IN REAL
Data input
I INT
Sample number
Input
T INT
ST language notation Output := MAV( E, IN, I, T, M );
Important
Read Notes on Moving Average InstructionMAVMAV_N provided after the Moving
Average (low-speed version) section before using this instruction.
Arguments
Arg. Operand Type Const. Description
E BOOL
Execution flag
IN REAL
Data input
I INT
Sample number
Input
T INT
ST language notation Output := MAV_N( E, IN, I, T, M );
Important
Read Notes on Moving Average InstructionMAVMAV_N provided after the Moving
Average (low-speed version) section before using this instruction.
Arguments
Arg. Operand Type Const. Description
E BOOL
Execution flag
IN REAL
Data input
I INT
Sample number
Input
T INT
Moving average
(low-speed version)
MAV_N
1.32/
3.10
Not supported (*1)
(*1)
Integrated Controller V series does not support moving average (low-speed version):MAV_N. If
accuracy is required for the moving average result, implement the function equivalent to the moving
average (low-speed version) with the user defined function block. The sample program of the user
defined function block [ufb_mav.fbk] equivalent to the moving average (low-speed version) can be
downloaded from Toshiba website Integrated Controller V series - FAQ.
To use the downloaded user function block [ufb_mav.fbk], read Execute import/export of library found
in the instruction manual below:
Unified Controller nv series Integrated Controller V series Engineering Tool 4 Basic(6F8C129)
User defined function block [ufb_mav.fbk] is a sample program and proper operation is not
guaranteed. Check the operation thoroughly before incorporating and using the sample program.
Chapter 2 LD/FBD Instructions
6F8C1226
414
Rate Limiter
Process Operation Rate Limiter
LD/FBD language
notation
Execution flag Outpu
DLM_
Data input
Rate limit
Instance name
E OUT
IN
D
EN input Edge execution Index modification Modifier
ST language notation [Instance name]( E, IN, D );
[Variable name]:= [Instance name] . OUT;
Arguments
The following data types are supported for input and output arguments and the
instruction symbol depends on the data type:
Arg. Operand Type Const. Description
E BOOL
Execution flag
IN See below
Rate limit
Output OUT See below Output
Data input
Rate limit
Symbol(_ ) Output Instance
(OUT/B4Y)
INT DLM_INT INT INT
DINT DLM_DINT DINT DINT
REAL DLM_REAL REAL REAL
Execution flag Output
DLM_
Data input
E
IN
Rate limit D
Instance name
OUT
Instance structure
Name Type Description Remarks
OUT See above Output Can be accessed from the user program.
B4Y See above
Previous output
(Yn-1)
Cannot be accessed from the user
program.
Execution flag
IN REAL
Data input
T1 REAL
ST language notation Output := UNT( IN, PV_RH );
Arguments
Arg. Operand Type Const. Description
IN REAL
ST language notation Output := PCT( IN, PV_RH );
Arguments
Arg. Operand Type Const. Description
IN REAL
(When Tl=0, l=0)
2.16 Process Operation
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
425
[Function block]
Gap
ope.
1
Pn
+
+
Kp
+SVn en
1
TIs
I ntegration
enable control
(Speed type)
TDs
1+TDs
1
1+Ts
PID operation
MVn=MVn-1 MVn
Dn
(=0.1) (Speed type)
PV
n
In
DSV
H / L DMV MVS
DMMV
Speed
position
convert
MVn
High
low
limit er
Rate
limiter
MVCn
Manipulated
value
MV *2
Manual mode manipulated
input MMV
Cont rol polarity DR *1
Output tracking input TMV
Output tracking command TR
Process
measurement PVC
Filter
coefficient
FT
Cascade
mode
CSV
Auto mode
ASV
MVC
n
Rate limiter
Speed type
Manual mode
*1 The control polarity D/R specification in the speed to positional format conversion specification
is performed as follows:
Direct specification: subtraction
Reverse specification: addition
*2 The switching of output polarity of manipulated valued output MV is performed with external
logic (ladder circuit).
[Gap operation and integration control]
(Gap ope) Error e
GP(%) GP(%)
(SV-PV)
Gradient=1
(Differentiation control)
When |SVn - PVn| < |GP|
MVn=0
(Integration control)
Ln=MVn - MV
when reverse is specified
Ln-1-In > 0 Integration disabled
L n-1-In s 0 Integration enabled
when direct is specified
Ln-1-In < 0 Integration disabled
L n-1-In > 0 Integration enabled
[Supplementary description]
For the initial value of the manipulated value, the final value MV up to the previous
time is output.
MV tracking
This function is valid only in auto mode and cascade mode (This specification is invalid
in manual mode).
Chapter 2 LD/FBD Instructions
6F8C1226
426
When tracking directive TR is 1, the high and low limits of manipulated value MV are
valid, but the differential limit of MV is invalid. In this case, the internal MV
n
is set as
MV
n
=MV.
When the tracking directive changes to 0, addition/subtraction of MV is started from
the MV
n
at that point.
Auto mode
Changing of ASV is valid in auto mode and manual mode.
When auto mode is entered, SV
n
is approached to ASV while limiting the rate-of-change.
SV
n
=SV
n-1
|DSV|
Also, MMV is equal to MV so that switching from auto mode to manual mode is
bumpless.
Therefore, MMV cannot be changed during auto mode.
Both the high/low limit and rate limiter of manipulated value MV are valid.
Cascade mode
Changing of CSV is valid in all modes.
SV
n
becomes equal to CSV when cascade mode is entered. In this case, both the
high/low limit and rate limiter of manipulated value MV are valid.
Also, ASV is equal to SV
n
and MMV is equal to MV so that switching from cascade mode
to auto mode and to manual mode is bumpless.
Therefore, ASV and MMV cannot be changed during cascade mode.
Manual mode
Changing of MMV is valid only in manual mode.
When manual mode is entered, MV is approached to MMV while limiting the
rate-of-change.
MV=MV|DMMV|
Both the high / low limit and rate limiter of manipulated value MV are invalid.
Also, MV
n
is equal to MV so that switching from manual mode to auto mode or cascade
mode is bumpless.
When switching to auto mode or cascade mode, addition/subtraction of MV is started
from the MV
n
at that point.
Direct polarity DR specification
Direct specification: MV is decreased when error (en) is increased.
MVn=MV
n-1
-MV
Reverse specification: MV is increased when error (en) is decreased.
MVn = MV
n-1
+MV
Rate limiter of manual mode manipulated value setting MMV input DMMV
MV is approached to MMV with rate-of-change DMMV.
1. When +|DMMV| (MMV-MV) -|DMMV| :MV=MMV
2. When (MMV-MV) > +|DMMV|
:MV=MV+|DMMV|
2.16 Process Operation
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
427
3. When (MMV-MV) < -|DMMV| :MV=MV-|DMMV|
Rate limiter of auto mode setting ASV input DSV
SV
n
is approached to ASV with rate-of-change DSV.
1. When +|DSV| (ASV-SV
n-1
) -|DSV| :SV
n
=ASV
2. When (ASV-SV
n-1
) > +|DSV| :SV
n
=SV
n-1
+|DSV|
3. When (ASV-SV
n-1
) < -|DSV| :SV
n
=SV
n-1
-|DSV|
High / low limit of manipulated output MH, ML
1. When MH < ML :MH=ML
If high / low limit output is MVX
n
2. When MV
n
> MH :MVX
n
=MH
3. When MV
n
< ML :MVX
n
=ML
Rate limiter of manipulated output DMV
1. When +|DMMV| (MVX
n
-MV) |DMV| MV = MVX
n
2. When (MVX
n
-MV)< + |DMV| MV = MV + |DMV|
3. When (MVX
n
-MV)< - |DMV| MV = MV - |DMV|
When instruction input is OFF
PID initialization is performed. The content is as follows:
1. Sets the operation mode MODE to mode specified by initial mode IMODE.
MODE=IMODE
2. For the initial value of the manipulated value, the final value MV up to the previous
time is output.
3. Auto mode setting is set to the value set to auto mode initial value ISV.
ASV=ISV
4. Internal data is initialized as follows:
MV
0
=MV
MMV=MV
PV
0
=PVC
SV
0
=ASV or CSV (Depends on initial mode. However, it is set to ASV in manual mode.)
D
0
=0
C=N
e
0-1
=e
0
When instruction input is ON
Performs PID operation.
Performs PID operation every N scans which is the set control cycle.
(Executes if the internal counter C is 0 or less, resets the internal counter C to N and
sets instruction output to TRUE(ON). If the internal counter is greater than 0,
decrements C and resets the instruction output to FALSE(OFF)).
2 LD/FBD
6E8C4826
428
[
M
o
d
e
d
a
t
a
r
e
l
a
t
i
o
n
s
h
i
p
t
a
b
l
e
]
S
e
t
t
i
n
g
M
a
n
i
p
u
l
a
t
e
d
v
a
l
u
e
M
a
n
i
p
u
l
a
t
e
d
v
a
l
u
e
o
u
t
p
u
t
l
i
m
i
t
A
u
t
o
m
o
d
e
s
e
t
t
i
n
g
A
S
V
C
a
s
c
a
d
e
m
o
d
e
s
e
t
t
i
n
g
C
S
V
S
e
t
t
i
n
g
S
V
n
M
a
n
u
a
l
m
o
d
e
s
e
t
t
i
n
g
m
a
n
i
p
u
l
a
t
e
d
v
a
l
u
e
M
M
V
T
r
a
c
k
i
n
g
s
e
t
t
i
n
g
m
a
n
i
p
u
l
a
t
e
d
v
a
l
u
e
T
M
V
I
n
t
e
r
n
a
l
m
a
n
i
p
u
l
a
t
e
d
v
a
l
u
e
M
V
n
H
i
g
h
/
l
o
w
L
i
m
i
t
C
h
a
n
g
e
o
f
r
a
t
e
l
i
m
i
t
L
i
m
i
t
o
u
t
p
u
t
M
V
C
n
O
u
t
p
u
t
m
a
n
i
p
u
l
a
t
e
d
v
a
l
u
e
M
V
M
a
n
u
a
l
m
o
d
e
(
C
h
a
n
g
e
a
b
l
e
)
(
C
h
a
n
g
e
a
b
l
e
)
S
V
n
-
1
(
P
r
e
v
i
o
u
s
v
a
l
u
e
)
S
e
t
M
M
V
(
C
h
a
n
g
e
a
b
l
e
)
M
V
N
o
N
o
M
V
M
M
V
M
V
n
T
r
a
c
k
i
n
g
=
F
A
L
S
E
(
O
F
F
)
(
C
h
a
n
g
e
a
b
l
e
)
P
I
D
O
p
e
r
a
t
i
o
n
r
e
s
u
l
t
Y
e
s
Y
e
s
A
u
t
o
m
o
d
e
T
r
a
c
k
i
n
g
=
T
R
U
E
(
O
N
)
S
e
t
A
S
V
(
C
h
a
n
g
e
a
b
l
e
)
A
S
V
S
V
n
S
e
t
T
M
V
M
V
Y
e
s
N
o
T
r
a
c
k
i
n
g
=
F
A
L
S
E
(
O
F
F
)
(
C
h
a
n
g
e
a
b
l
e
)
P
I
D
O
p
e
r
a
t
i
o
n
r
e
s
u
l
t
Y
e
s
Y
e
s
C
a
s
c
a
d
e
m
o
d
e
T
r
a
c
k
i
n
g
=
T
R
U
E
(
O
N
)
S
V
n
(
N
o
t
C
h
a
n
g
e
a
b
l
e
)
S
e
t
C
S
V
C
S
V
M
V
(
N
o
t
C
h
a
n
g
e
a
b
l
e
)
S
e
t
T
M
V
M
V
Y
e
s
N
o
I
n
t
e
r
n
a
l
m
a
n
i
p
u
l
a
t
e
d
v
a
l
u
e
M
V
n
O
u
t
p
u
t
l
i
m
i
t
M
V
C
n
2.16 Process Operation
Integrated Controller V seriesUnified Controller nv series Programming Instructions (LD/FBD/SFC/ST)
429
Important
The scan cycle of the task using this instruction must be in constant scan mode(Integrated
Controller and S Controller only).
When specifying floating scan, no operation is performed and the error flag is set to TRUE(ON).
Program example
[LD/FBD language notation]
PID3 SIGNAL2
ST
TBL2
LD
TBL1
LD
E
LP_P
PV_D
SIGNAL1
PID3_1
Q
MV
PV_D
SAMPLE1
ST
TBL1
ST
[ST language notation]
PID3_1( SIGNAL1, TBL2, TBL1);
SIGNAL2 := PID3_1.Q;
SAMPLE1 := PID3_1.MV;
When SIGNAL1 is TRUE(ON), performs essential succession PID operation with the
content of parameters specified by variables TBL1 and TBL2 and stores the result in
SAMPLE1.
Error information
When the PV data and LP parameter exceed the variable area, the essential
succession PID is not processed and the data boundary is exceeded.
The following operation is performed when PV data and LP parameters are REAL:
Controller Action
S Controller Up to V02.5*
L Controller
If NAN data is entered as input, the result is
NAN.
If INF data is entered as input, the result is INF.
Integrated
Controller V series
S Controller After V02.60
Unified Controller nv series
NAN and INF data are limited by the maximum
value.
The following operation is performed when direct I/O variable is specified for the PV
data or LP parameter:
Controller Action
Integrated Controller
V series
S Controller
Essential succession PID is not executed.
Error flag is set to TRUE(ON).
Unified Controller nv series
Essential succession PID is not executed.
Error flag and table operation error flag are set to TRUE(ON).
If the scan cycle of the task using this instruction is in floating scan mode, no
operation is performed and the error flag is set to TRUE(ON) (Integrated Controller
and S Controller only).
Chapter 2 LD/FBD Instructions
6F8C1226
430
Estimate with Reset
Process Operation Estimate with Reset
LD/FBD language
notation
Input data Estimate
value
RSM_L
Reset flag
Initial value
Unit time conversion code
Maximum estimate value
Output resolution
Instance name
U1 Y
U2
H1
H2
H3
H4
EN input Edge execution Index modification Modifier
ST language notation [Instance name](U1, U2, H1, H2, H3, H4 );
[Variable name]:=[Instance name]. Y;
Arguments
Arg. Operand Type Const. Description
U1 REAL
Input data
U2 BOOL
Reset flag
H1 REAL
Initial value
H2 INT
Unit time conversion code
(0: Sec.(K = 1)/1: Min.(K = 60) / 2: Hour(K = 3600))
H3 REAL
Output resolution
(0:1/1:0.1/2:0.01/3:0.001/4:0.0001)
Output Y REAL Estimate value
Function
When the reset flag U2 is TRUE(ON), the reset value (initial value + 1 process cycle
value) is output.
When the reset flag is FALSE(OFF), input data U1 is estimated in consideration of the
unit time conversion code H2.
The estimate value is reset when it reaches the maximum estimate value H3. The
exceeded portion (|U1 + Yn-1||H3|) s not considered as an error since it is added to
the next count value.
Estimation can be performed without error even if the estimate value is much larger
(up to 106 times) than the input value.
2.16 Process Operation
Integrated Controller V seriesUnified Controller nv series Programming Instructions (LD/FBD/SFC/ST)
431
[Formula]
When U2 = TRUE:
ZSUM = U1* (CT/K)
Y = ZSUM + H1
When U2 = FALSE:
ZSUM = ZSUM + U1* (CT/K)
if |ZSUM|> = MAX then
ZSUM = ZSUM - (ZSUM/ |ZSUM|)* MAX
if |Y|> = H3 then
Y = Y
n-1
+ (ZSUM/ |ZSUM|)* MAX - (Y
n-1
/ |Y
n-1
|)* H3
else
Y = Y
n-1
+ (ZSUM/ |ZSUM|)* MAX
endif
endif
(CT:Main scan cycle [sec], K:Unit time conversion value (1/60/3600), MAX:Output
resolution (1/0.1/0.01/0.001/0.0001)
Instance structure
Name Type Description Remarks
Y REAL Estimate value
Can be accessed from the user
program.
ZSUM REAL
Internal estimate value
(estimated to the value corresponding
to the output resolution)
Cannot be accessed from the user
program.
Chapter 2 LD/FBD Instructions
6F8C1226
432
Program example
[LD/FBD language notation]
RSM_L output
GE output
50m
3
RSM_L
U1
U2
H1
H2
H3
H4
S1
0
ST
0
LD
0.0
LD
2
LD
DP20
50.0
LD
2
LD
PV1.PV
200.0
LD
GE
50.0
LD
RSM_L_1
[ST language notation]
RSM_L_1( PV1.PV, 0, 0.0, 2, DP20, 2);
S1 := GE( RSM_L_1.Y, 50.0);
When the PV1 measurement range is 0 to 250m/h, flag which is set to TRUE(ON)
every 50m
3
.
Error information
The following operation is performed when the input data type is REAL:
Controller Action
Integrated Controller V series
When NAN is input NAN abnormal is set to
TRUE(ON) and output is retained.
When the maximum estimate value H3 is negative, it is handled as 0.
Estimate value Y is not reset when U1>H3>0 or U1<H3<0.
When the reset flag U2 is TRUE(ON), it is output without change even if initial value
H1>maximum estimate value H3.
When the maximum estimate value H3>(Output resolution H4(1 to 0.0001)-106), the
estimate accuracy is deteriorated when the estimate value Y nears the maximum
estimate value H3.
Estimate value Y is reset when it is +H3 or -H3.
Reset flag U2 operation differs when it is changed from TRUE(ON) to FALSE(OFF)
depending on the initial value H1, input data U1 sign, and magnitude relation with the
maximum estimate value H3.
2.16 Process Operation
Integrated Controller V seriesUnified Controller nv series Programming Instructions (LD/FBD/SFC/ST)
433
Parameter Structure
The following list provides the structure of parameters used in process operation. For
functions requiring parameter specification, use structures defined by @ standard
structure (L controller).typ, @ standard structure (DS).typ, and @ standard structure (S
controller).typ of Engineering tool.
The parameter structure used in process operation differs by the controller type for the
PV parameter, PV data, LP parameter and LP data.
Structures of @ standard structure (L controller) are used in process operation of
Integrated Controller S2/S3/L1/L2/L3 and Unified Controller type1.
Structures of @ standard structure (DS) are used in process operation of Integrated
Controller L2DS/L3DS and Unified Controller type2.
The parameters provided here describe the following:
Type Structure name MCS/DCS
typePV_PARA @ standard data type (MCS type L Controller) PV parameter
typePV_PARA_DS @ standard data type (DS type L Controller)
typePV_DATA @ standard data type (MCS type L Controller) PV data
typePV_DATA_DS @ standard data type (DS type L Controller)
typeLP_PARA @ standard data type (MCS type L Controller) LP parameter
typeLP_PARA_DS @ standard data type (DS type L Controller)
typeLP_DATA @ standard data type (MCS type L Controller) LP data
typeLP_DATA_DS @ standard data type (DS type L Controller)
typeP_PARA @ standard data type (MCS type L Controller) Polygonal line parameter
typeP_PARA_DS @ standard data type (DS type L Controller)
PID3 instruction PV data/setting
value
typePID3_PV_D @ standard data type (S Controller type)
PID3 instruction LP parameter typePID3_LP_P @ standard data type (S Controller type)
Chapter 2 LD/FBD Instructions
6F8C1226
434
PV parameter structureS2/S3/L1/L2/L3, type1
Data type Parent type
typePV_PARA STRUCT
Member Data type Initial value Comment
TAG ARRAY[0..3] OF DWORD Tag No.
IP DWORD Input hardware address
RH REAL 100.0 Indicator range high limit [EU]
RL REAL Indicator range low limit [EU]
CH INT 32000 Input count high limit
CL INT 6400 Input count low limit
SIG UINT Input signal type
LNR WORD Compensation operation type
LC INT -100 Low cut value [0.01%]
FT UINT 25 Filter constant [%]
TM UINT Temperature compensation PV No.
PM UINT Pressure compensation PV No.
TDG REAL Temperature compensation
designed temperature [C]
PDG REAL Pressure compensation designed
pressure [kPa]
PU REAL 1.0 Pulse weight coefficient [EU/pulse]
T REAL 1.0 Time conversion coefficient
K REAL 1.0 Engineering unit conversion
coefficient
D REAL 1.0 Compensation coefficient
PH REAL 90.0 PV alarm high [EU]
PL REAL 10.0 PV alarm low [EU]
PVB REAL 1.0 PV alarm high/low [EU]
DPL REAL 10.0 PV rate-of-change alarm [EU/s]
DPB REAL 1.0 PV rate-of-change alarm dead band
[EU/s]
PRD UINT PV error processing definition
SPV UINT Integral input PV No.
MAX REAL 100.0 Totalization max [EU]
SIMM UINT Simulation setting
UIL BOOL Sensor low alarm suppress
UIH BOOL Sensor high alarm suppress
DIC BOOL PV/PVC direct connection
PVC REAL PV before application compensation
Spare ARRAY[0..3] OF WORD
2.16 Process Operation
Integrated Controller V seriesUnified Controller nv series Programming Instructions (LD/FBD/SFC/ST)
435
PV parameter structureL2DS/L3DS, type2
Data type Parent type
typePV_PARA_DS STRUCT
Member Data type Initial value Comment
TAG ARRAY[0..3] OF DWORD Tag No.
NAME ARRAY[0..7] OF DWORD Tag name
TYP UINT Tag type
MDL WORD Display pattern model No.
SCNO UINT Auto screen display No.
LOCK WORD Operation lock setting
SIGN ARRAY[0..3] OF DWORD Tagging character
ATYP WORD 1 Alarm confirm method
PRS UINT Control scan setting
SCH WORD 1 Sub schedule No.
DVRM UINT Scale divisions (for reprocessing)
MON ARRAY[0..31] OF BOOL Alarm monitor individual setting
AGRD ARRAY[0..15] OF WORD Alarm grade type
AMMT UINT Monitoring timer setting value
DCML UINT 2 Decimal point position
EU ARRAY[0..3] OF DWORD Engineering unit character
BNO WORD Input point bus No./node No.
SNO WORD Input point slot No./module No.
CNO WORD Main slot No.
IOM WORD I/O module type
ZPT UINT Cold compensation point PV No.
IPL UINT Inverse polygonal line No.
SIG UINT Input type signal
LNR UINT Input compensation operation type
PVA DWORD Input point variable name
CH INT 4000 Input count high limit
CL INT 800 Input count low limit
LC REAL -1.0 Low cut value [0.01%]
FT REAL 0.25 Filter coefficient [%]
RH REAL 100.0 Indicator range high limit [EU]
RL REAL Indicator range low limit [EU]
PHH REAL 100.0 PV alarm high high [EU]
PH REAL 90.0 PV alarm high [EU]
PL REAL 10.0 PV alarm low [EU]
PLL REAL PV alarm low low [EU]
PVB REAL 1.0 PV alarm high low dead band [EU]
DPL REAL 10.0 PV rate-of-change alarm [EU/s]
DPB REAL 1.0 PV rate-of-change alarm dead band
[EU/s]
Chapter 2 LD/FBD Instructions
6F8C1226
436
Member Data type Initial value Comment
TM UINT Temperature compensation PV No.
PM UINT Pressure compensation PV No.
TDG REAL Temperature compensation design
temperature [C]
PDG REAL Pressure compensation design
pressure[kPa]
PRD UINT PV error process definition
SPV UINT Integration input PV No.
PU REAL 1.0 Pulse weight coefficient [EU/pulse]
T REAL 1.0 Time conversion coefficient
K REAL 1.0 Unit conversion coefficient
D REAL 1.0 Compensation coefficient
MAX REAL 100.0 Integration high limit value [EU]
PSET REAL Integration setting value [EU]
FONO UINT Startup button No.
PBNO UINT Startup button PB No.
SPLT REAL 50.0 PV split range position [EU]
PVPT REAL 50.0 PV friction pointer position [EU]
DMAX REAL Integration rate-of-change setting
value [EU/h]
PLN UINT Polygonal line No.
SGDR WORD Power factor signal direction setting
SENS ARRAY[0..3] OF DWORD Input device name
V0 REAL Draught free judgment value
PVP UINT Wind direction PV No.
UIL BOOL PV low sensor error suppress setting
UIH BOOL PV high sensor error suppress
setting
DIC BOOL PV/PVC direct connection
PVIR BOOL PV update setting for sensor error
UBS BOOL Unipolar/bipolar setting (for nv)
DCH DINT 64000 Input count high limit (for nv)
DCL DINT 12800 Input count low limit (for nv)
SPARE ARRAY[0..11] OF WORD
2.16 Process Operation
Integrated Controller V seriesUnified Controller nv series Programming Instructions (LD/FBD/SFC/ST)
437
PV data structureS2/S3/L1/L2/L3, type1
Data type Parent type
typePV_DATA STRUCT
Member Data type Comment
PV REAL PV value [EU]
SCN BOOL Scan off
SIM BOOL Simulation
SPR BOOL Alarm suppress
RST BOOL Totalizor reset
DEU BOOL Device error unconfirmed
VIU BOOL Sensor error unconfirmed
PRU BOOL PV processing error unconfirmed
VHU BOOL PV alarm high unconfirmed
VLU BOOL PV alarm low unconfirmed
VDU BOOL PV rate-of-change alarm
unconfirmed
PDE BOOL Device error
PVI BOOL Sensor error
PRE BOOL PV processing error
PVH BOOL PV upper limit alarm
PVL BOOL PV lower limit alarm
PVD BOOL PV change rate alarm
Chapter 2 LD/FBD Instructions
6F8C1226
438
PV data structureL2DS/L3DS, type2
Data type Parent type
typePV_DATA_DS STRUCT
Member Data type Comment
B0_0 BOOL
B0_1 BOOL
B0_2 BOOL
B0_3 BOOL
B0_4 BOOL
B0_5 BOOL
B0_6 BOOL
B0_7 BOOL
B0_8 BOOL
B0_9 BOOL
B0_10 BOOL
INOP BOOL Sensor error
DU BOOL SDIN card error
B0_13 BOOL
B0_14 BOOL
B0_15 BOOL
PVIH BOOL PV sensor upper limit alarm
PVIL BOOL PV sensor lower limit alarm
PVHH BOOL Upper limit alarm above PV
PVH BOOL PV upper limit alarm
PVL BOOL PV lower limit alarm
PVLL BOOL Lower limit alarm below PV
PVD BOOL PV change rate alarm
PDE BOOL Device error
PRE BOOL PV processing error
UP BOOL State of integration setting value
reached
TTE BOOL Integration rate-of-change alarm
B1_11 BOOL
B1_12 BOOL
B1_13 BOOL
B1_14 BOOL
B1_15 BOOL
STIT ARRAY[0..31] OF BOOL Alarm display condition
FLIT ARRAY[0..31] OF BOOL Alarm conf condition
B6_0 BOOL
B6_1 BOOL
B6_2 BOOL
B6_3 BOOL
2.16 Process Operation
Integrated Controller V seriesUnified Controller nv series Programming Instructions (LD/FBD/SFC/ST)
439
Member Data type Comment
MSR BOOL Measuring mode (for
reprocessing)
WAT BOOL Wait mode (for reprocessing)
TST BOOL Test mode (for reprocessing)
PRF BOOL Proofread mode(for reprocessing)
TRC BOOL Tracking
ZER BOOL Zero adjustment mode (for
reprocessing)
B6_10 BOOL
B6_11 BOOL
B6_12 BOOL
B6_13 BOOL
B6_14 BOOL
MHLD BOOL MELSECNET input stop
SCN BOOL Scan setting
SIM BOOL Simulation setting
SPR BOOL Alarm suppress setting
BSIM BOOL Batch simulation setting
RCNF BOOL Alarm confirm request
RLO BOOL LO request
B7_6 BOOL
B7_7 BOOL
RST BOOL Integration reset setting
B7_9 BOOL
B7_10 BOOL
B7_11 BOOL
B7_12 BOOL
SPR1 BOOL Alarm suppress limit setting
HLD BOOL Input stop (for nv)
B7_15 BOOL
PV REAL PV value [EU]
SINW INT Simulation input value
DRC UINT Wind direction
PVC REAL PV before application
compensation
W14 WORD
W15 WORD
W16 WORD
W17 WORD
RAW INT Raw count value
W19 WORD
BSPR ARRAY[0..31] OF BOOL Alarm suppress flag
PVPC REAL PV [% unit]
PVCPC REAL PVC [% unit]
Chapter 2 LD/FBD Instructions
6F8C1226
440
Member Data type Comment
PVI BOOL Sensor alarm
B26_1 BOOL
B26_2 BOOL
B26_3 BOOL
B26_4 BOOL
B26_5 BOOL
B26_6 BOOL
B26_7 BOOL
B26_8 BOOL
B26_9 BOOL
B26_10 BOOL
B26_11 BOOL
B26_12 BOOL
B26_13 BOOL
B26_14 BOOL
B26_15 BOOL
W27 WORD
DRAW DINT Raw count value (for nv)
SPARE ARRAY[0..1] OF WORD
2.16 Process Operation
Integrated Controller V seriesUnified Controller nv series Programming Instructions (LD/FBD/SFC/ST)
441
LP parameter structureS2/S3/L1/L2/L3, type1
Data type Parent type
typeLP_PARA STRUCT
Member Data type Initial
value
Comment
OA DWORD Output hardware address
PVP UINT Controlled PV No
MSIG UINT Output signal type
CTL WORD 16#0001 Control operation type
CDR BOOL Control operation direction
dum1 BOOL
dum2 BOOL
dum3 BOOL
dum4 BOOL
dum5 BOOL
dum6 BOOL
dum7 BOOL
MDR BOOL MV output direction
dum9 BOOL
dum10 BOOL
dum11 BOOL
dum12 BOOL
dum13 BOOL
dum14 BOOL
dum15 BOOL
KP REAL 0.8 Proportional gain
TI REAL 0.1 Integral time [min]
TD REAL 0.0 Differential time [min]
ETA REAL 0.1 Rate gain
ALP REAL 0.4 2 DOF proportionality
coefficient/SV high value
BET REAL 1.35 2 DOF integration coefficient/SV
low value
GAM REAL 1.25 2 DOF differential coefficient
GP REAL 0.0 Gap [%]
GG REAL 1.0 Gap gain
DMV REAL 100.0 MV rate limiter [%/scan]
MH REAL 100.0 MV high limit value [%]
ML REAL -5.0 MV low limit value [%]
FP REAL Full stroke pulse count/time [s]
BL REAL Backlash
HT REAL Hold time
PLB REAL Pulse dead band [s]
DL REAL 10.0 Deviation alarm value [EU]
DVB REAL 1.0 Deviation alarm dead band [EU]
Chapter 2 LD/FBD Instructions
6F8C1226
442
Member Data type Initial
value
Comment
MHA REAL 90.0 MV alarm high [%]
MLA REAL 10.0 MV alarm low [%]
MVB REAL 1.0 MV alarm high/low limit dead band
[%]
VP UINT Valve position PV No.
DT0 UINT 1 Control cycle [scan]
T0 UINT 5 Sample time [0.1s]
T1 UINT 5 Control time [0.1s]
CLD UINT Control stop definition
LDU WORD 16#0001 LDU Setting
MDT REAL 0.0 Dead time [min] (for model driven
PID)
MKF REAL 0.0 PD comp. Gain (for model driven
PID)
MTF REAL 0.0 PD comp. Differential time [min] (for
model driven PID)
CMD UINT 0 Control Mode Setting
POR BOOL 0 Pulse Output Request
SVS BOOL 0 SV Setting at A Mode
FS0 BOOL 0 SV major tracking
FS1 BOOL 0 Cascade value kind
B61_4 BOOL
B61_5 BOOL
B61_6 BOOL
B61_7 BOOL
B61_8 BOOL
B61_9 BOOL
B61_10 BOOL
B61_11 BOOL
B61_12 BOOL
B61_13 BOOL
B61_14 BOOL
B61_15 BOOL
PMV REAL Pulse Output
2.16 Process Operation
Integrated Controller V seriesUnified Controller nv series Programming Instructions (LD/FBD/SFC/ST)
443
LP parameter structure(L2DS/L3DS, type2)
Data type Parent type
typeLP_PARA_DS STRUCT
Member Data type Initial
value
Comment
TAG ARRAY[0..3] OF DWORD Tag No.
NAME ARRAY[0..7] OF DWORD Tag name
TYP UINT Tag type
MDL WORD Display pattern model No.
SCNO UINT Auto screen display No..
LOCK WORD Operation lock setting
SIGN ARRAY[0..3] OF DWORD Tagging character
ATYP WORD 1 Alarm confirm method
PRS UINT Control scan setting
SCH WORD 1 Sub schedule No.
W39 WORD
MON ARRAY[0..31] OF BOOL Alarm monitor individual setting
AGRD ARRAY[0..15] OF WORD Alarm grade type
PVP UINT Indicator PV No.
VP UINT Valve position PV No.
MDR BOOL MV Output direction setting
B60_1 BOOL
B60_2 BOOL
B60_3 BOOL
B60_4 BOOL
B60_5 BOOL
B60_6 BOOL
B60_7 BOOL
CDR BOOL Control operation direction
B60_9 BOOL
B60_10 BOOL
B60_11 BOOL
B60_12 BOOL
B60_13 BOOL
B60_14 BOOL
B60_15 BOOL
MDSP WORD MV display direction setting
MSPL REAL 50.0 MV split range position
MVPT REAL 50.0 MV friction pointer position
MSIG WORD Output signal type
SIMM WORD Simulation method
MUNO WORD Output point unit No.
MPNO WORD Output point No.
MVA DWORD Output point variable name
DMV REAL 100.0 MV rate-of-change limit [%/scan]
MH REAL 100.0 MV high limit value [%]
Chapter 2 LD/FBD Instructions
6F8C1226
444
Member Data type Initial
value
Comment
ML REAL MV low limit value [%]
MHA REAL 90.0 MV alarm high [%]
MLA REAL 10.0 MV alarm low [%]
MVB REAL 1.0 MV alarm dead band [%]
CLD UINT Control stop type
CMD UINT Control mode setting
SVS UINT A mode SV setting
DT0 UINT 1 Control cycle
T0 UINT 5 Sample time [scan]
T1 UINT 5 Control time [scan]
KP REAL 0.8 Proportional gain
TI REAL 0.1 Integral time [min]
TD REAL Differential time [min]
ETA REAL 0.1 Rate gain
ALP REAL 0.4 2 DOF proportionality
coefficient/SV high value
BET REAL 1.35 2 DOF integration coefficient/SV
low value
GAM REAL 1.25 2 DOF differential coefficient
GP REAL Gap [%]
GG REAL 1.0 Gap gain
GAIN REAL Proportional gain
BIAS REAL Proportional bias
FP REAL Full stroke time/pulse count
BL REAL Backlash
HT REAL Hold time
PLB REAL Pulse dead band [s]
PDL REAL 10.0 Positive deviation alarm value
NDL REAL 10.0 Negative deviation alarm value
DVB REAL 1.0 Deviation alarm dead band [EU]
SH REAL 100.0 Proportional range high limit value
SL REAL Proportional range low limit value
SVEU ARRAY[0..3] OF DWORD Proportional engineering unit
character
MVEU ARRAY[0..3] OF DWORD Proportional operation value
engineering unit character
SVDM UINT 2 Proportional decimal point position
MVDM UINT 2 Proportional operation value
decimal point position
KF REAL 1.0 MV gain
DFF REAL MV bias
MVP REAL MV ramp target value
MVK REAL MV ramp incremental value
MVT REAL MV ramp time coefficient
SVP REAL SV ramp target value
SVK REAL SV ramp incremental value
SVT REAL SV ramp time coefficient
TR REAL MV tracking value
2.16 Process Operation
Integrated Controller V seriesUnified Controller nv series Programming Instructions (LD/FBD/SFC/ST)
445
Member Data type Initial
value
Comment
ACTS ARRAY[0..3] OF DWORD Output device name
W174 WORD
POIP UINT 1 Inching pulse width
FS0 BOOL 0 SV measure tracking designation
FS1 BOOL 0 Cascade value type
B176_2 BOOL
B176_3 BOOL
B176_4 BOOL
B176_5 BOOL
B176_6 BOOL
B176_7 BOOL
B176_8 BOOL
B176_9 BOOL
B176_10 BOOL
B176_11 BOOL
B176_12 BOOL
B176_13 BOOL
B176_14 BOOL
B176_15 BOOL
W177 WORD
MDT REAL 0.0 Dead time [min] (for model driving
PID)
MKF REAL 0.0 PD compensator gainfor model driving
PID
MTF REAL 0.0 PD compensator differential time [min] (for
model driving PID)
VMHC UINT MV direction character display (for
reprocessing)
SPARE ARRAY[0..6] OF WORD
Chapter 2 LD/FBD Instructions
6F8C1226
446
LP data structureS2/S3/L1/L2/L3, type1
Data type Parent type
typeLP_DATA STRUCT
Member Data type Comment
SV REAL SV value [EU]
MV REAL MV value [%]
MODE UINT Control mode
MVT BOOL MV tracking
SIM BOOL Simulation
LSP BOOL Alarm suppress
M BOOL Mode M
A BOOL Mode A
C BOOL Mode C
RM BOOL Mode RM
LS_7 BOOL
LS_8 BOOL
LS_9 BOOL
MVE BOOL MV error
CLI BOOL Control stop
MVH BOOL MV alarm high
MVL BOOL MV alarm low
DVE BOOL Deviation alarm value
VPI BOOL Valve position error
SSV BOOL SEQ-SV ope.
CSV BOOL CMP-SV involvement condition
SMV BOOL SEQ-MV involvement condition
CMV BOOL CMP-MV ope.
CMP BOOL CMP operation
SEQ BOOL SEQ operation
CC BOOL Cascade
dum7 BOOL
dum8 BOOL
dum9 BOOL
MEU BOOL MV error unconfirmed
CLU BOOL Control stop unconfirmed
MHU BOOL MV alarm high unconfirmed
MLU BOOL MV alarm low unconfirmed
DVU BOOL Deviation alarm unconfirmed
VPU BOOL Valve position error unconfirmed
2.16 Process Operation
Integrated Controller V seriesUnified Controller nv series Programming Instructions (LD/FBD/SFC/ST)
447
LP data structure(L2DS/L3DS, type2)
Data type Parent type
typeLP_DATA_DS STRUCT
Member Data type Comment
CLI BOOL Control inactive
MVE BOOL MV error
MVH BOOL MV alarm high
MVL BOOL MV alarm low
PDV BOOL Positive deviation alarm
NDV BOOL Negative deviation alarm
VPI BOOL Valve position error
B0_7 BOOL
B0_8 BOOL
B0_9 BOOL
B0_10 BOOL
B0_11 BOOL
B0_12 BOOL
B0_13 BOOL
B0_14 BOOL
B0_15 BOOL
PVIH BOOL PV sensor upper limit alarm
PVIL BOOL PV sensor lower limit alarm
PVHH BOOL Upper limit alarm above PV
PVH BOOL PV upper limit alarm
PVL BOOL PV lower limit alarm
PVLL BOOL Lower limit alarm below PV
PVD BOOL PV change rate alarm
PDE BOOL Device error
PRE BOOL PV processing error
B1_9 BOOL
B1_10 BOOL
B1_11 BOOL
B1_12 BOOL
B1_13 BOOL
B1_14 BOOL
B1_15 BOOL
STIT ARRAY[0..31] OF BOOL Alarm display condition
FLIT ARRAY[0..31] OF BOOL Alarm conf condition
SSV BOOL SEQ-SV ope.
CSV BOOL CMP-SV involvement condition
SMV BOOL SEQ-MV involvement condition
CMV BOOL CMP-MV ope.
Chapter 2 LD/FBD Instructions
6F8C1226
448
Member Data type Comment
M BOOL Mode M
A BOOL Mode A
C BOOL Mode C
RM BOOL Mode RM
TRC BOOL MV tracking state
B6_9 BOOL
POR BOOL Pulse output request
IOPN BOOL Pulse inching request (OPEN)
ICLS BOOL Pulse inching request (CLOSE)
B6_13 BOOL
B6_14 BOOL
B6_15 BOOL
SCN BOOL Scan setting
SIM BOOL Simulation setting
SPR BOOL Alarm suppress setting
BSIM BOOL Batch simulation setting
RCNF BOOL Alarm confirm request
RLO BOOL LO request
B7_6 BOOL
B7_7 BOOL
RST BOOL Integration reset setting
B7_9 BOOL
B7_10 BOOL
B7_11 BOOL
B7_12 BOOL
SPR1 BOOL Alarm suppress limit setting
HLD BOOL Input stop (for nv)
B7_15 BOOL
PV REAL PV value [EU]
SV REAL SV value [EU]
MV REAL MV value [%]
MODE UINT Control mode
W15 WORD
PMV REAL Pulse output MV
RAW INT Raw count value
W19 WORD
TR REAL MV tracking value
RPLS REAL PO user area1
POWK DWORD PO user area 2
BSPR ARRAY[0..31] OF BOOL Alarm suppress flag
PVPC REAL PV [% unit]
PVCPC REAL PVC [% unit]
SVPC REAL SV [% unit]
2.16 Process Operation
Integrated Controller V seriesUnified Controller nv series Programming Instructions (LD/FBD/SFC/ST)
449
Member Data type Comment
PVI BOOL Sensor alarm
CMP BOOL Computer flag
MCH BOOL M mode set
ACH BOOL A mode set
CCH BOOL C mode set
MDCH BOOL Mode change
MRM BOOL M/RM mode
DVE BOOL Deviation alarm
B34_8 BOOL MRM previous memory
B34_9 BOOL A mode previous memory
B34_10 BOOL C mode previous memory
B34_11 BOOL M mode request
B34_12 BOOL A mode request
B34_13 BOOL C mode request
B34_14 BOOL
B34_15 BOOL
W35 WORD
MVOVER REAL
DRAW DINT Raw count (for nv)
SPARE ARRAY[0..23] OF WORD
Polygonal line parameter structure(S2/S3/L1/L2/L3, type1)
Data type Parent type
typeP_PARA STRUCT
Member Data type Comment
VAL ARRAY[0..11] OF typeXY
Data type Parent type
typeXY STRUCT
Member Data type Comment
X REAL X value
Y REAL Y value
Polygonal line parameter structure(L2DS/L3DS, type2)
Data type Parent type
typeP_PARA_DS STRUCT
Member Data type Comment
X ARRAY[0..11] OF REAL X value
Y ARRAY[0..11] OF REAL Y value
Chapter 2 LD/FBD Instructions
6F8C1226
450
For PID3 instruction (PV data/setting structure):
Data type Parent type
typePID3_PV_D STRUCT
Member Data type Comment
PVC REAL Process measurement input [%]
ASV REAL Auto mode setting value[%]
CSV REAL Cascade mode setting value[%]
MMV REAL Manual mode manipulated value input [%]
TMV REAL Manipulated value tracking input [%]
MODE DWORD Mode setting
For PID 3 instruction (LP parameter)
Data type Parent type
typePID3_LP_P STRUCT
Member Data type Comment
KP REAL Proportional gain
TI REAL Integral time [min]
TD REAL Rate time [min]
GP REAL Control dead band [%]
ISV REAL Auto mode setting initial value [%]
FT REAL Process input filter
DSV REAL Setting ASV rate limiter [%/At]
DMMV REAL Manual mode manipulated value MMV differential
limit [%/At]
STS DWORD Status
MH REAL Manipulated value high limit [%]
ML REAL Manipulated value low limit [%]
DMV REAL Manipulated value differential limit [%/At]
N REAL Control cycle setting value
2.17 Program Control
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
451
2.17 Program Control
No. Instruction Remarks
1 Return RETURN
2 User Defined Function
3 User Defined Function Block
4 Program Enable EN_P
5 Program Disable DIS_P
6 Event Program Startup START_P
7 Interrupt Enable EI_T T compatible instruction
8 Interrupt Disable DI_T T compatible instruction
Chapter 2 LD/FBD Instructions
6F8C1226
452
Return
Program Control Return
LD/FBD language
notation
RETURN Input
EN input Edge execution Index modification Modifier
ST language notation RETURN
Function
When the input state is TRUE(ON), program, user defined function, and user defined
function block are terminated and control returns to the instruction following the
corresponding CALL instruction.
If connected directly to left power rail, program, user defined function, and user defined
function block are terminated unconditionally and control returns to the instruction
following the corresponding CALL instruction.
Input Action Output
FALSE(OFF) Return not executed
TRUE(ON) Return executed
This instruction is not necessary in order to return to the instruction following the
corresponding CALL instruction at the end of program, user defined function, or user
defined function block. Use the Return instruction when it is necessary to return to
the instruction following the corresponding CALL instruction in the middle of a
program.
Program example
[LD/FBD language notation]
SIGNAL2
RETURN
SIGNAL1
[ST language notation]
IF SIGNAL1 AND SIGNAL2 THEN
RETURN;
END_IF;
Returns only when the state of SIGNAL1 and SIGNAL2 is TRUE(ON).
2.17 Program Control
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
453
User Defined Function
Program Control User Defined Function
LD/FBD language
notation
Function name Input argument 1
Input argument 2
Input argument 3
Input argument n
Output
EN input Edge execution Index modification Modifier
ST language notation Output := Function name( Input argument 1, Input argument 2, Input
argument 3, , Input argument n );
Function
Executes the user defined function.
Up to 15 Input argument including function value may be defined.
User defined function and user defined function block may be nested up to 6 levels.
Program example
[LD/FBD language notation]
USERFUN
IN0
IN1
IN2
IN3
SAMPLE1
SAMPLE2
SAMPLE3
SAMPLE4
SAMPLE5
ADD_INT
IN0
IN1
IN2
SUB_INT
IN3
MUL_INT
USERFUN
User defined function content
[ST language notation]
SAMPLE5 := USERFUN( SAMPLE1, SAMPLE2, SAMPLE3, SAMPLE4);
(User defined function content)
USERFUN := ( IN0 + IN1 IN2 ) * IN3
Executes the content of user defined function using SAMPLE1 to 4 as input argument
and stores the result in SAMPLE5.
Chapter 2 LD/FBD Instructions
6F8C1226
454
User Defined Function Block
Program Control User Defined Function Block
LD/FBD language
notation
Function name Input argument 1
Input argument 2
Input argument 3
Input argument n
Output 1
Output 2
Output 3
Output n
Instance name
EN input Edge execution Index modification Modifier
ST language
notation
[Instance name](Input argument1, Input argument2, Input argument3, ,
Input argument n );
[Variable name]:=[Instance name]. Output argument1;
[Variable name]:=[Instance name]. Output argument2;
[Variable name]:=[Instance name]. Output argument3;
:
[Variable name]:=[Instance name]. Output argument n;
Function
Executes the user defined function block.
Up to 15 input and output arguments may be defined.
User defined function and user defined function block may be nested up to 6 levels.
Program example
[LD/FBD language notation]
ADD_INT
IN0
IN1
IN2
SUB_INT
IN3
MUL_INT
OUT1
User defined function block content
ADD_INT
IN0
IN1
IN2
SUB_INT
IN3
DIV_INT
OUT2
USERFB
IN0 OUT1
IN1 OUT2
IN2
IN3
SAMPLE1
SAMPLE2
SAMPLE3
SAMPLE4
SAMPLE5
SAMPLE6
USERFB_1
2.17 Program Control
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
455
[ST language notation]
USERFB_1( SAMPLE1, SAMPLE2, SAMPLE3, SAMPLE4);
SAMPLE5 := USERFB_1.OUT1;
SAMPLE6 := USERFB_1.OUT2;
(User defined function block content)
OUT1 := ( IN0 + IN1 IN2 ) * IN3
OUT2 := ( IN0 + IN1 IN2 ) / IN3
Executes the content of user defined function block using SAMPLE1 to 4 as input
arguments and stores the result in SAMPLE5 and SAMPLE6.
Chapter 2 LD/FBD Instructions
6F8C1226
456
Program Enable
Program Control Program Enable
LD/FBD language
notation
Execution control input Output
EN_P
E
TASK
NO
Task entry No.
Task type
EN input Edge execution Index modification Modifier
ST language notation Output := EN_P( E, TASK, NO);
Arguments
Arg. Operand Type Const. Description Remarks
E BOOL
Execution control
input
TASK UINT
Task type
Input
NO UINT
1
Super
highspeed task
SS
2 Interrupt task IP
3 Highspeed task HS
4 Main task MS
5 Background task BG
Execution
control input
Action Output
FALSE(OFF) FALSE(OFF)
TRUE(ON) Enables execution of the specified program. TRUE(ON)
2.17 Program Control
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
457
Program example
[LD/FBD language notation]
SIGNAL1
1
LD
EN_P
4
LD
SIGNAL2
1
ST
10
LD
E
TASK
NO
Main task
000
001
010
009 P_2059
P_2051
P_2050
P_2060
Disabledenabled
[ST language notation]
SIGNAL2 := EN_P( SIGNAL1, 4, 10);
When execution control input SIGNAL1 is TRUE(ON), execution of program P_2060
registered in entry No. 010 of main task specified by task type TASK and task entry No.
NO is enabled.
Error information
No operation is performed if an unregistered program, invalid task type, or invalid task
entry No. is specified.
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
Chapter 2 LD/FBD Instructions
6F8C1226
458
Program Disable
Program Control Program Disable
LD/FBD language
notation
Execution control input Output
DIS_P
E
TASK
NO
Task entry No.
Task type
EN input Edge execution Index modification Modifier
ST language notation Output := DIS_P( E, TASK, NO);
Arguments
Arg. Operand Type Const. Description Remarks
E BOOL
Execution control
input
TASK UINT
Task type
Input
NO UINT
1
Super high
speed task
SS
2 Interrupt task IP
3
Highspeed
task
HS
4 Main task MS
5
Background
task
BG
Execution
control input
Action Output
FALSE(OFF) FALSE(OFF)
TRUE(ON) Disables execution of the specified program. TRUE(ON)
2.17 Program Control
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
459
Program example
[LD/FBD language notation]
SIGNAL1
1
LD
DIS_P
4
LD
SIGNAL2
1
ST
10
LD
E
TASK
NO
Main task
000
001
010
009 P_2059
P_2051
P_2050
P_2060 EnabledDisabled
[ST language notation]
SIGNAL2 := DIS_P( SIGNAL1, 4, 10);
When execution control input SIGNAL1 is TRUE(ON), execution of program P_2060
registered in entry No. 10 of main task specified by task type TASK and task entry No.
NO is disabled.
Error information
No operation is performed if an unregistered program, invalid task type, or invalid task
entry No. is specified.
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
Chapter 2 LD/FBD Instructions
6F8C1226
460
Event Program Startup
Program Control Event Program Startup
LD/FBD language
notation
Execution control input Output
START_P
E
TASK
NO
Task entry No.
Task type
EN input Edge execution Index modification Modifier
ST language notation Output := START_P( E, TASK, NO );
Arguments
Arg. Operand Type Const. Description Remarks
E BOOL
Execution control
input
TASK UINT
Task type
Input
NO UINT
1
Super
high-speed task
SS
2 Interrupt task IP
3 High-speed task HS
4 Main task MS
5 Background task BG
2.17 Program Control
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
461
[Integrated Controller V series]
Execution
control input E
Action Output
FALSE(OFF) FALSE(OFF)
TRUE(ON) Starts the specified event program. TRUE(ON)
[Unified Controller nv series]
Execution
control input E
Action Output
FALSE(OFF) FALSE(OFF)
Executed TRUE(ON)
TRUE(ON) Starts the specified event program.
Not executed FALSE(OFF)
Program example
[Integrated Controller V series]
[LD/FBD language notation]
START_P
TASK
E
IP1_REQ
2
NO 1
IP1_DONE
START_P
TASK
E
IP2_REQ
2
NO 2
IP2_DONE
Indicates IP1 is
enabled and output
is set to TRUE(ON)
Interrupt task
0
1
2
15
P_2050
P_2051
P_2052
P_2065
Startup
Startup
Main task(MS)
Interrupt task(IP)
MS_001
MS_001
IP_001
Indicates IP2 is
enabled and output
is set to TRUE (ON)
IP_002
[ST language notation]
IP1_DONE := START_P( IP1_REQ, 2, 1);
IP2_DONE := START_P( IP2_REQ, 2, 2);
When execution control input IP1_REQ is TRUE(ON), the event program IP1 specified
by the task type TASK and task entry No. NO is started up to start up program P_2051.
When execution control input IP2_REQ is TRUE(ON), the event program IP2 specified
by the task type TASK and task entry No. NO is started up to start up program P_2052,
as with the same scan of IP1 startup.
Chapter 2 LD/FBD Instructions
6F8C1226
462
[Unified Controller nv series]
[LD/FBD language notation]
START_P
TASK
E
IP1_REQ
2
NO 1
R
IP1_REQ START_P
TASK
E
IP2_REQ
2
NO 2
R
IP2_REQ
Indicates IP1 is
executed and startup
request is reset with
reset coil instruction.
Interrupt task
0
1
2
15
P_2050
P_2051
P_2052
P_2065
Startup
Startup
Main task(MS)
Interrupt task (IP)
MS_001 MS_001
IP_001
Indicates IP2 is not
executed and startup
request is made again
by the next scan.
MS_001
IP_002
[ST language notation]
Since ST language does not support the notation equivalent to LD language, it cannot
describe data hold types such as -(R) - and - (S) - or change detection types such as
-|P|- and -|N|-. Therefore the program example is omitted.
When execution control input IP1_REQ is TRUE(ON), event program IP1 specified by
the task type TASK and task entry No. starts up to activate program P_2051.
Startup request for event program IP2 by the same scan as IP1 is made but denied
when execution control input IP2_REQ is TRUE(ON). Therefore, IP2 startup request
should be made again in the next scan.
Error information
No operation is performed if an unregistered program, invalid task type, or invalid task
entry No. is specified.
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
2.17 Program Control
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
463
Interrupt Enable
Program Control Interrupt Enable
LD/FBD language
notation
Execution control input Result
EI_T
EN input Edge execution Index modification Modifier
ST language notation Result := EI_T(Execution control input );
Arguments
Arg. Operand Type Const. Description Remarks
Input BOOL
Execution
control input
Output BOOL Result
Function
When the input is FALSE(OFF), outputs FALSE(OFF) without performing operation.
When the input is TRUE(ON), execution of task with higher priority than the executing
task is enabled and TRUE(ON) is output as the result.
Interrupt events that occur while execution is disabled are held until interrupt enable
instruction is executed and the held task is executed after execution is enabled.
Important
If interrupt is disabled, it must be enabled within the same POU.
Program example
[LD/FBD language notation]
DI_T
Circuit A
Circuit B
EI_T
I/O
Interrupt
factor
IP task
Execution
disabled
IP task
Execute
Interrupt factor
held
SIGNAL2
SIGNAL1
[ST language notation]
SIGNAL3 := DI_T( SIGNAL1);
SIGNAL4 := EI_T( SIGNAL2);
Disables interrupt when the SIGNAL1 is TRUE(ON). This interrupt is disabled while
circuit A is executing. Enables interrupt when the SIGNAL2 is TRUE(ON). Then the
interrupt task (IP) is started up by the suspended I/O interrupt.
Chapter 2 LD/FBD Instructions
6F8C1226
464
Interrupt Disable
Program Control Interrupt Disable
LD/FBD language
notation
Execution control input Result
DI_T
EN input Edge execution Index modification Modifier
ST language notation Result := DI_T( Execution control input );
Arguments
Arg. Operand Type Const. Description Remarks
Input BOOL
Execution control
input
Output BOOL Result
Function
When the input is FALSE(OFF), outputs FALSE(OFF) without performing operation.
When the input is TRUE(ON), execution of task with higher priority than the executing
task is disabled and TRUE(ON) is output as the result.
Interrupt events that occur while execution is disabled are held until interrupt enable
instruction is executed and the held task is executed after execution is enabled.
Important
If interrupt is disabled, it must be enabled within the same POU.
Program example
[LD/FBD language notation]
DI_T
Circuit A
Circuit B
EI_T
I/O
Interrupt
factor
IP task
Execution
disabled
IP task
Execute
Interrupt factor
held
SIGNAL2
SIGNAL1
[ST language notation]
SIGNAL3 := DI_T( SIGNAL1);
SIGNAL4 := EI_T( SIGNAL2);
Disables interrupt when the SIGNAL1 is TRUE(ON). This interrupt is disabled while
circuit A is executing. Enables interrupt when the SIGNAL2 is TRUE(ON). Then the
interrupt task (IP) is invoked by the suspended I/O interrupt.
2.18 String Processing
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
465
2.18 String Processing
No. Instruction Remarks
1 String Length LEN
2 Leftmost Extract String LEFT
3 Rightmost Extract String RIGHT
4 Extract String MID
5 Concatenate String CONCAT_STRING
6 Insert String INSERT
7 Delete String DELETE
8 Replace String REPLACE
9 Find String FIND
10 Define String DEF_STRING
Chapter 2 LD/FBD Instructions
6F8C1226
466
String Length
String Processing String Length
LD/FBD language
notation
Input string Output
LEN
EN input Edge execution Index modification Modifier
ST language notation Output := LEN(Input string );
Arguments
Arg. Operand Type Const. Description Remarks
Input STRING Input string
Output UINT Output
Function
Calculates the length of the input string and outputs the result.
Direct I/O variable cannot be specified for the input variable.
Program example
[LD/FBD language notation]
SAMPLE1
LD
LEN SAMPLE2
7
ST
Input string String length
7 B C D E F G A
[ST language notation]
SAMPLE2 := LEN( SAMPLE1);
Calculates the length of string "ABCDEFG" in input data SAMPLE1 and stores the
result "7" in SAMPLE2.
Error information
When the input variable exceeds the variable area, the string length is not processed
and the data boundary is exceeded.
The following operation is performed when direct I/O variable is specified for the input
variable:
Controller Action
Integrated Controller V series
Result=0.
Error flag is set to TRUE(ON).
Unified Controller nv series
Result=0.
Error flag and table operation error flag are set to TRUE(ON).
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
2.18 String Processing
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
467
Leftmost Extract String
String Processing Leftmost Extract String
LD/FBD language
notation
Input string Output
LEFT
IN
L
Extraction character length
EN input Edge execution Index modification Modifier
ST language notation LEFT( IN, L, Output);
Arguments
Arg. Operand Type Const. Description Remarks
IN STRING Input string
Input
L UINT
Extraction
character
length
Output STRING Output
Function
Extracts the string specified by extraction character length L from the left end of the
input string IN and outputs the result.
Direct I/O variable cannot be specified for the input string variable and output variable.
Program example
[LD/FBD language notation]
SAMPLE1
LD
LEFT
IN
L
SAMPLE3
ST
Input string Extracted string
ABC
SAMPLE2
3
LD
Extraction character count
3
B C D E F G A
[ST language notation]
LEFT( SAMPLE1, SAMPLE2, SAMPLE3);
Extracts the number of characters specified by extraction character length "3" in
SAMPLE2 from the left end of the string "ABCDEFG" in SAMPLE1and stores the
result "ABC" in SAMPLE3.
Chapter 2 LD/FBD Instructions
6F8C1226
468
Error information
When the input string variable and output variable exceed the variable area, the
leftmost extract string is not processed and the data boundary is exceeded.
The following operation is performed when direct I/O variable is specified for the input
string variable and output variable:
Controller Action
Integrated Controller V series
Leftmost extract string is not executed.
Error flag is set to TRUE(ON).
Unified Controller nv series
Leftmost extract string is not executed.
Error flag and table operation error flag are set to
TRUE(ON).
When EN is used ENO output is reset to FALSE(OFF) when the above error occurs.
2.18 String Processing
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
469
Rightmost Extract String
String Processing Rightmost Extract String
LD/FBD language
notation
Input string Output
RIGHT
IN
L
Extraction character length
EN input Edge execution Index modification Modifier
ST language notation RIGHT( IN, L, Output );
Arguments
Arg. Operand Type Const. Description Remarks
IN STRING Input string
Input
L UINT
Extraction
character
length
Output STRING Output
Function
Extracts the number of characters specified by extraction character length L from the
right end of the input string IN and outputs the result.
Direct I/O variable cannot be specified for input string variable and output variable.
Program example
[LD/FBD language notation]
SAMPLE1
LD
RIGHT
IN
L
SAMPLE3
ST
Input string Extracted string
EFG
SAMPLE2
3
LD
Extraction character length
3
B C D E F G A
[ST language notation]
RIGHT( SAMPLE1, SAMPLE2, SAMPLE3);
Extracts the number of characters specified by extraction character length "3" in
SAMPLE2 from the right end of the string "ABCDEFG" in SAMPLE1and stores the
result "EFG" in SAMPLE3.
Chapter 2 LD/FBD Instructions
6F8C1226
470
Error information
When the input string variable and output variable exceed the variable area, rightmost
extract string is not processed and the data boundary is exceeded.
The following operation is performed when direct I/O variable is specified for the input
string variable and output variable:
Controller Action
Integrated Controller V series
Rightmost extract string is not executed.
Error flag is set to TRUE(ON).
Unified Controller nv series
Rightmost extract string is not executed.
Error flag and table operation error flag are set to TRUE(ON).
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
2.18 String Processing
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
471
Extract String
String Processing Extract String
LD/FBD language
notation
Input string Output
MID
IN
L
P
Extraction character length
Extracted string top position
EN input Edge execution Index modification Modifier
ST language notation MID( IN, L, P, Output );
Arguments
Arg. Operand Type Const. Description Remarks
IN STRING Input string
L UINT
ST language notation CONCAT_STRING( IN1, IN2, Output );
Arguments
Arg. Operand Type Const. Description Remarks
IN1 STRING
Input string 1
Input
IN2 STRING
Input string 2
Output STRING
Output
Function
Concatenates input string 1 with input string 2 and outputs the result.
Direct I/O variable cannot be specified for the input string variable and output variable.
Program example
[LD/FBD language notation]
SAMPLE1
LD
CONCAT_STRING
IN1
IN2
SAMPLE3
ST
Input string 1
Output string
SAMPLE2
LD
Input string 2
+
E F G
B C D A
B C D E F G A
[ST language notation]
CONCAT_STRING( SAMPLE1, SAMPLE2, SAMPLE3);
Concatenates the string "ABCD" in SAMPLE1 with extraction string "EFG" in
SAMPLE2 and stores the result "ABCDEFG" in SAMPLE3.
Chapter 2 LD/FBD Instructions
6F8C1226
474
Error information
When the input string variable and output variable exceed the variable area, the
concatenate string is not processed and the data boundary is exceeded.
If the string length after concatenation exceeds the output string variable size, the result is
unchanged.
The following operation is performed when direct I/O variable is specified for the input
string variable and output variable:
Controller Action
Integrated Controller V series
Concatenate string is not executed.
Error flag is set to TRUE(ON).
Unified Controller nv series
Concatenate string is not executed.
Error flag and table operation error flag are set to
TRUE(ON).
When EN is used ENO output is reset to FALSE(OFF) when the above error occurs.
2.18 String Processing
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
475
Insert String
String Processing Insert String
LD/FBD language
notation
Input string Output
INSERT
IN1
IN2
P
Insertion character string
Insert position
EN input Edge execution Index modification Modifier
ST language notation INSERT( IN1, IN2, P, Output );
Arguments
Arg. Operand Type Const. Description Remarks
IN1 STRING Input string
IN2 STRING
Insertion
character
string
Input
P UINT
Insertion
position
Output STRING Output
Function
Inserts the insertion string IN2 at insertion position P of the input string IN1 and outputs
the result.
Direct I/O variable cannot be specified for the input string variable and output variable.
Program example
[LD/FBD language notation]
SAMPLE1
LD
INSERT
IN
L
P
SAMPLE4
ST
Input string Inserted string
SAMPLE2
3
LD
Insert string
SAMPLE3
1
LD
D E F G
B C A
1
Insert position
B C A D E F G
[ST language notation]
INSERT( SAMPLE1, SAMPLE2, SAMPLE3, SAMPLE4);
Chapter 2 LD/FBD Instructions
6F8C1226
476
Inserts the insertion character string "DEFG" in SAMPLE2 into string "ABC" in
SAMPLE1 at insertion position "1" specified by SAMPLE3 and stores the result
"ADEFGBC" in SAMPLE4.
Error information
When the input string variable and output variable exceed the variable area, the insert
string is not processed and the data boundary is exceeded.
If number of characters in insertion string IN1 is less than Insertion position P, insertion string is
inserted at the end of the input string IN1.
If the insertion position P is "0", IN2 is inserted at the start of the input string IN1.
If the string length after insertion exceeds the output string variable size, the result is
unchanged.
The following operation is performed when direct I/O variable is specified for the input
string variable and output variable:
Controller Action
Integrated Controller V series
Insert string is not executed.
Error flag is set to TRUE(ON).
Unified Controller nv series
Insert string is not executed.
Error flag and table operation error flag are set to
TRUE(ON).
When EN is used, ENO output is reset to FALSE(OFF) only when the string size is
exceeded or when the string variable is specified as direct I/O.
2.18 String Processing
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
477
Delete String
String Processing Delete String
LD/FBD language
notation
Input string Output
DELETE
IN
L
P
Deletion character length
Delete position
EN input Edge execution Index modification Modifier
ST language notation DELETE( IN, L, P, Output );
Arguments
Arg. Operand Type Const. Description Remarks
IN STRING Input string
L UINT
Deletion
character
length
Input
P UINT
Delete position
Output STRING Output
Function
Deletes a string of length L from the deletion position P of the input string IN and
outputs the result.
Direct I/O variable cannot be specified for the input string variable and output variable.
Program example
[LD/FBD language notation]
SAMPLE1
LD
DELETE
IN
L
P
SAMPLE4
ST
Input string Deleted string
SAMPLE2
4
LD
SAMPLE3
3
LD
B G A
3
Delete position
F G A B C D E
4
Deletion character length
[ST language notation]
DELETE( SAMPLE1, SAMPLE2, SAMPLE3, SAMPLE4);
Deletes the number of characters specified by deletion character length "4" in
SAMPLE2 from string "ABCDEFG" in SAMPLE1 starting from delete position "3"
specified by SAMPLE3 and stores the result "ABG" in SAMPLE4.
Chapter 2 LD/FBD Instructions
6F8C1226
478
Error information
When the input string variable and output variable exceed the variable area, the delete
string is not processed and the data boundary is exceeded.
If number of characters from delete position P is less than deletion character length, the entire
string starting at position P is deleted.
If Input string length is less than delete position P, the input string is output unchanged.
The following operation is performed when direct I/O variable is specified for the input
string variable and output variable:
Controller Action
Integrated Controller V series
Delete string is not executed.
Error flag is set to TRUE(ON).
When EN is used, ENO output is reset to
FALSE(OFF).
Unified Controller nv series
Delete string is not executed.
Error flag and table operation error flag are set to
TRUE(ON).
When EN is used, ENO output is reset to FALSE(OFF).
2.18 String Processing
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
479
Replace String
String Processing Replace String
LD/FBD language
notation
Input string Output
REPLACE
IN1
IN2
L
P
Replacement character string
Replacement character length
Replacement position
EN input Edge execution Index modification Modifier
ST language notation REPLACE( IN1, IN2, L, P, Output );
Arguments
Arg. Operand Type Const. Description Remarks
IN1 STRING Input string
IN2 STRING
Replacement
character
string
L UINT
Replacement
character
length
Input
P UINT
Replacement
position
Output STRING Output
Function
Replaces a string of length L starting at replacement position P of the input string IN1
with replacement character string IN2 and outputs the result.
Direct I/O variable cannot be specified for the input string variable and output variable.
Program example
[LD/FBD language notation]
SAMPLE1
LD
REPLACE SAMPLE5
ST
Input string Replaced string
SAMPLE2
LD
SAMPLE3
4
LD
Y Z X
3
Replace position
F G A B C D E
4
Replacement character length
IN1
IN2
L
SAMPLE4
3
LD
P
Replace character string
G A B X Y Z
Chapter 2 LD/FBD Instructions
6F8C1226
480
[ST language notation]
REPLACE( SAMPLE1, SAMPLE2, SAMPLE3, SAMPLE4, SAMPLE5);
For string "ABCDEFG" specified by SAMPLE1, replaces the number of characters
specified by replacement character length in SAMPLE3 starting at Replacement
position 3 specified by SAMPLE4 with the replacement string "XYZ" specified by
SAMPLE2 and stores the result "ABXYZG" in SAMPLE5.
Error information
When the input string variable and output variable exceed the variable area, the
replace string is not processed and the data boundary is exceeded.
If Input string length is less than replacement position P, the replacement string is output
following the Input string.
If the string length after replacement exceeds the output string variable size, the result is
unchanged.
The following operation is performed when direct I/O variable is specified for the input
string variable and output variable:
Controller Action
Integrated Controller
V series
Replace string is not executed.
Error flag is set to TRUE(ON).
Unified Controller nv series
Replace string is not executed.
Error flag and table operation error are set to TRUE(ON).
When EN is used, ENO output is reset to FALSE(OFF) only when the string size is
exceeded or when the string variable is specified as direct I/O.
2.18 String Processing
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
481
Find String
String Processing Find String
LD/FBD language
notation
Input string Output
FIND
IN1
IN2 Search character string
EN input Edge execution Index modification Modifier
ST language notation Output := FIND( IN1, IN2 );
Arguments
Arg. Operand Type Const. Description Remarks
IN1 STRING Input string
Input
IN2 STRING
Search
character
string
Output UINT Output
Function
Searches the search character string IN2 from the input string IN1 and outputs the first
found string position.
If a matching string cannot be found, 0 is output.
Direct I/O variable cannot be specified for the input string variable.
Program example
[LD/FBD language notation]
SAMPLE1
LD
FIND
IN1
IN2
SAMPLE3
3
ST
Input string Search result
SAMPLE2
LD
Search string
3 B C D E F G A
C D
[ST language notation]
SAMPLE3 := FIND( SAMPLE1, SAMPLE2);
Searches the string "CD" specified by SAMPLE2 from the string "ABCDEFG" in
SAMPLE1 and stores the result 3 in SAMPLE3.
Chapter 2 LD/FBD Instructions
6F8C1226
482
Error information
When the input string variable exceeds the variable area, the find string is not
processed and the data boundary is exceeded.
The following operation is performed when direct I/O variable is specified for the input
string variable:
Controller Action
Integrated Controller V series
Result=0.
Error flag is set to TRUE(ON).
Unified Controller nv series
Result=0.
Error flag and table operation error flag are set to
TRUE(ON).
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
2.18 String Processing
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
483
Define String
String Processing Define String
LD/FBD language
notation
String byte count input Output
DEF_STRING
EN input Edge execution Index modification Modifier
ST language notation DEF_STRING( String byte count input, Output );
Arguments
Arg. Operand Type Const. Description Remarks
Input UINT
Comparison data
Function
If the content of index register specified with the CASE statement and the content of
comparison data are equal, the code following the[ : ]instruction is executed.
The CASE condition is not evaluated after executing the code following
the[ : ]instruction. (This is equivalent to the C language break statement.)
The comparison data may be specified using variables or constants.
Condition Action
Index register=Comparison data Executes the code following:
Index registerComparison data Does not execute the code following:
Program example
[LD/FBD language notation]
CASE
END_CASE
ADD_INT
SAMPLE2
SAMPLE3
SAMPLE4
Process 1
SUB_INT
SAMPLE2
SAMPLE3
SAMPLE4
Process 2
INDEX XI
.. :
20 30
:
SAMPLE1
Chapter 2 LD/FBD Instructions
6F8C1226
498
[ST language notation]
CASE XI OF
SAMPLE1:
SAMPLE4 := ADD_INT( SAMPLE2, SAMPLE3);
20..30:
SAMPLE4 := SUB_INT( SAMPLE2, SAMPLE3);
END_CASE;
Process 1
Process 2
XI=SAMPLE1?
FALSE
TRUE
20XI30?
FALSE
TRUE
If the content of index register XI, which is the condition value, is equal to the content
of SAMPLE1, Process 1 (addition) is performed and if the content of index register XI
is between "20" and "30" Process 2 (subtraction) is performed.
2.19 Control Statements
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
499
.. :
Control Statements .. :
LD/FBD language
notation
.. :
Comparison data 1 Comparison data 2
EN input Edge execution Index modification Modifier
ST language notation (Comparison data 1 ) .. (Comparison data 2 ) :
Arguments
Arg. Operand Type Const. Description Remarks
DINT
Comparison data 1
Input
DINT
Comparison data 2
Function
When the content of index register specified with the CASE statement is between
Comparison Data 1 and Comparison Data 2, the code following the[ .. : ]instruction is
executed. The CASE condition is not evaluated after executing the code following
the[ .. : ]instruction. (This is equivalent to the C language break statement.)
Comparison Data 1 and Comparison Data 2 may be specified using variables or
constants.
Condition Action
Index register is between Comparison Data 1 and Comparison
Data 2
Executes the code
following .. :
Index register is outside Comparison Data 1 and Comparison
Data 2
Does not execute the
code following .. :
Chapter 2 LD/FBD Instructions
6F8C1226
500
Program example
[LD/FBD language notation]
CASE
END_CASE
ADD_INT
SAMPLE2
SAMPLE3
SAMPLE4
Process 1
SUB_INT
SAMPLE2
SAMPLE3
SAMPLE4
Process 2
INDEX XI
.. :
20 30
:
SAMPLE1
[ST language notation]
CASE XI OF
SAMPLE1:
SAMPLE4 := ADD_INT( SAMPLE2, SAMPLE3);
20..30:
SAMPLE4 := SUB_INT( SAMPLE2, SAMPLE3);
END_CASE;
Process 1
Process 2
XI=SAMPLE1?
FALSE
TRUE
20XI30?
FALSE
TRUE
If the content of index register XI, which is the condition value, is equal to the content
of SAMPLE1, Process 1 (addition) is performed and if the content of index register XI
is greater than or equal to "20" and less than or equal to "30," Process 2 (subtraction)
is performed.
2.19 Control Statements
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
501
,
Control Statements ,
LD/FBD language
notation
,
Comparison data
EN input Edge execution Index modification Modifier
ST language notation ( Comparison data ) , (Comparison data ) :
Arguments
Arg. Operand Type Const. Description Remarks
Input DINT
Comparison data
Function
Used to enumerate comparison data in CASE statement.
If the content of index register specified in the CASE statement is equal to the
comparison data or if the subsequent condition is satisfied, the code following the [ ,]
instruction is executed.
The CASE condition is not evaluated after executing the code following the [ ,]
instruction (This is equivalent to the C language break statement).
The comparison data may be specified using variables or constants.
Condition Action
Index register=Comparison data Executes the code following ,
Index registerComparison data Compare the following comparison data
Program example
[LD/FBD language notation]
CASE
END_CASE
ADD_INT
SAMPLE3
SAMPLE4
SAMPLE5
Process 1
SUB_INT
SAMPLE3
SAMPLE4
SAMPLE5
Process 2
INDEX XI
.. :
20 30
,
SAMPLE1
:
SAMPLE2
Chapter 2 LD/FBD Instructions
6F8C1226
502
[ST language notation]
CASE XI OF
SAMPLE1, SAMPLE2:
SAMPLE5 := ADD_INT( SAMPLE3 , SAMPLE4);
20..30:
SAMPLE5 := SUB_INT( SAMPLE3 , SAMPLE4);
END_CASE;
Process 1
Process 2
XI=SAMPLE1?
FALSE
TRUE
20XI30?
FALSE
TRUE
XI=SAMPLE2?
FALSE
TRUE
If the content of index register XI, which is the condition value, is equal to the content
of SAMPLE1 or equal to SAMPLE2, Process 1 (addition) is performed and if the
content of index register XI is greater than or equal to "20" and less than or equal to
"30," Process 2 (subtraction) is performed.
2.19 Control Statements
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
503
.. ,
Control Statements .. ,
LD/FBD language
notation
.. ,
Comparison data 1 Comparison data 2
EN input Edge execution Index modification Modifier
ST language notation (Comparison data 1 ) .. (Comparison data 2 ) , (Comparison data) :
Arguments
Arg. Operand Type Const. Description Remarks
DINT
Comparison data 1
Input
DINT
Comparison data 2
Function
Used to enumerate comparison data in CASE statement.
If the content of index register specified in the CASE statement is between
Comparison Data 1 and Comparison Data 2 or if the subsequent condition is satisfied,
the code following the[ .., ]instruction is executed.
The CASE condition is not evaluated after executing the code following the[ .. ,]
instruction (This is equivalent to the C language break statement).
Comparison Data 1 and Comparison Data 2 may be specified using variables or
constants.
Condition Action
Index register is between Comparison Data 1 and Comparison Data 2
Executes the code
following .. ,
Index register is outside Comparison Data 1 and Comparison Data 2
Compare the following
comparison data
Chapter 2 LD/FBD Instructions
6F8C1226
504
Program example
[LD/FBD language notation]
CASE
END_CASE
ADD_INT
SAMPLE3
SAMPLE4
SAMPLE5
Process 1
SUB_INT
SAMPLE3
SAMPLE4
SAMPLE5
Process 2
INDEX XI
.. ,
20 30
:
SAMPLE2
:
SAMPLE1
[ST language notation]
CASE XI OF
SAMPLE1:
SAMPLE5 := ADD_INT( SAMPLE3, SAMPLE4);
20..30, SAMPLE2:
SAMPLE5 := SUB_INT( SAMPLE3, SAMPLE4);
END_CASE;
Process1
Process 2
XI=SAMPLE1?
FALSE
TRUE
20XI30?
FALSE
TRUE
XI=SAMPLE2?
FALSE
TRUE
If the content of index register XI, which is the condition value, is equal to the content
of SAMPLE1, Process 1 (addition) is performed and if the content of index register XI
is greater than or equal to "20" and less than or equal to "30" or equal to variable
SAMPLE2, Process 2 (subtraction) is performed.
2.19 Control Statements
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
505
ELSE (CASE statement)
Control Statements ELSE (CASE statement)
LD/FBD language
notation
ELSE
EN input Edge execution Index modification Modifier
ST language notation ELSE
Function
If the content of the index register in the CASE statement does not satisfy any of the
specified conditions, the code following the ELSE statement is executed (This is
equivalent to the C language default statement).
Condition Action
Index register satisfies the condition with the previous
comparison data
Does not execute the code
following ELSE.
Index register does not satisfy the condition with the previous
comparison data
Executes the code following
ELSE.
Program example
[LD/FBD language notation]
CASE
ELSE
ADD_INT
SAMPLE3
SAMPLE4
SAMPLE5
Process 1
SUB_INT
SAMPLE3
SAMPLE4
SAMPLE5
Process 2
INDEX XI
.. ,
20 30
:
SAMPLE2
:
SAMPLE1
END_CASE
MUL_INT
SAMPLE3
SAMPLE4
SAMPLE5
Process 3
Chapter 2 LD/FBD Instructions
6F8C1226
506
[ST language notation]
CASE XI OF
SAMPLE1:
SAMPLE5 := ADD_INT( SAMPLE3, SAMPLE4);
20..30, SAMPLE2:
SAMPLE5 := SUB_INT( SAMPLE3, SAMPLE4);
ELSE
SAMPLE5 := MUL_INT( SAMPLE3, SAMPLE4);
END_CASE;
Process 1
Process 2
XI=SAMPLE1?
FALSE
TRUE
20XI30?
FALSE
TRUE
XI=SAMPLE2?
FALSE
TRUE
Process 3
If the content of index register XI, which is the condition value, is equal to the content
of SAMPLE1, Process 1 (addition) is performed and if the content of Index Register XI
is greater than or equal to "20" and less than or equal to "30" or equal to SAMPLE2,
Process 2 (subtraction) is performed. Otherwise, Process 3 (multiplication) is
performed.
2.19 Control Statements
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
507
END_CASE
Control Statements END_CASE
LD/FBD language
notation
END_CASE
EN input Edge execution Index modification Modifier
ST language notation END_CASE
Function
Indicates the end of CASE statement.
Program example
[LD/FBD language notation]
CASE
END_CASE
ADD_INT
SAMPLE1
SAMPLE2
SAMPLE3
Process 1
SUB_INT
SAMPLE1
SAMPLE2
SAMPLE3
Process 2
INDEX XI
.. :
20 30
:
10
[ST language notation]
CASE XI OF
10:
SAMPLE3 := ADD_INT( SAMPLE1, SAMPLE2);
20..30:
SAMPLE3 := SUB_INT( SAMPLE1, SAMPLE2);
END_CASE;
Chapter 2 LD/FBD Instructions
6F8C1226
508
Process 1
Process 2
XI=10?
FALSE
TRUE
20XI30?
FALSE
TRUE
If the content of index register XI, which is the condition value, is "10," Process 1
(addition) is performed and if the content of index register XI is greater than or equal
to "20" and less than or equal to "30," Process 2 (subtraction) is performed.
2.19 Control Statements
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
509
FOR_DO
Control Statements FOR_DO
LD/FBD language
notation
FOR_DO
INDEX MIN MAX STEP
EN input Edge execution Index modification Modifier
ST language notation FOR ( INDEX ) := ( MIN ) TO ( MAX ) BY ( STEP ) DO
Arguments
Arg. Operand Type Const. Description
Rem
arks
INDEX DINT Index register specification (repeat count)
MIN DINT
Increment input
Function
Indicates the start of FOR statement and sets the loop condition.
The instructions between FOR_DO and END_FOR are repeated until the loop count in
index register reaches the final value.
The loop condition is specified using the index register, which specifies the loop count
INDEX, and variables or constants specifying the initial value MIN, final value MAX,
and increment STEP.
Condition Action
Index register content > Final value End repetition
Index register content Final value Repeats instruction between FOR_DO and
END_FOR
Program example
[LD/FBD language notation]
FOR_DO
END_FOR
ADD_INT
SAMPLE1
SAMPLE2
SAMPLE3
Process 1
INDEX XI MIN 0 MAX 9 STEP 1
[ST language notation]
FOR XI := 0 TO 9 BY 1 DO
SAMPLE3 := ADD_INT( SAMPLE1, SAMPLE2);
END_FOR;
Chapter 2 LD/FBD Instructions
6F8C1226
510
XI=XI+1
Process 1
XI9?
FALSE
TRUE
XI =0
Process 1 (addition) is repeated until the loop count in index register XI exceeds "9".
2.19 Control Statements
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
511
EXIT (FOR statement)
Control Statements EXIT (FOR statement)
LD/FBD language
notation
EXIT
EN input Edge execution Index modification Modifier
ST language notation EXIT
Function
Forces end of FOR statement.
Program example
[LD/FBD language notation]
SIGNAL2
FOR_DO
ADD_INT
EN ENO
SAMPLE1
SAMPLE2
SAMPLE3
Process 1
INDEX XI MIN 0 MAX 9 STEP 1
SIGNAL1
END_FOR
IF
SIGNAL3
THEN
EXIT
END_IF
Process 2
SIGNAL2
[ST language notation]
FOR XI := 0 TO 9 BY 1 DO
IF SIGNAL2 THEN
EXIT;
END_IF;
END_FOR;
Chapter 2 LD/FBD Instructions
6F8C1226
512
XI=XI+1
Process 1
XI9?
FALSE
TRUE
SIGNAL2?
FALSE
TRUE
XI =0
Process 1 (addition) is repeated until the loop count in index register XI exceeds"9",
but the FOR statement is terminated if the SIGNAL2 in the IF statement is TRUE(ON).
2.19 Control Statements
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
513
END_FOR
Control Statements END_FOR
LD/FBD language
notation
END_FOR
EN input Edge execution Index modification Modifier
ST language notation END_FOR
Function
Indicates the end of FOR statement.
Program example
[LD/FBD language notation]
FOR_DO
END_FOR
ADD_INT
SAMPLE1
SAMPLE2
SAMPLE3
Process 1
INDEX XI MIN 0 MAX 9 STEP 1
[ST language notation]
FOR XI := 0 TO 9 BY 1 DO
SAMPLE3 := ADD_INT( SAMPLE1, SAMPLE2);
END_FOR;
XI=XI+1
Process 1
XI9?
FALSE
TRUE
XI =0
Process 1 (addition) is repeated until the loop count in index register XI exceeds "9".
Chapter 2 LD/FBD Instructions
6F8C1226
514
WHILE
Control Statements WHILE
LD/FBD language
notation
WHILE
EN input Edge execution Index modification Modifier
ST language notation WHILE
Function
Indicates the start of WHILE statement.
A condition expression is described between WHILE and DO. The code between DO
and END_WHILE is executed while the condition expression is TRUE(ON) and jumps
to code following END_WHILE when the condition expression becomes FALSE(OFF).
The condition expression following WHILE must contain instruction that outputs BOOL
type result such as bit sequence instructions, compare instructions, or logical
operation instructions).
Program example
[LD/FBD language notation]
WHILE
DO
END_WHILE
SIGNAL2 SIGNAL1 SIGNAL3
ADD_INT
SAMPLE1
SAMPLE2
SAMPLE3
Condition expression
Process 1
[ST language notation]
WHILE SIGNAL1 AND SIGNAL2 DO
SAMPLE3 := ADD_INT( SAMPLE1, SAMPLE2);
END_WHILE;
Process 1 (addition) is repeated if the states of
SIGNAL1 and SIGNAL2, which are the
condition expression, are both TRUE(ON).
Otherwise, jumps to the code following the
END_WHILE statement.
Process 1
Condition
expression
TRUE
FALSE
2.19 Control Statements
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
515
DO
Control Statements DO
LD/FBD language
notation
DO
EN input Edge execution Index modification Modifier
ST language notation DO
Function
The following table shows the processing when the condition expression in a WHILE
statement is satisfied:
Condition Action
Condition expression is satisfied
(TRUE(ON))
Executes the code between DO and
END_WHILE
Condition expression is not
satisfied (FALSE(OFF))
Does not execute the code between DO
and END_WHILE
Program example
[LD/FBD language notation]
WHILE
DO
END_WHILE
SIGNAL2 SIGNAL1 SIGNAL3
ADD_INT
SAMPLE1
SAMPLE2
SAMPLE3
Condition expression
Process 1
[ST language notation]
WHILE SIGNAL1 AND SIGNAL2 DO
SAMPLE3 := ADD_INT( SAMPLE1, SAMPLE2);
END_WHILE;
Process 1 (addition) is repeated if the states of
SIGNAL1 and SIGNAL2, which are the
condition expression, are both TRUE(ON).
Otherwise, jumps to the code following the
END_WHILE statement.
Process 1
Condition
expression
TRUE
FALSE
Chapter 2 LD/FBD Instructions
6F8C1226
516
EXIT (WHILE statement)
Control Statements EXIT (WHILE statement)
LD/FBD language
notation
EXIT
EN input Edge execution Index modification Modifier
ST language notation EXIT
Function
Forces end of WHILE statement.
Program example
[LD/FBD language notation]
WHILE
SIGNAL4
ADD_INT
EN ENO
SAMPLE1
SAMPLE2
SAMPLE3
Process 1
SIGNAL3
END_WHILE
IF
THEN
EXIT
END_IF
Process 2
SIGNAL5
SIGNAL4
DO
SIGNAL2
SIGNAL1
[ST language notation]
WHILE SIGNAL1 DO
IF SIGNAL4 THEN
EXIT;
END_IF;
END_WHILE;
2.19 Control Statements
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
517
Process 1
SIGNAL1?
TRUE
FALSE
SIGNAL4?
FALSE
TRUE
Process 1 (addition) is repeated while SIGNAL1, which is the condition expression, is
TRUE(ON), but if the SIGNAL4 in the IF statement is TRUE(ON), termination of the
WHILE statement is forced and jumps to the code following the END_WHILE
statement.
Chapter 2 LD/FBD Instructions
6F8C1226
518
END_WHILE
Control Statements END_WHILE
LD/FBD language
notation
END_WHILE
EN input Edge execution Index modification Modifier
ST language notation END_WHILE
Function
Indicates the end of WHILE statement.
Program example
[LD/FBD language notation]
WHILE
DO
END_WHILE
SIGNAL2 SIGNAL1 SIGNAL3
ADD_INT
SAMPLE1
SAMPLE2
SAMPLE3
Condition expression
Process 1
[ST language notation]
WHILE SIGNAL1 AND SIGNAL2 DO
SAMPLE3 := ADD_INT( SAMPLE1, SAMPLE2);
END_WHILE;
Process 1
Condition
expression
TRUE
FALSE
Process 1 (addition) is repeated if the states of SIGNAL1 and SIGNAL2, which are the
condition expression, are both TRUE(ON). Otherwise, jumps to the code following
the END_WHILE statement.
2.19 Control Statements
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
519
REPEAT
Control Statements REPEAT
LD/FBD language
notation
REPEAT
EN input Edge execution Index modification Modifier
ST language notation REPEAT
Function
Indicates the start of REPEAT statement.
Processing is described between REPEAT and UNTIL. The code between REPEAT
and UNTIL is executed while the condition expression following UNTIL is FALSE(OFF)
and jumps to code following END_REPEAT when it becomes TRUE(ON).
The condition expression following UNTIL must contain instruction that outputs BOOL
type result (such as bit sequence instructions, compare instructions, or logical
operation instructions).
Program example
[LD/FBD language notation]
REPEAT
UNTIL
END_REPEAT
SIGNAL2 SIGNAL1 SIGNAL3
Condition expression
ADD_INT
SAMPLE1
SAMPLE2
SAMPLE3
Process 1
[ST language notation]
REPEAT
SAMPLE3 := ADD_INT( SAMPLE1, SAMPLE2);
UNTIL SIGNAL1 AND SIGNAL2
END_REPEAT;
Process 1
Condition
expression
TRUE
FALSE
Process 1 (addition) is repeated if the states of
SIGNAL1 and SIGNAL2, which are the condition
expression, are not both TRUE(ON). If the states
of SIGNAL1 and SIGNAL2 are both TRUE(ON),
jumps to the code following the END_REPEAT
statement without looping.
Chapter 2 LD/FBD Instructions
6F8C1226
520
UNTIL
Control Statements UNTIL
LD/FBD language
notation
UNTIL
EN input Edge execution Index modification Modifier
ST language notation UNTIL
Function
Indicates the start of the condition expression of REPEAT statement.
Condition Action
Condition expression is satisfied
TRUE(ON)
Ends REPEAT - UNTIL loop
Condition expression is not
satisfied FALSE(OFF)
Executes the code between
REPEAT and UNTIL
Program example
[LD/FBD language notation]
REPEAT
UNTIL
END_REPEAT
SIGNAL2 SIGNAL1 SIGNAL3
Condition
expression
ADD_INT
SAMPLE1
SAMPLE2
SAMPLE3
Process 1
[ST language notation]
REPEAT
SAMPLE3 := ADD_INT( SAMPLE1, SAMPLE2);
UNTIL SIGNAL1 AND SIGNAL2
END_REPEAT;
Process 1 (addition) is repeated if the states of
SIGNAL1 and SIGNAL2, which are the condition
expression, are not both TRUE(ON). If the
states of SIGNAL1 and SIGNAL2 are both
TRUE(ON), jumps to the code following the
END_REPEAT statement without looping.
Process 1
Condition
expression
TRUE
FALSE
2.19 Control Statements
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
521
EXIT (REPEAT statement)
Control Statements EXIT (REPEAT statement)
LD/FBD language
notation
EXIT
EN input Edge execution Index modification Modifier
ST language notation EXIT
Function
Forces end of REPEAT statement.
Program example
[LD/FBD language notation]
REPEAT
END_REPEAT
SIGNAL4
ADD_INT
EN ENO
SAMPLE1
SAMPLE2
SAMPLE3
Process 1
SIGNAL3
IF
THEN
EXIT
END_IF
Process 2
SIGNAL5
SIGNAL4
UNTIL
SIGNAL2
SIGNAL1
[ST language notation]
REPEAT
IF SIGNAL4 THEN
EXIT;
END_IF;
UNTIL SIGNAL1
END_REPEAT;
Chapter 2 LD/FBD Instructions
6F8C1226
522
Process 1
SIGNAL1?
FALSE
TRUE
SIGNAL4?
FALSE
TRUE
Process 1 (addition) is repeated while SIGNAL1, which is the condition expression, is
FALSE(OFF), but if the SIGNAL4 in the IF statement is TRUE(ON), termination of the
REPEAT statement is forced and jumps to the code following the END_REPEAT
statement.
2.19 Control Statements
Unified Controller nv seriesIntegrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
523
END_REPEAT
Control Statements END_REPEAT
LD/FBD language
notation
END_REPEAT
EN input Edge execution Index modification Modifier
ST language notation END_REPEAT
Function
Indicates the end of REPEAT statement.
Program example
[LD/FBD language notation]
REPEAT
UNTIL
END_REPEAT
SIGNAL2 SIGNAL1 SIGNAL3
Condition
expression
ADD_INT
SAMPLE1
SAMPLE2
SAMPLE3
Process 1
[ST language notation]
REPEAT
SAMPLE3 := ADD_INT( SAMPLE1, SAMPLE2);
UNTIL SIGNAL1 AND SIGNAL2
END_REPEAT;
Process 1
Condition
expression
TRUE
FALSE
Process 1 (addition) is repeated if the states of SIGNAL1 and SIGNAL2, which are the
condition expression, are not both TRUE(ON). If the states of SIGNAL1 and
SIGNAL2 are both TRUE(ON), jumps to the code following the END_REPEAT
statement without looping.
Chapter 2 LD/FBD Instructions
6F8C1226
524
2.20 Communication
No. Instruction Remarks
1
Socket Communication Send
USEND_T V dedicated instruction
2 Socket Communication Send USEND_N nv dedicated instruction
3
Socket Communication Receive
URCV_T V dedicated instruction
4 Socket Communication Receive URCV_N nv dedicated instruction
5
Communication FB (XMIT_T) XMIT_T V dedicated instruction
6 Communication FB (XMIT_N) XMIT_N nv dedicated instruction
Note
Socket communication instruction for Integrated Controller is USEND_T/URCV_T and socket
communication instruction for Unified Controller is USEND_N/URCV_N.
When using an Integrated Controller user application for Unified Controller, the socket
communication instructions and commands must be changed.
The following items must be remembered to change USEND_T/URCV_T into
USEND_N/URCV_N.
Change in socket communication instruction
Socket communication send: USEND_TUSEND_N
Socket communication receive: URCV_TURCV_N
Instruction instances are stored in different areas:
USEND_T/URCV_T instance: static variable area
USEND_N/URCV_N instance: nontracking type, static variable area
Since the referential description of the output argument differs, refer to the [ST language
notation]of the instruction manual.
When using socket communication with duplex system, see Notes for duplex system in this
section.
Integrated Controller: application of EN7** to Unified Controller EN8**
For EN7** and EN8**, the instructions and referential description of the output arguments
must be changed.
Integrated Controller: application of EN311 to Unified Controller EN911
For EN311 and EN911, the socket communication instructions, command contents (command
structure, command number) and referential description of the output arguments must be
changed.
2.20 Communication
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
525
Socket Communication Send
Communication Socket Communication Send
V dedicated
instruction
LD/FBD language
notation
Completion output
Send command
Send data word number
Send data
Execution request
USEND_T
REQ
CMD
P
N
Error
Socket no. or error status
Instance name
DONE
ERROR
STATUS
EN input Edge execution Index modification Modifier
ST language notation [Instance name]( REQ, CMD, P, N );
[Variable name]:=[Instance name]. DONE;
[Variable name]:=[Instance name]. ERROR;
[Variable name]:=[Instance name]. STATUS;
Arguments
Arg. Operand Type Const. Description Valid range
REQ BOOL
Execution request
CMD PTR Send command
P PTR Send data
Send data word number
(Send word command)
1 to 1000 words
Input
N UINT
Send data bytes number
(Send bytes command)
1 to 2000 bytes
DONE BOOL Completion output
ERROR BOOL Error Output
STATUS INT Socket No. or error status
Send command data structure
15 0
Requested Ethernet module slot no.
Socket service command
Requested parameter
(See below for details)
Chapter 2 LD/FBD Instructions
6F8C1226
526
Instance structure
Name Type Description Remarks
DONE BOOL Completion output
ERROR BOOL Error
STATUS INT Socket No. or error status
Can be accessed from the user
program.
TIMECNT DINT Time count
RESERVE DWORD Reserved
Cannot be accessed from the
user program.
Restrictions
Integrated Controller V series
Item
S3 S2 L3 L2 L1
# of Ethernet modules/stations 4 1
# of sockets/Ethernet modules 12
Single bus Yes Yes Yes Yes Yes
TCP/IP
Duplex bus No No Yes Yes No
Single bus Yes Yes Yes Yes Yes
Protocol
UDP/IP
Duplex bus Yes Yes Yes Yes No
Transferred text size/socket
Send word command: 1000 words
Send bytes command: 2000 bytes
Function
This is a function block that communicates with TCP/IP or UDP/IP protocol using the
Ethernet module.
When the execution request REQ changes from FALSE(OFF) to TRUE(ON), N words
starting from send data P are sent with the content of the specified send command
CMD.
Word send command: send data word number is 1 to 1000, byte send command: can
be specified from 1 to 2000 bytes.
When data transfer completes, completion output DONE is kept TRUE(ON) for one
scan time.
If an error occurs, ERROR is kept TRUE(ON) for one scan time.
When transfer completes successfully or unsuccessfully, Socket No. or error status
STATUS contains the detailed completion information.
The instruction completes successfully (DONE=ON) starting from the second scan
after execution request (REQ=ON). Therefore, depending on how the control cycle is
set and application program is created, it may take several seconds before normal
completion.
The request command differs according to Ethernet module. Following sections
describe request commands. Also, a list of error status codes is included after the
URCV_T instruction (Error Status Code List).
Notes on using this communication function block instruction in a duplex system are
included after the Error Status Code List (Notes for duplex system).
2.20 Communication
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
527
Ethernet module type and request command type
Model
Module execution
location
Bus type Module name Request command type*
Single EN711, EN731, EN751* Single bus request command
Main unit
Duplex
EN721, EN741, EN761
FN711*
Single bus request command and
duplex bus request command
3000
Parallel I/O unit Single EN311 EN311 request command
Single EN611, EN631, EN651* Single bus request command
2000 Main unit
Duplex
EN621/EB621,
EN641/EB641, EN661
FN611
Single bus request command and
duplex bus request command
1000 Main unit Single EN531* Single bus request command
Notes on request command type
Both the single bus request command and duplex bus request command may be used for duplex bus
(EN721, EN741, EN761, FN711*, EN621/EB621, EN641/EB641, EN661, FN611), but the duplex bus
request command cannot be used for single bus (EN711, EN731, EN751, EN611, EN631, EN651*, EN531*).
Be sure to use a single bus request command.
When the destination is single bus, use a single bus request command even if the source Ethernet module
is duplex bus.
Single bus request command
: Available /: Unavailable
Command description Command S3 S2 L3 L2 L1
Reset request 16#0011
: Available/: Unavailable
Command description Command S3 S2 L3 L2 L1
UDP open request 16#0231
UDP send request / broadcast 16#0232
UDP close request 16#0234
TCP open request 16#0235
TCP send request 16#0237
TCP close request 16#0239
EN311 request command
: Available /: Unavailable
Command description Command S3 S2 L3 L2 L1
Reset request 16#0311
Parameter setting request 16#0312
Operation mode control request 16#0313
Other station confirmed request 16#0314
Time setting request 16#0318
Router IP address setting request 16#0319
PC link (register write request) 16#0321
UDP open request 16#0331
UDP send request / broadcast 16#0332
UDP close request 16#0334
TCP open request 16#0335
TCP send request 16#0337
TCP close request 16#0339
Single bus/duplex bus request command
The single bus request command and duplex bus request command have different command
numbers, but their structure is the same. They will be described together.
Reset request
Resets the Ethernet module from the user program.
The request command and error status are as follows:
15 0
Requested Ethernet module slot No.
Command (16#0011)
<Request command>
<Error status>
15 0
=0: Normal complete, 0: Error status
2.20 Communication
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
529
Remote station verification request
Verifies the existence of the specified station (Equivalent to Ping).
The structure of the request command and the socket No. or error status are as
follows:
Notes on duplex bus Ethernet module: The "Other station confirmed request" is not a
duplex bus request command. Make the request by specifying the IP address for
both Ethernet A and B systems. Program according to the system request
specification (such as the command is successful if either A or B is successful/the
command is successful if both A and B are successful).
Socket batch close request
The source controller closes all the opening sockets for the Ethernet module specified
by the requested Ethernet module slot No.
This command is supported by the following versions of S3 Controller.
S3 Controller Support version
S3PU55/S3PU55/S3PU65 (Single/Duplex) V02.7J and following versions
S3PU65 (Duplex reliability improvement version) V03.7E and following versions
The request command structure and error status are as follows:
15 0
Requested Ethernet module slot No.
Command (16#001B)
<Request command>
<Error status>
15 0
=0: Normal completer, 0: Error status
15 0
Requested Ethernet module slot No.
Command (16#0014)
<Request command>
<Error status>
15 0
=0: Normal complete, 0: Error status
D-IP address
D-IP address : Destination IP address to be verified
Chapter 2 LD/FBD Instructions
6F8C1226
530
UDP open request
Opens the requested socket.
Communication protocol: UDP/IP
Socket No. is set in STATUS when UDP completes successfully (DONE=ON). This
socket No. is used to obtain the send, receive, close, and EN board control socket
identifier.
15 0
Requested Ethernet module slot No.
Command (16#0031)/Duplex (16#0231)
<Request command>
<Socket No. or error status>
15 0
Socket No. (0 to 11), error status
UDPPort No. : UDP port No. of the specified source socket (1024 to 65535)
UDPPort No.
2.20 Communication
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
531
UDP send request/broadcast send request
Sends source data using the opened UDP socket.
Number of transferred data words: 1 to 1000
UDP close request
Ends the opened UDP sockets. Also cancels receive requests (unlimited wait state).
15 0
Requested Ethernet module slot No.
Command (16#0034)/Duplex (16#0234)
<Request command>
<Error status>
15 0
0: Normal complete, 0: Error status
Socket No. :Socket ID (0 to 11) (identifier obtained with UDP open)
Socket No.
15 0
Requested Ethernet module slot No.
Command (16#0032)/Duplex (16#0232)
<Request command>
<Error status>
15 0
=0: Normal complete, 0: Error status
Socket No. :Socket ID (0 to 11) (identifier obtained with UDP open)
D-IP address :Destination IP address
Specifying 255.255.255.255 as the destination IP address results in
broadcast send.
D-UDPPort No. :Destination socket UDP port No.
Socket No.
D-IP address
D-UDPPort No.
Chapter 2 LD/FBD Instructions
6F8C1226
532
TCP open request
Opens (active/passive) the requested port.
Communication protocol: TCP/IP
Socket No. is set in STATUS when TCP completes successfully (DONE=ON). This
socket No. is used to obtain the send, receive, close, and EN board control socket identifier.
TCP send request
Sends the source data using the opened TCP connection.
Send data word number: 1 to 1000 words
15 0
Requested Ethernet module slot No.
Command (16#0035)/Duplex (16#0235)
<Request command>
<Socket No. or error status>
15 0
Socket No. (0 to 11), error status
Type
D-IP address
D-TCPPor tNo.
S-TCPPort No.
TimeCnt
Type :Open type (1/2)
1=Active open - client
2=Passive open - server
D-IP address :Destination IP address (valid only for active open)
D-UDPPort No. :Destination socket TCP port No. (valid only for active open)
S-TCPPort No. :Source specified socket TCP port No.
TimeCnt :Receive wait timeout interval (1 to 65535: 0.1 second unit, 0:
unlimited)
(valid only for passive open)
15 0
Requested Ethernet module slot No.
Command (16#0037)/Duplex (16#0237)
<Request command>
<Error status>
15 0
0: Normal complete, 0: Error status
Socket No. :Socket ID (0 to 11) (identifier obtained by TCP open)
Socket No.
2.20 Communication
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
533
TCP close request
Ends an opened TCP connection and closes the socket.
Also cancels open/receive requests (unlimited wait state).
UDP byte send request
Sends source data using the opened UDP socket.
Number of transferred data bytes: 1 to 2000 bytes
15 0
Requested Ethernet module slot No.
Command (16#0042)
<Request command>
<Error status>
15 0
=0: Normal complete, 0: Error status
Socket No. :Socket ID (0 to 11) (identifier obtained by UDP open)
D-IP address : Destination IP address
Specifying 255.255.255.255 as the destination IP address results
in broadcast send.
D-UDPPort No. : Destination socket UDP port No.
Socket No.
D-IP address
D-UDPPort No.
15 0
Requested Ethernet module slot No.
Command (16#0039)/Duplex (16#0239)
<Request command>
<Error status>
15 0
0: Normal complete, 0: Error status
Socket No. :Socket ID (0 to 11) (identifier obtained by TCP open)
Socket No.
Chapter 2 LD/FBD Instructions
6F8C1226
534
TCP byte send request
Sends the source data using the opened TCP connection.
Send data word number: 1 to 2000 bytes
15 0
Requested Ethernet module slot No.
Command (16#0047)
<Request command>
<Error status>
15 0
0: Normal complete, 0: Error status
Socket No. :Socket ID (0 to 11) (identifier obtained by TCP open)
Socket No.
2.20 Communication
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
535
EN311 request commands
Reset request
Resets EN311 from the user program.
The request command structure and error status are as follows:
<Request command>
Error status:
Command (16#0311)
15 0
=0: Normal complete, 0: Error status
15 0
Bus Requested Ethernet module sl ot No. Unit Slot
12 8
Error status 16#EC** (-50**) indicates that the error was detected by the CPU module
and 16#B** indicates that it was detected by the EN311 (* is any number).
Parameter setting request
Sets EN311 parameters for a standy mode EN311 from a user program.
The request command structure and error status are as follows:
<Request command>
S-IP address :Source IP address
UDPPort No. :UDP port No. (1024 to 65535)
<Error status>
Command (16#0312)
S-IP address
15 0
=0: Normal complete 0: Error status
UDPPort No.
15 0
Bus Requested Ethernet module slot No. Unit Slot
12 8
Chapter 2 LD/FBD Instructions
6F8C1226
536
Operation mode control request
Controls the operation of EN311 from the user program.
The request command structure and error status are as follows:
<Request command>
Specified information
Bit13:Changes EN311 from run mode to standby mode.
Bit12:Changes EN311 from standby mode to run mode.
Bit5 :Message transmission 1:Enabled, 0:Disabled
Bit4 :Socket transmission 1:Enabled, 0:Disabled
<Error status>
Command (16#0313)
Specified information
15 0
=0: Normal complete 0: Error status
15 0
Bus Requested Ethernet module slot No. Unit Slot
12 8
Remote station verification request
Verifies the existence of the specified station (Equivalent to Ping).
The request command structure and error status are as follows:
<Request command>
D-IP address :Destination IP address to be verified
Error status:
Command (16#0314)
D-IP address
15 0
=0: Normal completion 0: Error status
15 0
Bus Requested Ethernet module slot No. Unit Slot
12 8
Time setting request
Sets the EN311 internal clock from the user program.
The request command structure and error status are as follows:
<Request command>
<Error status>
Command (16#0318)
Month
15 0
=0: Normal completion 0: Error status
15 0
Bus Requested Ethernet module slot No. Unit Slot
12 8
Year
Hour Date
Second Minute
2.20 Communication
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
537
Router IP address setting request
Sets the router IP address of a standby mode EN311 from the user program.
The request command structure and Error status are as follows:
<Request command>
<Error status>
Command (16#0319)
Router IP address
15 0
=0: Normal complete 0: Error status
15 0
Bus Requested Ethernet module slot No. Unit Slot
12 8
PC link register write request
Writes the data in specified source register into the specified destination register.
15 0
Requested Ethernet module slot
No.
Command (16#0321)
<Request command>
<Error status>
15 0
=0: Normal complete, 0: Error status
Bus Slot Unit
12 8
DRID
Dreg No.
TimeCnt
D-IP address
D-UDPPort No.
DRID :Destination register type code
(Only register D can be specified when the destination is S3).
0=XW/YW
1=W
2=LW
3=RW
4=D
5=F (0 to 32767)
6=F (0 to 65535)
7=T
8=C
9=SW
DRegNo. :Destination register No.
TimeCnt :Timeout interval 1 to 32767 (0.1 second unit) when bit 15=0
Defaults to 30 seconds when bit15=1
D-IP address : Destination IP address
D-UDPPort No. : Destination UDP port No.
Chapter 2 LD/FBD Instructions
6F8C1226
538
UDP open request
Opens the requested socket.
Communication protocol: UDP/IP
<Request command>
Socket No. :Socket ID (1 to 8)
UDPPort No. :UDP port No. of the specified source socket (1024 to 65535)
<Socket No. or error status>
Command (16#0331)
Socket no.
15 0
Socket No. , error status
15 0
Bus
Requested Ethernet module slot No.
Unit Slot
12 8
UDPPort No.
UDP send request / broadcast send request
Sends source data using the opened UDP socket.
Number of transferred data words: 1 to 1000 words
15 0
Requested Ethernet module slot No.
Command (16#0332)
<Request command>
<Error status>
15 0
=0: Normal complete, 0: Error status
Bus Slot Unit
12 8
Socket No.
D-UDPPort No.
Socket No. : Socket ID (1 to 8)
D-IP address :Destination IP address
Specifying 255.255.255.255 as the destination IP address results in
broadcast send.
D-UDPPort No. : Destination socket UDP port No.
D-IP address
2.20 Communication
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
539
UDP close request
Ends the opened UDP sockets. Also cancels receive requests (unlimited wait state).
TCP open request
Opens (active/passive) the requested port.
Communication protocol: TCP/IP
<Request command>
Socket No. :Socket ID (1 to 8)
Type :Open type (1/2)
1=Active open - client
2=Passive open - server
D-IP address :Destination IP address
D-TCPPortNo. :Destination socket TCP port No.
S-TCPPortNo. :Source specified socket TCP port No.
TimeCnt :Receive wait timeout interval (1 to 65535: 0.1 second unit, 0: unlimited)
Socket No. or error status:
Command (16#0335)
Socket No.
15 0
Socket No. ( 1 to 8), error status
15 0
Bus Requested Ethernet module slot No. Unit Slot
12 8
Type
S-TCPPortNo.
D-TCPPortNo.
D-IP address
TimeCnt
15 0
Requested Ethernet module slot
No.
Command (16#0334)
<Request command>
<Error status>
15 0
=0: Normal complete, 0: Error status
Bus Slot Unit
12 8
Socket No. (1 to 8)
Socket No. : Socket ID (1 to 8)
Chapter 2 LD/FBD Instructions
6F8C1226
540
TCP send request
Sends the source data using the opened TCP connection.
Send data word number: 1 to 1000 words
<Request command>
Socket No. :Socket ID (1 to 8)
<Error status>
Command (16#0337)
Socket No.
15 0
15 0
Bus
Requested Ethernet module slot No.
Unit Slot
12 8
TCP close request
Ends an opened TCP connection and closes the socket.
Also cancels open/receive requests (unlimited wait state).
<Request command>
Socket No. :Socket ID (1 to 8)
< Error status>
Command (16#0339)
Socket No.
15 0
15 0
Bus
Requested Ethernet module slot No.
Unit Slot
12 8
=0 : Normal complete, 0 : Error status
=0 : Normal complete, 0 : Error status
2.20 Communication
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
541
Program example
[LD/FBD language notation]
SIGNAL1
1
LD
USEND_T
SIGNAL2
ST
REQ
SAMPLE1
LD
SAMPLE2
LD
SAMPLE3
50
LD
CMD
P
N
Request command SAMPLE1
2
16#0031
8080
Slot No.
UDP open request
Source station UDP port No.
DONE
ERROR
STATUS
SIGNAL3
ST
SAMPLE5
ST
USEND_T_1
[ST language notation]
USEND_T_1( SIGNAL1, SAMPLE1, SAMPLE2, SAMPLE3);
SIGNAL2 := USEND_T_1.DONE;
SIGNAL3 := USEND_T_1.ERROR;
SAMPLE5 := USEND_T_1.STATUS;
The request command (slot No.=2, Command=16#0031, Source UDP port No.=8080)
is specified with SAMPLE1.
UDP open request specified with the request command is made at the rise of
SIGNAL1 from FALSE(OFF) to TRUE(ON).
When UDP open completes normally, the completion output SIGNAL2 is kept
TRUE(ON) for one scan time. The socket ID is stored in status output SAMPLE5.
When UDP open is unsuccessful, the error output SIGNAL3 is kept TRUE(ON) for one
scan time. The error status is stored in status output SAMPLE5.
Chapter 2 LD/FBD Instructions
6F8C1226
542
Socket Communication Send
Communication Socket Communication Send
nv dedicated
instruction
LD/FBD language
notation
Completion output
Request command
Send data word no.
Send data
Execution request
USEND_N
Error
Socket no. or error
status
Instance name
ERROR
STATUS
DONE
CMD
N
P
REQ
EN input Edge execution Index modification Modifier
ST language notation [Instance name]( REQ, CMD, P, N );
[Variable name]:= @[Instance name]. DONE;
[Variable name]:= @[Instance name]. ERROR;
[Variable name]:= @[Instance name]. STATUS;
Arguments
Arg. Operand Type Const. Description Valid range
REQ BOOL
Execution request
CMD PTR Request command
P PTR Send data
EN8**send data word No.
(for word send command)
1 to1000 words
EN8**send data bytes No.
(for bytes send command)
1 to 2000 bytes
EN9**send data word No.
(for word send command)
1 to 700 words
Input
N UINT
EN9**send data bytes No.
(for bytes send command)
1 to 1400 bytes
DONE BOOL Completion output
ERROR BOOL Error Output
STATUS INT Socket No. or error status
2.20 Communication
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
543
Request command data structure
Instance structure
Name Type Description Remarks
DONE BOOL Completion output
ERROR BOOL Error
STATUS INT Socket No. or error status
Can be accessed from the user
program.
TIMECNT DINT Time count
RESERVE DWORD Reserved
Cannot be accessed from the
user program.
Restrictions
Unified Controller nv series
Item
type1 type2
Ethernet modules/stations 4
EN8** 48 (Max.48/controller) Sockets /Ethernet
modules (Note) EN9** 12 (Max.48/controller)
Single bus Yes Yes
TCP/IP
Duplex bus No Yes
Single bus Yes Yes
Protocol
UDP/IP
Duplex bus No Yes
EN8**
For word send command: 1000 words
For byte send command: 2000 bytes Transmission text
size/socket
EN9**
For word send command: 700 words
For byte send command:1400 bytes
EN9** support Yes No
(Note) The total number of sockets using multiple Ethernets modules (e.g. EN8 and EN9) are
max.48/Controller.
<EN8**> <EN9**>
15 0
Requested Ethernet module slot No.
Socket service command
Request parameter
15 0
ID code (16#F001)
Socket service command
Requested Ethernet module
Basic unit slot/node/unit/slot
Request parameter
<Requested Ethernet module Basic unit slot/node/unit/slot>
15 0
Unit
8 7
Slot
Basic unit slot Node
Chapter 2 LD/FBD Instructions
6F8C1226
544
Function
This is a function block for the Unified Controller nv series that communicates with
TCP/IP or UDP/IP protocol using the Ethernet module.
When execution request REQ changes from FALSE(OFF) to TRUE(ON), N words
starting from send data P are sent with the content of the specified request command
CMD.
The send data word number varies depending on the Ethernet module.
For EN8**word send command, send data word number is 1 to 1000 words. For byte
send command, it is one to 2000 bytes.
For EN9**word send command, send data word number is 1 to 700 words. For byte
send command, it is 1 to 1400 bytes.
When transfer is completed normally, completion output DONE becomes TRUE(ON)
for one scanning time.
When it is completed with an error, error ERROR becomes TRUE(ON) for one
scanning time.
When transfer is completed with or without an error, the details are output to socket No.
or error status STATUS.
The instruction completes normally (DONE=ON) starting from the second scan after
execution request (REQ=ON). Therefore, depending on how the control cycle is set
and application program is created, it may take several seconds before normal
completion.
Direct I/O variable cannot be specified for send data.
The request commands vary depending on the Ethernet module. The request
commands are described below. Also, a list of error status codes is included after the
URCV_N instruction (Error Status Code List).
Notes on using this communication function block instruction in a duplex system are
included after the Error Status Code List (Notes for duplex system).
2.20 Communication
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
545
Ethernet module type and request command type:
Type
Module installation
location
Bus type Module name Request command type*
Single EN811 Single bus request command
Main unit
Duplex
Single bus request command and
duplex bus request command
type1
TC-net I/O unit Single EN911 EN911 request command
Single EN811 Single bus request command
type2 Main unit
Duplex FN812
Single bus request command and
duplex bus request command
Notes on request command type
Both the single bus request command and duplex bus request command may be used
for duplex bus (FN812), but the duplex bus request command cannot be used for
single bus (EN811). Be sure to use a single bus request command.
When the destination is single bus, use a single bus request command even if the
source Ethernet module is duplex bus.
Single bus request command
: Available : Unavailable
Command description Command type1 type2
Reset request 16#0011
Other station confirmed request 16#0014
UDP open request 16#0031
UDP send request/broadcast 16#0032
UDP close request 16#0034
TCP open request 16#0035
TCP send request 16#0037
TCP close request 16#0039
UDP byte send request 16#0042
TCP byte send request 16#0047
Duplex bus request command (In development)
: Available /: Unavailable
Command description Command type1 type2
UDP open request 16#0231
UDP send request/broadcast 16#0232
UDP close request 16#0234
TCP open request 16#0235
TCP send request 16#0237
TCP close request 16#0239
Chapter 2 LD/FBD Instructions
6F8C1226
546
EN911 request command
: Available / : Unavailable
Command description Command type1 type2
Reset request 16#0911
Other station confirmed request 16#0914
UDP open request 16#0931
UDP send request/broadcast 16#0932
UDP close request 16#0934
TCP open request 16#0935
TCP send request 16#0937
TCP close request 16#0939
UDP byte send request 16#0942
TCP byte send request 16#0947
Single bus/duplex bus request command
The single bus request command and duplex bus request command have different
command numbers, but their structure is the same. They will be described together.
Reset request
Resets the Ethernet module from the user program.
The request command and Error status are as follows:
15 0
Requested Ethernet module slot No.
Command (16#0011)
<Request command>
<Error status>
15 0
=0: Normal complete, 0: Error status
2.20 Communication
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
547
Other station confirmed request
Verifies the existence of the specified other station (Equivalent to Ping).
The request command and Error status are as follows.
Notes on duplex bus Ethernet module: The "Other station confirmed request" is not a
duplex bus request command. Make the request by specifying the IP address for
both Ethernet A and B systems. Program according to the system request
specification (such as the command is successful if either A or B is successful/the
command is successful if both A and B are successful).
UDP open request
Opens the requested socket.
Communication protocol: UDP/IP
Socket No. is set in STATUS when UDP completes successfully (DONE=ON). This
socket No. is used to obtain the send, receive, close, and EN board control socket
identifier.
15 0
Requested Ethernet module slot No.
Command (16#0031)/Duplex (16#0231)
<Request command>
<Socket No. or error status>
15 0
Socket No. (0 to47), error status
UDPPort No. : UDP port No of the specified source socket (1024 to 65535)
UDPPort No.
15 0
Requested Ethernet module slot No.
Command (16#0014)
<Request command>
<Error status>
15 0
=0: Normal complete, 0: Error status
D-IP address
D-IP address : Destination IP address to be verified.
Chapter 2 LD/FBD Instructions
6F8C1226
548
UDP send request/broadcast send request
Sends source data using the opened UDP socket.
Number of transferred data words: 1 to 1000 words.
UDP close request
Ends the opened UDP sockets. Also cancels receive requests (unlimited wait state).
15 0
Requested Ethernet module slot No.
Command (16#0034)/Duplex (16#0234)
<Request command>
<Error status>
15 0
=0: Normal complete, 0: Error status
Socket No. : Socket ID(0 to 47)
(identifier obtained by UDP open)
Socket No.
15 0
Requested Ethernet module slot No.
Command (16#0032)/Duplex (16#0232)
<Request command>
<Error status>
15 0
=0: Normal complete, 0: Error status
Socket No. : Socket ID (0 to 47) (identifier obtained with UDP open)
Destination IP address: Destination IP address
Specifying 255.255.255.255 as the destination IP address results
in broadcast send.
D-UDPPort No. : Destination socket UDP port No.
Socket No.
D-IP address
D-UDPPort No.
2.20 Communication
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
549
TCP open request
Opens (active/passive) the requested port.
Communication protocol: TCP/IP
Socket No. is set in STATUS when TCP completes successfully (DONE=ON). This
Socket No. is used to obtain the send, receive, close, and EN board control socket
identifier.
TCP send request
Sends the source data using the opened TCP connection.
Send data word number: 1 to 1000 words
15 0
Requested Ethernet module slot No.
Command (16#0037)/Duplex (16#0237)
<Request command>
<Error status>
15 0
=0: Normal complete, 0: Error status
Socket No. : Socket ID (0 to 47)
(identifier obtained by TCP open)
Socket No.
15 0
Requested Ethernet module slot No.
Command (16#0035)/Duplex (16#0235)
<Request command>
<Socket No. or error status>
15 0
Socket No. (0 to 47), error status
Type
D-IP address
D-TCPPort No.
S-TCPPort No.
TimeCnt
Type : Open type (1/2)
1= Active open - client
2= Passive open - server
D-IP address : Destination IP address (valid only for active open)
D-TCPPort No. : Destination socket TCP port no. (valid only for active open)
S-TCPPort No. : Source specified socket TCP port No.
TimeCnt : Receive wait timeout interval (1 to 65535: 0.1 second unit, 0:
unlimited)
(valid only for passive open)
Chapter 2 LD/FBD Instructions
6F8C1226
550
TCP close request
Ends an opened TCP connection and closes the socket.
Also cancels open/receive requests (unlimited wait state).
UDP byte send request
Sends source data using the opened UDP socket.
Number of transferred data bytes: 1 to 2000 bytes
15 0
Requested Ethernet module slot No.
Command (16#0042)
<Request command>
<Error status>
15 0
=0: Normal complete, 0: Error status
Socket No. : Socket ID (0 to 47)
(identifier obtained by UDP open)
D-IP address : Destination IP address
Specifying 255.255.255.255 as the destination IP address results
in broadcast send.
D-UDPPort No. : Destination socket UDP port No.
Socket No.
D-IP address
D-UDPPort No.
15 0
Requested Ethernet module slot No.
Command (16#0039)/Duplex (16#0239)
<Request command>
<Error status>
15 0
=0: Normal complete, 0: Error status
Socket No. : Socket ID (0 to 47)
(identifier obtained by TCP open)
Socket No.
2.20 Communication
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
551
TCP byte send request
Sends the source data using the opened TCP connection.
Send data word number: 1 to 2000 bytes
15 0
Requested Ethernet module slot No.
Command (16#0047)
<Request command>
<Error status>
15 0
=0: Normal complete, 0: Error status
Socket No. : Socket ID (0 to 47)
(identifier obtained by TCP open)
Socket No.
Chapter 2 LD/FBD Instructions
6F8C1226
552
EN911 request command
EN911 request command differs from the EN8** in the request command format. There
is an identification code (16#F001) at the top of the request command. The specified
format (2 words) of the requested Ethernet module is also different. The contents
following the command are the same although the numbers are different.
Reset request
Resets the Ethernet module from the user program. The reset request is valid then
EN9**, which issues the reset request, is specified for I/O fallback.
The request command structure and error status are as follows:
Other station confirmed request
Verifies the existence of the specified other station. (Equivalent to Ping)
The request command and error status are as follows:
15 0
ID code (16#F001)
Requested Ethernet module
Basic unit slot/node/unit/slot
<Request command>
<Error status>
15 0
=0: Normal complete, 0: Error status
D-IP address : Destination IP address to be verified
Command (16#0914)
D-IP address
15 0
ID code (16#F001)
Command (16#0911)
Requested Ethernet module
Basic unit slot/node/unit/slot
<Request command>
<Error status>
15 0
=0: Normal complete, 0: Error status
2.20 Communication
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
553
UDP open request
Opens requested sockets.
Communication protocol: UDP/IP
Socket No. is set in STATUS when UDP completes successfully (DONE=ON). This
socket No. is used to obtain the send, receive, close and EN board control socket
identifier.
UDP send request/broadcast send request
Sends source data using the opened UDP socket.
Number of transferred data words: 1 to 700 words
15 0
ID code (16#F001)
Requested Ethernet module
Basic unit slot/node/unit/slot
<Request command>
<Error status>
15 0
=0: Normal complete, 0: Error status
Socket No. : Socket ID (0 to 47) (identifier obtained by UDP open)
D-IP address : Destination IP address
Specifying 255.255.255.255 as the destination IP address results
in broadcast send.
D-UDPPort No. : Destination socket UDP port No.
Socket No.
Command (16#0932)
D-IP address
D-UDPPort No.
15 0
ID code (16#F001)
Requested Ethernet module
Basic unit slot/node/unit/slot
<Request command>
<Socket No. or error status>
15 0
Socket No. (0 to 47), error status
UDPPort No. : UDP port No. of the specified source socket (1024 to 65535)
Command (16#0931)
UDPPort No.
Chapter 2 LD/FBD Instructions
6F8C1226
554
UDP close request
Ends the opened UDP sockets. Also cancels receive request (unlimited wait state).
TCP open request
Opens (active/passive) the requested port. ,
Communication protocol: TCP/IP
Socket No. is set in STATUS when TCP completes successfully (DONE=ON). This
socket No. is used to obtain the send, receive, close and En board control socket
identifier.
15 0
ID code (16#F001)
Command (16#0935)
Requested Ethernet module
Basic unit slot/node/unit/slot
<Request command>
<Socket No. or error status>
15 0
Socket No. (0 to 47), error status
Type
D-IP address
D-TCPPort No.
S-TCPPort No.
TimeCnt
Type : Open type (1/2)
1= Active open - client
2= Passive open - server
D-IP address : Destination IP address (valid only for active open)
D-TCPPort No. : Destination socket TCP port no. (valid only for active open)
S-TCPPort No. : Source specified socket TCP port No.
TimeCnt : Receive wait timeout interval (1 to 65535: 0.1 second unit, 0:
unlimited)
(valid only for passive open)
15 0
ID code (16#F001)
Requested Ethernet module
Basic unit slot/node/unit/slot
<Request command>
<Error status>
15 0
=0: Normal complete, 0: Error status
Socket No. : Socket ID (0 to 47) (identifier obtained by UDP open)
Command (16#0934)
Socket No.
2.20 Communication
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
555
TCP send request
Sends the source data using the opened TCP connection.
Send data word number: 1 to 700 words
TCP close request
Ends an opened TCP connection and closes the socket.
Also cancels open/receive requests (unlimited wait state).
15 0
ID code (16#F001)
Command (16#0939)
Requested Ethernet module
Basic unit slot/node/unit/slot
<Request command>
<Error status>
15 0
=0: Normal complete, 0: Error status
Socket No. : Socket ID (0 to 47) (identifier obtained by TCP open)
Socket No.
15 0
ID code (16#F001)
Command (16#0937)
Requested Ethernet module
Basic unit slot/node/unit/slot
<Request command>
<Error status>
15 0
=0: Normal complete, 0: Error status
Socket No. : Socket ID (0 to 47) (identifier obtained by TCP open)
Socket No.
Chapter 2 LD/FBD Instructions
6F8C1226
556
UDP byte send request
Sends source data using the opened UDP socket.
Number of transferred data bytes: 1 to 1400 bytes
TCP byte send request
Sends the source data using the opened TCP connection.
Send data word number: 1 to 1400 bytes
15 0
ID code (16#F001)
Command (16#0947)
Requested Ethernet module
Basic unit slot/node/unit/slot
<Request command>
<Error status>
15 0
=0: Normal complete, 0: Error status
Socket No. : Socket ID (0 to 47) (identifier obtained by TCP open)
Socket No.
15 0
ID code (16#F001)
Command (16#0942)
Requested Ethernet module
Basic unit slot/node/unit/slot
<Request command>
<Error status>
15 0
=0: Normal complete, 0: Error status
Socket no. : Socket ID (0 to 47) (identifier obtained by UDP open)
D-IP address : Destination IP address
Specifying 255.255.255.255 as the destination IP address results
in broadcast send.
D-UDPPort No. : Destination socket UDP port No.
Socket No.
D-IP address
D-UDPPortn No.
2.20 Communication
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
557
Program example
[LD/FBD language notation]
[ST language notation]
USEND_N_1( SIGNAL1, SAMPLE1, SAMPLE2, SAMPLE3);
SIGNAL2 := @USEND_N_1.DONE;
SIGNAL3 := @USEND_N_1.ERROR;
SAMPLE4 := @USEND_N_1.STATUS;
The request command (slot No.=2, Command=16#0031, Source UDP port No.=5000)
is specified with SAMPLE1.
UDP open request specified with the request command is made at the rise of
SIGNAL1 from FALSE(OFF) to TRUE(ON).
When UDP open completes normally, the completion output SIGNAL2 is kept
TRUE(ON) for one scan time. The socket ID is stored in status output SAMPLE4.
When UDP open is unsuccessful, the error output SIGNAL3 is kept TRUE(ON) for one
scan time. The error status is stored in status output SAMPLE4.
Error information
When the specified range of the send data exceeds the area, the socket
communication send is not processed and the data boundary is exceeded.
The following operation is performed when direct I/O variable is specified for the send
data:
Controller Action
Unified Controller nv series
Socket communication send is not executed.
Error flag and table operation error flag are set to
TRUE(ON).
USEND_N
REQ
CMD
P
N
DONE
ERROR
STATUS
SAMPLE1
LD
SIGNAL1
SAMPLE2
LD
SAMPLE3
0
LD
SIGNAL2
SIGNAL3
SAMPLE4
ST
Request command SAMPLE1
16#0031
5000
Slot No.
UDP open request
Source station UDP port No.
2
USEND_N_1
Chapter 2 LD/FBD Instructions
6F8C1226
558
Socket Communication Receive
Communication Socket Communication Receive
V dedicated
instruction
LD/FBD language
notation
Completion output
Request command
Receive data word count
Receive data
Execution request
URCV_T
REQ DONE
CMD ERROR
P STATUS
N
Error
Status
Instance name
EN input Edge execution Index modification Modifier
ST language notation [Instance name]( REQ, CMD, P, N );
[Variable name]:=[Instance name]. DONE;
[Variable name]:=[Instance name]. ERROR;
[Variable name]:=[Instance name]. STATUS;
Arguments
Arg. Operand Type Const. Description Valid range
REQ BOOL
Execution request
CMD PTR Request command
P PTR Receive data
Receive data word No.
(for word receive command)
1 to 1001 words Input
N UINT
Receive data byte No.
(for byte receive command)
2 to 2002 bytes
DONE BOOL Completion output
ERROR BOOL Error Output
STATUS INT Status
Request command data structure
Instance structure
Name Type Description Remarks
DONE BOOL Completion output
ERROR BOOL Error
STATUS INT Status
Can be accessed from the user program.
TIMECNT DINT Time count
RESERVE DWORD Reserved
Cannot be accessed from the user program.
15 0
Requested Ethernet module slot No.
Socket service command
Request parameter
(See below for details)
2.20 Communication
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
559
Restrictions
Item S3 S2 L3 L2 L1
Ethernet modules/stations 4 1
Sockets/Ethernet modules 12
Single bus Yes Yes Yes Yes Yes
TCP/IP
Duplex bus No No Yes Yes No
Single bus Yes Yes Yes Yes Yes
Protocol
UDP/IP
Duplex bus Yes Yes Yes Yes No
Transferred text size/sockets
For word receive command: 1001 words
For byte receive command: 2002 bytes
Function
This is a function block for Integrated Controller V series that communicates with
TCP/IP or UDP/IP procedure using the Ethernet module.
When the Execution request REQ changes from FALSE(OFF) to TRUE(ON), N words
starting from Receive data P are received with the content of the specified Receive
command CMD.
Word receive command: receive data word number may be from 1 to 1001 words,
byte receive command: receive data byte number may be from 2 to 2002.
When data receive completes, Completion output DONE is kept to TRUE(ON) for one
scan time.
If an error occurs, ERROR is kept to TRUE(ON) for one scan time.
The detail status is output to STATUS when receive completes normally or abnormally.
The instruction completes successfully (DONE=ON) starting from the second scan
after execution request (REQ=ON). Therefore, depending on how the control cycle is
set and application program is created, it may take several seconds before normal
completion.
Request commands differ by the Ethernet module. Each request command is
described from the following pages. Also, a list of error status codes is included after
the URCV_T instruction (Error Status Code List).
Notes on using this communication function block instruction in a duplex system are
included after the Error Status Code List (Notes for duplex system).
Chapter 2 LD/FBD Instructions
6F8C1226
560
Ethernet module type and request command type
Model
Module installation
location
Bus type Module name Request command type*
Single EN711,EN731,EN751* Single bus request command
Main unit
Duplex
EN721,EN741,EN761
FN711*
Single bus request command and
duplex bus request command
3000
Parallel I/O unit Single EN311 EN311 request command
Single EN611, EN631, EN651* Single bus request command
2000 Main unit
Duplex
EN621/EB621,
EN641/EB641, EN661
FN611
Single bus request command and
duplex bus request command
1000 Main unit Single EN531* Single bus request command
Notes on request command type
Both the single bus request command and duplex bus request command may be
used for duplex bus (EN721, EN741, EN761, FN711*, EN621/EB621, EN641/EB641,
EN661, FN611), but the duplex bus request command cannot be used for single bus
(EN711, EN731, EN751, EN611, EN631, EN651*, EN531*). Be sure to use a single
bus request command.
When the destination is single bus, use a single bus request command even if the
source Ethernet module is duplex bus.
Single bus request command
: Available/: Unavailable
Command description Command S3 S2 L3 L2 L1
Get EN board management socket
identifier
16#0016
UDP receive request/broadcast 16#0033
: Available/: Unavailable
Command description Command S3 S2 L3 L2 L1
UDP receive request/broadcast 16#0233
TCP receive request 16#0238
EN311 request command
Command description Command S3 S2 L3 L2 L1
RAS information read 16#0315
PC link (register read request) 16#0321
UDP receive request/broadcast 16#0333
TCP receive request 16#0338
2.20 Communication
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
561
Single bus/duplex bus request command
The single bus request command and duplex bus request command have different
command numbers, but their structure is the same. They will be described together.
EN board management socket identifier acquisition
This command is used to refer detailed information of Ethernet module sockets.
En board management socket identifier is obtained from opened socket identifier.
The request command structure and error status are as follows:
The socket No. obtained by UDP/TCP open command is a number controlled by the
communication function block instruction and is different from the real socket No.
obtained by the Ethernet module. Send, receive, or close can be performed using the
socket No. obtained with an open command. However, the detailed information for
each socket controlled by Ethernet module cannot be accessed. Therefore, use this
command to obtain the socket No. controlled by the Ethernet module and access the
socket information using that value as offset.
The information for each socket controlled by the Ethernet module is available as
station global. Register a station global variable or use direct instruction word notation
(%MW13.offset address) to access it from the user application program.
The information for each socket is organized as follows:
15 0
Requested Ethernet module slot No.
Command (16#0016)
<Request command>
<Socket No. or error status>
15 0
Socket No. (0 to 63), error status
Socket No. : Socket ID (0 to11) (identifier obtained by UDP open)
Socket No.
Chapter 2 LD/FBD Instructions
6F8C1226
562
Ethernet module detailed information for each socket
Overall structure:
Socket 0
Socket 1
:
Socket 63
Socket information
for single bus request
command
(1 word x 64 sockets)
TCP
F
UDP
E
AOP
D
POP
C
CON
B
RCV
A
RCL
9
Reserved
8 0
The structure of each slot is the same.
Socket 0
Socket 1
:
Socket 63
Socket information
for single bus request
command
(1 word x 64 sockets)
Top offset
address
+64
Bit description:
Name Description Set condition Reset condition
TCP Using TCP During TCP open During socket close request
UDP Using UDP During UDP open During socket close request
AOP Active open During TCP active open During socket close request
POP Passive open During TCP passive open During socket close request
CON Connecting During TCP connection
During socket close request
or when RCL is ON
RCV Receive data When there is receive data No receive data
RCL Disconnected
When closed by opposite
party when connecting
During socket close request
2.20 Communication
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
563
Top offset address:
Model Slot Top offset address
0 130944
1 655232
2 1179520
3 1703808
4 2228096
5 2752384
6 3276672
2000/3000
7 3800960
1000 1 65280
(Ex.) Socket 4 information of single bus request command installed in slot 3 for model 3000
Direct notation
%MW13.1703811
LD ST
Variable declaration
SOCKET_INF3 [4]
LD ST
Station variables (Slot3)
Variable Data type Word No. Bit No.
SOCKET_INF3 Array[0..63] OF WORD 1703808 0
EN board management socket number acquisition request
The number of socket information for the source Controller, which is managed by
Ethernet module specified by the requested Ethernet module slot No. is obtained.
This command is supported by the versions after S3 Controller.
S3Controller Support version
S3PU55/S3PU55/S3PU65 (Single/Duplex) V02.7J and following versions
S3PU65 (Duplex reliability improvement version) V03.7E and following versions
The request command structure and error status are as follows:
15 0
Requested Ethernet module slot No.
Command (16#001A)
<Request command>
<Status>
15 0
Management socket No.
Chapter 2 LD/FBD Instructions
6F8C1226
564
UDP receive request/broadcast receive request
Receives data from opened UDP socket.
Receive data word number: 1 to 1001 (number of words including the received bytes
(1W))
TCP receive request
Receives data from opened TCP socket.
Receive data word number: 1 to 1001 words (number of words including the received
bytes (1W))
15 0
Requested Ethernet module slot No.
Command (16#0038)/Duplex (16#0238)
<Request command>
<Error status>
15 0
=0: Normal complete, 0: Error status
Socket No. :Socket ID (0 to 11) (identifier obtained by TCP open)
TimeCnt :Receive wait timeout interval (1 to 65535: 0.1 second unit, 0:
unlimited)
Socket No.
TimeCnt
15 0
Requested Ethernet module slot No.
Command (16#0033)/Duplex (16#0233)
<Request command>
<Error status>
15 0
=0: Normal complete, 0: Error status
Socket No. : Socket ID (0 to 11) (identifier obtained by UDP open)
D-IP address : Source IP address
Specifying 0.0.0.0 as the source IP address results in broadcast
receive.
D-UDPPort No. : Source socket UDP port No.
Do not check the source port when the command is duplex
(16#0233) or UDP port No. is "0".
TimeCnt : Receive wait timeout interval (1 to 65535: 0.1 second unit, 0:
unlimited)
Socket No.
D-IP address
D-UDPPort No.
TimeCnt
2.20 Communication
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
565
UDP byte receive request
Receives data from opened UDP socket.
Receive data word number: 2 to 2002 bytes (including the storage area for receive
byte count (2 bytes))
TCP byte receive request
Receives data from opened TCP socket.
Receive data word number: 2 to 2002 bytes (including the storage area for receive
byte count (2 bytes))
15 0
Requested Ethernet module slot No.
Command (16#0048)
<Request command>
<Error status>
15 0
=0: Normal complete, 0: Error status
Socket No. : Socket ID (0 to 11) (identifier obtained by TCP open)
TimeCnt : Receive wait time out interval (1 to 65535: 0.1 sec. unit, 0: unlimited)
Socket No.
TimeCnt
15 0
Requested Ethernet module slot No.
Command (16#0043)
<Request command>
<Error status>
15 0
=0: Normal complete, 0: Error status
Socket No. : Socket ID (0 to11) (identifier obtained by UDP open)
D-IP address : Source IP address
Specifying 0.0.0.0 as the source IP address results in broadcast
receive.
D-UDPPort No. : Source socket UDP port No.
TimeCnt : Receive wait time out interval (1 to 65535: 0.1 sec. unit, 0: unlimited)
Socket No.
D-IP address
D-UDPPort No.
TimeCnt
Chapter 2 LD/FBD Instructions
6F8C1226
566
EN311 request command
Read RAS information request
Reads EN311 RAS information (internal error information and event log) from the user
program.
The request command structure and Error status are as follows:
Error status 16#EC** (-50**) indicates that the error was detected by the CPU module
and 16#B** indicates that it was detected by the EN311 (* is any number).
15 0
Command (16#0315)
<Request command>
<Error status>
15 0
=0: Normal complete, 0: Error status
RAS request type :Specify the type of RAS information to be read.
1=RAS counter
2=MIB information
3=Maintenance data (this data cannot be used)
4=Event trace information
5=RAS information area
Start position : Valid only when the read request type is 2 (MIB
information) or 4 (trace information).
MIB information
0=MIB_IF
1=MIB_IP
2=MIB_TCP
3=MIB_UDP
4=MIB_ICMP
Trace information : Read position (0 to 160), 0 is the latest information
Read number : Valid only when the read request type is 4 (event trace
information).
1 to 30.
RAS request type
Start position
Read number
Requested Ethernet module slot No. Bus Slot Unit
2.20 Communication
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
567
PC link register read request
Reads the data in the specified destination register to the specified source register.
15 0
Requested Ethernet module slot No.
Command (16#0321)
<Request command>
<Error status>
15 0
=0: Normal complete, 0: Error status
Bus Slot Unit
12 8
DRID
Dreg No.
TimeCnt
D-IP address
D-UDPPort No.
DRID : Destination register type code
(Only register D/SW can be specified when the destination is S3.)
0=XW/YW
1=W
2=LW
3=RW
4=D
5=F (0 to 32767)
6=F (0 to 65535)
7=T
8=C
9=SW
Dreg No : Destination register No.
TimeCnt : Time out interval 1 to 32767 (0.1 second unit) when bit 15=0
Defaults to 30 seconds when bit15=1
D-IP address : Destination IP address
D-UDPPort No. : Destination UDP port No.
Chapter 2 LD/FBD Instructions
6F8C1226
568
UDP receive request/broadcast receive request
Receives data from opened UDP socket.
Receive data word number: 1 to 1001 words (number of words including the received
bytes (1W))
TCP receive request
Receives data from opened TCP socket.
Receive data word number: 1 to 1001 words (number of words including the received
bytes (1W))
15 0
Requested Ethernet module slot No
Command (16#0338)
<Request command>
<Error status>
15 0
=0: Normal complete, 0: Error status
Bus Slot Unit
12 8
Socket No.
Socket No. : Socket ID (1 to 8)
TimeCnt : Receive timeout interval (1 to 65535: 0.1 second unit, 0: unlimited)
TimeCnt
15 0
Requested Ethernet module slot No.
Command (16#0333)
<Request command>
<Error status>
15 0
=0: Normal complete, 0: Error status
Bus Slot Unit
12 8
Socket No.
D-UDPPort No.
Socket No. : Socket ID (1 to 8)
D-IP address : Source IP address
Specifying 0.0.0.0 as the source IP address results in broadcast receive.
D-UDPPort No. : Source socket UDP port no.
TimeCnt : Receive wait timeout interval (1 to 65535: 0.1 second unit, 0: unlimited)
D-IP address
TimeCnt
2.20 Communication
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
569
Program example
[LD/FBD language notation]
SIGNAL1
1
LD
URCV_T SIGNAL2
ST
REQ
SAMPLE1
LD
SAMPLE2
LD
SAMPLE3
50
LD
CMD
P
N
Request command SAMPLE1
2
16#0033
11
Slot No.
UDP receive request
UDP socket No.
DONE
ERROR
STATUS
SIGNAL3
ST
SAMPLE5
ST
16#12_34_56_78
8080
300
Send source IP address
Send source target socket UDP No.
Receive wait timeout
URCV_T_1
[ST language notation]
URCV_T_1( SIGNAL1, SAMPLE1, SAMPLE2, SAMPLE3);
SIGNAL2 := URCV_T_1.DONE;
SIGNAL3 := URCV_T_1.ERROR;
SAMPLE5 := URCV_T_1.STATUS;
The request command (Slot No.=2, Command=16#0033, UDP socket No.=11, Source
IP address=16#12_34_56_78, Source socket UDP No.=8080, Receive timeout
inteval=30 seconds) is specified with SAMPLE1.
UDP receive request specified with the request command is made at the rise of
SIGNAL1 from FALSE(OFF) to TRUE(ON).
When UDP receive completes normally, the completion output SIGNAL2 is kept
TRUE(ON) for one scan time. "0" is stored in status output SAMPLE5.
When UDP receive request is unsuccessful, the error output SIGNAL3 is kept
TRUE(ON) for one scan time. The error status is stored in status output SAMPLE5.
Chapter 2 LD/FBD Instructions
6F8C1226
570
Socket Communication Receive
Communication Socket Communication Receive
nv dedicated
instruction
LD/FBD language
notation
Completion
output
URCV_N
Error
Status
Instance name
CMD
N
P
REQ
ERROR
STATUS
DONE
Execution request
Request command
Receive data
Receive data word
count
EN input Edge execution Index modification Modifier
ST language notation [Instance name]( REQ, CMD, P, N );
[Variable name]:= @[Instance name]. DONE;
[Variable name]:= @[Instance name]. ERROR;
[Variable name]:= @[Instance name]. STATUS;
Arguments
Arg. Operand Type Const. Description Valid range
REQ BOOL
Execution request
CMD PTR Request command
P PTR Receive data
EN8**receive data word No.
(For word receive command)
1 to 1001 words
EN8** receive data word No.
(For word receive command)
2 to 2002 bytes
EN9** receive data word No.
(For word receive command)
1 to 701
Input
N UINT
EN9** receive data word No.
(For word receive command)
2 to 1402 bytes
DONE BOOL Completion output
ERROR BOOL Error Output
STATUS INT Status
2.20 Communication
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
571
Request command data structure
Instance structure
Name Type Description Remarks
DONE BOOL
Completion
output
ERROR BOOL Error
STATUS INT Status
Can be accessed from the user program.
TIMECNT DINT Time count
RESERVE DWORD Reserved
Cannot be accessed from the user
program.
Restrictions
Item type1 type2
Ethernet modules/stations 4
EN8** 48 (Max.48/Controller) Sockets /Ethernet
modules (Note) EN9** 12 (Max.48/Controller)
Single bus Yes Yes
TCP/IP
Duplex bus No No
Single bus Yes Yes
Protocol
UDP/IP
Duplex bus No Yes
EN8**
For word receive command:1001 words
For byte receive command:2002 bytes Transferred text
size/sockets
EN9**
For word receive command:701 words
For byte receive command:1402 bytes
EN9** support Yes No
(Note) The total number of sockets using multiple Ethernets modules (e.g. EN8** and
EN9**) are max.48/Controller.
<EN8**> <EN9**>
15 0
Requested Ethernet module slot No.
Socket service command
Request parameter
15 0
ID code (16#F001)
Socket service command
Requested Ethernet module
Basic unit slot/node/unit/slot
Request parameter
<Requested Ethernet module Basic unit slot/node/unit/slot>
15 0
Unit
8 7
Slot
Basic unit slot Node
Chapter 2 LD/FBD Instructions
6F8C1226
572
Function
This is a function block that communicates with TCP/IP or UDP/IP procedure using the
Ethernet module.
When execution request REQ changes from FALSE(OFF) to TRUR(ON), N words
starting from receive data P are received with the content of the specified request
command CMD.
Receive data word numbers differ by the Ethernet modules. For EN8** word receive
command, receive data number is 1 to 1001 words and for byte receive command,
receive data byte number is 2 to 2002 bytes.
For EN9** word receive command, receive data word number is 1 to 701 words and
for byte receive command, receive byte number is 2 to 1402.
When receive is completed normally, completion output DONE becomes TRUE(ON)
for one scanning time.
When it is completed with an error, error ERROR becomes TRUE(ON) for one
scanning time.
When receive is completed with or without an error, the details are output to status
STATUS.
The instruction completes successfully (DONE=ON) starting from the second scan
after execution request (REQ=ON). Therefore, depending on how the control cycle is
set and application program is created, it may take several seconds before normal
completion.
Direct I/O variable cannot be specified for receive data.
The request commands and error codes vary depending on the Ethernet module.
2.20 Communication
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
573
Ethernet module type and request command type
Type
Module installation
location
Bus type Module name Request command type *
Single EN811 Single bus request command
Main unit
Duplex
Single bus request command and
duplex bus request command
type1
TC-net I/O unit Single EN911 EN911 request command
Single EN811 Single bus request command
type2 Main unit
Duplex FN812
Single bus request command and
duplex bus request command
Notes on request command type
Both the single bus request command and duplex bus request command may be used for
duplex bus (FN812), but the duplex bus request command cannot be used for single bus
(EN811). Be sure to use a single bus request command.
When the destination is single bus, use a single bus request command even if the source
Ethernet module is duplex bus.
Single bus request command (In development)
: Available / : Unavailable
Command description Command type1 type2
EN board management socket identifier
acquisition
16#0016
UDP receive request/broadcast 16#0033
TCP receive request 16#0038
UDP byte receive request 16#0043
TCP byte receive request 16#0048
Duplex bus request command (In development)
: Available/: Unavailable
Command description Command type1 type2
UDP receive request/broadcast 16#0233
TCP receive request 16#0238
EN911 request command
: Available / : Unavailable
Command description Command type1 type2
EN board management socket identifier
acquisition
16#0916
UDP receive request/broadcast 16#0933
TCP receive request 16#0938
UDP byte receive request 16#0943
TCP byte receive request 16#0948
Chapter 2 LD/FBD Instructions
6F8C1226
574
Single bus/duplex bus request command
The single bus request command and duplex bus request command have different
command numbers, but their structure is the same. They will be described together.
EN board management socket identifier acquisition
Used to refer to the detailed information of each socket of the Ethernet module.
Obtains the EN board management socket identifier from the opened socket identifier.
The request command and Error status are as follows:
Relation between socket No. obtained with the open command and socket No.
obtained with this command.
The socket No. obtained by UDP/TCP open command is a number controlled by the
communication function block instruction and is different from the real socket No.
obtained by the Ethernet module. Send, receive, or close can be performed using
the socket No. obtained with an open command. However, the detailed information
for each socket controlled by Ethernet module cannot be accessed. Therefore, use
this command to obtain the Socket No. controlled by the Ethernet module and access
the socket information using that value as offset.
The information for each socket controlled by the Ethernet module is available as
station global. Register a station global variable or use direct instruction word
notation (%MW13.offset address) to access it from the user application program.
The information for each socket is organized as follows:
15 0
Requested Ethernet module slot No.
Command (16#0016)
<Request command>
<Socket No. or error status>
15 0
Socket No. (0 to 63), error status
Socket No.
Socket No. : Socket ID (0 to 47)
(identifier obtained by UDP/TCP open)
2.20 Communication
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
575
Ethernet module detailed information for each socket
Overall structure:
Bit description:
Name description Set condition Reset condition
TCP Using TCP During TCP open
During socket close
request
UDP Using UDP During UDP open
During socket close
request
AOP Active open During TCP active open
During socket close
request
POP Passive open During TCP passive open
During socket close
request
CON Connecting During TCP connection
During socket close
request or when RCL is ON
RCV Receive data When there is receive data No receive data
RCL Disconnected
When closed by opposite
party when connecting
During socket close
request
NOA TCP timeout
Response from opposite
party is interrupted during
connection
During socket close
request
Socket information
for single bus
request command
(1 word64
sockets)
Tope offset
address
Socket information
for single bus
request command
(1 word64
sockets)
+64
Socket 0
Socket 1
Socket 63
UDP TCP AOP POP CON RCV RCL Reserve
E F D C B A 9 8 0
:
Socket0
Socket 1
Socket 63
:
The structure of each slot is the same.
NOA
7
Chapter 2 LD/FBD Instructions
6F8C1226
576
Top offset address:
Type Slot Top offset address
0 130944
2 2228096
3 3276672
4 4325248
5 5373824
6 6422400
type1/2
7 7470976
(Ex.) Socket 4 information of single bus request command installed in slot 3 for type 1.
Direct notation
%MW13.3276672
LD ST
Variable declaration
SOCKET_INF3 [4]
LD ST
Station global variable (Slot3)
Variable Data type Word No. Bit No.
SOCKET_INF3 Array[0..63] OF WORD 3276672 0
2.20 Communication
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
577
UDP receive request/broadcast receive request
Receives data from opened UDP socket.
Receive data word number: 1 to 1001 words (including the storage area for receive
byte count (1W))
TCP receive request
Receives data from opened TCP socket.
Receive data word number: 1 to 1001 words (including the storage area for receive
byte count (1W)).
15 0
Requested Ethernet module slot No.
Command (16#0038)/Duplex (16#0238)
<Request command>
<Error status>
15 0
=0: Normal complete, 0: Error status
Socket No. : Socket ID (0 to 47)
(identifier obtained by TCP open)
TimeCnt : Receive wait timeout interval (1 to 65535: 0.1 second unit, 0:
unlimited)
Socket No.
TimeCnt
15 0
Requested Ethernet module slot No.
Command (16#0033)/Duplex (16#0233)
<Request command>
<Error status>
15 0
=0: Normal complete, 0: Error status
Socket No. : Socket ID (0 to 47) (identifier obtained by UDP open)
D-IP address : Source IP address
Specifying 0.0.0.0 as the source IP address results in broadcast
receive.
D-UDPPort No. : Source socket UDP port No.
Do not check the source port when the command is duplex (16#0233)
or UDP port No. is 0.
TimeCnt : Receive wait timeout interval (1 to 65535: 0.1 second unit, 0: unlimited)
Socket No.
D-IP address
D-UDPPort No.
TimeCnt
Chapter 2 LD/FBD Instructions
6F8C1226
578
UDP byte receive request
Receives data from opened UDP socket.
Receive data word number: 2 to 2002 bytes (including the storage area for receive
byte count (2 bytes))
TCP byte receive request
Receives data from opened TCP socket.
Receive data word number: 2 to 2002 bytes (including the storage area for receive
byte count (2 bytes))
15 0
Requested Ethernet module slot No.
Command (16#0048)
<Request command>
<Error status>
15 0
=0: Normal complete, 0: Error status
Socket No. : Socket ID (0 to 47)
(identifier obtained by TCP open)
TimeCnt : Receive timeout interval (1 to 65535: 0.1 second unit, 0: unlimited)
Socket No.
TimeCnt
15 0
Requested Ethernet module slot No.
Command (16#0043)
<Request command>
<Error status>
15 0
=0: Normal complete, 0: Error status
Socket No. : Socket ID (0 to 47)
(identifier obtained by UDP open)
D-IP address : Source IP address
Specifying 0.0.0.0 as the source IP address results in broadcast
receive.
D-UDPPort No. : Source socket UDP port no.
TimeCnt : Receive wait timeout interval (1 to 65535: 0.1 second unit, 0:
unlimited)
Socket No.
D-IP address
D-UDPPort No.
TimeCnt
2.20 Communication
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
579
EN911 request command
EN911 request command differs from the EN8** in the request command format. There
is an identification code (16#F001) at the top of the request command. The specified
format (2 words) of the requested Ethernet module is also different. The contents
following the command are the same although the numbers are different.
EN board management socket identifier acquisition
Used to refer to the detailed information of each socket of the Ethernet module.
Obtains the EN board management socket identifier from the opened socket identifier.
The request command structure and error status are as follows:
Relationship between the socket No. obtained by open command and socket No.
obtained by this command
The socket No. obtained by UDP/TCP open command is a number controlled by the
communication function block instruction and is different from the real socket No.
obtained by the Ethernet module. Send, receive, or close can be performed using the
socket No. obtained with an open command. However, the detailed information for
each socket controlled by Ethernet module cannot be accessed. Therefore, use this
command to obtain the socket No. controlled by the Ethernet module and access the
socket information using that value as offset.
The information for each socket controlled by the Ethernet module is available as
station global. Register a station global variable or use direct instruction word notation
(%MW13.offset address) to access it from the user application program.
The information for each socket is organized as follows:
15 0
Command (16#0916)
<Request command>
<Socket No. or error status>
15 0
Socket No. (0 to 11), error status
Socket No.
Socket No. : Socket ID (0 to 47)
(identifier obtained by UDP/TCP open)
ID code (16#F001)
Requested Ethernet module
Basic unit slot/node/unit/slot
Chapter 2 LD/FBD Instructions
6F8C1226
580
Detailed information for each socket of Ethernet module
Overall structure:
Bit description:
Name Description Set condition Reset condition
TCP Using TCP During TCP open During socket close request
UDP Using UDP During UDP open During socket close request
AOP Active open During TCP active open During socket close request
POP Passive open During TCP passive open During socket close request
CON Connecting During TCP connection
During socket close request or
when RCL is ON
RCV Receive data When there is receive data No receive data
RCL Disconnected
When closed by opposite party
when connecting
During socket close request
NOA TCP timeout
Response from opposite party is
interrupted during connection
During socket close request
I/O variable (standard variable)
Variable Data type Word No. Bit No.
EN9_SOCK_M_NN_SS (Note) ARRAY [0..11] OF WORD 33 0
(Note) Where variable name: EN9_SOCK_M_NN_SS:
M : Main slot No.
NN : TCnet I/O loop node No.
SS : TCnet I/O slot No.
A unique variable name is registered for each EN911 module.
(Ex.)
Information of TC-net I/O loop node No.=3 connected to the Controller and EN9119 socket 4
installed in TC-net I/O slot No.=5:
TC-net I/O loop block
(Node no.3)*16+96
Word no.=33 Socket 0
Socket 1
Socket 11
UDP TCP AOP POP CON RCV RCL Reserve
E F D C B A 9 8 0
:
The structure of each slot is the same.
Socket
information for
EN911 request
command
(1 word*12
sockets)
NOA
7
EN9_SOCK_0_03_05[4]
LD
TEMP
ST
2.20 Communication
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
581
UDP receive request/broadcast receive request
Receives data from opened UDP socket.
Receive data word number: 1 to 701 words (number of words including the received
bytes (1W).
TCP receive request
Receives data from opened TCP socket.
Received data word number: 1 to 701 words (number of words including the received
bytes (1W)).
15 0
Command (16#0938)
<Request
<Error status>
15 0
=0: Normal complete, 0: Error status
Socket No. : Socket ID (0 to 47) (identifier obtained by TCP open)
TimeCnt : Receive wait timeout interval (1 to 65535: 0.1 sec unit, 0: unlimited)
Socket No.
TimeCnt
ID code (16#F001)
Requested Ethernet module
Basic unit slot/node/unit/slot
15 0
Command (16#0933)
<Request command>
<Error status>
15 0
=0: Normal complete, 0: Error status
Socket No. : Socket ID (0 to 47) (identifier obtained by UDP open)
D-IP address : Source IP address
Specifying 0.0.0.0 as the source IP address results in
broadcast receive.
D-UDPPort No. : Source socket UDP port No.
TimeCnt : Receive wait timeout interval (1 to 65535: 0.1 second unit, 0: unlimited)
Socket No.
D-IP address
D-UDPPort No.
TimeCnt
ID code (16#F001)
Requested Ethernet module
Basic unit slot/node/unit/slot
Chapter 2 LD/FBD Instructions
6F8C1226
582
UDP byte receive request
Receives data from opened UDP socket.
Receive data word number: 2 to 1402 bytes (including the storage area for receive
byte count (2 bytes))
TCP byte receive request
Receives data from opened TCP socket.
Receive data word number : 2 to 1402 bytes (including the storage area for receive
byte count (2 bytes))
15 0
Command (16#0948)
<Request command>
<Error status>
15 0
=0: Normal complete, 0: Error status
Socket No. : Socket ID (0 to 47) (identifier obtained by TCP open)
TimeCnt : Receive wait timeout interval1 to 65535: 0.1 sec unit, 0: unlimited)
Socket No.
TimeCnt
ID code (16#F001)
Requested Ethernet module
Basic unit slot/node/unit/slot
15 0
Command (16#0943)
<Request command>
<Error status>
15 0
=0: Normal complete, 0: Error status
Socket No. : Socket ID (0 to 47) (identifier obtained by UDP open)
D-IP address : Source IP address
Specifying 0.0.0.0 as the source IP address results in
broadcast receive.
D-UDPPort No. : Source socket UDP port No.
TimeCnt : Receive wait timeout interval (1 to 65535: 0.1 second unit, 0: unlimited)
Socket No.
D-IP address
D-UDPPort No.
TimeCnt
ID code (16#F001)
Requested Ethernet module
Basic unit slot/node/unit/slot
2.20 Communication
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
583
Program example
[LD/FBD language notation]
[ST language notation]
URCV_N_1( SIGNAL1, SAMPLE1, SAMPLE2, SAMPLE3);
SIGNAL2 := @URCV_N_1.DONE;
SIGNAL3 := @URCV_N_1.ERROR;
SAMPLE4 := @URCV_N_1.STATUS;
The request command (Slot No.=2, Command=16#0033, UDP socket No.=11, Source
IP address=172.16.64.5, Source socket UDP No.=5000, Receive timeout interval=30
seconds) is specified with SAMPLE1.
UDP receive request specified with the request command is made at the rise of
SIGNAL1 from FALSE(OFF) to TRUE(ON).
When UDP receive completes normally, the completion output SIGNAL2 is kept
TRUE(ON) for one scanning time. "0" is stored in status output SAMPLE4.
When UDP open is unsuccessful, the error output SIGNAL3 is kept TRUE(ON) for one
scanning time. The error status is stored in status output SAMPLE4.
Error information
When the specified range of receive data exceeds the area, the socket communication
receive is not processed and the data boundary is exceeded.
The following operation is performed when direct I/O variable is specified for the
receive data.
Controller Action
Unified Controller nv series
Socket communication receive is not executed.
Error flag and table operation error flag are set to TRUE(ON).
URCV_N_1
URCV_N
REQ
CMD
P
N
DONE
ERROR
STATUS
SAMPLE1
LD
SIGNAL1
SAMPLE2
LD
SAMPLE3
50
LD
SIGNAL2
SIGNAL3
SAMPLE4
ST
Request command SAMPLE1
16#0033
11
Slot No.
UDP receive request
2
UDP socket No.
Source IP address
172.16.64.5
5000
Source target socket UDP No.
300
Receive timeout
16#AC_10_
40_5
Chapter 2 LD/FBD Instructions
6F8C1226
584
Error Status Code List
EN7: When using EN7**/EN6**/EN8**/EN9**module
EN3: When using EN3** module
EN9: When using EN9** module (Error status unique to EN9**)
Error
code
Error description Request type
2819 Source standby EN3: UDP/TCP send / receive
2848
Timeout occurred
EN3: Other station verification, PC link register R/W
TCP open, UDP receive
2864 Length abnormal EN3: UDP/TCP send
2880 Station mode abnormal EN3: Router IP address setting
2896
MAC/IP not set
EN3: Operation mode control, router IP address
setting
2912 Transmission prohibited state EN3: UDP/TCP open/close, UDP/TCP send
Port No. abnormal EN3: Parameter setting
2929
IP address abnormal Router IP address setting
2931 Time setting error (year) EN3: Time setting request
2932 Time setting error (month) EN3: Time setting request
2933 Time setting error (day) EN3: Time setting request
2934 Time setting error (hour) EN3: Time setting request
2935 Time setting error (minute) EN3: Time setting request
2936 Time setting error (second) EN3: Time setting request
2944 Already opened EN3: UDP/TCP open
2945 Socket not open EN3: UDP/TCP send / receive, UDP/TCP close
2947 Invalid control request specification EN3: Operation mode control
3008 Resource shortage error EN3: UDP send
3009
Receive request from CPU (word count)
abnormal
EN3: UDP/TCP receive
3011 Send buffer full EN3: TCP send
3012 Destination window size small EN3: TCP send
Invalid connection destination IP address EN7: TCP open
-11
Unable to send to specified destination EN7: UDP/TCP send
Timeout. Connection does not complete within
prescribed time
EN7: TCP open
-12
Timeout UDP/TCP receive
-14 Connection broken on the local system EN7: UDP/TCP send / receive
Resource shortage EN7: TCP open
Resource reservation failure EN7: UDP/TCP send, TCP close
-15
Unable to create socket because there is no
buffer area
EN7: UDP/TCP open
Not a valid socket identifier EN7: UDP/TCP open/close, UDP/TCP send/receive
-16
One of the socket identifier specified with bit
mask is invalid
EN7: TCP open
Argument (addr or addr length) not in valid
area within user address space
EN7: UDP/TCP open
-17
Invalid argument (buffer pointer) pointer UDP/TCP send/receive
2.20 Communication
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
585
Error
code
Error description Request type
Socket is set to asynchronous I/O mode and
there is none waiting connection
EN7: TCP open
No receive data EN7: UDP/TCP receive
-8
Send request not accepted EN7: UDP/TCP send
-19 Invalid message size EN7: UDP/TCP send
Bind already complete EN7: TCP open
-22
Invalid parameter EN7: TCP open
Connection is broken EN7: UDP/TCP receive
-32
Attempt was made to send to disconnected
socket
EN7: UDP/TCP send, TCP close
Invalid argument (name, name length) EN7: TCP open
-50
Invalid destination address specification EN7: UDP/TCP send
-54 Specified protocol not supported EN7: UDP/TCP open
-55
Specified socket type not supported in address
family
EN7: UDP/TCP open
Specified socket is not SOCK_STREAM type EN7: TCP open
Socket is not a type supporting listen EN7: TCP open
-56
Specified operation not supported with that
socket
EN7: UDP/TCP receive
Specified address family is currently
unsupported
EN7: UDP/TCP open
-58
Specified address family cannot be used with
that socket
EN7: UDP/TCP send
-59 Given address is already used EN7: UDP/TCP open
-60 Given address cannot be used in this system EN7: UDP/TCP open
-67 The socket is already connected EN7: TCP open
-69 Shutdown is issued EN7: UDP/TCP send
-71 Protocol error EN7: TCP open
-1001 Corresponding socket is busy EN7: All requests
-1002 Corresponding socket not generated EN7: All requests
-1005 PING timeout EN7: Other station verification
-1006 PING busy EN7: Other station verification
-1010 Socket type abnormal EN7: All requests
-1101 Receive memory block shortage EN7: Receive related requests
-2001 Communication request count exceeded EN7: All requests
-2002 Request buffer count exceeded EN7: All requests
-2005 Corresponding socket not open EN7: All requests
-2006 Used port count exceeded EN7: All requests
-2007 Reply timeout EN7: All requests
-2008 Buffer resource reservation failure EN7: All requests
-2009 EN board reset in progress EN7: All requests
-2201 Interrupt accept wait timeout EN7: All requests
-2202 Verification/specification response wait timeout EN7: All requests
Chapter 2 LD/FBD Instructions
6F8C1226
586
Error
code
Error description Request type
-5000
Communication instruction request count
exceeded
EN7: Reset, other station verification, UDP/TCP open
-5001 Command type abnormal EN7/EN3: All requests
-5002 Receive timeout EN7: All requests
-5003 Socket in use or not open EN7: UDP/TCP send/receive
-5004 Outside slot socket No. range EN7/EN3: All requests
-5005
Socket not open EN7: UDP/TCP send/receive, close
EN3: Socket No. retrieval
-5006 Duplicate port No. EN7: UDP/TCP open
-5007 Destination busy or disconnected EN7: TCP open send/receive
-5030 Invalid reset request EN9: Reset request
-5050 Reset in progress EN3: All except reset request
-5051 Register error (source) EN3: PC link register R/W
-5052 Response timeout (source) EN3: PC link register R/W
-5054 Memory write protect (source) EN3: PC link register R/W
-5056 Request count exceeded EN3: All requests
-5060 Boundary error (source) EN3: PC link register R/W
-5071 Register error (destination) EN3: PC link register R/W
-5072 Response timeout (destination) EN3: PC link register R/W
-5074 Memory write protect (destination) EN3: PC link register R/W
-5076 Send completion timeout (destination) EN3: PC link register R/W
-5080 Boundary error (destination) EN3: PC link register R/W
-5099 Other errors EN7: UDP/TCP send / receive
2.20 Communication
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
587
Notes for Duplex System
In a duplex system, the station bus transmission modules are separate modules in the
primary side and secondary side. Therefore, management information for transmission
modules is different (different resources).
For the control of the station bus transmission modules (e.g. socket generation), there is
a difference of whether to perform tracking of instance data of communication instruction
between the communication instruction for the integrated controller (USEND_T/URCV_T)
and communication instruction for the unified controller (USEND_N/URCV_N).
Therefore, in a user application program using communication instructions, information
must be initialized at duplex switching so that the operation starts from the initialization
state (socket open processing) again.
Refer to the overview of processing at duplex switching and user application examples
below, and make sure that the operation starts from the initialization state.
USEND_T/URCV_T/USEND_N/ URCV_N instruction does not operate unless this
operation is done.
Chapter 2 LD/FBD Instructions
6F8C1226
588
Overview of processing
1) Detect online upgrade with duplex switching event task (EV3).
Set the flag indicating that duplex switching occurs to TRUE(ON) ([Example (1)]).
(Example: DUPLEX_CHG_REQ=TRUE(ON))
2) In each of the programs using communication, initialize the instance data of
USEND_T/URCV_T instruction at duplex switching. Also, initialize information so
that the operation starts from the initialization state (socket open processing) again.
Initialization program ([Example (2)])
Important
Reset the flag that indicates that duplex switching set to TRUE(ON) in 1) occurs to FALSE(OFF)
when the initialization of all the related USEND_T/URCV_T instructions for all programs are
completed (initialization is performed only for the first scan after duplex switching).
Change the description to P equivalent circuit ([Example (3)]) if the REQ command
is input to USEND_T/URCV_T/USEND_N/URCV_N instruction using the
differentiation instruction (e.g. P).
Perform normal programming of USEND_T/URCV_T/USEND_N/URCV_N instruction
after implementing 2).
Controller
Communication
instruction
Tracking of
instruction
instance data
Instruction
instance data
initialize
Equivalent circuit of REQ
command to
communication instruction
Send USEND_T Integrated Controller
V series Receive URCV_T
Yes Required
Send USEND_N Unified Controller
nv series Receive URCV_N
No Not required
Required
2.20 Communication
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
589
Program example
[[Example (1)]: Program that detects online upgrade in EV3
[Example (2)]: Initialization program
[LD/FBD language notation]
DUPLEX_
CHG_REQ
TINZ_WORD
4
LD
16#0000
LD
N
USEND_T_1
ST
(** Initialize USEND_T_1 instance **)
B4_REQ_CMD B4_REQ_CMD REQ_CMD REQ_CMD (** Initialization of derivative contact
equivalent circuit variable of
USEND_T REQ command **)
DUPLEX_
CHG_REQ
DUPLEX_
CHG_REQ (** Duplex switch flag is reset. However, execute
flag when initialization of all USEND_T/URCV_T is
completed. **)
(R) (R)
(R)
[Example (3)]: P equivalent circuit and USEND_T instruction program
[LD/FBD language notation]
[ST language notation]
The ST language does not support the equivalent notations as the LD language, so data
hold types such as -(R)- and -(S)- or change detection types such as -|P|- and -|N|-
cannot be described. Therefore, program examples are omitted here.
REQ_CMD REQUEST B4_REQ_CMD REQ_CMD B4_REQ_CMD
(** USEND_T program **)
REQUEST
USEND_T
REQ
USEND_T_1
CMD
P
N
P
LD
CMD
LD
N
LD
DONE
ERROR
STATUS
DONE
ST
ERROR
ST
STATUS
ST
REQ_CMD REQUEST
Circuit when |P| is used
REQUEST
P
(** P input equivalent circuit to REQ command of USEND_T**)
DUPLEX_
CHG_REQ
DUPLEX_
CHG_REQ
Chapter 2 LD/FBD Instructions
6F8C1226
590
Communication FB (XMIT_T)
Communication Communication FB(XMIT_)
V dedicated
instruction
LD/FBD language
notation
Completion
output
Bus / Unit / Slot / Node no.
Send/receive data
Request command
Execution request
XMIT_T
REQ DONE
PRM ERROR
CMD STATUS
DATA
Error
Status
Instance
EN input Edge execution Index modification Modifier
ST language notation [Instance name]( REQ, PRM, CMD, DATA );
[Variable name]:=[Instance name]. DONE;
[Variable name]:=[Instance name]. ERROR;
[Variable name]:=[Instance name]. STATUS;
Arguments
Arg. Operand Type Const. Description Valid range
REQ BOOL
Execution request
PRM PTR
ST language notation Output := DUPLEX_CHG(Execution control input);
Arguments
Arg. Operand Type Const. Description Remarks
Input BOOL
Execution
control input
Output BOOL Output
Function
If the execution control input is FALSE(OFF), FALSE(OFF) is output without
performing any operation.
If the execution control input is TRUE(ON), online and standby are changed and
TRUE(ON) is output.
Execution
control input
Action Output
FALSE(OFF) FALSE(OFF)
TRUE(ON) Executed TRUE(ON)
Program example
[LD/FBD language notation]
[ST language notation]
SIGNAL2 := DUPLEX_CHG( SIGNAL1);
Online and standby are changed when the execution control input SIGNAL1 is
TRUE(ON).
SIGNAL2
1
ST
DUPLEX_CHG SIGNAL1
1
ST
Chapter 2 LD/FBD Instructions
6F8C1226
596
PS IF PU PS IF PU
DUPLEX_CHG
Online Standby
Before instruction execution:
PS IF PU PS IF PU
Online Standby
After instruction execution:
Error information
This instruction has no affect on non-duplex system.
If the target system is not in standby state, no switching is performed.
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
2.21 Duplex Control
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
597
Duplex SelfSystem Down
Duplex Control Duplex SelfSystem Down
LD/FBD language
notation
Execution control input Output
DUPLEX_DOWN
EN input Edge execution Index modification Modifier
S T language notation Output := DUPLEX_DOWN(Execution control input);
Arguments
Arg. Operand Type Const. Description Remarks
Input BOOL
Execution
control input
Output BOOL Output
Function
If the execution control input is FALSE(OFF), FALSE(OFF) is output without
performing any operation.
If the execution control input is TRUE(ON), shutdown of self system is forced and
TRUE(ON) is output.
Execution
control input
Action Output
FALSE(OFF) FALSE(OFF)
TRUE(ON) Executed TRUE(ON)
Program example
[LD/FBD language notation]
SIGNAL1
1
LD
DUPLEX_DOWN
SIGNAL2
1
ST
[ST language notation]
SIGNAL2 := DUPLEX_DOWN( SIGNAL1);
When the execution control input SIGNAL1 is TRUE(ON), shutdown of the self system
is forced.
Chapter 2 LD/FBD Instructions
6F8C1226
598
PS IF PU PS IF PU
DUPLEX_DOWN
Online Standby
Before instruction execution:
PS IF PU PS IF PU
Online Down
After instruction execution:
Error information
This instruction has no affect on non-duplex system.
When the target system is not in standby state, the self system is not shutdown.
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
2.21 Duplex Control
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
599
Partial Equalizer (variable specification)
Duplex Control Partial Equalizer (variable specification)
V dedicated
instruction
LD/FBD language
notation
Variable
specification
Parameter normal/abnormal
output
EQUALIZE_VAR
Equalizer size N
EN input Edge execution Index modification Modifier
ST language notation Parameter normal/abnormal output := EQUALIZE_VAR(variable
specification, N );
Arguments
Arg. Operand Type Const. Description Remarks
PTR Variable specification
Input
N UINT
ST language notation Parameter normal/abnormal output := EQUALIZE_ADDR( SCOPE,
ADDR, N );
Arguments
Arg. Operand Type Const. Description Remarks
SCOPE UINT
Variable type specification
3: DW register
4: User variable
ADDR DINT
1
1+Tis
Tds
1+Tds
1
Tis
1
Kp
+
-
+
-
+
+
+
+
-
+
+
PV
SV MV
Features
This is equivalent to hyper PID implemented in the small-scale system (MCS) and
CIEMAC-DS (PCS-DS).
An improved bilinear transformation is used for derivative calculation.
A hyper PID unique method is used for anti-reset-windup (AR/W) function. As AR/W
function, the integrating term is restricted (only in the decreasing direction of output
restriction) when restricting the MV output (when the internal totalized value does not
match the actual output).
The 2 degrees of freedom operation is filter format and can use three parameters: , ,
and .
Coefficient PID algorithm
1 1 1 General PID (deviation PID)
1 1 0 PI-D (PV derivative type PID)
0 1 0 I-PD
1 0 2 degrees of freedom for P term only
1 2 degrees of freedom for PD term only
0 2 degrees of freedom for PI term only
2 degrees of freedom for all
A gap function is used as a non-linear function. Depending on the amount of deviation,
the non-linear element defined by gap width and gap gain is reflected to the size of the
rate limiter.
2.22 Process Control
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
605
Current Output PID
Process Control Current Output PID
LD/FBD language
notation
Result output (MV)
PID_P
SV MV
PV
GAN
FFS
FFD
TR
MVT
LP_D
LP_P
Instance name
SV input
PV input
Feed forward gain
Feed forward static characteristic
Feed forward dynamic characteristic
Tracking MV input
Tracking request flag
LP data variable
LP parameter variable
EN input Edge execution Index modification Modifier
ST language notation [Instance name]( SV, PV, GAN, FFS, FFD, TR, MVT, LP_D, LP_P );
[Variable name]:=[Instance name]. MV;
Arguments
Arg. Operand Type Const. Description
SV REAL
SV input [Engineering value]
PV REAL
Feed forward gain
PID proportional gain compensation
Specify 1.0 when feed forward is not used
FFS
REAL
Feed forward static characteristic [%]
Specify 0.0 when feed forward is not used
FFD
REAL
Feed forward dynamic characteristic [%]
Specify 0.0 when feed forward is not used
TR
REAL
Tracking MV input [%]
When tracking, % value used as MV initial
value during initialization
MVT BOOL
tmpQ2
0
LD
tmpQ2
Demote to M mode on
detecting the first error
Reflect in
BOOL mode
FIC100.M
tmpQ2
FIC100.A
R
FIC100.RM
R
FIC100.C
R
CLD=0
(Execute only to
detect errors)
Set error judgment
condition required by
the system
PV process error
(Sensor error)
MV error
Valve position error
Chapter 2 LD/FBD Instructions
6F8C1226
612
Current Output Sample PI
Process Control Current Output Sample PI
LD/FBD language
notation
Result output (MV)
SPI_P
SV MV
PV
GAN
FFS
FFD
TR
MVT
LP_D
LP_P
Instance name
SV input
PV input
Feed forward gain
Feed forward static characteristic
Feed forward dynamic characteristic
Tracking MV input
Tracking request flag
LP data variable
LP parameter variable
EN input Edge execution Index modification Modifier
ST language notation [Instance name]( SV, PV, GAN, FFS, FFD, TR, MVT, LP_D, LP_P );
[Variable name]:=[Instance name]. MV;
Arguments
Arg. Operand Type Const. Description
SV REAL
Feed forward gain
PID proportional gain compensation
Specify 1.0 when feed forward is not used
FFS
REAL
Feed forward static characteristic [%]
Specify 0.0 when feed forward is not used
FFD
REAL
Feed forward dynamic characteristic [%]
Specify 0.0 when feed forward is not used
TR
REAL
Tracking MV input [%]
When tracking, % value used as MV initial value
during initialization
MVT BOOL
Feed forward gain
PID proportional gain compensation
Specify 1.0 when feed forward is not used
FFS
REAL
Feed forward static characteristic [%]
Specify 0.0 when feed forward is not used
MVT BOOL
Feed forward gain
PID proportional gain compensation
Specify 1.0 when feed forward is not used
FFS
REAL
Feed forward static characteristic [%]
Specify 0.0 when feed forward is not used
MVT BOOL
%
100-K3
100
100+K1
100
UNIT
low
limit
MED
Master input
AIR.PV F
%
A FUEL.PV
100+K4
100
100-K2
100
Chapter 2 LD/FBD Instructions
6F8C1226
636
Program example
[LD/FBD language notation]
Variables:
Variable Data type Dec.
PID_01 PID_P VAR
PID_02 PID_P VAR
PID_03 PID_P VAR
DCL_01 typeDCL_PARA VAR
Controller variable:
Variable Data type
!DIC100 typeLP_PARA
!DIC100 typeLP_DATA
!DIC100 typePV_DATA
!FIC100 typeLP_PARA
!FIC100 typeLP_DATA
!FIC100 typePV_DATA
!AIC100 typeLP_PARA
!AIC100 typeLP_DATA
!AIC100 typePV_DATA
In case of L1
User defined structure
typeDCL_PARA
Member Data type
K1 Real
K2 Real
K3 Real
K4 Real
BETA Real
MU Real
L Real
ADV Real
FDV Real
PID_P
DIC100.PV
LD
PV
FFS
PID_01
GAN
FFD
DIC100.MV
ST
MV
DIC100.MV
LD
TR
0
LD
MVT
DIC100.SV
LD
LP_D
DIC100.SV
LD
SV
DIC100.OA
LD
LP_P
LD
0
LD
0
LD
PID_P
FIC100.PV
LD
PV
FFS
PID_02
GAN
FFD
FIC100.MV
ST
MV
FIC100.MV
LD
TR
0
LD
MVT
FIC100.SV
LD
LP_D
FIC100.SV
LD
SV
FIC100.OA
LD
LP_P
LD
0
LD
0
LD
PID_P
AIC100.PV
LD
PV
FFS
PID_03
GAN
FFD
AIC100.MV
ST
MV
AIC100.MV
LD
TR
0
LD
MVT
AIC100.SV
LD
LP_D
AIC100.SV
LD
SV
AIC100.OA
LD
LP_P
LD
0
LD
0
LD
DCL_P
AIC100.PV
LD
AIR
FTR
DCL_01
FUEL
ATR
DCL_P
LD
DCL_P
DIC100.MV
LD
PV
FIC100.SV
LD
LP_FD
FIC100.OA
LD
LP_FP
FIC100.PV
LD
FIC100.MV
LD
AIC100.MV
LD
AIC100.SV
LD
LP_AD
AIC100.OA
LD
LP_AP
FIC100.SV
ST
FSV
AIC100.SV
ST
ASV
DCL control Master PID
Fuel flow PID Air flow PID
2.22 Process Control
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
637
[ST language notation]
(* Master PID *)
PID_01( DIC100.SV, DIC100.PV, 1, 0, 0, DIC100.MV, 0, DIC100.SV, DIC100.OA);
DIC100.MV := PID_01.MV;
(* DCL control *)
DCL_01( DIC100.MV, AIC100.PV, FIC100.PV, FIC100.MV, AIC100.MV, DCL_P,
FIC100.SV, FIC100.OA, AIC100.SV, AIC100.OA);
FIC100.SV := DCL_01.FSV;
AIC100.SV := DCL_01.ASV;
(* Fuel flow PID *)
PID_02( FIC100.SV, FIC100.PV, 1, 0, 0, FIC100.MV, 0, FIC100.SV, FIC100.OA);
FIC100.MV := PID_02.MV;
(* Air flow PID *)
PID_03( AIC100.SV, AIC100.PV, 1, 0, 0, AIC100.MV, 0, AIC100.SV, AIC100.OA);
AIC100.MV := PID_03.MV;
Performs double cross limit control with master PID (DIC100) result output (MV) as
master input, gives that result to fuel flow PID(FIC100) and air flow PID(AIC100), and
optimizes the fuel flow and air flow.
Error information
The following operation is performed when the input data type is REAL:
Controller Action
Integrated Controller
V series
L controller
If NAN data is entered as input, the result is NAN.
If INF data is entered as input, the result is INF.
Unified Controller nv series
NAN and INF data are limited by the maximum
value.
The fuel flow and air flow are calculated with % value as input when the respective
indicator is RH=RL.
The following operation is performed when the LP data, LP parameter or DCL
parameter specification is invalid:
Controller Action
Integrated Controller
V series
L controller
When variable other than LP tag data/parameter,
DCL parameter is specified, table operation error is
set to TRUE(ON) and output is previous value.
Unified Controller nv series
When variable other than LP tag data/parameter,
DCL parameter is specified, error flag and table
operation error are set to TRUE(ON) and output is
previous value.
Chapter 2 LD/FBD Instructions
6F8C1226
638
2.23 Tag Operation
No. Instruction Remarks
1 Change Adjuster Mode CMLP_P Changes the adjuster tag mode.
2
Change Push Button
Mode
CMPB_P Changes the push button mode.
3
Change Sequence
Mode
CMSQ_P Changes the sequence tag mode.
4 Set SV SSV_P
Changes the SV value of the adjuster tag at
constant rate.
Used together with Reset SV.
5 Reset SV RSV_P
Resets the change in SV value (Set SV) of the
adjuster tag. Used together with Set SV.
6 Set MV SMV_P
Changes the MV value of the adjuster tag at
constant rate.
Used together with Reset MV.
7 Reset MV RMV_P
Resets the change in MV value (Set MV) of the
adjuster tag. Used together with Set MV.
8 Shut CV SCV_P
Sets the MV value of the adjuster tag to constant
value and changes the mode. Used together with
Reset MV.
9 Push Button ON PB_P
Sets the push button tag button in pushed state
for 1 processing cycle.
10 Push Button Lock LB_P Sets the push button tag button in pushed state.
11 Action Timer ACT_P
Performs timer action using the timer tag. The
timer execution status can be
monitored/manipulated easily from OIS.
12 Action Counter ACC_P
Counts the program event every process cycle.
The counter execution status can be
monitored/manipulated easily from OIS.
13 Self Step Jump SJ_P
Jumps the current active location of the SFC
allocated to the sequence tag.
14 Reset Jump RJ_P
Resets all active locations of SFC allocated to the
sequence tag and jumps to a certain location.
15 Reset jump 2 RJ_P2
Resets all active locations of SFC allocated to the
sequence tag and jumps to a certain location
(corresponds with phase step 2).
16 SFC initialize INI_STEP
Clears all SFC steps including the specified initial
steps and activates the initial step.
The instructions of the Tag Operation are directives for the tags. Therefore it is important
to understand the tag structure and operation to use the instructions. Refer to the
following materials for description of the tags:
Integrated Controller V series model 3000/2000 Loop Controller L2/L3 Users Manual-
Functions 6F8C0885
2.23 Tag Operation
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
639
Change Adjuster Mode
Tag Operation Change Adjuster Mode
LD/FBD language
notation
Execution control input Output
CMLP_P
E
MODE
LP_D LP data variable
Mode
EN input Edge execution Index modification Modifier
ST language notation Output := CMLP_P( E, MODE, LP_D );
Arguments
Arg. Operand Type Const. Description Remarks
E BOOL
ST language notation Output := CMPB_P( E, MODE, PB_D );
Arguments
Arg. Operand Type Const. Description Remarks
E BOOL
ST language notation Output := CMSQ_P( E, MODE, SQ_D );
Arguments
Arg. Operand Type Const. Description Remarks
E BOOL
ST language notation Output := SSV_P( E, SVP, SVK, SVT, LP_P, LP_D );
Arguments
Arg. Operand Type Const. Description Remarks
E BOOL
Target value
SVK REAL
Tilt
SVT REAL
control section
Instrumentati on FB section
FIC100.MV
ST
FIC100.PV
LD
1
LD
0
LD
0
LD
FIC100.MV
LD
0
LD
FIC100.CLI
LD
FIC100.SV
LD
FIC100.
TAG[0]
LD
PID_P
PV
GAN
FFS
PID_01
SV
FFD
TR
MVT
LP_D
LP_P
MV
executi on section
FIC100.MVE
FIC100.CLI
FIC100.SSV
SSV_EXEC
( )
FIC100.SV
LD
SSV_EXEC
FIC100.SVP
LD
SEL_REAL
G
IN0
IN1
DIV_REAL
1000
LD
ZF[23]
LD
FIC100.SVK
LD
DIV_REAL
FIC100.SVT
LD
MUL_REAL
FIC100.SV
SET
SSV_EXEC
DLM_REAL
E
IN
D
SSV_EXEC
LD
In case of L3DS
DLM_01
OUT
Variables:
Variable Data type Dec.
SSV_REQ BOOL VAR
SSV_EXEC BOOL VAR
SIGNAL1 BOOL VAR
SIGNAL2 BOOL VAR
PID_01 PID_P VAR
DLM_01 DLM_REAL VAR
Chapter 2 LD/FBD Instructions
6F8C1226
648
Controller variables:
Variable Data type
!FIC100 typeLP_PARA_DS
!FIC100 typeLP_DATA_DS
ZF ARRAY[0..4095] OF REAL
[ST language notation]
(* SSV control section *)
SIGNAL1 := SSV_P( SSV_REQ, 80, 5, 1, FIC100.TAG[0], FIL100.CLI);
SIGNAL2 := RSV_P( SSV_REQ, FIL100.CLI);
*Positive transitionsensing contact (SSV_REQ) and negative transitionsensing
contact (SSV_REQ) do not perform the same operation as LD/FBD because they are
not supported by the ST language.
(* Instrumentation FB section *)
PID_01( FIC100.SV, FIC100.PV, 1, 0, 0, FIC100.MV, 0, FIC100.CLI, FIC100.TAG[0]);
FIC100.MV := PID_01.MV;
(* SSV execution section *)
SSV_EXEC := NOT(FIC100.MVE) AND NOT(FIC100.CLI) AND FIC100.SSV;
Z2 := SEL_REAL(SSV_EXEC, FIC100.SV, FIC100.SVP);
Z3 := ZF[23] / 1000 * FIC100.SVK / FIC100.SVT;
DLM_01(SSV_EXEC, Z2, Z3);
FIC100.SV := DLM_01.OUT;
SSV control section
At the rise of SSV request (SSV_REQ), requests Set SV directive (target value: 80, tilt:
5/s) to the adjuster tag (FIC100). At the fall of SSV, resets the Set SV directive.
Instrumentation FB section
Executes current output PID against the adjuster tag (FIC100).
SSV execution section
When the adjuster tag (FIC100) Set SV condition is satisfied (MVE=FALSE and
CLI=FALSE and SSV=TRUE), changes SV according to the requested content (SVP,
SVK, SVT). When the Set SV condition is not satisfied, SV holds the previous value.
2.23 Tag Operation
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
649
Reset SV
Tag Operation Reset SV
LD/FBD language
notation
Execution control inp
t
Output
RSV_P
LP data variable
E
LP_D
EN input Edge execution Index modification Modifier
ST language notation Output := RSV_P( E, LP_D );
Arguments
Arg. Operand Type Const. Description Remarks
E BOOL
ST language notation Output := SMV_P( E, MVP, MVK, MVT, LP_P, LP_D );
Arguments
Arg. Operand Type Const. Description Remarks
E BOOL
Target value
MVK REAL
Tilt
MVT REAL
control section
Instrumentati on FB section
FIC100.MV
ST
FIC100.PV
LD
1
LD
0
LD
0
LD
FIC100.MV
LD
0
LD
FIC100.CLI
LD
FIC100.SV
LD
FIC100.
TAG[0]
LD
PID_P
PV
GAN
FFS
PID_01
SV
FFD
TR
MVT
LP_D
LP_P
MV
execution section
FIC100.MVE
FIC100.CLI
FIC100.SMV SMV_EXEC
( )
FIC100.MV
LD
SMV_EXEC
FIC100.MVP
LD
SEL_REAL
G
IN0
IN1
DIV_REAL
1000
LD
ZF[23]
LD
FIC100.MVK
LD
DIV_REAL
FIC100.MVT
LD
MUL_REAL
DLM_REAL
E
IN
D
SMV_EXEC
LD
Variables:
Vari able Data type Dec.
SMV_REQ BOOL VAR
SMV_EXEC BOOL VAR
SIGNAL1 BOOL VAR
SIGNAL2 BOOL VAR
PID_01 PID_P VAR
DLM_01 DLM_REAL VAR
Controller vari ables:
Vari able Data type
!FIC100 typeLP_PARA_DS
!FIC100 typeLP_DATA_DS
ZF ARRAY[0..4095] OF REAL
In case of L3DS
DLM_01
OUT
Chapter 2 LD/FBD Instructions
6F8C1226
654
[ST language notation]
(* SMV control section *)
SIGNAL1 := SMV_P( SMV_REQ, 80, 5, 1, FIC100.TAG[0], FIL100.CLI);
SIGNAL2 := RMV_P( SMV_REQ, FIL100.CLI);
*Positive transition-sensing contact (SMV_REQ) and negative transition-sensing
contact (SMV_REQ) do not perform the same operation as LD/FBD because they are
not supported by the ST language.
(* Instrumentation FB section *)
PID_01( FIC100.SV, FIC100.PV, 1, 0, 0, FIC100.MV, 0, FIC100.CLI, FIC100.TAG[0]);
FIC100.MV := PID_01.MV;
(* SMV execution section *)
SMV_EXEC := NOT(FIC100.MVE) AND NOT(FIC100.CLI) AND FIC100.SMV;
Z2 := SEL_REAL(SMV_EXEC, FIC100.MV, FIC100.MVP);
Z3 := ZF[23] / 1000 * FIC100.MVK / FIC100.MVT;
DLM_01(SMV_EXEC, Z2, Z3);
FIC100.MV := DLM_01.OUT;
SMV control section
At the rise of SMV request (SMV_REQ), requests Set MV directive (target value: 80,
tilt: 5/s) to the adjuster tag (FIC100). At the fall of SMV, resets the Set MV directive.
Instrumentation FB section
Executes current output PID against the adjuster tag (FIC100).
SMV execution section
When the adjuster tag (FIC100) Set MV condition is satisfied (MVE=FALSE and
CLI=FALSE and SMV=TRUE), changes MV according to the requested content (MVP,
MVK, MVT). When the Set MV condition is not satisfied, MV holds the previous value.
2.23 Tag Operation
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
655
Reset MV
Tag Operation Reset MV
LD/FBD language
notation
Execution control input Output
RMV_P
E
LP_D
LP data variable
EN input Edge execution Index modification Modifier
ST language notation Output := RMV_P( E, LP_D );
Arguments
Arg. Operand Type Const. Description Remarks
E
BOOL
Execution control
input
Input
LP_D PTR LP data variable
Output BOOL Output
A pointer to tag table is placed in LP data variable.
A setup example is shown below.
Array No.=0, tag No.=FIC100 are assumed for the used adjuster tag.
Notation
Operand
Array Tag symbol
LP_D LP_DATA[0] FIC100.CLI
The following tag symbols are referenced by this instruction:
Operand Symbol Type R/W Description
LP_D
(LP_DATA)
SMV BOOL W SEQ-MV intervention status
R/W: R=Read only, W=Write only, R/W=Read/Write
Function
When the execution control input E is FALSE(OFF), FALSE(OFF) is output without
performing any operation.
When the execution control input E is TRUE(ON), the SMV of the LP data variable
specified with LP_D is reset to FALSE(OFF) and TRUE(ON) is output as the result.
(Resetting Set MV directive).
This instruction is used together with the Set MV (SMV_P) instruction.
Chapter 2 LD/FBD Instructions
6F8C1226
656
The following variables can be specified for the LP data:
Controller Variable
Integrated Controller
V series
L controller LP tag data variable
Unified Controller
nv series
type2 LP tag data variable
Execution
control input
Action Output
FALSE(OFF) No process FALSE(OFF)
TRUE(ON) Resets the Set MV directive of the specified LP
variable
TRUE(ON)
Program example
Refer to the program example of the Set MV (SMV_P) instruction.
Error information
The following operation is performed when invalid variable is specified for the LP data:
Controller Action
Integrated Controller
V series
L controller
When variable other than LP tag data is specified
table operation error is set to TRUE(ON) and the
result is FALSE(OFF).
Unified Controller nv series
When variable other than LP tag data is specified
error flag and table operation error are set to
TRUE(ON) and the result is FALSE(OFF).
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
2.23 Tag Operation
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
657
Shut CV
Tag Operation Shut CV
LD/FBD language
notation
Execution control input Output
SCV_P
E
MOD
MV
LP_P
LP_D
MV value
Mode
LP parameter variable
LP data variable
EN input Edge execution Index modification Modifier
ST language notation Output := SCV_P( E, MOD, MV, LP_P, LP_D );
Arguments
Arg. Operand Type Const. Description Remarks
E BOOL
Mode (0:M,1:A,2:C,3:RM)
MV REAL
MV value[%]
LP_P PTR LP parameter variable
Input
LP_D PTR LP data variable
Output BOOL Output
Pointers to tag table are placed in LP parameter variable and LP data variable.
A setup example is shown below.
Array No.=0, tag No.=FIC100 are assumed for the used adjuster tag.
Notation
Operand
Array Tag symbol
LP_P LP_PARA[0] FIC100.TAG[0]
LP_D LP_DATA[0] FIC100.CLI
The following tag symbols are referenced by this instruction:
Operand Symbol Type R/W Description
MVP REAL R/W MV ramp target value
MVK REAL R/W MV ramp increment
LP_P
(LP_PARA)
MVT REAL R/W MV ramp time coefficient
LP_D
(LP_DATA)
SMV
BOOL W SEQ-MV intervention status
R/W: R=Read only, W=Write only, R/W=Read/Write
Chapter 2 LD/FBD Instructions
6F8C1226
658
Function
When the execution control input E is FALSE(OFF), FALSE(OFF) is output without
performing any operation.
When the execution control input E is TRUE(ON), the MV value is set immediately to
the specified value and the mode is set to the specified mode.
Sets setup information of the LP parameter variable specified with LP_P to the value
specified with the input argument (MVP=input argument MV, MVK=2000, MVT=1),
sets the SMV of LP data variable specified by LP_D to TRUE(ON), sets the mode to
the mode specified with the input argument, and outputs TRUE(ON) as the result.
(Start of Set MV directive, the actual action is step action (change immediately to
specified MV value) because the tilt is set large).
This instruction provides the setup information (MVP, MVK, MVT) and directive (SMV)
to perform ramp MV action, but does not perform the actual ramp MV action. A
separate program must be created to perform the ramp MV action (See program
example).
This instruction is used together with the Reset MV (RMV_P) instruction.
The following variables can be specified for the LP data/parameter.
Controller Variable
Integrated Controller V series L controller LP tag data/parameter variable
Unified Controller nv series type2 LP tag data/parameter variable
Execution
control input
Action Output
FALSE(OFF) No process FALSE(OFF)
TRUE(ON) Starts the Set MV directive of the specified LP variable TRUE(ON)
Error information
The following operation is performed when the input data type is REAL:
Controller Action
Integrated Controller
V series
L controller
When NAN is input, the result is FALSE(OFF) and NAN
input error flag is set to TRUE(ON).
When INF is input the result is FALSE(OFF).
Unified Controller nv series NAN and INF data are limited by the maximum value.
The following operation is performed when the LP data or LP parameter specification
is invalid:
Controller Action
Integrated Controller
V series
L controller
When variable other than LP tag data/parameter is
specified, table operation error is set to TRUE(ON) and
the result is FALSE(OFF).
Unified Controller nv series
When variable other than LP tag data/parameter is
specified, error flag and table operation error are set to
TRUE(ON) and the result is FALSE(OFF).
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
2.23 Tag Operation
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
659
Program example
[LD/FBD language notation]
FIC100.MV
SET
SCV_EXEC
SCV_P
SIGNAL1
ST
E
10
LD
MV
0
LD
MOD
FIC100.
TAG[0]
LD
LP_P
FIC100.CLI
LD
LP_D
SCV_REQ
RMV_P
SIGNAL2
ST
E
FIC100.CLI
LD
LP_D
SCV_REQ
control
i
Instrumentati on FB section
FIC100.MV
ST
FIC100.PV
LD
1
LD
0
LD
0
LD
FIC100.MV
LD
0
LD
FIC100.CLI
LD
FIC100.SV
LD
FIC100.
TAG[0]
LD
PID_P
PV
GAN
FFS
PID_01
SV
FFD
TR
MVT
LP_D
LP_P
MV
C execution section
FIC100.MVE
FIC100.CLI
FIC100.SMV SCV_EXEC
( )
FIC100.MV
LD
SCV_EXEC
FIC100.MVP
LD
SEL_REAL
G
IN0
IN1
DIV_REAL
1000
LD
ZF[23]
LD
FIC100.MVK
LD
DIV_REAL
FIC100.MVT
LD
MUL_REAL
DLM_REAL
E
IN
D
SCV_EXEC
LD
Variabl es:
Variable Data type Dec.
SCV _REQ BOOL VAR
SCV_EXEC BOOL VAR
SIGNAL1 BOOL VAR
SIGNAL2 BOOL VAR
PID_01 PID_P VAR
DLM_01 DLM_REAL VAR
Control ler variables:
Variable Data type
!FIC100 typeLP_PARA_DS
!FIC100 typeLP_DATA_DS
ZF ARRAY[0..4095] OF REAL
In case of L3DS
DLM_01
OUT
Chapter 2 LD/FBD Instructions
6F8C1226
660
[ST language notation]
(* SCV control section *)
SIGNAL1 := SCV_P( SCV_REQ, 0, 10, FIC100.TAG[0], FIL100.CLI);
SIGNAL2 := RMV_P( SCV_REQ, FIL100.CLI);
*Positive transitionsensing contact (SCV_REQ) and negative transitionsensing
contact (SCV_REQ) do not perform the same operation as LD/FBD because they are
not supported by the ST language.
(* Instrumentation FB section *)
PID_01( FIC100.SV, FIC100.PV, 1, 0, 0, FIC100.MV, 0, FIC100.CLI, FIC100.TAG[0]);
FIC100.MV := PID_01.MV;
(* SCV execution section *)
SCV_EXEC := NOT(FIC100.MVE) AND NOT(FIC100.CLI) AND FIC100.SMV;
Z2 := SEL_REAL(SCV_EXEC, FIC100.MV, FIC100.MVP);
Z3 := ZF[23] / 1000 * FIC100.MVK / FIC100.MVT;
DLM_01(SCV_EXEC, Z2, Z3);
FIC100.MV := DLM_01.OUT;
SCV control section
At the rise of SCV request (SCV_REQ), requests Set MV directive (MV value:10) to
the adjuster tag (FIC 100) and sets the mode to M. At the fall of SCV, resets the Set
MV directive.
Instrumentation FB section
Executes current output PID against the adjuster tag (FIC100).
SCV execution section
When the adjuster tag (FIC100) Set MV condition is satisfied (MVE=FALSE and
CLI=FALSE and SMV=TRUE), changes MV according to the requested content (MVP,
MVK, MVT) (resulting in MV=10 immediately after the rise of SCV_REQ). When the
Set MV condition is not satisfied, MV holds the previous value.
2.23 Tag Operation
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
661
Push Button ON
Tag Operation Push Button ON
LD/FBD language
notation
Executi on control i nput Output
PB_P
E
BNO
PB_P
PB_D
Mode
PB parameter variable
PB data variable
EN input Edge execution Index modification Modifier
ST language notation Output := PB_P( E, BNO, PB_P, PB_D );
Arguments
Arg. Operand Type Const. Description Remarks
E BOOL
ST language notation Output := LB_P( E, BNO, PB_D );
Arguments
Arg. Operand Type Const. Description Remarks
E BOOL
Push button No. (0: Reset, 1
to 8: button No.)
Input
PB_D PTR PB data variable
Output BOOL Output
A pointer to tag table is placed in PB data variable.
A setup example is shown below.
Array No.=0, tag No.=FIC100 are assumed for the used push button tag.
Notation
Operand
Array Tag symbol
PB_D PB_DATA[0] XV100.ASA
The following tag symbols are referenced by this instruction:
Operand Symbol Type R/W Description
PB_D
(PB_DATA)
IFO[n] BOOL W
Button lock request (n=0: button 1 to 7: button 8)
(corresponding button locked when 1, unlocked
when all bits are 0)
R/W: R=Read only, W=Write only, R/W=Read/Write
Function
When the execution control input E is FALSE(OFF), FALSE(OFF) is output without
performing any operation.
When the execution control input E is TRUE(ON), the specified push button is locked.
When the push button No. (BNO) is between 1 and 8, the corresponding button is
locked. If the push button No. is 0, the button is unlocked.
Sets the corresponding bit of the IFO of the PB data variable specified by PB_D to
TRUE(ON) (or resets all bits to FALSE(OFF)) and outputs TRUE(ON) as the result
(Button lock directive).
2.23 Tag Operation
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
665
This instruction locks the button (IFO). The content of IFO is reflected in FO by
standard output process. Therefore, the result of this instruction is not reflected when
FO is accessed immediately after executing this instruction (in that control cycle). The
reflected result can be accessed on the next cycle.
The following parameters can be specified for the PB data:
Controller Variable
Integrated Controller
V series
L controller PB tag data variable
Unified Controller
nv series
type2 PB tag data variable
Execution
control input
Action Output
FALSE(OFF) No process FALSE(OFF)
TRUE(ON)
Executes button lock directive of the specified PB
variable
TRUE(ON)
Program example
[LD/FBD language notation]
LB_P
SIGNAL1
ST
E
2
LD
BNO
XV100.ASA
LD
PB_D
LB_REQ
P
Variables:
Variable Data type Dec.
LB_REQ BOOL VAR
SIGNAL1 BOOL VAR
SIGNAL2 BOOL VAR
Controller variables:
Variable Data type
!XV100 typePB_PARA_DS
!XV100 typePB_DATA_DS
In case of L3DS
LB_P
SIGNAL2
ST
E
0
LD
BNO
XV100.ASA
LD
PB_D
LB_REQ
N
[ST language notation]
SIGNAL1 := LB_P( LB_REQ, 2, XV100.ASA);
SIGNAL2 := LB_P( LB_REQ, 0, XV100.ASA);
At the rise of LB request (LB_REQ), issues a button 2 lock directive for the push button
tag (XV100). At the fall of LB request, unlocks the lock.
Error information
The following operation is performed when invalid variable is specified for the PB data:
Controller Action
Integrated Controller
V series
L controller
When variable other than PB tag data is specified,
table operation error is set to TRUE(ON) and the
result is FALSE(OFF).
Unified Controller nv series
When variable other than PB tag data is specified,
error flag and table operation error are set to
TRUE(ON) and the result is FALSE(OFF).
If the push button on (BNO) is out of range (not 0 to 8), the instruction is treated as no
process.
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
Chapter 2 LD/FBD Instructions
6F8C1226
666
Action Timer
Tag Operation Action Timer
LD/FBD language
notation
Execution control input Output
ACT_P
E
STATE
T_D
Directive to timer
T data variable
EN input Edge execution Index modification Modifier
ST language notation Output := ACT_P( E, STATE, T_D );
Arguments
Arg. Operand Type Const. Description Remarks
E BOOL
Directive to timer
(0: Start/1: Stop/2: Reset)
Input
T_D PTR T data variable
Output BOOL Output
A pointer to tag table is placed in T data variable.
A setup example is shown below.
The timer tag to be used will be array No.=0.
T_DATA[0]
The following tag symbols are referenced by this instruction:
Operand Symbol Type R/W Description
STAT BOOL W Start
STOP BOOL W Stop
T_D
(T_DATA)
RST BOOL W Reset
R/W: R=Read only, W=Write only, R/W=Read/Write
The following symbols can be accessed to check the execution status of the timer tag:
Operand Symbol Type R/W Description
T_PARA SET INT R/W Set value (target value)
VAL INT R/W Clock value (current value)
STAT BOOL R Start
STOP BOOL R Stop
RST BOOL R Reset
T_DATA
UP BOOL R Timeout
R/W: R=Read only, W=Write only, R/W=Read/Write
2.23 Tag Operation
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
667
For the timer tag, the unit of SET and VAL is different between the first half and second
half of the array.
Array No. Unit Clock range Accuracy (error)
0 to 255 0.1 s 0.0[s] to 3276.7[s]
0.1 [s] max. or main scan cycle
(whichever is greater)
256 to 511 0.1 min
0.0[min] to 3276.7[min]
(0.0[s] to 196602[s])
0.1 [min] max.(6[s]) or main scan cycle
(whichever is greater)
Function
When the execution control input E is FALSE(OFF), FALSE(OFF) is output without
performing any operation.
When the execution control input E is TRUE(ON), the specified timer tag is activated.
Manipulates the STAT, STOP, RST of the T data variable specified by T_D and outputs
ON as the result (timer manipulation directive). The relationships between the directive
(STATE) to the timer and STAT, STOP, RST are as shown below and either STAT,
STOP, or RST is set to ON.
Manipulation Directive to
timer
STATE
STAT STOP RST
0Start ON OFF OFF
1Stop OFF ON OFF
2Reset OFF OFF ON
When the clock value (VAL) of the timer tag reaches the set value (SET), judgment
can be made with UP status (UP).
When the set value (SET) of the timer tag is set to "0", UP status becomes ON
regardless of the timer operation status.
Even when the clock value (VAL) of the timer tag reaches the set value (SET), clocking
is continued up to the maximum value (32767).
The timer operates only in the increasing direction.
The following variables can be specified for the T data:
Controller Variable
Integrated Controller
V series
L controller T tag data variable
Unified Controller
nv series
type2 T tag data variable
Execution
control input
Action Output
FALSE(OFF) No process FALSE(OFF)
TRUE(ON)
Executes timer manipulation directive of the
specified T variable
TRUE(ON)
Chapter 2 LD/FBD Instructions
6F8C1226
668
Timing chart
T_DATA[nA].VAL
Timer maximum(32767)
Timer initial value (0)
T_DATA[n].STAT
T_DATA[n].STOP
T_DATA[n].RST
T_DATA[n].UP
t
T_PARA[n].SET
Start Stop Reset
Start
Reset
Start
Error information
If the T data specification is incorrect (such as specifying variable other than T tag
data), the table operation error is set to TRUE(ON) and the instruction itself is treated
as no process.
The following operation is performed when invalid variable is specified for the T data:
Controller Action
Integrated Controller
V series
L controller
When variable other than T tag data is specified,
table operation error is set to TRUE(ON) and the
result is FALSE(OFF).
Unified Controller nv series
When variable other than T tag data is specified,
error flag and table operation error are set to
TRUE(ON) and the result is FALSE(OFF).
If the directive to the timer (STATE) is out of range (not 0 to 2), the instruction is treated
as no process.
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
Notes
This instruction executes a timer manipulation directive (STAT, STOP, RST). The timer
tag clocking (updating current value, timeout judgment) is synchronized with the main
scan process and is performed before program execution. Therefore, the result of this
instruction is not reflected when UP status is accessed immediately after executing
this instruction (in that control cycle). The reflected result can be accessed on the next
cycle. Also, when using this instruction in a high-speed scan process, caution is
necessary because the actual timer tag clocking is synchronized with the scan
process.
2.23 Tag Operation
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
669
The timer accuracy (tolerance) is affected by the scan process cycle because the timer
clocking is synchronized with the main scan process. At maximum, the offset is equal
to the main scan process cycle.
If this instruction is executed for the same timer tag more than once in the same
process cycle, the instruction (directive) executed last is effective and other
instructions are not reflected (either start, stop, or reset action per process cycle).
Only the timer tag (T_PARA(DATA)) can be used with this instruction. Clock or count
down (TC_PARA(DATA)) cannot be used.
Program example
[LD/FBD language notation]
ACT_P
SIGNAL1
ST
E
0
LD
STATE
T_DATA[0]
LD
T_D
STAT_REQ
Variables:
Variable Data type Dec.
STAT_REQ BOOL VAR
STOP_REQ BOOL VAR
RST_REQ BOOL VAR
SIGNAL1 BOOL VAR
SIGNAL2 BOOL VAR
SIGNAL3 BOOL VAR
Controller variables:
Variable Data type
T_PARA ARRAY[0..511] OF typeT_PARA_DS
T_DATA ARRAY[0..511] OF typeT_DATA_DS
In case of L3DS
ACT_P
SIGNAL2
ST
E
1
LD
STATE
T_DATA[0]
LD
T_D
STOP_REQ
ACT_P
SIGNAL3
ST
E
2
LD
STATE
T_DATA[0]
LD
T_D
RST_REQ
T_DATA[0].UP
UP time
process
[ST language notation]
SIGNAL1 := ACT_P( STAT_REQ, 0, T_DATA[0]);
SIGNAL2 := ACT_P( STOP_REQ, 1, T_DATA[0]);
SIGNAL3 := ACT_P( RST_REQ, 2, T_DATA[0]);
At the rise of start request (STAT_REQ), issues a start directive to the timer tag (T_DATA[0]).
At the rise of stop request (STOP_REQ), issues a stop directive to the timer tag (T_DATA[0]).
At the rise of reset request (RST_REQ), issues a reset directive to the timer tag (T_DATA[0]).
At time-up (T_DATA[0].UP=ON), executes the UP time process.
Chapter 2 LD/FBD Instructions
6F8C1226
670
Action Counter
Tag Operation Action Counter
LD/FBD language
notation
Execution control
i
Output
ACC_P
E
STATE
C_D
Directive to counter
C data variable
EN input Edge execution Index modification Modifier
ST language notation Output := ACC_P( E, STATE, C_D );
Arguments
Arg. Operand Type Const. Description Remarks
E BOOL
Directive to counter
0: Increment, 1: Decrement, 2: Reset
Input
C_D PTR C data variable
Output BOOL Output
A pointer to tag table is placed in C data variable.
A setup example is shown below.
The timer tag to be used will be array No.=0.
C_DATA[0]
The following tag symbols are referenced by this instruction:
Operand Symbol Type R/W Description
INC BOOL W Increment
DEC BOOL W Decrement
C_D
(C_DATA)
RST BOOL W Reset
R/W: R=Read only, W=Write only, R/W=Read/Write
The following symbols can be accessed to check the execution status of the counter tag:
Operand Symbol Type R/W Description
C_PARA SET INT R/W Set value (target value)
VAL INT R/W Clock value (current value)
STAT BOOL R Start
STOP BOOL R Stop
RST BOOL R Reset
UP BOOL R Count up
C_DATA
DOWN BOOL R Count down
R/W: R=Read only, W=Write only, R/W=Read/Write
2.23 Tag Operation
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
671
Function
When the execution control input E is FALSE(OFF), FALSE(OFF) is output without
performing any operation.
When the execution control input E is TRUE(ON), the specified counter tag is
activated.
Manipulates the INC, DEC, RST of the C data variable specified by C_D and outputs
TRUE(ON) as the result (timer manipulation directive). The relationships between the
directive (STATE) to the counter and INC, DEC, RST are as shown below and either
INC, DEC, or RST is set to ON.
Manipulation Directive to counter
STATE INC DEC RST
0:Increment ON OFF OFF
1:Decrement OFF ON OFF
2:Reset OFF OFF ON
The UP status (UP) and DOWN status (DOWN) operate (judged) as follows according to
the relationship between the current value (VAL) and set value (SET) of the counter tag.
Relationship between current
value and set value
UP DOWN
Current value Set value ON OFF
Current value -Set value OFF ON
Current value = Set value = 0 ON ON
Even when the current value (VAL) reaches the set value (SET), clocking is continued
up to the maximum value (32767) or minimum value (-32768).
The counter is incremented by Increment (INC) and decremented by Decrement
(DEC).
The following variables can be specified for the C data:
Controller Variable
Integrated Controller
V series
L controller C tag data variable
Unified Controlle
nv series
type2 C tag data variable
Execution
control input
Action Output
FALSE(OFF) No process FALSE(OFF)
TRUE(ON) Executes counter manipulation directive of the
specified C variable
TRUE(ON)
Chapter 2 LD/FBD Instructions
6F8C1226
672
Timing chart
Counter maximum(32767)
Counter initial value(0)
-C_PARA[n].SET
C_DATA[n].UP
C_DATA[n].DOWN
t
Counter minimum(-32768)
C_PARA[n].SET
C_DATA[n].VAL
Increment
Decrement Reset Decrement
Set value=0
Reset
Increment
Error information
The following operation is performed when invalid variable is specified for the C data:
Controller Action
Integrated Controller
V series
L controller
When variable other than C tag data/parameter is
specified, table operation error is set to TRUE(ON) and
the result is FALSE(OFF).
Unified Controller nv series
When variable other than C tag data/parameter is
specified, error flag and table operation error are set to
TRUE(ON) and the result is FALSE(OFF).
If the directive (STATE) to the counter is out of range (not 0 to 2), the instruction is
treated as no process.
When EN is used, ENO output is reset to FALSE(OFF) when the above error occurs.
Notes
This instruction executes a counter manipulation directive (INC, DEC, RST). The
updating of the counter tag (current value count, up judgment) is synchronized with the
main scan process and is performed before program execution. Therefore, the result
of this instruction is not reflected when UP status is accessed immediately after
executing this instruction (in that control cycle). The reflected result can be accessed
on the next cycle. Also, when using this instruction in a high-speed scan process,
caution is necessary because the actual counter tag update is synchronized with the
scan process.
If this instruction is executed for the same counter tag more than once in the same
process cycle, the instruction (directive) executed last is effective and other
instructions are not reflected (only 1 count changes per process cycle).
Only the counter tag (C_PARA(DATA)) can be used with this instruction. Clock or
count down (TC_PARA(DATA)) cannot be used.
2.23 Tag Operation
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
673
Program example
[LD/FBD language notation]
ACC_P
SIGNAL1
ST
E
0
LD
STAT
E
C? DATA[0]
LD
C_D
INC_REQ
P
Variables:
Variable Data type Dec.
INC_REQ BOOL VAR
DEC_REQ BOOL VAR
RST_REQ BOOL VAR
SIGNAL1 BOOL VAR
SIGNAL2 BOOL VAR
SIGNAL3 BOOL VAR
Controller variables:
Variable Data type
C_PARA ARRAY[0..511] OF typeC_PARA_DS
C_DATA ARRAY[0..511] OF typeC_DATA_DS
In case of L3DS
ACC_P
SIGNAL2
ST
E
1
LD
STAT
E
C? DATA[0]
LD
C_D
DEC_REQ
P
ACC_P
SIGNAL3
ST
E
2
LD
STAT
E
C? DATA[0]
LD
C_D
RST_REQ
P
C_DATA[0].UP
UP time
process
DOWN time
process
C_DATA[0].DOWN
[ST language notation]
SIGNAL1 := ACC_P( INC_REQ, 0, C_DATA[0]);
SIGNAL2 := ACC_P( DEC_REQ, 1, C_DATA[0]);
SIGNAL3 := ACC_P( RST_REQ, 2, C_DATA[0]);
At the rise of increment request (INC_REQ), issues an increment directive to the
counter tag (C_DATA[0]). At the rise of decrement request (DEC_REQ), issues a
decrement directive to the counter tag (C_DATA[0]). At the rise of reset request
(RST_REQ), issues a reset directive to the counter tag (C_DATA[0]).
At count up (C_DATA[0].UP=ON), executes the UP time process.
At count down (C_DATA[0].DOWN=ON), executes the DOWN time process.
Chapter 2 LD/FBD Instructions
6F8C1226
674
Self Step Jump
Tag Operation Self Step Jump
LD/FBD language
notation
Execution control input Output
SJ_P
E
STEP
Jump destination step
EN input Edge execution Index modification Modifier
ST language notation Output := SJ_P( E, STEP );
Arguments
Arg. Operand Type Const. Description Remarks
E BOOL
ST language notation Output := RJ_P( E, SQ_P, STEP );
Arguments
Arg. Operand Type Const. Description Remarks
E BOOL
ST language notation Output := RJ_P2 ( E, SQ_P, PHNO );
Arguments
Arg. Operand Type Const. Description Remarks
E BOOL
ST language notation Output := INI_STEP( E, STEP );
Argument
Arg. Operand Type Const. Description Remarks
E BOOL
Interlock circuit diagnosis
permission
1 : Permitted,
0 : Prohibited
DSP BOOL
*1
Interlock circuit screen
permission
1 : Permitted,
0 : Prohibited
Input
GRP UINT
Interlock circuit diagnosis
permission
1: Permitted, 0:
Prohibited
FFENA BOOL
Interlock circuit first fault
diagnosis permission
1: Permitted, 0:
Prohibited
DSP BOOL
*1
Interlock circuit screen
permission
1: Permitted, 0:
Prohibited
Input
GRP UINT
Single step
execution
After 1 scan
>
<Initialized state> <During execution (1 scan only) > <After executing 1 scan>
All transition conditions are assumed to be satisfied.
When single step execution is performed once from an initialized state such as
Initializing (long stop) or immediately after program DL, the INI step is activated for just
one scan time and the active location moves to PHASE1. And when single step
execution is performed again, the phase part of PHASE1 is executed in sequence one
step at a time from the initial step.
Chapter 3 SFC Instructions
6F8C1226
718
Changing the active location
The SFC network connected to a sequence instruction can change the active location
from OIS-DS, tool, or instruction.
Changing the active location from OIS-DS is possible when the SFC network is
stopped (RM mode) and the change can be made in phase units.
Changing the active location from the tool is possible when the SFC network is
stopped (RM or M mode) and the change can be made in step units.
Changing the active location from an instruction is possible when the SFC network is
executing (A or C mode) and the change can be made in step units. The instructions to
change the active location are Reset Jump (RJ_P) and Self Step Jump (SJ_P). Reset
jump activates the specified step after initializing (resetting all active information) the
SFC network similar to OIS-DS and tool. On the other hand, Self Step Jump makes
the step to which the Self Step Jump is connected to inactive and activates the
specified step. Therefore, when self step jump is performed within a parallel process,
only that active location is changed and other parallel active locations are unaffected.
This is summarized in the following table:
Method Unit
Possible
mode
Action
OIS-DS Phase RM Resets all active information and activates specified phase
Tool Step RM or M Resets all active information and activates specified step
Instruction (RJ_P) Step A or C Resets all active information and activates specified step
Instruction (SJ_P) Step A or C Makes self step inactive and activates specified step
Notes
Neither OIS-DS, tool, nor instruction can change the active location to within a parallel
process (does not become parallel action). If the active location is switched inside a
parallel process, steps are executed in sequence from that location and held at the end
of the parallel process (waiting for other parallel process to end). In such case, the
activate location must be switched once more.
Changing the active location
OIS-DS:
Change the mode to RM (press the
M
button twice) in the point screen of the sequence.
Press the
[Phase change]
button.
Select the change destination phase from the phase list and press
[Change]
.
Tool:
From the control panel of the program editor, change the mode to M or RM (press the
button).
Select the change destination step and press the
button.
Change the mode to A or C (press the
button).
Refer to "2.23 Tag Operation" for information on instructions RJ_P and SJ_P.
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
719
Program example
T1
T2
T3
INI
SEQ001
SEQ
1 PHASE1
Time#10s
2 PHASE2
Time#10s
T1
T2
T3
INI
SEQ001
SEQ
1 PHASE1
Time#10s
2 PHASE2
Time#10s
<In M or RM mode> <In A or C mode>
Stop SFC network when SEQ001 mode is M (or RM).
Sequentially execute SFC network when SEQ001 mode is A (or C).
Restriction
This instruction must be written at the beginning of an SFC network. If it is written in
the middle of an SFC network, its operation will be unstable (not as expected).
The beginning of the sequence parameter must be specified for the SQ parameter. An
index register cannot be specified for array No. A table operation error will occur if
there is an incorrect specification.
Correct example :SQ_PARA[1] :SEQ001.TAG[0]
Wrong example :SQ_DATA[1] :SEQ001.TYPE SQ_PARA[XI]
Chapter 3 SFC Instructions
6F8C1226
720
Phase Step
SFC Phase Step
Diagram
Step name
Congestion timer
N: Phase no. (1-32)
EN input Edge execution Index modification
Modifier
Function
Unlike the Step instruction, action (sub screen) is performed from the phase step itself.
When the transition condition of the previous step becomes TRUE(ON), the connected
phase step becomes active and executes the ladder circuit or action connected to the
right side of the phase step (if conf progress wait, the connection on the right side of
the phase step remains FALSE(OFF) and the ladder circuit is not executed. (When
"acknowledge operation" is performed the connection on the right side of the phase
step becomes TRUE(ON)). At the same time, the SFC network written in the action
(sub screen) is executed as "phase". When phase execution completes (phase end
instruction becomes active) and the transition condition of the proceeding step
becomes TRUE(ON), its own phase step is deactivated (inactive).
The portion containing the Sequence instruction and Phase Step instruction is referred
to as the operation and the portion expanded by the Phase Step instruction is referred
to as the phase.
A number from 1 to 32 is set as the phase No. This number is used to associate with a
sequence tag member (phase name (PNAM) and interlock/single selection (FA)) and
the phase execution status can be monitored from OIS-DS.
The Phase Step instruction has a congestion monitor timer. If phase execution does
not completed before the congestion monitor timer expires, a congestion alarm is
issued. In this case, the timer value is limited by the set value. Congestion monitor is
disabled when the congestion monitor timer is set to 0 seconds (time#0s).
The step state can be determined from the following variables:
Step flag : Step name .X (TRUE(ON) when step is active,
FALSE(OFF) when step is inactive)
Step execution duration : Step name .T (represents the duration when step is
active and is cleared to 0 the first time the step is
active)
Phase step cannot be placed consecutively with other steps. A transition must be
placed between phase step and other step.
Phase step is not executed consecutively within the same scan.
Conf progress and continuous progress
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
721
Phase execution can be controlled with sequence tag execution control information
(mode, interlock/single setting). When the sequence tag mode is C mode, phase is
executed continuously regardless of the interlock/single setting. When the sequence
tag mode is A mode, phase is executed continuously as in C mode if the
interlock/single setting is interlock, but if the interlock/single setting is single, the phase
is temporarily halted (conf progress wait) before execution, a conf progress wait alarm
is issued, and phase execution is resumed after it is acknowledged by the operator.
Phase setting
sequence mode
Interlock Single
C mode
(continuous progress)
Execute Execute
A mode (conf progress) Execute
Temporary halt Executed
resumed when acknowledged
M, RM mode Halt Halt
If several phases are in "conf progress wait" in a parallel process, a single acknowledge will
cancel all acknowledge waits and resume execution.
When the mode is switched to C while in "conf progress wait", all conf progress waits are
canceled and changed to continuous execution. Also, if the mode is switched to M/RM while in
"conf progress wait" and single step execution is performed, conf progress wait is canceled and
inside of the phase is executed.
Acknowledge method
Press the
[conf progress]
button on the OIS-DIS sequence tag point screen.
Press the button on the tool's program editor control panel.
Set conf progress request (CNE) of sequence tag ON from tool's tag editor or other program.
Conf progress example
T1
T2
2 PHASE2
Time#10s
T3
4 PHASE4
Time#10s
1 PHASE1
Time#10s
3 PHASE3
Time#10s
T1
T2
2 PHASE2
Time#10s
T3
4 PHASE4
Time#10s
1 PHASE1
Time#10s
3 PHASE3
Time#10s
T1
T2
2 PHASE2
Time#10s
T3
4 PHASE4
Time#10s
1 PHASE1
Time#10s
3 PHASE3
Time#10s
>
> || > >
Sequence tag (parameter)
:
FA1 : Interlock/single setting 1 Interlock
FA2 : Interlock/single setting 2 Interlock
FA3 : Interlock/single setting 3 Standalone
:
Sequence tag (data
:
MODEmode A
:
Transition T1
=TRUE(ON)
Acknowledge
CNE=ON
PHASE1 : Active(phase execution complete)
PHASE2 : Active (executing within phase)
PHASE3 : Active (conf progress wait)
PHASE2 : Active (executing within phase)
PHASE3 : Active (executing within phase)
Chapter 3 SFC Instructions
6F8C1226
722
If transition (T1) becomes TRUE(ON) when PHASE1 is active, PHASE2 and PHASE3 become
active. Execution within phase is started immediately because PHASE2 is "interlock". PHASE3
is temporarily halted and placed in conf progress wait because it is "single". When
acknowledged, PHASE3's conf progress wait is canceled and the inside of PHASE3 is
executed.
Program example
Main screen (operation) Sub screen (phase)
T1
T2
T3
INI
SEQ001
SEQ
1 PHASE1
Time#10s
2 PHASE2
Time#10s
T11
T2
T13
P1INI
S11
S12
S13
PhaseEnd
When phase 1 (step name: PHASE1) becomes active, the initial step (step name:
P1INI) of the sub screen (phase) becomes active. Step is executed sequentially from
P1INI and "Phase execution complete" is indicated when the phase end step (step
name: S13) becomes active. When S13 becomes active and operation transition
condition (T2) becomes TRUE(ON), phase execution is ended and the active point is
moved to the next step (phase).
Restriction
Description in phase level is not allowed (phase step nesting is not allowed). If phase
steps are nested, operation will be unstable (not as expected).
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
723
Phase End Step
SFC Phase End Step
Diagram Step name
Phase End
EN input Edge execution Index modification
Modifier
Function
Represents the minimum unit of SFC network operation.
When the transition condition in the previous step becomes TRUE(ON), the connected
phase end step becomes active and the ladder circuit or action connected on the right
side of the phase end step is executed. At the same time, phase execution completion
is notified to the calling Phase Step instruction.
The phase end step is active only for one scan.
Phase end step can be written more than once within a phase. Execution of the phase
(SFC network) is ended when any of the phase end step becomes active.
The step state can be determined from the following variables:
Step flag: step name .X (TRUE(ON) when step is active, FALSE(OFF) when step is
inactive)
Phase end step cannot be placed consecutively with other steps. A transition must be
placed between phase step and other step.
Transition or other step instruction cannot be placed below phase end step.
Phase end step is not executed consecutively within the same scan.
Chapter 3 SFC Instructions
6F8C1226
724
Program example
Main screen (operation) Sub screen (phase)
T1
T2
T3
INI
SEQ001
SEQ
1 PHASE1
Time#10s
2 PHASE2
Time#10s
T11
T2
T13
P1INI
S11
S12
S13
PhaseEnd
When phase 1 (step name: PHASE1) becomes active, the initial step (step name:
P1INI) of the sub screen (phase) becomes active. Step is executed sequentially from
P1INI and "Phase execution complete" is indicated when the phase end step (step
name: S13) becomes active. When S13 becomes active and operation transition
condition (T2) becomes ON, phase execution is ended and the active point is moved
to the next step (phase).
Restriction
Description at the operation level is not allowed. If phase step is nested, operation will
be unstable (not as expected).
At least one phase end step must be written within a phase. If there is no phase end
step, the phase will not end (no transition of operation active pointer).
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
725
Answer Step
SFC Answer Step
Diagram
Step name
Ans
Answer timer
EN input Edge execution Index modification
Modifier
Function
Represents the minimum unit of SFC network operation.
When the state of the predecessor transition becomes TRUE(ON), the connected
answer step becomes active and the ladder circuit or action connected on the right
side of the answer step is executed.
Answer step can be written more than once only in phase. Description at the operation
level is not allowed.
Answer step instruction has an answer back monitor timer. If execution of the answer
step does not complete before the answer back monitor timer expires (answer back
proceeding transition is satisfied), an answer back alarm is issued. In this case, the
timer value is limited by the set value. Answer back monitor is disabled when the timer
is set to 0 seconds (time#0s).
The step state can be determined from the following variables:
Step flag : Stepname.X (TRUE(ON) when step is active, FALSE(OFF) when step is
inactive)
Step execution duration : Stepname.T (represents the duration when step is active and
is cleared to 0 the first time the step is active)
Answer step cannot be placed consecutively with other steps. A transition must be
placed between Answer step and other step.
Answer step is not executed consecutively within the same scan.
Restarting answer back monitor
When the SEQ tag mode is set to M (or RM) and later changed to A (or C), the answer
back monitor is restarted (timer current value is cleared to 0, answer back alarm
restored). The answer back alarm causes M demotion. When reclosed to A, the
answer back alarm is restored to perform answer back monitor again.
Remarks
The timer current value is initialized when the mode is changed from M(or RM) to A(or C).
(The answer back monitor restart function is valid for PU821 (all versions), L3DS(V3.26 and
following versions) and L2DS(V3.18 and following versions)).
Chapter 3 SFC Instructions
6F8C1226
726
Program example
Main screen (operation) Sub screen (phase)
T12
PB_P
SIGNAL1
PB_PARA[1]
PB_D
BNO
PB_P
E
PB_DATA[1]
1
PB_DATA[1].
FI[1]
T1
T2
INI
SEQ001
SEQ
1 PHASE1
Time#10s
T11
P1INI
S12
PhaseEnd
S11
Ans
Time#10s
When answer step (step name: S1) becomes active, Push Button instruction (PB_P)
is executed and PB_DATA[1] button 1 is pressed. If the transition condition
(PB_DATA[1].FI[1]) is satisfied before the answer back timer expires (10s), no alarm
is issued and transition is made to the next step. If the timer expires, an answer back alarm is
issued.
Restriction
Description at the operation level is not allowed. Please be sure to describe in phase
level. When it describes in operation level, an active step does not move.
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
727
Phase Step 2
SFC Phase Step 2
Diagram
Ph2
TIM Step
N
TIM Congestion timer set val ue [ms]
N Phase No. (1-32)
Step Variable name to indicate step instance
EN input Edge execution Index modification
Modifier
Function
When the transition condition of the previous step becomes TRUE(ON), the connected
phase step becomes active and executes the ladder circuit or action connected to the
right side of the phase step 2 (for conf progress wait, the connection on the right side
of the phase step 2 remains FALSE(OFF) and the ladder circuit is not executed).
When acknowledge operation is performed, the connection on the right side of the
phase step 2 becomes TRUE(ON).
At the same time, the SFC network is executed as phase.
When phase execution completes (when the next phase step is active) and the
transition condition of the proceeding step becomes TRUE(ON), its own phase step is
deactivated (inactive).
The numbers from 1 to 32 are set as phase numbers. A number is used to associate
with a sequence tag member (phase name PNAM and interlock/single selection (FA))
and the phase execution status can be monitored by OIS-DS.
The phase step 2 instruction has a congestion monitor timer. If phase execution is not
completed before the congestion monitor timer expires, a congestion alarm is issued.
In such case the time value is limited by the set value.
Chapter 3 SFC Instructions
6F8C1226
728
Program example
T2
T1
INI
SEQ001
SEQ
1 PHASE1
Time#10s
T5
2 PHASE2
Time#10s
T3
S1
T4
S2
Phase 1
When T1 is TRUE(ON), phase 1 (up to the previous step of the next phase step 2) is
executed.
If the phase is not executed in 10 seconds, the congestion alarm is issued.
Error information
No action is made when the phase number is out of the range (other than 1 to 32).
When the congestion monitor timer set value is 0, the timer current value is not
updated and the alarm is not issued (treated as no setting for congestion monitor).
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
729
Answer Step 2
SFC Answer Step 2
Diagram
Ans2
TIM Step
TIM : Answer back timer set value [ms]
Step: Variable name to indicate step instance
EN input Edge execution Index modification
Modifier
Function
When the state of the predecessor transition becomes TRUE(ON), the connected
answer step becomes active and the ladder circuit or action connected on the right
side of the answer step 2 executed.
Answer step 2 instruction has an answer back monitor timer. if execution of the answer
step 2 does not complete before the answer back monitor timer expires (answer back
proceeding transition is satisfied), an answer back alarm is issued. In this case, the
timer value is limited by the set value.
Answer back monitor is disabled when the timer is set to 0 second (TIME#0s).
Answer step 2 cannot be placed consecutively with other steps. A transition must be
placed between the answer step 2 and other step.
The answer step 2 is not executed consecutively within the same scan.
Program example
Ans2
S3
T3
T1
T2
S1
SIGNAL1
TIME#10s
The monitor timer is updated when the answer step (step name:Ans2) is activated.
When the transition condition (T2) is satisfied before the answer back timer (10
seconds) expires, no alarm is issued and transition is made to the next step.
If the timer expires, an answer back alarm is issued.
Chapter 3 SFC Instructions
6F8C1226
730
Error information
When the answer back monitor timer set value is 0, the timer current value is not
updated and the alarm is not issued (treated as no setting for answer back monitor).
731
Appendix A
Using Any Function
Appendix A Using Any Function
6F8C1226
732
No. Instruction
Remarks
(Real instruction)
Arithmetic Operations
Add + ADD_
1
Multiply * MUL_
Subtract - SUB_
2
Divide / DIV_
Logical Operations
Bitwise Boolean AND AND AND_
Bitwise Boolean OR OR OR_ 3
Bitwise Boolean XOR XOR XOR_
4 Bitwise Boolean NOT ~ NOT_
Comparison Functions
Greater Than > GT_
Greater Than or Equal >= GE_
Equal = EQ_
Less Than or Equal <= LE_
5
Less Than < LT_
6 Not Equal <> NE_
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
733
Any function instructions
These are standard functions for any data types. The user can use the instruction
symbols without specifying the data type.
Any Function instructions are supported by Program Editor (full graphic).
Converts to equivalent instructions in the "Remarks" column when compiled.
The instruction data type is fixed automatically.
Instruction type Instruction data type
Arithmetic Operations
Logical Operations
Using the output data type, their data type is fixed.
Comparison Functions Using the input data type, their data type is fixed.
If the fixed data type is different from the input one, Type Conversion instruction is
inserted automatically.
Automatic insertion of Type Conversion Instruction.
1) The program code steps increases, when Type Conversion instruction is inserted
automatically.
2) Type Conversion instruction is NOT inserted, if the value is rounded down or the
error margin is caused. (It is the compile error.)
Example A: Value is rounded down.
Output (UINT) = Input1 (INT) + Input2 (UINT)
If the value of input (INT) is a minus, it is rounded down.
Example B: Error margin is caused.
Output (REAL) = Input1 (DINT) + Input2 (DINT)
If the value of result beyond the limits of "-16777215" to "16777215",
the error margin is caused.
3) When their instruction type is Arithmetic Operations or Comparison Functions, and
the input data type is "WORD", the type is converted into "DINT" or "UINT".
The BCD data is not supported.
Data types are indicated by "notations" (INT, REAL and others) in this section.
Appendix A Using Any Function
6F8C1226
734
Add/multiply
Arithmetic Operation Add/Multiply
LD/FBD language
notation
Input 1 Output
Input 2
Input n
EN input Edge execution Index modification
Modifier
Arguments
The following data types are supported for input and output arguments:
Arg. Operand Type Const. Description Remarks
Input See below
Input1n 2n15
Output Output
Input 1 Output
Input 2
Input n
Input1n Symbol () Output
See below +
*
See below
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
735
Function
The type of the instruction symbol (data type) is the same as the output data type.
Refer to the following rule tables for the input data type that can be used at once.
The data type that does not exist in the following table will be the compile error:
[Table: Rules of data types]
DINT
UINT
REAL
INT
WORD
INT
DINT
UINT
REAL
DINT
WORD
INT
DINT
UINT
REAL
UINT
WORD
INT
DINT
UINT
REAL
REAL
WORD
If the output data type and the input data type are different, the input data type fix
according to the output data type. That is, Type Conversion instruction is inserted
between input data and the instruction.
If the input data type is "WORD", Type Conversion instruction "Bit string - Integer
conversion" is inserted.
Type conversion Type conversion instruction
WORDDINT WORD_TO_DINT
WORDUINT WORD_TO_UINT
Refer to the description of "Arithmetic Operation Instructions" for "function",
"operation" and "error information" of each instruction (ADD / SUB / MUL / DIV).
Appendix A Using Any Function
6F8C1226
736
Program example
[LD/FBD language notation]
SAMPLE1
INT
LD
SAMPLE2
REAL
LD
SAMPLE3
UINT
LD
SAMPLE4
REAL
ST
SAMPLE1
INT
LD
ADD_REAL
SAMPLE2
REAL
LD
SAMPLE3
UINT
LD
SAMPLE4
REAL
ST
Type conversion
instruction
INTREAL
INT_TO_REAL
Internal
process
Type conversion
instruction
UINTREAL
UINT_TO_REAL
As the output data type is "REAL", "ADD_REAL" is used.
To operate SAMPLE1 ("INT") and SAMPLE3 ("UINT") by "REAL", Type Conversion
instructions are automatically inserted.
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
737
Subtract/Divide
Arithmetic Operation Subtract/Divide
LD/FBD language
notation
Input 1 Output
Input 2
EN input Edge execution Index modification
Modifier
Arguments
The following data types are supported for input and output arguments:
Arg. Operand Type Const. Description Remarks
Input See below
Input1, 2
Output Output
Input 2
Input 1 Output
Input1, 2 Symbol(
) Output
See below
/
See below
Appendix A Using Any Function
6F8C1226
738
Function
The type of the instruction symbol (data type) is the same as the output data type.
Refer to the following rule tables for the input data type that can be used at once.
The data type that does not exist in the following table will the compile error:
[Table: Rules of data types]
DINT
UINT
REAL
INT
WORD
INT
DINT
UINT
REAL
DINT
WORD
INT
DINT
UINT
REAL
UINT
WORD
INT
DINT
UINT
REAL
REAL
WORD
If the output data type and the input data type are different, the input data type fix
according to the output data type. That is, type conversion instruction is inserted
between input data and the instruction.
If the input data type is "WORD", Type Conversion instruction "Bit string - Integer
conversion" is inserted.
Type conversion Type conversion instruction
WORDDINT WORD_TO_DINT
WORDUINT WORD_TO_UINT
Refer to the description of "Arithmetic Operation Instructions" for "function",
"operation" and "error information" of each instruction (ADD / SUB / MUL / DIV).
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
739
Program example
LD/FBD language notation
SAMPLE1
INT
LD
SAMPLE2
REAL
LD
SAMPLE3
REAL
ST
SAMPLE1
INT
LD
SUB_REAL
SAMPLE2
REAL
LD
SAMPLE3
REAL
ST
Type conversion
instruction
INTREAL
INT_TO_REAL
Internal
process
As the output data type is "REAL", "ADD_REAL" is used.
To operate SAMPLE1 ("INT") and SAMPLE3 ("UINT") by "REAL", the Type
Conversion Instructions are automatically inserted.
Appendix A Using Any Function
6F8C1226
740
Bitwise Boolean AND/Bitwise Boolean OR/Bitwise Boolean XOR
Logical Operation
Bitwise Boolean AND/Bitwise Boolean OR/Bitwise
Boolean XOR
LD/FBD language
notation
Input 1 Output
Input 2
Input n
EN input Edge execution Index modification
Modifier
Arguments
The following data types are supported for input and output arguments:
Arg. Operand Type Const. Description Remarks
Input See below
Input1n 2n15
Output Output
Input 1 Output
Input 2
Input n
Input1n Symbol(
) Output
See below AND
OR
XOR
See below
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
741
Function
The type of the instruction symbol (data type) is the same as the output data type.
Refer to the following rule tables for the input data type that can be used at once.
The data type that does not exist in the following table will be the compile error:
[Table: Rules of data types]
WORD BOOL
DWORD
BOOL
WORD
WORD
DWORD
BOOL
WORD
DWORD
DWORD
If the output data type and the input data type are different, the input data type fix
according to the output data type. That is, Type Conversion instruction is inserted
between input data and the instruction.
Refer to the description of "Logical Operation Instructions" for "function", "operation"
and "error information" of each instruction (Bitwise Boolean AND / Bitwise Boolean
OR / Bitwise Boolean XOR).
Program example
[LD/FBD language notation]
SAMPLE1
DWORD
LD
AND
SAMPLE2
DWORD
LD
SAMPLE3
WORD
LD
SAMPLE4
DWORD
ST
AND_DWORD
Internal
process
Type conversion
instruction
WORDDWORD
WORD_TO_DWORD
SAMPLE1
DWORD
LD
SAMPLE2
DWORD
LD
SAMPLE3
WORD
LD
SAMPLE4
DWORD
ST
As the output data type is "DWORD", "AND_DWORD" is used.
To operate SAMPLE3 ("WORD") by "DWORD", Type Conversion instructions are
automatically inserted.
Appendix A Using Any Function
6F8C1226
742
Bitwise Boolean NOT
Logical Operation Bitwise Boolean NOT
LD/FBD language
notation
Input Output
~
EN input Edge execution Index modification
Modifier
Arguments
The following data types are supported for input and output arguments:
Arg. Operand Type Const. Description Remarks
Input See below
Input
Output Output
Input Output
Input1, 2 Symbol(
) Output
See below ~ See below
Function
The type of the instruction symbol (data type) is the same as the output data type.
Refer to the following rule table for the input data type that can be used at once.
The data type that does not exist in the following table will be the compile error:
[Table: Rules of data types]
WORD
DWORD
If the output data type and the input data type are different, the input data type fix
according to the output data type. That is, Type Conversion instruction is inserted
between input data and the instruction.
Refer to the description of "Logical Operation Instructions" for "function", "operation"
and "error information" of each instruction (Bitwise Boolean NOT).
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
743
Program example
[LD/FBD language notation]
SAMPLE1
WORD
LD
~ SAMPLE2
DWORD
ST
NOT_DWORD
Internal
process
Type conversion
instruction
WORDDWORD
WORD_TO_DWORD
SAMPLE1
WORD
LD
SAMPLE2
DWORD
ST
As the output data type is "DWORD", "NOT_DWORD" is used.
To operate SAMPLE1 ("WORD") by "DWORD", Type Conversion instructions are
automatically inserted.
Appendix A Using Any Function
6F8C1226
744
Greater Than/Greater Than or Equal/Equal/Less Than or Equal/less Than
Comparison
Function
Greater Than/Greater Than or Equal/Equal/Less Than
or Equal/Less Than
LD/FBD language
notation
Input 1 Output
Input 2
Input n
EN input Edge execution Index modification
Modifier
Arguments
The following data types are supported for input and output arguments:
Arg. Operand Type Const. Description Remarks
Input See below
Input1n 2n15
Output BOOL Output
Input 1 Output
Input 2
Input n
Input1n Symbol(
)
See below >
>=
=
<=
<
Unified Controller nv series/Integrated Controller V series Programming Instructions (LD/FBD/SFC/ST)
745
Function
Refer to the following rule tables for the input data type that can be used at once.
The data type that does not exist in the following table will be the compile error:
[Table: Rules of data types]
DINT
UINT
REAL
WORD
DWORD
When all the rules of "Input 1 n" are "
Arguments
The following data types are supported for input and output arguments:
Arg. Operand Type Const. Description Remarks
Input See below
)
See below <>
Function
Refer to the following rule table for the input data type that can be used at once.
The data type that does not exist in the following table will be the compile error:
[Table: Rules of data types]
e
d
C
o
n
t
r
o
l
l
e
r
n
v
s
e
r
i
e
s
&
I
n
t
e
g
r
a
t
e
d
C
o
n
t
r
o
l
l
e
r
V
s
e
r
i
e
s