0% found this document useful (0 votes)
21 views570 pages

FBD Third

This document provides programming instructions for the TOSHIBA Integrated Controller V series and Unified Controller nv series, focusing on Ladder Diagram (LD), Function Block Diagram (FBD), and Sequential Function Chart (SFC) languages. It details data types, program structure, and variable management, including examples and specifications for each language. Additionally, it includes guidelines for using the programming environment and handling various data formats.

Uploaded by

Mohammed Ali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views570 pages

FBD Third

This document provides programming instructions for the TOSHIBA Integrated Controller V series and Unified Controller nv series, focusing on Ladder Diagram (LD), Function Block Diagram (FBD), and Sequential Function Chart (SFC) languages. It details data types, program structure, and variable management, including examples and specifications for each language. Additionally, it includes guidelines for using the programming environment and handling various data formats.

Uploaded by

Mohammed Ali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 570

6F8C1226

Unified Controller Integrated Controller

nv Series

Programming Instructions
(LD/FBD/SFC/ST)

10E_6F8C1226_Controller_V_series_1022_単.indd 1 08.10.22 5:14:21 PM


Notice
(1) Technical information in this document is described for the explanation of typical operation of
the product and its application. It shall not be construed as the grant of intellectual property
or other right of Toshiba or of other party, nor the consent to use the said right.
(2) Duplication and reproduction of a part or whole of this document without approval of Toshiba
is prohibited.
(3) The contents of this document are subject to change without notice.
(4) This document is prepared with the utmost attention. However, when any doubt, error or
the matter to be changed is observed in the document, the customer is kindly requested
to inform us of it.

PROSEC, TOSLINE, TOSDIC and CIEMAC are the registered trade names of Toshiba.
IBM is a registered trade name of International Business Machines Corporation.
Microsoft and Windows are the registered trade name of Microsoft Corporation in the U.S.A.
and in other countries.
DeviceNet is a registered trade name of Open DeviceNet Vendor Association Inc.

© TOSHIBA CORPORATION 2008


All rights reserved
Introduction
This manual describes the Ladder Diagram (LD), Function Block Diagram language (FBD), and Sequential Function Chart
(SFC) instructions for TOSHIBA Integrated Controller V series.
The L controller is divided into MCS type version and DS type version and each one is described as follows:
Classification Series Name Description in this document
MCS type model 2000 L2PU11, L2PU12 L2
model 3000 L3PU11 L3
DS type model 2000 L2PU22 L2DS
model 3000 L3PU21 L3DS
6F8C1226
1. General 1-1

1 General

This manual describes the usage of LD/FBD/SFC instructions and functions of TOSHIBA Integrated Controller V series and
Unified Controller nv-series.
This chapter explains the following items:

1.1 What are LD, FBD, and SFC Languages?


1.2 Data
1.2.1 Data Type
1.2.2 Data Structure
1.2.3 Real Number Format
1.2.4 Variables
1.2.5 Variable Memory Allocation Rules
1.2.6 Variable Declaration Examples
1.2.7 Reading and Writing Variable
1.3 Program Structure
1.3.1 Task
1.3.2 POU (Program Organization Unit)
1.3.3 Program
1.3.4 Function
1.3.4.1 What is Function?
1.3.4.2 Function Execution Control with EN /ENO
1.3.4.3 User Defined Function
1.3.4.4 Function/Function Block Restrictions
1.3.5 Function Block
1.3.5.1 What is Function Block?
1.3.5.2 User Defined Function Block
1.4 Index Registers
1.5 System Flags
1.6 Handling of Real Data
1.7 Instruction Behavior when Exceeding Data Boundary
1.8 Step Counting
1.9 How to Read Instruction Spec.
1.10 Instruction List
6F8C1226
1. General 1-2

1.1 What are LD, FBD, and SFC Languages?

LD Language:
Ladder Diagram is a graphic language for commonly used Boolean operation and is 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.

Horizontal link
Switch_1 Switch_3 Motor_On

Left power rail


Vertical link Right power rail
Switch_2

Switch_4 ADD_INT Done


EN ENO

Offset Value

LD SET

Value

LD
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 functions and function blocks.
Timer_1
Switch1 AND_BOOL TON Start
IN Q
LD ST

Switch2 T_Value
PT ET
LD ST

preset ADD_TIME

LD

DelayTime

LD

Note: The characters “LD”, “ST” and “SET” are


displayed on the semi-graphic Program Editor,
but not displayed on the full-graphic one.
6F8C1226
1. General 1-3

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_ON S2_ON
S1 N Action_1 LED S2

T1

S3_ON
S3

T2
6F8C1226
1. General 1-4

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 Bits 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
38 -45
-3.40282310 to -1.40129810
REAL Real numbers 32 0
1.40129810-45 to 3.4028231038
-2147483648 to 2147483647ms
TIME Duration 32
(-596h31m23s648ms to 596h31m23s647ms )
DATE
Date 32 1998-01-01 to 2097-12-31 (*3)
D (abbreviation)
TIME_OF_DAY
Time of day 32 00:00:00.000 to 23:59:59.999 (*3)
TOD (abbreviation)
DATE_AND_TIME 0001-01-01-00:00:00.000
Date and time of day 64
DT (abbreviation) - 9999-12-31-23:59:59.999 (*3)
Maximum number of characters: 256
Fixed-length character Character code system: shift JIS
STRING
string 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) 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 retain 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).
6F8C1226
1. General 1-5

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, and 16#1_0 in hexadecimal specification are allowed.
The following table shows examples of constant specification.

DataType
Notation
Data Type can be Example of constant specification
(DataType)
omitted?
BOOL#0, BOOL#FALSE,0, FALSE
BOOL Boolean Yes
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
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.
TIME Duration No
<DataType> can be specified in TIME# and T#.
TIME#6d_10m, TIME#16d_5h_4m_3s_21ms
T#6d_10m, T#12.34s
DATE
Date No DATE#2007-12-10, D#2007-12-10
D(abbreviation)
TIME_OF_DAY
Time of day No TIME_OF_DAY#1:2:3.456, TOD#1:2:3
TOD(abbreviation)

WORD Bit string of length 16 Yes WORD#4660, 4660, WORD#16#1234, 16#12_34

DWORD#305419896, 305419896
DWORD Bit string of length 32 Yes
DWORD#16#1234_5678, 16#12345678
6F8C1226
1. General 1-6

1.2.2 Data Structure


(1) Integer (INT)/Unsigned integer (UNIT)/Bit string of length 16 (WORD)
15 0
0 data

(2)Double integer (DINT)/Real numbers (REAL)/Duration (TIME)/Time of day (TOD)/Bit string of length 32(DWORD)
15 0
0 data (L)
1 data (H)

(3)Date (DATE)
15 0
0 year (INT)
1 day month

Example) 1999-10-11 <year-month-day>

(4)Date and time of day (DT)


15 0
0 year (INT)
1 day month
2 time of day (L)
3 time of day (H)

(5)Fixed-length character string (STRING)


15 0
An example of 6 character data is show at left.
0 VARlength
1 String length (n) Variables:
2 2nd string 1st string Variable Data type Dec.
3 4th string 3rd string
SAMPLE STRING[6] VAR
4 6th string 5th string

(6)Derived data type Array data (ARRAY)


15 0
An example of 16 bit data is show at left.
0
A 32 bit data is stored every 4 bytes as (2) and (3).
data [0]
1 data [1]
2
Variables:
data [2]
Variable Data type Dec.
n-1 data [n-1] data ARRAY [0..n-1] OF INT VAR
6F8C1226
1. General 1-7

(7)Derived data type Structure (STRUCT)


15 0 An example of INT+BOOL+DINT is shown at left.
0 data (INT)
1 bit1 bit0 Variables:
2 data1 (DINT L) Variable Data type Dec.
3 data1 (DINT H) Data typeSAMPLE VAR
Structures:
Data type Parent type
typeSAMPLE STRUCT
Members:
Member Data type
data INT
bit0 BOOL
bit1 BOOL
data1 DINT
6F8C1226
1. General 1-8

1.2.3 Real Number Format


An arbitrary size single word real data is expressed as follows:
Mantissa
Exponent
E
REAL value SM  2 
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 0
Exponent (8 bits) e Mantissa (23 bits) m
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)2e-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.
6F8C1226
1. General 1-9

1.2.4 Variables
Variables used in applications are divided into local variables and global variables.
Major classification Minor classification Variable feature
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
Temporary variable
time the POU is executed.
Initialization is required before using the 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
Static variable Initialization."
Local variable
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
Non-tracking type A variable that can be used only in the POU in which it is included.
static variable The variable value is retained because memory is reserved statically.
In the initialization operation, the variable is initialized to zero when the
(Unified Controller nv controller starts up in RUN.
series only) In a duplex system, this variable is not tracked.
A variable that can be used if the stations are organically linked via
scan transmission, and managed in an integrated fashion. It is used
Network variable 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.
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
Station global variable restricted.
Global variable [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.
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
Controller global
variable is used.
variable
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.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. 15 0
V1 BOOL VAR 0 V2 V1
V2 BOOL VAR 1 V3
V3 INT VAR 2 V4
V4 BOOL VAR
6F8C1226
1. General 1-10

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.
 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, Data type
ULINT, REAL, LREAL, TIME, DATE, TIME_OF_DAY,
TOD, DATE_AND_TIME, DT, STRING, BYTE, WORD,
DWORD, LWORD,PTR, PTRB
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 declaration
Function, Function block name Function or function block names such as SIN, COS, TAN,
TON, CTU
FUNCTION BLOCK... Function block declaration
END_FUNCTION BLOCK
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 type declaration
VAR...END_VAR Variable declaration
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
WHILE...DO...END_WHILE WHILE statement
6F8C1226
1. General 1-11

WITH Program or function block task association


XI,XJ,XK,XL,XM,XN,XP,XQ Index registers

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

(2) 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 Data type Dec.
LOCAL_NT_VAR_1 INT VAR(NonTracking)
LOCAL_NT_VAR_2 WORD VAR(NonTracking)

(3)Temporary variable
Temporary variables used within POU are declared using the keyword VAR_TEMP.
Variables:
Variable Data type Dec.
TEMP_VAR_1 INT VAR_TEMP
TEMP_VAR_2 WORD VAR_TEMP

(4) Input parameter


Represent the input arguments for POU and are declared using the keyword VAR_INPUT.
Variables:
Variable Data type Dec.
INPUT_VAR_1 INT VAR_INPUT
INPUT_VAR_2 WORD VAR_INPUT

(5) Output parameter


Represent the output arguments for POU and are declared using the keyword VAR_OUTPUT.
Variables:
Variable Data type Dec.
OUTPUT_VAR_1 INT VAR_OUTPUT
OUTPUT_VAR_2 WORD VAR_OUTPUT

(6) Input/Output parameter


Represent the input/output arguments for POU and are declared using the keyword VAR_IN_OUT.
Variables:
Variable Data type Dec.
INOUT_VAR_1 INT VAR_IN_OUT
INOUT_VAR_2 WORD VAR_IN_OUT

(7) Global variable


When using global variables, the keyword VAR_GLOBAL is used to declare system global variables, station global variables,
and controller global variables.
Controller / Station / Network Variables:
Variable Data type
GLOBAL_VAR_1 INT
GLOBAL_VAR_2 WORD
6F8C1226
1. General 1-12

(8) Derived data type Array declaration


The ARRAY···OF 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 Data type Dec.
ARRAY_VAR ARRAY[0..9] OF INT VAR

(9) Derived data type structure declaration


The STRUCT…END_STRUCT keywords are used to declare structures to be used within POU.
Variables:
Variable Data type Dec.
data typeX VAR
Structures:
Data type Parent type
typeX STRUCT
Members:
Member Data type
VAL1 INT
VAL_ARY ARRAY[0..9] OF BOOL
VAL2 DINT
6F8C1226
1. General 1-13

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
LD instruction is used to specify input arguments to function
Read Load instruction LD
or function block.
ST instruction is used to write the result of function or
Store instruction ST
function block without execution control to a variable.
Write
Set store SET instruction is used to write the result of function with
SET
instruction execution control to a variable.

Combination with function:


(1) Example of function without execution control
SAMPLE1 ADD_INT SAMPLE3

LD ST

SAMPLE2 Use ST instruction

LD

(2) Example of function with execution control

SIGNAL1 ADD_INT SIGNAL2


EN ENO

SAMPLE1 SAMPLE3

LD SET

SAMPLE2 Use SET instruction

LD

Combination with Gate instruction:


(1) Example of normally open Contact Gate and Store instruction
SIGNAL1
SAMPLE1 SAMPLE2 When SIGNAL1=OFF :SAMPLE2=0
When SIGNAL1=ON :SAMPLE2=SAMPLE1
LD ST

(2) Example of normally open Contact Gate and SET Store instruction

SAMPLE1 SIGNAL1 SAMPLE2 When SIGNAL1=OFF :SAMPLE2=Previous value


When SIGNAL1=ON :SAMPLE2=SAMPLE1
LD SET
6F8C1226
1. General 1-14

1.3 Program Structure


1.3.1 Task
The integrated controller controls 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 contained in each task]
Controller
Execution
Task name Priority S3 S2 L3 L2 L1
method
(L3DS) (L2DS)
Event task EV 1 8 8 8 8 — Event
(16) (16)
Super high-speed task SS 2 1 1 1 1 — Scan
(-) (-)
Interrupt task IP 3 8 8 8 8 — Event
(32) (32)
High-speed task HS 4 (*1) 32 32 8 — Scan
(128) (128)
Main task MS 5 256 256 256 64 8 Scan
(256) (256)
Background task BG 6 4 4 4 1 — Event or Scan
(4) (4)
(*1) S3PU21/S3PU45: 32, S3PU55/S3PU65: 128

[Number of programs that can be registered in each task in the Unified Controller nv series]
Unit:Number of programs
Controller
Task name Priority Execution method
type1 type2
Event task EV 1 8 8
Event (Select EV or IP)
Interrupt task 16 16
IP
*1 Event
Ultra 2
(Select IP or SS)
high-speed SS 1 - Scan
task
High-speed
HS 3 128 128
task Scan (Select HS or RIO)
RIO task *2 RIO 0 -
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.
6F8C1226
1. General 1-15

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.
[ POU resource counts of each controller ]

Controller S T T F A
t e a u r
a m s n g
t p k c u
i o t m
c r r i e
POU Instance a e o n
(Program v l g n t
Organization a y i
Unit ) r s v
i v t a
a a r l
b r a u
l i t e
e a i
b o
l n
S3 S2 L3 L2 L1
e
(L3DS) (L2DS)

Program Program √ √ √ - √
instance
Function - *2 437 2048 512 64 - √ - √ √
Function Function block (2048) (2048) √ √ - - √
block instance
*2 S3PU21: 437, S3PU45: 821, S3PU55/S3PU65: 917
6F8C1226
1. General 1-16

[Number of POUs that can be registered in the Unified Controller nv series]


Unit:Number of POUs
Controller
S T T F A
t e a u r
a m s n g
t p k c u
i o t m
c r r i e
a e o n
POU
v r g n t
(Program
Instance a y i v
Organization type1 type2 r s a
Unit )
i v t l
a a r u
b r a e
l i t
e a i
b o
l n
e
Program
Program √ √ √ - √
instance
Function - 940 2000 - √ - √ √
Function block
Function block √ √ - - √
instance
6F8C1226
1. General 1-17

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

Program Program Program Program

Function block Function block Function Function block

Function Function
6F8C1226
1. General 1-18

1.3.4 Function
1.3.4.1 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
IEC61131-3 are examples of functions.

1.3.4.2 Function Execution Control with EN/ENO


Functions can have EN input and ENO output. They control the execution of the function.
Example without execution control: Example with execution control:

SAMPLE1 ADD_INT SAMPLE3 SIGNAL1 ADD_INT SIGNAL2


EN ENO
LD ST
SAMPLE2 SAMPLE1 SAMPLE3

LD LD SET
SAMPLE2

LD

Instructions to store the result to be connected to a function is divided into Store instruction (ST) and Set Store instruction (SET).
The following rules apply to these instructions:
Store (ST)
Set Store (SET)
EN input Function processing ENO output instruction Remarks
instruction action
action
Update with (*1)
OFF Not executed [Outputs 0] OFF No data update default value
(0)
Normal
Yes ON
Executed completion Update with
Update with
ON (Outputs Error Depend on operation
operation result
operation result) completion function result
(Error) (*2)
Update with
No — Executed — Not available operation
result
(*1) When EN input is 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 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.
6F8C1226
1. General 1-19

(1) When the function output is BOOL variable

SIGNAL1 SIGNAL2 In the case where SAMPLE1>SAMPLE2


GT_INT  When SIGNAL1=OFF
EN ENO
SIGNAL2OFF
SAMPLE1 SIGNAL3
SIGNAL3 is unchanged
LD SET  When SIGNAL1=ON
SAMPLE2 SIGNAL2ON
SIGNAL3ON
LD

SIGNAL1 SIGNAL2
GT_INT In the case where SAMPLE1 > SAMPLE2
EN ENO  When SIGNAL1=OFF
SAMPLE1 SIGNAL3 SIGNAL2OFF
SIGNAL3OFF
LD  When SIGNAL1=ON
SAMPLE2
SIGNAL2ON
LD SIGNAL3ON

(2) When the function output is not BOOL variable


SIGNAL1 SIGNAL2  When SIGNAL1=OFF
ADD_INT
EN ENO SIGNAL2OFF
SAMPLE1 SAMPLE3 SAMPLE3 is unchanged
 When SIGNAL1=ON
LD SET SIGNAL2ON
SAMPLE2 SAMPLE3SAMPLE1+SAMPLE2
LD

(3) Example of execution control with EN, ENO


ENO and EN on same circuit are used connected.
SIGNAL1 SIGNAL2
ADD_INT MUL_INT
EN ENO EN ENO
SAMPLE1 SAMPLE4

LD SET
SAMPLE2 SAMPLE3

LD LD
When EN is FALSE(OFF), 0 is output.

 When SIGNAL1=OFF
SIGNAL2OFF
SAMPLE4 is unchanged
 When SIGNAL1=ON
SIGNAL2ON
SAMPLE4(SAMPLE1+SAMPLE2)SAMPLE3
6F8C1226
1. General 1-20

1.3.4.3 User Defined Function


The user can define a new function by combining existing functions. This enables program components to be packaged for
reuse.
SAMPLE1 USR_FUN SAMPLE3
DATA1
LD ST
SAMPLE2
DATA2 USR _ FUN  SAMPLE12  SAMPLE22
LD

User defined function : USR_FUN


DATA1 MUL_REAL SUB_REAL SQRT USR_FUN

LD ST
DATA1

LD
DATA2 MUL_REAL
LD
DATA2

LD

1.3.4.4 Function/Function Block Restrictions


The following restrictions apply when the function value of a function or output argument of a function block is DT, STRING,
PTR or PTRB.
 Function value and output argument must be stored in a single variable only.
 Always connect function value and output argument with Store or Set Store instruction.

Supported case:
STRING1 LEFT STRING2
LD IN ST
NUMBER L
LD

Unsupported case:
(1) Function value is stored in two or more variables

STRING1 LEFT STRING2


LD IN ST
NUMBER L STRING3
LD ST

(2) Function value is connected to instructions other than ST/SET


STRING1 LEFT MID STRING3
LD IN IN ST
NUMBER L STRING2 L
LD LD
6F8C1226
1. General 1-21

1.3.5 Function Block


1.3.5.1 What is Function Block?
A function block (FB) is a program organization unit that returns one or more value when executed. More than one instance
(copy) of a named FB can be created. An instance requires an identifier (instance name) for identity. The output variables and
internal variables are retained from one execution to the next. Therefore, the result of executing an FB with the same argument
is not necessary the same. Instructions such as CTU and TON defined by IEC61131-3 are examples of function blocks.

1.3.5.2 User Defined Function Block


The user can define a new function block by combining existing functions and function blocks. This enables program
components to be packaged for reuse.
USR_FB_1
SAMPLE1 USR_FB SAMPLE3
D Q
LD ST
SAMPLE2 SAMPLE4
CK notQ
LD ST

User Defined Function Block USR_FB


SR_1
CK D SR Q
P S1 Q

D notQ
R
6F8C1226
1. General 1-22

1.4 Index Registers


The following eight registers are available as index registers:
XI, XJ, XK, XL, XM, XN, XP, XQ
These index registers are controlled every the task type. (These become the global registers every task type.)
Therefore, these don’t overlap, even if the same index registers are used between the task type that differs.
These can be used to specify a memory area that is offset by the index register from the specified variable. This
is referred to as index modification.
An index modification of a variable is coded as follows:
Variables:
Variable Data type Dec.
TABLE ARRAY[0..3] OF DINT VAR
SAMPLE DINT VAR

Program:
TABLE[XI] ADD_DINT SAMPLE

LD ST
TABLE[XJ]

LD

Description:
When index register XI=1, XJ=3 Array: TABLE
SAMPLE=TABLE[XI] + TABLE[XJ] 0 100
=TABLE[1] + TABLE[3] 1 150
2 70
=150 + 30
3 30
is calculated and the result 180 is stored in SAMPLE.

1.5 System Flags


The following list shows the flags that are set when an error occurs within a function or used in operation with
carry.
These specific registers are model dependent. Therefore, refer to the respective function description for each
model (S3 User’s Manual - Functions - for example when using on S3).
Flag Description Supported instruction
User carry flag Carry flag used in operations with carry and in shift and rotate ADC, SBB, SHL,
S[24]. B[0] instructions. SHR, ROL, ROR
Error flag Set to ON when an error occurs during function execution.
S[24]. B[1] Set together with the following flags.
Boundary error flag Set to ON when the address range is exceeded in an indirect LD, ST, and instructions
S[25]. B[4] address specification. specified with pointers
Divide error flag Set to ON when divide with zero occurs in a divide instruction. DIV, MOD
S[25]. B[8]
Set to ON when BCD data is outside the range from 0 to 9 in UINT_TO_BCD_WORD
BCD data error flag BCD related instructions. DINT_TO_BCD_DWORD
S[25]. B[9] WORD_BCD_TO_UINT
DWORD_BCD_TO_DINT
Table operation Set to ON when the operation pointer is outside the table size TSET, TRST
error flag in the table operation instructions.
S[25]. B[10]
Encode error flag Set to ON when the encode error occurs in the encode ENC
S[25]. B[11] instructions.
6F8C1226
1. General 1-23

[Unified Controller nv series]


In the Unified Controller, the flags include common flags for all tasks for compatibility with the Integrated
Controller, and common tasks for each task.

System flag Description


Common for all For compatibility with the
tasks Integrated Controller
Common for
For EV/IP tasks
Priority 1
Common for
For SS/IP tasks
Priority 2
Common for
For HS tasks
Priority 3
Common for
For MS tasks
Priority 4

Flag Description Supported instruction


Carry flag used in operations with carry and in ADC, SBB, SHL,
User carry flag
shift and rotate instructions. SHR, ROL, ROR
Set to ON when an error occurs during function
Error flag
execution. Set together with the following flags.
Set to ON when divide with zero occurs in a
Divide error flag DIV, MOD
divide instruction.
Set to ON when BCD data is outside the range UINT_TO_BCD_WORD
BCD data error flag
from 0 to 9 in BCD related instructions. WORD_BCD_TO_UINT, etc.
Set to ON when the operation pointer is outside
the table size in the table operation instructions,
Table operation error flag or an unsupported variable is specified in the TSET, TRST, TMOV, PLN, etc.
table operation instructions or function
instructions.
Set to ON when the encode error occurs in the
Encode error flag ENC
encode instructions.
Set to ON when invalid ASCII code is detected
ASC data conversion error ASCDEC_TO_DINT,
in ASCII data conversion in an instruction
flag DINT_TO_ASCDEC, etc.
handling ASCII data.
6F8C1226
1. General 1-24

1.6 Handling of Real Data


In calculations using read data (four arithmetic operations such as ADD/SUB/MUL/DIV and functions such as
SIN/COS/PID), if "infinity/nonnumeric" is specified in the input data, the calculation result becomes "infinity/nonnumeric," or
the result becomes "infinity/nonnumeric" during the calculation, the Integrated Controller and Unified Controller perform the
following calculations.

Integrated Controller Unified Controller


Calculation is done by using the input
Calculation is done by limiting the input
data as it is, so the calculation result
"Infinity/Nonnumeric" is data to "± maximum value."
also becomes "infinity/nonnumeric."
specified in the input data For a function with EN, the ENO output is
For a function with EN, the ENO
set to OFF.
output is set to OFF.
The calculation result is outputted as it The calculation result is limited to "±
Calculation result becomes is. maximum value" and outputted
"Infinity/Nonnumeric" For a function with EN, the ENO For a function with EN, the ENO output is
output is set to OFF. set to OFF.
Calculation is continued by using the
Calculation is continued by limiting the
"infinity/nonnumeric" result during the
Result becomes result to "± maximum value" during the
calculation, so the calculation result
"Infinity/Nonnumeric" during calculation.
also becomes "infinity/nonnumeric."
the calculation For a function with EN, the ENO output is
For a function with EN, the ENO
set to OFF.
output is set to OFF.

Therefore, the range of real data of the Integrated Controller and Unified Controller is as follows:

Integrated
Input/output data
Controller
Unified Controller
Decimal
Real data representation S2/S3 L2/L3
representation
7FFF.FFFF
+NAN
+Nonnumeric :  +3.4028235E+38
(not a number) +INF
7F80.0001 (+Maximum value)
+Infinity +INF(Infinity) 7F80.0000 
+3.4028235E+38(+Maximum value) 7F7F.FFFF
Normalized
: :
value
+1.1754944E-38 0080.0000
  
+1.1754942E-38 007F.FFFF
Unnormalized
: :
value
+1.4012985E-45 0000.0001
+0 0000.0000 +0
Zero +0 +0
-0 8000.0000 -0
-1.4012985E-45 8000.0001
Unnormalized
: :
value
-1.1754942E-38 807F.FFFF
  
-1.1754944E-38 8080.0000
Normalized : :
value
-3.4028235E+38(-Maximum value) FF7F.FFFF
-Infinity -INF(Infinity) FF80.0000 

FF80.0001 -3.4028235E+38
-NAN -INF
-Nonnumeric :  (-Maximum value)
(not a number)
FFFF.FFFF
6F8C1226
1. General 1-25

●Important
・ In the Integrated Controller and Unified Controller, the calculation results are different when
"infinity" or "nonnumeric" is inputted in a calculation using real data, or when the calculation
result becomes "infinity" or "nonnumeric."
・ When real data is used in the user program and the effect of the difference exists, the
validity of calculation result="maximum value" can be ensured by writing the program in the
following manner.
・ When real calculation is needed, real calculation can be used as a function with EN so that
a factor resulting in a calculation result of "infinity" or "nonnumeric" can be detected when
ENO=FALSE(OFF).
・ The cautions on handling real data are as follows:
・ Check if it is within the expected input/output data range. Is the limit processing
required before or after the calculation?
・ In division, is there any division with divisor=0?
・ In data comparison, is it OK to use "=" (equality)?
・ When calculation is done as a function with EN and the ENO output is normal (ON),
is the calculation result required to be used?
6F8C1226
1. General 1-26

1.7 Instruction Behavior when Exceeding Data Boundary


When the data boundary is exceeded, the message User task data boundary is exceeded is written in the error log. In this
case, the data read from the variable is treated as 0 and no write to variable is performed. The controller operation after the error
depends on information set in the controller parameter. The behavior of each instruction is as follows:
Data
Variable
Instruction read from Instruction output Remarks
write
variable
0 0 —
0 1 —
P 0 0 —
1 (when previous data=1 with input=1)
N 0 —
0 (other than above)
— — —
— — —
P — — — Previous value is updated
N — — — as pulse function.
S — — —
R — — —
— — —
— — —
P — — — Previous value is updated
N — — — as pulse function.
S — — —
R — — —
LD 0 — —
ST/SET — — —
6F8C1226
1. General 1-27

1.8 Step Counting


When a constant is used to specify an input argument or for index modification, there are cases where the step count is
changed. This is described below.

(1)Specification by constant
One step if the data structure is a single word constant specification and two steps if the data structure is a two word size
constant specification.

(2)Index modification of BOOL variable


Increases by 1 step each time the level of index modification increases. (Increased by 1 step for single index specification, by
2 steps for double index specification.) Examples of index modification using BOOL variable BOOL_VAL are shown below:
 No index modification
BOOL_VAL
1 step

 Single index modification


BOOL_VAL[XI]
2 steps

 Double index modification


BOOL_VAL[XI][XJ]
3 steps

(3)Index modification of WORD variable


For single word data type, double or more index specification results in increase of 1 step and for double word data type, single
or more index specification results in increase of 1 step. Thereafter, the step is increased by 1 each time the level of index
modification increases as with BOOL variables. Examples of index modification of INT variable INT_VAL and DINT variable
DINT_VAL are shown below:

INT variable: DINT variable:


 No index modification
INT_VAL 1 step DINT_VAL 1 step

 Single index modification


INT_VAL[XI] 1 step DINT_VAL[XI] 2 steps

 Double index modification


INT_VAL[XI][XJ] 2 steps DINT_VAL[XI][XJ] 3 steps

Note: Currently, only single index modification is allowed. Double index is not allowed. (This is currently under
development.)
6F8C1226
1. General 1-28

1.9 How to Read Instruction Spec.


Instruction Related instruction (*1)
name
Graphical form

Moving Move Data

Diagram Input MOVE_xxx Output


Whether modification is allowed

EN input Edge execution Index modification


Modifier

Arguments:
 The following data types are supported for input and output arguments and the instruction symbol

depends on the data type: Whether constant specification is allowed

Arg. Operand Type Const. Descripton Remarks


Input — Input
See below
Output — — Output

Input MOVE_xxx Output

Input Symbol(_xxx) Output


INT MOVE_INT INT
DINT MOVE_DINT DINT
UNIT MOVE_UINT UNIT
REAL MOVE_REAL REAL
W ORD MOVE_WORD W ORD
DW ORD MOVE_DWORD DW ORD
TIME MOVE_TIME TIME
TOD MOVE_TOD TOD
DATE MOVE_DATE DATE
DT MOVE_DT DT
STRING MOVE_STRING STRING

Explanation of the instruction


Function:
 Input data is output as result.

Program example: Program example

SAMPLE1 MOVE_INT SAMPLE2 Description of the operation


1234 1234
in a program sample
LD ST

 Content of variable SAMPLE1 ”1234” is moved to variable SAMPLE2.

(*1) This function is compatible with the instruction which the controller described in the column has. The controller is shown
as below:
Programmable Controller PROSEC T Series: T
Control Station PCS Series: PCS
6F8C1226
1. General 1-29

1.10 Instruction List


The V Series controller instructions are listed below. The following symbols are used in the table.
√ : Supported from the initial version of the respective controller (available)
Number : Supported from the specified version of the respective controller (available)
- : Not supported by the respective controller (Unavailable)
Carefully check the available instruction when programming.

Caution

When an unsupported instruction is used during programming, the action depends on the controller as follows:
With the S controller, POU using unsupported instruction is not downloaded to the controller. If it is downloaded, the
engineering tool displays an error message indicating that it is an unsupported message.
With the L controller, POU using unsupported message can be downloaded to the controller, but the program will go into
fallback mode or fail when it detects the unsupported instruction.

nv series Supported model


Instruction Symbol type type L3 L2 Step
S3 S2 L3 L2 L1
1 2 DS DS
Contacts & Coils
Normally Open Contact √ √ √ √ √ √ √ √ √ 1
Normally Closed Contact √ √ √ √ √ √ √ √ √ 1
Positive
Transition-sensing P √ √ √ √ √ √ √ √ √ 2
Contact
Negative
Transition-sensing N √ √ √ √ √ √ √ √ √ 2
Contact
Rising Edge Detector √ √ √ √ √ √ √ √ √ 1
Falling Edge Detector √ √ √ √ √ √ √ √ √ 1
Inverter I √ √ √ √ √ √ √ √ √ 1
Coil √ √ √ √ √ √ √ √ √ 1
Negated Coil √ √ √ √ √ √ √ √ √ 1
SET Coil S √ √ √ √ √ √ √ √ √ 1
RESET Coil R √ √ √ √ √ √ √ √ √ 1
Positive √ √
P √ √ √ √ √ √ √ 2
Transition-sensing Coil
Negative
N √ √ √ √ √ √ √ √ √ 2
Transition-sensing Coil
Forced Coil √ √ √ √ √ √ √ √ — 1
Forced Negated Coil √ √ √ √ √ √ √ √ — 1
Forced SET Coil S √ √ √ √ √ √ √ √ — 1
Forced RESET Coil R √ √ √ √ √ √ √ √ — 1
Forced Positive —
P √ √ √ √ √ √ √ √ 2
Transition-sensing Coil
Forced Negative —
N √ √ √ √ √ √ √ √ 2
Transition-sensing Coil
Execution Control
Jump Control Set JCS √ √ √ √ √ √ √ √ √ 1
Jump Control Reset JCR √ √ √ √ √ √ √ √ √ 1
Jump √ √ √ √ √ √ √ √ √ 1
Label LABEL √ √ √ √ √ √ √ √ √ 1
Conditional Execution
√ √ √ √ √ √ √ √ √ 1
Instruction
6F8C1226
1. General 1-30

End of Conditional
√ √ √ √ √ √ √ √ √ 1
Execution Instruction
Master Control Set MCS √ √ √ √ √ √ √ √ √ 1
Master Control Reset MCR √ √ √ √ √ √ √ √ √ 1

nv series Supported model


Instruction Symbol type type L3 L2 Step
S3 S2 L3 L2 L1
1 2 DS DS
Counters
Up Counter CTU √ √ √ √ √ √ √ √ √ 1
Down Counter CTD √ √ √ √ √ √ √ √ √ 1
Up Down Counter CTUD √ √ √ √ √ √ √ √ √ 1
Timers
On-Delay Timer (0.1ms) TON_100us √ √ √ — — — — — — 2
On-Delay Timer (1ms) TON √ √ √ √ √ √ √ √ √ 1
On-Delay Timer (10ms) TON_10ms √ √ √ √ — — — — — 2
On-Delay Timer (100ms) TON_100ms √ √ √ √ √ √ √ √ — 2
On-Delay Timer TONM_P
√ √ — — √ √ √ √ — 2
(0.1 minute)
Off-Delay Timer (0.1ms) TOF_100us √ √ √ — — — — — — 2
Off-Delay Timer (1ms) TOF √ √ √ √ √ √ √ √ √ 1
Off-Delay Timer (10ms) TOF_10ms √ √ √ √ — — — — — 2
Off-Delay Timer (100ms) TOF_100ms √ √ √ √ √ √ √ √ — 2
Off-Delay Timer TOFM_P
√ √ — — √ √ √ √ — 2
(0.1 minute)
Pulse Timer (0.1ms) TP_100us √ √ √ — — — — — — 2
Pulse Timer (1ms) TP √ √ √ √ √ √ √ √ √ 1
Pulse Timer (10ms) TP_10ms √ √ √ √ — — — — — 2
Pulse Timer (100ms) TP_100ms √ √ √ √ √ √ √ √ — 2
Single Shot (100ms) SS_P √ √ √ √ √ √ √ √ — 2
Single Shot (0.1 minute) SSM_P √ √ — — √ √ √ √ — 2
Real Time Calendar RTC — — √ √ — — — — — 2
Real Time Clock RTC_N √ √ — — — — — — — 2
Flip-Flops
Set Type Flip-Flop SR √ √ √ √ √ √ √ √ √ 2
Reset Type Flip-Flop RS √ √ √ √ √ √ √ √ √ 2
Semaphore SEMA √ √ √ √ √ √ √ √ √ 2
Moving
Normally Open Contact
√ √ √ √ √ √ √ √ √ 1
Gate
Normally Closed Contact
√ √ √ √ √ √ √ √ √ 1
Gate
Move Data MOVE_INT √ √ √ √ 1.30 1.10 2.30 √ — 1
MOVE_DINT √ √ √ √ 1.30 1.10 2.30 √ — 1
MOVE_UINT √ √ √ √ 1.30 1.10 2.30 √ — 1
MOVE_REAL √ √ √ √ 1.30 1.10 2.30 √ — 1
MOVE_WORD √ √ √ √ 1.30 1.10 2.30 √ — 1
MOVE_DWORD √ √ √ √ 1.30 1.10 2.30 √ — 1
MOVE_TIME √ √ √ √ 1.30 1.10 2.30 √ — 1
MOVE_TOD √ √ √ √ 1.30 1.10 2.30 √ — 1
MOVE_DATE √ √ √ √ 1.30 1.10 2.30 √ — 1
MOVE_DT √ √ √ √ 1.30 1.10 2.30 √ — 1
MOVE_STRING — — — — — — — — — 1
Move Table Data TMOV √ √ √ √ √ √ √ √ — 1
Data Exchange XCHG_INT √ √ √ √ — — — — — 2
XCHG_DINT √ √ √ √ — — — — — 2
6F8C1226
1. General 1-31

XCHG_UINT √ √ √ √ — — — — — 2
XCHG_REAL √ √ √ √ — — — — — 2
XCHG_WORD √ √ √ √ — — — — — 2
XCHG_DWORD √ √ √ √ — — — — — 2
XCHG_TIME √ √ √ √ — — — — — 2
XCHG_TOD √ √ √ √ — — — — — 2
XCHG_DATE √ √ √ √ — — — — — 2

nv series Supported model


Instruction Symbol type type L3 L2 Step
S3 S2 L3 L2 L1
1 2 DS DS
Moving
Initialize Table Data TINZ_INT √ √ √ √ — — — — — 1
TINZ_DINT √ √ √ √ — — — — — 1
TINZ_UINT √ √ √ √ — — — — — 1
TINZ_REAL √ √ √ √ — — — — — 1
TINZ_WORD √ √ √ √ — — — — — 1
TINZ_DWORD √ √ √ √ — — — — — 1
TINZ_TIME √ √ √ √ — — — — — 1
TINZ_TOD √ √ √ √ — — — — — 1
TINZ_DATE √ √ √ √ — — — — — 1
TINZ_DT — — — — — — — — — 1
Comparison
Greater Than GT_INT √ √ √ √ √ √ √ √ √ 1
GT_DINT √ √ √ √ √ √ √ √ √ 1
GT_UINT √ √ √ √ √ √ √ √ √ 1
GT_REAL √ √ √ √ √ √ √ √ √ 1
GT_WORD √ √ √ √ √ √ √ √ √ 1
GT_DWORD √ √ √ √ √ √ √ √ √ 1
GT_TIME √ √ √ √ √ √ √ √ √ 1
GT_TOD √ √ √ √ √ √ √ √ √ 1
GT_DATE — — — — — — — — — 1
GT_DT — — — — — — — — — 1
Greater Than or Equal GE_INT √ √ √ √ √ √ √ √ √ 1
GE_DINT √ √ √ √ √ √ √ √ √ 1
GE_UINT √ √ √ √ √ √ √ √ √ 1
GE_REAL √ √ √ √ √ √ √ √ √ 1
GE_WORD √ √ √ √ √ √ √ √ √ 1
GE_DWORD √ √ √ √ √ √ √ √ √ 1
GE_TIME √ √ √ √ √ √ √ √ √ 1
GE_TOD √ √ √ √ √ √ √ √ √ 1
GE_DATE — — — — — — — — — 1
GE_DT — — — — — — — — — 1
Equal EQ_INT √ √ √ √ √ √ √ √ √ 1
EQ_DINT √ √ √ √ √ √ √ √ √ 1
EQ_UINT √ √ √ √ √ √ √ √ √ 1
EQ_REAL √ √ √ √ √ √ √ √ √ 1
EQ_WORD √ √ √ √ √ √ √ √ √ 1
EQ_DWORD √ √ √ √ √ √ √ √ √ 1
EQ_TIME √ √ √ √ √ √ √ √ √ 1
EQ_TOD √ √ √ √ √ √ √ √ √ 1
EQ_DATE √ √ √ √ √ √ √ √ √ 1
EQ_DT — — — — — — — — — 1
6F8C1226
1. General 1-32

nv series Supported model


Instruction Symbol type type L3 L2 Step
S3 S2 L3 L2 L1
1 2 DS DS
Comparison
Less Than or Equal LE_INT √ √ √ √ √ √ √ √ √ 1
LE_DINT √ √ √ √ √ √ √ √ √ 1
LE_UINT √ √ √ √ √ √ √ √ √ 1
LE_REAL √ √ √ √ √ √ √ √ √ 1
LE_WORD √ √ √ √ √ √ √ √ √ 1
LE_DWORD √ √ √ √ √ √ √ √ √ 1
LE_TIME √ √ √ √ √ √ √ √ √ 1
LE_TOD √ √ √ √ √ √ √ √ √ 1
LE_DATE — — — — — — — — — 1
LE_DT — — — — — — — — — 1
Less Than LT_INT √ √ √ √ √ √ √ √ √ 1
LT_DINT √ √ √ √ √ √ √ √ √ 1
LT_UINT √ √ √ √ √ √ √ √ √ 1
LT_REAL √ √ √ √ √ √ √ √ √ 1
LT_WORD √ √ √ √ √ √ √ √ √ 1
LT_DWORD √ √ √ √ √ √ √ √ √ 1
LT_TIME √ √ √ √ √ √ √ √ √ 1
LT_TOD √ √ √ √ √ √ √ √ √ 1
LT_DATE — — — — — — — — — 1
LT_DT — — — — — — — — — 1
Not Equal NE_INT √ √ √ √ √ √ √ √ √ 1
NE_DINT √ √ √ √ √ √ √ √ √ 1
NE_UINT √ √ √ √ √ √ √ √ √ 1
NE_REAL √ √ √ √ √ √ √ √ √ 1
NE_WORD √ √ √ √ √ √ √ √ √ 1
NE_DWORD √ √ √ √ √ √ √ √ √ 1
NE_TIME √ √ √ √ √ √ √ √ √ 1
NE_TOD √ √ √ √ √ √ √ √ √ 1
NE_DATE √ √ √ √ √ √ √ √ √ 1
NE_DT — — — — — — — — — 1
Selection
Maximum MAX_INT √ √ √ √ √ √ √ √ √ 1
MAX_DINT √ √ √ √ √ √ √ √ √ 1
MAX_UINT √ √ √ √ √ √ √ √ √ 1
MAX_REAL √ √ √ √ √ √ √ √ √ 1
MAX_WORD √ √ √ √ √ √ √ √ √ 1
MAX_DWORD √ √ √ √ √ √ √ √ √ 1
MAX_TIME √ √ √ √ √ √ √ √ √ 1
MAX_TOD √ √ √ √ √ √ √ √ √ 1
MAX_DATE — — — — — — — — — 1
MAX_DT — — — — — — — — — 1
6F8C1226
1. General 1-33

nv series Supported model


Instruction Symbol type type L3 L2 Step
S3 S2 L3 L2 L1
1 2 DS DS
Selection
Maximum of Table Data MAXL_INT √ √ √ √ — — — — — 1
MAXL_DINT √ √ √ √ — — — — — 1
MAXL_UINT √ √ √ √ — — — — — 1
MAXL_REAL √ √ √ √ — — — — — 1
MAXL_TIME √ √ √ √ — — — — — 1
MAXL_TOD √ √ √ √ — — — — — 1
MAXL_DATE — — — — — — — — — 1
MAXL_DT — — — — — — — — — 1
Minimum MIN_INT √ √ √ √ √ √ √ √ √ 1
MIN_DINT √ √ √ √ √ √ √ √ √ 1
MIN_UINT √ √ √ √ √ √ √ √ √ 1
MIN_REAL √ √ √ √ √ √ √ √ √ 1
MIN_WORD √ √ √ √ √ √ √ √ √ 1
MIN_DWORD √ √ √ √ √ √ √ √ √ 1
MIN_TIME √ √ √ √ √ √ √ √ √ 1
MIN_TOD √ √ √ √ √ √ √ √ √ 1
MIN_DATE — — — — — — — — — 1
MIN_DT — — — — — — — — — 1
Minimum of Table Data MINL_INT √ √ √ √ — — — — — 1
MINL_DINT √ √ √ √ — — — — — 1
MINL_UINT √ √ √ √ — — — — — 1
MINL_REAL √ √ √ √ — — — — — 1
MINL_TIME √ √ √ √ — — — — — 1
MINL_TOD √ √ √ √ — — — — — 1
MINL_DATE — — — — — — — — — 1
MINL_DT — — — — — — — — — 1
Average Value AVE_INT √ √ √ √ √ √ √ √ √ 1
AVE_DINT √ √ √ √ √ √ √ √ √ 1
AVE_UINT √ √ √ √ √ √ √ √ √ 1
AVE_REAL √ √ √ √ √ √ √ √ √ 1
AVE_TIME √ √ √ √ √ √ √ √ √ 1
Average of Table Data AVEL_INT √ √ √ √ — — — — — 1
AVEL_DINT √ √ √ √ — — — — — 1
AVEL_UINT √ √ √ √ — — — — — 1
AVEL_REAL √ √ √ √ — — — — — 1
AVEL_TIME √ √ √ √ — — — — — 1
Limiter LIMIT_INT √ √ √ √ √ √ √ √ √ 1
LIMIT_DINT √ √ √ √ √ √ √ √ √ 1
LIMIT_UINT √ √ √ √ √ √ √ √ √ 1
LIMIT_REAL √ √ √ √ √ √ √ √ √ 1
LIMIT_WORD √ √ √ √ √ √ √ √ √ 1
LIMIT_DWORD √ √ √ √ √ √ √ √ √ 1
LIMIT_TIME √ √ √ √ √ √ √ √ √ 1
LIMIT_TOD √ √ √ √ √ √ √ √ √ 1
LIMIT_DATE — — — — — — — — — 1
LIMIT_DT — — — — — — — — — 1
6F8C1226
1. General 1-34

nv series Supported model


Instruction Symbol type type L3 L2 Step
S3 S2 L3 L2 L1
1 2 DS DS
Selection
Selector SEL_BOOL √ √ √ √ √ √ √ √ √ 1
SEL_INT √ √ √ √ √ √ √ √ √ 1
SEL_DINT √ √ √ √ √ √ √ √ √ 1
SEL_UINT √ √ √ √ √ √ √ √ √ 1
SEL_REAL √ √ √ √ √ √ √ √ √ 1
SEL_WORD √ √ √ √ √ √ √ √ √ 1
SEL_DWORD √ √ √ √ √ √ √ √ √ 1
SEL_TIME √ √ √ √ √ √ √ √ √ 1
SEL_TOD √ √ √ √ √ √ √ √ √ 1
SEL_DATE √ √ √ √ √ √ √ √ √ 1
SEL_DT — — — — — — — — — 1
Multiplex MUX_BOOL √ √ √ √ — — — — — 1
MUX_INT √ √ √ √ — — — — — 1
MUX_DINT √ √ √ √ — — — — — 1
MUX_UINT √ √ √ √ — — — — — 1
MUX_WORD √ √ √ √ — — — — — 1
MUX_DWORD √ √ √ √ — — — — — 1
MUX_REAL √ √ √ √ — — — — — 1
MUX_TIME √ √ √ √ — — — — — 1
MUX_TOD √ √ √ √ — — — — — 1
MUX_DATE √ √ √ √ — — — — — 1
MUX_DT — — — — — — — — — 1
Multiplex of Table Data MPX_INT √ √ √ √ — — — — — 1
MPX_DINT √ √ √ √ — — — — — 1
MPX_UINT √ √ √ √ — — — — — 1
MPX_WORD √ √ √ √ — — — — — 1
MPX_DWORD √ √ √ √ — — — — — 1
MPX_REAL √ √ √ √ — — — — — 1
MPX_TIME √ √ √ √ — — — — — 1
MPX_TOD √ √ √ √ — — — — — 1
MPX_DATE √ √ √ √ — — — — — 1
MPX_DT — — — — — — — — — 1
6F8C1226
1. General 1-35

nv series Supported model


Instruction Symbol type type L3 L2 Step
S3 S2 L3 L2 L1
1 2 DS DS
Type Conversion
Integer-Integer INT_TO_DINT √ √ √ √ 1.30 1.10 2.30 √ — 1
Conversion INT_TO_UINT √ √ 2.50 2.53 — — — — — 1
DINT_TO_INT √ √ √ √ 1.30 1.10 2.30 √ — 1
DINT_TO_UINT √ √ 2.50 2.53 — — — — — 1
UINT_TO_INT √ √ 2.50 2.53 — — — — — 1
UINT_TO_DINT √ √ 2.50 2.53 — — — — — 1
Integer-Real Numbers INT_TO_REAL √ √ √ √ √ √ √ √ √ 1
Conversion DINT_TO_REAL √ √ √ √ √ √ √ √ √ 1
UINT_TO_REAL √ √ 2.50 2.53 — — — — — 1
Integer-Bit String INT_TO_WORD √ √ √ √ √ √ √ √ 1.03 1
Conversion INT_TO_DWORD √ √ 2.50 2.53 — — — — — 1
DINT_TO_WORD √ √ 2.50 2.53 — — — — — 1
DINT_TO_DWORD √ √ √ √ √ √ √ √ 1.03 1
UINT_TO_WORD √ √ √ √ √ √ √ √ 1.03 1
UINT_TO_DWORD √ √ 2.50 2.53 — — — — — 1
Integer-BCD Conversion INT_TO_BCD_WORD √ √ 2.50 2.53 — — — — — 1
INT_TO_BCD_DWORD √ √ 2.50 2.53 — — — — — 1
DINT_TO_BCD_WORD √ √ 2.50 2.53 — — — — — 1
DINT_TO_BCD_DWORD √ √ √ √ — — — — — 1
UINT_TO_BCD_WORD √ √ √ √ — — — — — 1
UINT_TO_BCD_DWORD √ √ 2.50 2.53 — — — — — 1
Integer-Duration INT_TO_TIME √ √ 2.50 2.53 — — — — — 1
Conversion DINT_TO_TIME √ √ 2.50 2.53 — — — — — 1
UINT_TO_TIME √ √ 2.50 2.53 — — — — — 1
Real Numbers-Integer REAL_TO_INT √ √ √ √ √ √ √ √ √ 1
Conversion REAL_TO_DINT √ √ √ √ √ √ √ √ √ 1
REAL_TO_UINT √ √ 2.50 2.53 — — — — — 1
Real Numbers-BCD REAL_TO_BCD_WORD √ √ 2.50 2.53 — — — — — 1
Conversion REAL_TO_BCD_DWORD √ √ 2.50 2.53 — — — — — 1
Real Numbers-Duration REAL_TO_TIME
√ √ 2.50 2.53 — — — — — 1
Conversion
Bit String- Integer WORD_TO_INT √ √ √ √ √ √ √ √ 1.03 1
Conversion WORD_TO_DINT √ √ 2.50 2.53 — — — — — 1
WORD_TO_UINT √ √ √ √ √ √ √ √ 1.03 1
DWORD_TO_INT √ √ 2.50 2.53 — — — — — 1
DWORD_TO_DINT √ √ √ √ √ √ √ √ 1.03 1
DWORD_TO_UINT √ √ 2.50 2.53 — — — — — 1
Bit String-Bit String WORD_TO_DWORD √ √ √ √ 1.30 1.10 2.30 √ — 1
Conversion DWORD_TO_WORD √ √ √ √ 1.30 1.10 2.30 √ — 1
BCD-Integer Conversion WORD_BCD_TO_INT √ √ 2.50 2.53 — — — — — 1
WORD_BCD_TO_DINT √ √ 2.50 2.53 — — — — — 1
WORD_BCD_TO_UINT √ √ √ √ — — — — — 1
DWORD_BCD_TO_INT √ √ 2.50 2.53 — — — — — 1
DWORD_BCD_TO_DINT √ √ √ √ — — — — — 1
DWORD_BCD_TO_UINT √ √ 2.50 2.53 — — — — — 1
BCD-Real Numbers WORD_BCD_TO_REAL √ √ 2.50 2.53 — — — — — 1
Conversion DWORD_BCD_TO_REAL √ √ 2.50 2.53 — — — — — 1
BCD-Duration Conversion WORD_BCD_TO_TIME √ √ 2.50 2.53 — — — — — 1
DWORD_BCD_TO_TIME √ √ 2.50 2.53 — — — — — 1
6F8C1226
1. General 1-36

nv series Supported model


Instruction Symbol type type L3 L2 Step
S3 S2 L3 L2 L1
1 2 DS DS
Type Conversion
Duration-Integer TIME_TO_INT √ √ 2.50 2.53 — — — — — 1
Conversion TIME_TO_DINT √ √ 2.50 2.53 — — — — — 1
TIME_TO_UINT √ √ 2.50 2.53 — — — — — 1
Duration -Real Numbers TIME_TO_REAL
√ √ 2.50 2.53 — — — — — 1
Conversion
Duration -BCD TIME_TO_BCD_WORD √ √ 2.50 2.53 — — — — — 1
Conversion TIME_TO_BCD_DWORD √ √ 2.50 2.53 — — — — — 1
Truncation TRUNC_INT √ √ √ √ — — — — — 1
TRUNC_DINT √ √ √ √ — — — — — 1
TRUNC_UINT √ √ 2.50 2.53 — — — — — 1
Sign Negative NEG_INT √ √ √ √ — — — — — 1
NEG_DINT √ √ √ √ — — — — — 1
NEG_REAL √ √ √ √ — — — — — 1
DEG-RAD Conversion DEG_TO_RAD √ √ √ √ — — — — — 1
RAD-DEG Conversion RAD_TO_DEG √ √ √ √ — — — — — 1
BIN Conversion BIN_INT_P √ √ √ √ — — — — — 1
BIN_DINT_P √ √ √ √ — — — — — 1
Time Data Type DT_TO_TOD √ √ 2.50 2.53 — — — — — 1
Conversion DT_TO_DATE √ √ 2.50 2.53 — — — — — 1
Concatenate Time Data CONCAT_D_TOD √ √ 2.50 2.53 — — — — — 1
ASCII-HEX Conversion ATOH_T √ √ √ √ — — — — — 1
HEX-ASCII Conversion HTOA_T √ √ √ √ — — — — — 1
ASCII-Real Numbers ASC_TO_REAL
√ √ √ √ — — — — — 1
Conversion
Real Numbers-ASCII REAL_TO_ASC
√ √ √ √ — — — — — 1
Conversion
ASCII (Decimal)-Double ASCDEC_TO_DINT
Integer Conversion √ √ 2.50 2.53 — — — — — 1
ASCII ASCHEX_TO_DINT
(Hexadecimal)-Double √ √ 2.50 2.53 — — — — — 1
Integer Conversion
Double Integer-ASCII DINT_TO_ASCDEC
(Decimal) Conversion √ √ 2.50 2.53 — — — — — 1
Double Integer-ASCII DINT_TO_ASCHEX
(Hexadecimal) √ √ 2.50 2.53 — — — — — 1
Conversion
Array-String Conversion ARRAY_TO_STRING — — — — — — — — — 1
String-Array Conversion STRING_TO_ARRAY — — — — — — — — — 1
Tag Number Conversion TO_INDEX — √ — — — 1.1A — 1.18 2.23 1
Numeric Function
Square Root SQRT √ √ √ √ √ √ √ √ √ 1
Exponential EXP √ √ √ √ √ √ √ √ √ 1
Common Logarithms LOG √ √ √ √ √ √ √ √ √ 1
Natural Logarithms LN √ √ √ √ √ √ √ √ √ 1
Absolute Value ABS_INT √ √ √ √ √ √ √ √ √ 1
ABS_DINT √ √ √ √ √ √ √ √ √ 1
ABS_REAL √ √ √ √ √ √ √ √ √ 1
Sine SIN √ √ √ √ √ √ √ √ — 1
Cosine COS √ √ √ √ √ √ √ √ — 1
Tangent TAN √ √ √ √ √ √ √ √ — 1
Arcsine ASIN √ √ √ √ √ √ √ √ — 1
Arccosine ACOS √ √ √ √ √ √ √ √ — 1
Arctangent ATAN √ √ √ √ √ √ √ √ — 1
6F8C1226
1. General 1-37

nv series Supported model


Instruction Symbol type type L3 L2 Step
S3 S2 L3 L2 L1
1 2 DS DS
Logical Operation
Bitwise Boolean AND AND_BOOL √ √ √ √ √ √ √ √ √ 1
AND_WORD √ √ √ √ √ √ √ √ √ 1
AND_DWORD √ √ √ √ √ √ √ √ √ 1
Bitwise Boolean AND of TAND
√ √ 2.50 2.53 — — — — — 1
Table Data
Bitwise Boolean OR OR_BOOL √ √ √ √ √ √ √ √ √ 1
OR_WORD √ √ √ √ √ √ √ √ √ 1
OR_DWORD √ √ √ √ √ √ √ √ √ 1
Bitwise Boolean OR of TOR
√ √ 2.50 2.53 — — — — — 1
Table Data
Bitwise Boolean NOT NOT_BOOL √ √ √ √ √ √ √ √ √ 1
NOT_WORD √ √ √ √ √ √ √ √ √ 1
NOT_DWORD √ √ √ √ √ √ √ √ √ 1
Bitwise Boolean NOT of TNOT
√ √ 2.50 2.53 — — — — — 1
Table Data
Bitwise Boolean XOR XOR_BOOL √ √ √ √ √ √ √ √ √ 1
XOR_WORD √ √ √ √ √ √ √ √ √ 1
XOR_DWORD √ √ √ √ √ √ √ √ √ 1
Bitwise Boolean XOR of TXOR
√ √ 2.50 2.53 — — — — — 1
Table Data
Bitwise Boolean NOT TXNR
√ √ 2.50 2.53 — — — — — 1
XOR of Table Data
Test TEST_WORD √ √ √ √ — — — — — 1
TEST_DWORD √ √ √ √ — — — — — 1
Bit Operation
Shift Bits Right SHR_WORD √ √ √ √ √ √ √ √ √ 1
SHR_DWORD √ √ √ √ √ √ √ √ √ 1
Shift Bits Left SHL_WORD √ √ √ √ √ √ √ √ √ 1
SHL_DWORD √ √ √ √ √ √ √ √ √ 1
Rotate Bits Right ROR_WORD √ √ √ √ √ √ √ √ √ 1
ROR_DWORD √ √ √ √ √ √ √ √ √ 1
Rotate Bits Left ROL_WORD √ √ √ √ √ √ √ √ √ 1
ROL_DWORD √ √ √ √ √ √ √ √ √ 1
Arithmetic Shift SFA_WORD_P √ √ √ √ √ √ √ √ — 1
SFA_DWORD_P √ √ √ √ √ √ √ √ — 1
Logical Shift SFL_WORD_P √ √ √ √ √ √ √ √ — 1
SFL_DWORD_P √ √ √ √ √ √ √ √ — 1
6F8C1226
1. General 1-38

nv series Supported model


Instruction Symbol type type L3 L2 Step
S3 S2 L3 L2 L1
1 2 DS DS
Arithmetic Operation
Add ADD_INT √ √ √ √ √ √ √ √ √ 1
ADD_DINT √ √ √ √ √ √ √ √ √ 1
ADD_UINT √ √ √ √ √ √ √ √ √ 1
ADD_REAL √ √ √ √ √ √ √ √ √ 1
Add with Carry ADC_INT √ √ √ √ — — — — — 1
ADC_DINT √ √ √ √ — — — — — 1
Subtract SUB_INT √ √ √ √ √ √ √ √ √ 1
SUB_DINT √ √ √ √ √ √ √ √ √ 1
SUB_UINT √ √ √ √ √ √ √ √ √ 1
SUB_REAL √ √ √ √ √ √ √ √ √ 1
Subtract with Carry SBB_INT √ √ √ √ — — — — — 1
SBB_DINT √ √ √ √ — — — — — 1
Multiply MUL_INT √ √ √ √ √ √ √ √ √ 1
MUL_DINT √ √ √ √ √ √ √ √ √ 1
MUL_UINT √ √ √ √ √ √ √ √ √ 1
MUL_REAL √ √ √ √ √ √ √ √ √ 1
MUL_INT_DINT √ √ √ √ — — — — — 1
Divide DIV_INT √ √ √ √ √ √ √ √ √ 1
DIV_DINT √ √ √ √ √ √ √ √ √ 1
DIV_UINT √ √ √ √ √ √ √ √ √ 1
DIV_REAL √ √ √ √ √ √ √ √ √ 1
Remainder MOD_INT √ √ √ √ √ √ √ √ √ 1
MOD_DINT √ √ √ √ √ √ √ √ √ 1
MOD_UINT √ √ √ √ √ √ √ √ √ 1
Increment INC_INT √ √ √ √ √ √ √ √ — 1
INC_DINT √ √ √ √ √ √ √ √ — 1
INC_UINT — — — — — — — — — 1
INC_REAL — — — — — — — — — 1
INC_TIME — — — — — — — — — 1
Decrement DEC_INT √ √ √ √ √ √ √ √ — 1
DEC_DINT √ √ √ √ √ √ √ √ — 1
DEC_UINT — — — — — — — — — 1
DEC_REAL — — — — — — — — — 1
DEC_TIME — — — — — — — — — 1
Power EXPT_INT √ √ √ √ — — — — — 1
EXPT_DINT √ √ √ √ — — — — — 1
EXPT_UINT √ √ √ √ — — — — — 1
EXPT_REAL √ √ √ √ √ √ √ √ √ 1
Add Time Data ADD_T_T — — — — — — — — — 1
ADD_TOD_T — — — — — — — — — 1
ADD_DT_T — — — — — — — — — 1
ADD_D_INT — — — — — — — — — 1
ADD_D_DINT — — — — — — — — — 1
ADD_D_UINT — — — — — — — — — 1
6F8C1226
1. General 1-39

nv series Supported model


Instruction Symbol type type L3 L2 Step
S3 S2 L3 L2 L1
1 2 DS DS
Arithmetic Operation
Subtract Time Data SUB_T_T — — — — — — — — — 1
SUB_D_D — — — — — — — — — 1
SUB_TOD_T — — — — — — — — — 1
SUB_TOD_TOD — — — — — — — — — 1
SUB_DT_T — — — — — — — — — 1
SUB_DT_DT — — — — — — — — — 1
SUB_D_D_INT — — — — — — — — — 1
SUB_D_D_DINT — — — — — — — — — 1
SUB_D_D_UINT — — — — — — — — — 1
SUB_D_INT — — — — — — — — — 1
SUB_D_DINT — — — — — — — — — 1
SUB_D_UINT — — — — — — — — — 1
Multiply Time Data MUL_T_INT — — — — — — — — — 1
MUL_T_DINT — — — — — — — — — 1
MUL_T_UINT — — — — — — — — — 1
Divide Time Data DIV_T_INT — — — — — — — — — 1
DIV_T_DINT — — — — — — — — — 1
DIV_T_UINT — — — — — — — — — 1
Data Processing
Set Carry SETC √ √ √ √ — — — — — 1
Reset Carry RSTC √ √ √ √ — — — — — 1
Encode ENC_WORD_INT √ √ 2.50 2.53 — — — — — 1
ENC_WORD_DINT √ √ 2.50 2.53 — — — — — 1
ENC_DWORD_INT √ √ 2.50 2.53 — — — — — 1
ENC_DWORD_DINT √ √ 2.50 2.53 — — — — — 1
Decode DEC_INT_WORD √ √ 2.50 2.53 — — — — — 1
DEC_INT_DWORD √ √ 2.50 2.53 — — — — — 1
DEC_DINT_WORD √ √ 2.50 2.53 — — — — — 1
DEC_DINT_DWORD √ √ 2.50 2.53 — — — — — 1
Bit Counter BC_WORD √ √ 2.50 2.53 — — — — — 1
BC_DWORD √ √ 2.50 2.53 — — — — — 1
Table Bit Set TSET_INT √ √ 2.50 2.53 — — — — — 1
TSET_DINT √ √ 2.50 2.53 — — — — — 1
TSET_WORD √ √ 2.50 2.53 — — — — — 1
TSET_DWORD √ √ 2.50 2.53 — — — — — 1
Table Bit Reset TRST_INT √ √ 2.50 2.53 — — — — — 1
TRST_DINT √ √ 2.50 2.53 — — — — — 1
TRST_WORD √ √ 2.50 2.53 — — — — — 1
TRST_DWORD √ √ 2.50 2.53 — — — — — 1
I/O
I/O Memory Read MREAD — — √ √ 1.35 1.10 2.10 √ — 1
I/O Memory Write MWRITE — — √ √ 1.35 1.10 2.10 √ — 1
Special Module Data Input MREAD_N 1.20 — — — — — — — — 2
Special Module Data
MWRITE_N 1.20 — — — — — — — — 2
Output
ASC Module String Data ASCREAD
— — — — — — — — — 1
Input
ASC Module String Data ASCWRITE
— — — — — — — — — 1
Output
State Change Detection
GET_IP_INF √ √ 2.06 2.52 — — — — — 1
Read
6F8C1226
1. General 1-40

Direct I/O IO_T — — 2.50 2.53 — — — — — 1


I/O Node State Read GET_SIO_STS √ √ — — — — — — — 1
I/O Module State Read GET_IO_STS √ √ — — — — — — — 1
I/O Degeneracy Request IOFB_REQ √ √ — — — — — — — 1
I/O Degeneracy Recovery
IORC_REQ √ √ — — — — — — — 1
Request

nv series Supported model


Instruction Symbol type type L3 L2 Step
S3 S2 L3 L2 L1
1 2 DS DS
Process Operation
Dead Band DB_INT √ √ √ √ — — — — — 1
DB_DINT √ √ √ √ — — — — — 1
DB_REAL √ √ √ √ — — — — — 1
Derivative DIF2 √ √ √ √ √ √ √ √ √ 2
Integrator INTG √ √ √ √ √ √ √ √ √ 2
Super Two Degrees of PID2
√ √ √ √ √ √ √ √ √ 2
Freedom PID
MV Calculation MVS √ √ √ √ √ √ √ √ √ 2
Fix MV MVF √ √ 2.50 2.53 √ √ √ √ √ 1
Polygonal Line Function PLN_INT √ √ √ √ — — — — — 1
PLN_REAL √ √ √ √ √ √ √ √ √ 1
Polygonal Line Function PLN_REAL2
1.20 — — — — — — — — 1
(high-speed version)
Inverse Polygonal Line ILNL_INT √ √ 2.50 2.53 — — — — — 1
Function ILNL_REAL √ √ 2.50 2.53 √ √ √ √ √ 1
Inverse Polygonal Line
Function (high-speed ILNL_REAL2 1.20 — — — — — — — — 1
version)
Dead Time DT √ √ √ √ √ √ √ √ √ 1
Moving Average MAV √ √ 2.50 2.53 √ √ √ √ √ 1
Moving Average
MAV_N √ √ — — — — — — — 1
(low-speed version)
Rate Limiter DLM_INT √ √ √ √ √ √ √ √ √ 2
DLM_DINT √ √ √ √ √ √ √ √ √ 2
Lag/Lead Filter DLM_REAL √ √ √ √ √ √ √ √ √ 2
LAG2 √ √ √ √ √ √ √ √ √ 2
Engineering Unit UNT
√ √ 2.50 2.53 √ √ √ √ √ 1
Conversion
Percent Conversion PCT √ √ 2.50 2.53 √ √ √ √ √ 1
Essential Succession PID PID3 √ √ 2.50 2.53 — — — — — 2
Program Control
Return RETURN √ √ √ √ √ √ √ √ √ 1
User Defined Function - √ √ √ √ √ √ √ √ √ 1
User Defined Function
- √ √ √ √ √ √ √ √ √ 2
Block
Program Enable EN_P √ √ √ √ √ √ √ √ — 1
Program Disable DIS_P √ √ √ √ √ √ √ √ — 1
Event Program Startup START_P √ √ — — √ √ √ √ — 1
Interrupt Enable EI_T √ √ √ √ — — — — — 1
Interrupt Disable DI_T √ √ √ √ — — — — — 1
String Processing
String Length LEN — — — — — — — — — 1
Leftmost extract string LEFT — — — — — — — — — 1
Rightmost extract string RIGHT — — — — — — — — — 1
Extract String MID — — — — — — — — — 1
Concatenate string CONCAT_STRING — — — — — — — — — 1
6F8C1226
1. General 1-41

Insert String INSERT — — — — — — — — — 1


Delete String DELETE — — — — — — — — — 1
Replace String REPLACE — — — — — — — — — 1
Find String FIND — — — — — — — — — 1
Define String DEF_STRING — — — — — — — — — 1

nv series Supported model


Instruction Symbol type type L3 L2 Step
S3 S2 L3 L2 L1
1 2 DS DS
Control Statements
IF IF √ √ √ √ √ √ √ √ √ 1
THEN THEN √ √ √ √ √ √ √ √ √ 1
ELSE (IF statement) ELSE √ √ √ √ √ √ √ √ √ 1
ELSEIF ELSEIF √ √ √ √ √ √ √ √ √ 1
END_IF END_IF √ √ √ √ √ √ √ √ √ 1
CASE CASE √ √ √ √ √ √ √ √ √ 1
: : √ √ √ √ √ √ √ √ √ 1
. .: ..: √ √ √ √ √ √ √ √ √ 1
, , √ √ √ √ √ √ √ √ √ 1
.. , .. , √ √ √ √ √ √ √ √ √ 1
ELSE (CASE statement) ELSE √ √ √ √ √ √ √ √ √ 1
END_CASE END_CASE √ √ √ √ √ √ √ √ √ 1
FOR_DO FOR_DO √ √ √ √ √ √ √ √ √ 1
EXIT (FOR statement) EXIT √ √ √ √ √ √ √ √ √ 1
END_FOR END_FOR √ √ √ √ √ √ √ √ √ 1
WHILE WHILE √ √ √ √ √ √ √ √ √ 1
DO DO √ √ √ √ √ √ √ √ √ 1
EXIT (WHILE statement) EXIT √ √ √ √ √ √ √ √ √ 1
END_WHILE END_WHILE √ √ √ √ √ √ √ √ √ 1
REPEAT REPEAT √ √ √ √ √ √ √ √ √ 1
UNTIL UNTIL √ √ √ √ √ √ √ √ √ 1
EXIT (REPEAT statement) EXIT √ √ √ √ √ √ √ √ √ 1
END_REPEAT END_REPEAT √ √ √ √ √ √ √ √ √ 1
Communication
Socket Communication USEND_T
— — √ √ √ √ √ √ 1.20 2
Send
Socket Communication USEND_N
√ √ — — — — — — — 2
Send
Socket Communication
URCV_T — — √ √ √ √ √ √ 1.20 2
Receive
Socket Communication
URCV_N √ √ — — — — — — — 2
Receive
Communication FB
XMIT_T — — 2.50 2.50 — — — — — 2
(XMIT_T)
Communication FB
XMIT_N 1.20 — — — — — — — — — 2
(XMIT_N)
Duplex Control
Duplex Online-Standby DUPLEX_CHG
√ √ √ √ 1.37 1.10 2.35 √ — 1
Change
Duplex Self-System Down DUPLEX_DOWN √ √ √ √ 1.37 1.10 2.35 √ — 1
Partial Equalizer (variable
EQUALIZE_VAR — — 2.50 2.53 — — — — — 1
specification)
Partial Equalizer (address 2.53 — — — — —
EQUALIZE_ADDR — — 2.50 1
specification)
6F8C1226
1. General 1-42

nv series Supported model


Instruction Symbol type type L3 L2 Step
S3 S2 L3 L2 L1
1 2 DS DS
Process Control
Current Output PID PID_P — √ — — — 1.10 — √ 2.00 2
Current Output Sample PI SPI_P — √ — — — — — — — 2
Pulse Output PID PIDP_P — √ — — — 1.10 — √ 2.00 2
Pulse Output Sample PI SPIP_P — √ — — — — — — — 2
Feed Forward FFD_P — √ — — — 1.10 — √ 2.00 2
Double Cross Limit DCL_P — √ — — — — — — — 2
Tag Operation
Change Adjuster Mode CMLP_P — √ — — — 1.10 — √ — 2
Change Push Button CMPB_P — — — — —
— √ 1.10 √ 2
Mode
Change Sequence Mode CMSQ_P — √ — — — 1.10 — √ — 2
Set SV SSV_P — √ — — — 1.10 — √ — 2
Reset SV RSV_P — √ — — — 1.10 — √ — 2
Set MV SMV_P — √ — — — 1.10 — √ — 2
Reset MV RMV_P — √ — — — 1.10 — √ — 2
Shut CV SCV_P — √ — — — 1.10 — √ — 2
Push Button ON PB_P — √ — — — 1.10 — √ — 2
Push Button Lock LB_P — √ — — — 1.10 — √ — 2
Action Timer ACT_P — √ — — — 1.10 — √ — 2
Action Counter ACC_P — √ — — — 1.10 — √ — 2
Self Step Jump SJ_P — √ — — — 1.10 — √ — 2
Reset Jump RJ_P — √ — — — 1.10 — √ — 2
RAS
Cyclic Trace DATALOGC √ √ 2.17 2.52 — — — — — 2
Calendar Data Acquisition GET_CLND √ √ — — — — — — — 1
Interlock Diagnosis DIAG_D √ — 2.75 — — — — — — 2
6F8C1226
1. General 1-43

nv series Supported model


Instruction Symbol type type L3 L2 Step
S3 S2 L3 L2 L1
1 2 DS DS
SFC

Step √ √ √ √ √ √ √ √ 1.10 1

Initial Step √ √ √ √ √ √ √ √ 1.10 2

Transition √ √ √ √ √ √ √ √ 1.10 2

Divergence/Convergence
√ √ √ √ √ √ √ √ 1.10 2
of Sequence
Divergence/Convergence
of Simultaneous √ √ √ √ √ √ √ √ 1.10 2
Sequences

Link √ √ √ √ √ √ √ √ 1.10 2

Action (BOOL type) B √ √ √ √ √ √ √ √ 1.10 3

U
Action (User defined type) √ √ √ √ √ √ √ √ 1.10 3/5

Sequence
SEQ — √ — — — 1.10 — √ — 2
(See Note)

Phase Step N
— √ — — — 1.10 — √ — 5
(See Note)

Phase End Step


P hase E nd — √ — — — 1.10 — √ — 1
(See Note)

Answer Step A n s — √ — — — 1.10 — √ — 3


(See Note)
6F8C1226
2. Contacts & Coils 2-1

2 Contacts & Coils

No. Instruction Remarks


1 Normally Open Contact
2 Normally Closed Contact
3 Positive Transition-sensing Contact P
4 Negative Transition-sensing Contact N
5 Rising Edge Detector
6 Falling Edge Detector
7 Inverter I
8 Coil
9 Negated Coil
10 SET Coil S
11 RESET Coil R
12 Positive Transition-sensing Coil P
13 Negative Transition-sensing Coil N
14 Forced Coil
15 Forced Negated Coil
16 Forced SET Coil S
17 Forced RESET Coil R
18 Forced Positive Transition-sensing Coil P
19 Forced Negative Transition-sensing Coil N
6F8C1226
2. Contacts & Coils 2-2

Contacts & Coils Normally Open Contact

Variable(BOOL)
Diagram
Input Output

EN input Edge execution Index modification


Modifier
— — √

Function:
• Normally open contact of variable (BOOL).
Input Condition Output
OFF Regardless of variable (BOOL) state OFF
Variable (BOOL)=OFF OFF
ON
Variable (BOOL)=ON ON

Program example:
SIGNAL1 SIGNAL2 SIGNAL3

• Coil SIGNAL3 is ON only when states of SIGNAL1 and SIGNAL2 are both ON.

SIGNAL1

SIGNAL2

SIGNAL3

Error information:
• When there is a boundary error due to index modification, the value of variable (BOOL) is treated as OFF and data boundary
over occurs.
6F8C1226
2. Contacts & Coils 2-3

Contacts & Coils Normally Closed Contact

Variable (BOOL)
Diagram
Input Output

EN input Edge execution Index modification


Modifier
— — √

Function:
• Relay coil b contact (always closed contact) corresponding to variable (BOOL).
Input Condition Output
OFF Regardless of variable (BOOL) state OFF
Variable (BOOL)=OFF ON
ON
Variable (BOOL)=ON OFF

Program example:
SIGNAL1 SIGNAL2 SIGNAL3

• Coil SIGNAL3 is ON only when states of SIGNAL1 and SIGNAL2 are both OFF.

SIGNAL1

SIGNAL2

SIGNAL3

Error information:
• When there is a boundary error due to index modification, the value of variable (BOOL) is treated as OFF and data boundary
over occurs.
6F8C1226
2. Contacts & Coils 2-4

Contacts & Coils Positive Transition-sensing Contact

Variable (BOOL)
Diagram
Input P Output

EN input Edge execution Index modification


Modifier
— — √

Function:
• The output is kept ON for 1 scan time, when the input is ON and the variable(BOOL) changes from OFF to ON.
Input Condition Output
OFF Regardless of variable (BOOL) state OFF
Variable (BOOL)=OFF→OFF OFF
Variable (BOOL)=ON→OFF OFF
ON
Variable (BOOL)=OFF→ON ON
Variable (BOOL)=ON→ON OFF

Program example:
SIGNAL1 SIGNAL2 SIGNAL3
P

• When the variable SIGNAL1 is ON and the variable SIGNAL2 changes from OFF to ON, coil SIGNAL3 keeps ON for 1 scan
time only.

SIGNAL1

SIGNAL2

SIGNAL3

t t t:1 Scan time

Error information:
• When there is a boundary error due to index modification, the value of variable (BOOL) is treated as OFF and data boundary
over occurs.
6F8C1226
2. Contacts & Coils 2-5

Contacts & Coils Negative Transition-sensing Contact

Variable (BOOL)
Diagram
Input N Output

EN input Edge execution Index modification


Modifier
— — √

Function:
• The output is kept ON for 1 scan time, when the input is ON and the variable(BOOL) changes from ON to OFF.
Input Condition Output
OFF Regardless of variable (BOOL) state OFF
Variable (BOOL)=OFF→OFF OFF
Variable (BOOL)=ON→OFF ON
ON
Variable (BOOL)=OFF→ON OFF
Variable (BOOL)=ON→ON OFF

Program example:
SIGNAL1 SIGNAL2 SIGNAL3
N

• When the variable SIGNAL1 is ON and the variable SIGNAL2 changes from ON to OFF, coil SIGNAL3 keeps ON for 1 scan
time only.

SIGNAL1

SIGNAL2

SIGNAL3

t t t:1 Scan time

Error information:
• When there is a boundary error due to index modification, the value of variable (BOOL) is treated as OFF and data boundary
over occurs.
6F8C1226
2. Contacts & Coils 2-6

Contacts & Coils Rising Edge Detector

Diagram Input ↑ Output

EN input Edge execution Index modification


Modifier
— — —

Function:
• The output is kept ON for 1 scan time, when the input changes from OFF to ON.
Input Condition Output
OFF Regardless of previous input state OFF
Previous input=OFF ON
ON
Previous input=ON OFF

Program example:
SIGNAL1 SIGNAL2

• The coil SIGNAL2 keeps ON for 1 scan time only when the variable SIGNAL1 changes from OFF to ON.

SIGNAL1

SIGNAL2

t t t

t:1 Scan time


6F8C1226
2. Contacts & Coils 2-7

Contacts & Coils Falling Edge Detector

Diagram Input ↓ Output

EN input Edge execution Index modification


Modifier
— — —

Function:
• The output is kept ON for 1 scan time, when the input changes from ON to OFF.
Input Condition Output
Previous input=OFF OFF
OFF
Previous input=ON ON
ON Regardless of previous input state OFF

Program example:
SIGNAL1 SIGNAL2

• The coil SIGNAL2 keeps ON for 1 scan time only when the variable SIGNAL1 changes from ON to OFF.

SIGNAL1

SIGNAL2

t t t
t:1 Scan time
6F8C1226
2. Contacts & Coils 2-8

Contacts & Coils Inverter

Diagram Input I Output

EN input Edge execution Index modification


Modifier
— — —

Function:
• The output is turned ON, when the input is OFF, and the output is turned OFF, when the input is ON.
Input Condition Output
OFF — ON
ON — OFF

Program example:
SIGNAL1 SIGNAL2
I

• Coil SIGNAL2 becomes OFF when variable SIGNAL1 is ON and ON when variable SIGNAL1 is OFF.

SIGNAL1

SIGNAL2
6F8C1226
2. Contacts & Coils 2-9

Contacts & Coils Coil

Variable (BOOL)
Diagram
Input

EN input Edge execution Index modification


Modifier
— — √

Function:
• Relay coil of a variable(BOOL).
• The input state is stored in the variable(BOOL).
Input Action Output
OFF Variable (BOOL)=OFF —
ON Variable (BOOL)=ON —

Program example:
SIGNAL1 SIGNAL2 SIGNAL3

• The coil SIGNAL3 becomes ON only when these states of variables SIGNAL1 and SIGNAL2 are both ON.

SIGNAL1

SIGNAL2

SIGNAL3

Error information:
• When there is a boundary error due to index modification, the value of variable (BOOL) is unchanged and data boundary
over occurs.
6F8C1226
2. Contacts & Coils 2-10

Contacts & Coils Negated Coil

Variable (BOOL)
Diagram
Input

EN input Edge execution Index modification


Modifier
— — √

Function:
• Negated coil of a variable(BOOL).
• The negated input state is stored in the variable(BOOL).
Input Action Output
OFF Variable (BOOL)=ON —
ON Variable (BOOL)=OFF —

Program example:
SIGNAL1 SIGNAL2 SIGNAL3

• The coil SIGNAL3 becomes OFF only when these states of variables SIGNAL1 and SIGNAL2 are both ON.

SIGNAL1

SIGNAL2

SIGNAL3

Error information:
• When there is a boundary error due to index modification, the value of variable (BOOL) is unchanged and data boundary
over occurs.
6F8C1226
2. Contacts & Coils 2-11

Contacts & Coils SET Coil

Variable (BOOL)
Diagram S
Input

EN input Edge execution Index modification


Modifier
— — √

Function:
• Set coil of a variable(BOOL).
• When the input state is ON, the variable is set to ON, and remains ON.
Input Action Output
OFF Variable (BOOL)=Unchanged —
ON Variable (BOOL)=ON —

Program example:
SIGNAL1 SIGNAL2 SIGNAL3
S

• The coil SIGNAL3 is set to ON when state of variables SIGNAL1 and SIGNAL2 are both ON, and then the variable SIGNAL3
remains ON even when SET coil input becomes OFF.

SIGNAL1

SIGNAL2

SIGNAL3

Error information:
• When there is a boundary error due to index modification, the value of variable (BOOL) is unchanged and data boundary
over occurs.
6F8C1226
2. Contacts & Coils 2-12

Contacts & Coils RESET Coil

Variable (BOOL)
Diagram R
Input

EN input Edge execution Index modification


Modifier
— — √

Function:
• Reset coil of a variable(BOOL).
• When the input state is ON, the variable is reset to OFF, and remains OFF.
Input Action Output
OFF Variable (BOOL)=unchanged —
ON Variable (BOOL)=OFF —

Program example:
SIGNAL1 SIGNAL2 SIGNAL3
R

• The coil SIGNAL3 is reset to OFF when state of variables SIGNAL1 and SIGNAL2 are both ON, and then variable SIGNAL3
remains OFF even when RESET coil input becomes OFF.

SIGNAL1

SIGNAL2

SIGNAL3

Error information:
• When there is a boundary error due to index modification, the value of variable (BOOL) is unchanged and data boundary
over occurs.
6F8C1226
2. Contacts & Coils 2-13

Contacts & Coils Positive Transition-sensing Coil

Variable (BOOL)
Diagram P
Input

EN input Edge execution Index modification


Modifier
— — √

Function:
• When the input changes from OFF to ON, the variable(BOOL) is kept to ON for 1 scan time only.
Input Action Output
OFF Variable (BOOL)=OFF —
When previous input=OFF, variable (BOOL)=ON —
ON
When previous input=ON, variable (BOOL)=OFF —

Program example:
SIGNAL1 SIGNAL2
P

• When the variable SIGNAL1 changes from OFF to ON, the variable SIGNAL2 is kept to ON for 1 scan time only.

SIGNAL1

SIGNAL2

t t t
t:1 Scan time

Error information:
• When there is a boundary error due to index modification, the value of variable (BOOL) is unchanged and data boundary
over occurs. However, the input state for pulse operation is saved.
6F8C1226
2. Contacts & Coils 2-14

Contacts & Coils Negative Transition-sensing Coil

Variable (BOOL)
Diagram N
Input

EN input Edge execution Index modification


Modifier
— — √

Function:
• When the input changes from ON to OFF, the variable(BOOL) is kept to ON for 1 scan time only.
Input Action Output
When previous input=OFF, variable (BOOL)=OFF —
OFF
When previous input=ON, variable (BOOL)=ON —
ON Variable (BOOL)=OFF —

Program example:
SIGNAL1 SIGNAL2
N

• When the variable SIGNAL1 changes from ON to OFF, the variable SIGNAL2 is kept to ON for 1 scan time only.

SIGNAL1

SIGNAL2

t t t
t:1 Scan time

Error information:
• When there is a boundary error due to index modification, the value of variable (BOOL) is unchanged and data boundary
over occurs. However, the input state for pulse operation is saved.
6F8C1226
2. Contacts & Coils 2-15

Contacts & Coils Forced Coil

Variable (BOOL)
Diagram
Input

EN input Edge execution Index modification


Modifier
— — √

Function:
• This is 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
OFF Variable(BOOL)=retains previous state —
ON Variable(BOOL)=retains previous state —

Program example:
SIGNAL1 SIGNAL2

• The forced set state of variable SIGNAL2 is retained regardless of the state of variable SIGNAL1.
• If the state of variable SIGNAL2 just before being forced set is ON, the forced coil retains the ON state (see ex.1).
• If the state of variable SIGNAL2 just before being forced set is OFF, the forced coil retains the OFF state (see ex.2).

SIGNAL1

SIGNAL2
ex.1 ex.2
Set forced Reset Set forced Reset
forced forced

Error information:
• When there is a boundary error due to index modification, the value of variable (BOOL) is unchanged and data boundary
over occurs.
6F8C1226
2. Contacts & Coils 2-16

Contacts & Coils Forced Negated Coil

Variable (BOOL)
Diagram
Input

EN input Edge execution Index modification


Modifier
— — √

Function:
• This is 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
OFF Variable(BOOL)=retains previous state —
ON Variable(BOOL)=retains previous state —

Program example:
SIGNAL1 SIGNAL2

• The forced set state of variable SIGNAL2 is retained regardless of the state of variable SIGNAL1.
• If the state of variable SIGNAL2 just before being forced set is OFF, the forced negated coil retains the OFF state (see ex.1).
• If the state of variable SIGNAL2 just before being forced set is ON, the forced negated coil retains the ON state (see ex.2).

SIGNAL1

SIGNAL2
ex.1 ex.2
Set forced Reset Set forced Reset
forced forced

Error information:
• When there is a boundary error due to index modification, the value of variable (BOOL) is unchanged and data boundary
over occurs.
6F8C1226
2. Contacts & Coils 2-17

Contacts & Coils Forced SET Coil

Variable (BOOL)
Diagram S
Input

EN input Edge execution Index modification


Modifier
— — √

Function:
• This is 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
OFF Variable(BOOL)=retains previous state —
ON Variable(BOOL)=retains previous state —

Program example:
SIGNAL1 SIGNAL2
S

• The forced set state of variable SIGNAL2 is retained regardless of the state of variable SIGNAL1.
• If the state of variable SIGNAL2 just before being forced set is OFF, the forced SET coil retains the OFF state (see ex.1).
• If the state of variable SIGNAL2 just before being forced set is ON, the forced SET coil retains the ON state (see ex.2).

SIGNAL1

SIGNAL2
ex.1 ex.2
Set forced Reset Set forced Reset
forced forced

Error information:
• When there is a boundary error due to index modification, the value of variable (BOOL) is unchanged and data boundary
over occurs.
6F8C1226
2. Contacts & Coils 2-18

Contacts & Coils Forced RESET Coil

Variable (BOOL)
Diagram R
Input

EN input Edge execution Index modification


Modifier
— — √

Function:
• This is 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
OFF Variable(BOOL)=retains previous state —
ON Variable(BOOL)=retains previous state —

Program example:
SIGNAL1 SIGNAL2
R

• The forced set state of variable SIGNAL2 is retained regardless of the state of variable SIGNAL1.
• If the state of variable SIGNAL2 just before being forced set is ON, the forced RESET coil retains the ON state (see ex.1).
• If the state of variable SIGNAL2 just before being forced set is OFF, the forced RESET coil retains the OFF state (see ex.2).

SIGNAL1

SIGNAL2
ex.1 ex.2
Set forced Reset Set forced Reset
forced forced

Error information:
• When there is a boundary error due to index modification, the value of variable (BOOL) is unchanged and data boundary
over occurs.
6F8C1226
2. Contacts & Coils 2-19

Contacts & Coils Forced Positive Transition-sensing Coil

Variable (BOOL)
Diagram P
Input

EN input Edge execution Index modification


Modifier
— — √

Function:
• This is a positive transition-sensing coil that retains the state of a variable (BOOL) when forced, regardless of the input state.
• The operation as forced positive transition-sensing coil is not guaranteed when the same variable is used as coil in more
than one place.
Input Action Output
OFF Variable(BOOL)=retains previous state —
ON Variable(BOOL)=retains previous state —

Program example:
SIGNAL1 SIGNAL2
P

• The forced set state of variable SIGNAL2 is retained regardless of the state of variable SIGNAL1.
• If the state of variable SIGNAL2 just before being forced set is OFF, the forced positive transition-sensing coil retains the
OFF state (see ex.1).
• If the state of variable SIGNAL2 just before being forced set is ON, the forced positive transition-sensing coil retains the ON
state (see ex.2).

SIGNAL1

t t
SIGNAL2
ex.1 ex.2
Set forced Reset Set forced Reset t:1 Scan time
forced forced

Error information:
• When there is a boundary error due to index modification, the value of variable (BOOL) is unchanged and data boundary
over occurs. However, the input state for pulse operation is saved.
6F8C1226
2. Contacts & Coils 2-20

Contacts & Coils Forced Negative Transition-sensing Coil

Variable (BOOL)
Diagram N
Input

EN input Edge execution Index modification


Modifier
— — √

Function:
• This is a 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
OFF Variable(BOOL)=retains previous state —
ON Variable(BOOL)=retains previous state —

Program example:
SIGNAL1 SIGNAL2
N

• The forced set state of variable SIGNAL2 is retained regardless of the state of variable SIGNAL1.
• If the state of variable SIGNAL2 just before being forced set is ON, the forced negative transition-sensing coil retains the ON
state (see ex.1).
• If the state of variable SIGNAL2 just before being forced set is OFF, the forced negative transition-sensing coil retains the
OFF state (see ex.2).

SIGNAL1

t t t
SIGNAL2
ex.1 ex.2
Set forced Reset Set forced Reset
forced forced
t :1Scan time

Error information:
• When there is a boundary error due to index modification, the value of variable (BOOL) is unchanged and data boundary
over occurs. However, the input state for pulse operation is saved.
6F8C1226
3. Execution Control 3-1

3 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
6F8C1226
3. Execution Control 3-2

Execution Control Jump Control Set/Reset

Condition input JCS

Diagram Circuit P

JCR

EN input Edge execution Index modification


Modifier
— — —

Function:
• When input to JCS is ON, instructions between JCS and JCR are skipped and instructions are executed from JCR.
• When input to JCS is OFF, instructions between JCS and JCR are executed.
• JCS and JCR must be used as pair.
• JCS must be described before JCR.
• The JCS-JCR combination may be nested.
Input Condition Output
OFF Jump not performed (Between JCS and JCR are executed.) —
ON Jump performed —

Program example:
SIGNAL1

JCS

Circuit A

JCR
Circuit B

• When SIGNAL1 is OFF, Circuit A and Circuit B instructions are executed.


• When SIGNAL1 is ON, Circuit A is not executed and instructions are executed from Circuit B.
6F8C1226
3. Execution Control 3-3

Execution Control Jump/Label

Condition input Label

Diagram Circuit P
Label
LABEL:

EN input Edge execution Index modification


Modifier
— — —

Function:
• When input to jump instruction is ON, instructions between Jump and Label instructions are skipped and instructions are
executed from Label instruction.
• When input to jump instruction is OFF, instructions between Jump and Label instructions are executed.
• Jump and Label must be used as pair.
• Jump-Label instructions may be nested.
Input Condition Output
OFF Jump not performed (Between Jump and Label are executed.) —
ON Jump performed —

Program example:
SIGNAL1
JMP_A

Circuit A
JMP_A
LABEL :
Circuit B

• When SIGNAL1 is OFF, Circuit A and Circuit B instructions are executed.


• When SIGNAL1 is ON, Circuit A is not executed and instructions are executed from Circuit B.
6F8C1226
3. Execution Control 3-4

Conditional Execution Instruction/


Execution Control
End of Conditional Execution Instruction

Condition input

Diagram
Circuit P

EN input Edge execution Index modification


Modifier
— — —

Function:
• When input to Conditional Execution Instruction is 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 input to Conditional Execution Instruction is 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.
• Conditional Execution Instruction and End of Conditional Execution Instruction may be nested.
Input Condition Output
OFF Jump performed —
Jump not performed (Between and are
ON —
executed.)

Program example:
SIGNAL1

Circuit A

Circuit B

• When variable SIGNAL1 is ON, Circuit A and Circuit B instructions are executed.
• When SIGNAL1 is OFF, Circuit A is not executed and instructions are executed from Circuit B.
6F8C1226
3. Execution Control 3-5

Execution Control Master Control Set/Reset

Condition input MCS

Diagram Circuit P

MCR

EN input Edge execution Index modification


Modifier
— — —

Function:
• When input to MCS is OFF, the power rail input between MCS and MCR is reset to OFF.
• When input to MCS is ON, normal operation is performed.
• MCS and MCR must be used as pair.
• MCS must come before MCR.
• MCS-MCR combination cannot be nested.
Input Condition Output
OFF Power rail input OFF —
ON Normal operation —

Program example:
SIGNAL1
MCS
1234 MOVE_INT SAMPLE1 Circuit A1
LD ST

SIGNAL2 SIGNAL3 Circuit A2


MOVE_INT
EN ENO
5678 SAMPLE2
LD SET
MCR

Circuit B

• When variable SIGNAL1 is OFF:


Circuit A1, Circuit B: Normal operation.
Circuit A2: Operates as SIGNAL2 input=OFF, with SIGNAL3=OFF and SAMPLE2=Previous value.
• When variable SIGNAL1 is ON, Circuit A1,Circuit A2, and Circuit B operate normally.
6F8C1226
4. Counters 4-1

4 Counters

No. Instruction Remarks


1 Up Counter CTU
2 Down Counter CTD
3 Up Down Counter CTUD
6F8C1226
4. Counters 4-2

Counters Up Counter

Instance name
CTU
Count up command CU Q Count up status
Diagram
Reset command R CV Current value
Preset value PV

EN input Edge execution Index modification


Modifier
— — —

Arguments:
Arg. Operand Type Const. Description
CU BOOL √ Count up command
Input R BOOL √ Reset command
PV INT √ Preset value
Outpu Q BOOL — Count up status
t CV INT — Current value

Instance structure:
Name Type Description
Q BOOL Count up status
CV INT Current value

Function:
• When the Reset command R is 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=ON.
• When the Reset command R is 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 ON.
Input Output
Action
CU R Q CV
* ON Not executed When CV<PV: 0
OFFÆ ON CV=CV+1 until PV is OFF
reached When CV=PV: Current CV
OFF
Otherwise — ON
6F8C1226
4. Counters 4-3

Program example:
Up_Ctr SIGNAL1
SIGNAL1 CTU SIGNAL3 SIGNAL2
CU Q
SAMPLE1
SIGNAL2
R CV SAMPLE2
ST SAMPLE2
SAMPLE1 PV
LD SIGNAL3

• While variable SIGNAL2 is ON, variable SAMPLE2 becomes 0 because current value CV is initialized.
• When variable SIGNAL2 is OFF, count up is performed when variable SIGNAL1 changes from OFF to ON.
• When the preset value of variable SAMPLE1 is equal to the current value, variable SIGNAL3 becomes ON because count
up status Q becomes ON.

[Supplement]
• Positive transition-sensing 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.
6F8C1226
4. Counters 4-4

Counters Down Counter

Instance name
CTD
Count down command CD Q Count down status
Diagram
Load command LD CV Current value
Preset value PV

EN input Edge execution Index modification


Modifier
— — —

Arguments:
Arg. Operand Type Const. Description
CD BOOL √ Count down command
Input LD BOOL √ Load command
PV INT √ Preset value
Outpu Q BOOL — Count down status
t CV INT — Current value

Instance structure:
Name Type Description
Q BOOL Count down status
CV INT Current value

Function:
• When the Load command LD is ON, the current value CV is initialized with preset value PV. However, while LD=ON,
count down is not performed at the rising edge of the Count Down command.
• When the Load command LD is 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 ON.
Input Output
Action
CD LD Q CV
* ON Not executed When CV>0: PV
OFFÆON CV=CV-1 until 0 is reached OFF
Otherwise OFF — When CV=0: Current CV
ON
6F8C1226
4. Counters 4-5

Program example:
Dn_Ctr SIGNAL1
SIGNAL1 CTD SIGNAL3 SIGNAL2
CD Q
SAMPLE1
SIGNAL2
LD CV SAMPLE2
ST SAMPLE2
SAMPLE1 PV
LD SIGNAL3

• While variable SIGNAL2 is ON, variable SAMPLE2 becomes preset value PV because current value CV is initialized.
• When variable SIGNAL2 is OFF, count down is performed when variable SIGNAL1 changes from OFF to ON. The current
value is stored in SAMPLE2.
• When the variable SAMPLE2 which is the current value becomes 0, variable SIGNAL3 becomes ON because the count
down status Q becomes ON.

[Supplement]
• Positive transition-sensing 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.
6F8C1226
4. Counters 4-6

Counters Up Down Counter

Instance name
CTUD
Count up command CU QU Count up status

Count down command CD QD Count down status


Diagram
Reset command R CV Current value

Load command LD

Preset value PV

EN input Edge execution Index modification


Modifier
— — —

Arguments:
Arg. Operand Type Const. Description
CU BOOL √ Count up command
CD BOOL √ Count down command
Input R BOOL √ Reset command
LD BOOL √ Load command
PV INT √ Preset value
QU BOOL — Count up status
Outpu
QD BOOL — Count down status
t
CV INT — Current value

Instance structure:
Name Type Description
QU BOOL Count up status
QD BOOL Count down status
CV INT Current value

Function:
• When the Reset command R is ON, current value CV is initialized to 0.
• When the Load command LD is ON and the Reset command R is OFF, the current value CV is initialized with preset value
PV.
• While R=ON or LD=ON, count at the rising edge of the count up command and count down command are not performed.
• When the Reset command R and Load command LD are OFF, count up is performed at the rising edge of the count up
input.
• When the Reset command R and Load command LD are 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 ON.
• When the current value CV reaches 0, count down status QD is set to ON.
• When both the count up input CU and count down input CD are ON, count operation is not performed.
Input Action Output
CU CD R LD QU QD CV
* * ON * Not executed 0
OFF ON When CV<PV: When CV>0: PV
ON ON — OFF OFF
OFFÆ OFF CV=CV+1 until Current
ON OFF OFF PV is reached When CV=PV: When CV=0: CV
OFF OFFÆ CV=CV-1 until ON ON
ON 0 is reached
6F8C1226
4. Counters 4-7

Program example:
Ud_Ctr SIGNAL1
SIGNAL1 CTUD SIGNAL5 SIGNAL2
CU QU
SIGNAL2 SIGNAL6 SIGNAL3
CD QD
SIGNAL3 SIGNAL4
R CV SAMPLE2 SAMPLE1
ST
SIGNAL4
LD SAMPLE2

SIGNAL5
SAMPLE1 PV
LD SIGNAL6

• While variable SIGNAL3 is ON, variable SAMPLE2 becomes 0 because current value CV is initialized.
• While variable SIGNAL3 is OFF and variable SIGNAL4 is ON, variable SAMPLE2 becomes preset value PV because
current value CV is initialized.
• Count up is performed when variable SIGNAL1 changes from OFF to ON and count down is performed when variable
SIGNAL2 changes from OFF to ON. The current value is stored in SAMPLE2. However, count is not performed when
variables SIGNAL1 and SIGNAL2 are both ON.
• When variable SAMPLE2 which is the current value reaches the preset value PV, variable SIGNAL5 becomes ON.
• When variable SAMPLE2 which is the current value reaches 0, variable SIGNAL6 becomes ON.

[Supplement]
• 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.
6F8C1226
5. Timers 5-1

5 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
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
11 Pulse Timer (0.1ms) TP_100us
12 Pulse Timer (1ms) TP
13 Pulse Timer (10ms) TP_10ms
14 Pulse Timer (100ms) TP_100ms
12 Single Shot (100ms) SS_P PCS
13 Single Shot (0.1 minute) SSM_P PCS
14 Real Time Calendar RTC V dedicated instruction
15 Real Time Clock RTC_N nv dedicated instruction
TOSDIC-compatible
16 On/Off-Delay Timer (REAL) DEL_L
instruction
6F8C1226
5. Timers 5-2

● Important

・ For the Integrated Controller V Series controller, 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.

Timer setting "PT change support in time up state"


value Not supported Supported
Restarts clock until ET≦PT; Output (Q) Holds both Output (Q) and Duration
PT>ET changes depending on the relation (ET).
between PT and ET. New setting value (PT) becomes
effective upon restart after the timer
PT<ET Limits ET to PT. stops.

*1: Timer stop state

Timer instruction Timer activation command IN


TON*** FALSE(OFF)
TOF*** TRUE(ON)
TP*** FALSE(OFF)
SS*** FALSE(OFF)

"PT change support in time up state" version in the [Integrated Controller V Series]

Version
Controller Not
Supported
supported
S2PU22/32/72 ~V02.03 V02.04~
S2 S2PU22A/32A/72A/72D N/A V02.50~, V03.70~
S2PU82 N/A V02.00~, V03.00~
S3PU** ~V02.05 V02.06~, V02.10~
S3
S3PU**A N/A V02.50~, V03.70~
L1 L1PU1*H,LC5** ~V02.49 V02.50~
L2PU1* ~V03.00 V03.10~
L2
L2PU22 ~V03.0D V03.10~
L3PU11 ~V03.00 V03.10~
L3
L3PU21 ~V03.0K V03.10~
6F8C1226
5. Timers 5-3

On-Delay Timer (0.1ms/1ms/10ms/100ms/0.1min)

On-Delay Timer
Timers *1
(0.1ms/1ms/10ms/100ms/0.1min)
LD/FBD language Instance name
notation
TON
Timer activation command IN Q Time up status

Preset time PT ET Duration

Instance name
TON_□□
Timer activation command IN Q Time up status

Preset time PT ET Duration

Instance name (*1)PCS-compatible instruction

TONM_P
Timer activation command IN Q Time up status

Preset time PT ET Duration

Modifier EN input Edge execution Index modification


- - -
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 √ Timer activation command
Input
PT TIME √ 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 √ Timer activation command
Input
PT DINT √ Preset time
Q BOOL — Time up status
Output
ET DINT — Duration
6F8C1226
5. Timers 5-4

Instance structure:
• TON (1ms unit)

Name Type Description Remarks


Q BOOL Time up status
Can be accessed from the user program.
ET TIME Duration

• TON_□□/TONM_P[□□ indicates 100us(0. 1ms unit), 10ms(10ms unit), or 100ms(100ms unit).]

Name Type Description Remarks


Q BOOL Time up status
Can be accessed from the user program.
ET DINT Duration

Function:
• When timer activation command IN is ON, time up status Q is set to ON after the preset time elapses.
• Duration is added.
• When timer activation command IN is OFF, duration is cleared to zero.
• The setting range of preset time PT is as follows.

TON_100us (0.1ms timer) : 0 to 2147483647∗0.1ms [59h39m8s364.7ms


(2.48551348day)]
TON (1ms timer) : 0 to 2147483647ms [596h31m23s647ms
(24.8551348day)]
TON_10ms (10ms timer) : 0 to 2147483647∗10ms [5965h13m56s470ms
(248.551348day)]
TON_100ms (100ms timer) : 0 to 2147483647∗100ms [59652h19m24s700ms
(2485.51348day)]
TONM_P (0.1min timer) : 0 to 2147483647∗0.1 minutes [3579139h24m42s
(149130.8088day)]
• The data type of PT/ET is TIME for TON, and DINT for TON_100us/TON_10ms/TON_100ms/TONM_P.

Input Output
Action
IN Q ET
FALSE(OFF) Not executed FALSE(OFF) 0
Duration < Preset time FALSE(OFF)
TRUE(ON) Executed Current ET
Duration ≧ Preset time TRUE(ON)
6F8C1226
5. Timers 5-5

Program example:
[LD/FBD language notation]

Ondelay_1 SIGNAL1
SIGNAL1 TON SIGNAL2 SAMPLE1
IN Q
SAMPLE1 PT ET SAMPLE2 SAMPLE2
LD ST
SIGNAL2

[ST language notation]


Ondelay_1(SIGNAL1, SAMPLE1);
SIGNAL2 := Ondelay_1.Q;
SAMPLE2 := Ondelay_1.ET;

• After variable SIGNAL1 becomes ON, variable SIGNAL2, which is time up status, is set to ON after the preset time specified
with variable SAMPLE1 elapses. Duration is stored to variable SAMPLE2.
• The content of duration after duration reaches the preset time specified with variable SAMPLE1 is held as long as variable
SIGNAL1 is ON.
• When variable SIGNAL1 is OFF, duration is cleared, variable SAMPLE2 becomes zero, and variable SIGNAL2, which is
time up status, is set to OFF.

Error information:
• If preset time PT is less than 0, On-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.
6F8C1226
5. Timers 5-6

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 Instance name
notation
TOF
Timer activation command IN Q Time up status

Preset time PT ET Duration

Instance name
TOF_□□
Timer activation command IN Q Time up status

Preset time PT ET Duration

Instance name (*1)CS-compatible instruction

TOFM_P
Timer activation command IN Q Time up status

Preset time PT ET Duration

Modifier EN input Edge execution Index modification


- - -
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 √ Timer activation command
Input
PT TIME √ 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 √ Timer activation command
Input
PT DINT √ Preset time
Q BOOL — Time up status
Output
ET DINT — Duration
6F8C1226
5. Timers 5-7

Instance structure:
• TOF (1ms unit)

Name Type Description Remarks


Q BOOL Time up status
Can be accessed from the user program.
ET TIME Duration

• TOF_□□/TOFM_P[□□ indicates 100us(0.1ms unit), 10ms(10ms unit), or 100ms (100ms unit).]

Name Type Description Remarks


Q BOOL Time up status
Can be accessed from the user program.
ET DINT Duration

Function:
• After timer activation command IN becomes OFF, time up status Q is set to OFF after the preset time elapses.
• Duration is added.
• The setting range of preset time PT is as follows.

TOF_100us (0.1ms timer) : 0~2147483647∗0.1ms [59h39m8s364.7ms


(2.48551348day)]
TOF (1ms timer) : 0~2147483647ms [596h31m23s647ms
(24.8551348day)]
TOF_10ms (10ms timer) : 0~2147483647∗10ms [5965h13m56s470ms
(248.551348day)]
TOF_100ms (100ms timer) : 0~2147483647∗100ms [59652h19m24s700ms
(2485.51348day)]
TOFM_P (0.1min timer) : 0~2147483647∗0.1 minutes [3579139h24m42s
(149130.8088day)]
• The data type of PT/ET is TIME for TOF, and DINT for TOF_100us/TOF_10ms/TOF_100ms/TOFM_P.

Input Output
Action
IN Q ET
Duration < Preset time TRUE(ON)
FALSE(OFF) Executed Current ET
Duration ≧ Preset time FALSE(OFF)
TRUE(ON) Not executed TRUE(ON) 0
6F8C1226
5. Timers 5-8

Program example:
[LD/FBD language notation]

Offdelay_1 SIGNAL1
SIGNAL1 TOF SIGNAL2 SAMPLE1
IN Q
SAMPLE1 PT ET SAMPLE2 SAMPLE2
LD ST
SIGNAL2

[ST language notation]


Offdelay_1(SIGNAL1, SAMPLE1);
SIGNAL2 := Offdelay_1.Q;
SAMPLE2 := Offdelay_1.ET;

• After variable SIGNAL1 becomes OFF, variable SIGNAL2, which is time up status, is set to OFF after the preset time
specified with variable SAMPLE1 elapses. Duration is stored to variable SAMPLE2.
• The content of duration after duration reaches the preset time specified with variable SAMPLE1 is held as long as variable
SIGNAL1 is OFF.
• When variable SIGNAL1 is ON, duration is cleared, variable SAMPLE2 becomes zero, and variable SIGNAL2, which is time
up status, is set to ON.

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 TOF instruction of 1ms unit is used.
6F8C1226
5. Timers 5-9

Pulse Timer (0.1ms/1ms/10ms/100ms)

Timers Pulse Timer (0.1ms/1ms/10ms/100ms)


LD/FBD language Instance name
notation
TP
Timer activation command IN Q Time up status

Preset time PT ET Duration

Instance name
TP_□□
Timer activation command IN Q Time up status

Preset time PT ET Duration

Modifier EN input Edge execution Index modification


- - -
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 √ Timer activation command
Input
PT DINT √ Preset time
Q BOOL — Time up status
Output
ET DINT — Duration
6F8C1226
5. Timers 5-10

Instance structure:
• TP (1ms unit)

Name Type Description Remarks


Q BOOL Time up status
Can be accessed from the user program.
ET TIME Duration

• TP_□□[□□ indicates 100us(0.1ms unit), 10ms(10ms unit), or 100ms(100ms unit).]

Name Type Description Remarks


Q BOOL Time up status
Can be accessed from the user program.
ET DINT Duration

Function:
• After timer activation command IN becomes ON, time up status Q is set to ON until the preset time elapses.
• Duration is added.
• When timer activation command becomes OFF after the preset time elapses, duration is cleared.
• The setting range of preset time PT is as follows.

TP_100us (0.1ms timer) : 0 to 2147483647∗0.1ms [59h39m8s364.7ms


(2.48551348day)]
TP (1ms timer) : 0 to 2147483647ms [596h31m23s647ms
(24.8551348day)]
TP_10ms (10ms timer) : 0 to 2147483647∗10ms [5965h13m56s470ms
(248.551348day)]
TP_100ms (100ms timer) : 0 to 2147483647∗100ms [59652h19m24s700ms
(2485.51348day)]
• The data type of PT/ET is TIME for TP, and DINT for TP_100us/TP_10ms/TP_100ms.

Input Output
Action
IN Q ET
FALSE(OFF) Not executed FALSE(OFF) 0
Duration < Preset time TRUE(ON)
TRUE(ON) Executed Current ET
Duration ≧ Preset time FALSE(OFF)
6F8C1226
5. Timers 5-11

Program example:
[LD/FBD language notation]

Plstimer_1 SIGNAL1
SIGNAL1 TP SIGNAL2 SAMPLE1
IN Q
SAMPLE1 PT ET SAMPLE2 SAMPLE2
LD ST
SIGNAL2

[ST language notation]


Plstimer_1(SIGNAL1, SAMPLE1);
SIGNAL2 := Plstimer_1.Q;
SAMPLE2 := Plstimer_1.ET;

• After variable SIGNAL1 becomes ON, variable SIGNAL2 is set to ON until the preset time specified with variable SAMPLE1
elapses. After duration reaches the preset time, variable.
• SIGNAL2 becomes OFF. Duration is stored to variable SAMPLE2.
• Duration is still updated even if variable SIGNAL1 becomes OFF before duration reaches the preset time specified with
variable SAMPLE1.
• The content of duration after duration reaches the preset time specified with variable SAMPLE1 is held as long as variable
SIGNAL1 is ON. When variable SIGNAL1 becomes OFF, duration is cleared to zero, and "0" is stored to variable 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.
6F8C1226
5. Timers 5-12

Timers Single Shot (100ms/0.1 minute) PCS

Instance name
SS_P
Timer activation command IN Q Time up status

Preset time PT ET Duration


Diagram
Instance name
SSM_P
Timer activation command IN Q Time up status

Preset time PT ET Duration

EN input Edge execution Index modification


Modifier
— — —

Arguments:
Arg. Operand Type Const. Description
IN BOOL √ Timer activation command
Input
PT DINT √ Preset time
Q BOOL — Time up status
Output
ET DINT — Duration

Instance structure:
Name Type Description
Q BOOL Time up status
ET DINT Duration

Function:
• After Timer activation command IN becomes ON, time up status Q is set to ON until preset time elapses.
• Duration ET is added.
• If Timer activation command becomes OFF before the timer expires, the time up status also becomes OFF.
• After preset time has elapsed, duration ET is cleared when Timer activation command becomes OFF.
• The range of preset time PT is as follows:
SS_P (100ms timer) : 0 to 2147483647 ×100ms [59652h19m24s700ms (2485.51348day)]
SSM_P (0.1 minute timer) : 0 to 2147483647 × 0.1 minutes [3579139h24m42s (149130.8088day)]

Input Output
Action
IN Q ET
OFF Not executed OFF 0
Duration < Preset time ON Current
ON Executed
Duration ≧ Preset time OFF ET
6F8C1226
5. Timers 5-13

Program example:
SS_1 SIGNAL1
SIGNAL1 SS_P SIGNAL2 SAMPLE1
IN Q
SAMPLE1 PT ET SAMPLE2 SAMPLE2
LD ST
SIGNAL2

• After variable SIGNAL1 becomes ON, variable SIGNAL2 is ON until preset time specified with variable SAMPLE1 elapses.
After the duration reaches a preset time, variable SIGNAL2 becomes OFF. Duration is stored in variable SAMPLE2.
• When variable SIGNAL1 becomes OFF before duration ET reaches the preset time specified with variable SAMPLE1,
variable SAMPLE2 which is the duration becomes 0. Variable SIGNAL2 which is the time up status also becomes OFF.
• After duration ET has reached the preset time specified with SAMPLE1, its content is retained while variable SIGNAL1 is ON.
When variable SIGNAL1 becomes OFF, duration is cleared to 0 and 0 is stored in variable 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 ON for just 1 scan.
6F8C1226
5. Timers 5-14

Timers Real Time Calendar

Instance name
Date and time of day update RTC
Diagram command IN Q Output

Preset date and time of day PDT CDT Current date and time
of day

EN input Edge execution Index modification


Modifier
— — —

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
Q BOOL Output

Function:
• When the Date and time of day update command IN changes from OFF to 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 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.
Input Output
Action
IN Q CDT
Not
OFF Not executed OFF
updated
When previous input=OFF:
Update calendar
(CDT=PDT) Current
ON Executed ON
When previous input=ON: CDT
CDT=Current date and
time of day

Program example:
RTC_1
SIGNAL1 RTC SIGNAL2
IN Q
SAMPLE1 SAMPLE2
LD PDT CDT ST
• When variable SIGNAL1 changes from OFF to ON, the calendar is updated with the preset date and time of day specified
with variable SAMPLE1.
• While SIGNAL1 is ON, the current time is output to variable SAMPLE2.
• Variable SIGNAL2 becomes ON when variable SIGNAL1 is ON and SIGNAL2 becomes OFF when variable SIGNAL1 is
OFF.
Error information:
• The calendar is not updated when the content of preset date and time of day CDT is abnormal.
6F8C1226
5. Timers 5-15

Real Time Clock

nv dedicated
Timers Real Time Clock
instruction
LD/FBD language Instance name
notation
RTC_N
Date and time of day
update command IN Q Completion output

Preset date/time PDT CDT Current date/time

Modifier EN input Edge execution Index modification


- - -
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/time
Q BOOL — Completion output
Output
CDT DT — Current date/time

Instance structure:

Name Type Description Remarks


Q BOOL Completion output Can be accessed from the user program.

Function:
• When the date and time of day command IN changes from OFF to 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 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 ON.

Input Output
Action
IN Q CDT
FALSE(OFF) Not executed FALSE(OFF)
Previous input =FALSE(OFF): Not updated
FALSE(OFF)
Calendar is updated
TRUE(ON) Executed
Previous input =TRUE(ON):
TRUE(ON) Current CDT
Current date/time ÆCDT
6F8C1226
5. Timers 5-16

Program example:
[LD/FBD language notation]
RTC_1
SIGNAL1 RTC_N SIGNAL2
IN Q
SAMPLE1 PDT CDT SAMPLE2
LD ST

[ST language notation]


RTC_1( SIGNAL1, SAMPLE1, SAMPLE2);
SIGNAL2 :=@RTC_1.Q;

• When variable SIGNAL1 changes from OFF to ON, the calendar is updated with the preset date and time of day specified
with variable SAMPLE1. After the calendar is updated, completion output SIGNAL2 becomes ON.
• Current day/time is output to variable SAMPLE2, after variable SIGNAL1 becomes ON and the calendar is updated.

Error information:
• The calendar is not updated when the content of preset date and time of day CDT is abnormal. Completion output outputs
the state of Date and time of day update command IN.
6F8C1226
5. Timers 5-17

On/Off-Delay Timer

TOSDIC-compatible
Timers On/Off-Delay Timer
instruction
LD/FBD language Instance name
notation
DEL_L
Input flag U1 Y Result output

On-delay time H1 ON On-delay elapsed time

Off-delay time H2 OFF Off-delay elapsed time

Modifier EN input Edge execution Index modification


- - -
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
Input H1 REAL √ On-delay time (≧0) [sec]
H2 REAL √ Off-delay time (≧0) [sec]
Y BOOL - Result output
Output ON REAL - On-delay elapsed time [sec]
OFF REAL - Off-delay elapsed time [sec]

Instance structure:

Name Type Description Remarks


Y BOOL Result output
ON REAL On-delay elapsed time [sec] Can be accessed from the user program.
OFF REAL Off-delay elapsed time [sec]

Function:
• After input flag U1 becomes ON, result output is set to ON after on-delay time H1. After input flag U1 becomes OFF, result
output is set to OFF after off-delay time H2.
• After input flag U1 becomes ON, result output Y is set to ON after on-delay time H1.
• After input flag U1 becomes OFF, result output Y is set to OFF after off-delay time H2.
6F8C1226
5. Timers 5-18

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

Normal Input becomes OFF Input becomes ON Input is changed Off-delay is stopped
Operation during on-delay during off-delay during on/off-delay during on-delay
ti
Input U1

Output Y
-> Time

On/Off-delay time On-delay is stopped On-delay is started again


is measured at the Output is inversed Off-delay is stopped
same time
: On-delay time
: Off-delay time

Program example:
[LD/FBD language notation]

DEL_1
S1 DEL_L S2
U1 Y

DP11LD H1 ON ON_TIME ST

DP12LD H2 OFF 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/off-delay time =0, Input U1=Output Y.
• If on/off-delay time is nonnumeric, nonnumeric abnormal is set to ON, and the instruction itself is not processed.
6F8C1226
6. Filp-Flops 6-1

6 Filp-Flops

No. Instruction Remarks


1 Set Type Flip-Flop SR
2 Reset Type Flip-Flop RS
3 Semaphore SEMA
6F8C1226
6. Filp-Flops 6-2

Filp-Flops Set Type Flip-Flop

Instance name
SR
Diagram Set input S1 Q1 Output

Reset input R

EN input Edge execution Index modification


Modifier
— — —

Arguments:
Arg. Operand Type Const. Description
S1 BOOL √ Set input
Input
R BOOL √ Reset input
Output Q1 BOOL — Output

Instance structure:
Name Type Description
Q1 BOOL Output

Function:
• When set input S1 is ON, output Q1 is set to ON regardless of the input state of reset input R.
• When set input S1 is OFF and reset input R is ON, output Q1 is reset to OFF.
• Output Q1 is unchanged when set input S1 and reset input R are both OFF.
Input Output
Action
S1 R Q1
Retain
OFF OFF Not executed
previous value
OFF ON OFF
Executed
ON * ON

Program example:
FF_1 SIGNAL1
SIGNAL1 SR SIGNAL3 SIGNAL2
S1 Q1
SIGNAL2 SIGNAL3
R

• When variable SIGNAL1 is ON, variable SIGNAL3 becomes ON.


• When variable SIGNAL1 is OFF and variable SIGNAL2 is ON, variable SIGNAL3 becomes OFF.
• When variable SIGNAL1 and SIGNAL2 are both OFF, variable SIGNAL3 retains the previous value.
6F8C1226
6. Filp-Flops 6-3

Filp-Flops Reset Type Flip-Flop

Instance name
RS
Diagram Set input S Q1 Output

Reset input R1

EN input Edge execution Index modification


Modifier
— — —

Arguments:
Arg. Operand Type Const. Description
S BOOL √ Set input
Input
R1 BOOL √ Reset input
Output Q1 BOOL — Output

Instance structure:
Name Type Description
Q1 BOOL Output

Function:
• When reset input R1 is ON, output Q1 is reset to OFF regardless of the input state of set input S.
• When reset input R1 is OFF and set input S is ON, output Q1 is set to ON.
• Output Q1 is unchanged when set input S and reset input R1 are both OFF.
Input Output
Action
S R1 Q1
Retain previous
OFF OFF Not executed
value
* ON OFF
Executed
ON OFF ON

Program example:
FF_1 SIGNAL1
SIGNAL1 RS SIGNAL3 SIGNAL2
S Q1
SIGNAL2 SIGNAL3
R1

• When variable SIGNAL2 is ON, variable SIGNAL3 is reset to OFF.


• When variable SIGNAL2 is OFF and variable SIGNAL1 is ON, variable SIGNAL3 becomes ON.
• When variable SIGNAL1 and SIGNAL2 are both OFF, variable SIGNAL3 retains the previous value.
6F8C1226
6. Filp-Flops 6-4

Filp-Flops Semaphore

Instance name
SEMA
Diagram Test and set command CLAIM BUSY Semaphore status output

Release command RELEASE

EN input Edge execution Index modification


Modifier
— — —

Arguments:
Arg. Operand Type Const. Description
CLAIM BOOL √ Test and set command
Input
RELEASE BOOL √ Release command
Output BUSY BOOL — Semaphore status output

Instance structure:
Name Type Description
BUSY BOOL Semaphore status output
X BOOL Internal variable

Function:
• Initially, resets internal variable X to 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 ON when test and set
command CLAIM is ON.
• When test and set command CLAIM is OFF and release command RELEASE is ON after internal variable X is output to
semaphore status output BUSY, semaphore state output BUSY and internal variable X are reset to OFF .
Input Output
Action
CLAIM RELEASE BUSY
OFF OFF BUSY=Internal variable Xn-1
BUSY=Internal variable Xn-1 Previous Xn-1
ON *
Internal variable Xn=ON
BUSY=OFF
OFF ON OFF
Internal variable Xn=OFF
6F8C1226
6. Filp-Flops 6-5

Program example:
SEMA_1
SIGNAL1 SEMA SIGNAL3
CLAIM BUSY
SIGNAL2
RELEASE

SEMA_1 Execution timing

SIGNAL1

SIGNAL2

SIGNAL3

• The state of internal variable X after executing previous SEMA_1 is output to variable SIGNAL3.
Except when variable SIGNAL1=OFF and variable SIGNAL2=ON
• When variable SIGNAL1 is ON, internal variable X is set to ON.
• When variable SIGNAL1 is OFF and variable SIGNAL2 is ON, internal variable X and variable SIGNAL3 becomes OFF.
6F8C1226
7. Moving 7-1

7 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
6F8C1226
7. Moving 7-2

Moving Normally Open Contact Gate

Variable (BOOL)
Diagram
Input 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
See below
Output — — Output

Variable (BOOL)
Input Output

Input Output
INT INT
DINT DINT
UINT UINT
REAL REAL
WORD WORD
DWORD DWORD
TIME TIME
TOD TOD
DATE DATE

Function:
(1)Combination of Normally Open Contact Gate instruction and ST instruction or function and function block input
• When variable (BOOL) is ON, input data is output as the result.
• When variable (BOOL) is OFF, output is set to 0.
Input Action Output
OFF 0
Executed
ON Input data

(2)Combination of Normally Open Contact Gate instruction and SET instruction


• When variable (BOOL) is ON, input data is output as the result.
• When variable (BOOL) is OFF, previous value is retained.
Input Action Output
OFF Retain previous value
Executed
ON Input data
6F8C1226
7. Moving 7-3

Program example:
(1)Normally Open Contact Gate instruction + ST instruction
SIGNAL1
SAMPLE1 SAMPLE2
LD ST

• When SIGNAL1 is ON, content of variable SAMPLE1 is moved to variable SAMPLE2.


• When SIGNAL1 is OFF, 0 is moved to variable SAMPLE2.

(2)Normally Open Contact Gate instruction + SET instruction


SIGNAL1
SAMPLE1 SAMPLE2
LD SET

• When SIGNAL1 is ON, content of variable SAMPLE1 is moved to variable SAMPLE2.


• When SIGNAL1 is OFF, variable 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 OFF and data boundary over occurs.
6F8C1226
7. Moving 7-4

Moving Normally Closed Contact Gate

Variable (BOOL)
Diagram
Input 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
See below
Output — — Output

Variable (BOOL)
Input Output

Input Output
INT INT
DINT DINT
UINT UINT
REAL REAL
WORD WORD
DWORD DWORD
TIME TIME
TOD TOD
DATE DATE

Function:
(1)Combination of Normally Closed Contact Gate instruction and ST instruction or function and function block input
• When variable (BOOL) is OFF, input data is output as result.
• When variable (BOOL) is ON, output is set to 0.
Input Action Output
OFF Input data
Executed
ON 0

(2)Combination of Normally Closed Contact Gate instruction and SET instruction


• When variable (BOOL) is OFF, input data is output as result.
• When variable (BOOL) is ON, previous value is retained.
Input Action Output
OFF Input data
Executed
ON Retain previous value
6F8C1226
7. Moving 7-5

Program example:
(1)Normally Closed Contact Gate instruction + ST instruction
SIGNAL1
SAMPLE1 SAMPLE2
LD ST

• When SIGNAL1 is OFF, content of variable SAMPLE1 is moved to variable SAMPLE2.


• When SIGNAL1 is ON, 0 is moved to variable SAMPLE2.

(2)Normally Closed Contact Gate instruction + SET instruction


SIGNAL1
SAMPLE1 SAMPLE2
LD SET

• When SIGNAL1 is OFF, content of variable SAMPLE1 is moved to variable SAMPLE2.


• When SIGNAL1 is ON, variable 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 OFF and data boundary over occurs.
6F8C1226
7. Moving 7-6

Moving Move Data

Diagram Input MOVE_xxx Output

EN input Edge execution Index modification


Modifier
√ √ —

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
See below
Output — — Output

Input MOVE_xxx Output

Input Symbol (_xxx) 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.

Program example:
SAMPLE1 MOVE_INT SAMPLE2
1234 1234
LD ST
• Content of variable SAMPLE1 1234 is moved to variable SAMPLE2.
6F8C1226
7. Moving 7-7

Moving Move Table Data

TMOV
Input table TBL Output table
Diagram
Transfer word number N

EN input Edge execution Index modification


Modifier
√ √ —

Arguments:
Arg. Operand Type Const. Description Remarks
TBL PTR — Input table
Input
N UINT √ Transfer word number 1 ≤ N ≤ 1024
Output — PTR — Output table

Function:
• N data words starting at input table are transferred as block to output table.
• 1 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.
• Direct I/O variable cannot be specified for input table or output table.
Table Table word Error
Action
specification number flag
1 ≤ N ≤ 1024 Executed —
Not direct I/O N=0 Not executed —
N > 1024 Executed with N=1024 as limit —
Direct I/O * Not executed ON

Input table Output table

Batch
transfer
N words N words

Program example:
ARRAY1 TMOV ARRAY2 ARRAY1 ARRAY2
LD TBL ST 1234 1234
8 2345 2345
N
LD 3456 3456
4567 4567
8 words
5678 5678
6789 6789
7890 7890
8901 8901

• The 8 words source data starting from variable ARRAY1 are transferred as block to destination starting at variable ARRAY2.
6F8C1226
7. Moving 7-8

Error information:
• If the number of transfer words exceed 1024W, 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 data boundary over occurs.
• Table transfer is not performed if direct I/O variables are specified for input table or output table. Also, the Error Flag is set
to ON.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
7. Moving 7-9

Moving Data Exchange

Instance name
XCHG_xxx
Diagram Input 1 IN1 OUT1 Output 1

Input 2 IN2 OUT2 Output 2

EN input Edge execution Index modification


Modifier
— — —

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 √ Input 1
Input
IN2 √ Input 2
See below
OUT1 — Output 1
Output
OUT2 — Output 2

XCHG_xxx
Input 1 IN1 OUT1 Output 1

Input 2 IN2 OUT2 Output 2

Input 1, Input 2 Symbol (_xxx) Output 1, Output 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
OUT1 See above Output 1
OUT2 See above Output 2

Function:
• Input data Input 1 is output to Output 2 and Input 2 is output to Output 1.
Input 1 Output 1
Input 2 Output 2
6F8C1226
7. Moving 7-10

Program example:
Xchg_1
XCHG_INT
SAMPLE1 SAMPLE1
1234 IN1 OUT1 5678
LD ST
SAMPLE2 SAMPLE2
5678 IN2 OUT2 1234
LD ST

• Contents of variable SAMPLE1 and variable SAMPLE2 are exchanged.


6F8C1226
7. Moving 7-11

Moving Initialize Table Data

TINZ_xxx
Initialization data IN Output table
Diagram
Count N

EN input Edge execution Index modification


Modifier
√ √ —

Arguments:
• The following data types are supported for input arguments and the instruction symbol depends on the data type:
Arg. Operand Type Const. Description Remarks
IN See below √ Initialization data
Input
N UINT √ Count 1 ≤ N ≤ 1024
Output — PTR — Output table

TINZ_xxx
Initialization data IN Output table

Count N

Initialization data Symbol (_xxx)


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

Function:
• An N word block starting at output table is initialized with initialization data IN.
• 1 to 1024 words may be transferred. If N=0, no table initialization is performed.
• Direct I/O variable cannot be specified for output table.
Table Table word Error flag
Action
specification number
1 ≤ N ≤ 1024 Executed —
Not direct I/O N=0 Not executed —
N > 1024 Executed with N=1024 as limit —
Direct I/O * Not executed ON

Output table

Initialization data IN N words


6F8C1226
7. Moving 7-12

Program example:
SAMPLE1 TINZ_INT ARRAY1 SAMPLE1 ARRAY1
LD IN ST 1234 1234
8 1234
N
LD 1234
1234
8 words
1234
1234
1234
1234

• 8 words block starting at variable ARRAY1 is initialized with content of variable SAMPLE1 1234.

Error information:
• If the number of transfer words exceed 1024W, operation is performed with 1024 as the limit.
• If the output table exceeds the specified range, table initialization is not performed and data boundary over occurs.
• Table transfer is not performed if direct I/O variable is specified for output table. Also, the Error Flag is set to ON.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
8. Comparison 8-1

8 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
6F8C1226
8. Comparison 8-2

Comparison Greater Than

Input 1 GT_xxx Output


Input 2
Diagram

Input n

EN input Edge execution Index modification


Modifier
√ √ —

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 1…n 2 ≤ n ≤ 15
Output — BOOL — Output

Input 1 GT_xxx Output


Input 2

Input n

Input 1…n Symbol (_xxx)


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

Function:
• Compares the value of input data and outputs the comparison result.
ON is output when the condition Input 1 > Input 2 >...> Input n is satisfied.
OFF is output when the condition Input 1 > Input 2 >...> Input n is not satisfied.
• Up to 15 input data are allowed.
• Input 1 to n must have the same data type.
Input Condition Output
Input data When Input 1 > Input 2 >...> Input n is satisfied ON
Input 1...Input n When Input 1 > Input 2 >...> Input n is not satisfied OFF
6F8C1226
8. Comparison 8-3

Program example:
SAMPLE1 GT_INT SIGNAL1
7777 1
LD ST
SAMPLE2
6666
LD
SAMPLE3
5555
LD
SAMPLE4
4444
LD

• Compares the data in variables SAMPLE1 to 4 and outputs ON to variable SIGNAL1 because the condition SAMPLE1 >
SAMPLE2 > SAMPLE3 > SAMPLE4 is satisfied.

Error information:
• If NAN data is entered as input when the input data type is REAL, OFF is output as the result.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
8. Comparison 8-4

Comparison Greater Than or Equal

Input 1 GE_xxx Output


Input 2
Diagram

Input n

EN input Edge execution Index modification


Modifier
√ √ —

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 1…n 2 ≤ n ≤ 15
Output — BOOL — Output

Input 1 GE_xxx Output


Input 2

Input n

Input 1…n Symbol (_xxx)


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

Function:
• Compares the value of input data and outputs the comparison result.
ON is output when the condition Input 1 ≥ Input 2 ≥...≥ Input n is satisfied.
OFF is output when the condition Input 1 ≥ Input 2 ≥...≥ Input n is not satisfied.
• Up to 15 input data are allowed.
• Input 1 to n must have the same data type.
Input Condition Output
Input data When Input 1 ≥ Input 2 ≥…≥ Input n is satisfied ON
Input 1...Input n When Input 1 ≥ Input 2 ≥…≥ Input n is not satisfied OFF
6F8C1226
8. Comparison 8-5

Program example:
SAMPLE1 GE_INT SIGNAL1
7777 1
LD ST
SAMPLE2
6666
LD
SAMPLE3
6666
LD
SAMPLE4
5555
LD

• Compares the data in variables SAMPLE1 to 4 and outputs ON to variable SIGNAL1 because the condition SAMPLE1 ≥
SAMPLE2 ≥ SAMPLE3 ≥ SAMPLE4 is satisfied.

Error information:
• If NAN data is entered as input when the input data type is REAL, OFF is output as the result.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
8. Comparison 8-6

Comparison Equal

Input 1 EQ_xxx Output


Input 2
Diagram

Input n

EN input Edge execution Index modification


Modifier
√ √ —

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 1…n 2 ≤ n ≤ 15
Output — BOOL — Output

Input 1 EQ_xxx Output


Input 2

Input n

Input 1…n Symbol (_xxx)


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

Function:
• Compares the value of input data and outputs the comparison result.
ON is output when the condition Input 1=Input 2=...=Input n is satisfied.
OFF is output when the condition Input 1=Input 2=...=Input n is not satisfied.
• Up to 15 input data are allowed.
• Input 1 to n must have the same data type.
Input Condition Output
Input data When Input 1=Input 2=…=Input n is satisfied ON
Input 1...Input n When Input 1=Input 2=…=Input n is not satisfied OFF
6F8C1226
8. Comparison 8-7

Program example:
SAMPLE1 EQ_INT SIGNAL1
1234 1
LD ST
SAMPLE2
1234
LD
SAMPLE3
1234
LD
SAMPLE4
1234
LD

• Compares the data in variables SAMPLE1 to 4 and outputs ON to variable SIGNAL1 because the condition
SAMPLE1=SAMPLE2=SAMPLE3=SAMPLE4 is satisfied.

Error information:
• If NAN data is entered as input when the input data type is REAL, OFF is output as the result.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
8. Comparison 8-8

Comparison Less Than or Equal

Input 1 LE_xxx Output


Input 2
Diagram

Input n

EN input Edge execution Index modification


Modifier
√ √ —

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 1…n 2 ≤ n ≤ 15
Output — BOOL — Output

Input 1 LE_xxx Output


Input 2

Input n

Input 1…n Symbol (_xxx)


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

Function:
• Compares the value of input data and outputs the comparison result.
ON is output when the condition Input 1 ≤ Input 2 ≤...≤ Input n is satisfied.
OFF is output when the condition Input 1 ≤ Input 2 ≤...≤ Input n is not satisfied.
• Up to 15 input data are allowed.
• Input 1 to n must have the same data type.
Input Condition Output
Input data When Input 1 ≤ Input 2 ≤…≤ Input n is satisfied ON
Input 1...Input n When Input 1 ≤ Input 2 ≤…≤ Input n is not satisfied OFF
6F8C1226
8. Comparison 8-9

Program example:
SAMPLE1 LE_INT SIGNAL1
1111 1
LD ST
SAMPLE2
2222
LD
SAMPLE3
2222
LD
SAMPLE4
3333
LD

• Compares the data in variables SAMPLE1 to 4 and outputs ON to variable SIGNAL1 because the condition SAMPLE1 ≤
SAMPLE2 ≤ SAMPLE3 ≤ SAMPLE4 is satisfied.

Error information:
• If NAN data is entered as input when the input data type is REAL, OFF is output as the result.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
8. Comparison 8-10

Comparison Less Than

Input 1 LT_xxx Output


Input 2
Diagram

Input n

EN input Edge execution Index modification


Modifier
√ √ —

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 1…n 2 ≤ n ≤ 15
Output — BOOL — Output

Input 1 LT_xxx Output


Input 2

Input n

Input 1…n Symbol (_xxx)


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

Function:
• Compares the value of input data and outputs the comparison result.
ON is output when the condition Input 1 < Input 2 <...< Input n is satisfied.
OFF is output when the condition Input 1 < Input 2 <...< Input n is not satisfied.
• Up to 15 input data are allowed.
• Input 1 to n must have the same data type.
Input Condition Output
Input data When Input 1 < Input 2 <…< Input n is satisfied ON
Input 1...Input n When Input 1 < Input 2 <…< Input n is not satisfied OFF
6F8C1226
8. Comparison 8-11

Program example:
SAMPLE1 LT_INT SIGNAL1
1111 1
LD ST
SAMPLE2
2222
LD
SAMPLE3
3333
LD
SAMPLE4
4444
LD

• Compares the data in variables SAMPLE1 to 4 and outputs ON to variable SIGNAL1 because the condition SAMPLE1 <
SAMPLE2 < SAMPLE3 < SAMPLE4 is satisfied.

Error information:
• If NAN data is entered as input when the input data type is REAL, OFF is output as the result.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
8. Comparison 8-12

Comparison Not Equal

Input 1 NE_xxx Output


Diagram
Input 2

EN input Edge execution Index modification


Modifier
√ √ —

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 1, 2 Input number=2
Output — BOOL — Output

Input 1 NE_xxx Output

Input 2

Input 1,2 Symbol (_xxx)


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

Function:
• Compares the value of input data and outputs the comparison result.
ON is output when the condition Input 1≠Input 2 is satisfied.
OFF is output when the condition Input 1≠Input 2 is not satisfied.
• Number of input data must be 2.
• Input 1 and Input 2 must have the same data type.
Input Condition Output
Input data When Input 1≠Input 2 is satisfied ON
Input 1, Input 2 When Input 1≠Input 2 is not satisfied OFF
6F8C1226
8. Comparison 8-13

Program example:
SAMPLE1 NE_INT SIGNAL1
1111 1
LD ST
SAMPLE2
2222
LD

• Compares the data in variables SAMPLE1 and SAMPLE2 and outputs ON to variable SIGNAL1 because the condition
SAMPLE1≠SAMPLE2 is satisfied.

Error information:
• If NAN data is entered as input when the input data type is REAL, OFF is output as the result.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
9. Selection 9-1

9 Selection

No. Instruction Remarks


1 Maximum MAX
2 Maximum of Table Data MAXL
3 Minimum MIN
4 Minimum of Table Data MINL
5 Average Value AVE
6 Average of Table Data AVEL
7 Limiter LIMIT
8 Selector SEL
9 Multiplex MUX
10 Multiplex of Table Data MPX
6F8C1226
9. Selection 9-2

Selection Maximum

Input 1 MAX_xxx Output


Input 2
Diagram

Input n

EN input Edge execution Index modification


Modifier
√ √ —

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 1…n 2 ≤ n ≤ 15
See below
Output — — Output

Input 1 MAX_xxx Output


Input 2

Input n

Input 1…n Symbol (_xxx) 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

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.
• Input 1 to n must have the same data type.
6F8C1226
9. Selection 9-3

Program example:

SAMPLE1 MAX_INT SAMPLE5


-1111 6666
LD ST
SAMPLE2
6666
LD
SAMPLE3
-5555
LD
SAMPLE4
4444
LD

• The maximum value of input data SAMPLE1 to SAMPLE4 is obtained and the maximum value 6666 is stored in variable
SAMPLE5.

Error information:
• When input data type is REAL, if NAN data is entered as input, the result is NAN.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
9. Selection 9-4

Selection Maximum of Table Data

MAXL_xxx
Input table TBL Output
Diagram
Number N

EN input Edge execution Index modification


Modifier
√ √ —

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 1 ≤ N ≤ 256
Output — See below — Output

MAXL_xxx
Input table TBL Output

Number N

Symbol (_xxx) 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

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.
• Direct I/O variable cannot be specified for input table.
Table specification Table word number Action Error flag
1 ≤ N ≤ 256 Executed —
Not direct I/O N=0 Not executed —
N > 256 Executed with N=256 as limit —
Direct I/O * Not executed ON
6F8C1226
9. Selection 9-5

Program example:

ARRAY1 MAXL_INT SAMPLE1 Pointer ARRAY1 SAMPLE1


TBL 100
LD ST 1 -98 100
6 2 100
N 3 65 Index register XL
LD 4 23 2
5 -51
6 100
7 -125
8 199

• The maximum value is obtained from 6 data in input table ARRAY1 and the maximum value 100 is stored in variable
SAMPLE1. Also, the table pointer 2 of the maximum value is output to index register XL.

Error information:
• If N exceeds 256, N is limited to 256.
• When input data type is REAL, if NAN data is entered as input, the result is NAN.
• When direct I/O variable is specified as input table, table data maximum is not obtained. Also, the Error Flag is set to ON.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
9. Selection 9-6

Selection Minimum

Input 1 MIN_xxx Output


Input 2
Diagram

Input n

EN input Edge execution Index modification


Modifier
√ √ —

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 1…n 2 ≤ n ≤ 15
See below
Output — — Output

Input 1 MIN_xxx Output


Input 2

Input n

Input 1…n Symbol (_xxx) 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

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.
• Input 1 to n must have the same data type.
6F8C1226
9. Selection 9-7

Program example:

SAMPLE1 MIN_INT SAMPLE5


-1111 -5555
LD ST
SAMPLE2
6666
LD
SAMPLE3
-5555
LD
SAMPLE4
4444
LD

• The minimum value of input data SAMPLE1 to SAMPLE4 is obtained and the minimum value -5555 is stored in variable
SAMPLE5.

Error information:
• When input data type is REAL, if NAN data is entered as input, the result is NAN.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
9. Selection 9-8

Selection Minimum of Table Data

MINL_xxx
Input table TBL Output
Diagram
Number N

EN input Edge execution Index modification


Modifier
√ √ —

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 1 ≤ N ≤ 256
Output — See below — Output

MINL_xxx
Input table TBL Output

Number N

Symbol (_xxx) 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

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.
• Direct I/O variables cannot be specified for input table.
Table specification Table word number Action Error flag
1 ≤ N ≤ 256 Executed —
Not direct I/O N=0 Not executed —
N > 256 Executed with N=256 as limit —
Direct I/O * Not executed ON
6F8C1226
9. Selection 9-9

Program example:

ARRAY1 MINL_INT SAMPLE1 Pointer ARRAY1 SAMPLE1


TBL -100
LD ST 1 98 -100
6 2 -100
N 3 65 Index register XL
LD 4 23 2
5 -51
6 -100
7 -125
8 199

• The minimum value is obtained from 6 data in input table ARRAY1 and the minimum value -100 is stored in variable
SAMPLE1. Also, the table pointer 2 of the minimum value is output to index register XL.

Error information:
• If N exceeds 256, N is limited to 256.
• When input data type is REAL, if NAN data is entered as input, the result is NAN.
• When direct I/O variable is specified as input table, table data minimum is not obtained. Also, the Error Flag is set to ON.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
9. Selection 9-10

Selection Average Value

Input 1 AVE_xxx Output

Input 2
Diagram

Input n

EN input Edge execution Index modification


Modifier
√ √ —

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 1…n 2 ≤ n ≤ 15
See below
Output — — Output

Input 1 AVE_xxx Output


Input 2

Input n

Input 1…n Symbol (_xxx) Output


INT AVE_INT INT
DINT AVE_DINT DINT
UINT AVE_UINT UINT
REAL AVE_REAL REAL
TIME AVE_TIME TIME

Function:
• The average of input data Input 1 to Input n is obtained and output as result.
• Up to 15 input data are allowed.
• Input 1 to n must have the same data type.
Output = (Input 1 + Input 2 + Input 3 + ... + Input n) / n
6F8C1226
9. Selection 9-11

Program example:

SAMPLE1 AVE_INT SAMPLE5


-1111 1111
LD ST
SAMPLE2
6666
LD
SAMPLE3
-5555
LD
SAMPLE4
4444
LD

• The average value of input data SAMPLE1 to SAMPLE4 is obtained and the average value 1111 is stored in variable
SAMPLE5.

Error information:
• When input data type is REAL, if NAN data is entered as input, the result is NAN.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
9. Selection 9-12

Selection Average of Table Data

AVEL_xxx
Input table TBL Output
Diagram
Number N

EN input Edge execution Index modification


Modifier
√ √ —

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 1 ≤ N ≤ 256
Output — See below — Output

AVEL_xxx
Input table TBL Output

Number N

Symbol (_xxx) Output


AVEL_INT INT
AVEL_DINT DINT
AVEL_UINT UINT
AVEL_REAL REAL
AVEL_TIME TIME

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 variables cannot be specified for input table.
Table specification Table word number Action Error flag
1 ≤ N ≤ 256 Executed —
Not direct I/O N=0 Not executed —
N > 256 Executed with N=256 as limit —
Direct I/O * Not executed ON
Output = (TBL[0] + TBL[1] +...+ TBL[N-1]) / N
6F8C1226
9. Selection 9-13

Program example:

ARRAY1 AVEL_INT SAMPLE1 Pointer ARRAY1 SAMPLE1


TBL -10
LD ST 1 98 -10
6 2 -100
N 3 65
LD 4 23
5 -51
6 -100
7 -125
8 199

• The average value is obtained from 6 data in input table ARRAY1 and the average value -10 is stored in variable SAMPLE1.

Error information:
• If N exceeds 256, N is limited to 256.
• When input data type is REAL, if NAN data is entered as input, the result is NAN.
• When direct I/O variable is specified as input table, table data average is not obtained. Also, the Error Flag is set to ON.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
9. Selection 9-14

Selection Limiter

LIMIT_xxx
Minimum MN Output

Diagram Input value IN

Maximum MX

EN input Edge execution Index modification


Modifier
√ √ —

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
Input IN √ Input value
See below
MX √ Maximum
Output — — Output

LIMIT_xxx
Minimum MN Output

Input value IN

Maximum MX

Minimum, Input value,


Symbol (_xxx) Output
Maximum
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

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.
• Input data cannot have mixed data types.
OUT = MIN{MAX(IN, MN), MX}
6F8C1226
9. Selection 9-15

Program example:

SAMPLE1 LIMIT_INT SAMPLE4


1000 MN 2500
LD ST
SAMPLE2
2500 IN
LD
SAMPLE3
4000 MX
LD
• Checks whether the input value 2500 in variable SAMPLE1 is between minimum 1000 in SAMPLE1 and maximum 4000 in
SAMPLE3. Because SAMPLE2 is between the maximum and minimum, 2500 is stored in variable SAMPLE4 as result.

Error information:
• When input data type is REAL, if NAN data is entered as input, the result is NAN.
• When EN is used, ENO output is reset to OFF when the above error occurs.

Note

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 Limited data
Hex.
MN,IN,MX MN, IN, MX
+ NAN 16#7F80_0001 - 16#7FFF_FFFF
+ MAX
+ INF 16#7F80_0000
+ MAX 16#7F7F_FFFF
:
+ MIN 16#0000_0001
16#0000_0000
0 Input data
16#8000_0000
- MIN 16#8000_0001
:
- MAX 16#FF7F_FFFF
- INF 16#FF80_0000
- MAX
- NAN 16#FF80_0001 - 16#FFFF_FFFF
6F8C1226
9. Selection 9-16

Selection Selector

SEL_xxx
Select input G Output

Diagram Input 0 IN0

Input 1 IN1

EN input Edge execution Index modification


Modifier
√ √ —

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
G BOOL √ Select input
Input IN0 √ Input 0
IN1 See below √ Input 1
Output — — Output

SEL_xxx
Select input G Output

Input 0 IN0

Input 1 IN1

Input 0, Input 1 Symbol (_xxx) 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

Function:
• Input 0 or Input 1 is selected depending on the status of select input G.
When select input G=OFF, Input 0 is selected and output as result.
When select input G=ON, Input 1 is selected and output as result.
• Input 0 and Input 1 must have the same data type.
6F8C1226
9. Selection 9-17

Program example:

SIGNAL1 SEL_INT SAMPLE3


1 G 2000
LD ST
SAMPLE1
1000 IN0
LD
SAMPLE2
2000 IN1
LD

• Because select input variable SIGNAL1 is ON, 2000 is stored in SAMPLE3 as result.
6F8C1226
9. Selection 9-18

Selection Multiplex

MUX_xxx
Input point No. K Output

Diagram Input 0

Input(n-1)

EN input Edge execution Index modification


Modifier
√ √ —

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 √ Input point No. 0 ≤ K ≤ (n-1)
Input
— See below √ Input 0...Input(n-1) 2 ≤ n ≤ 14
Output — — Output

MUX_xxx
Input point No. K Output

Input 0
Input(n-1)

Input 0...(n-1) Symbol (_xxx) 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

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.
6F8C1226
9. Selection 9-19

Program example:

SAMPLE1 MUX_INT SAMPLE5 Input point No. K=2 Result


2 K -9876
LD ST 0 1234 -9876
SAMPLE2 1 5678
1234 2 -9876
LD
SAMPLE3
5678
LD
SAMPLE4
-9876
LD

• Because the input point No. specified by SAMPLE1 is 2, -9876 which is the content of variable SAMPLE4 is stored in
variable 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 OFF when the above error occurs.
6F8C1226
9. Selection 9-20

Selection Multiplex of Table Data

MPX_xxx
Input table TBL Output

Diagram Selection point No. K

Table word number N

EN input Edge execution Index modification


Modifier
√ √ —

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 K UINT √ Selection point No. 0 ≤ K ≤ (N-1)
N UINT √ Table word number 1 ≤ N ≤ 256
Output — See below — Output

MPX_xxx
Input table TBL Output

Selection point No. K

Table word number N

Symbol (_xxx) Output


MPX_INT INT
MPX_DINT DINT
MPX_UINT UINT
MPX_WORD WORD
MPX_DWORD DWORD
MPX_REAL REAL
MPX_TIME TIME
MPX_TOD TOD
MPX_DATE DATE
MPX_DT DT

Function:
• The K (selection pointer No.) data is selected from N word data specified with input table TBL and result is output.
• Table word number may be from 1 to 256.
• Direct I/O variables cannot be specified for input table.
Table specification Table word number Action Error flag
1 ≤ N ≤ 256 Executed —
Not direct I/O N=0 Not executed —
N > 256 Executed with N=256 as limit —
Direct I/O * Not executed ON
6F8C1226
9. Selection 9-21

Selection point No. Pointer Input table Output


K=3 0 1234 4567
1 2345
2 3456 N words
N=5
3 4567
4 5678

Program example:

ARRAY1 MPX_INT SAMPLE3 Selection point No. K=2 Result


TBL -200
LD ST 0 -100 -200
SAMPLE1 1 100
2 K 2 -200
LD 3 200
SAMPLE2 4 -300
6 N
LD 5 300

• From the 6 input table specified with variable ARRAY1, -200 which is the K data (specified by selection pointer No. K=2 in
SAMPLE1) is stored in variable SAMPLE3.

Error information:
• If table word number N exceeds 256, N is limited to 256.
• When selection point No. K ≥ Table word number, operation is performed with K limited to (Table word number-1). Also, the
specific register Table Operation Error Flag is set ON.
• When direct I/O variable is specified as input table, table multiplexing is not performed. Also, the Error Flag is set to ON.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
10. Type Conversion 10-1

10 Type Conversion

No. Instruction Remarks


INT_TO_DINT
INT_TO_UINT
DINT_TO_INT
1 Integer-Integer Conversion
DINT_TO_UINT
UINT_TO_INT
UINT_TO_DINT
INT_TO_REAL
2 Integer-Real Numbers Conversion DINT_TO_REAL
UINT_TO_REAL
INT_TO_WORD
INT_TO_DWORD
DINT_TO_WORD
3 Integer-Bit String Conversion
DINT_TO_DWORD
UINT_TO_WORD
UINT_TO_DWORD
INT_TO_BCD_WORD
INT_TO_BCD_DWORD
DINT_TO_BCD_WORD
4 Integer-BCD Conversion
DINT_TO_BCD_DWORD
UINT_TO_BCD_WORD
UINT_TO_BCD_DWORD
INT_TO_TIME
5 Integer-Duration Conversion DINT_TO_TIME
UINT_TO_TIME
REAL_TO_INT
6 Real Numbers-Integer Conversion REAL_TO_DINT
REAL_TO_UINT
REAL_TO_BCD_WORD
7 Real Numbers-BCD Conversion
REAL_TO_BCD_DWORD
8 Real Numbers-Duration Conversion REAL_TO_TIME
WORD_TO_INT
WORD_TO_DINT
WORD_TO_UINT
9 Bit String-Integer Conversion
DWORD_TO_INT
DWORD_TO_DINT
DWORD_TO_UINT
WORD_TO_DWORD
10 Bit String-Bit String Conversion
DWORD_TO_WORD
WORD_BCD_TO_INT
WORD_BCD_TO_DINT
WORD_BCD_TO_UINT
11 BCD-Integer Conversion
DWORD_BCD_TO_INT
DWORD_BCD_TO_DINT
DWORD_BCD_TO_UINT
WORD_BCD_TO_REAL
12 BCD-Real Numbers Conversion
DWORD_BCD_TO_REAL
WORD_BCD_TO_TIME
13 BCD-Duration Conversion
DWORD_BCD_TO_TIME
14 Duration-Integer Conversion TIME_TO_INT
TIME_TO_DINT
6F8C1226
10. Type Conversion 10-2

TIME_TO_UINT
15 Duration-Real Numbers Conversion TIME_TO_REAL
TIME_TO_BCD_WORD
16 Duration-BCD Conversion
TIME_TO_BCD_DWORD
17 Truncation TRUNC
18 Sign Negative NEG
19 DEG-RAD Conversion DEG_TO_RAD
20 RAD-DEG Conversion RAD_TO_DEG
BIN_INT_P PCS
21 BIN Conversion
BIN_DINT_P PCS
DT_TO_TOD
22 Time Data Type Conversion
DT_TO_DATE
23 Concatenate Time Data CONCAT_D_TOD
24 ASCII-HEX Conversion ATOH_T T
25 HEX-ASCII Conversion HTOA_T T
26 ASCII-Real Numbers Conversion ASC_TO_REAL
27 Real Numbers-ASCII Conversion REAL_TO_ASC
ASCII (Decimal)-Double Integer
28 ASCDEC_TO_DINT
Conversion
ASCII (Hexadecimal)-Double Integer
29 ASCHEX_TO_DINT
Conversion
Double Integer-ASCII (Decimal)
30 DINT_TO_ASCDEC
Conversion
Double Integer-ASCII (Hexadecimal)
31 DINT_TO_ASCHEX
Conversion
32 Array-String Conversion ARRAY_TO_STRING
33 String-Array Conversion STRING_TO_ARRAY
34 Tag Number Conversion TO_INDEX
6F8C1226
10. Type Conversion 10-3

Type Conversion Integer-Integer Conversion

xxx_TO_xxx
Diagram Input Output

EN input Edge execution Index modification


Modifier
√ √ —

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
See below
Output — — Output

xxx_TO_xxx
Input Output

Input Symbol Output


INT INT_TO_DINT DINT
INT INT_TO_UINT UNIT
DINT DINT_TO_INT INT
DINT DINT_TO_UINT UNIT
UNIT UINT_TO_INT INT
UNIT UINT_TO_DINT DINT

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 —
DINT_TO_INT Input < -32768 -32768 √
Input > 32767 32767 √
0 to 65535 0 to 65535 —
DINT_TO_UINT Input < 0 0 √
Input > 65535 65535 √
0 to 32767 0 to 32767 —
UINT_TO_INT
Input > 32767 32767 √
UINT_TO_DINT 0 to 65535 0 to 65535 —
6F8C1226
10. Type Conversion 10-4

Program example:
(1) Normal execution
SAMPLE1 DINT_TO_INT SAMPLE2
−1234 −1234
LD ST

• Input data -1234 in variable SAMPLE1 is converted to INT and the result -1234 is stored in variable SAMPLE2.

(2) Limit execution


SAMPLE1 DINT_TO_INT SAMPLE2
−40000 −32768
LD ST

• Because input data -40000 in SAMPLE1 exceeds the valid data range for INT, the result -32768 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 OFF when the above error occurs.
6F8C1226
10. Type Conversion 10-5

Type Conversion Integer-Real Numbers Conversion

xxx_TO_REAL
Diagram Input Output

EN input Edge execution Index modification


Modifier
√ √ —

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

xxx_TO_REAL
Input Output

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:

SAMPLE1 INT_TO_REAL SAMPLE2


1234 1234.0
LD ST

• Input data 1234 in variable SAMPLE1 is converted to REAL and the result 1234.0 is stored in variable SAMPLE2.
6F8C1226
10. Type Conversion 10-6

Type Conversion Integer-Bit String Conversion

xxx_TO_xxx
Diagram Input Output

EN input Edge execution Index modification


Modifier
√ √ —

Arguments:
Arg. Operand Type Const. Description Remarks
Input — √ Input
See below
Output — — Output

xxx_TO_xxx
Input Output

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 to 16#7FFF —
INT_TO_DWORD -32768 to 32767 16#FFFF8000 to 16#00007FFF —
-32768 to 32767 16#8000 to 16#7FFF —
DINT_TO_WORD Input < -32768 16#8000 √
Input > 32767 16#7FFF √
DINT_TO_DWORD -2147483648 to 2147483647 16#80000000 to 16#7FFFFFFF —
UINT_TO_WORD 0 to 65535 16#0 to 16#FFFF —
UINT_TO_DWORD 0 to 65535 16#0 to 16#0000FFFF —

Program Example:
SAMPLE1 INT_TO_WORD SAMPLE2
−1234 16#FB2E
LD ST

• 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 OFF when the above error occurs.
6F8C1226
10. Type Conversion 10-7

Type Conversion Integer-BCD Conversion

xxx_TO_BCD_xxx
Diagram Input Output

EN input Edge execution Index modification


Modifier
√ √ —

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
See below
Output — — Output

xxx_TO_BCD_xxx
Input 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 to 16#9999 — —
INT_TO_BCD_WORD Input < 0 16#0 √ ON
Input > 9999 16#9999 √ ON
0 to 32767 16#0 to 16#32767 — —
INT_TO_BCD_DWORD
Input < 0 16#0 √ ON
0 to 9999 16#0 to 16#9999 — —
DINT_TO_BCD_WORD Input < 0 16#0 √ ON
Input > 9999 16#9999 √ ON
0 to 99999999 16#0 to 16#99999999 — —
DINT_TO_BCD_DWORD Input < 0 16#0 √ ON
Input > 99999999 16#99999999 √ ON
0 to 9999 16#0 to 16#9999 — —
UINT_TO_BCD_WORD
Input > 9999 16#9999 √ ON
UINT_TO_BCD_DWORD 0 to 65535 16#0 to 16#65535 — —
6F8C1226
10. Type Conversion 10-8

Program example:
(1) Normal execution
SAMPLE1 UINT_TO_BCD_WORD SAMPLE2
1234 16#1234
LD ST
• The input data 1234 in SAMPLE1 is converted to BCD and the result 16#1234 is stored in SAMPLE2.

(2) Limit execution


SAMPLE1 UINT_TO_BCD_WORD SAMPLE2
12345 16#9999
LD ST
• Because input data 12345 in SAMPLE1 exceeds the valid range, the result 16#9999 is stored in SAMPLE2.

Error information:
• If the BCD data after conversion exceeds the valid range of the output data, the conversion result is limited by
16#0 or 16#9999 when WORD
16#0 or 16#99999999 when DWORD
• Also, the specific register BCD Error Flag is set to ON.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
10. Type Conversion 10-9

Type Conversion Integer-Duration Conversion

xxx_TO_TIME
Diagram Input Output

EN input Edge execution Index modification


Modifier
√ √ —

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

xxx_TO_TIME
Input Output

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:
SAMPLE1 INT_TO_TIME SAMPLE2
1234 T#1234ms
LD ST

• Input data 1234 in variable SAMPLE1 is converted to TIME and the result T#1234ms is stored in variable SAMPLE2.
6F8C1226
10. Type Conversion 10-10

Type Conversion Real Numbers-Integer Conversion

REAL_TO_xxx
Diagram Input Output

EN input Edge execution Index modification


Modifier
√ √ —

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

REAL_TO_xxx
Input 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 IEC559.
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
6F8C1226
10. Type Conversion 10-11

Program example:
(1) Normal execution
SAMPLE1 REAL_TO_INT SAMPLE2
4.567 5
LD ST

• Input data 4.567 in variable SAMPLE1 is converted to INT and the result 5 is stored in variable SAMPLE2.

(2) Limit execution


SAMPLE1 REAL_TO_INT SAMPLE2
54321.0 32767
LD 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.

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 input data type is REAL, if NAN data is entered as input, 0 is output as the result.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
10. Type Conversion 10-12

Type Conversion Real Numbers-BCD Conversion

REAL_TO_BCD_xxx
Diagram Input Output

EN input Edge execution Index modification


Modifier
√ √ —

Arguments:
Arg. Operand Type Const. Description Remarks
Input — REAL √ Input
Output — See below — Output

REAL_TO_BCD_xxx
Input Output

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 as follows:
Instruction Input (after rounding) Output Limit BCD error
0.0 to 9999.0 16#0 to 16#9999 — —
REAL_TO_BCD_WORD Input < 0.0 16#0 √ ON
Input > 9999.0 16#9999 √ ON
0.0 to 99999995.0 16#0 to 16#99999992 — —
REAL_TO_BCD_DWORD Input < 0.0 16#0 √ ON
Input > 99999995.0 16#99999999 √ ON

Program example:
(1) Normal execution
SAMPLE1 REAL_TO_BCD_WORD SAMPLE2
1234.0 16#1234
LD ST

• Converts input data 1234.0 in SAMPLE1 to BCD and stores the result 16#1234 in SAMPLE2.

(2) Limit execution


SAMPLE1 REAL_TO_BCD_WORD SAMPLE2
12345.0 16#9999
LD ST

• Stores the result 16#9999 in SAMPLE2 because input data 12345.0 in SAMPLE1 exceeds the valid range.
6F8C1226
10. Type Conversion 10-13

Error information:
• If the BCD data after conversion exceeds the valid range of the output data, the conversion result is limited by
16#0 or 16#9999 when WORD
16#0 or 16#99999999 when DWORD
Also, the special register BCD Error Flag is set to ON.
• If nonnumeric data is entered as input, the result is 0. Also, the special register BCD Error Flag is set to ON.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
10. Type Conversion 10-14

Type Conversion Real Numbers-Duration Conversion

REAL_TO_TIME
Diagram Input Output

EN input Edge execution Index modification


Modifier
√ √ —

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:
(1) Normal execution
SAMPLE1 REAL_TO_TIME SAMPLE2
4.567 T#5ms
LD ST

• Input data 4.567 in variable SAMPLE1 is converted to elapsed time and the result T#5ms is stored in variable SAMPLE2.

(2) Limit execution


SAMPLE1 REAL_TO_TIME SAMPLE2
3.4E+20 T#2147483647ms
LD 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.

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.
• If nonnumeric data is entered as input, 0 is output as the result.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
10. Type Conversion 10-15

Type Conversion Bit String-Integer Conversion

xxx_TO_xxx
Diagram Input Output

EN input Edge execution Index modification


Modifier
√ √ —

Arguments:
Arg. Operand Type Const. Description Remarks
Input — √ Input
See below
Output — — Output

xxx_TO_xxx
Input Output

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

Function:
• The entered bit string data is converted to integer data.
• The conversion range and limits are shown below.
Instruction Input Output Limit
WORD_TO_INT 16#0 to 16#7FFF 0 to 32767 —
16#8000 to 16#FFFF -32768 to -1 —
WORD_TO_DINT 16#0 to 16#7FFF 0 to 32767 —
16#8000 to 16#FFFF -32768 to -1 —
WORD_TO_UINT 16#0 to 16#FFFF 0 to 65535 —
16#0 to 16#7FFF 0 to 32767 —
DWORD_TO_INT 16#7FFF < Input ≤ 16#7FFFFFFF 32767 √
16#7FFFFFFF < Input < 16#FFFF8000 -32768 √
16#FFFF8000 ≤ Input ≤ 16#FFFFFFFF -32768 to -1 —
DWORD_TO_DINT 16#0 to 16#7FFFFFFF 0 to 2147483647 —
16#80000000 to 16#FFFFFFFF -2147483648 to -1 —
16#0 to 16#FFFF 0 to 65535 —
DWORD_TO_UINT 0 to 65535 (Low order word is √
Input > 16#FFFF
treated as UINT data)

Program example:
SAMPLE1 WORD_TO_INT SAMPLE2
16#FB2E −1234
LD ST

• The input data 16#FB2E in SAMPLE1 is converted to INT and the result -1234 is stored in SAMPLE2.

Error information:
• If input data is greater than 16#FFFF, the low order 16 bits of the converted DWORD data is output.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
10. Type Conversion 10-16

Type Conversion Bit String-Bit String Conversion

xxx_TO_xxx
Diagram Input Output

EN input Edge execution Index modification


Modifier
√ √ —

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
See below
Output — — Output

xxx_TO_xxx
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 to 16#FFFF 16#0 to 16#FFFF —
16#0 to 16#FFFF 16#0 to 16#FFFF —
DWORD_TO_WORD
Input > 16#FFFF Low order 16 bits are output √

Program Example:
(1) Normal execution

SA MPLE1 DWORD_TO_WORD SA MPLE2


16#00001234 16#1234
LD ST

• The input data 16#00001234 in SAMPLE1 is converted to WORD and the result 16#1234 is stored in SAMPLE2.

(2) Limit execution

SA MPLE1 DWORD_TO_WORD SA MPLE2


16#00012345 16#2345
LD 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 OFF.

Error information:
• If input data is greater than 16#FFFF, the low order 16 bits of the converted DWORD data is output.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
10. Type Conversion 10-17

Type Conversion BCD-Integer Conversion

xxx_BCD_TO_xxx
Diagram Input Output

EN input Edge execution Index modification


Modifier
√ √ —

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
See below
Output — — Output

xxx_BCD_TO_xxx
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 to 16#F is present in each digit.
Instruction Input Output Limit BCD error
16#0 to 16#9999 0 to 9999 — —
WORD_BCD_TO_INT
Each digit input > 16#9 0 — ON
16#0 to 16#9999 0 to 9999 — —
WORD_BCD_TO_DINT
Each digit input > 16#9 0 — ON
16#0 to 16#9999 0 to 9999 — —
WORD_BCD_TO_UINT
Each digit input > 16#9 0 — ON
16#0 to 16#9999 0 to 9999 — —
DWORD_BCD_TO_INT Input >16#9999 9999 √ ON
Each digit input > 16#9 0 — ON
16#0 to 16#99999999 0 to 99999999 — —
DWORD_BCD_TO_DINT
Each digit input > 16#9 0 — ON
16#0 to 16#65535 0 to 65535 — —
DWORD_BCD_TO_UINT Input > 16#65535 65535 √ ON
Each digit input > 16#9 0 — ON
6F8C1226
10. Type Conversion 10-18

Program example:
(1) Normal execution

SA MPLE1 DWORD_TO_WORD SA MPLE2


16#00001234 16#1234
LD ST

• The input data 16#00001234 in SAMPLE1 is converted to WORD and the result 16#1234 is stored in SAMPLE2.

(2) Limit execution

SA MPLE1 DWORD_TO_WORD SA MPLE2


16#00012345 16#2345
LD 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 OFF.

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 is set to 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 OFF when the above error occurs.
6F8C1226
10. Type Conversion 10-19

Type Conversion BCD-Real Numbers Conversion

xxx_BCD_TO_REAL
Diagram Input Output

EN input Edge execution Index modification


Modifier
√ √ —

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

xxx_BCD_TO_REAL
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 to 16#F is present in each digit.
Instruction Input Output BCD error
16#0 to 16#9999 0.0 to 9999.0 —
WORD_BCD_TO_REAL
Each digit input > 16#9 0.0 ON
16#0 to 16#99999999 0.0 to 100000000.0 —
DWORD_BCD_TO_REAL
Each digit input > 16#9 0.0 ON

Program example:
(1) Normal execution
SAMPLE1 WORD_BCD_TO_REAL SAMPLE2
16#1234 1234.0
LD ST

• Input data 16#1234 in variable SAMPLE1 is converted to REAL and the result 1234.0 is stored in variable SAMPLE2.

(2) Invalid data input


SAMPLE1 WORD_BCD_TO_REAL SAMPLE2
16#1A39 0.0
LD ST

• Stores the result 0.0 in SAMPLE2 because the input data 16#1A39 in SAMPLE1 contains invalid data A.

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 is set to ON.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
10. Type Conversion 10-20

Type Conversion BCD-Duration Conversion

xxx_BCD_TO_TIME
Diagram Input Output

EN input Edge execution Index modification


Modifier
√ √ —

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

xxx_BCD_TO_TIME
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 to 16#9999 T#0ms to T#9999ms —
WORD_BCD_TO_DINT
Each digit input > 16#9 T#0ms ON
16#0 to 16#99999999 T#0ms to T#99999999ms —
DOWRD_BCD_TO_DINT
Each digit input > 16#9 T#0ms ON
6F8C1226
10. Type Conversion 10-21

Program example:
(1) Normal execution
SAMPLE1 WORD_BCD_TO_TIME SAMPLE2
16#1234 T#1234ms
LD ST

• Input data 16#1234 in variable SAMPLE1 is converted to elapsed time and the result T#1234ms is stored in variable
SAMPLE2.

(2) Invalid data input


SAMPLE1 WORD_BCD_TO_TIME SAMPLE2
16#1A39 T#0ms
LD ST

• Stores the result T#0ms in SAMPLE2 because the input data 16#1A39 in SAMPLE1 contains invalid data A.

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 is set to ON.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
10. Type Conversion 10-22

Type Conversion Duration-Integer Conversion

TIME_TO_xxx
Diagram Input Output

EN input Edge execution Index modification


Modifier
√ √ —

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

TIME_TO_xxx
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 as follows:
Instruction Input Output Limit
-T#32768ms to T#32767ms -32768 to 32767 —
TIME_TO_INT Input < -T#32768ms -32768 √
Input > T#32767ms 32767 √
-T#2147483648ms -2147483648 to —
TIME_TO_DINT
to T#2147483647ms 2147483647
T#0ms to T#65535ms 0 to 65535 —
TIME_TO_UINT Input < T#0ms 0 √
Input > T#65535ms 65535 √
6F8C1226
10. Type Conversion 10-23

Program example:
(1) Normal execution
SAMPLE1 TIME_TO_INT SAMPLE2
−T#1234ms −1234
LD ST

• Converts input data -T#1234ms in SAMPLE1 to INT and stores the result -1234 in SAMPLE2.

(2) Limit execution

SAMPLE1 TIME_TO_INT SAMPLE2


−T#40000ms −32768
LD ST

• Stores the result -32768 in SAMPLE2 because input data -T#40000ms in SAMPLE1 exceeds the valid data range for INT.

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 OFF when the above error occurs.
6F8C1226
10. Type Conversion 10-24

Type Conversion Duration-Real Numbers Conversion

TIME_TO_REAL
Diagram Input Output

EN input Edge execution Index modification


Modifier
√ √ —

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 — REAL — Output

Function:
• The entered TIME data is converted to REAL data.
• Converts with output in ms unit.
• TIME data between -T#16777215ms to T#16777215ms will be accurate when converted to REAL.

Program example:
SAMPLE1 TIME_TO_REAL SAMPLE2
T#1234ms 1234.0
LD ST

• Input data T#1234ms in variable SAMPLE1 is converted to REAL and the result 1234.0 is stored in variable SAMPLE2.
6F8C1226
10. Type Conversion 10-25

Type Conversion Duration-BCD Conversion

TIME_TO_BCD_ xxx
Diagram Input Output

EN input Edge execution Index modification


Modifier
√ √ —

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

TIME_TO_BCD_xxx
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 to T#9999ms 16#0 to 16#9999 — —
TIME_TO_BCD_WORD Input < T#0ms 16#0 √ ON
Input > T#9999ms 16#9999 √ ON
T#0ms to T#99999999ms 16#0 to 16#99999999 — —
TIME_TO_BCD_DWORD Input < T#0ms 16#0 √ ON
Input > T#99999999ms 16#99999999 √ ON
6F8C1226
10. Type Conversion 10-26

Program example:
(1) Normal execution

SAMPLE1 TIME_TO_BCD_WORD SAMPLE2


T#1234ms 16#1234
LD ST

• Converts input data T#1234ms in SAMPLE1 to BCD and stores the result 16#1234 in SAMPLE2.

(2) Limit execution

SAMPLE1 TIME_TO_BCD_WORD SAMPLE2


T#12345ms 16#9999
LD ST

• Stores the result 16#9999 in SAMPLE2 because input data T#12345ms in SAMPLE1 exceeds the valid range.

Error information:
• If the BCD data after conversion exceeds the valid range of the output data, the conversion result is limited by
16#0 or 16#9999 when WORD
16#0 or 16#99999999 when DWORD
Also, the special register BCD Error Flag is set to ON.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
10. Type Conversion 10-27

Type Conversion Truncation

TRUNC_xxx
Diagram Input Output

EN input Edge execution Index modification


Modifier
√ √ —

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

TRUNC_xxx Output
Input

Symbol Output
TRUNC_INT INT
TRUNC_DINT DINT
TRUNC_UINT UINT

Function:
• The entered REAL data is converted to 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
UNIT conversion : 0 to 65535
6F8C1226
10. Type Conversion 10-28

Program example:
(1) Normal execution

SAMPLE1 TRUNC_INT SAMPLE2


4.567 4
LD ST

• Input data 4.567 in variable SAMPLE1 is converted to INT and the result 4 is stored in variable SAMPLE2.

(2) Limit execution

SAMPLE1 TRUNC_INT SAMPLE2


54321.0 32767
LD 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.

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 input data type is REAL, if NAN data is entered as input, 0 is output as the result.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
10. Type Conversion 10-29

Type Conversion Sign Negative

NEG_xxx
Diagram Input Output

EN input Edge execution Index modification


Modifier
√ √ —

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
See below
Output — — Output

NEG_xxx Output
Input

Input Symbol Output


INT NEG_INT INT
DINT NEG_DINT DINT
REAL NEG_REAL REAL

Function:
• The sign of the input data is negated and the result is output.

Program example:
(1) Normal execution
SAMPLE1 NEG_INT SAMPLE2
1234 −1234
LD ST

• The sign of the input data 1234 in SAMPLE1 is inverted and the result -1234 is stored in variable SAMPLE2.

(2) Limit execution


SAMPLE1 NEG_INT SAMPLE2
−32768 32767
LD 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.

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 input data type is REAL, if NAN data is entered as input, the result is NAN.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
10. Type Conversion 10-30

Type Conversion DEG-RAD Conversion

DEG_TO_RAD
Diagram Input Output

EN input Edge execution Index modification


Modifier
√ √ —

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:
SAMPLE1 DEG_TO_RAD SAMPLE2
90.0 1.57079
LD ST

• The input data 90 in variable SAMPLE1 is converted to radian and the result 1.57079 is stored in variable SAMPLE2.

Error information:
• If NAN data is entered as input, the result is NAN.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
10. Type Conversion 10-31

Type Conversion RAD-DEG Conversion

RAD_TO_DEG
Diagram Input Output

EN input Edge execution Index modification


Modifier
√ √ —

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:
SAMPLE1 RAD_TO_DEG SAMPLE2
1.57079 90.0
LD ST

• The input data 1.57079 in variable SAMPLE1 is converted to angle and the result 90 is stored in variable SAMPLE2.

Error information:
• If NAN data is entered as input, the result is NAN.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
10. Type Conversion 10-32

Type Conversion BIN Conversion PCS

BIN_xxx_P
Diagram Input Output

EN input Edge execution Index modification


Modifier
√ √ —

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
See below
Output — — Output

BIN_xxx_P Output
Input

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 to 16#99999999 (When each digit > 9: Limit each digit to 9)
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 √
• Invalid input data error can be detected by using a BIN Conversion instruction in the condition expression of an IF statement.
Valid input data : Executes statements after THEN.
Invalid input data : Executes statements after ELSE.
6F8C1226
10. Type Conversion 10-33

Program example:
(1) Normal execution

SAMPLE1 BIN_INT_P SAMLE2


16#1234 1234
LD ST

• The input data 16#1234 in SAMPLE1 is converted to BIN and the result 1234 is stored in SAMPLE2.

(2) Invalid data input

SAMPLE1 BIN_INT_P SAMLE2


16#1A39 1939
LD ST

• Because the input data 16#1A39 in SAMPLE1 contains invalid data A, the result 1939 is stored in SAMPLE2. Also, the
condition expression of the IF statement is reset to OFF.

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 OFF when the above error occurs.
6F8C1226
10. Type Conversion 10-34

Type Conversion Time Data Type Conversion

DT_TO_xxx
Diagram Input Output

EN input Edge execution Index modification


Modifier
√ √ —

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 — DT — Input
Output — See below — Output

DT_TO_xxx Output
Input

Symbol Output
DT_TO_TOD TOD
DT_TO_DATE DATE

Function:
• The entered DT data is converted to specified TOD data or DATE data.

Program Example:
(1) DT_TO_TOD

SAMPLE1 DT_TO_TOD SAMPLE2


DT#1999-8-24-17:34:56 TOD#17:34:56
LD ST

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

(2) DT_TO_DATE

SAMPLE1 DT_TO_DATE SAMPLE2


DT#1999-8-24-17:34:56 DATE#1999-8-24
LD ST

• 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.
6F8C1226
10. Type Conversion 10-35

Type Conversion Concatenate Time Data

CONCAT_D_TOD
Input 1 Output
Diagram
Input 2

EN input Edge execution Index modification


Modifier
√ √ —

Arguments:
Arg. Operand Type Const. Description Remarks
— DATE √ Input 1 (Date data)
Input
— TOD √ Input 2 (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.

Program example:
SAMPLE1 CONCAT_D_TOD SAMPLE3
DATE#1999-8-24 DT#1999-8-24-17:34:56
LD ST

SAMPLE2
TOD#17:34:56
LD

• 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.
6F8C1226
10. Type Conversion 10-36

Type Conversion ASCII-HEX Conversion T

ATOH_T
Source table TBL Destination table
Diagram
Table size N

EN input Edge execution Index modification


Modifier
√ √ —

Arguments:
Arg. Operand Type Const. Description Remarks
TBL PTR — Source table
Input
N UINT √ Table size 1 ≤ N ≤ 64
Output — PTR — Destination table

Function:
• The N word ASCII data starting at variable specified with source table TBL is converted to WORD and the result is stored in
destination table.
• Conversion is performed from low order byte of the source table and stored from the highest digit of the destination table.
• Valid ASCII data is “0”(16#30) to “9”(16#39) and “A”(16#41) to “F”(16#46).
• If the table size is odd, only the high order byte is updated in the final data of the destination table.
• Table size N is the size of the source table and may be between 1 and 64.
• If N=0, no conversion is performed.
• Direct I/O variable cannot be specified for source table or destination table. (S controller only)
Table
Table size Action Error Flag
specification
1 ≤ N ≤ 64 Executed —
Not direct I/O N=0 Not executed —
N > 64 Execute with N=64 as limit —
Direct I/O * Not executed ON
6F8C1226
10. Type Conversion 10-37

Program example:
ARRAY1 ATOH_T ARRAY2
TBL
LD ST
SAMPLE2
9 N
LD
Source table (ASCII data) Destination table (WORD)
ARRAY1 ARRAY2
F 8 7 0 F 0
“1”(16#31) “0”(16#30) 16#0123
“3”(16#33) “2”(16#32) 16#4567
“5”(16#35) “4”(16#34) Conversion 16#89AB
“7”(16#37) “6”(16#36) 16#CDEF
9 words “9”(16#39) “8”(16#38) 16#01∗∗
“B”(16#42) “A”(16#41) Because N=9, only the high order byte is
“D”(16#44) “C”(16#43) updated for the final word of the destination
“F”(16#46) “E”(16#45) table. Low order byte is previous value.
“1”(16#31) “0”(16#30)

• The 9 words ASCII data starting at source table ARRAY1 is converted to WORD and the result is stored in variable
ARRAY2.
• Because the table size is odd, only the top byte of the destination table ARRAY2[4] is updated and the low order byte retains
the previous value.

Error information:
• If the conversion source data contains invalid data (ASCII code other than “0” to “9” and “A” to “F”), no conversion is
performed and the S register Error Flag is set to ON.
• If table size N exceeds 64, it is limited to N=64.
• ASCII to HEX conversion is not performed if direct I/O variables are specified for source table or destination table. Also, the
specific register Error Flag is set ON. (S controller only)
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
10. Type Conversion 10-38

Type Conversion HEX-ASCII Conversion T

HTOA_T
Source table TBL Destination table
Diagram bl
Table size N

EN input Edge execution Index modification


Modifier
√ √ —

Arguments:
Arg. Operand Type Const. Description Remarks
TBL PTR — Source table
Input
N UINT √ Table size 1 ≤ N ≤ 32
Output — PTR — Destination table

Function:
• The N word WORD data starting at variable specified with source table TBL is converted to ASCII data and the result is
stored in destination table.
• Conversion is performed from top of the source table and stored from the low order byte of the destination table.
• Table size N is the size of the source table and may be between 1 and 32.
• If N=0, no conversion is performed.
• Direct I/O variable cannot be specified for source table or destination table. (S controller only)
Table
Table size Action Error Flag
specification
1 ≤ N ≤ 32 Executed —
Not direct I/O N=0 Not executed —
N > 32 Execute with N=32 as limit —
Direct I/O * Not executed ON

Program example:

ARRAY1 HTOA_T ARRAY2


TBL
LD ST
SAMPLE2
4 N
LD

Source table (WORD) Destination table (ASCII data)


ARRAY1 ARRAY2
F 0 F 8 7 0
16#0123 “1”(16#31) “0”(16#30)
16#4567 “3”(16#33) “2”(16#32)
16#89AB “5”(16#35) “4”(16#34)
Conversion
16#CDEF “7”(16#37) “6”(16#36)
8 words
“9”(16#39) “8”(16#38)
“B”(16#42) “A”(16#41)
“D”(16#44) “C”(16#43)
“F”(16#46) “E”(16#45)
• The 4 words WORD data starting at source table ARRAY1 is converted to ASCII and the result is stored in variable
ARRAY2.

Error information:
• If table size N exceeds 32, it is limited to N=32.
• HEX to ASCII conversion is not performed if direct I/O variables are specified for source table or destination table. Also, the
6F8C1226
10. Type Conversion 10-39

specific register Error Flag is set ON. (S controller only)


• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
10. Type Conversion 10-40

Type Conversion ASCII-Real Numbers Conversion

ASC_TO_REAL
Input string Output
Diagram
Converted N
characters

EN input Edge execution Index modification


Modifier
√ √ —

Arguments:
Arg. Operand Type Const. Description Remarks
— STRING — Input string
Input
N UINT √ Converted characters 1 ≤ N ≤ 64
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 format : 123.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:

.
e
SP + +
Number . Number E Number
- -

Program example:
(1) When the input string is specified in numerical format.
SAMPLE1 ASC_TO_REAL SAMPLE3
162.25 162.25
LD ST

SAMPLE2
6 N
LD

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

(2) When the input string is specified in exponential format.


SAMPLE1 ASC_TO_REAL SAMPLE3
12.5E-23 0.125
LD ST

SAMPLE2
7 N
LD
6F8C1226
10. Type Conversion 10-41

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

Error information:
• 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.
• When EN is used, ENO is reset to OFF when the above error occurs.
6F8C1226
10. Type Conversion 10-42

Type Conversion Real Numbers-ASCII Conversion

REAL_TO_ASC
Input data Output

Diagram Output characters SIZE

Decimal N
characters

EN input Edge execution Index modification


Modifier
√ √ —

Arguments:
Arg. Operand Type Const. Description Remarks
— REAL √ Input data
Input ≥ 0 : 0 ≤ SIZE ≤ 9
Input SIZE UINT √ Output characters
Input < 0 : 0 ≤ SIZE ≤ 10
N UINT √ Decimal characters 0≤N≤7
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 ON to indicate that characters are truncated.
• When SIZE=0, the result is NULL .
.
N
SIZE
6F8C1226
10. Type Conversion 10-43

Program example:
(1) Normal execution
SAMPLE1 REAL_TO_ASC SAMPLE4
162.25 162.2
LD ST

SAMPLE2
5 SIZE
LD

SAMPLE3
1 N
LD

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

(2) Abnormal execution


SAMPLE1 REAL_TO_ASC SAMPLE4
-12.345 -12.3
LD ST

SAMPLE2
5 SIZE
LD

SAMPLE3
2 N
LD

• 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 ON to indicate that
characters are truncated.

Error information:
• If the converted result cannot be stored within SIZE, an Error Flag in the specific register is set to ON to indicate that
characters are truncated.
• No conversion is performed when SIZE is greater than the defined string size.
• If input data is NAN, no conversion is performed.
• 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.
• When EN is used, ENO is reset to OFF when the above error occurs.
6F8C1226
10. Type Conversion 10-44

Type Conversion ASCII (Decimal)-Double Integer Conversion

ASCDEC_TO_DINT
Conversion table TBL Output
Diagram
Table size N

EN input Edge execution Index modification


Modifier
√ √ —

Arguments:
Arg. Operand Type Const. Description Remarks
TBL PTR — Conversion table
Input
N UINT √ Table size 1 ≤ N ≤ 64
Output — DINT — Output

Function:
• From conversion table TBL consisting of decimal ASCII data (including end code CR), the number of words specified by
table size N are converted to DINT and the result is output.
• Valid ASCII data are ”0”(16#30) to “9”(16#39), “-“(16#2D), “+”(16#2B) and CR(16#0D).
• The content of the conversion table that is subject to conversion starts with a number, “+” or “-“ and ends with end code CR.
• Table size N is from 1 to 64. When N=0, the result is output as 0.
• The range of data to be converted is from -2147483648 to 2147483647.
• The data format of the conversion table is as follows:
(1)”12345678” (2)”–876543210” (3)”+135792468”
0 “2”(16#32) “1”(16#31) 0 “8”(16#38) “-”(16#2D) 0 “1”(16#31) “+”(16#2B)
1 “4”(16#34) “3”(16#33) 1 “6”(16#36) “7”(16#37) 1 “5”(16#35) “3”(16#33)
2 “6”(16#36) “5”(16#35) 2 “4”(16#34) “5”(16#35) 2 “9”(16#39) “7”(16#37)
3 “8”(16#38) “7”(16#37) 3 “2”(16#32) “3”(16#33) 3 “4”(16#34) “2”(16#32)
4 * CR(16#0D) 4 “0”(16#30) “1”(16#31) 4 “8”(16#38) “6”(16#36)
5 * * 5 * CR(16#0D) 5 * CR(16#0D)

• Direct I/O variables cannot be specified for conversion table. (S controller only)
Table
Table word count Action Error Flag
specification
1 ≤ N ≤ 64 Executed —
Not direct I/O N=0 0 output —
N > 64 Execute with N=64 as limit —
Direct I/O ∗ Not executed ON
6F8C1226
10. Type Conversion 10-45

Program example:
(1) Normal execution
ASCDEC_TO_DINT TBL1 structure
TBL1 SAMPLE2 0 “1” (16#31) “-“ (16#2D)
TBL -1234
LD ST 1 “3” (16#33) “2” (16#32)
SAMPLE1 2 CR(16#0D) “4” (16#34)
3 N
LD

• Starting with conversion table TBL1, the 3 words ASCII data specified by SAMPLE1 is converted to DINT and the result
-1234 is stored in variable SAMPLE2.

(2) Abnormal execution


ASCDEC_TO_DINT TBL1 structure
TBL1 SAMPLE2 0 “1” (16#31) “-“ (16#2D)
TBL 0
LD ST 1 “3” (16#33) “2” (16#32)
SAMPLE1 2 “5” (16#35) “4” (16#34)
3 N
LD

• Because no CR code is detected when converting the 3 words ASCII data specified by SAMPLE1 starting with conversion
TBL1 to DINT, the result 0 is stored in variable SAMPLE2 and the special register Error Flag is set to ON.

Error information:
• If an ASCII code other than the specified character is present before the CR code, if “+“ or “-“ is present anywhere other than
the beginning of data, or if the CR code is not present, the result is 0 and the special register Error Flag is set to ON.
• If the conversion result exceeds the maximum value of DINT type, the limit value is output. Also, the special register Error
Flag is set to ON.
• If table size exceeds 64, it is limited to N=64.
• When direct I/O variable is specified as conversion table, no operation is performed. Also, the special register Error Flag is
set to ON. (S controller only)
• When EN is used, ENO is reset to OFF when the above error occurs.
6F8C1226
10. Type Conversion 10-46

Type Conversion ASCII (Hexadecimal)-Double Integer Conversion

ASCHEX_TO_DINT
Conversion table TBL Output
Diagram
Table size N

EN input Edge execution Index modification


Modifier
√ √ —

Arguments:
Arg. Operand Type Const. Description Remarks
TBL PTR — Conversion table
Input
N UINT √ Table size 1 ≤ N ≤ 64
Output — DINT — Output

Function:
• From conversion table TBL consisting of hexadecimal ASCII data (including end code CR), the numbers of words specified
by table size N are converted to DINT and the result is output.
• Valid ASCII data are as follows:
“0” (16#30) to “9” (16#39), “A”(16#41) to “F”(16#46), “a”(16#61) to “f”(16#66), CR(16#0D)
• The content of the conversion table that is subject to conversion starts with a number, “A” to “F”, or “a” to “f” and ends with
end code CR.
• Table size N is from 1 to 64. When N=0, the result is output as 0.
• The data to be converted is from 0 to FFFFFFFF.
• The data format of the conversion table is as follows:
(1) “12345678” (2) “ABCDef01”
0 “2” (16#32) “1” (16#31) 0 “B” (16#42) “A” (16#41)
1 “4” (16#34) “3” (16#33) 1 “D” (16#44) “C” (16#43)
2 “6” (16#36) “5” (16#35) 2 “f” (16#66) “e” (16#65)
3 “8” (16#38) “7” (16#37) 3 “1” (16#31) “0” (16#30)
4 * CR (16#0D) 4 * CR (16#0D)
5 * * 5 * *

• Direct I/O variables cannot be specified for conversion table. (S controller only)
Table
Table word count Action Error Flag
specification
1 ≤ N ≤ 64 Executed —
Not direct I/O N=0 0 output —
N > 64 Execute with N=64 as limit —
Direct I/O ∗ Not executed ON
6F8C1226
10. Type Conversion 10-47

Program example:
(1) Normal execution
ASCHEX_TO_DINT TBL1 structure
TBL1 SAMPLE2 0 "A" (16#41) "1" (16#31)
TBL 109364
LD ST 1 "3" (16#33) "B" (16#42)
SAMPLE1 2 CR(16#0D) "4" (16#34)
3 N
LD

• Starting with conversion table TBL1, the 3 words ASCII data specified by SAMPLE1 is converted to DINT and the result
109364 is stored in variable SAMPLE2.

(2) Abnormal execution


ASCHEX_TO_DINT TBL1 structure
TBL1 SAMPLE2 0 "1" (16#31) "0" (16#30)
TBL 0
LD ST 1 "3" (16#33) "2" (16#32)
SAMPLE1 2 "5" (16#35) "4" (16#34)
3 N
LD

• Because no CR code is detected when converting the 3 words ASCII data specified by SAMPLE1 starting with conversion
TBL1 to DINT, the result 0 is stored in variable SAMPLE2 and the special register Error Flag is set to ON.

Error information:
• If an ASCII code other than the specified character is present before the CR code or if the CR code is not present, the result
is 0 and the special register Error Flag is set to ON.
• If the conversion result exceeds the maximum value of DINT type, the limit value is output. Also, the special register Error
Flag is set to ON.
• If table size exceeds 64, it is limited to N=64.
• When direct I/O variable is specified as conversion table, no operation is performed. Also, the special register Error Flag is
set to ON. (S controller only)
• When EN is used, ENO is reset to OFF when the above error occurs.
6F8C1226
10. Type Conversion 10-48

Type Conversion Double Integer-ASCII (Decimal) Conversion

DINT_TO_ASCDEC
Conversion data IN Store destination
Diagram table
Table size N

EN input Edge execution Index modification


Modifier
√ √ —

Arguments:
Arg. Operand Type Const. Description Remarks
IN DINT — Conversion data
Input
N UINT √ Table size 1 ≤ N ≤ 64
Output — PTR — Store destination table

Function:
• Conversion data IN is converted to decimal ASCII data and the result is output with end code CR appended at the end of
converted ASCII data. Also, the number of converted character codes is output to index register XL. (XL contains the
number of character codes including the end code CR.)
• Table size N is from 1 to 64. No operation is performed when N=0.
• The range of data to be converted is from -2147483648 to 2147483647.
• The data format of the storage destination table is as follows:
(1) 1234567890 (2) –876543210
0 “2”(16#32) “1”(16#31) 0 “8”(16#38) “-“(16#2D)
1 “4”(16#34) “3”(16#33) 1 “6”(16#36) “7”(16#37)
2 “6”(16#36) “5”(16#35) 2 “4”(16#34) “5”(16#35)
3 “8”(16#38) “7”(16#37) 3 “2”(16#32) “3”(16#33)
4 “0”(16#30) “9”(16#39) 4 “0”(16#30) “1”(16#31)
5 * CR(16#0D) 5 * CR(16#0D)

• I/O variable cannot be specified directly for storage destination table. (S controller only)
Table
Table word count Action Error flag
specification
1 ≤ N ≤ 64 Executed —
Not direct I/O N=0 Not executed —
N > 64 Execute with N=64 as limit —
Direct I/O ∗ Not executed ON
6F8C1226
10. Type Conversion 10-49

Program example:
(1) Normal execution
DINT_TO_ASCDEC TBL1 structure
SAMPLE1 TBL1 0 "1" (16#31) "-" (16#2D)
-1234 IN
LD ST 1 "3" (16#33) "2" (16#32)
SAMPLE2 2 CR(16#0D) "4" (16#34)
3 N
LD

• Content -1234 of conversion table SAMPLE1 is converted to ASCII (decimal) and the result is stored in a 3 words area
specified by SAMPLE2 starting from storage destination table TBL1. The number of characters 6 is stored in index register
XL.

(2) Abnormal execution


DINT_TO_ASCDEC TBL1 structure
SAMPLE1 TBL1 0 "1" (16#31) "4" (16#34)
-12345 IN
LD ST 1 * CR(16#0D)
SAMPLE2 2 * *
3 N Content of TBL1 is unchanged.
LD

• Because the content of conversion data SAMPLE1 cannot be converted to ASCII (decimal) and stored in 3 words area
specified by SAMPLE2 and starting with storage destination table TBL1 (4 words are required), the contents of storage
destination table TBL1 and index register XL are unchanged. Also, the special register Error Flag is set to ON.

Error information:
• If the conversion result cannot be stored in area of with number of words specified by N, the result is not updated and the
special register Error Flag is set to ON.
• If table size exceeds 64, it is limited to N=64.
• When direct I/O variable is specified as storage destination table, no operation is performed. Also, the special register Error
Flag is set to ON. (S controller only)
• When EN is used, ENO is reset to OFF when the above error occurs.
6F8C1226
10. Type Conversion 10-50

Type Conversion Double Integer-ASCII (Hexadecimal) Conversion

DINT_TO_ASCHEX
Conversion data IN Storage
Diagram destination table
Table size N

EN input Edge execution Index modification


Modifier
√ √ —

Arguments:
Arg. Operand Type Const. Description Remarks
IN DINT — Conversion data
Input
N UINT √ Table size 1 ≤ N ≤ 64
Output — PTR — Storage destination table

Function:
• Conversion data IN is converted to hexadecimal ASCII data and the result is output with end code CR appended at the end
of converted ASCII data. Also, the number of converted character codes is output to index register XL. (XL contains the
number of character codes including the end code CR.)
• Table size N is from 1 to 64. No operation is performed when N=0.
• The range of data to be converted is from -2147483648 to 2147483647.
• The data format of the storage destination table is as follows:
(1) 305419896 (2) –876543210
0 “2”(16#32) “1”(16#31) 0 “A”(16#41) “F”(16#46)
1 “4”(16#34) “3”(16#33) 1 “6”(16#36) “C”(16#43)
2 “6”(16#36) “5”(16#35) 2 “0”(16#30) “8”(16#38)
3 “8”(16#38) “7”(16#37) 3 “F”(16#46) “4”(16#34)
4 0 CR(16#0D) 4 0 CR(16#0D)
5 * * 5 * *

• I/O variable cannot be specified directly for storage destination table. (S controller only)
Table specification Table word count Action Error flag
1 ≤ N ≤ 64 Executed —
Not direct I/O N=0 Not executed —
N > 64 Execute with N=64 as limit —
Direct I/O ∗ Not executed ON
6F8C1226
10. Type Conversion 10-51

Program example:
(1) Normal execution
DINT_TO_ASCHEX TBL1 structure
SAMPLE1 TBL1 0 “1”(16#31) “5”(16#35)
332340 IN
LD ST 1 “3”(16#33) “2”(16#32)
SAMPLE2 2 CR(16#0D) “4”(16#34)
3 N
LD

• Content 332340 of conversion table SAMPLE1 is converted to ASCII (hexadecimal) and the result is stored in a 3 words
area specified by SAMPLE2 starting from storage destination table TBL1. The number of characters 6 is stored in index
register XL.

(2) Abnormal execution


DINT_TO_ASCHEX TBL1 structure
SAMPLE1 TBL1 0 “1”(16#31) "4”(16#34)
4660 IN
LD ST 1 * CR(16#0D)
SAMPLE2 2 * *
2 N Content of TBL1 is unchanged.
LD

• Because the content of conversion data SAMPLE1 cannot be converted to ASCII (hexadecimal) and stored in 2 words area
specified by SAMPLE2 and starting with storage destination table TBL1 (3 words are required), the contents of storage
destination table TBL1 and index register XL are unchanged. Also, the special register Error Flag is set to ON.

Error information:
• If the conversion result cannot be stored in area of with number of words specified by N, the result is not updated and the
special register Error Flag is set to ON.
• If table size exceeds 64, it is limited to N=64.
• When direct I/O variable is specified as storage destination table, no operation is performed. Also, the special register Error
Flag is set to ON. (S controller only)
• When EN is used, ENO is reset to OFF when the above error occurs.
6F8C1226
10. Type Conversion 10-52

Type Conversion Array-String Conversion

ARRAY_TO_STRING
Array data IN Storage
Diagram destination string
Table size N variable

EN input Edge execution Index modification


Modifier
√ √ —

Arguments:
Arg. Operand Type Const. Description Remarks
IN PTR — Array data
Input
N UINT √ Table size 1 ≤ N ≤ 129
Storage destination string
Output — STRING —
variable

Function:
• An N word shift JIS character code starting from input array data IN is output as STRING.
• The data to be converted is N words starting from IN and ends with CR code (16#0D).
• The table size N indicates the conversion size of the array data. No operation is performed when N=0.
• The range of table size N is from 1 to 129 (up to 256 bytes + CR code).
• The data formats of the conversion source and destination table are as follows:
(1)12345678 (2)–87654321
0 “2”(16#32) “1”(16#31) 0 “8”(16#38) “-”(16#2D) <Conversion source>
1 “4”(16#34) “3”(16#33) 1 “6”(16#36) “7”(16#37)
2 “6”(16#36) “5”(16#35) 2 “4”(16#34) “5”(16#35)
3 “8”(16#38) “7”(16#37) 3 “2”(16#32) “3”(16#33)
4 * CR(16#0D) 4 CR(16#0D) “1”(16#31)
5 * * 5 * *
N=5 N=5
<Conversion destination>
0 VAR length=6 0 VAR length=6 ←Character code storage area word count as STRING[12]
1 STRING length=8 1 STRING length=9 ←Number of bytes up to CR code
2 “2”(16#32) “1”(16#31) 2 “8”(16#38) “-”(16#2D)
Example:
3 “4”(16#34) “3”(16#33) 3 “6”(16#36) “7”(16#37) When character string is declared
4 “6”(16#36) “5”(16#35) 4 “4”(16#34) “5”(16#35) as follows:
Stored
5 “8”(16#38) “7”(16#37) 5 “2”(16#32) “3”(16#33) character codes Variable Data type Dec.
6 * * 6 * “1”(16#31) A STRING[12] VAR
7 * * 7 * *
• Direct I/O variable cannot be specified for input array and storage destination string. (S controller only)
Table
Table word count Action Error flag
specification
1 ≤ N ≤ 129 Executed —
Not direct I/O N=0 Not executed —
N > 129 Execute with N=129 as limit —
Direct I/O ∗ Not executed ON
6F8C1226
10. Type Conversion 10-53

Program example:

ARRAY_TO_STRING TBL1 structure


TBL1 SAMPLE2 0 "1" (16#31) "5" (16#35)
IN
1 "3" (16#33) "2" (16#32)
LD ST
2 CR (16#0D) "4" (16#34)
SAMPLE1
3 N 3 "7" (16#37) "6" (16#36)
LD

<Variable declaration> SAMPLE2 result


Variable Data type Dec. 0 VAR length=6
SAMPLE2 STRING[12] VAR 1 STRING length=5
2 "1" (16#31) "5" (16#35)
3 "3" (16#33) "2" (16#32)
4 "4" (16#34)
*
5 * *
6
* *
7 * *

• Starting with conversion source array data TBL1, 3 words array data specified by variable SAMPLE1 is stored in STRING
variable SAMPLE2. The data up to the end code CR in the conversion source are converted.

Error information:
• If the conversion source data cannot be stored in the storage destination STRING variable (INT((number of character codes
up to CR+1)/2) > VAR length), the result is unchanged.
• If there is no CR code in the N word array starting with the conversion source data, the result is unchanged. (Data format
error)
• If the array data contains invalid 2 byte character code, it is replaced with ?? in the result.
• If N > 129, the operation is limited to N=129.
• When direct I/O variable is specified as conversion source array and output string, no operation is performed. Also, the
special register Error Flag is set to ON. (S controller only)
• When EN is used, ENO is reset to OFF when the above error occurs.
6F8C1226
10. Type Conversion 10-54

Type Conversion String-Array Conversion

STRING_TO_ARRAY
Input string IN Storage
destination array
Diagram Converted L
characters
Start of converted P
characters

EN input Edge execution Index modification


Modifier
√ √ —

Arguments:
Arg. Operand Type Const. Description Remarks
IN STRING — Input string
Input L UINT √ Converted characters
P UINT √ Start of converted characters
Output — PTR — Storage 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:
(1) “12345678” (2) “–87654321” <Input string>
0 VAR length=6 0 VAR length=6 ←Character code storage area words as STRING[12]
1 STRING length=8 1 STRING length=9 ←Stored character bytes
2 “2”(16#32) “1”(16#31) 2 “8”(16#38) “-”(16#2D)
Example:
3 “4”(16#34) “3”(16#33) 3 “6”(16#36) “7”(16#37)
When string variable is declared as
4 “6”(16#36) “5”(16#35) 4 “4”(16#34) “5”(16#35) follows:
Stored
5 “8”(16#38) “7”(16#37) 5 “2”(16#32) “3”(16#33) Variable Data type Dec.
character code
6 * * 6 * “1”(16#31) A STRING[12] VAR
7 * * 7 * *
When L=4,P=2 When L=5,P=3

0 “3”(16#33) “2”(16#32) 0 “6”(16#36) “7”(16#37) <Store destination array>


1 “5”(16#35) “4”(16#34) 1 “4”(16#34) “5”(16#35)
2 * CR(16#0D) 2 CR(16#0D) “3”(16#33)
3 * * 3 * *
4 * * 4 * *
5 * * 5 * *

• Direct I/O variable cannot be specified for input string and storage destination array. (S controller only)
6F8C1226
10. Type Conversion 10-55

Program example:
STRING_TO_ARRAY SAMPLE1 structure
SAMPLE1 TBL1 0 VAR length=6
IN 1 STRING length=5
LD ST
2 "1" (16#31) "5" (16#35)
SAMPLE2
3 "3" (16#33) "2" (16#32)
3 L
LD 4 * "4" (16#34)
SAMPLE3 5 * *
2 P 6 * *
LD 7 * *

<Variable declaration> TBL1 result


Variable Data type Dec. 0 "2" (16#32) "1" (16#31)
A STRING[12] VAR 1 CR (16#0D) "3" (16#33)
2 * *
3 * *

• In the conversion source input string SAMPLE1, 3 characters specified by variable SAMPLE2 from conversion character
start position 2 specified by variable SAMPLE3 are output to storage destination array TBL1 with end code CR appended.

Error information:
• 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.
• When direct I/O variable is specified as input string and storage destination table, no operation is performed. Also, the
special register Error Flag is set to ON. (S controller only)
• When EN is used, ENO is reset to OFF when the above error occurs.
6F8C1226
10. Type Conversion 10-56

Tag Number Conversion

Type Conversion Tag Number Conversion


LD/FBD language
notation TO_INDEX
Tag variable TAG Tag number

Tag type TYPE

Modifier EN input Edge execution Index modification


√ √ -
ST language notation Tag number := TO_INDEX (TAG, TYPE);

Arguments:

Arg. Operand Type Const. Description Remarks


Tag variable
TAG PTR -
(parameter)
Input
0:PV, 1:LP,
TYPE UINT √ Tag type
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).
• I/O variable cannot be specified directly for 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 processing using tags is made common (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).
6F8C1226
10. Type Conversion 10-57

Program example:
[LD/FBD language notation]

User FB(TAG_FB) caller User FB(TAG_FB)


Variable Data type Value Dic. Type Variable Data type Value Dic.
PV1 REAL 0 VAR TAG PTR VAR_INPUT
PV2 REAL 0 VAR OUT REAL VAR_OUTPUT
TAG_FB_1 TAG_FB VAR
TAG_FB_2 TAG_FB VAR
TAG{INT}[0] TO_INDEX XI 0 at IND01,
TAG_FB_1 TAG 1 at IND02
LD ST
IND01.TAG TAG_FB PV1
TAG OUT 12 0
LD ST 24.0 at IND01,
TYPE
LD 24.0 at IND02
TAG_FB_2
IND02.TAG TAG_FB PV2 PV_DATA[XI]. PCT OUT
TAG OUT 62 PV IN
LD ST LD ST
PV_PARA[XI].
RH PV_RH 12.0 at IND01,
IND01.TAG indicates PV_PARA[0] LD 62.0 at IND02
IND02.TAG indicates PV_PARA[1]

IND01.RH=200.0 IND01.RL=0.0 IND01.PV=24.0


IND02.RH=100.0 IND02.RL=-100.0 IND02.PV=24.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".
• When I/O variable is specified directly for tag variable, the operation is as follows.

Controller Action
Integrated
S controller Table operation error flag is set to ON, and Result = -1.
Controller V series
Unified Controller nv series Error flag and table operation error flag are set to ON, and Result = -1.

• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
11. Numeric Function 11-1

11 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
6F8C1226
11. Numeric Function 11-2

Numeric Function Square Root

SQRT
Diagram Input Output

EN input Edge execution Index modification


Modifier
√ √ —

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.

Output = (sign of input) * squire root ( | input | )

Program example:
SAMPLE1 SQRT SAMPLE2
3.0 1.732051
LD ST

• The square root of the input data 3 in SAMPLE1 is obtained and the result 1.732051 is stored in SAMPLE2.

Error information:
• If NAN data is entered as input, the result is NAN.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
11. Numeric Function 11-3

Numeric Function Exponential

EXP
Diagram Input Output

EN input Edge execution Index modification


Modifier
√ √ —

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.

Output = exponential ( input )


Result output
3.40282E+38

1
Input data
0 88.7228

Program example:
SAMPLE1 EXP SAMPLE2
3.0 20.08553
LD ST

• The exponential of the input data 3 in SAMPLE1 is obtained and the result 20.08553 is stored in SAMPLE2.

Error information:
• If NAN data is entered as input, the result is NAN.
• If the operation result overflows, the result is infinity.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
11. Numeric Function 11-4

Numeric Function Common Logarithms

LOG
Diagram Input Output

EN input Edge execution Index modification


Modifier
√ √ —

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


Result output
38.53184

Input data
-3.40282E+38 3.40282E+38
0

Program example:
SAMPLE1 LOG SAMPLE2
3.0 0.4771213
LD ST

• The common logarithm of the input data 3 in SAMPLE1 is obtained and the result 0.4771213 is stored in SAMPLE2.

Error information:
• If NAN data is entered as input, the result is NAN.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
11. Numeric Function 11-5

Numeric Function Natural Logarithms

LN
Diagram Input Output

EN input Edge execution Index modification


Modifier
√ √ —

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.

Output = ln ( | input | )
Result output
88.7228

Input data
-3.40282E+38 3.40282E+38
0

Program example:
SAMPLE1 LN SAMPLE2
3.0 1.098612
LD ST

• The natural logarithm of the input data 3 in SAMPLE1 is obtained and the result 1.098612 is stored in SAMPLE2.

Error information:
• If NAN data is entered as input, the result is NAN.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
11. Numeric Function 11-6

Numeric Function Absolute Value

ABS_xxx
Diagram Input Output

EN input Edge execution Index modification


Modifier
√ √ —

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
See below
Output — — Output

ABS_xxx
Input Output

Input Symbol (_xxx) 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

Program example:
SAMPLE1 ABS_INT SAMPLE2
-1234 1234
LD ST

• The absolute value of the input data -1234 in SAMPLE1 is obtained and the result 1234 is stored in SAMPLE2.

Error information:
• When data type is REAL, if NAN data is entered as input, the result is NAN.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
11. Numeric Function 11-7

Numeric Function Sine

SIN
Diagram Input Output

EN input Edge execution Index modification


Modifier
√ √ —

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 )


Result output
1.0

Input data
-4π -3π -2π -π 0 π 2π 3π 4π

-1.0

Program example:
SAMPLE1 SIN SAMPLE2
1.47198 0.8660254
LD ST

• The sine of the input data 1.47198 in SAMPLE1 is obtained and the result 0.8660254 is stored in SAMPLE2.

Error information:
• If NAN data is entered as input, the result is NAN.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
11. Numeric Function 11-8

Numeric Function Cosine

COS
Diagram Input Output

EN input Edge execution Index modification


Modifier
√ √ —

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 )


Result output
1.0

Input data
0
-4π -3π -2π -π π 2π 3π 4π

-1.0

Program example:
SAMPLE1 COS SAMPLE2
1.047198 0.5
LD ST

• The cosine of the input data 1.047198 in SAMPLE1 is obtained and the result 0.5 is stored in SAMPLE2.

Error information:
• If NAN data is entered as input, the result is NAN.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
11. Numeric Function 11-9

Numeric Function Tangent

TAN
Diagram Input Output

EN input Edge execution Index modification


Modifier
√ √ —

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

Output = tan ( Input )


Result output
+Infinity

Input data
-4π -3π -2π -π 0 π 2π 3π 4π

-Infinity

Program example:
SAMPLE1 TAN SAMPLE2
1.047198 1.732051
LD ST

• The tangent of the input data 1.047198 in SAMPLE1 is obtained and the result 1.732051 is stored in SAMPLE2.

Error information:
• If NAN data is entered as input, the result is NAN.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
11. Numeric Function 11-10

Numeric Function Arcsine

ASIN
Diagram Input Output

EN input Edge execution Index modification


Modifier
√ √ —

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 )


Result output
2.0

1.0
-0.5
Input data
-2.0 -1.5 -1.0 0 0.5 1.0 1.5 2.0
-1.0

-2.0

Program example:
SAMPLE1 ASIN SAMPLE2
0.5 0.5235988
LD ST

• The arcsine of the input data 0.5 in SAMPLE1 is obtained and the result 0.5235988 is stored in SAMPLE2.

Error information:
• If NAN data is entered as input, the result is NAN.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
11. Numeric Function 11-11

Numeric Function Arccosine

ACOS
Diagram Input Output

EN input Edge execution Index modification


Modifier
√ √ —

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 )


Result output
4.0

3.0

2.0

1.0

Input data
-2.0 -1.5 -1.0 -0.5 0 0.5 1.0 1.5 2.0

Program example:
SAMPLE1 ACOS SAMPLE2
0.5 1.047198
LD ST

• The arccosine of the input data 0.5 in SAMPLE1 is obtained and the result 1.047198 is stored in SAMPLE2.

Error information:
• If NAN data is entered as input, the result is NAN.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
11. Numeric Function 11-12

Numeric Function Arctangent

ATAN
Diagram Input Output

EN input Edge execution Index modification


Modifier
√ √ —

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 )


Result output
2.0

1.0

Input data
0

-1.0

-2.0

Program example:
SAMPLE1 ATAN SAMPLE2
0.5 0.4636476
LD ST

• The arctangent of the input data 0.5 in SAMPLE1 is obtained and the result 0.4636476 is stored in SAMPLE2.

Error information:
• If NAN data is entered as input, the result is NAN.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
12. Logical Operation 12-1

12 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
6F8C1226
12. Logical Operation 12-2

Logical Operation Bitwise Boolean AND

Input 1 AND_xxx Output


Input 2
Diagram

Input n

EN input Edge execution Index modification


Modifier
√ √ —

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 1…n 2 ≤ n ≤ 15
See below
Output — — Output

Input 1 AND_xxx Output


Input 2

Input n

Input 1…n Symbol (_xxx) 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.

Program example:
SAMPLE1 AND_WORD SAMPLE5
16#79AF 16#1084 15 0
LD ST SAMPLE1 0 1 1 1 1 0 0 1 1 0 1 0 1 1 1 1
SAMPLE2
16#9584 SAMPLE2 1 0 0 1 0 1 0 1 1 0 0 0 0 1 0 0
LD SAMPLE3 0 0 0 1 0 0 1 1 1 1 1 0 0 1 1 0
SAMPLE3
16#13E6 SAMPLE4 1 1 1 1 0 0 1 0 1 1 1 0 0 1 1 1
LD
SAMPLE5 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0
SAMPLE4
16#F2E7
LD

• The Bitwise Boolean AND of input data in SAMPLE1 to SAMPLE4 is obtained and the result 16#1084 is stored in SAMPLE5.
6F8C1226
12. Logical Operation 12-3

Logical Operation Bitwise Boolean AND of Table Data

TAND
Input table 1 TBL1 Output table

Diagram Input table 2 TBL2

Table word number N

EN input Edge execution Index modification


Modifier
√ √ —

Arguments:
Arg. Operand Type Const. Description Remarks
TBL1 PTR — Input table 1
Input TBL2 PTR — Input table 2
N UINT √ Table word number 1 ≤ N ≤ 64
Output — PTR — Output table

Function:
• The Bitwise Boolean AND of N word data starting from Input table 1 and Input table 2 is obtained and the result is stored in
the specified output table.
• Table word number N must be between 1 and 64.
• If table word number N is 0, no operation is performed.
• Direct I/O variable cannot be specified for input table or output table.
Table
Table word number Action Error flag
specification
1 ≤ N ≤ 64 Executed —
Not direct I/O N=0 Not executed —
N > 64 Execute with N=64 as limit —
Direct I/O * Not executed ON

Program example:
TABLE1 TAND TABLE3 TABLE1 TABLE2 TABLE3
TBL1
LD ST 0 16#F035 0 16#236B 0 16#2021
TABLE2 1 16#00FF 1 16#AAAA 1 16#00AA
TBL2 2 16#5555 2 16#0F0F 2 16#0505
LD
3
N
LD

• The Bitwise Boolean AND of 3 words data starting from input tables TABLE1 and TABLE2 is obtained and the result is
stored in output table TABLE3.

Error information:
• If N exceeds 64, it is limited to N=64.
• If there is an area error due to index modification, no operation is performed.
• If direct I/O variables are specified for input table and output table, no operation is performed and Error Flag is set to ON.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
12. Logical Operation 12-4

Logical Operation Bitwise Boolean OR

Input 1 OR_xxx Output


Input 2
Diagram

Input n

EN input Edge execution Index modification


Modifier
√ √ —

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 1…n 2 ≤ n ≤ 15
See below
Output — — Output

Input 1 OR_xxx Output


Input 2

Input n

Input 1…n Symbol (_xxx) Output


BOOL OR_BOOL BOOL
WORD OR_WORD WORD
DWORD OR_DWORD DWORD

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.

Program example:
SAMPLE1 OR_WORD SAMPLE5
16#1234 16#BF77 15 0
LD ST SAMPLE1 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0
SAMPLE2
16#9876 SAMPLE2 1 0 0 1 1 0 0 0 0 1 1 1 0 1 1 0
LD SAMPLE3 0 0 1 0 0 0 1 1 0 1 0 0 0 1 0 1
SAMPLE3
16#2345 SAMPLE4 1 0 0 0 0 1 1 1 0 1 1 0 0 1 0 1
LD
SAMPLE5 1 0 1 1 1 1 1 1 0 1 1 1 0 1 1 1
SAMPLE4
16#8765
LD

• The Bitwise Boolean OR of input data in SAMPLE1 to SAMPLE4 is obtained and the result 16#BF77 is stored in SAMPLE5.
6F8C1226
12. Logical Operation 12-5

Logical Operation Bitwise Boolean OR of Table Data

TOR
Input table 1 TBL1 Output table

Diagram Input table 2 TBL2

Table word number N

EN input Edge execution Index modification


Modifier
√ √ —

Arguments:
Arg. Operand Type Const. Description Remarks
TBL1 PTR — Input table 1
Input TBL2 PTR — Input table 2
N UINT √ Table word number 1 ≤ N ≤ 64
Output — PTR — Output table

Function:
• The Bitwise Boolean OR of N word data starting from Input table 1 and Input table 2 is obtained and the result is stored in the
specified output table.
• Table word number N must be between 1 and 64.
• If table word number N is 0, no operation is performed.
• Direct I/O variable cannot be specified for input table or output table.
Table
Table word number Action Error flag
specification
1 ≤ N ≤ 64 Executed —
Not direct I/O N=0 Not executed —
N > 64 Execute with N=64 as limit —
Direct I/O * Not executed ON

Program example:
TABLE1 TOR TABLE3 TABLE1 TABLE2 TABLE3
TBL1
LD ST 0 16#F035 + 0 16#236B 0 16#F37F
TABLE2 1 16#00FF + 1 16#AAAA 1 16#AAFF
TBL2 2 16#5555 + 2 16#0F0F 2 16#5F5F
LD
3
N
LD

• 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:
• If N exceeds 64, it is limited to N=64.
• If there is an area error due to index modification, no operation is performed.
• If direct I/O variables are specified for input table and output table, no operation is performed and Error Flag is set to ON.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
12. Logical Operation 12-6

Logical Operation Bitwise Boolean NOT

NOT_xxx
Diagram Input Output

EN input Edge execution Index modification


Modifier
√ √ —

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
See below
Output — — Output

Input NOT_xxx Output

Input Symbol (_xxx) Output


BOOL NOT_BOOL BOOL
WORD NOT_WORD WORD
DWORD NOT_DWORD DWORD

Function:
• The Bitwise Boolean NOT of input data is obtained and the result is output.

Program example:
SAMPLE1 NOT_WORD SAMPLE2
16#1234 16#EDCB
LD ST

• The Bitwise Boolean NOT of input data 16#1234 in SAMPLE1 is obtained and the result 16#EDCB is stored in SAMPLE2.
6F8C1226
12. Logical Operation 12-7

Logical Operation Bitwise Boolean NOT of Table Data

TNOT
Input table TBL Output table
Diagram
Table word number N

EN input Edge execution Index modification


Modifier
√ √ —

Arguments:
Arg. Operand Type Const. Description Remarks
TBL PTR — Input table
Input
N UINT √ Table word number 1 ≤ N ≤ 1024
Output — PTR — Output table

Function:
• The Bitwise Boolean NOT of N word data starting from the input table is obtained and the result is stored in the specified
output table.
• Table word number N must be between 1 and 1024.
• If table word number N is 0, no operation is performed.
• Direct I/O variable cannot be specified for input table or output table.
Table
Table word number Action Error flag
specification
1 ≤ N ≤ 1024 Executed —
Not direct I/O N=0 Not executed —
N > 1024 Executed with N=1024 as limit —
Direct I/O * Not executed ON

Program example:
TABLE1 TNOT TABLE2 TABLE1 TABLE2
TBL
LD ST 0 16#F035 0 16#0FCA
3 1 16#00FF 1 16#FF00
N 2 16#5555 2 16#AAAA
LD

• The Bitwise Boolean NOT of 3 words data starting from input table TABLE1 is obtained and the result is stored in output
table TABLE2.

Error information:
• If N exceeds 1024, it is limited to N=1024.
• If there is an area error due to index modification, no operation is performed.
• If direct I/O variables are specified for input table and output table, no operation is performed and Error Flag is set to ON.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
12. Logical Operation 12-8

Logical Operation Bitwise Boolean XOR

Input 1 XOR_xxx Output


Input 2
Diagram

Input n

EN input Edge execution Index modification


Modifier
√ √ —

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 1…n 2 ≤ n ≤ 15
See below
Output — — Output

Input 1 XOR_xxx Output


Input 2

Input n

Input 1…n Symbol (_xxx) Output


BOOL XOR_BOOL BOOL
WORD XOR_WORD WORD
DWORD XOR_DWORD DWORD

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.

Program example:
SAMPLE1 XOR_WORD SAMPLE5
16#1234 16#2E62 15 0
LD ST SAMPLE1 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0
SAMPLE2
16#9876 SAMPLE2 1 0 0 1 1 0 0 0 0 1 1 1 0 1 1 0
LD SAMPLE3 0 0 1 0 0 0 1 1 0 1 0 0 0 1 0 1
SAMPLE3
16#2345 SAMPLE4 1 0 0 0 0 1 1 1 0 1 1 0 0 1 0 1
LD
SAMPLE5 0 0 1 0 1 1 1 0 0 1 1 0 0 0 1 0
SAMPLE4
16#8765
LD

• The Bitwise Boolean XOR of input data in SAMPLE1 to SAMPLE4 is obtained and the result 16#2E62 is stored in
SAMPLE5.
6F8C1226
12. Logical Operation 12-9

Logical Operation Bitwise Boolean XOR of Table Data


TXOR
Input table 1 TBL1 Output table

Diagram Input table 2 TBL2

Table word number N

EN input Edge execution Index modification


Modifier
√ √ —

Arguments:
Arg. Operand Type Const. Description Remarks
TBL1 PTR — Input table 1
Input TBL2 PTR — Input table 2
N UINT √ Table word number 1 ≤ N ≤ 64
Output — PTR — Output table

Function:
• The Bitwise Boolean XOR of N word data starting from Input table 1 and Input table 2 is obtained and the result is stored in
the specified output table.
• Table word number N must be between 1 and 64.
• If table word number N is 0, no operation is performed.
• Direct I/O variable cannot be specified for input table or output table.
Table
Table word number Action Error flag
specification
1 ≤ N ≤ 64 Executed —
Not direct I/O N=0 Not executed —
N > 64 Execute with N=64 as limit —
Direct I/O * Not executed ON

Program example:
TABLE1 TXOR TABLE3 TABLE1 TABLE2 TABLE3
TBL1
LD ST 0 16#F035 ⊕ 0 16#236B 0 16#D35E
TABLE2 1 16#00FF ⊕ 1 16#AAAA 1 16#AA55
TBL2 2 16#5555 ⊕ 2 16#0F0F 2 16#5A5A
LD
3
N
LD

• 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:
• If N exceeds 64, it is limited to N=64.
• If there is an area error due to index modification, no operation is performed.
• If direct I/O variables are specified for input table and output table, no operation is performed and Error Flag is set to ON.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
12. Logical Operation 12-10

Logical Operation Bitwise Boolean NOT XOR of Table Data

TXNR
Input table 1 TBL1 Output table

Diagram Input table 2 TBL2

Table word number N

EN input Edge execution Index modification


Modifier
√ √ —

Arguments:
Arg. Operand Type Const. Description Remarks
TBL1 PTR — Input table 1
Input TBL2 PTR — Input table 2
N UINT √ Table word number 1 ≤ N ≤ 64
Output — PTR — Output table

Function:
• The Bitwise Boolean NOT XOR of N word data starting from Input table 1 and Input table 2 is obtained and the result is
stored in the specified output table.
• Table word number N must be between 1 and 64.
• If table word number N is 0, no operation is performed.
• Direct I/O variable cannot be specified for input table or output table.
Table
Table word number Action Error flag
specification
1 ≤ N ≤ 64 Executed —
Not direct I/O N=0 Not executed —
N > 64 Execute with N=64 as limit —
Direct I/O * Not executed ON

Program example:
TABLE1 TXNR TABLE3 TABLE1 TABLE2 TABLE3
TBL1
LD ST 0 16#F035 ⊕ 0 16#236B 0 16#2CA1
TABLE2 1 16#00FF ⊕ 1 16#AAAA 1 16#55AA
TBL2 2 16#5555 ⊕ 2 16#0F0F 2 16#A5A5
LD
3
N
LD

• 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:
• If N exceeds 64, it is limited to N=64.
• If there is an area error due to index modification, no operation is performed.
• If direct I/O variables are specified for input table and output table, no operation is performed and Error Flag is set to ON.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
12. Logical Operation 12-11

Logical Operation Test

Input 1 TEST_xxx Output


Diagram
Input 2

EN input Edge execution Index modification


Modifier
√ √ —

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 1,2 Input number=2
See below
Output — — Output

Input 1 TEST_xxx Output

Input 2

Input 1,2 Symbol (_xxx) Output


WORD TEST_WORD
BOOL
DWORD TEST_DWORD

Function:
• The Bitwise Boolean AND of input data Input 1 and Input 2 is obtained and OFF is output if the result is 0 and ON is output if
otherwise.
• Input 1 and Input 2 must have the same data type.

Program example:
SAMPLE1 TEST_WORD SIGNAL1
16#1234 1
LD ST
SAMPLE2
16#98C3
LD

• Input data SAMPLE1 and SAMPLE2 are tested and the result ON is output to SIGNAL1.
6F8C1226
13. Bit Operation 13-1

13 Bit Operation

No. Instruction Remarks


1 Shift Bits Right SHR
2 Shift Bits Left SHL
3 Rotate Bits Right ROR
4 Rotate Bits Left ROL
SFA_WORD_P
5 Arithmetic Shift PCS
SFA_DWORD_P
SFL_WORD_P
6 Logical Shift PCS
SFL_DWORD_P
6F8C1226
13. Bit Operation 13-2

Bit Operation Shift Bits Right

SHR_xxx
Input IN Output
Diagram
Shift number N

EN input Edge execution Index modification


Modifier
√ √ —

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

SHR_xxx
Input IN Output

Shift number N

Input Symbol (_xxx) Output


WORD SHR_WORD WORD
DWORD SHR_DWORD DWORD

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)

Program example:
SAMPLE1 SHR_WORD SAMPLE3 F E D C B A 9 8 7 6 5 4 3 2 1 0
16#9876 IN 16#261D SAMPLE1
LD 1 0 0 1 1 0 0 0 0 1 1 1 0 1 1 0
ST
SAMPLE2
18 N
LD F E D C B A 9 8 7 6 5 4 3 2 1 0 CF
SAMPLE3
0 0 1 0 0 1 1 0 0 0 0 1 1 1 0 1 1

0 is entered.

• Right shifts the input data 16#9876 in SAMPLE1 by shift number (=MOD(18/16)) specified by variable SAMPLE2 and stores
the result 16#261D in SAMPLE3. The bit data ON shifted out last is stored in specific register Carry Flag.
6F8C1226
13. Bit Operation 13-3

Bit Operation Shift Bits Left

SHL_xxx
Input IN Output
Diagram
Shift number N

EN input Edge execution Index modification


Modifier
√ √ —

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

SHL_xxx
Input IN Output

Shift number N

Input Symbol (_xxx) Output


WORD SHL_WORD WORD
DWORD SHL_DWORD DWORD

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)

Program example:
SAMPLE1 SHL_WORD SAMPLE3 F E D C B A 9 8 7 6 5 4 3 2 1 0
16#9876 IN 16#61D8 SAMPLE1
LD 1 0 0 1 1 0 0 0 0 1 1 1 0 1 1 0
ST
SAMPLE2
18 N
LD CF F E D C B A 9 8 7 6 5 4 3 2 1 0
SAMPLE3
0 0 1 1 0 0 0 0 1 1 1 0 1 1 0 0 0

0 is entered.

• Left shifts the input data 16#9876 in SAMPLE1 by shift number (=MOD(18/16)) specified by variable SAMPLE2 and stores
the shift result 16#61D8 in SAMPLE3. The last shifted bit OFF is stored in specific register Carry Flag.
6F8C1226
13. Bit Operation 13-4

Bit Operation Rotate Bits Right

ROR_xxx
Input IN Output
Diagram
Rotate number N

EN input Edge execution Index modification


Modifier
√ √ —

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

ROR_xxx
Input IN Output

Rotate number N

Input Symbol (_xxx) Output


WORD ROR_WORD WORD
DWORD ROR_DWORD DWORD

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)

Program example:
SAMPLE1 ROR_WORD SAMPLE3
16#9876 IN 16#A61D F E D C B A 9 8 7 6 5 4 3 2 1 0 CF
LD SAMPLE1
ST 1 0 0 1 1 0 0 0 0 1 1 1 0 1 1 0 ∗
SAMPLE2
18 N
LD
F E D C B A 9 8 7 6 5 4 3 2 1 0 CF
SAMPLE3
1 0 1 0 0 1 1 0 0 0 0 1 1 1 0 1 1

• 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 ON rotated from the least significant bit is stored in specific register
Carry Flag.
6F8C1226
13. Bit Operation 13-5

Bit Operation Rotate Bits Left

ROL_xxx
Input IN Output
Diagram
Rotate number N

EN input Edge execution Index modification


Modifier
√ √ —

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

ROL_xxx
Input IN Output

Rotate number N

Input Symbol (_xxx) Output


WORD ROL_WORD WORD
DWORD ROL_DWORD DWORD

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)

Program example:
SAMPLE1 ROL_WORD SAMPLE3
16#9876 IN 16#61DA CF F E D C B A 9 8 7 6 5 4 3 2 1 0
LD SAMPLE1
ST ∗ 1 0 0 1 1 0 0 0 0 1 1 1 0 1 1 0
SAMPLE2
18 N
LD
CF F E D C B A 9 8 7 6 5 4 3 2 1 0
SAMPLE3
0 0 1 1 0 0 0 0 1 1 1 0 1 1 0 1 0

• Left rotates the input data 16#9876 in SAMPLE1 by rotate number (=MOD(18/16)) specified by SAMPLE2 and stores the
rotated result 16#61DA in SAMPLE3. The last bit data ON rotated from the least significant bit is stored in specific register
Carry Flag.
6F8C1226
13. Bit Operation 13-6

Bit Operation Arithmetic Shift PCS

SFA_xxx_P
Input IN Output
Diagram
Shift number N

EN input Edge execution Index modification


Modifier
√ √ —

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

SFA_xxx_P
Input IN Output

Shift number N

Input Symbol (_xxx) Output


WORD SFA_WORD_P WORD
DWORD SFA_DWORD_P DWORD

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.
• Shift number N specifies the shift number and shift direction. No shift is performed if shift number=0.
Symbol Shift number Shift direction
SFA_WORD_P MOD(N/16) N < 0: Left
SFA_DWORD_P MOD(N/32) N > 0: Right
6F8C1226
13. Bit Operation 13-7

Program example:
(1) Shift right
F E D C B A 9 8 7 6 5 4 3 2 1 0
SAMPLE1
SAMPLE1 SFA_WORD_P SAMPLE3 1 0 0 1 1 0 0 0 0 1 1 1 0 1 1 0
16#9876 IN 16#E61D
LD ST
SAMPLE2 F E D C B A 9 8 7 6 5 4 3 2 1 0
N SAMPLE3
18 1 1 1 0 0 1 1 0 0 0 0 1 1 1 0 1
LD

Fixed State of most significant bit is entered.


• Arithmetic shifts right input data 16#9876 in SAMPLE1 by shift number (=MOD(18/16)) specified by SAMPLE2 and stores
the shift result 16#E61D in SAMPLE3.

(2) Shift left


F E D C B A 9 8 7 6 5 4 3 2 1 0
SAMPLE1
SAMPLE1 SFA_WORD_P SAMPLE3 1 0 0 1 1 0 0 0 0 1 1 1 0 1 1 0
16#9876 IN 16#E1D8
LD ST
SAMPLE2 F E D C B A 9 8 7 6 5 4 3 2 1 0
N SAMPLE3
-18 1 1 1 0 0 0 0 1 1 1 0 1 1 0 0 0
LD

Fixed 0 is entered.
• Arithmetic left shifts input data 16#9876 in SAMPLE1 by shift number (=MOD(18/16)) specified by SAMPLE2 and stores the
shift result 16#E1D8 in SAMPLE3.
6F8C1226
13. Bit Operation 13-8

Bit Operation Logical Shift PCS

SFL_xxx_P
Input IN Output
Diagram
Shift number N

EN input Edge execution Index modification


Modifier
√ √ —

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

SFL_xxx_P
Input IN Output

Shift number N

Input Symbol (_xxx) Output


WORD SFL_WORD_P WORD
DWORD SFL_DWORD_P DWORD

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) N < 0: Left
SFL_DWORD_P MOD(N/32) N > 0: Right
6F8C1226
13. Bit Operation 13-9

Program example:
(1) Shift right
F E D C B A 9 8 7 6 5 4 3 2 1 0
SAMPLE1
SAMPLE1 SFL_WORD_P SAMPLE3 1 0 0 1 1 0 0 0 0 1 1 1 0 1 1 0
16#9876 IN 16#261D
LD ST
SAMPLE2 F E D C B A 9 8 7 6 5 4 3 2 1 0
18 SAMPLE3
N 0 0 1 0 0 1 1 0 0 0 0 1 1 1 0 1
LD
0 is entered.
• Logical shifts right input data 16#9876 in SAMPLE1 by shift number (=MOD(18/16)) specified by SAMPLE2 and stores the
shift result 16#261D in SAMPLE3.

(2) Shift left


F E D C B A 9 8 7 6 5 4 3 2 1 0
SAMPLE1
SFL_WORD_P 1 0 0 1 1 0 0 0 0 1 1 1 0 1 1 0
SAMPLE1 SAMPLE3
16#9876 IN 16#61D8
LD ST
F E D C B A 9 8 7 6 5 4 3 2 1 0
SAMPLE2 SAMPLE3
-18 N 0 1 1 0 0 0 0 1 1 1 0 1 1 0 0 0
LD
0 is entered.
• Logical shifts left input data 16#9876 in SAMPLE1 by shift number (=MOD(18/16)) specified by SAMPLE2 and stores the
shift result 16#61D8 in SAMPLE3.
6F8C1226
14. Arithmetic Operation 14-1

14 Arithmetic Operation

No. Instruction Remarks


1 Add ADD
2 Add with Carry ADC
3 Subtract SUB
4 Subtract with Carry SBB
5 Multiply MUL
6 Divide DIV
7 Remainder MOD
8 Increment INC
9 Decrement DEC
10 Power EXPT
11 Add Time Data ADD
12 Subtract Time Data SUB
13 Multiply Time Data MUL
14 Divide Time Data DIV
6F8C1226
14. Arithmetic Operation 14-2

Arithmetic Operation Add

Input 1 ADD_xxx Output


Input 2
Diagram

Input n

EN input Edge execution Index modification


Modifier
√ √ —

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 1…n 2 ≤ n ≤ 15
See below
Output — — Output

Input 1 ADD_xxx Output


Input 2

Input n

Input 1…n Symbol (_xxx) Output


INT ADD_INT INT
DINT ADD_DINT DINT
UINT ADD_UINT UINT
REAL ADD_REAL REAL

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.
6F8C1226
14. Arithmetic Operation 14-3

Program example:
SAMPLE1 ADD_INT SAMPLE5
12765 -1000
LD ST
SAMPLE2
-32653
LD
SAMPLE3
7654
LD
SAMPLE4
11234
LD

 The input data in SAMPLE1 to SAMPLE4 are added and the result -1000 is stored in SAMPLE5.

Error information:
 If an overflow occurs, the limit value is output as result.
 When input data type is REAL, if NAN data is entered as input, the result is NAN.
 When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
14. Arithmetic Operation 14-4

Arithmetic Operation Add with Carry

Input 1 ADC_xxx Output


Diagram
Input 2

EN input Edge execution Index modification


Modifier
√ √ —

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 1,2
See below
Output — — Output

Input 1 ADC_xxx Output

Input 2

Input 1, 2 Symbol (_xxx) Output


INT ADC_INT INT
DINT ADC_DINT DINT

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 ON
When there is no carry from most significant bit (no carry out) : Carry Flag is reset to OFF
 When EN is used, ENO output is set as follows:
Carry from most significant bit (carry out) or
Carry from most significant bit-1 to most significant bit: ENO output is reset to OFF
 Input 1 and input 2 must have the same data type.
Output=Input 1+Input 2+Carry Flag
6F8C1226
14. Arithmetic Operation 14-5

Program example:
(1) When there is no carry out (CF), or overflow (OV) and input Carry Flag (input CF)=OFF
SAMPLE1 ADC_INT SAMPLE3 SAMPLE1 0 0 0 1 1 1 1 0 1 0 1 1 0 0 0 0 7856
7856 10573
LD ST SAMPLE2 0 0 0 0 1 0 1 0 1 0 0 1 1 1 0 1 2717
SAMPLE2
2717 +) Input CF 0
LD SAMPLE3 0 0 1 0 1 0 0 1 0 1 0 0 1 1 0 1 10573

CF 0
OV 0

 The input data 7856 in SAMPLE1 and 2717 in SAMPLE2 are added with carry and the result 10573 is stored in SAMPLE3.
Also, the specific register Carry Flag is reset to OFF.

(2) When there is carry out (CF) and overflow (OV), and input Carry Flag (input CF)=OFF
SAMPLE1 ADC_INT SAMPLE3 SAMPLE1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -32768
-32768 22768
LD ST SAMPLE2 1 1 0 1 1 0 0 0 1 1 1 1 0 0 0 0 -10000
SAMPLE2
-10000 +) Input CF 0
LD SAMPLE3 0 1 0 1 1 0 0 0 1 1 1 1 0 0 0 0 22768

CF 1
OV 0

 The input data -32768 in SAMPLE1 and -10000 in SAMPLE2 are added with carry and the result 22768 is stored in
SAMPLE3. Also, the specific register Carry Flag is set to ON.

Error information:
 When EN is used, ENO output is reset to OFF if overflow or carry occurs.
6F8C1226
14. Arithmetic Operation 14-6

Arithmetic Operation Subtract

Input 1 SUB_xxx output


Diagram
Input 2

EN input Edge execution Index modification


Modifier
√ √ —

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 √ Input 1,2
Output — below — Output

Input 1 SUB_xxx Output


Input 2

Input 1,2 Symbol (_xxx) Output


INT SUB_INT INT
DINT SUB_DINT DINT
UINT SUB_UINT UINT
REAL SUB_REAL REAL

Function:
 Input data Input 2 is subtracted from Input 1 and the result is output.
 Input 1 and input 2 must have the same data type.
Output=Input 1-Input 2

Important:
 With SUB_REAL, if the absolute value of subtrahend and minuend differ significantly (difference in exponent  24), the result
is the value of the data with larger absolute value.

Program example:
SAMPLE1 SUB_INT SAMPLE3
4378 2033
LD ST
SAMPLE2
2345
LD

 The input data in SAMPLE2 is subtracted from SAMPLE1 and the result 2033 is stored in SAMPLE3.

Error information:
 If an overflow occurs, the limit value is output as result.
 When input data type is REAL, if NAN data is entered as input, the result is NAN.
 When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
14. Arithmetic Operation 14-7

Arithmetic Operation Subtract with Carry

Input 1 SBB_xxx Output


Diagram
Input 2

EN input Edge execution Index modification


Modifier
√ √ —

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 √ Input 1, 2
Output — below — Output

Input 1 SBB_xxx Output

Input 2

Input 1,2 Symbol (_xxx) Output


INT SBB_INT INT
DINT SBB_DINT DINT

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 ON
When there is no borrow to the most significant bit (no borrow in) : Carry Flag is reset to 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=OFF
 Input 1 and input 2 must have the same data type.
Output=Input 1-Input 2-Carry Flag
6F8C1226
14. Arithmetic Operation 14-8

Program example:
(1) When there is no borrow in (CF) or overflow (OV), and input Carry Flag (input CF)=OFF
SAMPLE1 SBB_INT SAMPLE3 SAMPLE1 0 1 0 1 1 1 0 0 0 1 1 0 0 0 0 0 23648
23648 13313
LD ST SAMPLE2 0 0 1 0 1 0 0 0 0 1 0 1 1 1 1 1 10335
SAMPLE2
10335 +) Input CF 0
LD SAMPLE3 0 0 1 1 0 1 0 0 0 0 0 0 0 0 0 1 13313

CF 0
OV 0

 Input data 10335 in SAMPLE2 is subtracted from 23648 in SAMPLE1 with carry and the result 13313 is stored in SAMPLE3.
Also, the specific register Carry Flag is reset to OFF.

(2) When there is borrow in (CF), overflow (OV), and input Carry Flag (input CF)=OFF

SAMPLE1 SBB_INT SAMPLE3 SAMPLE1 0 0 1 0 0 1 1 1 0 0 0 1 0 0 0 0 10000


10000 -27536
LD ST SAMPLE2 1 0 0 1 0 0 1 0 1 0 1 0 0 0 0 0 -28000
SAMPLE2
-28000 +) Input CF 0
LD SAMPLE3 1 0 0 1 0 1 0 0 0 1 1 1 0 0 0 0 -27536

CF 1
OV 0

 Input data -28000 in SAMPLE2 is subtracted from 10000 in SAMPLE1 with carry and the result -27536 is stored in
SAMPLE3. Also, the specific register Carry Flag is set to ON.

Error information:
 When EN is used, when borrow in or underflow occurs, ENO output is reset to OFF.
6F8C1226
14. Arithmetic Operation 14-9

Arithmetic Operation Multiply

Input 1 MUL_xxx Output

Diagram Input 2

Input n

EN input Edge execution Index modification


Modifier
√ √ —

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 1…n 2 ≤ n ≤ 15
See below
Output — — Output

Input 1 MUL_xxx Output


Input 2

Input n

Input 1…n Symbol (_xxx) Output


INT MUL_INT INT
DINT MUL_DINT DINT
UINT MUL_UINT UINT
REAL MUL_REAL REAL

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
6F8C1226
14. Arithmetic Operation 14-10

Program example:
SAMPLE1 MUL_INT SAMPLE5
12 -24192
LD ST
SAMPLE2
-32
LD
SAMPLE3
21
LD
SAMPLE4
3
LD

 Input data in SAMPLE1 to SAMPLE4 are multiplied and the result -24192 is stored in SAMPLE5.

Error information:
 If an overflow occurs, the limit value is output as result.
 When input data type is REAL, if NAN data is entered as input, the result is NAN.
 When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
14. Arithmetic Operation 14-11

Arithmetic Operation Multiply

Input 1 MUL_INT_DINT Output


Diagram
Input 2

EN input Edge execution Index modification


Modifier
√ √ —

Arguments:
Arg. Operand Type Const. Description Remarks
Input — INT √ Input 1, 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:
SAMPLE1 MUL_INT_DINT SAMPLE5
129 -421185
LD ST
SAMPLE2
-3265
LD

 The input data 129 in SAMPLE1 is multiplied with -3265 in SAMPLE2 and the result -421185 is stored in SAMPLE5.
6F8C1226
14. Arithmetic Operation 14-12

Arithmetic Operation Divide

Input 1 DIV_xxx Output


Diagram
Input 2

EN input Edge execution Index modification


Modifier
√ √ —

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 1, 2
See below
Output — — Output

Input 1 DIV_xxx Output

Input 2

Input 1, 2 Symbol (_xxx) Output


INT DIV_INT INT
DINT DIV_DINT DINT
UINT DIV_UINT UINT
REAL DIV_REAL REAL

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

Program example:
SAMPLE1 DIV_INT SAMPLE3
24378 10
LD ST
SAMPLE2
2345
LD

 The input data 24378 in SAMPLE1 is divided by 2345 in SAMPLE2 and the result 10 is stored in SAMPLE3.

Error information:
 If divided by 0 error occurs, the limit is output as operation result. Also, the specific registers Error Flag and Divide Error Flag
are set to ON.
 If the operation result exceeds the valid data range, the limit value is output.
 When input data type is REAL, if NAN data is entered as input, the result is NAN.
 When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
14. Arithmetic Operation 14-13

Arithmetic Operation Remainder

Input 1 MOD_xxx Output


Diagram
Input 2

EN input Edge execution Index modification


Modifier
√ √ —

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 1, 2
See below
Output — — Output

Input 1 MOD_xxx Output

Input 2

Input 1, 2 Symbol (_xxx) Output


INT MOD_INT INT
DINT MOD_DINT DINT
UINT MOD_UINT UINT

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)

Program example:
SAMPLE1 MOD_INT SAMPLE3
24378 928
LD ST
SAMPLE2
2345
LD

 The input data 24378 in SAMPLE1 is divided by 2345 in SAMPLE2 and the remainder 928 is stored in SAMPLE3.

Error information:
 If divided by 0 error occurs, the remainder 0 is output as operation result. Also, the specific registers Error Flag and Divide
Error Flag are set to ON.
 If EN is included, ENO output is OFF when the above error occurs.
6F8C1226
14. Arithmetic Operation 14-14

Arithmetic Operation Increment

INC_xxx Output
Diagram
Input_Output 1 V V Input_Output 1

EN input Edge execution Index modification


Modifier
√ √ —

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_Output 1
See below
Output — — Output

INC_xxx Output

Input_Output 1 V V Input_Output 1

Input_Output 1 Symbol (_xxx) Output


INT INC_INT INT
DINT INC_DINT DINT
UINT INC_UINT UINT
REAL INC_REAL REAL
TIME INC_TIME TIME

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.
Output=Input_Output 1+1
6F8C1226
14. Arithmetic Operation 14-15

Program example:
(1)
INC_INT SAMPLE2
1000
ST
SAMPLE1 SAMPLE1
999 V V
LD ST

 The input data 999 in variable SAMPLE1 is incremented and the result 1000 is stored in variables SAMPLE1 and SAMPLE2.

(2)
INC_INT SAMPLE2
-32768
ST
SAMPLE1 SAMPLE1
32767 V V
LD ST
 The input data 32767 in variable SAMPLE1 is incremented and the result -32768 is stored in variables SAMPLE1 and
SAMPLE2.

Error information:
 When input data type is REAL, if NAN data is entered as input, the result is NAN.
 When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
14. Arithmetic Operation 14-16

Arithmetic Operation Decrement

DEC_xxx Output
Diagram
Input_Output 1 V V Input_Output 1

EN input Edge execution Index modification


Modifier
√ √ —

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_Output 1
See below
Output — — Output

DEC_xxx Output

Input_Output 1 V V Input_Output 1

Input_Output 1 Symbol (_xxx) Output


INT DEC_INT INT
DINT DEC_DINT DINT
UINT DEC_UINT UINT
REAL DEC_REAL REAL
TIME DEC_TIME TIME

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.
Output=Input_Output 1 - 1
6F8C1226
14. Arithmetic Operation 14-17

Program example:
(1)
DEC_INT SAMPLE2
998
ST
SAMPLE1 SAMPLE1
999 V V
LD ST
 The input data 999 in variable SAMPLE1 is decremented and the result 998 is stored in variables SAMPLE1 and SAMPLE2.

(2)
DEC_INT SAMPLE2
32767
ST
SAMPLE1 SAMPLE1
-32768 V V
LD ST
 The input data -32768 in variable SAMPLE1 is decremented and the result 32767 is stored in variables SAMPLE1 and
SAMPLE2.

Error information:
 When input data type is REAL, if NAN data is entered as input, the result is NAN.
 When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
14. Arithmetic Operation 14-18

Arithmetic Operation Power

Input 1 EXPT_xxx Output


Diagram
Input 2

EN input Edge execution Index modification


Modifier
√ √ —

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 REAL √ Input 1
Input
Input 2 See below √ Input 2
Output — REAL — Output

Input 1 EXPT_xxx Output


Input 2

Input 2 Symbol (_xxx)


INT EXPT_INT
DINT EXPT_DINT
UINT EXPT_UINT
REAL EXPT_REAL

Function:
 Input data Input 1 is raised to the Input 2 power and the result is output.
Output=(Input 1)Input 2

Program example:
SAMPLE1 EXPT_INT SAMPLE3
12.45 546.91946
LD ST
SAMPLE2
2.5
LD

 SAMPLE1 is raised to the SAMPLE2 power and the result 546.91946 is stored in SAMPLE3.

Error information:
 If the operation result exceeds the valid data range, the limit value is output.
 If Input 1=Input 2=0, 0 is output as the result and the specific register Error Flag is set to ON.
 If Input 1 < 0 and Input 2 has decimal fractions (example: Input 1=-2, Input 2=-2.5), the result is 0 and the specific register
Error Flag is set to ON.
 When input data type is REAL, if NAN data is entered as input, the result is NAN.
 When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
14. Arithmetic Operation 14-19

Arithmetic Operation Add Time Data

Input 1 ADD_xxx Output


Diagram
Input 2

EN input Edge execution Index modification


Modifier
√ √ —

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 — Note 1 Input 1,2
See below
Output — — Output
Note 1: For constant specification of input 1, constant specification is not allowed for DT type.

Input 1 ADD_xxx Output

Input 2

Input 1 Input 2 Symbol (_xxx) 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

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=Input 1+Input 2
6F8C1226
14. Arithmetic Operation 14-20

Program example:
(1) When TIME+TIMETIME
SAMPLE1 ADD_T_T SAMPLE3
T#12345ms T#15801ms
LD ST
SAMPLE2
T#3456ms
LD
 The input data T#12345ms in SAMPLE1 is added with T#3456ms in SAMPLE2 as time data and the result T#15801ms is
stored in SAMPLE3.

(2) When DATE+INTDATE


SAMPLE1 ADD_D_INT SAMPLE3
D#1999-8-1 D#1999-8-6
LD ST
SAMPLE2
5
LD

 The input data D#1999-8-1in SAMPLE1 is added to input data 5 in SAMPLE2 as time data and the result D#1999-8-6 is
stored in SAMPLE3.

Error information:
 If an overflow occurs, the limit value is output as result.
 When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
14. Arithmetic Operation 14-21

Arithmetic Operation Subtract Time Data

Input 1 SUB_xxx Output


Diagram
Input 2

EN input Edge execution Index modification


Modifier
√ √ —

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 — Note 1 Input 1,2
See below
Output — — Output
Note 1: For constant specifcation of input 1, constant specification is not allowed for DT type.

Input 1 SUB_xxx Output

Input 2

Input 1 Input 2 Symbol (_xxx) 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

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=Input 1-Input 2
6F8C1226
14. Arithmetic Operation 14-22

Program example:
(1) When TIME-TIMETIME
SAMPLE1 SUB_T_T SAMPLE3
T#12345ms T#8889ms
LD ST
SAMPLE2
T#3456ms
LD

 The input data T#3456ms in SAMPLE2 is subtracted from T#12345ms in SAMPLE1 as time data and the result T#8889ms
is stored in SAMPLE3.

(2) When DATE-INTDATE


SAMPLE1 SUB_D_INT SAMPLE3
D#1999-8-6 D#1999-8-1
LD ST
SAMPLE2
5
LD

 The input data 5 in SAMPLE2 is subtracted from input data D#1999-8-6 in SAMPLE1 as time data and the result D#1999-8-1
is stored in SAMPLE3.

Error information:
 If an overflow occurs, the limit value is output as result.
 When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
14. Arithmetic Operation 14-23

Arithmetic Operation Multiply Time Data

Input 1 MUL_xxx Output


Diagram
Input 2

EN input Edge execution Index modification


Modifier
√ √ —

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 TIME √ Input 1
Input
Input 2 See below √ Input 2
Output — TIME — Output

Input 1 MUL_xxx Output

Input 2

Input 2 Symbol (_xxx)


INT MUL_T_INT
DINT MUL_T_DINT
UINT MUL_T_UINT

Function:
 Input data Input 1 is multiplied with Input 2 as time data and the result is output.
Output=Input 1 * Input 2

Program example:
SAMPLE1 MUL_T_INT SAMPLE3
T#12345ms T#37035ms
LD ST
SAMPLE2
3
LD

 The input data T#12345ms in SAMPLE1 is multiplied with 3 in SAMPLE2 as time data and the result T#37035ms is stored in
SAMPLE3.

Error information:
 If the operation result exceeds the valid data range, the limit value is output.
 When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
14. Arithmetic Operation 14-24

Arithmetic Operation Divide Time Data

Input 1 DIV_xxx Output


Diagram
Input 2

EN input Edge execution Index modification


Modifier
√ √ —

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 TIME √ Input 1
Input
Input 2 See below √ Input 2
Output — TIME — Output

Input 1 DIV_xxx Output


Input 2

Input 2 Symbol (_xxx)


INT DIV_T_INT
DINT DIV_T_DINT
UINT DIV_T_UINT

Function:
 Input data Input 1 is divided by Input 2 as time data and the result is output.
Output=Input 1/ Input 2

Program example:
SAMPLE1 DIV_T_INT SAMPLE3
T#12345ms T#4115ms
LD ST
SAMPLE2
3
LD

 The input data T#12345ms in SAMPLE1 is divided by 3 in SAMPLE2 as time data and the result T#4115ms is stored in
SAMPLE3.

Error information:
 If the operation result exceeds the valid data range, the limit value is output.
 If divided by 0 error occurs, the limit is output as operation result. Also, the specific registers Error Flag and Divide Error Flag
are set to ON.
 When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
15. Data Processing 15-1

15 Data Processing

No. Instruction Remarks


1 Set Carry SETC
2 Reset Carry RSTC
3 Encode ENC
4 Decode DEC
5 Bit Counter BC
6 Table Bit Set TSET
7 Table Bit Reset TRST
6F8C1226
15. Data Processing 15-2

Data Processing Set Carry

SETC
Diagram Input Output

EN input Edge execution Index modification


Modifier
— — —

Arguments:
Arg. Operand Type Const. Description Remarks
Input — BOOL √ Input
Output — BOOL — Output

Function:
• When the input is ON, the specific register Carry Flag is set to ON.
• When the input is OFF, the specific register Carry Flag is unchanged.
• The state of the input is output as the result.
Input Action Output
OFF Do not execute (Carry Flag is unchanged) OFF
ON Execute (Carry Flag=ON) ON

Program example:
SIGNAL1 SETC SIGNAL2
1 1
LD ST

• When SIGNAL1 is ON, the Carry Flag is set to ON and ON is output to variable SIGNAL2.
6F8C1226
15. Data Processing 15-3

Data Processing Reset Carry

RSTC
Diagram Input Output

EN input Edge execution Index modification


Modifier
— — —

Arguments:
Arg. Operand Type Const. Description Remarks
Input — BOOL √ Input
Output — BOOL — Output

Function:
• When the input is ON, the specific register Carry Flag is reset to OFF.
• When the input is OFF, the specific register Carry Flag is unchanged.
• The state of the input is output as the result.
Input Action Output
OFF Do not execute (Carry Flag is unchanged) OFF
ON Execute (Carry Flag=OFF) ON

Program example:
SIGNAL1 RSTC SIGNAL2
1 1
LD ST

• When SIGNAL1 is ON, the Carry Flag is reset to OFF and ON is output to variable SIGNAL2.
6F8C1226
15. Data Processing 15-4

Data Processing Encode


Diagram
ENC_xxx
Input data Bit no. output

Modifier EN input Edge execution Index modification


√ √ -

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 — — Bit no. output

Input data ENC_xxx Bit no. output

Input data Symbol (_xxx) Bit no. output


WORD ENC_WORD_INT INT
WORD ENC_WORD_DINT DINT
DWORD ENC_DWORD_INT INT
DWORD ENC_DWORD_DINT DINT

Function:
• Searches the input data from the most significant bit and outputs the number of the first bit that is ON.
• The 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 ON bit, -1 is output. Also, the specific register Encode Error Flag set to ON.

Program example:
SAMPLE1 ENC_WORD_INT SAMPLE2 Bit no. 15 12 8 4 0
16#1234 12 WORD 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0
LD ST
Bit search direction
• Encodes the input data SAMPLE1 and stores 12 as the result in SAMPLE2.

Error information:
• If input data=0, an encode error occurs with -1 output as the result and the specific register Encode Error Flag is set to ON.
• When EN is used, ENO is reset to OFF when the above error occurs.
6F8C1226
15. Data Processing 15-5

Data Processing Decode


Diagram
Bit no. input DEC_xxx Result output
Target data M M Target data

Modifier EN input Edge execution Index modification


√ √ -

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 √ Bit no. input
Output — — Result output
Input/Output M — Target data

Bit no. input DEC_xxx Result output

Target data M M Target data

Bit no. input Target data Symbol (_xxx) Result output


INT WORD DEC_INT_WORD WORD
INT DWORD DEC_INT_DWORD DWORD
DINT WORD DEC_DINT_WORD WORD
DINT DWORD DEC_DINT_DWORD DWORD

Function:
• Of the target data, the bit specified with bit no. input is set to ON. The operation result is output in result output.
• The input bit number depends on the data type of the target data as follows:
WORD: 0 to 15 … Bit no. position=MOD (Bit no. input/16)
DWORD: 0 to 31 … Bit no. position=MOD (Bit no. input/32)

Program example:
SAMPLE1 DEC_INT_WORD SAMPLE3 Bit no. 15 12 8 4 0
12 16#1234 WORD 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0
LD ST
SAMPLE2 SAMPLE2
16#0234 M M Bit no. input
LD ST

• Of the content 16#0234 in target data SAMPLE2, the 12th bit specified with bit no. input SAMPLE1 is set to ON. As the result
of this decode operation, the content of target data SAMPLE2 is 16#1234 and the result 16#1234 is stored in SAMPLE3.

Error information:
• When bit no. input < 0, no decode operation is performed.
• When EN is used, ENO is reset to OFF when the above error occurs.
6F8C1226
15. Data Processing 15-6

Data Processing Bit Counter


Diagram
Input data BC_xxx Bit count output

Modifier EN input Edge execution Index modification


√ √ —

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

BC_xxx
Input data Bit count output

Input data Symbol (_xxx)


WORD BC_WORD
DWORD BC_DWORD

Function:
• Counts the number of bits in the input data that are ON and output the result.

Program example:
SAMPLE1 BC_WORD SAMPLE2 Bit no. 15 12 8 4 0
16#1234 5 WORD 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0
LD ST

• Counts the number of bits in input data SAMPLE1 and stores 5 as the result in SAMPLE2.
6F8C1226
15. Data Processing 15-7

Data Processing Table Bit Set


Diagram
Bit pointer TSET_xxx Target table
Table size N

Modifier EN input Edge execution Index modification


√ √ —

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
— See below √ Bit pointer
Input
N UINT √ Table size 1 ≤ N ≤ 64
Output — PTR — Target table

Bit pointer TSET_xxx Target table


Table size N

Bit pointer Symbol (_xxx)


INT TSET_INT
DINT TSET_DINT
WORD TSET_WORD
DWORD TSET_DWORD

Function:
• The bit position specified with bit pointer in the N word table starting with the target table is set to ON.
• The table size must be between 1 and 64 words (1024 bits).
• If table size N=0, no table set is performed.
• If the bit pointer points outside the target table, no table set is performed and the specific register Table Operation Error is set
to ON.
• Direct I/O variables cannot be specified for target table.
Table specification Table word count Action Error flag
Not direct I/O 1 ≤ N ≤64 Executed —
N=0 Not executed —
N > 64 Execute with N=64 as limit —
Direct I/O ∗ Not executed ON
6F8C1226
15. Data Processing 15-8

Program example:
SAMPLE1 TSET_INT TBL1 Target table TBL1
88 0 151413121110 9 8 7 6 5 4 3 2 1 0
LD ST
1 31302928272625242322212019 18 17 16
SAMPLE2
6 N
LD 5 95949392919089888786858483 82 81 80
Set to ON
Bit pointer=88

• In the 6 word (which is specified with table size SAMPLE2) table data starting with target table TBL1, the bit position
specified with bit pointer in input data SAMPLE1 is set to ON.

Error information:
• If the bit pointer points outside the target table, Table Operation Error is set to ON.
• If table size N > 64, operation is performed with N=64.
• If direct I/O variable is specified for target table, no operation is performed and Error Flag is set to ON.
• When EN is used, ENO is reset to OFF when the above error occurs.
6F8C1226
15. Data Processing 15-9

Data Processing Table Bit Reset


Diagram
Bit pointer TRST_xxx Target table
Table size N

Modifier EN input Edge execution Index modification


√ √ —

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
— See below √ Bit pointer
Input
N UINT √ Table size 1 ≤ N ≤ 64
Output — PTR — Target table

Bit pointer TRST_xxx Target table


Table size N

Bit pointer Symbol (_xxx)


INT TRST_INT
DINT TRST_DINT
WORD TRST_WORD
DWORD TRST_DWORD

Function:
• The bit position specified with bit pointer in the N word table starting with the target table is reset to OFF.
• The table size must be between 1 and 64 words (1024 bits).
• If table size N=0, no table reset is performed.
• If the bit pointer points outside the target table, no table reset is performed and the specific register Table Operation Error is
set to ON.
• Direct I/O variables cannot be specified for target table.
Table specification Table word count Action Error flag
Not direct I/O 1 ≤ N ≤ 64 Executed —
N=0 Not executed —
N > 64 Execute with N=64 as limit —
Direct I/O ∗ Not executed ON
6F8C1226
15. Data Processing 15-10

Program example:
Target tabel TBL1
SAMPLE1 TRST_INT TBL1
88 0 151413121110 9 8 7 6 5 4 3 2 1 0
LD ST
1 31302928272625242322212019 18 17 16
SAMPLE2
6 N
LD 5 95949392919089888786858483 82 81 80
Reset to OFF
Bit pointer=88

• In the 6 word (which is specified with table size SAMPLE2) table data starting with target table TBL1, the bit position
specified with bit pointer in input data SAMPLE1 is reset to OFF.

Error information:
• If the bit pointer points outside the target table, Table Operation Error is set to ON.
• If table size N > 64, operation is performed with N=64.
• If direct I/O variable is specified for target table, no operation is performed and Error Flag is set to ON.
• When EN is used, ENO is reset to OFF when the above error occurs.
6F8C1226
16. I/O Instructions 16-1

16 I/O

No. Instruction Remarks


1 I/O Memory Read MREAD
2 I/O Memory Write MWRITE
3 Special Module Data Input (nv) MREAD_N nV dedicated instruction
4 Special Module Data Output (nv) MWRITE_N nV dedicated instruction
5 ASC Module String Data Input ASCREAD
6 ASC Module String Data Output ASCWRITE
7 Read State Change GET_IP_INF
8 Direct I/O IO_T T
9 I/O Node State Read GET_SIO_STS nV dedicated instruction
10 I/O Module State Read GET_IO_STS nV dedicated instruction
11 I/O Degeneracy Request IOFB_REQ nV dedicated instruction
12 I/O Degeneracy Recovery Request IORC_REQ nV dedicated instruction
6F8C1226
16. I/O Instructions 16-2

I/O I/O Memory Read

MREAD
Execution enabled input E Completion output

Bus/Unit/Slot T

Diagram Extended memory top address TADDR

Transfer destination variable P

Transfer word number N

EN input Edge execution Index modification


Modifier
— — —

Arguments:
Arg. Operand Type Const. Description Range
Input E BOOL √ Execution enabled input
T WORD √ Bus/Unit/Slot
TADDR WORD √ Extended memory top address 0 to 7FFFH
P PTR — Transfer destination variable
N UINT √ Transfer word number 1 to 256W
Output — BOOL — Completion output

[I/O argument supplementary description]


(1) Bus/Unit/Slot data structure
15 12 11 8 7 0
Bus Unit Slot
Range 16#00 to 16#0A
Range 16#0 to 16#7 (0 in case of base unit)
Range 16#0 to 16#3 (0 in case of base unit)
(2) Extended memory top address
15 0
Extended memory address (16#0000 to 16#7FFF)

(3) Transfer word number


15 14 0
Transfer word number (1 to 256)

Function:
• If execution enabled input E is OFF, no data is input from the special module.
• If execution enabled input E is ON, data is transferred from special module internal extended memory specified by the input
argument to the CPU module.
• Input arguments specify the transfer source (special module slot location and special module internal extended memory top
address), transfer destination (CPU module internal variable), and transfer word number.
• If an execution error is detected, the specific register Error Flag is set.
• 1 to 256 words may be transferred.
• Direct I/O variable cannot be specified for transfer destination variable.
Input Action Output Error flag
OFF Not executed OFF —
Executed: Normal ON —
ON
Not executed: Error ON ON
6F8C1226
16. I/O Instructions 16-3

Program example:
Transfer destination
SIGNAL1 MREAD SIGNAL2 Special module internal extended address variable SAMPLE3
1 E 1
LD ST 15 0 15 0
SAMPLE1 16#0000
16#1_1_06 T N=200W
LD TADR=16#0100 Transfer
SAMPLE2 N=200W
16#0100 TADDR
LD
SAMPLE3 16#01C8
1234 P
LD
SAMPLE4
200 N
LD
IO specification: SAMPLE1
Bus: Channel 1
Unit: 1
Slot: 6
16#7FFF

• Variable SAMPLE1 specifies the special module slot location. (Bus: Channel 1, Unit: 1, Slot: 6)
• Variable SAMPLE2 specifies the read top address of the extended memory in special module. (16#0100)
• Variable SAMPLE3 specifies the transfer destination variable.
• Variable SAMPLE4 specifies the transfer word number. (specify 200W)
• When SIGNAL1 is ON, the data specified with the above input argument is transferred. Upon normal completion, SIGNAL2
is set to ON.

Error information:
• When the module cannot be accessed because the specified special module is not installed or is abnormal.
• When the specified module is not a special module.
• When the transfer word number exceeds 256W.
• When the transfer source special module extended address is outside 0 to 7FFF.
• When the range specified by the transfer destination variable exceeds the allowed area.
• When direct I/O variable is specified for transfer destination variable.
• If the above error occurs, specific register Error Flag is set to ON without performing any operation.
6F8C1226
16. I/O Instructions 16-4

I/O I/O Memory Write

M W RITE
Execution enabled input E Com pletion output

Bus/Unit/Slot T

Diagram Extended m em ory top address TADDR

Transfer destination variable P

Transferred words N

EN input Edge execution Index modification


Modifier
— — —

Arguments:
Arg. Operand Type Const. Description Range
Input E BOOL √ Execution enabled input
T WORD √ Bus/Unit/Slot
TADDR WORD √ Extended memory top address 0 to 7FFFH
P PTR — Transfer destination variable
N UINT √ Transfer words 1 to 256W
Output — BOOL — Completion output

[I/O argument supplementary description]


(1) Bus/Unit/Slot data structure
15 12 11 8 7 0
Bus Unit Slot
Range 16#00 to 16#0A
Range 16#0 to 16#7 (0 in case of base unit)
Range 16#0 to 16#3 (0 in case of base unit)
(2) Extended memory top address
15 0
Extended memory top address (16#0000 to 16#7FFF)

(3) Transfer word number


15 14 0
Transfer word number (1 to 256)

Function:
• If execution enabled input E is OFF, no data is output to special module.
• If execution enabled input E is ON, data is transferred from transfer source variable in the CPU module specified by input
argument to the special module internal extended memory.
• Input arguments specify the transfer source (CPU module internal variable), transfer destination (special module slot
location and special module internal extended memory top address), and transfer word number.
• If an execution error is detected, the specific register Error Flag is set.
• 1 to 256 words may be transferred.
• Direct I/O variable cannot be specified for transfer source variable.
Input Action Output Error flag
OFF Not executed OFF —
Executed: Normal ON —
ON
Not executed: Error ON ON

Program example:
6F8C1226
16. I/O Instructions 16-5

Transfer source variable


SIGNAL1 MWRITE SIGNAL2 SAMPLE3 Special module internal extended address
1 E 1 15 0 0 15
LD ST
16#0000
SAMPLE1 N=200W
16#1_1_06 T
LD Transfer TADR=16#0100
SAMPLE2 N=200W
16#0100 TADDR
LD
SAMPLE3 16#01C8
1234 P
LD
SAMPLE4
200 N
LD
IO specification: SAMPLE1
Bus: Channel 1
Unit: 1
Slot: 6
16#7FFF

• Variable SAMPLE1 specifies the special module slot location. (Bus: Channel 1, Unit: 1, Slot: 6)
• Variable SAMPLE2 specifies the special module internal extended memory write top address. (16#0100)
• Variable SAMPLE3 specifies the transfer source variable.
• Variable SAMPLE4 specifies the transfer word number. (specify 200W)
• When SIGNAL1 is ON, the data specified with the above input argument is transferred. Upon normal completion, SIGNAL2
is set to ON.

Error information:
• When the module cannot be accessed because the specified special module is not installed or is abnormal.
• When the specified module is not a special module.
• When the transfer word number exceeds 256W.
• When the range specified by the transfer source variable exceeds the allowed area.
• When the transfer destination special module extended address is outside 0 to 7FFF.
• When direct I/O variable is specified for transfer source variable.
• If the above error occurs, specific register Error Flag is set to ON without performing any operation.
6F8C1226
16. I/O Instructions 16-6

Special Module Data Input (nv)

nV dedicated
I/O Special Module Data Input (nv)
instruction
LD/FBD language MREAD_
notation Completion
Execution request REQ DONE output
Basic unit slot / node
/unit / slot T ERROR Error
Extended memory
address TADDR STATU Status

Transfer destination
P
variable
Transfer word count N

Modifier EN input Edge execution Index modification


- - -
ST language notation [Instance name] (REQ, T, TADDR, 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
Basic unit slot / node /
T Bit string of length 32 √ 0
unit / slot
Input
TADDR Bit string of length 16 √ Extended memory address 0 to 32KW
P PTR - Transfer destination variable
N UINT √ Transfer word count 1 to 256W
DONE BOOL - Completion output
Output ERROR BOOL - Error
STATUS INT - Status

[Input argument supplementary description]


• Basic unit slot / node / unit / slot data structure
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Basic unit slot Node Unit Slot

Allowable
Setting value Valid range Remarks
range
Basic unit slot 0 to 255 0 0: I/O directly under the
controller
Node 0 to 255 3 to 34
NX-I/√ 1
Unit 0 to 255
G3-I/√ 1 to 7
NX-I/√ 0 to 15
Slot 0 to 255
G3-I/√ 0 to 11

• Extended memory address


15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 Extended memory address(0 to 16#7FFF) :32kW

• Transfer word count


6F8C1226
16. I/O Instructions 16-7

15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 Transfer word count (1 to 256) :256W

Instance structure:

Name Type Description Remarks


Completion
DONE BOOL
output Can be accessed from the user
ERROR BOOL Error program.
STATUS INT Status
TIMECNT DINT Time count Cannot be accessed from the user
RESERVE Bit string of length 32 Reserved program.

Function:
• This function block reads data from an arbitrary memory address for the I/O module with memory of NX-I/O and G3-I/O.
• When execution request REQ changes from OFF to ON, data for transfer word count is read from extended memory
address TADDR of the specified basic unit slot / node / unit / slot to transfer destination variable P.
• For transfer word count, 1 to 256 words can be specified.
• When it is completed normally, completion output DONE becomes ON for 1 scanning time.
• When it is completed with an error, error ERROR becomes ON for 1 scanning time.
• When transfer is completed with or without an error, the details are output to status STATUS.
• I/O variable cannot be specified directly for transfer destination variable.
• For MREAD_N, MWRITE_N and XMIT_N instructions, up to 48 requests can be made simultaneously per controller.
• The status values are as follows.

Status Completion status


Content Description
STATUS DONE ERROR
MREAD_N management
0 to 63 TRUE FALSE
buffer number
Transfer word count
-5001 FALSE TRUE Transfer word count exceeds 256.
abnormal
Extended memory When 0≦ Extended memory address specification
-5002 FALSE TRUE specification address ≦16#7FFF:
abnormal (TADDR+N-1)≧16#8000
The specification range of transfer destination
-5003 FALSE TRUE Boundary abnormal
variable exceeds the area.
Transfer destination
I/O variable is specified directly for transfer
-5004 FALSE TRUE variable specification
destination variable.
abnormal
I/O is installed in the specified basic unit
-5005 FALSE TRUE Module abnormal slot/node/unit/slot, but it is in degeneration or
specified as hot-swap.
MREAD_N instruction cannot be executed
-5006 FALSE TRUE Management buffer full
because MREAD_N management buffer is full.
6F8C1226
16. I/O Instructions 16-8

Program example:
[LD/FBD language notation]

MREAD_N_1
SIGNAL1 MREA _ SIGNAL2
1 REQ DONE 1
L ST
SAMPLE1 SIGNA 3
16 0001020 T ERROR 0
L ST
SAMPLE2 SIGNA 5
16#0100 TADDR STATUS 8
L ST
SAMPLE3
123 P
L Transfer destination variable
Extended address in special module SAMPLE3
SAMPLE4
20 N 1 0 1 0
L 16#0000
N=200W
Transfer
TADR=16#0100
N=200W

16#01C8

IO specification: SAMPLE1
Basic unit slot : 0
Node 1
Unit 2
16#7FFF Slot: 3

[ST language notation]


MREAD_N_1(SIGNAL1, SAMPLE1, SAMPLE2, SAMPLE3, SAMPLE4);
SIGNAL2 := @MREAD_N_1.DONE;
SIGNAL3 := @MREAD_N_1.ERROR;
SIGNAL5 := @MREAD_N_1.STATUS;

• The installation slot location of the special module is specified with variable SAMPLE1 (Basic unit slot :0, Node :1, Unit :
2, Slot :3).
• The read top address of the extended memory in special module is specified with variable SAMPLE2 (16#0100).
• The destination variable is specified with variable SAMPLE3.
• Transfer word count is specified with variable SAMPLE4 (200W specified).
• When variable SIGNAL1 is ON, transfer operation is performed with the data specified in the input arguments above. When
it is completed normally, variable SIGNAL2 becomes ON.

Error information:
When I/O variable is specified directly for destination, the operation is as follows.

Controller Processing
Special module data input processing is not
executed.
Unified Controller nv series
Error flag and table operation error flag are set to
ON.
6F8C1226
16. I/O Instructions 16-9

Special Module Data Output (nv)

nv dedicated
I/O Special Module Data Output (nv)
instruction
LD/FBD language Instance name
notation
MWRITE_
Execution permission input REQ DONE Completion output
Basic unit slot / node
/ unit / slot T ERROR Error

Extended memory address TADDR STATU Status

Transfer source variable P

Transfer word count N

Modifier EN input Edge execution Index modification


- - -
ST language notation [Instance name] (REQ, T, TADDR, 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 permission input
T Bit string of length 32 √ Basic unit slot / node / unit / slot 0
Input TADDR Bit string of length 16 √ Memory top address 0 to 32KW
P PTR - Transfer source variable
N UINT √ Transfer word count 1 to 256W
DONE BOOL - Completion output
Output ERROR BOOL - Error
STATUS INT - Status

[Input argument supplementary description]


• Basic unit slot / node / unit / slot data structure
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Basic unit slot Node Unit Slot
Allowable
Setting value Valid range Remarks
range
Basic unit slot 0 to 255 0 0: I/O directly under the
controller
Node 0 to 255 3 to 34
NX-I/O 1
Unit 0 to 255
G3-I/O 1 to 7
NX-I/O 0 to 15
Slot 0 to 255
G3-I/O 0 to 11
• Extended memory address
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 Extended memory address (0 to 16#7FFF) :32kW

• Transfer word count


15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 Transfer word count ( 1 to 25 ):256W
6F8C1226
16. I/O Instructions 16-10

Function:
• This function block writes data to an arbitrary memory address for the I/O module with memory of NX-I/O and G3-I/O.
• When execution request REQ changes from OFF to ON, data for transfer word count is written to extended memory address
TADDR of the specified basic unit slot / node / unit / slot from transfer destination variable P.
• For transfer word count, 1 to 256 words can be specified.
• When it is completed normally, completion output DONE becomes ON for 1 scanning time.
• When it is completed with an error, error ERROR becomes ON for 1 scanning time.
• When transfer is completed with or without an error, the details are output to status STATUS.
• I/O variable cannot be specified directly for transfer source variable.
• For MREAD_N, MWRITE_N and XMIT_N instructions, up to 48 requests can be made simultaneously per controller.
• The status values are as follows.

Completion
Status
status Content Description
STATUS
DONE ERROR
MWRITE_N management
0 to 63 TRUE FALSE
buffer number
-5001 FALSE TRUE Transfer word count abnormal Transfer word count exceeds 256.
When 0≦ Extended memory address
Extended memory specification
-5002 FALSE TRUE specification ≦16#7FFF:(TADDR+N-1)
address abnormal
≧16#8000
The specification range of transfer source
-5003 FALSE TRUE Boundary abnormal
variable exceeds the area.
Transfer source variable I/O variable is specified directly for transfer
-5004 FALSE TRUE
specification abnormal source variable.
I/O is installed in the specified basic unit
-5005 FALSE TRUE Module abnormal slot/node/unit/slot, but it is in degeneration or
specified as hot-swap.
A certain period of time elapsed, but
MWRITE_N instruction cannot be executed
-5006 FALSE TRUE Management buffer full
because MWRITE_N management buffer is
full.
6F8C1226
16. I/O Instructions 16-11

Instance structure:
Name Type Description Remarks
Completion
DONE BOOL
output Can be accessed from the user
ERROR BOOL Error program.
STATUS INT Status
TIMECNT DINT Time count Cannot be accessed from the user
RESERVE Bit string of length 32 Reserved program.

Program example:
[LD/FBD language notation]
MWRITE_N_
SIGNAL1 MWRITE_ SIGNAL2
1 RE DON 1
L ST
Transfer destination variable
SAMPLE1 SIGNA 3
16 0001020 T ERRO 0 SAMPLE3 Extended address in special module
L ST 1 0 0 1
SAMPLE2 SIGNA 5 16#000
16#010 TADDR STATUSR 8 N=200W
L ST Transfer TADR=16#010
SAMPLE3
123 P N=200W 0
L
SAMPLE4
16#01C
20 N
L

I/O specification :SAMPLE1


Basic unit slot :0
Nod :1
Unit :2
Slot :3
16#7FF

[ST language notation]


MWRITE_N_1(SIGNAL1, SAMPLE1, SAMPLE2, SAMPLE3, SAMPLE4);
SIGNAL2 := @MWRITE_N_1.DONE;
SIGNAL3 := @MWRITE_N_1.ERROR;
SIGNAL5 := @MWRITE_N_1.STATUS;

• The installation slot location of the special module is specified with variable SAMPLE1 (Basic unit slot :0, Node :1, Unit :
2, Slot :3).
• The read top address of the extended memory in special module is specified with variable SAMPLE2 (16#0100).
• The transfer source variable is specified with variable SAMPLE3.
• Transfer word count is specified with variable SAMPLE4 (200W specified).
• When variable SIGNAL1 changes OFF to ON, transfer operation is performed with the data specified in the input arguments
above. When it is completed normally, variable SIGNAL2 becomes ON.

Error information:
• When I/O variable is specified directly for transfer source, the operation is as follows.
Controller Processing
Special module data output processing is not
Unified Controller nv series executed.
Error flag and table operation error flag are set to ON.
6F8C1226
16. I/O Instructions 16-12

I/O ASC Module String Data Input


Diagram
ASCREAD
Execution enabled input E Completion
output
Bus/Unit/Slot T

Extended memory top address TADDR

Transfer destination variable P

Transfer word number N

End code specification CODE

Modifier EN input Edge execution Index modification


— — —

Arguments::
Arg. Operand Type Const. Description Range
Input E BOOL √ Execution enabled input
T WORD √ Bus/Unit/Slot
TADDR WORD √ Extended memory top address 0 to 7FFFH
P STRING — Transfer destination variable
N UINT √ Transfer word number 1 to 129W
CODE WORD √ End code specification
Output — BOOL — Completion output

[I/O argument supplementary description]


(1) Bus/Unit/Slot data structure
15 12 11 8 7 0
Bus Unit Slot
Valid from 16#00 to 16#0A
Valid from 16#0 to 16#7(0 in case of basic unit)
Valid from 16#0 to 16#3 (0 in case of basic unit)
(2) Extended memory top address
15 0
Extended memory adr. (16#0000 to 16#7FFF)

(3) Transfer word number


15 14 0
Transfer word number (1 to 129)

Function:
• If execution enabled input E is OFF, no string data is input from the ASC module.
• If execution enabled input E is ON, data is transferred from ASC module internal extended memory specified by the input
argument to the STRING variable in the CPU module.
• The store target data is N words starting from TADDR and the data from the beginning up to the specified end code is
stored.
• The low order byte (16#00 to 16#FF) of the CODE input data is used as the end code.
• For input arguments, specify the transfer source (ASC module slot location and ASC module internal extended memory top
address), transfer destination (CPU module internal variable), transfer word number, and end code.
• If a double-byte code in the data read from ASC module is invalid, the invalid double-byte code is stored in STRING variable
replaced by ??.
6F8C1226
16. I/O Instructions 16-13

• If an execution error is detected, the specific register Error Flag is set.


• 1 to 129 words may be specified for transfer word number.
• Direct I/O variable cannot be specified for transfer destination variable.

Input Action Output Error flag


OFF Not executed OFF —
Executed: Normal ON —
ON
Not executed: Error ON ON

Important:
• Specify the same code for the end code in the ASC module and the end code specification CODE in this instruction.

Program example:
SIGNAL1 ASCREAD SIGNAL2 Extended address in Transfer destination
1 E 1 ASC module variable SAMPLE3
LD ST 15 0 15 0
SAMPLE1 16#0000 VAR length=6
16#1_1_06 T
String length=8
LD
SAMPLE2 TADDR=16#0080 “2“ “1“ “2“ “1“
16#0080 TADDR “4“ “3“ Transfer “4“ “3“
LD “6“ “5“ “6“ “5“
SAMPLE3 “8“ “7“ “8“ “7“
P
““ “CR“ * *
LD
SAMPLE4 16#0085 * *
5 N
LD IOSpecification: SAMPLE1
SAMPLE5 Bus: Channel 1 Variables:
16#000D CODE Unit: 1 Variable Data type Dec.
LD Slot: 6 SAMPLE3 STRING[12] VAR

16#7FFF

• Variable SAMPLE1 specifies the ASC module slot location. (Bus: Channel 1, Unit: 1, Slot: 6)
• Variable SAMPLE2 specifies the read top address of the extended memory in ASC module. (16#0080)
• Variable SAMPLE3 specifies the transfer destination STRING variable.
• Variable SAMPLE4 specifies the transfer word number. (5W specified)
• Variable SAMPLE5 specifies the end code. ("CR" specified)
• When variable SIGNAL1 is ON, the content specified with the above input argument is transferred and the character data up
to the specified end code is stored in the STRING variable. Upon normal completion, SIGNAL2 is set to ON.
6F8C1226
16. I/O Instructions 16-14

Error information:
• When the ASC module cannot be accessed because the specified ASC module is not installed or is abnormal.
• When the specified module is not a special module.
• When the transfer word number exceeds 129W.
• When the transfer source ASC module extended address is not between 0 and 7FFF.
• When the range specified by the transfer destination variable exceeds the allowed area.
• When direct I/O variable is specified for transfer destination variable.
• If the above error occurs, the specific register Error Flag is set to ON without performing any operation.
6F8C1226
16. I/O Instructions 16-15

I/O ASC Module String Data Output


Diagram
ASCWRITE
Execution enabled input E Completion
output
Bus/Unit/Slot T

Extended memory top address TADDR

Transfer source variable P

Transfer word number N

End code specification CODE

Modifier EN input Edge execution Index modification


— — —

Arguments:
Arg. Operand Type Const. Description Range
Input E BOOL √ Execution enabled input
T WORD √ Bus/Unit/Slot
TADDR WORD √ Extended memory top address 0 to 7FFFH
P STRING — Transfer source variable
N UINT √ Transfer word number 1 to 129W
CODE WORD √ End code specification
Output — BOOL — Completion output

[I/O argument supplementary description]


(1) Bus/Unit/Slot data structure
15 12 11 8 7 0
Bus Unit Slot
Valid from 16#00 to 16#0A
Valid from 16#0 to 16#7 (0 in case of basic unit)
Valid from 16#0 to 16#3 (0 in case of basic unit)
(2) Extended memory top address
15 8 7 0
Extended memory adr. (16#0000 to 16#7FFF)

(3) Transfer word number


15 14 8 7 0
Transfer word number (1 to 129)

Function:
• If execution enabled input E is OFF, no data is output to ASC module.
• If execution enabled input E is ON, data is transferred from transfer source variable in the CPU module specified by input
argument to the ASC module internal extended memory.
• The storage target data is output with the valid character code stored in STRING variable appended with the end code
specified with end code specification CODE.
• The low order byte (16#00 to 16#FF) of the CODE input data is used as the end code.
• For input arguments, specify the transfer source (CPU module internal variable), transfer destination (special module slot
location and ASC module internal extended memory top address), transfer word number, and end code.
• If an execution error is detected, the specific register Error Flag is set.
• 1 to 129 words (up to 256 bytes + end code) can be specified as transfer word number.
Normally, the transfer word number N is specified as INT ((string declaration byte size+2)/2). By specifying this way, the
6F8C1226
16. I/O Instructions 16-16

application program need not be aware of the actual number of character code bytes stored in the STRING variable.
• Direct I/O variable cannot be specified for transfer source variable.

Input Action Output Error flag


OFF Not executed OFF —
Executed: Normal ON —
ON
Not executed: Error ON ON

Important:
• Specify the same code for the end code in the ASC module and the end code specification CODE in this instruction.

Program example:
SIGNAL1 ASCWRITE SIGNAL2 Transfer source Extended address
1 E 1 variable SAMPLE3 in ASC module
LD ST 15 0 0 15
SAMPLE1 VAR length=6 16#0000
16#1_1_06 T
String length=8
LD
SAMPLE2 “2“ “1“ “2“ “1“ TADR=16#0240
Transfer
16#0240 TADDR “4“ “3“ “4“ “3“
LD “6“ “5“ “6“ “5“
SAMPLE3 “8“ “7” “8“ “7“
P
““ ““ ““ “CR“
LD
SAMPLE4 Variables: 16#0245
5 N Variable Data type Dec.
LD SAMPLE3 STRING[12] VAR
SAMPLE5
16#000D CODE
LD IO specification: SAMPLE1
Bus: Channel 1
Unit: 1 16#7FFF
Slot: 6

• Variable SAMPLE1 specifies the ASC module slot location. (Bus: Channel 1, Unit: 1, Slot: 6)
• Variable SAMPLE2 specifies the ASC module internal extended memory write top address. (16#0240)
• Variable SAMPLE3 specifies the transfer source STRING variable.
• Variable SAMPLE4 specifies the transfer word number. (5W specified)
• Variable SAMPLE5 specifies the end code. ("CR" specified)
• When SIGNAL1 is ON, transfer is performed with the end code specified with the above input argument appended. Upon
normal completion, SIGNAL2 is set to ON.

Error information:
• When the ASC module cannot be accessed because the specified ASC module is not installed or is abnormal.
• When the specified module is not a special module.
• When the transfer word number exceeds 129W.
• When the range specified by the transfer source variable exceeds the allowed area.
• When the transfer destination special module extended address is not between 0 and 7FFF.
• When INT (string declaration byte size+2)/2)>N.
• When direct I/O variable is specified for transfer source variable.
• If the above error occurs, the specific register Error Flag is set to ON without performing any operation.
6F8C1226
16. I/O Instructions 16-17

State Change Detection Read

I/O State Change Detection Read


LD/FBD language
GET_IP_INF
notation Storage destination table

Modifier EN input Edge execution Index modification


√ √ -
ST language notation GET_IP_INF(Storage destination table);

Arguments:

Arg. Operand Type Const. Description Valid range


Storage
Output - PTR -
destination table

Function:
• This is a dedicated instruction for I/O interruption task.
• When GET_IP_INF instruction is used in the I/O interruption task, the activation factor (I/O, TC-net100, START_P) of the I/O
interruption task can be obtained.
• The obtained result is transferred to the specified storage destination table.
• For storage destination table specification, static variable, non-tracking type / static variable (unified controller), temporary
variable, user variable, special register (SW) or system variable (ZW), and data register (D) are valid. If other variable is
specified, state change detection information is not read.
• The structure of state change detection information varies depending on the activation factor as shown below.

[Integrated controller - S controller]

I/O node state output value


[W]
I/O TC-net
+0 Activation factor =0 Activation factor =1
State change occurrence
+1 -
slot
+2
- Point No.
+3
+4
- State change bit history
+5
+6
- State change data
+7
+8
- IP task No.
+9
6F8C1226
16. I/O Instructions 16-18

[Unified Controller nv series]

I/O node state output value


[W]
I/O TC-net START_P
Activation factor =
+0 Activation factor =0 Activation factor =1
2
State change
+1 - -
occurrence slot
+2
Point No. Point No. -
+3
+4
- State change bit history -
+5
+6 ON interruption status
State change data -
+7 OFF interruption status
+8
IP task No. IP task No. IP task No.
+9

Program example:
[LD/FBD language notation]

Controller
I/O state
change /* IP3 Program */
I/O interruption / State change detection
notification registration Inf information
GET_IP_IN →Info*/
information ST
Point No. 0
I/O-1 IP0 /* When Info activation factor=I/O
Word No. IP1
IP2 Interruption processing from I/O-1 module word No.= 1
I/O interruption
Point No.1 IP3 event processing
I/O-1 program (IP3)
IP4 /* When Info activation factor=TC-net
Word No.1 IP5
Interruption processing from TC-net 100 module
IP6
I/O interruption
TC-net10 event processing
state change program (IP6)
notification /* IP6 Program */
IP15 / State change detection
Point No.0 Inf information
GET_IP_INF →Info*/
Block No. ST
Word No. /* When Info point No.=1
Point No.1 Interruption processing for point No.=1
Block No.
Word No.
/* When Info point No.=2
Point No.2
Interruption processing for point No.=2
Block No.
Word No.

[ST language notation]


GET_IP_INF(Info);
6F8C1226
16. I/O Instructions 16-19

When the same I/O interruption task (IP3) is set from the setting screen of I/O state change notification or TC-net100 state
change notification:
• Using the I/O interruption program, state change detection information is read to variable Info with GET_IP_INF instruction.
Interruption processing from the I/O module and interruption processing from TC-net100 can be programmed and executed
as different cases depending on the activation factor read.

When the same I/O interruption task (IP6) is set with multiple point number settings from the setting screen of TC-net100 state
change notification:
• Using the I/O interruption program, state change detection information is read to variable Info with GET_IP_INF instruction.
Interruption processing by TC-net100 point number can be programmed and executed as different cases depending on the
point number read.

Error information:
• If any variable other than static variable, non-tracking type / static variable (unified controller), temporary variable, user
variable, special register (SW) or system variable (ZW), or data register (D) is specified, state change detection information
is not read, and table operation error and error flag are set to ON.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
16. I/O Instructions 16-20

I/O Direct I/O T


Diagram
IO_T
Batch I/O specification Execution
output
Word number N

Modifier EN input Edge execution Index modification


√ √ —
Arguments:
Arg. Operand Type Const. Description Range
Input — PTR — Batch I/O specification
N UINT √ Word number 1 ≤ N ≤ 64
Output — BOOL — Execution output

Function:
• Performs data I/O of N words, which is specified by a batch I/O variable or by direct notation (%IQ), with the corresponding
I/O module as follows and sets the execution output to ON.
(1) When the corresponding I/O module is an input module
Stores the content input from the input module in batch output variable. (Data input)
(2) When the corresponding I/O module is an output module
Outputs the content of the batch I/O variable to the I/O module. (Data output)
• Performs direct I/O with the I/O module (such as digital I/O, TL-S20, TL-F10, TC-net) assigned to the batch I/O variable.
However, because model 2000 TL-F10 module supports only synchronous mode. Only I/O synchronized with scan is
performed even with this instruction.
• 1 to 64 words may be specified for word count N.
If N > 64: N=64 is assumed.
If N=0: Not executed
• Direct I/O instruction must be specified in I/O module units. Therefore, I/O of multiple I/O modules cannot be processed with
a single direct I/O instruction. In such case, I/O is performed only for the first module and the execution output is reset to
OFF.
• No I/O is performed if the I/O module corresponding to the specified batch I/O variable is not installed or if there is an I/O
fallback.
6F8C1226
16. I/O Instructions 16-21

Batch I/O variable [Specification example]


Case 1: Specify 4W from beginning of I/O(1)
I/O (1) 0W Case 1 Normal I/O possible
I/O I/O I/O I/O (1) 1W Case 2: Specify 2W from I/O(1)2W
(1) (2) (3) I/O (1) 2W Case 2 Normal I/O possible
I/O (1) 3W Case 3: Specify 5W from I/O(2)2W to I/O(3)2W
4W 4W 4W I/O (2) 0W I/O(2) 2-3W Ænormal I/O possible
I/O (2) 1W I/O(3) 0-2W Æno I/O performed
I/O (2) 2W Case 3
I/O (2) 3W
I/O (3) 0W
I/O (3) 1W
I/O (3) 2W
I/O (3) 3W

Program example:
SAMPLE1 IO_T SIGNAL1
1234 1
LD ST
SAMPLE2
4 N SAMPLE1: 4W output
LD module
• Outputs 4W from a batch I/O variable SAMPLE1 to a 4W output module.

Error information:
• No I/O is performed when anything other than batch I/O variable or direct notation (%IQ) is used for batch I/O specification
input.
• When I/O of multiple I/O modules is specified with a single direction I/O instruction, I/O is performed only for the first module.
• If word count N exceeds 64, it is limited to N=64.
• When I/O is specified only for the even number words of an I/O module set up Scan access 2W, I/O is performed only for the
specified even number words.
• When EN is used, ENO is reset to OFF when the above error occurs.
6F8C1226
16. I/O Instructions 16-22

I/O Node State Read

nv dedicated
I/O I/O Node State Read
instruction
LD/FBD language notation
GET_SIO_STS
Basic unit slot BASESLOT I/O node State

I/O node numbe NODE

Modifier EN input Edge execution Index modification


√ √ -
ST language notation I/O node state := GET_SIO_STS(BASESLOT, NODE);

Arguments:

Arg. Operand Type Const. Description Valid range


BASESLOT UINT √ Basic unit slot 0
Input
NODE UINT √ I/O node number 3 to 34
Output - BOOL - I/O node state

Function:
• I/O node state specified with basic unit slot (BASESLOT) and I/O node number (NODE) is read. The output (I/O node state)
varies depending on the task using this instruction.

I/O node state output value


Task
TRUE(ON) FALSE(OFF)
I/O node abnormal is not detected upon
Event task EV4 startup, so it is not the target of I/O I/O node abnormal is detected upon EV4
- I/O degeneracy task node degeneracy. startup, so it is the target of I/O node
(EV4) (Normal, or abnormal detection has been degeneracy.
done)
I/O node abnormal recovery is not detected
Event task I/O node abnormal recovery is detected upon EV6 startup, so it is not the target of I/O
- I/O degeneracy recovery upon EV6 startup, so it is the target of I/O node degeneracy recovery.
task (EV6) node degeneracy recovery. (Normal, or abnormal detection has been
done)
Other than above Specified I/O node state is normal. Specified I/O node state is abnormal.

• Therefore, in event task - I/O degeneracy task (EV4), the I/O node that was abnormal this time can be identified with this
instruction and special register (SW), or system variable (ZW) I/O degeneracy information (type1:SW[340] to SW[346]
/type2:ZW[300] to ZW[306]).
In event task - I/O degeneracy recovery task (EV6), the I/O node that returned normally this time can be identified with this
instruction and special register (SW), or system variable (ZW) I/O degeneracy recovery information (type1:SW[350] to SW
[356]/type2:ZW[310] to ZW[316]).
• 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.
6F8C1226
16. I/O Instructions 16-23

Program example:
[LD/FBD language notation]
Event task - I/O degeneracy task (EV4): [Example for type1]

I
S[340].B[1] S[340].B[3] VAL1

THEN /* I/O node abnormal of one unit/*


Indicates the I/O node where the following information is abnormal. Describes the processing related to the node.
1) SW[345]:I/O node degeneracy information(Main slot No.), 2) SW[346]:I/O node degeneracy information Node No.

ELSEI
S[340].B[1] S[340].B[3] VAL1

THEN /*I/O node abnormal of multiple units*/


FOR_DO /*Searches for I/O node abnormal detection in nodes 3 to 34*/
INDEX : X MIN:3 MAX:34 STEP :1
GET_SIO_ST NODE_O
0 BASESLO
X DINT_TO_UIN NOD
NODE_O T
Describes the processing related to the I/O node No.

END_FO

ENDIF

Event task - I/O degeneracy task (EV6): [Example for type1]


I
S[350].B[1] S[350].B[3] VAL1

THEN /* I/O node abnormal recovery of one unit*/


Indicates the I/O node where the following information is abnormal. Describes the processing related to the node.
1) SW[355] :I/O node degeneracy recovery information(Main slot No.), 2) SW[356] :I/O node degeneracy information (Node No.)

ELSEI
S[350].B[1] S[350].B[3] VAL1

THEN /*I/O node abnormal recovery of multiple units*/


FOR_DO /*Searches for I/O node abnormal recovery
INDEX : X STEP :1 detection in nodes 3 to 34*/
MIN :3 MAX:3
NODE_O
GET_SIO_STS
0 BASESLOT
X DINT_TO_UIN NOD
NODE_O
Describes the processing related to the I/O node No.
END_FO

ENDIF

[ST language notation]


(* Event task - I/O degeneracy task (EV4):[Example for type1] *)
IF S[340].B[1] AND NOT(S[340].B[3]) THEN
(* I/O node abnormal of one unit *)
ELSEIF S[340].B[1] AND S[340].B[3] THEN
(* I/O node abnormal of multiple units *)
FOR XI := 3 TO 34 BY 1 DO
Z1 := DINT_TO_UINT(XI);
6F8C1226
16. I/O Instructions 16-24

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 degeneracy 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 degeneracy task (EV4)


When I/O node degeneracy of multiple units is detected in I/O degeneracy task (EV4), it can be determined if the specified I/O
node is a target of degeneracy by using GET_SIO_STS instruction in EV4 task.
GET_SIO_STS instruction output becomes OFF if the specified I/O node is a target of degeneracy, or ON otherwise.
Description of operation for I/O degeneracy recovery task (EV6)
When I/O node degeneracy recovery of multiple units is detected in I/O degeneracy recovery task (EV6), it can be determined
if the specified I/O node is a target of degeneracy recovery by using GET_SIO_STS instruction in EV6 task.
GET_SIO_STS instruction output becomes ON if the specified I/O node is a target of degeneracy recovery, or OFF otherwise.
Description of operation for tasks other than I/O degeneracy task (EV4) / I/O degeneracy recovery task (EV6)
When GET_SIO_STS instruction is used in a task other than I/O degeneracy task (EV4) / I/O degeneracy recovery task (EV6),
the specified I/O node state can be determined.
GET_SIO_STS instruction output becomes ON if the specified I/O node is normal, or 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 OFF.
When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
16. I/O Instructions 16-25

I/O Module State Read

nV dedicated
I/O I/O Module State Read
instruction
LD/FBD language notation
GET_IO_STS
Basic unit slot BASESLOT I/O module state

I/O node number NODE


Unit number UNIT
Slot number SLOT

Modifier EN input Edge execution Index modification


√ √ -
ST language notation I/O module state := GET_IO_STS(BASESLOT, NODE, UNIT, SLOT);

Arguments:

Arg. Operand Type Const. Description Valid


range
BASESLOT UINT √ Basic unit slot 0
NODE UINT √ I/O node number 3 to 34
Input
UNIT UINT √ Unit number 1 to 7
SLOT UINT √ Slot number 0 to 15
Output - BOOL - I/O module state (1:Normal, 0:Abnormal)

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)
I/O abnormal is not detected upon EV4
Event task startup, so it is not the target of I/O node
I/O abnormal is detected upon EV4 startup,
- I/O degeneracy task degeneracy.
so it is the target of I/O degeneracy.
(EV4) (Normal, or abnormal detection has been
done)
I/O abnormal recovery is not detected upon
Event task I/O abnormal recovery is detected upon EV6 startup, so it is not the target of I/O
- I/O degeneracy recovery EV6 startup, so it is the target of I/O degeneracy recovery.
task (EV6) degeneracy recovery. (Normal, or abnormal detection has been
done)
I/O module serious failure occurred, or I/O
Other than above Specified I/O module state is normal. degeneracy occurred due to an I/O
degeneracy request.

• Therefore, in event task - I/O degeneracy 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 degeneracy information (type1:SW[340] to SW[346]
/type2:ZW[300]to ZW[306]).
6F8C1226
16. I/O Instructions 16-26

In event task - I/O degeneracy recovery task (EV6), the I/O module that returned normally this time can be identified with this
instruction and special register (SW), or system variable (ZW) I/O degeneracy recovery information (type1:SW[350]to SW
[356]/type2:ZW[310]to ZW[316]).
• 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]
Event task - I/O degeneracy task (EV4) :[Example for type1]

I
S[340].B[0] S[340].B[2] VAL1

THEN /* I/O module abnormal of one unit*/

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 degeneracy information (Main slot No./node No./unit No./slot No.)

ELSEI
S[340].B[0] S[340].B[2] VAL1

THEN /* I/O module abnormal of multiple units */

FOR_DO /* Searches for I/O module abnormal detection in nodes 3 to 34


of slot 0 to 15 */
INDEX:X MIN:3 MAX:3 STEP:1
FOR_DO
INDEX:X MIN:0 MAX:1 STEP:1

GET_IO_ST IO_O
0
BASESLO
X DINT_TO_UIN NOD
1 UNI
X DINT_TO_UIN SLOT
IO_O
Describes the processing related to the I/O module.

END_FO

END_FO

ENDIF
\

[ST language notation]


(* Event task - I/O degeneracy 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
6F8C1226
16. I/O Instructions 16-27

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]


Event task - I/O degeneracy recovery task
I
S[350].B[0] S[350].B[2] VAL1

THEN /* I/O module abnormal recovery of multiple units*/

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 degeneracy recovery information (Main slot No./node No./unit No./slot No.)

ELSEI
S[350].B[0] S[350].B[2] VAL1

THEN /* I/O module abnormal recovery of multiple units*/


FOR_DO /*Searches for I/O module abnormal recovery
detection in nodes 3 to 34 of slot 0 to 15*/
INDEX:X MIN:3 MAX:3 STEP:1
FOR_DO
INDEX:X MIN:0 MAX:1 STEP:1
IO_O
GET_IO_ST
0 BASESLO
X DINT_TO_UIN NOD
1 UNI
X DINT_TO_UIN SLOT

IO_O
Describes the processing related to the I/O module.

END_FO

END_FO
ENDIF

[ST language notation]


(* Event task - I/O degeneracy 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);
6F8C1226
16. I/O Instructions 16-28

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 degeneracy task (EV4)


When I/O degeneracy of multiple units is detected in I/O degeneracy task (EV4), it can be determined if the specified I/O
module is a target of degeneracy by using GET_SIO_STS instruction in EV4 task.
GET_SIO_STS instruction output becomes OFF if the specified I/O module is a target of degeneracy, or ON otherwise.
Description of operation for I/O degeneracy recovery task (EV6)
When I/O module degeneracy recovery of multiple units is detected in I/O degeneracy recovery task (EV6), it can be
determined if the specified I/O module is a target of degeneracy recovery by using GET_SIO_STS instruction in EV6 task.
GET_SIO_STS instruction output becomes ON if the specified I/O module is a target of degeneracy recovery, or OFF
otherwise.
Description of operation for tasks other than I/O degeneracy task (EV4) / I/O degeneracy recovery task (EV6)
When GET_SIO_STS instruction is used in a task other than I/O degeneracy task (EV4) / I/O degeneracy recovery task
(EV6), the specified I/O module state can be determined.
GET_SIO_STS instruction output becomes ON if the specified I/O module is normal, or 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 OFF.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
16. I/O Instructions 16-29

I/O Degeneracy Request

nV dedicated
I/O I/O Degeneracy Request
instruction
LD/FBD language notation
IOFB_REQ
Basic unit slot BASESLOT Execution
output
I/O node number NODE
Unit number
UNIT
Slot number
SLOT
Modifier EN input Edge execution Index modification
√ √ -
ST language notation Execution output := IOFB_REQ(BASESLOT, NODE, UNIT, SLOT);

Arguments:

Arg. Operand Type Const. Description Valid range


BASESLOT UINT √ Basic unit slot 0
NODE UINT √ I/O node number 3 to 34
Input
UNIT UINT √ Unit number 1 to 7
SLOT UINT √ Slot number 0 to 15
Output - BOOL - Execution output

Function:
• A degeneracy 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.
6F8C1226
16. I/O Instructions 16-30

Program example:
[LD/FBD language notation]

SAMPLE1 IOFB_REQ SIGNAL1


0
BASESLOT
LD

SAMPLE2
3
NODE
LD

SAMPLE3
1
UNIT
LD

SAMPLE4
5
LD
SLOT

[ST language notation]


SIGNAL1 := IOFB_REQ(SAMPLE1, SAMPLE2, SAMPLE3, SAMPLE4);

• The basic unit slot CPU is specified with variable SAMPLE1, I/O node number =3 is specified with variable SAMPLE2, unit
number =1 is specified with variable SAMPLE3, and slot number =5 is specified with variable SAMPLE4.
• A degeneracy 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 OFF.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
16. I/O Instructions 16-31

I/O Degeneracy Recovery Request

nv dedicated
I/O I/O Degeneracy Recovery Request
instruction
LD/FBD language notation
IORC_REQ
Basic unit slot BASESLOT Execution
output
I/O node number NODE
Unit number UNIT
Slot number SLOT

Modifier EN input Edge execution Index modification


√ √ -
ST language notation Execution output := IORC_REQ(BASESLOT, NODE, UNIT, SLOT);

Arguments:

Arg. Operand Type Const. Description Valid range


BASESLOT UINT √ Basic unit slot 0
NODE UINT √ I/O node number 3 to 34
Input
UNIT UINT √ Unit number 1 to 7
SLOT UINT √ Slot number 0 to 15
Output - BOOL - Execution output

Function:
• A degeneracy 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.
6F8C1226
16. I/O Instructions 16-32

Program example:
[LD/FBD language notation]

IORC_REQ SIGNAL1
SAMPLE1
0 BASESLOT
LD

SAMPLE2
3 NODE
LD

SAMPLE3
1 UNIT
LD
SAMPLE4
5 SLOT
LD

[ST language notation]


SIGNAL1 := IORC_REQ(SAMPLE1, SAMPLE2, SAMPLE3, SAMPLE4);

• The basic unit slot CPU is specified with variable SAMPLE1, I/O node number =3 is specified with variable SAMPLE2, unit
number =1 is specified with variable SAMPLE3, and slot number =5 is specified with variable SAMPLE4.
• A degeneracy 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 OFF.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
17. Process Operation 17-1

17 Process Operation

No. Instruction Remarks


1 Dead Band DB
2 Derivative DIF2
3 Integrator INTG
4 Super Two Degrees of Freedom PID PID2
5 MV Calculation MVS
6 Fix MV MVF
7 Polygonal Line Function PLN
8 Polygonal Line Function (High-Speed PLN_REAL2 nv-Specific Command
Version
9 Inverse Polygonal Line Function ILNL
10 Inverse Polygonal Line Function nv-Specific Command
(High-Speed Version) ILNL_REAL2
11 Dead Time DT
12 Moving Average MAV
13 Moving Average (Low Speed Version) MAV_N
14 Rate Limiter DLM
15 Lag/Lead Filter LAG2
16 Engineering Unit Conversion UNT
17 Percent Conversion PCT
18 Essential Succession PID PID3
19 Estimate with Reset RSM_L TOSDIC-Compatible
Command
Parameter structure (The parameter structures allowed for function are described.)
6F8C1226
17. Process Operation 17-2

Process Operation Dead Band

DB_xxx
Data input IN Output
Diagram
Dead band width H

EN input Edge execution Index modification


Modifier
√ √ —

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 √ Dead band width
Output — See below — Output

Data input DB_xxx Output

Dead band width

Data input, dead band width Symbol (_xxx) Output


INT DB_INT INT
DINT DB_DINT DINT
REAL DB_REAL REAL

Function:
 For data specified with data input IN and dead band width H, if data input IN is outside the dead band width H, the result of
subtracting dead band width H from data input IN is output.
 For data specified with data input IN and dead band width H, if data input IN is inside the dead band width H, 0 is output.

Condition Action
When data IN > 0
Result=IN-|H|
|IN| > |H|
When data IN < 0
Result=IN+|H|
|IN| ≤ |H| Result=0
6F8C1226
17. Process Operation 17-3

Program example:
SAMPLE1 DB_INT SAMPLE3 Result output
140 IN 40
LD ST
SAMPLE2
-100 H
LD
H H Data input IN
Dead band width H

 Performs dead band operation of the input data 140 in variable SAMPLE1 and dead band width 100 in variable SAMPLE2
and stores the difference 40 between the input data and dead band width in variable SAMPLE3 because the data input
exceeds the dead band width.

Error information:
 When input data type is REAL, if NAN data is entered as input, the result is NAN.
 If EN is included, ENO output is reset to OFF when the above error occurs.
6F8C1226
17. Process Operation 17-4

Process Operation Derivative

Instance name
DIF2
Execution flag E OUT Output
Diagram
Data input IN

Rate time T

EN input Edge execution Index modification


Modifier
— — —

Arguments:
Arg. Operand Type Const. Description
E BOOL √ Execution flag
Input IN REAL √ Data input
T REAL √ Rate time (sec)
Output OUT REAL — Output

Instance structure:
Name Type Description
OUT REAL Derivative result output
B4X REAL Previous input (Xn-1)
B4Y REAL Previous output (Yn-1)

Function:
 When Execution Flag E is OFF, Output OUT becomes zero.
 When Execution Flag E is ON, Output OUT becomes (T・S)/(1+T・S).
 The unit of rate time T is seconds. The absolute value of the input data is used as rate time T.
 Differentiation is performed by backward difference method.

DIF2 instance
Execution flag E Action
preprocessing
Xn-1 = Xn Yn= (Xn - Xn-1 +Yn-1) • T / (CT+T)
OFF Yn-1 = 0
T :Rate time
ON — CT :Control scan time
Xn :Current input
Xn-1:Previous input
Yn :Current output
Yn-1: Previous output

Important:
 The scan time of the task using this instruction must be in constant scan mode. (S controller only)
6F8C1226
17. Process Operation 17-5

Program example:
DIF2_01
SIGNAL1 DIF2 SAMPLE3 Control time CT=0.5 seconds
E OUT 150.0
ST Instance content (DIF2_01)
SAMPLE1 (beforeafter operation)
1000.0 IN
LD B4X(Xn-1) :100.01000.0
SAMPLE2
B4Y(Yn-1) :0.0150.0
0.1 T
LD

 When the variable SIGNAL1 is ON, performs differential operation using input data 1000.0 in variable SAMPLE1, rate time
0.1 in variable SAMPLE2, and instance variable DIF2_01, and stores the differential result 150.0 in variable SAMPLE3.

Error information:
 If NAN data is entered in input data, the result is output as NAN.
 If the scan time of the task using this instruction is in floating scan mode, no operation is performed and the specific register
Error Flag is set to ON. (S controller only)
6F8C1226
17. Process Operation 17-6

Process Operation Integrator

Instance name
INTG
Execution flag E OUT Output

Diagram Data input IN

Integral time T

Initial value INI

EN input Edge execution Index modification


Modifier
— — —

Arguments:
Arg. Operand Type Const. Description
E BOOL √ Execution flag
IN REAL √ Data input
Input
T REAL √ Integral time (sec)
INI REAL √ Initial value
Output OUT REAL — Output

Instance structure:
Name Type Description
OUT REAL Integral result output
B4Y REAL Previous output (Yn-1)

Function:
 When Execution Flag E is OFF, initial value INI is output.
 When Execution Flag E is 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.

INTG instance
Execution flag E Action
preprocessing
Result = INI
OFF -
Yn = INI
In case T=0 :Yn = Yn-1
In case T <> 0 :Yn = Xn • CT / T + Yn-1

T :Integral time
ON - CT :Control scan time
Xn :Current input
Yn :Current output
Yn-1 :Previous output
6F8C1226
17. Process Operation 17-7

Important:
 The scan time of the task using this instruction must be in constant scan mode. (S controller only)

Program example:
INTG_01
SIGNAL1 INTG SAMPLE4 Control time CT=0.5 seconds
E OUT 50.0
ST
SAMPLE1
Instance content (INTG_01)
100.0 IN (beforeafter operation)
LD B4Y(Yn-1) :0.050.0
SAMPLE2
1.0 T
LD
SAMPLE3
0.0 INI
LD

 When variable SIGNAL1 is ON, performs integration operation using input data 1000.0 in variable SAMPLE1, integral time
1.0 in variable SAMPLE2, initial value 0.0 in variable SAMPLE3, and instance variable INTG_01, and stores the integration
result 50.0 in variable SAMPLE4.

Error information:
 If NAN data is entered in input data, the result is output as NAN.
 If the scan time of the task using this instruction is in floating scan mode, no operation is performed and the specific register
Error Flag is set to ON. (S controller only)
6F8C1226
17. Process Operation 17-8

Process Operation Super Two Degrees of Freedom PID

Instance name
PID2
Execution flag E D_MV MV output

SV input SV
Diagram
PV input PV

PV parameter variable PV_P

LP parameter variable LP_P

EN input Edge execution Index modification


Modifier
— — —

Arguments:
Arg. Operand Type Const. Description
E BOOL √ Execution flag
SV REAL √ SV input [Engineering value]
Input PV REAL √ PV input [Engineering value]
PV_P PTR — PV parameter variable
LP_P PTR — LP parameter variable
Output D_MV REAL — MV output [%]
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 structure of the PV/LP parameters are described at the end of
this section.
Operand Symbol Type R/W Description
PV_P RH REAL R PV range high [Engineering unit]
(PV_PARA) RL REAL R PV range low [Engineering unit]
LP_P KP REAL R Proportional gain
(LP_PARA) TI REAL R Integral time [minute]
TD REAL R Rate time [minute]
ALP REAL R 2DOF proportionality coefficient
CDR BOOL R Control direction (reverse=0/direct=1)
R/W: R=Read only, W=Write only, RW=Read/Write

Instance structure:
Name Type Description
D_MV REAL MV difference output (MV)[%]
B4SV REAL SV previous value (SVn-1) [%]
SVF REAL SV calculation intermediate value [%]
B4E REAL Deviation previous value (En-1) [%]
B4D REAL Differential previous value (Dn-1) [%]
B4PV REAL PV previous value (PVn-1) [%]
6F8C1226
17. Process Operation 17-9

Function:
 When the Execution Flag E is OFF, initializes the PID2 instance area.
 When Execution Flag E is 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. (=0.1)
 Direct I/O variables cannot be specified for PV parameter variable or LP parameter variable. (S controller only)
PV/LP parameter specification Action Error flag
Non-direct I/O variable Executed —
Direct I/O variable Not executed ON

PID2 instance
Execution flag E Action
preprocessing
SVn-1 = SVn
SVF = SVn SVF = SVn • CT / (CT+TI)
en-1 = SVF - PVn + α • (SVn - SVn-1) • TI / (CT + TI)
Dn-1 = 0 + SVF • TI / (CT + TI)
PVn-1 = PVn ∆MV = (SVF - PVn) - en-1
en = SVF - PVn
OFF
In case TI <> 0:
∆MV = ∆MV+CT • en / TI

In case TD <> 0:
∆D=(-PVn+PVn-1) • TD / (CT+0.1•TD)
- Dn-1 • CT / ( CT+0.1 • TD)
∆MV = ∆MV+∆D
Dn= Dn+ ∆D

In case TD=0:
Dn=0
∆MV = ∆MV • Kp

In case CDR=1:
∆MV = - ∆MV

ON —
Kp :Proportional gain
TI :Integral time
TD :Rate time
CT :Control scan time
 : 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
MV :Output
D :Differential term
Dn :Current differential term
Dn-1 :Previous differential term
6F8C1226
17. Process Operation 17-10

Important:
 The scan time of the task using this instruction must be in constant scan mode. (S controller only)
Program example:
PID2_01
SIGNAL1 PID2 SAMPLE4 Control time CT=0.5 seconds
E D_MV -73.61369
ST
SAMPLE1
500.0 SV
LD
SAMPLE2
0.0 PV
LD
PV_PARA
[n].TAG PV_P
LD
LP_PARA
[m].TAG LP_P
LD

 When variable SIGNAL1 is ON, performs two degrees of freedom PID operation using SV input data 500.0 in variable
SAMPLE1, PV input data 0.0 in variable SAMPLE2, PV parameter variable PV_P, and LP parameter variable LP_P and
stores the result in variable SAMPLE4.

Error information:
 If NAN data is entered in input data, the result is output as NAN.
 If RH=RL, the Divide Error Flag is set to ON and 0 is output.
 If the PV parameter or LP parameter specification is invalid (such as specifying variable other than PV/LP tag parameter),
Table Operation Error is set to ON and 0 is output. (L controller only)
 If direct I/O variable is specified for PV parameter variable and LP parameter variable, no operation is performed and the
specific register Error Flag is set to ON. (S controller only)
 If the scan time of the task using this instruction is in floating scan mode, no operation is performed and the specific register
Error Flag is set to ON. (S controller only)
6F8C1226
17. Process Operation 17-11

Process Operation MV Calculation

Instance name
MVS
Execution flag E OUT Output

MV difference input IN
Diagram
MV initial value MV0

MV input MV

LP parameter variable LP_P

EN input Edge execution Index modification


Modifier
— — —

Arguments:
Arg. Operand Type Const. Description
E BOOL √ Execution flag
IN REAL √ MV difference input [%]
Input MV0 REAL √ MV initial value[%]
MV REAL √ MV input[%]
LP_P PTR — LP parameter variable
Output OUT REAL — Output [%]
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 [%]
LP_P
MH REAL R MV high limit [%]
(LP_PARA)
ML REAL R MV low limit [%]
R=Read only, W=Write only, RW=Read/Write

Instance structure:
Name Type Description
OUT REAL Output (MV) [%]
MVW REAL MV work [%]

Function:
 When the Execution Flag is OFF, performs MV operation and outputs the result.
 When the Execution Flag is 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.
6F8C1226
17. Process Operation 17-12

Direct I/O variables cannot be specified for LP parameter variables. (S controller only)
LP parameter specification Action Error flag
Non-direct I/O variable Executed —
Direct I/O variable Not executed ON

Execution flag E MVS instance preprocessing Action


MVW = MVW + IN MV high limit
MV rate limit when work > MH
when |MVW-MV| > DMV work = MH
when in increase direction MV low limit
OFF work = MV + DMV when work < ML
when in decrease direction work = ML
work = MV - DMV
when |MVW-MV| ≤ DMV Result output = work
work = MVW
ON MVW = MV0 In the above Algorithm:
work = MVW ML: MV low limit, MH: MV high limit
DMV: MV rate limit, MVW: MV work
work: MV calculation work

Program example:
MVS_01
SIGNAL1 MVS LP_DATA[m].MV
0 60.0 LP parameter (LP_P)
E OUT
LD ST
SAMPLE1
10.0 IN 100.0 DMV
LD 125.0 MH
SAMPLE2 -25.0 ML
50.0 MV0
LD
LP_DATA[m].MV
50.0 MV
LD
LP_PARA
[m].TAG LP_P
LD

Before operation: After operation:


Instance (MVS_01) Instance (MVS_01)
50.0 MVW 60.0 MVW

 When the variable SIGNAL1 is OFF, MV operation is performed against the MV difference input 10.0 in variable SAMPLE1
using the MV input and LP parameter LP_P, and the result 60.0 is stored in LP_DATA[m].MV.
6F8C1226
17. Process Operation 17-13

Error information:
 If NAN data is entered in input data, the result is output as NAN.
 If the LP parameter specification is invalid (such as specifying variable other than LP tag parameter), Table Operation Error
is set to ON and 0 is output. (L controller only)
 If direct I/O variable is specified for LP parameter variable, no operation is performed and the specific register Error Flag is
set to ON. (S controller only)
6F8C1226
17. Process Operation 17-14

Process Operation Fix MV

MVF
Execution flag E Q Output

Diagram MV fixed value IN

LP data variable LP_D LP_D LP data variable

EN input Edge execution Index modification


Modifier
√ √ —

Arguments:
Arg. Operand Type Const. Description
E BOOL √ Execution flag
Input
IN REAL √ MV fixed value[%]
Input/Output 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
LP_D MV REAL W MV value[%]
(LP_DATA) SMV BOOL W SEQ-MV operation
R/W : R=Read only, W=Write only

Function:
 When Execution Flag E is ON, registers the MV fixed value (set SMV flag).
 When Execution Flag E is OFF, unregisters the MV fixed value (reset SMV flag).
 Direct I/O variables cannot be specified for LP data variables. (S controller only)
LP data specification Action Error flag
Non-direct I/O variable Executed —
Direct I/O variable Not executed ON

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.

Program example:
SIGNAL1 MVF SAMPLE3
0 E 80.0
LD ST
SAMPLE1
80.0 IN
LD
LP_DATA LP_DATA
[m].SV LP_D LP_D [m].SV
LD LD

 When variable SIGNAL1 is ON, stores the MV input 80.0 specified with variable SAMPLE1 in LP data MV and sets the SMV
flag. When variable SIGNAL1 is OFF, the SMV flag is reset.
 Input value SAMPLE1 is output to SAMPLE3 unchanged.
6F8C1226
17. Process Operation 17-15

Error information:
 If NAN data is entered in input data, the result is output as NAN.
 If the LP data specification is invalid (such as specifying variable other than LP tag data), Table Operation Error is set to ON
and 0 is output. (L controller only)
 If direct I/O variable is specified for LP data variable, no operation is performed and the specific register Error Flag is set to
ON. (S controller only)
 If EN is included, ENO output is reset to OFF when the above error occurs.
6F8C1226
17. Process Operation 17-16

Process Operation Polygonal Line Function

PLN_xxx
Data input IN Output
Diagram
Polynomial line table TBL

EN input Edge execution Index modification


Modifier
√ √ —

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

PLN_xxx
Data input IN Output

Polynomial line table TBL

Data input Symbol (_xxx) Output


INT PLN_INT INT
REAL PLN_REAL REAL

Function:
 With the input data IN as X axis input, outputs the Y axis approximation result using the function table specified with the
polygonal line table TBL.
 The size and structure of the polygonal line table are as follows. Different table formats are used for INT data and REAL
data.

[PLN_INT] [PLN_REAL]
Maximum points: 40 Maximum points: 11
Table top address: Point n When less than 11 points: Add two end codes (H80000000)
15 0 31 0
Number of points n X0
X0 Y0
Y0 X1
X1 Y1
11 points maximum
Y1 40 points maximum

Xn-1 When less than 11 points, end code (H80000000)


Yn-1 When less than 11 points, end code (H80000000)

 Data must be stored in the polygonal table such that X0 < X1 <・・・Xn-1.
 When data input IN ≤ X0, the corresponding Y value is Y0 and when data input IN ≥ Yn-1, the Y value is Yn-1.
 Direct I/O variable cannot be specified for polygonal line table.
Table specification Action Error flag
Non-direct I/O variable Executed —
Direct I/O variable Not executed ON

f(x) = (IN – Xn-1) • (Yn-Yn-1) / (Xn-Xn-1) + Yn-1


Where Xn-1 and Xn are values enclosing input data IN (Xn-1 ≤ IN < Xn) and Yn-1 and Yn correspond to Xn-1 and Xn.

Program example:
6F8C1226
17. Process Operation 17-17

SAMPLE1 PLN_REAL SAMPLE3 Variable declaration


40 IN 80
LD ST Variable Data type Comment Dec.
SAMPLE2 SAMPLE1 Real Data Input VAR
4 TBL SAMPLE2 Array[0..21] Polynomial line VAR
LD of Real table

Y
SAMPLE2:Polynomial line table
100
-100 X0 SAMPLE3:80
50 Y0
-50 X1
-100 Y1
0 X2
X
0 Y2 -100 IN 100
50 X3
100 Y3
100 X4
-100 Y4
-100

 For input data in variable SAMPLE1, calculates the Y corresponding to input data 40 based on polygonal line table specified
with variable SAMPLE2 and stores the result 80 in SAMPLE3.

Error information:
 When input data type is REAL, if NAN data is entered as input, the result is NAN.
 If direct I/O variable is specified for polygonal line table, no operation is performed and the specific register Error Flag is set
to ON.
 If EN is included, ENO output is reset to OFF when the above error occurs.
6F8C1226
17. Process Operation 17-18

Polygonal Line Function (high-speed version)

nv dedicated
Process Operation Polygonal Line Function (high-speed version)
instruction
LD/FBD language PLN_REAL2
notation
Data input IN Output
Polygonal line
table TBL
Modifier EN input Edge execution Index modification
√ √ -
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

Maximum points: 11, Table top address: Point n


31 0
Number of points n
X0
Y0
X1
Y1 11 points maximum

Xn-1
Yn-1

 Data must be stored in the polygonal line table such that X0 < X1 <・・・Xn-1.
 When data input IN ≦ X0, the corresponding Y value is Y0 and when data input IN ≧Xn-1, the Y value is Yn-1.
 Output = (IN-Xn-1)  (Yn-Yn-1)/(Xn-Xn-1)+Yn-1
Where Xn-1 and Xn are values enclosing input data IN (Xn-1≦IN<Xn) and Yn-1 and Yn correspond to Xn-1 and Xn.
6F8C1226
17. Process Operation 17-19

 When point count =0 is specified, Result = Input data.

Program example:
[LD/FBD language notation]
SAMPLE1 PLN_REAL2 SAMPLE3 Structure declaration: type PLN_REAL2
40 IN 80 Member name Data type
LD ST
NUM DINT
SAMPLE2
5 TBL POINT ARRAY [0..21] OF REAL
LD
Variable declaration
Variable Data type Dec.
name
SAMPLE2: Polygonal line table
SAMPLE1 REAL VAR
5 NUM SAMPLE2 type PLN_REAL2 VAR
Y
-100 X0
100
50 Y0
SAMPLE3:80
-50 X1
-100 Y1
0 X2
0 Y2
X
50 X3 -100 IN 100
100 Y3
100 X4
-100 Y4
-100

[ST language notation]


SAMPLE3 := PLN_REAL2 (SAMPLE1, SAMPLE2);
 For input data in variable SAMPLE1, the Y corresponding to input data 40 is calculated based on polygonal line table
specified with variable SAMPLE2. The result "80" is stored to variable SAMPLE3.

Error information:
 When polygonal line table exceeds the variable area, the polygonal line function is not processed, and data boundary over
occurs.
 When input data type is REAL, the operation is as follows.

Controller Action
Unified Controller nv series Nonnumeric and infinite data is limited to the maximum value in calculation.

 When I/O variable is specified directly for polygonal line table, the operation is as follows.

Controller Action
Unified Controller nv series Error flag and table operation error are set to ON, and Result =0.

 If the specified point count exceeds 11, it is limited to 11 in calculation.


 When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
17. Process Operation 17-20

Process Operation Inverse Polygonal Line Function

ILNL_xxx
Data input IN Output
Diagram
Polynomial line table TBL

EN input Edge execution Index modification


Modifier
√ √ —

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

ILNL_xxx
Data input IN Output

Polynomial line table TBL

Data input Symbol (_xxx) Output


INT ILNL_INT INT
REAL ILNL_REAL REAL

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.
 The size and structure of the polygonal line table are as follows.

[ILNL_INT] [ILNL_REAL]
Maximum points: 40 Maximum points: 11
Table top address: Point n When less than 11 points: Add two end codes (H80000000)
15 0 31 0
Number of points n X0
X0 Y0
Y0 X1
X1 Y1
11 points maximum
Y1 40 points maximum

Xn-1 When less than 11 points: End code (H80000000)


Yn-1 When less than 11 points: End code (H80000000)

 Data must be stored in the polygonal table such that X0 < X1 <・・・ Xn-1.
 If data input IN intersects the polygonal line at two or more places, the one with the smallest X value has priority.
6F8C1226
17. Process Operation 17-21

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

Y
a
(X5,Y5) Output X5 when input value is a
Output X2 when input value is b
(X0,Y0) (X4,Y4)
(X1,Y1) (X3,Y3)
(X2,Y2)

b
X
X2 X5

 Direct I/O variable cannot be specified for polygonal line table.


Table specification Action Error flag
Non-direct I/O variable Executed —
Direct I/O variable Not executed ON

f(x) = (IN – Yn-1) ・ (Xn-Xn-1) / (Yn-Yn-1) + Xn-1


Where Yn-1 and Yn are values enclosing input data IN (Yn-1 ≤ IN < Yn) and Xn-1 and Xn correspond to Yn-1 and Yn.
6F8C1226
17. Process Operation 17-22

Program example:
SAMPLE1 ILNL_REAL SAMPLE3 Variable declaration
80 IN 40
LD ST Variable Data type Comment Dec.
SAMPLE2 SAMPLE1 Real Data Input VAR
4 TBL
SAMPLE2 Array[0..21] Polynomial line VAR
LD
of Real table

SAMPLE2:Polynomial line table Y


100
-100 X0
IN
50 Y0
-50 X1
-100 Y1
0 X2
0 Y2 X
50 X3 -100 100
100 Y3
100 X4 SAMPLE3
-100 Y4 =40
-100

 For input data in variable SAMPLE1, calculates the X corresponding to input data 80 based on polygonal line table specified
with variable SAMPLE2 and stores the result 40 in SAMPLE3.

Error information:
 When input data type is REAL, if NAN data is entered as input, the result is NAN.
 If direct I/O variable is specified for polygonal line table, no operation is performed and the specific register Error Flag is set
to ON.
 If EN is included, ENO output is reset to OFF when the above error occurs.
6F8C1226
17. Process Operation 17-23

Inverse Polygonal Line Function (high-speed version)

Inverse Polygonal Line Function nv dedicated


Process Operation
(high-speed version) instruction
LD/FBD language ILNL_REAL2
notation
Data input IN Output
Polygonal line
table TBL
Modifier EN input Edge execution Index modification
√ √ -
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

Maximum points: 11, Table top address: Point n


31 0
Number of points n
X0
Y0
X1
Y1 11 points maximum

Xn-1
Yn-1
 Data must be stored in the polygonal line table such that X0 < X1 <・・・ Xn-1.
 If data input IN intersects the polygonal line at two or more places, the one with the smallest X value has priority.
6F8C1226
17. Process Operation 17-24

Output X

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

Y
a
(X5,Y5) 入力値がaの場合は X5value
Output X5 when input を出力 is a
(X0,Y0) 入力値がbの場合は X2value
Output X2 when input を出力 is b
(X4,Y4)
(X1,Y1) (X3,Y3)
(X2,Y2)

b
X2 X5 X

 I/O variable cannot be specified directly for polygonal line table.

Xn - X n-1
f(x)=(IN-Yn-1)  + X n-1
Yn - Y n-1
Where Yn-1 and Yn are values enclosing input data IN (Yn-1≦IN<Yn) and Xn-1 and Xn correspond to Yn-1 and Yn.
 When point count =0 is specified, Result = Input data.
6F8C1226
17. Process Operation 17-25

Program example:
[LD/FBD language notation]
SAMPLE1 ILNL_REAL2 SAMPLE3 Structure declaration: type ILNL_REAL2
80 IN 80 Member name Data type
LD ST
NUM DINT
SAMPLE2
TBL POINT ARRAY [0..21] OF REAL
5
LD
Variable declaration
Variable Data type Dec.
SAMPLE2: Polygonal table Name
SAMPLE1 REAL VAR
5 NUM SAMPLE2 type ILNL_REAL2 VAR
-100 X0 Y
50 Y0 100
-50 X1 IN
-100 Y1
0 X2
0 Y2
50 X3 X
100 Y3 -100 100
100 X4
-100 Y4 SAMPLE3:40

-100

[ST language notation]


SAMPLE3 := ILNL_REAL2 (SAMPLE1, SAMPLE2);

 For input data in variable SAMPLE1, the X corresponding to input data 80 is calculated based on polygonal line table
specified with variable SAMPLE2. The result "40" is stored to variable SAMPLE3.

Error information:
 When polygonal line table exceeds the variable area, the inverse polygonal line function is not processed, and data
boundary over occurs.
 When input data type is REAL, the operation is as follows.

Controller Action
Unified Controller nv series Nonnumeric and infinite data is limited to the maximum value in calculation.

 When I/O variable is specified directly for polygonal line table, the operation is as follows.

Controller Action
Unified Controller nv series Error flag and table operation error are set to ON, and Result =0.

 If the specified point count exceeds 11, it is limited to 11 in calculation.


 When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
17. Process Operation 17-26

Process Operation Dead Time

DT
Execution flag E Output

Data input IN

Diagram Sample count I

Sampling time T

Work M M Work

EN input Edge execution Index modification


Modifier
√ √ —

Arguments:
Arg. Operand Type Const. Description
E BOOL √ Execution flag
IN REAL √ Data input
Input
I INT √ Sample number
T INT √ Sampling time (0.1 sec. unit)
Input/Output M PTR — Work (6+I2 words)
Output — REAL — Output

Function:
 When Execution Flag E is OFF, data input IN is output as the result.
 When the Execution Flag is ON, dead time operation is performed for data input IN and the result is output.
 Sampling time is set in 0.1 second units.
 Sampling number must be between 1 and 256.
 If sampling time T > scan time, linear interpolation is performed between samples.
 If sample number I ≤ 0, no dead time operation is performed.
 If the sample number is changed during dead time operation, the result is unpredictable.
 Specify the data save area used by the DT instruction for work. The size of the work depends on the sample number I (6+I2
words).
 Direct I/O variable cannot be specified for work.
Work specification Action Error flag
Non-direct I/O variable Executed —
Direct I/O variable Not executed ON
6F8C1226
17. Process Operation 17-27

[Size and structure of work]


15 0
Timer counter
Sample data counter
Current output
[2 words]
Previous difference
[2 words] Maximum number of words:
518 words
(6+2562 words)

Sample value
(I2 words)

Execution flag E Action


OFF Result output =Data input IN
ON Result output=Dead time
operation result

Program example:
SIGNAL1 DT SAMPLE4 Arg. declaration
1 E 20 Variable Data type Dec. Comment
LD ST
SIGNAL1 BOOL VAR Execution flag
SAMPLE1
160 IN
SAMPLE1 REAL VAR Data input
LD SAMPLE2 INT VAR Sampling time
SAMPLE3 ARRAY[0..11] VAR W ork
3 I OF INT
LD
SAMPLE4 REAL VAR Result output
SAMPLE2
10 T
LD
SAMPLE3 SAMPLE3
5 M M
LD ST
6F8C1226
17. Process Operation 17-28

Input X

Scan time
(0.5[s])
Sampling period
(10 [0.1s])
Output Y

Dead time (number of samples=3)


<Before execution> SAMPLE3Work area <After execution> SAMPLE3Work area
5 Timer counter 0 Timer counter
1 Sample data counter 2 Sample data counter
15 Current output 20 Current output

5 Previous difference 10 Previous difference

80 Sample value 80 Sample value

20 160

40 40

 When the execution flag in variable SIGNAL1 is ON, dead time operation is performed using data input in variable
SAMPLE1, sample number 3, sample period in variable SAMPLE2, and work specification in variable SAMPLE3. The result
is stored in variable SAMPLE4.

Error information:
 If NAN data is entered in input data, the result is output as NAN.
 If the sample number exceed 256, operation is performed with 256 as the limit.
 If the sample number is changed during dead time operation, the result is unpredictable.
 Do not write to work. The result is unpredictable.
 If direct I/O variable is specified for work, no operation is performed and the specific register Error Flag is set to ON.
 If EN is included, ENO output is reset to OFF when the above error occurs.
6F8C1226
17. Process Operation 17-29

Process Operation Moving Average

MAV
Execution flag E Output

Data input IN

Diagram Number of samples I

Sample period T

Work M M Work

EN input Edge execution Index modification


Modifier
√ √ —

Arguments:
Arg. Operand Type Const. Description
E BOOL √ Execution flag
IN REAL √ Data input
Input
I INT √ Number of Samples
T INT √ Sampling period (0.1 sec. unit)
Input/Output M PTR — Work (6+I2 words)
Output — REAL — Output

Function:
 When Execution Flag E is OFF, data input IN is output as the result.
 When the Execution Flag is ON, moving average operation is performed for data input IN and the result is output.
 Sampling time is set in 0.1 second units.
 Sample number must be between 1 and 256.
 When sampling time T > scan time, the output at sampling time is output once more (retained).
 When sample number I ≤ 0, no moving average operation is performed.
 If the sample number is changed during moving average operation, the result is unpredictable.
 Specify the data save area used by the MAV instruction for work. The size of the work depends on the sample number I
(6+I2 words).
 Direct I/O variable cannot be specified for work variable.
Work specification Action Error flag
Non-direct I/O variable Executed —
Direct I/O variable Not executed ON
6F8C1226
17. Process Operation 17-30

[Size and structure of work]


15 0
Timer counter
Sample data counter
Current output
[2 words]
Previous difference
[2 words] Maximum number of words
518 words
(6+2562 words)

Sample value
(I2 words)

Execution flag E Action


OFF Result output =Data input IN
ON Result output=Moving average
operation result

Program example:
SIGNAL1 MAV SAMPLE4 Arg. declaration:
1 E 93.333 Variable Data type Dec. Comment
LD ST
SIGNAL1 BOOL VAR Execution flag
SAMPLE1
160 IN SAMPLE1 REAL VAR Data input
LD SAMPLE2 INT VAR Sampling time
SAMPLE3 ARRAY[0..11] VAR Work
3 I OF INT
LD
SAMPLE2
SAMPLE4 REAL VAR Result output
10 T
LD
SAMPLE3 SAMPLE3
5 M M 0
LD ST
6F8C1226
17. Process Operation 17-31

(6) (7)
(8)
Input X (5)
(9)
(4) (10)
(3)
(2)
(1)

Scan time
(0.5[s])
Sampling period
(10[0.1s])
((5)+(6)+(7))/3 ((6)+(7)+(8))/3
Output Y ((4)+(5)+(6))/3

((2)+(3)+(4))/3 ((7)+(8)+(9))/3

((8)+(9)+(10))/3
((3)+(4)+(5))/3

<Before execution> SAMPLE4:Work area <After execution> SAMPLE4Work area


5 Timer counter 0 Timer counter
1 Sample data counter 2 Sample data counter
46.667 Current output 93.333 Current output

140 Sample value total 280 Sample value total

80 Sample value 80 Sample value

20 160

40 40

 When the execution flag in variable SIGNAL1 is ON, moving average operation is performed using data input in variable
SAMPLE1, sample number 3, sample period in variable SAMPLE2, and work specification in variable SAMPLE3. The result
is stored in variable SAMPLE4.

Error information:
 If NAN data is entered in input data, the result is output as NAN.
 If the sample number exceed 256, operation is performed with 256 as the limit.
 If the sample number is changed during moving average operation, the result is unpredictable.
 Do not write to work. The result is unpredictable.
 If direct I/O variable is specified for work, no operation is performed and the specific register Error Flag is set to ON.
 If EN is included, ENO output is reset to OFF when the above error occurs.
6F8C1226
17. Process Operation 17-32

Moving Average (low speed version)

Process Operation Moving Average (low speed version)


LD/FBD language MAV_N
notation Execution E Output

Data IN

Sample I

Sampling cycle T

Work M M Work

Modifier EN input Edge execution Index modification


√ √ -
ST language notation Output := MAV_N(E, IN, I, T, M);

Arguments:

Arg. Operand Type Const. Description


E BOOL √ Execution flag
IN REAL √ Data input
Input
I INT √ Sample count
T INT √ Sampling cycle (0.1ms unit)
Input/output M PTR - Work (6+I2 words)
Output - REAL - Output

Function:
 When execution flag E is OFF, data input IN is output as the result.
 When execution flag E is ON, moving average operation is performed for data input IN and the result is output.
 Sampling time is set in 0.1 second units.
 Sample count must be between 1 and 256.
 When sampling time T > scan time, the output at sampling time is output once more (retained).
 When sample number I ≦ 0, no moving average operation is performed.
 If the sample number is changed during moving average operation, the result becomes undefined.
 Specify the data save area used by the MAV instruction for work. The size of the work depends on the sample count I (6+I2
words).
 I/O variable cannot be specified directly for work.
6F8C1226
17. Process Operation 17-33

15 0
Timer counter
Sample data counter
Current output
[2 words]
Sample value total
[2 words] Maximum number
of words: 518 words
(6+2562 words)

Sample value
(I2 Words)

Execution flag E Processing


FALSE(OFF) Result output = Data input IN
TRUE(ON) Result output = Moving average operation result

● Important
・If sample count is changed during moving average operation, the result output becomes
unstable.
・Do not write to work. The result output becomes undefined.
・The difference between Moving Average (low speed version) and Moving Average (high speed
version) is in the summation operation to calculate the moving average. The following table
describes the algorithm, advantage, and disadvantage of using the summation operation to
be considered.

Moving Average (high speed version):


Moving Average (low speed version): MAV_N
MAV
<Summation formula> <Summation formula>
Algorithm Sample value total - Oldest sample value +
Σ(Sample value)
Latest sample value
Execution time is short because
No operation error occurs because summation
summation operation is not performed for
Advantage operation is performed for the number of times of
the number of times of sample count in
sample count in sampling timing.
sampling timing.
Operation errors are accumulated in the Execution time is long because summation operation is
Disadvantage summation value depending on the input performed for the number of times of sample count in
value. sampling timing.
6F8C1226
17. Process Operation 17-34

Program example:
[LD/FBD language notation]

SIGNAL1 MA _ SAMPLE4
1 E 93.333
L ST
S MPLE1 Arg.declaratio
16 I
L Variable Data Commen Dic
SIGNAL BOOL Execution flag VAR
3 I SAMPLE REAL Data input VAR
L Sampling cycle VAR
SAMPLE INT
SAMPLE2 SAMPLE ARRAY[0..11] OF INT Work VAR
1 T
SAMPLE REAL Result output VAR
L
SAMPLE3 SAMPLE3
5 M M 0
L ST

[ST language notation]


SAMPLE4 := MAV_N(SIGNAL1, SAMPLE1, 3, SAMPLE2, SAMPLE3);

 When the execution flag in variable SIGNAL1 is ON, moving average operation is performed using data input in variable
SAMPLE1, sample number 3, sample cycle in variable SAMPLE2, and work specification in variable SAMPLE3. The result
is stored in variable SAMPLE4.

Error information:
 When work exceeds the variable area, moving average is not processed, and data boundary over occurs.
 When input data type is REAL, the operation is as follows.

Controller Action
Integrated Controller V series Nonnumeric and infinite data is limited to the
Unified Controller nv series maximum value in calculation.

 If the specified sample count exceeds 256, it is limited to 256 in calculation.


 When I/O variable is specified directly for work, the operation is as follows.

Controller Action
Integrated Controller V series Error flag is set to ON, and Result =0.
Error flag and table operation error are set to ON,
Unified Controller nv series
and Result =0.

 When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
17. Process Operation 17-35

Process Operation Rate Limiter

Instance name
DLM_xxx
Execution flag E OUT Output
Diagram
Data input IN

Rate limit D

EN input Edge execution Index modification


Modifier
— — —

Arguments:
Arg. Operand Type Const. Description
E BOOL √ Execution flag
Input IN See below √ Data input
D See below √ Rate limit
Output OUT See below — Output

Instance name
DLM_xxx
Execution flag E OUT Output

Data input IN

Rate-of-change limit D

Data input Instance


Symbol (_xxx) Output
Rate limit (OUT/B4Y)
INT DLM_INT INT INT
DINT DLM_DINT DINT DINT
REAL DLM_REAL REAL REAL

Instance structure:
Name Type Description
OUT See above Output
B4Y See above Previous output (Yn-1)
6F8C1226
17. Process Operation 17-36

Function:
 When Execution Flag E is OFF, data input IN is output as the result.
 When the Execution Flag E is ON, the rate limit is calculated for data input IN and the result is output.
Execution flag E Action
OFF Result output = IN
Difference = IN - Yn-1
In case +|D| ≥ Difference ≥ –|D|: Yn=IN
In case +|D| < Difference: Yn = Yn-1 + |D|
When –|D| > Difference: Yn = Yn-1 - |D|

ON In the above Algorithm:


IN :Data input
Yn :Current output
Yn-1 :Previous output
D :Rate limit

Program example:
DLM_01
SIGNAL1 DLM_REAL SAMPLE3
1 E OUT 100
LD ST
SAMPLE1
120 IN
LD
SAMPLE2
50 D
LD

Before operation: After operation:


Instance (DLM_01) Instance (DLM_01)
50.0 B4Y 100.0 B4Y

 When the variable SIGNAL1 is ON, rate limit is calculated for data input 120 in variable SAMPLE1 using the rate limit 50 in
variable SAMPLE2 and previous output B4Y 50 stored in instance variable DLM_01, and the result 100 is stored in variable
SAMPLE3.

Error information:
 When input data type is REAL, if NAN data is entered as input, the result is NAN.
6F8C1226
17. Process Operation 17-37

Process Operation Lag/Lead Filter

Instance name
LAG2
Execution flag E OUT Output

Diagram Data input IN

Lead time T1

Lag time T2

EN input Edge execution Index modification


Modifier
— — —

Arguments:
Arg. Operand Type Const. Description
E BOOL √ Execution flag
IN REAL √ Data input
Input
T1 REAL √ Lead time (second)
T2 REAL √ Lag time (second)
Output OUT REAL — Output

Instance structure:
Name Type Description
OUT REAL Output
B4X REAL Previous input (Xn-1)
B4Y REAL Previous output (Yn-1)

Function:
 When Execution Flag E is OFF, data input IN is output as the result.
1  T1 S
 When the Execution Flag E is ON,  X is calculated for data input IN and the result is output.
1  T2  S
 The absolute values of lead time T1 and lag time T2 are used for the operation.

Execution flag E LAG2 instance Action


preprocessing
Xn-1= Xn
OFF Yn-1= Xn Yn=Xn • CT/(CT+T2)
+ (Xn-Xn-1) • T1/(CT+T2)
ON — + Yn-1 • T2/(CT+T2)

T1 :Lead time
T2 :Lag time
CT :Control scan time
Xn :Current input
Xn-1 :Previous input
Yn :Current output
Yn-1 :Previous output
6F8C1226
17. Process Operation 17-38

Important:
 The scan time of the task using this instruction must be in constant scan mode. (S controller only)

Program example:
LAG2_01
SIGNAL1 LAG2 SAMPLE4 Before operation :Instance (LAG2_01)
1 E OUT 712.0
LD ST 1000.0 B4X
SAMPLE1 640.0 B4Y
1000.0 IN
LD
SAMPLE2
1.0 T1
LD After operation :Instance (LAG2_01)
SAMPLE3 1000.0 B4X
2.0 T2 712.0 B4Y
LD

 When variable SIGNAL1 is ON, lag/lead filter operation is performed for data input 1000.0 in variable SAMPLE1 using the
lead time 1.0 in variable SAMPLE2, lag time 2.0 in variable SAMPLE3, and instance variable LAG2_01, and the result 712.0
is stored in variable SAMPLE4.

Error information:
 If NAN data is entered in input data, the result is output as NAN.
 If the scan time of the task using this instruction is in floating scan mode, no operation is performed and the specific register
Error Flag is set to ON. (S controller only)
6F8C1226
17. Process Operation 17-39

Process Operation Engineering Unit Conversion

UNT
Data input IN Output
Diagram
PV parameter PV_RH

EN input Edge execution Index modification


Modifier
√ √ —

Arguments:
Arg. Operand Type Const. Description
IN REAL √ Data input [%]
Input
PV_RH PTR — PV parameter (RH)
Output — REAL — Output [Engineering unit]

Function:
 Converts data input IN to engineering units from range high limit (RH) and range low limit (RL) of PV parameter table and
outputs the result.
 The structure of the PV parameters is described at the end of this chapter.
 Direct I/O variable cannot be specified for PV parameter. (S controller only)
PV parameter specification Action Error flag
Non-direct I/O variable Executed —
Direct I/O variable Not executed ON
Output = (RH - RL) / 100 ( Input + RL

Program example:
 EMBED Word.Picture.8 
 Performs engineering unit conversion of the data input 80.0 in variable SAMPLE1 using RH100.0 and
RL100.0 in the PV parameter variable and stores the result 60.0 in variable SAMPLE2.

Error information:
 If NAN data is entered in input data, the result is output as NAN.
 If direct I/O variable is specified for PV parameter, no operation is performed and the specific
register Error Flag is set to ON. (S controller only)
 If EN is included, ENO output is reset to OFF when the above error occurs.
6F8C1226
17. Process Operation 17-40

Process Operation Percent Conversion

PCT
Data input IN Output
Diagram
PV parameter PV_RH

EN input Edge execution Index modification


Modifier
√ √ —

Arguments:
Arg. Operand Type Const. Description
IN REAL √ Data input [Engineering unit]
Input
PV_RH PTR — PV parameter (RH)
Output — REAL — Output [%]

Function:
 Converts data input IN to % from range high limit (RH) and range low limit (RL) of PV parameter table and outputs the result.
 The structure of the PV parameters is described at the end of this chapter.
 Direct I/O variable cannot be specified for PV parameter. (S controller only)
PV parameter specification Action Error flag
Non-direct I/O variable Executed —
Direct I/O variable Not executed ON
Output = 100 / (RH - RL)  (Input - RL)

Program example:
SAMPLE1 PCT SAMPLE2 PV parameter
80.0 IN 90.0 PV_PARA[n].RH = 100.0
LD ST PV_PARA[n].RL = -100.0
PV_PARA[n].RH
100.0 PV_RH
LD

 Performs reverse engineering unit conversion of the data input 90.0 in variable SAMPLE1 using RH100.0 and RL-100.0 in
the PV parameter variable and stores the result 80.0 in variable SAMPLE2.

Error information:
 If NAN data is entered in input data, the result is output as NAN.
 If RH=RL, the Divide Error Flag is se to ON due to zero divide and the output is as follows:
 Output = (+Infinity when Input > RL, -Infinity when Input < RL)
 If direct I/O variable is specified for PV parameter, no operation is performed and the specific register Error Flag is set to ON.
(S controller only)
 If EN is included, ENO output is reset to OFF when the above error occurs.
6F8C1226
17. Process Operation 17-41

Process Operation Essential Succession PID


Diagram
Instance name
PID3
Execution control input E Q Execution output

LP parameter LP_P MV Manipulated value

PV data/setting PV_D PV_D PV data/setting

Modifier EN input Edge execution Index modification


— — —

Arguments:
Arg. Operand Type Const. Description
E BOOL √ Execution control input
Input
LP_P PTR — LP parameter
Output Q BOOL — Execution output
MV REAL — Manipulated value
I/O PV_D PTR — PV data/setting
The structures of the PV_D and LP_P parameters are described at the end of this chapter.

Parameter Structure:
PV data/setting
Name Type Description Unit
PVC REAL Process measurement input (Range: 0.0 to 100.0) %
ASV REAL Auto mode setting (Range: 0.0 to 100.0) %
CSV REAL Cascade mode setting (Range: 0.0 to 100.0) %
MMV REAL Manual mode manipulated value input (Range: -25.0 to 125.0) %
TMV REAL MV tracking input (Range: -25.0 to 125.0) %
MODE DWORD Mode setting
31 2 1 0
TR MODE

Operation mode specification MODE: bits <1-0>


00: Manual mode
01: Auto mode
10: Cascade mode
11: (Auto mode)
Tracking specification TR: Bit <2>
0: No
1: Yes
6F8C1226
17. Process Operation 17-42

LP parameter
Name Type Description Unit
Kp REAL Proportional gain
TI REAL Integral time min.
TD REAL Rate time min.
GP REAL Gap (Range: 0.0 to 10.0) %
ISV REAL Auto mode setting initial value (Range: 0.0 to 100.0) %
FT REAL Process input filter coefficient (Range: 0.1 to < 1)
DSV REAL Setting ASV rate-of-change limit % / t
DMMV REAL Manual mode manipulated value MMV rate-of-change limit % / t
STS DWORD Status
31 2 1 0
DR IMODE
Initial mode specification IMODE: bits <1 to 0>
00: Manual mode
01: Auto mode
10: Cascade mode
11: (Auto mode)
Polarity D/R specification DR: bit <2>
0: Direct
1: Reverse
MH REAL Manipulated value high limit (Range: -25.0 to 125.0) %
When MH < ML, MH=ML is assumed.
ML REAL Manipulated value low limit (Range: -25.0 to 125.0) %
DMV REAL Manipulated value rate-of-change limit % / t
N REAL Control cycle setting (Range: N ≥ 1)
PID operation is performed every N scan.
When N ≤ 0, N=1 is assumed.

Instance structure:
Name Type Description Unit
Q BOOL Execution output
MV REAL Manipulated value (Range: -25.0 to 125.0) %
B4E REAL Previous error (en-1)
B4D REAL Previous derivative term (Dn-1)
B4PV REAL Previous PV (PVn-1)
B4SV REAL Previous SV (SVn-1)
MVN REAL Current manipulated value
C REAL Internal counter
Counts the number of scans.
Decrements internal counter each scan starting from C=N. When
C ≤ 0, PID operation is performed and C is set equal to N once more.
DT0 REAL Control cycle (Δt) Sec.
* In Function - [Algorithm], this is denoted with the symbol in parentheses in the Description column.
6F8C1226
17. Process Operation 17-43

Function:
 Performs Essential Succession (Pre-derivative real PID algorithm) PID operation as follows for PV data/setting stored in
PV_D based on the parameter specified with LP_P and outputs the manipulated value MV as the result.
 The execution control input E and execution output Q are set as follows:
Execution control input E Action Execution
output Q
OFF Initialized OFF
C≤0 Executed ON
ON
C>0 Not executed OFF
 Direct I/O variables cannot be specified for PV_D data/setting and LP parameter variables.
PV_D/LP_P parameter Action Error flag
Non-direct I/O variable Executed —
Direct I/O variable Not executed ON

[Operation expression]
 Digital filter
PVn  (1  FT)  PVC  FT  PVn 1 (0.0  FT  1.0)
 PID
ΔMVn = Kp • (ΔPn+ Δln +ΔDn) (See Gap operation and integration control)
MVn = MVn-1  ΔMVn (Direct specification: Subtraction, Reverse specification: Addition)

where
Pn  en  en1
en  SVn  PVn (See Gap operation)
e  t
In  n (When TI  0, I  0)
TI
t  scheduled scan setting  N
TD  PVn1  PVn   t  Dn1
Dn 
t    TD
Dn  Dn1  Dn
  0 .1 ( fixed)
Ln1  MVn1  MV
6F8C1226
17. Process Operation 17-44

[Function block]
MVCn
Integration
enable control
PID operation MVn=MVn-1±ΔMVn

ΔIn Speed-
1 High
position
Auto mode Ti・s convert low Rate
Rate limiter (Speed type) Manipulated
ASV ΔMVn limiter limiter
DSV +SVn en + value
MVCn MV *2
+ Gap 1 ΔPn + + Kp MVS H/L DMV
Cascade Ope.
mode CSV (Speed type)
- -
Manual mode
Td・s ΔDn DMMV
PVn 1+η・Td・s (η=0.1) (Speed type )
Filter
coefficient
FT 1
1+T・s

Process Control polarity D/R *1 Manual mode


measurement manipulated input
Output tracking input TMV MMV
PVC
Output tracking command TR

*1 The control polarity D/R specification in the speed to positional format conversion specification performs subtraction if
direct specification and addition if reverse specification.
*2 The switching of output polarity of manipulated value output MV is performed with external logic (ladder circuit).

[Gap operation and integration control]


(Gap ope.) (Differentiation control)
Error e When |SVn - PVn|  |GP|
Gradient=1 ΔMVn=0

(Integration control)
Ln=MVn - MV
(SV-PV)
when reverse is specified
GP[%] GP[%]
Ln-1•ΔIn  0 Integration disabled
L n-1•ΔIn  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.)
When tracking directive TR is 1, the high and low limit of manipulated value MV are valid, but the differential limit
of MV is invalid. In this case, the internal MVn is set as MVn=MV.
And when the tracking directive changes to 0, addition/subtraction of ΔMV is started from the MVn at that point.
 Auto mode
Changing of ASV is valid in auto mode and manual mode.
When auto mode is entered, SVn is approached to ASV while limiting the rate-of-change.
SVn=SVn-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.
6F8C1226
17. Process Operation 17-45

 Cascade mode
Changing of CSV is valid in all modes.
SVn 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 SVn 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, MVn is equal to MV so that switching from manual mode to auto mode or cascade mode is bumpless.
And when switching to auto mode or cascade mode, addition/subtraction of MV is started from the MVn at that
point.
 Control polarity DR specification
Direct specification: MV is decreased when PV is increased. (DMV subtraction)
MVn=MVn-1 − DMV
Reverse specification: MV is increased when PV is increased. (DMV addition)
MVn=MVn-1 + DMV
 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|
3. When (MMV-MV) < -|DMMV| :MV=MV-|DMMV|
 Rate limiter of auto mode setting ASV input DSV
SVn is approached to ASV with rate-of-change DSV.
1. When +|DSV| ≥ (ASV-SVn-1) ≥ -|DSV| :SVn=ASV
2. When (ASV-SVn-1) > +|DSV| :SVn=SVn-1+|DSV|
3. When (ASV-SVn-1) < -|DSV| :SVn=SVn-1-|DSV|
 High / low limit of manipulated output MH, ML
1. When MH < ML :MH=ML
If high / low limit output is MVXn
2. When MVn > MH :MVXn=MH
3. When MVn < ML :MVXn=ML
 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:
MV0=MV
MMV=MV
PV0=PVC
SV0=ASV or CSV (Depends on initial mode. However, it is set to ASV in manual mode.)
D0=0
C=N
e0-1=e0
 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 ON.
If the internal counter is greater than 0, decrements C and resets the instruction output to OFF.)
6F8C1226
17. Process Operation 17-46

[Mode data relationship table]


Setting Manipulated value
Manipulated
Tracking value output limit
Manual Internal Limit Output
setting
Auto mode Cascade mode Setting mode manipulat output manipu
manipulated
setting setting SVn setting ed value High Change MVCn lated
value
ASV CSV manipulate MVn /low of value
TMV
d value Limit rate MV
MMV limit

SVn-1
Manual ― ― Previous Set MMV ― MV No No MV MMV
mode Changeable Changeable value Changeable MVn
― PID
Tracking Changeable Operation Yes Yes
Auto =OFF Set ASV ― ASVSVn result
mode Tracking (Changeable) Set TMV MV Yes No Internal
MV
=ON manipulat
Not
PID ed value
changeable MVCn
Tracking ― Operation Yes Yes MVn
=OFF Changeable result Output
Cascade limit
SVn Set CSV CSV
mode
Tracking Not Set TMV MV Yes No
=ON changeable

Important:
 The scan cycle of the task using this instruction must be in scheduled scan mode. (S controller only) When specifying
floating scan, the specific variable Error Flag is set to ON without performing operation.

Program example:
PID3_1
SIGNAL1 PID3 SIGNAL2
E Q
ST
TBL2 SAMPLE1
LP_P MV
LD ST
TBL1 TBL1
PV_D PV_D
LD ST

 When SIGNAL1 is ON, performs Essential Succession PID operation with the content of parameters specified by variables
TBL1 and TBL2 and stores the result in variable SAMPLE1.

Error information:
 If direct I/O variable is specified for PV data/setting variable and LP parameter variable, no operation is performed and the
specific register Error Flag is set to ON.
 If the scan cycle of the task using this instruction is floating scan mode, no operation is performed and the specific register
Error Flag is set to ON. (S controller only)
6F8C1226
17. Process Operation 17-47

Parameter structure:
The structure of each parameter used in function instructions is shown below. Use the following structure for functions that
require parameters. Note that these structures are predefined in the standard structure of the engineering tool.

PV parameter structure:
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]
DPB REAL 1.0 PV rate-of-change alarm dead band[EU/s]
PRD UINT PV error processing definition
SPV UINT Integral input PVNo.
MAX REAL 100.0 Totalization max [EU]
SIMM UINT Simulation setting
UIL BOOL Sensor low alarm suppress
UIH BOOL Sensor high alarm suppress
Spare ARRAY[0..5] OF WORD
6F8C1226
17. Process Operation 17-48

PV data structure:
Data type Parent type
typePV_DATA STRUCT

Member Data type Comment


PV REAL PV [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 alarm high
PVL BOOL PV alarm low
PVD BOOL PV rate-of-change alarm
6F8C1226
17. Process Operation 17-49

LP parameter structure:
Data type Parent type
typeLP_PARA STRUCT

Member Data type Initial Value Comment


OA DWORD Output hardware address
PVP UINT Controlled PVNo
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]
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 PVNo.
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
Spare ARRAY[0..6] OF WORD
POR BOOL Pulse output request flag
PMV REAL Pulse output request counter
6F8C1226
17. Process Operation 17-50

LP data structure:
Data type Parent type
typeLP_DATA STRUCT

Member Data type Comment


SV REAL SV [EU]
MV REAL MV value[%]
MODE UINT Control mode
MVT BOOL MV tracking
SIM BOOL Simulation
LSP BOOL Alarm suppress
LS_3 BOOL
LS_4 BOOL
LS_5 BOOL
LS_6 BOOL
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 operation
CSV BOOL CMP-SV operation
SMV BOOL SEQ-MV operation
CMV BOOL CMP-MV operation
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
6F8C1226
17. Process Operation 17-51

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 [%]
CSV REAL Cascade mode setting [%]
MMV REAL Manual mode manipulated value input [%]
TMV REAL Manipulated value tracking input [%]
MODE DWORD Mode setting

For PID3 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 [%/t]
DMMV REAL Manual mode manipulated value MMV differential limit [%/t]
STS DWORD Status
MH REAL Manipulated value high limit [%]
ML REAL Manipulated value low limit [%]
DMV REAL Manipulated value differential limit [%/t]
N REAL Control cycle setting
6F8C1226
18. Program Control 18-1

18 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
8 Interrupt Disable DI_T T
6F8C1226
18. Program Control 18-2

Program Control Return

Diagram Input RETURN

EN input Edge execution Index modification


Modifier
— — —

Function:
• When the input state is 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
OFF No return —
ON Return —

[Supplement]
• 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:
SIGNAL1 SIGNAL2
RETURN

• Returns only when the state of variables SIGNAL1 and SIGNAL2 is ON.
6F8C1226
18. Program Control 18-3

Program Control User Defined Function

Input argument 1 Function name Output


Input argument 2

Diagram Input argument 3

Input argument n

EN input Edge execution Index modification


Modifier
— — —

Function:
• Executes the user defined function.
• Up to 15 input arguments including function value may be defined.
• User defined function and user defined function block may be nested up to 6 levels.

Program example:
USERFUN
SAMPLE1 IN0 SAMPLE5
User defined function content
SAMPLE2 IN1
ADD_INT SUB_INT MUL_INT
IN0 USERFUN
SAMPLE3 IN2
IN1
SAMPLE4 IN3
IN2

IN3

• Executes the content of user defined function using variables SAMPLE1 to 4 as input arguments and stores the result in
variable SAMPLE5.
6F8C1226
18. Program Control 18-4

Program Control User Defined Function Block

Input argument 1 Function name Output 1


Input argument 2 Output 2

Diagram Input argument 3 Output 3

Input argument n Output n

EN input Edge execution Index modification


Modifier
— — —

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:
USERFB_1
USERFB
SAMPLE1 IN0 OUT1 SAMPLE5
User defined function block content
SAMPLE2 IN1 OUT2 SAMPLE6
ADD_INT SUB_INT MUL_INT
IN0 OUT1
SAMPLE3 IN2
IN1
SAMPLE4 IN3
IN2

IN3

ADD_INT SUB_INT DIV_INT


IN0 OUT2

IN1

IN2

IN3

• Executes the content of user defined function block using variables SAMPLE1 to 4 as input arguments and stores the result
in variables SAMPLE5 and SAMPLE6.
6F8C1226
18. Program Control 18-5

Program Control Program Enable

EN_P
Execution control input E Output

Diagram Task type TASK

Task entry no. NO

EN input Edge execution Index modification


Modifier
√ √ —

Arguments:
Arg. Operand Type Const. Description Remarks
E BOOL √ Execution control input
Input TASK UINT √ Task type
NO UINT √ Task entry no.
Output — BOOL — Output

Function:
• When the Execution Control Input E is OFF, OFF is output without performing any operation.
• When the Execution Control Input E is ON, execution of the program specified by Task type and Task entry no. is enabled
and ON is output as the result.
• The range of Task type TASK is as follows.
Task type specification Task name
0 Event task EV
1 Super high-speed task SS
2 Interrupt task IP
3 High-speed task HS
4 Main task MS
5 Background task BG
• The range of Task entry no. depends on the controller model. Refer to the operation manual for details.
Execution control input Action Output
OFF — OFF
ON Enables execution of the specified program. ON

Program example:
SIGNAL1 EN_P SIGNAL2 Main task
1 E 1 000 P_2050
LD ST
001 P_2051
4 TASK
LD 009 P_2059
010 P_2060 Disabled→Enabled
10 NO
LD

• When execution control input SIGNAL1 is 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 OFF when the above error occurs.
6F8C1226
18. Program Control 18-6

Program Control Program Disable

DIS_P
Execution control input E Output

Diagram Task type TASK

Task entry no. NO

EN input Edge execution Index modification


Modifier
√ √ —

Arguments:
Arg. Operand Type Const. Description Remarks
E BOOL √ Execution control input
Input TASK UINT √ Task type
NO UINT √ Task entry no.
Output — BOOL — Output

Function:
• When the Execution Control Input E is OFF, OFF is output without performing any operation.
• When the Execution Control Input E is ON, execution of the program specified by Task type and Task entry no. is disabled
and ON is output as the result.
• The range of Task type TASK is as follows.
Task type specification Task name
0 Event task EV
1 Super high-speed task SS
2 Interrupt task IP
3 High-speed task HS
4 Main task MS
5 Background task BG
• The range of Task entry no. depends on the controller model. Refer to the operation manual for details.
Execution control input Action Output
OFF — OFF
ON Disables execution of the specified program. ON

Program example:
SIGNAL1 DIS_P SIGNAL2 Main task
1 E 1 000 P_2050
LD ST
001 P_2051
4 TASK
LD 009 P_2059
010 P_2060 Enabled→Disabled
10 NO
LD

• When execution control input SIGNAL1 is 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 OFF when the above error occurs.
6F8C1226
18. Program Control 18-7

Program Control Event Program Startup

START_P
Execution control input E Output

Diagram Task type TASK

Task entry no. NO

EN input Edge execution Index modification


Modifier
√ √ —

Arguments:
Arg. Operand Type Const. Description Remarks
E BOOL √ Execution control input
Input TASK UINT √ Task type
NO UINT √ Task entry no.
Output — BOOL — Output

Function:
• When the Execution Control Input E is OFF, OFF is output without performing any operation.
• When the Execution Control Input E is ON, the program specified by Task type and Task entry no. is executed and ON is
output as the result.
• The range of Task type TASK is as follows. However, super high speed task (SS), high speed task (HS), and main task (MS)
which performs scan cannot be set.
Task type specification Task name
0 Event task EV
2 Interrupt task IP
5 Background task BG
• The range of Task entry no. depends on the controller model. Refer to the operation manual for details.
Execution control input Action Output
OFF — OFF
ON Starts the specified event program. ON

Program example:
SIGNAL1 START_P SIGNAL2 Event task
1 E 1 000 P_2050
LD ST
001 P_2051
0 TASK
LD 006 P_2056 Start up
007 P_2057
6 NO
LD START_P Execute

Main task MS001 MS001

Event task EV006

• When execution control input SIGNAL1 is ON, the program P_2056 registered in entry no. 006 of event task specified by
task type TASK and task entry no. NO is started up.

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 OFF when the above error occurs.
6F8C1226
18. Program Control 18-8

Program Control Interrupt Enable T

EI_T
Diagram Execution control input Result

EN input Edge execution Index modification


Modifier
√ √ —

Arguments:
Arg. Operand Type Const. Description Remarks
Input — BOOL √ Execution control input
Output — BOOL — Result

Function:
• When the input is OFF, outputs OFF without performing operation.
• When the input is ON, execution of task with higher priority than the executing task is enabled and 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:
SIGNAL1
I/O
Interrupt DI_T
factor IP task
Circuit A Execution
disabled

SIGNAL2 Interrupt factor held


EI_T
IP task
Execute
Circuit B

• Disables interrupt when the variable SIGNAL1 is ON. This interrupt is disabled while circuit A is executing. Enables interrupt
when the variable SIGNAL2 is ON. Then the interrupt task (IP) is started up by the suspended I/O interrupt.
6F8C1226
18. Program Control 18-9

Program Control Interrupt Disable T

DI_T
Diagram Execution control input Result

EN input Edge execution Index modification


Modifier
√ √ —

Arguments:
Arg. Operand Type Const. Description Remarks
Input — BOOL √ Execution control input
Output — BOOL — Result

Function:
• When the input is OFF, outputs OFF without performing operation.
• When the input is ON, execution of task with higher priority than the executing task is disabled and 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:
SIGNAL1
I/O DI_T
Interrupt
factor IP task
Circuit A Execution
disabled

SIGNAL2 Interrupt factor held


EI_T
IP task
Execute
Circuit B

• Disables interrupt when the variable SIGNAL1 is ON. This interrupt is disabled while circuit A is executing. Enables interrupt
when the variable SIGNAL2 is ON. Then the interrupt task (IP) is invoked by the suspended I/O interrupt.
6F8C1226
19. String Processing 19-1

19 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
6 Insert String INSERT
7 Delete String DELETE
8 Replace String REPLACE
9 Find String FIND
10 Define String DEF_STRING
6F8C1226
19. String Processing 19-2

String Processing String Length

LEN
Diagram Input string Output

EN input Edge execution Index modification


Modifier
√ √ —

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 variables cannot be specified for the variable scope of STRING variables.

Program example:
SAMPLE1 LEN SAMPLE2
Input string String length
7
LD ST ABCDE FG 7

• Calculates the length of string "ABCDEFG" in input data SAMPLE1 and stores the result "7" in SAMPLE2.

Error Information:
• If the STRING variable is specified as direct I/O, the result is '0' and the specific register Error Flag is set to ON.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
19. String Processing 19-3

String Processing Leftmost Extract String

LEFT
Input string IN Output
Diagram
Extraction character length L

EN input Edge execution Index modification


Modifier
√ √ —

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 variables cannot be specified for the variable scope of STRING variables.

Program example:
SAMPLE1 LEFT SAMPLE3
Input string Extracted string
IN
LD ST ABCDE FG ABC
SAMPLE2
3 L Extraction character count
LD 3

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

Error information:
• If the STRING variable is specified as direct I/O, the result is unchanged and the specific register Error Flag is set to ON.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
19. String Processing 19-4

String Processing Rightmost Extract String

RIGHT
Input string IN Output
Diagram
Extraction character length L

EN input Edge execution Index modification


Modifier
√ √ —

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 variables cannot be specified for the variable scope of STRING variables.

Program example:
SAMPLE1 RIGHT SAMPLE3 Input string Extracted string
IN
LD ST ABCDE FG EFG
SAMPLE2
3 L Extraction character length
LD 3

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

Error information:
• If the STRING variable is specified as direct I/O, the result is unchanged and the specific register Error Flag is set to ON.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
19. String Processing 19-5

String Processing Extract String

MID
Input string IN Output

Diagram L
Extraction character length

Extracted string top position P

EN input Edge execution Index modification


Modifier
√ √ —

Arguments:
Arg. Operand Type Const. Description Remarks
IN STRING — Input string
Input L UINT √ Extraction character length
P UINT √ Extraction character top position
Output — STRING — Output

Function:
• Extracts the number of characters specified by Extraction character length L starting from the Extraction character top
position P of the input string IN and outputs the result.
• Direct I/O variables cannot be specified for the variable scope of STRING variables.

Program example:
SAMPLE1 MID SAMPLE4 Input string Extracted string
IN
LD ST ABCDEFG BCD
SAMPLE2 Extraction character length
3 L
LD 3
SAMPLE3
P
2 Extracted string position
LD 2

• Extracts the number of characters specified by Extraction character length "3" in SAMPLE2, starting from Extraction
character top position "2" in SAMPLE3 of the string "ABCDEFG" in SAMPLE1 and stores the result "BCD" in SAMPLE3.

Error information:
• If number of characters from Extraction character top position P is less than the Extraction character length, the entire string
starting at position P is output.
• If Extraction character top position P is greater than the Input string length, the result is a null string.
• If the STRING variable is specified as direct I/O, the result is unchanged and the specific register Error Flag is set to ON.
Also, when EN is used, ENO output is used to OFF.
6F8C1226
19. String Processing 19-6

String Processing Concatenate String

CONCAT_STRING
Input string 1 IN1 Output
Diagram
Input string 2 IN2

EN input Edge execution Index modification


Modifier
√ √ —

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 variables cannot be specified for the variable scope of STRING variables.

Program example:
SAMPLE1 CONCAT_STRING SAMPLE3 Input string 1
IN1 ABCD
LD ST Output string
SAMPLE2 +
ABCDEFG
3 IN2 Input string 2
LD EFG
• Concatenates the string "ABCD" in SAMPLE1 with Extraction string "EFG" in SAMPLE2 and stores the result "ABCDEFG" in
SAMPLE3.

Error information:
• If the string length after concatenation exceeds the output string variable size, the result is unchanged.
• If the STRING variable is specified as direct I/O, the result is unchanged and the specific register Error Flag is set to ON.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
19. String Processing 19-7

String Processing Insert String

INSERT
Input string IN1 Output

Diagram Insertion character string IN2

Insert position P

EN input Edge execution Index modification


Modifier
√ √ —

Arguments:
Arg. Operand Type Const. Description Remarks
IN1 STRING — Input string
Input IN2 STRING — Insertion character string
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 variables cannot be specified for the variable scope of STRING variables.

Program example:
SAMPLE1 INSERT SAMPLE4 Input string Inserted string
IN ABC ADEFGBC
LD ST
SAMPLE2
3 L Insert position
LD
1
SAMPLE3
P
1 Insert string
LD
DEFG

• 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:
• 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.
• If the STRING variable is specified as direct I/O, the result is unchanged and the specific register Error Flag is set to ON.
• When EN is used, ENO output is reset to OFF only when the string size is exceeded or when the string variable is specified
as direct I/O.
6F8C1226
19. String Processing 19-8

String Processing Delete String

DELETE
Input string IN Output

Diagram Deletion character length L

Delete position P

EN input Edge execution Index modification


Modifier
√ √ —

Arguments:
Arg. Operand Type Const. Description Remarks
IN STRING — Input string
Input L UINT √ Deletion character length
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 variables cannot be specified for the variable scope of STRING variables.

Program example:
SAMPLE1 DELETE SAMPLE4 Input string Deleted string
IN ABCDEFG ABG
LD ST
SAMPLE2 Delete position Deletion character length
4 L
LD 3 4
SAMPLE3
P
3
LD

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

Error information:
• 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.
• If the STRING variable is specified as direct I/O, the result is unchanged and the specific register Error Flag is set to ON.
Also, when EN is used, ENO output is reset to OFF.
6F8C1226
19. String Processing 19-9

String Processing Replace String

REPLACE
Input string IN1 Output

Replacement character string IN2


Diagram
Replacement character length L

Replacement position P

EN input Edge execution Index modification


Modifier
√ √ —

Arguments:
Arg. Operand Type Const. Description Remarks
IN1 STRING — Input string
IN2 STRING — Replacement character string
Input
L UINT √ Replacement character length
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 variables cannot be specified for the variable scope of STRING variables.

Program example:
SAMPLE1 REPLACE SAMPLE5 Input string Replaced string
IN1 ABCDEFG ABXYZG
LD ST
SAMPLE2 Replace position Replacement character length
4 IN2
LD 3 4
SAMPLE3
3 L Replace character string
LD
SAMPLE4 XYZ
3 P
LD

• 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:
• 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.
• If the STRING variable is specified as direct I/O, the result is unchanged and the specific register Error Flag is set to ON.
• When EN is used, ENO output is reset to OFF only when the string size is exceeded or when the string variable is specified
as direct I/O.
6F8C1226
19. String Processing 19-10

String Processing Find String

FIND
Input string IN1 Output
Diagram
Search character string IN2

EN input Edge execution Index modification


Modifier
√ √ —

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 variables cannot be specified for the variable scope of STRING variables.

Program example:
SAMPLE1 FIND SAMPLE3 Input string Search result
IN1 3
LD ST ABCDEFG 3
SAMPLE2
IN2
LD Search string
CD

• Searches the string "CD" specified by SAMPLE2 from the string "ABCDEFG" in SAMPLE1 and stores the result 3 in
SAMPLE3.

Error Information:
• If the STRING variable is specified as direct I/O, the result is unchanged and the specific register Error Flag is set to ON.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
19. String Processing 19-11

String Processing Define String


Diagram
DEF_STRING
String byte count input Output

Modifier EN input Edge execution Index modification


√ √ —

Arguments:
Arg. Operand Type Const. Description Remarks
Input — UINT √ String byte count input
Output — STRING — Output

Function:
• Reserves a STRING data variable area of string byte count specified with input.
<Variable declaration>
Variable Data type Dec.
VAR_STRING STRING[8] VAR
In this case, a value from 1 to 8 is set as the string byte count input.
The STRING variable contains the number of string bytes (word size) that can be used in the variable. However, if STRING
is used for a static variable, the above string byte count information is cleared at run time. Therefore, the STRING type can
only be used in a global variable with retain specification.
Therefore, in order to use STRING variable in a variable scope outside this restriction, this instruction must be used under
the following condition:
• To use the string variable in a variable scope that will be initialized, this Define String instruction must be executed.
Local variable, global variable, SW/D register, IQ register: Must be executed during run time.
Temporary variable: Must be executed each time POU execution is performed.
• Set the string byte count within the string size specified in the variable declaration.
(String size when declaring 1 ≤ input ≤ STRING)
• Updates the word size of the STRING body of the STRING data.
VAR length ←INT((input+1) / 2)
• The string variable can be initialized by using it in combination with Array-String Conversion (ARRAY_TO_STRING)
instruction.
• Direct I/O variables cannot be specified for the variable scope of STRING variables.
String data structure:

VAR length 1W

STRING length 1W

STRING body
Up to 128W

VAR length :Word size of STRING body


STRING length :Stored byte count
STRING body :Character code
6F8C1226
19. String Processing 19-12

Important:
• Specify input within string size of STRING [A] declared in the variable declaration.
If a value greater than this is specified, a boundary error occurs or the content of variable allocated after STRING [A] will be
destroyed. Be very careful when setting the string byte count input value to be input.

Program example:
SAMPLE1 DEF_STRING SAMPLE2 SAMPLE2 data
12 VAR length=6
LD ST
STRING length
<Variable declaration> STRING body
Variable Data type Dec.
SAMPLE2 STRING[12] VAR

• Executes Define String instruction with declaration character count "12" in variable SAMPLE1 in order to use STRING
variable SAMPLE2 with variable scope=static variable, This declares the use of a 6 word area in VAR length of STRING
variable SAMPLE2.

Error information:
• If string byte count input > 256, an abnormal input is assumed and the VAR length of the specified STRING is set to 0.
• If the STRING variable is specified as direct I/O, the result is not updated and the specific register Error Flag is set to ON.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
20. Control Statements 20-1

20 Control Statements

No. Instruction Remarks


1 IF
2 THEN
3 ELSE (IF statement)
4 ELSEIF
5 END_IF
6 CASE
7 :
8 .. :
9 : ,
10 .. ,
11 ELSE (CASE statement)
12 END_CASE
13 FOR_DO
14 EXIT (FOR statement)
15 END_FOR
16 WHILE
17 DO
18 EXIT (WHILE statement)
19 END_WHILE
20 REPEAT
21 UNTIL
22 EXIT (REPEAT statement)
23 END_REPEAT
6F8C1226
20. Control Statements 20-2

Control statements IF

Diagram IF

EN input Edge execution Index modification


Modifier
— — —

Function:
• Indicates the start of IF statement.
• A condition expression is described between IF and THEN. If the condition expression is ON, the code following THEN is
executed. If the condition expression is OFF, the code following THEN is skipped and the code following ELSE is executed.
• The condition expression following IF must be instructions that outputs BOOL type result (such as bit sequence instructions,
compare instructions, or logical operation instructions).

Program example:
IF
Condition expression

SIGNAL1 SIGNAL2 SIGNAL3

THEN
Process 1
ADD_INT
SAMPLE1 SAMPLE3

SAMPLE2

ELSE
Process 2
SUB_INT
SAMPLE1 SAMPLE3

SAMPLE2

END_IF

FALSE
Condition
expression
TRUE

Process 1 Process 2

• If the states of condition expression variables SIGNAL1 and SIGNAL2 are both ON, Process 1 (addition) is performed.
Otherwise, Process 2 (subtraction) is performed.
6F8C1226
20. Control Statements 20-3

Control statements THEN

Diagram THEN

EN input Edge execution Index modification


Modifier
— — —

Function:
• The following table shows the processing when the condition expression in an IF statement is satisfied.
Condition Action
Condition expression is satisfied (ON) Executes the process following THEN
Condition expression is not satisfied (OFF) Does not execute the process following THEN

Program example:
IF
Condition expression

SIGNAL1 SIGNAL2 SIGNAL3

THEN
Process 1
ADD_INT
SAMPLE1 SAMPLE3

SAMPLE2

ELSE
Process 2
SUB_INT
SAMPLE1 SAMPLE3

SAMPLE2

END_IF

FALSE
Condition
expression
TRUE

Process 1 Process 2

• If the states of condition expression variables SIGNAL1 and SIGNAL2 are both ON, Process 1 (addition) following THEN is
performed. Otherwise, Process 2 (subtraction) following ELSE is performed.
6F8C1226
20. Control Statements 20-4

Control statements ELSE (IF statement)

Diagram ELSE

EN input Edge execution Index modification


Modifier
— — —

Function:
• The following table shows the processing when the condition expression in an IF statement is not satisfied.
Condition Action
Condition expression is satisfied (ON) Does not execute the process following ELSE
Condition expression is not satisfied (OFF) Executes the process following ELSE

Program example:
IF
Condition expression

SIGNAL1 SIGNAL2 SIGNAL3

THEN
Process 1
ADD_INT
SAMPLE1 SAMPLE3

SAMPLE2

ELSE
Process 2
SUB_INT
SAMPLE1 SAMPLE3

SAMPLE2

END_IF

FALSE
Condition
expression
TRUE

Process 1 Process 2

• If the states of condition expression variables SIGNAL1 and SIGNAL2 are both ON, Process 1 (addition) following THEN is
performed. Otherwise, Process 2 (subtraction) following ELSE is performed.
6F8C1226
20. Control Statements 20-5

Control statements ELSEIF

Diagram ELSEIF

EN input Edge execution Index modification


Modifier
— — —

Function:
• Indicates the start of ELSEIF statement.
• A condition expression is described between ELSEIF and THEN. If the condition expression is ON, the code following THEN
is executed. If the condition expression is OFF, the code following THEN is skipped and the code following ELSE is
executed.
• The condition expression following ELSEIF must be instructions that outputs BOOL type result (such as syntax instructions,
compare instructions, or logical operation instructions).

Program example:
IF
Condition expression 1

SIGNAL1 SIGNAL2 SIGNAL3

THEN
Process 1
ADD_INT
SAMPLE1 SAMPLE3

SAMPLE2

ELSEIF
Condition expression 2

SIGNAL3 SIGNAL4 SIGNAL3

THEN
Process 2
SUB_INT
SAMPLE1 SAMPLE3

SAMPLE2

ELSE
Process 3
MUL_INT
SAMPLE1 SAMPLE3

SAMPLE2

END_IF
6F8C1226
20. Control Statements 20-6

FALSE
Condition
expression 1
FALSE
TRUE Condition
expression 2
TRUE

Process 1 Process 2 Process 3

• If the states of Conditional Expression 1 variables SIGNAL1 and SIGNAL2 are both ON, Process 1 (addition) is performed
and if the states of Condition Expression 2 variables SIGNAL3 and SIGNAL4 are both ON, Process 2 (subtraction) is
performed. Otherwise, Process 3 (multiply) following ELSE is performed.
6F8C1226
20. Control Statements 20-7

Control statements END_IF

Diagram END_IF

EN input Edge execution Index modification


Modifier
— — —

Function:
• Indicates the end of IF statement.

Program example:
IF
Condition expression

SIGNAL1 SIGNAL2 SIGNAL3

THEN
Process 1
ADD_INT
SAMPLE1 SAMPLE3

SAMPLE2

ELSE
Process 2
SUB_INT
SAMPLE1 SAMPLE3

SAMPLE2

END_IF

FALSE
Condition
expression
TRUE

Process 1 Process 2

• If the states of condition expression variables SIGNAL1 and SIGNAL2 are both ON, Process 1 (addition) following THEN is
performed. Otherwise, Process 2 (subtraction) following ELSE is performed.
6F8C1226
20. Control Statements 20-8

Control statements CASE

CASE
Diagram INDEX xxx

EN input Edge execution Index modification


Modifier
— — —

Arguments:
Arg. Operand Type Const. Description Remarks
Input INDEX DINT — Index register specification (condition
value)

Function:
• Specifies the index register used as the start of CASE statement and condition value.
• Index registers XI,XJ,XK,XL,XM,XN,XP,and XQ may be used.

Program example:
CASE
INDEX XI

:
10
Process 1
ADD_INT
SAMPLE1 SAMPLE3

SAMPLE2

.. :
20 30
Process 2
SUB_INT
SAMPLE1 SAMPLE3

SAMPLE2

END_CASE

TRUE
XI=10
Process 1
FALSE
TRUE
20 ≤ XI ≤ 30
Process 2
FALSE

• 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.
6F8C1226
20. Control Statements 20-9

Control statements :

:
Diagram Comparison data

EN input Edge execution Index modification


Modifier
— — —

Arguments:
Arg. Operand Type Const. Description Remarks
Input — DINT √ 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 register≠Comparison data Does not execute the code following :

Program example:
CASE
INDEX XI

:
SAMPLE1
Process 1
ADD_INT
SAMPLE2 SAMPLE4

SAMPLE3

.. :
20 30
Process 2
SUB_INT
SAMPLE2 SAMPLE4

SAMPLE3

END_CASE
6F8C1226
20. Control Statements 20-10

TRUE
XI=SAMPLE1
Process 1
FALSE
TRUE
20 ≤ XI ≤ 30
FALSE Process 2

• 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.
6F8C1226
20. Control Statements 20-11

Control statements .. :

.. :
Diagram Comparison data 1 Comparison data 2

EN input Edge execution Index modification


Modifier
— — —

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

Program example:
CASE
INDEX XI

:
SAMPLE1
Process 1
ADD_INT
SAMPLE2 SAMPLE4

SAMPLE3

.. :
20 30
Process 2
SUB_INT
SAMPLE2 SAMPLE4

SAMPLE3

END_CASE
6F8C1226
20. Control Statements 20-12

TRUE
XI=SAMPLE1
Process 1
FALSE
TRUE
20 ≤ XI ≤ 30
FALSE Process 2

• 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
6F8C1226
20. Control Statements 20-13

Control statements ,

,
Diagram Comparison data

EN input Edge execution Index modification


Modifier
— — —

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 register≠Comparison data Does not execute the code following ,

Program example:
CASE
INDEX XI

, :
SAMPLE1 SAMPLE2
Process 1
ADD_INT
SAMPLE3 SAMPLE5

SAMPLE4

.. :
20 30
Process 2
SUB_INT
SAMPLE3 SAMPLE5

SAMPLE4

END_CASE
6F8C1226
20. Control Statements 20-14

TRUE
XI=SAMPLE1

FALSE
TRUE
XI=SAMPLE2
Process 1
FALSE
TRUE
20 ≤ XI ≤ 30
Process 2
FALSE

• If the content of index register XI, which is the condition value, is equal to the content of SAMPLE1 or equal to variable
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.
6F8C1226
20. Control Statements 20-15

Control statements .. ,

.. ,
Diagram Comparison data 1 Comparison data 2

EN input Edge execution Index modification


Modifier
— — —

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 Does not execute the code following .. ,

Program example:
CASE
INDEX XI

:
SAMPLE1
Process 1
ADD_INT
SAMPLE3 SAMPLE5

SAMPLE4

.. , :
20 30 SAMPLE2
Process 2
SUB_INT
SAMPLE3 SAMPLE5

SAMPLE4

END_CASE
6F8C1226
20. Control Statements 20-16

TRUE
XI=SAMPLE1
Process 1
FALSE
TRUE
20 ≤ XI ≤ 30
FALSE
TRUE
XI=SAMPLE2
Process 2
FALSE

• 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.
6F8C1226
20. Control Statements 20-17

Control statements ELSE (CASE statement)

Diagram ELSE

EN input Edge execution Index modification


Modifier
— — —

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 Does not execute the process following ELSE
comparison data
Index register does not satisfy the condition with the Executes the process following ELSE
previous comparison data

Program example:
CASE
INDEX XI

:
SAMPLE1
Process 1
ADD_INT
SAMPLE3 SAMPLE5

SAMPLE4

.. , :
20 30 SAMPLE2
Process 2
SUB_INT
SAMPLE3 SAMPLE5

SAMPLE4

ELSE
Process 3
MUL_INT
SAMPLE3 SAMPLE5

SAMPLE4

END_CASE
6F8C1226
20. Control Statements 20-18

TRUE
XI=SAMPLE1
Process 1
FALSE
TRUE
20 ≤ XI ≤ 30
FALSE
TRUE
XI=SAMPLE2
Process 2
FALSE

Process 3

• If the content of index register XI, which is the condition value, is equal to the content of variable 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. Otherwise, Process 3 (multiplication) is performed.
6F8C1226
20. Control Statements 20-19

Control statements END_CASE

Diagram END_CASE

EN input Edge execution Index modification


Modifier
— — —

Function:
• Indicates the end of CASE statement.

Program example:
CASE
INDEX XI

:
10
Process 1
ADD_INT
SAMPLE1 SAMPLE3

SAMPLE2

.. :
20 30
Process 2
SUB_INT
SAMPLE1 SAMPLE3

SAMPLE2

END_CASE

TRUE
XI=10
Process 1
FALSE
TRUE
20 ≤ XI ≤ 30
FALSE Process 2

• 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.
6F8C1226
20. Control Statements 20-20

Control statements FOR_DO

FOR_DO
Diagram INDEX xxx MIN xxx MAX xxx STEP xxx

EN input Edge execution Index modification


Modifier
— — —

Arguments:
Arg. Operand Type Const. Description Remarks
INDEX DINT — Index register specification (repeat count)
MIN DINT √ initial value input
Input
MAX DINT √ Final value input
STEP 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:
FOR_DO
INDEX XI MIN 0 MAX 9 STEP 1
Process 1
ADD_INT
SAMPLE1 SAMPLE3

SAMPLE2

END_FOR

XI=XI+1
TRUE
XI > 9

FALSE
Process 1

• Process 1 (addition) is repeated until the loop count in index register XI exceeds "9".
6F8C1226
20. Control Statements 20-21

Control statements EXIT (FOR statement)

Diagram EXIT

EN input Edge execution Index modification


Modifier
— — —

Function:
• Forces end of FOR statement.

Program example:
FOR_DO
INDEX XI MIN 0 MAX 9 STEP 1

Process 1
SIGNAL1 SIGNAL2
ADD_INT
EN ENO

SAMPLE1 SAMPLE3

SAMPLE2

Process 2
IF
SIGNAL2 SIGNAL3

THEN

EXIT

END_IF

END_FOR

XI=XI+1
TRUE
XI > 9

FALSE
Process 1
TRUE
SIGNAL2

FALSE

• Process 1 (addition) is repeated until the loop count in index register XI exceeds"9", but the FOR statement is terminated if
the variable SIGNAL2 in the IF statement is ON.
6F8C1226
20. Control Statements 20-22

Control statements END_FOR

Diagram END_FOR

EN input Edge execution Index modification


Modifier
— — —

Function:
• Indicates the end of FOR statement.

Program example:
FOR_DO
INDEX XI MIN 0 MAX 9 STEP 1
Process 1
ADD_INT
SAMPLE1 SAMPLE3

SAMPLE2

END_FOR

XI=XI+1
TRUE
XI > 9

FALSE
Process 1

• Process 1 (addition) is repeated until the loop count in index register XI exceeds "9".
6F8C1226
20. Control Statements 20-23

Control statements WHILE

Diagram WHILE

EN input Edge execution Index modification


Modifier
— — —

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 ON and jumps to code following END_WHILE when the condition expression becomes 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:
WHILE
Condition expression

SIGNAL1 SIGNAL2 SIGNAL3

DO
Process 1
ADD_INT
SAMPLE1 SAMPLE3

SAMPLE2

END_WHILE

FALSE
Condition
expression

TRUE
Process 1

• Process 1 (addition) is repeated if the states of variables SIGNAL1 and SIGNAL2, which are the condition expression, are
both ON. Otherwise, jumps to the code following the END_WHILE statement.
6F8C1226
20. Control Statements 20-24

Control statements DO

Diagram DO

EN input Edge execution Index modification


Modifier
— — —

Function:
• The following table shows the processing when the condition expression in a WHILE statement is satisfied.
Condition Action
Condition expression is satisfied (ON) Executes the code between DO and END_WHILE
Condition expression is not satisfied (OFF) Does not execute the code between DO and END_WHILE

Program example:
WHILE
Condition expression

SIGNAL1 SIGNAL2 SIGNAL3

DO
Process 1
ADD_INT
SAMPLE1 SAMPLE3

SAMPLE2

END_WHILE

FALSE
Condition
expression
TRUE

Process 1

• Process 1 (addition) is repeated if the states of variables SIGNAL1 and SIGNAL2, which are the condition expression, are
both ON. Otherwise, jumps to the code following the END_WHILE statement.
6F8C1226
20. Control Statements 20-25

Control statements EXIT (WHILE statement)

Diagram EXIT

EN input Edge execution Index modification


Modifier
— — —

Function:
• Forces end of WHILE statement.

Program example:
WHILE
SIGNAL1 SIGNAL2

DO
Process 1
SIGNAL3 SIGNAL4
ADD_INT
EN ENO

SAMPLE1 SAMPLE3

SAMPLE2

Process 2
IF
SIGNAL4 SIGNAL5

THEN

EXIT

END_IF

END_WHILE

FALSE
SIGNAL1

TRUE
Process 1
TRUE
SIGNAL4

FALSE

• Process 1 (addition) is repeated while variable SIGNAL1, which is the condition expression, is ON, but if the variable
SIGNAL4 in the IF statement is ON, termination of the WHILE statement is forced and jumps to the code following the
END_WHILE statement.
6F8C1226
20. Control Statements 20-26

Control statements END_WHILE

Diagram END_WHILE

EN input Edge execution Index modification


Modifier
— — —

Function:
• Indicates the end of WHILE statement.

Program example:
WHILE
Condition expression

SIGNAL1 SIGNAL2 SIGNAL3

DO
Process 1
ADD_INT
SAMPLE1 SAMPLE3

SAMPLE2

END_WHILE

FALSE
Condition
expression
TRUE

Process 1

• Process 1 (addition) is repeated if the states of variables SIGNAL1 and SIGNAL2, which are the condition expression, are
both ON. Otherwise, jumps to the code following the END_WHILE statement.
6F8C1226
20. Control Statements 20-27

Control statements REPEAT

Diagram REPEAT

EN input Edge execution Index modification


Modifier
— — —

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 OFF and jumps to code following END_REPEAT when it becomes 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:
REPEAT
Process 1
ADD_INT
SAMPLE1 SAMPLE3

SAMPLE2

UNTIL
Condition expression

SIGNAL1 SIGNAL2 SIGNAL3

END_REPEAT

Process 1
FALSE
Condition
expression
TRUE

• Process 1 (addition) is repeated if the states of variables SIGNAL1 and SIGNAL2, which are the condition expression, are
not both ON. If the states of variables SIGNAL1 and SIGNAL2 are both ON, jumps to the code following the END_REPEAT
statement without looping.
6F8C1226
20. Control Statements 20-28

Control statements UNTIL

Diagram UNTIL

EN input Edge execution Index modification


Modifier
— — —

Function:
• Indicates the start of the condition expression of the REPEAT statement.
Condition Action
Condition expression is satisfied (ON) Ends REPEAT - UNTIL loop
Condition expression is not satisfied (OFF) Executes the code between REPEAT and UNTIL

Program example:
REPEAT
Process 1
ADD_INT
SAMPLE1 SAMPLE3

SAMPLE2

UNTIL
Condition expression

SIGNAL1 SIGNAL2 SIGNAL3

END_REPEAT

Process 1
FALSE
Condition
expression
TRUE

• Process 1 (addition) is repeated if the states of variables SIGNAL1 and SIGNAL2, which are the condition expression, are
not both ON. If the states of variables SIGNAL1 and SIGNAL2 are both ON, jumps to the code following the END_REPEAT
statement without looping.
6F8C1226
20. Control Statements 20-29

Control statements EXIT (REPEAT statement)

Diagram EXIT

EN input Edge execution Index modification


Modifier
— — —

Function:
• Forces end of REPEAT statement.

Program example:
REAPEAT
Process 1
SIGNAL3 SIGNAL4
ADD_INT
EN ENO

SAMPLE1 SAMPLE3

SAMPLE2

Process 2
IF
SIGNAL4 SIGNAL5

THEN

EXIT

END_IF

UNTIL
SIGNAL1 SIGNAL2

END_REPEAT

Process 1
TRUE
SIGNAL4

FALSE
FALSE
SIGNAL1

TRUE

• Process 1 (addition) is repeated while variable SIGNAL1, which is the condition expression, is OFF, but if the variable
SIGNAL4 in the IF statement is ON, termination of the REPEAT statement is forced and jumps to the code following the
END_REPEAT statement.
6F8C1226
20. Control Statements 20-30

Control statements END_REPEAT

Diagram END_REPEAT

EN input Edge execution Index modification


Modifier
— — —

Function:
• Indicates the end of REPEAT statement.

Program example:
REPEAT
Process 1
ADD_INT
SAMPLE1 SAMPLE3

SAMPLE2

UNTIL
Condition expression

SIGNAL1 SIGNAL2 SIGNAL3

END_REPEAT

Process 1
FALSE
Condition
expression
TRUE

• Process 1 (addition) is repeated if the states of variables SIGNAL1 and SIGNAL2, which are the condition expression, are
not both ON. If the states of variables SIGNAL1 and SIGNAL2 are both ON, jumps to the code following the END_REPEAT
statement without looping.
6F8C1226
21. Communication 21-1

21 Communication

No. Instruction Remarks


1 Socket Communication Send USEND_T Note1, Note2
2 Socket Communication Send USEND_N
3 Socket Communication Receive URCV_T Note1, Note2
4 Socket Communication Receive URCV_N
5 Communication FB (XMIT_T) XMIT_T
6 Communication FB (XMIT_N) XMIT_N

Note1: Error Status Code List


The error status code list of Socket Communication Send / Receive instruction is described after Socket Communication
Receive.

Note2: Notes for duplex system


The attention in the time that uses the Socket Communication Send / Receive instruction with the duplex system is described
after Socket Communication Receive.
6F8C1226
21. Communication 21-2

Communication Socket Communication Send

Instance name

USEND_T
Execution request REQ DONE Completion output

Diagram Send command CMD ERROR Error

Send data P STATUS Socket No. or error status

Send data word number N

EN input Edge execution Index modification


Modifier
— — —

Arguments:
Arg. Operand Type Const. Description Range
REQ BOOL √ Execution request
CMD PTR — Send command
Input
P PTR — Send data
N UINT √ Send data word number 1 to 1000W
DONE BOOL — Completion output
Output ERROR BOOL — Error
STATUS INT — Socket No. or error status
Send command data structure
15 0
Requested Ethernet Module Slot No.
Socket Service Command
Request Parameter
(See below for details)

Instance structure:
Name Type Description
DONE BOOL Completion output
ERROR BOOL Error
STATUS INT Socket No. or error status
TIMECNT DINT Time count
RESERVE DWORD Reserved

Restrictions:
Item S3 S2 L3 L2 L1
# of Ethernet modules/station 4 1
# of sockets/Ethernet module 12
Single bus Yes Yes Yes Yes Yes
TCP/IP
Duplex bus No No Yes Yes No
Protocol
Single bus Yes Yes Yes Yes Yes
UDP/IP
Duplex bus Yes Yes Yes Yes No
Transferred text size/socket 1000 words
6F8C1226
21. Communication 21-3

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 OFF to ON, N words starting from Send data P are sent with the content of
the specified Send command CMD.
• Send data word number may be 1 to 1000W.
• When data transfer completes, Completion output DONE is kept ON for one scan time.
• If an error occurs, ERROR is kept 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. 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)

Ethernet module type and request command type:

Module execution Module


Model Bus type Request command type*
location name

Single EN711, EN731 Single bus request command


Main unit Single bus request command and
3000 Duplex EN721, EN741
duplex bus request command
Parallel I/O unit Single EN311 Single bus request command
Single EN711, EN731 Single bus request command
2000 Main unit Single bus request command and
Duplex EN721, EN741
duplex bus request command
1000 Main unit Single EN711, EN731 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,EN621,EN641), but the duplex bus request command cannot be used for single bus
(EN711,EN731,EN611,EN631,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.
6F8C1226
21. Communication 21-4

Single bus request command: √ : Available — : Unavailable


Command description Command S3 S2 L3 L2 L1
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 ( ( ( ( (

Duplex bus request command: √ : 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 setup request 16#0312 √ — — — —
Operation mode control request 16#0313 √ — — — —
Other station confirmed request 16#0314 √ — — — —
Time setting request 16#0318 √ — — — —
Router IP address setup 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 √ — — — —
6F8C1226
21. Communication 21-5

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.
(1)Reset request
• Resets the Ethernet module from the user program.
• The request command and Error status are as follows:
Request command:
15 0
Requested Ethernet Module Slot No.
Command (16#0011)
Error status:
15 0
=0:Normal end, ≠0: Error status

(2)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:
Request command:
15 0
Requested Ethernet Module Slot No.
Command (16#0014)
D-IP address

D-IP address :Destination IP address to be verified


Error status:
15 0
=0: Normal complete, ≠0: Error status
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).

(3)UDP open request


• Opens the requested socket.
• Communication protocol: UDP/IP
Request command:
15 0
Requested Ethernet Module Slot No.
Command (16#0031) / Duplex (16#0231)
UDPPortNo.
UDPPortNo. :UDP port No. of the specified source socket (1024 to 65535)
Socket No. or Error Status:
15 0
Socket No.(0 to 11), error status
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.
6F8C1226
21. Communication 21-6

(4)UDP send request/broadcast send request


• Sends source data using the opened UDP.
• Number of transferred data words: 1 to 1000 words.
Request command:
15 0
Requested Ethernet Module Slot No.
Command (16#0032) / Duplex (16#0232)
Socket No.
D-IP address

D-UDPPortNo.
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-UDPPortNo. :Destination socket UDP port No.
Error status:
15 0
=0: Normal complete, ≠0: Error status

(5)UDP close request


• Ends the opened UDP sockets. Also cancels receive requests (unlimited wait state).
Request command:
15 0
Requested Ethernet Module Slot No.
Command (16#0034) / Duplex (16#0234)
Socket No.
Socket No. :Socket ID (0 to 11) (identifier obtained with UDP open)
Error status:
15 0
=0: Normal complete, ≠0: Error status

(6)TCP open request


• Opens (active/passive) the requested port.
• Communication protocol: TCP/IP
Request command:
15 0
Requested Ethernet Module Slot No.
Command (16#0035) / Duplex (16#0235)
Kind
D-IP address

D-TCPPortNo.
S-TCPPortNo.
TimeCnt
Kind :Open type (1/2)
1=Active open - client
2=Passive open - server
D-IP address :Destination IP address (valid only for active open)
D-UDPPortNo. :Destination socket TCP port No. (valid only for active open)
S-TCPPortNo. :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)
Socket No. or Error Status:
15 0
Socket No.(0 to 11), error status
Socket No. is set in STATUS when TCP completes successfully (DONE=ON). This Socket No. is used to obtain the send,
6F8C1226
21. Communication 21-7

receive, close, and EN board control socket identifier.

(7)TCP send request


• Sends the source data using the opened TCP connection.
• Send data word number: 1 to 1000 words.
Request command:
15 0
Requested Ethernet Module Slot No.
Command (16#0037) / Duplex (16#0237)
Socket No.
Socket No. :Socket ID (0 to 11) (identifier obtained by TCP open)
Error status:
15 0
=0: Normal complete, ≠0: Error status

(8)TCP close request


• Ends an opened TCP connection and closes the socket.
• Also cancels open/receive requests (unlimited wait state).
Request command:
15 0
Requested Ethernet Module Slot No.
Command (16#0039) / Duplex (16#0239)
Socket No.
Socket No. :Socket ID (0 to 11) (identifier obtained by TCP open)
Error status:
15 0
=0: Normal complete, ≠0: Error status
6F8C1226
21. Communication 21-8

EN311 request commands:


(1)Reset request
• Resets EN311 from the user program.
• The request command structure and Error status are as follows:
Request command:
15 12 8 0
Bus Unit Slot Requested Ethernet Module Slot No.
Command (16#0311)
Error status:
15 0
=0: Normal end, ≠0: Error status
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)

(2)Parameter setup 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:
15 12 8 0
Bus Unit Slot Requested Ethernet Module Slot No.
Command (16#0312)
S-IP address

UDPPortNo.
S-IP address :Source IP address
UDPPortNo. :UDP port no. (1024 to 65535)
Error status:
15 0
=0: Normal end ,≠0: Error status

(3)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:
15 12 8 0
Bus Unit Slot Requested Ethernet Module Slot No.
Command (16#0313)
Specified information
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:
15 0
=0: Normal end ,≠0: Error status
6F8C1226
21. Communication 21-9

(4)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:
15 12 8 0
Bus Unit Slot Requested Ethernet Module Slot No.
Command (16#0314)
D-IP address
D-IP address :Destination IP address to be verified
Error status:
15 0
=0: Normal end ,≠0: Error status

(5)Time setup request


• Sets the EN311 internal clock from the user program.
• The request command structure and Error status are as follows:
Request command:
15 12 8 0
Bus Unit Slot Requested Ethernet Module Slot No.
Command (16#0318)
Month Year
Hour Date
Second Minute
Error status:
15 0
=0: Normal end ,≠0: Error status

(6)Router IP address setup 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:
15 12 8 0
Bus Unit Slot Requested Ethernet Module Slot No.
Command (16#0319)
Router IP address
Error status:
15 0
=0: Normal end ,≠0: Error status
6F8C1226
21. Communication 21-10

(7)PC link register write request


• Writes the data in specified source register into the specified destination register.
Request command:
15 12 8 0
Bus Unit Slot Requested Ethernet Module Slot No.
Command (16#0321)
Router IP address
DRIP
DRegNo.
TimerCnt
D-IP address

D-UDPPortNo.
DRID :Destination register type code
(Only register D can be specified when the destination is S3.)
0=XW/Ywxxx, 1=Wxxx, 2=LWxxx, 3=RWxxx, 4=Dxxx
5=F(0 to 32767)xxx, 6=F(0 to 65535), 7=Txxx, 8=Cxxx, 9=SWxxx
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-UDPPortNo. : Destination UDP port No.
Error status:
15 0
=0: Normal end ,≠0: Error status

(8)UDP open request


• Opens the requested socket.
• Communication protocol: UDP/IP
Request command:
15 12 8 0
Bus Unit Slot Requested Ethernet Module Slot No.
Command (16#0331)
Socket No.
UDPPortNo.
SocketNo. :Socket ID (1 to 8)
UDPPortNo. :UDP port No. of the specified source socket (1024 to 65535)
Socket No. or Error status:
15 0
Socket No.(1 to 8), error status
6F8C1226
21. Communication 21-11

(9)UDP send request / broadcast send request


• Sends source data using the opened UDP.
• Number of transferred data words: 1 to 1000 words.
Request command:
15 12 8 0
Bus Unit Slot Requested Ethernet Module Slot No.
Command (16#0332)
D-IP address

D-UDPPortNo.

D-IP address :Destination IP address


Specifying 255.255.255.255 as the destination IP address
results in broadcast send.
D-UDPPortNo. :Destination socket UDP port No.
Socket No. or Error status:
15 0
Socket No.(1 to 8), error status

(10)UDP close request


• Ends the opened UDP sockets. Also cancels receive requests (unlimited wait state).
Request command:
15 12 8 0
Bus Unit Slot Requested Ethernet Module Slot No.
Command (16#0334)
Socket No. (1 to 8)
Socket No. or Error status:
15 0
Socket No.(1 to 8), error status
6F8C1226
21. Communication 21-12

(11)TCP open request


• Opens (active/passive) the requested port.
• Communication protocol: TCP/IP
Request command:
15 12 8 0
Bus Unit Slot Requested Ethernet Module Slot No.
Command (16#0335)
Socket No.
Kind
D-IP address

D-TCPPortNo.
S-TCPPortNo.
TimeCnt
Socket No. :Socket ID (1 to 8)
Kind :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:
15 0
Socket No. ( 1 to 8), error status

(12)TCP send request


• Sends the source data using the opened TCP connection.
• Send data word number: 1 to 1000 words.
Request command:
15 12 8 0
Bus Unit Slot Requested Ethernet Module Slot No.
Command (16#0337)
Socket No.
Socket No. :Socket ID (1 to 8)
Socket No. or Error status:
15 0
Socket No.(1 to 8), error status

(13)TCP close request


• Ends an opened TCP connection and closes the socket.
• Also cancels open/receive requests (unlimited wait state).
Request command:
15 12 8 0
Bus Unit Slot Requested Ethernet Module Slot No.
Command (16#0339)
Socket No.
Socket No. :Socket ID (1 to 8)
Socket No. or Error status:
15 0
Socket No.(1 to 8), error status
6F8C1226
21. Communication 21-13

Program example:
USEND_T_1
SIGNAL1 USEND_T SIGNAL2
1 REQ DONE
LD ST
SAMPLE1 SAMPLE4
CMD ERROR
LD ST
SAMPLE2 SAMPLE5 Request command
P STATUS SAMPLE1
LD ST
2 Slot No.
SAMPLE3
50 N 16#0031 UDP open request
LD 8080 Source station UDP port no.

• The request command (slot No.=2, Command=16#0031, Source UDP port No.=8080) is specified with variable SAMPLE1.
• UDP open request specified with the request command is made at the rise of variable SIGNAL1 from OFF to ON.
• When UDP open completes normally, the completion output variable SIGNAL2 is kept ON for 1 scan time. The socket ID is
stored in status output variable SAMPLE5.
• When UDP open is unsuccessful, the error output variable SIGNAL3 is kept ON for 1 scan time. The Error status is stored
in status output variable SAMPLE5.
6F8C1226
21. Communication 21-14

Socket Communication Send

nv dedicated
Communication Socket Communication Send
instruction
LD/FBD language Instance name
notation
USEND_N
Execution request REQ DONE Completion output

Request command CMD ERROR Error


Socket No. or
Send data P STATUS error status
Send data word N
count

Modifier EN input Edge execution Index modification


- - -
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
Input Send data word count
1 to 1000 words
(for word send command)
N UINT √
Send data byte count
1 to 2000 bytes
(for byte send command)
DONE BOOL - Completion output
Output ERROR BOOL - Error
STATUS INT - Socket No. or error status

• Request command data structure

15 0
Requested Ethernet Module Slot No.
Socket Service Command
Request Parameter
6F8C1226
21. Communication 21-15

Instance structure:

Name Type Description Remarks


DONE BOOL Completion output
ERROR BOOL Error Can be accessed from the user program.
STATUS INT Socket No. or error status
TIMECNT DINT Time count
Cannot be accessed from the user program.
RESERVE Bit string of length 32 Reserved

Restrictions:

Unified Controller nv Series


Item
type1 type2
Ethernet module count / station 4
48
Socket count / Ethernet module
(Max.48/station)
Single bus Yes Yes
TCP/IP
Duplex bus No Yes
Protocol
Single bus Yes Yes
UDP/IP
Duplex bus No Yes
For word send command: 1000 words
Transmission text size / socket
For byte send command: 2000 bytes

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 OFF to ON, N words starting from send data P are sent with the content of the
specified request command CMD.
• For word send command, send data word count is 1 to 1000 words. For byte send command, it is 1 to 2000 bytes.
• When transfer is completed normally, completion output DONE becomes ON for 1 scanning time.
• When it is completed with an error, error ERROR becomes ON for 1 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.
• I/O variable cannot be specified directly 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)
6F8C1226
21. Communication 21-16

Ethernet module type and request command type:

Type Module installation location Bus type Module name Request command type *
Single EN811,EN821 Single bus request command
type1 Main unit Single bus request command and
Duplex -
duplex bus request command
Single EN811, EN821 Single bus request command
type2 Main unit Single bus request command and
Duplex FN812
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, EN821). 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:


○: 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 - ○
6F8C1226
21. Communication 21-17

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:
<Request command>
15 0
Requested Ethernet Module Slot No.
Command (16#0011)
<Error status>
15 0
=0:Normal complete, ≠0: Error status

Other station confirmed request:


• Verifies the existence of the specified other station. (Equivalent to Ping)
• The request command and Error status are as follows:
<Request command>
15 0
Requested Ethernet Module Slot No.
Command (16#0014)
D-IP address

D-IP address : Destination IP address to be verified

<Error status>
15 0
=0:Normal complete, ≠0: Error status

• 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).
6F8C1226
21. Communication 21-18

UDP open request:


• Opens the requested socket.
• Communication protocol: UDP/IP
<Request command>
15 0
Requested Ethernet Module Slot No.

Command (16#0031)/Duplex (16#0231)

UDPPortNo.

UDPPortNo. (1024 to 65535)


: UDP port No. of the specified source socket

<Socket No. or Error Status>


15 0
Socket No.(0 to 11), error status

• 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.
• Number of transferred data words: 1 to 1000 words.]

<Request command>
15 0
Requested Ethernet Module Slot No.
Command (16#0032)/Duplex (16#0232)
Socket No.
D-IP address

D-UDPPortNo.
Socket No. : Socket ID (0 to 11) (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-UDPPortNo. : Destination socket UDP port No.

<Error status>
15 0
=0: Normal complete, ≠0: Error status
6F8C1226
21. Communication 21-19

UDP close request:


• Ends the opened UDP sockets. Also cancels receive requests (unlimited wait state).

<Request command>
15 0
Requested Ethernet Module Slot No.
Command (16#0034)/Duplex (16#0234)
Socket No.
Socket No : Socket ID (0 to 11) (identifier obtained with UDP open)

<Error Status>
15 0
=0: Normal complete, ≠0: Error status

TCP open request:


• Opens (active/passive) the requested port.
• Communication protocol: TCP/IP
<Request command>
15 0
Requested Ethernet Module Slot No.
Command (16#0035) /Duplex (16#0235)
Kind
D-IP address

D-TCPPortNo.
S-TCPPortNo.
TimeCnt
Kind : Open type (1/2)
1= Active open - client
2= Passive open - server
D-IP address : Destination IP address (valid only for active open)
D-TCPPortNo. : Destination socket TCP port No. (valid only for active open)
S-TCPPortNo. : 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)

<Socket No. or Error Status>


15 0
Socket No.(0 to 11), error status

• 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.
6F8C1226
21. Communication 21-20

TCP send request:


• Sends the source data using the opened TCP connection.
• Send data word number: 1 to 1000 words.
<Request command>
15 0
Requested Ethernet Module Slot No.
Command (16#0037)/Duplex (16#0237)
Socket No.
Socket No. : Socket ID (0 to 11) (identifier obtained by TCP open)

<Error status>
15 0
=0:Normal complete, ≠0: Error status

TCP close request:


• Ends an opened TCP connection and closes the socket.
• Also cancels open/receive requests (unlimited wait state).
<Request command>
15 0
Requested Ethernet Module Slot No.
Command (16#0039)/Duplex (16#0239)
Socket No.
Socket No. : Socket ID (0 to 11) (identifier obtained by TCP open)

<Error status>
15 0
=0:Normal complete, ≠0: Error status

UDP byte send request:


• Sends source data using the opened UDP.
• Number of transferred data bytes: 1 to 2000 bytes.
<Request command>
15 0
Requested Ethernet Module Slot No.
Command (16#0042)
Socket No.
D-IP address

D-UDPPortNo.

Socket No. : Socket ID (0 to 11) (identifier obtained with UDP open)


D-IP address : Destination IP address
D-UDPPortNo. : Destination socket UDP port No.

<Error status>
15 0
=0:Normal complete, ≠0: Error status
6F8C1226
21. Communication 21-21

TCP byte send request:


• Sends the source data using the opened TCP connection.
• Send data word count: 1 to 2000 bytes
<Request command>
15 0
Requested Ethernet Module Slot No.
Command (16#0047)
Socket No.
Socket No. : Socket ID (0 to 11) (identifier obtained by TCP open)
<Error status>
15 0
=0:Normal complete, ≠0: Error status

Program example:
[LD/FBD language notation]

USEND_N_1
SIGNAL1 USEND_N SIGNAL2
REQ DONE

SIGNAL3
SAMPLE1
CM ERROR
LD

SAMPLE2 SAMPLE4
LD P STATU
S
Request command SAMPLE1
SAMPLE3 2 Slot No.
0 N 16#0031 UDP open request
LD 5000 Source station UDP port No.

[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 variable SAMPLE1.
• UDP open request specified with the request command is made at the rise of variable SIGNAL1 from OFF to ON.
• When UDP open completes normally, the completion output variable SIGNAL2 is kept ON for 1 scan time. The socket ID is
stored in status output variable SAMPLE4.
• When UDP open is unsuccessful, the error output variable SIGNAL3 is kept ON for 1 scan time. The Error status is stored
in status output variable SAMPLE4.

Error information:
• When the specification range of send data exceeds the area, Socket Communication Send is not processed, and data
boundary over occurs.
• When I/O variable is specified directly for send data, the operation is as follows.

Controller Action
Socket Communication Send is not executed.
Unified Controller nv series
Error flag and table operation error flag are set to ON.
6F8C1226
21. Communication 21-22

Communication Socket Communication Receive

Instance name
URCV_T
Execution request REQ DONE Completion output

Diagram Request command CMD ERROR Error

Receive data P STATUS Status

Receive data word count N

EN input Edge execution Index modification


Modifier
— — —

Arguments:
Arg. Operand Type Description Range
Input REQ BOOL Execution request
CMD PTR Request command
P PTR Receive data
N UINT Receive data word count 1 to 1001W
Output DONE BOOL Completion output
ERROR BOOL Error
STATUS INT Status
Request command data structure:
15 0
Requested Ethernet Module Slot No.
Socket Service Command
Request Parameter
(See below for detail)

Instance structure:
Name Type Description
DONE BOOL Completion output
ERROR BOOL Error
STATUS INT Status
TIMECNT DINT Time count
RESERVE DWORD Reserved

Restrictions:
Item S3 S2 L3 L2 L1
# of Ethernet modules/station 4 1
# of sockets/Ethernet module 12
Single bus Yes Yes Yes Yes Yes
TCP/IP
Duplex bus No No Yes Yes No
Protocol
Single bus Yes Yes Yes Yes Yes
UDP/IP
Duplex bus Yes Yes Yes Yes No
Transferred text size/socket 1000 words
6F8C1226
21. Communication 21-23

Function:
• This is a function block that communicates with TCP/IP or UDP/IP procedure using the Ethernet module.
• When the Execution request REQ changes from OFF to ON, N words starting from Receive data P are received with the
content of the specified Receive command CMD.
• Receive data word number may be from 1 to 1001W.
• When data receive completes, Completion output DONE is kept to ON for one scan time.
• If an error occurs, ERROR is kept to 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. 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)

Ethernet module type and request command type:


Module execution Module
Model Bus type Request command type*
location name
EN711,
Single Single bus request command
EN731
Main unit
3000 EN721, Single bus request command and duplex bus
Duplex
EN741 request command
Parallel I/O unit Single EN311 Single bus request command
EN711,
Single Single bus request command
EN731
2000 Main unit
EN721, Single bus request command and duplex bus
Duplex
EN741 request command
EN711,
1000 Main unit Single Single bus request command
EN731

Notes on request command type


• Both the single bus request command and duplex bus request command may be used for duplex bus
(EN721,EN741,EN621,EN641), but the duplex bus request command cannot be used for single bus
(EN711,EN731,EN611,EN631,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.
6F8C1226
21. Communication 21-24

Single bus request command: √ : Available — : Unavailable


Command description Command S3 S2 L3 L2 L1
Get EN board control socket identifier 16#0016 √ √ √ √ √
UDP receive request/broadcast 16#0033 √ √ √ √ √
TCP receive request 16#0038 √ √ √ √ √

Duplex bus request command: √ : Available —: Unavailable


Command description Command S3 S2 L3 L2 L1
UDP receive request/broadcast 16#0233 √ √ √ √ —
TCP receive request 16#0238 — — √ √ —

EN311 request command: √ : Available — : Unavailable


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 √ — — — —
6F8C1226
21. Communication 21-25

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.
(1)Reading the socket No. of the Ethernet module
• Reads the socket No. of the Ethernet module which is corresponding to the controller’s opening socket No.
• The request command structure and Error status are follows:
Request command
15 0
Requested Ethernet Module Slot No.
Command (16#0016)
Socket No.
Socket No. :Socket ID (0 to 11) (identifier obtained by UPD/TCP open)
Error status:
15 0
Socket No. (0 to 31) or Error status
• 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 SocketNo 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 SocketNo 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:
Relation between SocketNo obtained with the open command and SocketNo obtained with this command.

Ethernet module detailed information for each socket:


Overall structure:
F E D C B A 9 8 0
Top offset Socket information
address Socket 0 TCP UDP AOP POP CON RCV RCL Reserved
for single bus request
command Socket 1
The structure of each slot is the same.
(1 word x 64 sockets) :
Socket 63
+64 Socket information Socket 0
for single bus request
command Socket 1
(1 word x 64 sockets) :
Socket 63

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 During socket close request
when connecting
6F8C1226
21. Communication 21-26

Top offset address:


Model Slot Top offset address
2000, 3000 0 130944
1 655232
2 1179520
3 1703808
4 2228096
2000, 3000 5 2752384
6 3276672
7 3800960
1000 1 65280

Example: Socket 4 information of single bus request command installed in slot 3 for model 3000
• Direct notation
%MW13.1703811
LD ------------------ ST
• Variable notation
SOCKET_INF3[4]
LD ---------------------ST
Station variables (Slot3)
Variable Data type WordNo BitNo
SOCKET_INF3 Array[0..63] OF WORD 1703808 0

(2)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))
Request command
15 0
Requested Ethernet Module Slot No.
Command (16#0333) / Duplex (16#0238)
Socket No.
D-IP address

D-UDPPortNo.
TimeCnt
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-UDPPortNo. :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)
Error status:
15 0
=0: Normal complete, ≠0: Error status
6F8C1226
21. Communication 21-27

(3)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))
Request command:
15 0
Requested Ethernet Module Slot No.
Command (16#0038) / Duplex (16#0238)
Socket No.
TimeCnt
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)
Error status:
15 0
=0: Normal complete, ≠0: Error status
6F8C1226
21. Communication 21-28

EN311 request commands:


(1)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:
Request command:
15 12 8 0
Bus Unit Slot Reguested Ethernet Module Slot No.
Command (16#0315)
RAS request type
Start position
Read number
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 (trace information).
1 to 30.
Error status:
15 0
=0: Normal complete, ≠0: Error status
• 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)

(2)PC link register read request


• Reads the data in the specified destination register to the specified source register.
Request command:
15 12 8 0
Bus Unit Slot Reguested Ethernet Module Slot No.
Command (16#0321)
DRID
DRegNo.
TimeCnt
D-IP address

D-UDPPortNo.
DRID : Destination register type code
(Only register D/SW can be specified when the destination is S3.)
0=XW/Ywxxx, 1=Wxxx, 2=LWxxx, 3=RWxxx, 4=Dxxx, 5=F(0 to 32767)xxx
6= F(0 to 65535), 7=Txxx, 8=Cxxx, 9=SW
DRegNo :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-UDPPortNo. :Destination UDP port No.
6F8C1226
21. Communication 21-29

Socket No. or Error Status:


15 0
=0: Normal complete, ≠0: Error status

(3)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))
Request command:
15 12 8 0
Bus Unit Slot Reguested Ethernet Module Slot No.
Command (16#0333)
Socket No.
D-IP address

D-UDPPortNo.
TimeCnt
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-UDPPortNo. :Source socket UDP port No.
TimeCnt :Receive wait timeout interval (1 to 65535: 0.1 second unit, 0: unlimited)
Socket No. or Error Status:
15 0
Socket No.(1 to 8), error status

(4)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))
Request command:
15 12 8 0
Bus Unit Slot Reguested Ethernet Module Slot No.

Command (16#0338)
Socket No.
TimeCnt
Socket No.: Socket ID (1 to 8)
TimeCnt: Receive timeout interval (1 to 65535: 0.1 second unit, 0: unlimited)
Socket No. or Error Status:
15 0
Socket No.(1 to 8), error status
6F8C1226
21. Communication 21-30

Program example:
URCV_T_1
SIGNAL1 URCV_T SIGNAL2 Request command SAMPLE1
1 REQ DONE 2 Slot No.
LD ST
16#0033 UDP receive request
SAMPLE1 SAMPLE4
CMD ERROR 11 UDP socket no.
LD ST 16#12_34_56_78 Send source IP address
SAMPLE2 SAMPLE5
P STATUS 8080 Send source target socket UDP No.
LD ST
300 Receive wait timeout
SAMPLE3
50 N
LD

• 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 variable SAMPLE1.
• UDP receive request specified with the request command is made at the rise of variable SIGNAL1 from OFF to ON.
• When UDP receive completes normally, the completion output variable SIGNAL2 is kept ON for 1 scan time. "0" is stored in
status output variable SAMPLE5.
• When UDP receive request is unsuccessful, the error output variable SIGNAL3 is kept ON for 1 scan time. The Error status
is stored in status output variable SAMPLE5.
6F8C1226
21. Communication 21-31

Notes for duplex system:


Because the station bus transmission module in the duplex system of the integrated controller has separate modules for the
primary side and secondary side, the transmission module control information is different for the primary side and secondary side
(different resource).
The station bus transmission module is controlled (such as socket generation) with communication function block instructions
(USEND_T/URCV_T). Therefore, user application programs using USEND_T/URCV_T instructions, must initialize the
information when switching duplex system and start again from the initialized state (socket open process).
Refer to the outline of processing during duplex switching and the user application example and be sure to start from the
initialized state. If this is not performed, USEND_T/URSV_T instruction will not run.

Processing outline:
• Detect that you are online with the duplex switch event task (EV3). Set the flag indicating that duplex switching has occurred
to ON. (Figure 1) (Example: DUPLEX_CHG_REQ=ON)
• In each program using the communication function block, initialize the USEND_T/URCV_T instruction local variable during
duplex switching. Also, initialize the information to start again from the initialized state (socket open process).
a) Initialization program (Figure 2)
Important
The flag set in (1) indicating that duplex switching has occurred must be reset to OFF when all initialization of related
USEND_T/URCV_T instructions have completed in all programs. (Initialize only the first scan in which duplex switching
occurred.)
b) When entering REQ command to USEND_T/URCV_T instruction using a derivative instruction (for example ┤P├),
change the description to ┤P├ equivalent circuit (Figure 3).
c) Program the normal USEND_T/URCV_T instruction after you have performed a) and b) above.

Equivalent circuit of REQ


Communication Tracking of instruction Instruction instance data
Controller command to communication
instruction instance data processing
instruction
Send USEND_T
Integrated Controller
Rece Yes Required
V Series URCV_T
ive
Required
Send USEND_N
Unified Controller nv
Rece No Not required
Series URCV_N
ive
6F8C1226
21. Communication 21-32

Program example:
Figure 1: Program to detect changing to online in EV3
DUPLEX_ DUPLEX_
CHG_REQ CHG_REQ
(S)

Figure 2: Initialization program


DUPLEX_
CHG_REQ

16#0000 TINZ_WORD USEND_T_1 (** Initialize USEND_T_1 instance **)

LD ST
4
N
LD

B4_REQ_CMD B4_REQ_CMD REQ_CMD REQ_CMD (** Initialization of command


derivative contact equivalent circuit
(R) (R) variable of USEND_T REQ **)

DUPLEX_ DUPLEX_ (** Duplex switch flag is reset


CHG_REQ CHG_REQ
However, execute flag when initializaition of all USEND_T/URCV_T is
(R) completed. **)

Figure 3: Equivalent circuit of ┤P├ and USEND_T instruction program

(** −⏐P ⏐− input equivalent circuit to REQ command of USEND_T **)


REQ_CMD B4_REQ_CMD REQUEST REQ_CMD B4_REQ_CMD
( ) ( )

(** USEND_T program **)


USEND_T_1
REQUEST
USEND_T DONE
REQ DONE
ST Circuit when −⏐P⏐− is used
CMD ERROR
CMD ERROR REQ_CMD REQUEST
LD ST
( )
P STATUS
P STATUS
REQUEST
LD ST
N P
N
LD
6F8C1226
21. Communication 21-33

Socket Communication Receive

nv dedicated
Communication Socket Communication Receive
instruction
LD/FBD language Instance name
notation
URCV_N
Execution request REQ DONE Completion
output
Request command CMD ERROR Error

Receive data P STATUS Status


Receive data word N
count
Modifier EN input Edge execution Index modification
- - -
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 Description Valid range


REQ BOOL Execution request
CMD PTR Request command
Input P PTR Receive data
Receive data word count (for word receive command) 1 to 1001 words
N UINT
Receive data byte count (for byte receive command) 2 to 2002 bytes
DONE BOOL Completion output
Output ERROR BOOL Error
STATUS INT Status

• Request command data structure


15 0
Requested Ethernet Module Slot No.
Socket Service Command
Request Parameter

Instance structure:

Name Type Description Remarks


DONE BOOL Completion output
ERROR BOOL Error Can be accessed from the user program.
STATUS INT Status
TIMECNT DINT Time count
Cannot be accessed from the user program.
RESERVE Bit string of length 32 Reserved

Restrictions:
6F8C1226
21. Communication 21-34

Item type1 type2


Ethernet module count / station 4
48
Socket count / Ethernet module
(Max.48/ station)
Single bus Yes Yes
TCP/IP
Duplex bus No No
Protocol
Single bus Yes Yes
UDP/IP
Duplex bus No Yes
For word receive command: 1001 words
Transmission text size / socket
For byte receive command: 2002 bytes

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 OFF to ON, N words starting from receive data P are received with the content
of the specified request command CMD.
• For word receive command, send data word count is 1 to 1001 words. For byte receive command, it is 2 to 2002 bytes.
• When receive is completed normally, completion output DONE becomes ON for 1 scanning time.
• When it is completed with an error, error ERROR becomes ON for 1 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.
• I/O variable cannot be specified directly for receive data.
• The request commands and error codes vary depending on the Ethernet module.
6F8C1226
21. Communication 21-35

Ethernet module type and request command type:

Type Module installation location Bus type Module name Request command type *
Single EN811, EN821 Single bus request command
type1 Main unit Single bus request command and
Duplex -
duplex bus request command
Single EN811, EN821 Single bus request command
type2 Main unit Single bus request command and
Duplex FN812
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,EN821). 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
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:


○: Available/-: Unavailable
Command description Command type1 type2
UDP receive request/broadcast 16#0233 - ○
TCP receive request 16#0238 - ○
6F8C1226
21. Communication 21-36

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:
<Request command>
15 0
Requested Ethernet Module Slot No.
Command (16#0016)
Socket No.
Socket No.: Socket ID (0 to 11) (identifier obtained by UPD/TCP open)

<Error status>
15 0
Socket No. (0 to 31) or Error status

• 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:

• Ethernet module detailed information for each socket


Overall structure:
F E D C B A 9 8 0
Top offset Socket 0 TCP UDP AOP POP CON RCV RCL Reserve
address Socket information
for single bus Socket 1 The structure of each slot is the same.
request command
(1 word x 64 sockets) :

Socket 63
+64 Socket 0
Socket information
for single bus Socket 1
request command
(1 word x 64 sockets) :

Socket 63

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
Disconnected When closed by opposite party
RCL During socket close request
when connecting
6F8C1226
21. Communication 21-37

Top offset address:

Type Slot Top offset address


type1/2 0 130944
2 2228096
3 3276672
4 4325248
5 5373824
6 6422400
7 7470976

(Example) 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

UDP receive request/broadcast receive request:


• Receives data from opened UDP socket.
• Receive data word count: 1 to 1001 words (including the storage area for receive byte count (1W))

<Request command>
15 0
Requested Ethernet Module Slot No.
Command (16#0033) /Duplex (16#0233)
Socket No.
D-IP address

D-UDPPortNo.
TimeCnt
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-UDPPortNo. : Source socket UDP port No.
Do not check the source port when the command is duplex (16#0233) or UDP
port No
TimeCnt : Receive wait timeout interval (1 to 65535: 0.1 second unit, 0: unlimited)

<Error status>
15 0
=0: Normal complete, ≠0: Error status
6F8C1226
21. Communication 21-38

TCP receive request:


• Receives data from opened TCP socket.
• Receive data word count: 1 to 1001 words (including the storage area for receive byte count (1W))
<Request command>
15 0
Requested Ethernet Module Slot No.
Command (16#0038)/Duplex (16#0238)
Socket No.
TimeCnt
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)

<Error Status>
15 0
=0: Normal complete, ≠0: Error status

UDP byte receive request:


• Receives data from opened UDP socket.
• Receive data word count: 2 to 2002 bytes (including the storage area for receive byte count (2 bytes))
<Request command>
15 0
Requested Ethernet Module Slot No.
Command (16#0043)
Socket No.
D-IP address

D -UDPPortNo.
TimeCnt

Socket No. : Socket ID (0 to 11) (identifier obtained with UDP open)


D-IP address : Source IP address
D-UDPPortNo. : Source socket UDP port No.
TimeCnt : Receive wait timeout interval (1 to 65535: 0.1 second unit, 0: unlimited)
<Error Status>
15 0
=0: Normal complete, ≠0: Error status

TCP byte receive request:


• Receives data from opened TCP socket.
• Receive data word count: 2 to 2002 bytes (including the storage area for receive byte count (2 bytes))
<Request command>
15 0
Requested Ethernet Module Slot No.
Command (16#0048)
Socket No.
TimeCnt
Socket No. : Socket ID (0 to 11) (identifier obtained by TCP open)
TimeCnt : Receive timeout interval (1 to 65535: 0.1 second unit, 0: unlimited)

<Error Status>
15 0
=0: Normal complete, ≠0: Error status
6F8C1226
21. Communication 21-39

Program example:
[LD/FBD language notation]

URCV_N_1
SIGNAL1 URCV_N SIGNAL2
REQ DONE

SIGNAL3
SAMPLE1
CMD ERROR Request command SAMPLE1
LD
2 Slot No.
SAMPLE2 SAMPLE4 16#0033 UDP receive request
LD P STATUS 11 UDP socket No.
ST
16#AC_10_ Source address
SAMPLE3 40_5 172.16.64.5
50 N 5000 Source target socket UDP No.
LD 300 Receive timeout

[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 inteval=30 seconds) is specified with variable SAMPLE1.
• UDP receive request specified with the request command is made at the rise of variable SIGNAL1 from OFF to ON.
• When UDP receive completes normally, the completion output variable SIGNAL2 is kept ON for 1 scanning time. "0" is
stored in status output variable SAMPLE4.
• When UDP open is unsuccessful, the error output variable SIGNAL3 is kept ON for 1 scaning time. The Error status is
stored in status output variable SAMPLE4.

Error information:
• When the specification range of receive data exceeds the area, Socket Communication Receive is not processed, and data
boundary over occurs.
• When I/O variable is specified directly for receive data, the operation is as follows.

Controller Action
Socket Communication Receive is not executed.
Unified Controller nv Series Error flag and table operation error flag are set to
ON.
6F8C1226
21. Communication 21-40

Error Status Code List:


EN7: When using EN7**/EN6** module EN3: When using EN3** module
Error 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 setup
2896 MAC/IP not set EN3: Operation mode control, router IP address setup
2912 Transmission prohibited state EN3: UDP/TCP open/close, UDP/TCP send
2929 Port No. abnormal EN3: Parameter setup
IP address abnormal Router IP address setup
2931 Time set error (year) EN3: Time setup request
2932 Time set error (month) EN3: Time setup request
2933 Time set error (date) EN3: Time setup request
2934 Time set error (hour) EN3: Time setup request
2935 Time set error (minute) EN3: Time setup request
2936 Time set error (second) EN3: Time setup 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
-11 Invalid connection destination IP address EN7: TCP open
Unable to send to specified destination EN7: UDP/TCP send
-12 Timeout. Connection does not complete within EN7: TCP open
prescribed time
Timeout UDP/TCP receive
-14 Connection broken on the local system EN7: UDP/TCP send / receive
-15 Resource shortage EN7: TCP open
Resource reservation failure EN7: UDP/TCP send, TCP close
Unable to create socket because there is no buffer EN7: UDP/TCP open
area
-16 Not a valid socket identifier EN7: UDP/TCP open/close, UDP/TCP send/receive
One of the socket identifier specified with bit mask is EN7: TCP open
invalid
-17 Argument (addr or addr length) not in valid area EN7: UDP/TCP open
within user address space
Invalid argument (buffer pointer) pointer UDP/TCP send/receive
-18 Socket is set to asynchronous I/O mode and there is EN7: TCP open
none waiting connection
No receive data EN7: UDP/TCP receive
Send request not accepted EN7: UDP/TCP send
-19 Invalid message size EN7: UDP/TCP send
-22 Bind already complete EN7: TCP open
Invalid parameter EN7: TCP open
-32 Connection is broken EN7: UDP/TCP receive
Attempt was made to send to disconnected socket EN7: UDP/TCP send, TCP close
-50 Invalid argument (name, name length) EN7: TCP open
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
6F8C1226
21. Communication 21-41

Error Error description Request type


-56 Specified socket is not SOCK_STREAM type EN7: TCP open
Socket is not a type supporting listen EN7: TCP open
Specified operation not supported with that socket EN7: UDP/TCP receive
-58 Specified address family is currently unsupported EN7: UDP/TCP open
Specified address family cannot be used with that EN7: UDP/TCP send
socket
-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
-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
-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
6F8C1226
21. Communication 21-42

Cautions on a 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.

Overview of processing:
1) Detect online upgrade with duplex switching event task (EV3).
Set the flag indicating that duplex switching occurs to 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 (eg. ┤P├).
• Perform normal programming of USEND_T/URCV_T/USEND_N/URCV_N instruction after implementing 2).

Tracking of Equivalent circuit of REQ


Communication Instruction instance
Controller instruction instance command to communication
instruction data processing
data instruction
Integrated Controller Send USEND_T
Yes Required
V Series Receive URCV_T
Required
Unified Controller nv Send USEND_N
No Not required
Series Receive URCV_N
6F8C1226
21. Communication 21-43

Program example:
[Example (1)]: Program that detects online upgrade in EV3
DUPLEX_ DUPLEX_
CHG_REQ CHG_REQ
(S)

[Example (2)]: Initialization program


[LD/FBD language notation]
DUPLEX_
CHG_REQ

16#0000 TINZ_WORD USEND_T_1


(** Initialize USEND_T_1 instance **)
LD ST
4
N
LD

B4_REQ_CMD B4_REQ_CMD REQ_CMD REQ_CMD (** Initialization of derivative contact


equivalent circuit variable of
(R) (R)
USEND_T REQ command **)
DUPLEX_ DUPLEX_
CHG_REQ CHG_REQ (** Duplex switch flag is reset. However, execute
(R)
flag when initialization of all USEND_T/URCV_T is
completed. **)

[Example (3)]: ┤P├ equivalent circuit and USEND_T instruction program


[LD/FBD language notation]
(** -|P|- input equivalent circuit to REC command of USEND_T **)

REQ_CMD B4_REQ_CMD REQUEST REQ_CMD B4_REQ_CMD


( ) ( )

(** USEND_T program **)

USEND_T_
REQUEST
USEND_T DONE
RE DONE Circuit when -|P|- is used
ST
CM ERRO REQ_CMD REQUEST
CM ERRO ( )
L ST
P STATUS REQUEST
P STATUS
L ST P
N
N
L

[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.
6F8C1226
21. Communication 21-44

Communication Communication FB (XMIT_T)


Diagram
Instance

XMIT_T
Execution request REQ DONE Completion
output
Bus / Unit / Slot / Node no. PRM ERROR Error

Request command CMD STATUS Status

Send/receive data DATA

Modifier EN input Edge execution Index modification


- — —

Arguments:
Arg. Operand Type Const. Description Range
REQ BOOL √ Execution request
PRM PTR — Bus / Unit / Slot / Node No.
Input
CMD PTR — Request command
DATA PTR — Send/receive data
DONE BOOL — Completion output
Output ERROR BOOL — Error
STATUS INT — Status

Instance structure:
Name Type Description
DONE BOOL Completion output
ERROR BOOL Error
STATUS INT Status
RESERVE ARRAY 3W Reserved

Function:
• Function block that communicates with FL-net custom procedure using FL-net module.
• Send / receive is performed with the content of the specified request command CMD at the rise of execution request REQ.
• The format of the bus / unit / slot / node No. PRM is as follows:
15 12 8 0
Bus Unit Slot
Node no.

• Refer to the FL-net User's Guide for the detail of the request command CMD.
• The table data specified with DATA is sent during send and the received data is stored in table specified with DATA during
receive.
• Completion output Q and ERROR are set to ON for one scan only.
• The STATUS contains the completion code if normal completion and error status if abnormal completion.
• Refer to the FL-net User's Guide for the detail of the code No.
6F8C1226
21. Communication 21-45

Program example:
XMIT_T_1 Bus / Unit / Slot / Node no.: SAMPLE1
SIGNAL1 XMIT_T SIGNAL2 16#000A Bus/Unit/Slot
1 REQ DONE 1 Node no.
LD ST
SAMPLE1 SAMPLE4
PRM ERROR Request command: SAMPLE2
LD ST 1 Command no.
SAMPLE2 SAMPLE5 0 Area specification
CMD STATUS 4 Offset L
LD ST
0 Offset H
SAMPLE3
DATA 10 Read word size
LD

• Bus / Unit / Slot / Node No. (basic unit/slot 10, node No. 1) is specified with variable SAMPLE1.
• Request command (Command=cyclic data read, Area=area1, Offset address=4, Read word count=10 words) is specified
with variable SAMPLE2.
• The cyclic data read request specified with request command is made at the rise of variable SIGNAL1 from OFF to ON.
• When cyclic data read request completes normally, the completion output variable SIGNAL2 is set to ON for 1 scanning time.
Also, the normal completion code is stored in variable SAMPLE5, which is the status output.
• When cyclic data read request is unsuccessful, the error output variable SIGNAL3 is set to ON for 1 scanning time. Also, the
error status is stored in variable SAMPLE5, which is the status output.
6F8C1226
21. Communication 21-46

Communication FB (XMIT_N)

nv dedicated
Communication Communication FB(XMIT_N)
instruction
LD/FBD language Instance name
notation
XMIT_N
Completion
Execution request REQ DONE output
Basic unit slot/node/unit/
slot/node no. PRM ERROR Error

Request command CMD STATUS Status

Send/receive data DATA


Modifier EN input Edge execution Index modification
- - -
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 - Basic unit slot / node / unit / slot / node number
Input
CMD PTR - Request command
DATA PTR - Send/receive data
DONE BOOL - Completion output
Output ERROR BOOL - Error
STATUS INT - Status

Instance structure:

Name Type Description Remarks


DONE BOOL Completion output
ERROR BOOL Error Can be accessed from the user program.
STATUS INT Status
RESERVE ARRAY 3W Reserved Cannot be accessed from the user program.

Function:
• This function block communicates with FL-net custom procedure using FL-net module.
• Send/receive is performed with the content of the specified request command CMD at the rise of execution request REQ.
• The format of basic unit slot / node / unit / slot / node number PRM is as follows.
6F8C1226
21. Communication 21-47

15 8 7 0
Unit Slot
Basic unit slot Node
Node no.

• For details on request command CMD, refer to "FL-net Operation Manual."


• The table data specified with DATA is sent during send and the received data is stored in table specified with DATA during
receive.
• Completion output Q and ERROR are set to ON for one scan only.
• The STATUS contains the completion code if normal completion and error status if abnormal completion.
For details on code number, refer to "FL-net Operation Manual."

Program example:
[LD/FBD language notation]

XMIT_N_1 Basic unit slot/node/unit/slot/node no.:


SAMPLE1
SIGNAL1 XMIT_N SIGNAL2
1 REQ DONE 16#010A Unit/Slot
LD ST
16#0003 Basic unit slot/node
SAMPLE1 SIGNAL3
1 Node no.
PRM ERROR
LD ST
SAMPLE2 SAMPLE5 Request command: SAMPLE2
CMD STATUS 65005 Command no.
LD ST
16#8000 Virtual address (L)
SAMPLE3
DATA
16#0001 Virtual address (H)
LD 10 Read word size

[ST language notation]


XMIT_T_1(SIGNAL1, SAMPLE1, SAMPLE2, SAMPLE3);
SIGNAL2 := XMIT_T_1.DONE;
SIGNAL3 := XMIT_T_1.ERROR;
SAMPLE5 := XMIT_T_1.STATUS;

• Basic unit slot / node / unit / slot / node number (built-in, node 3, unit 1, slot 10, node number 1) is specified with variable
SAMPLE1.
• Request command (command = word block read, virtual address =16#0001_8000, read word count =10 words) is specified
with variable SAMPLE2.
• The word block read request specified with request command is made at the rise of variable SIGNAL1 from OFF to ON.
• When the word block read request is completed normally, the completion output variable SIGNAL2 becomes ON for 1
scanning time. Also, the normal completion code is stored in variable SAMPLE5, which is the status output.
• When the word block read request is not completed normally, the error output variable SIGNAL3 becomes ON for 1 scanning
time. Also, the error status is stored in variable SAMPLE5, which is the status output.
6F8C1226
22. Duplex Control 22-1

22 Duplex Control

No. Instruction Remarks


1 Duplex Online-Standby Change DUPLEX_CHG
2 Duplex Self-System Down DUPLEX_DOWN
3 Partial Equalizer (variable specification) EQUALIZE_VAR
4 Partial Equalizer (address specification) EQUALIZE_ADDR
6F8C1226
22. Duplex Control 22-2

Duplex Control Duplex Online-Standby Change

DUPLEX_CHG
Diagram Execution control input Output

EN input Edge execution Index modification


Modifier
√ √ —

Arguments:
Arg. Operand Type Const. Description Remarks
Input — BOOL √ Execution control input
Output — BOOL — Output

Function:
• If the execution control input is OFF, OFF is output without performing any operation.
• If the execution control input is ON, online and standby are changed and ON is output.

Execution control input Action Output


OFF — OFF
ON Executed ON

Program example:
SIGNAL1 DUPLEX_CHG SIGNAL2
1 1
LD ST

• Online and standby are changed when the execution control input SIGNAL1 is ON.
Before instruction execution: DUPLEX_CHG

PS IF PU PS IF PU

Online Standby
After instruction execution:

PS IF PU PS IF PU

Standby Online
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 OFF when the above error occurs.
6F8C1226
22. Duplex Control 22-3

Duplex Control Duplex Self-System Down

DUPLEX_DOWN
Diagram Execution control input Output

EN input Edge execution Index modification


Modifier
√ √ —

Arguments:
Arg. Operand Type Const. Description Remarks
Input — BOOL √ Execution control input
Output — BOOL — Output

Function:
• If the execution control input is OFF, OFF is output without performing any operation.
• If the execution control input is ON, shutdown of self system is forced and ON is output.

Execution control input Action Output


OFF — OFF
ON Executed ON

Program example:
SIGNAL1 DUPLEX_DOWN SIGNAL2
1 1
LD ST

• When the execution control input SIGNAL1 is ON, shutdown of the self system is forced.
Before instruction execution: DUPLEX_DOWN

PS IF PU PS IF PU

Online Standby
After instruction execution:

PS IF PU PS IF PU

Down Online
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 OFF when the above error occurs.
6F8C1226
22. Duplex Control 22-4

Duplex Control Partial Equalizer (variable specification)


Diagram
Variable EQUALIZE_VAR
specification Parameter normal/abnormal
output
Equalizer size N

Modifier EN input Edge execution Index modification


√ √ —

Arguments:
Arg. Operand Type Const. Description Remarks
— PTR — Variable specification
Input
N UINT √ Equalizer size 1 ≤ N ≤ 1024
Normal: ON
Output — BOOL — Parameter normal/abnormal output
Abnormal: OFF

Function:
• Equalizes an N word area starting from the variable specified with the variable specification.
• Variables for which partial equalization can be specified are DW register and user variables.
• 1 to 1024 words may be specified for equalizer size N.
If N>1024, operation is performed assuming N=1024 and output is reset to OFF to indicate a parameter error.
If N=0: No operation is performed.
• If the specified variable is not a DW register or user variable, or if variable specification+size exceeds the area of the variable,
output is reset to OFF to indicate a parameter error.
• Up to eight partial equalize (variable specification, address specification) requests are possible within the same single scan.
• Subsequent equalize requests are not executed and output is reset to OFF to indicate a parameter error.

Program example:
SAMPLE1 EQUALIZE_VAR SIGNAL1 User variable
1
LD ST
SAMPLE2 SAMPLE1
100 N 100W
LD Equalize 100W starting from
SAMPLE1

• Partially equalizes a 100 words area starting from user variable SAMPLE1.

Error information:
• When this instruction is used on non-duplex system, no operation is performed and parameter error occurs.
• If the destination system is in standby, partial equalize is not performed.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
22. Duplex Control 22-5

Duplex Control Partial Equalizer (address specification)


Diagram
EQUALIZE_ADDR
Variable type specification Parameter
SCOPE normal/abnormal output
Top address specification ADDR
Equalize size N

Modifier EN input Edge execution Index modification


√ √ —

Arguments:
Arg. Operand Type Const. Description Remarks
3: DW register
SCOPE UINT √ Variable type specification
4: User variable
Input
ADDR DINT √ Top address specification ADDR ≥ 0
N UINT √ Equalize size 1 ≤ N ≤ 1024
Normal: ON
Output — BOOL — Parameter normal/abnormal output
Abnormal: OFF

Function:
• In the variable SCOPE specified with variable type, equalizes an N word area starting from the top address ADDR.
• Variables for which partial equalization can be specified are DW register (=3) and user variables (=4).
• 1 to 1024 words may be specified for equalizer size N.
If N > 1024, operation is performed assuming N=1024 and output is reset to OFF to indicate a parameter error.
If N=0: No operation is performed.
• If the specified variable is not a DW register (=3) or user variable (=4), or if top address+size exceeds the area of the variable,
output is reset to OFF to indicate a parameter error.
• Up to eight partial equalize (variable specification, address specification) requests are possible within the same single scan.
• Subsequent equalize requests are not executed and output is reset to OFF to indicate a parameter error.

Program example:
SAMPLE1 EQUALIZE_ADDR SIGNAL1 User variable
4 SCOPE 1
LD ST
SAMPLE2 200
200 ADDR 100W
LD Equalizes 100W starting from user variable
SAMPLE3 address 200
100 N
LD

• Partially equalizes a 100 word area starting from user variable address 200.

Error information:
• When this instruction is used on non-duplex system, no operation is performed and parameter error occurs.
• If the destination system is in standby, partial equalize is not performed.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
23. Process Control 23-1

23 Process Control

No Instruction Remarks
1 Current Output PID PID_P
2 Current Output Sample PI SPI_P
3 Pulse Output PID PIDP_P
4 Pulse Output Sample PI SPIP_P
5 Feed Forward FFD_P
6 Double Cross Limit DCL_P

PID algorithm:
The PID algorithm for current output PID, current output sample PI, pulse output PID, and pulse output sample PI is as
described in the figure below. (Pulse output is ΔMV output, but the algorithm is as shown below for all.)

α 1

+ +
+ 1 + 1
SV 1- α Kp MV
1+β Tis + Tis
- + - +

αγ

+
Tds
1+ηTds
-
PV

Features:
This is equivalent to hyper PID implemented in the small-scale system (MCS) and TOSDIC-CIE-DS (PCS-DS).
• An improved bilinear transformation is used for derivative calculation.
• A hyper PID unique method is used for anti-reset-windup (ARW) function. As ARW 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 3 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.
6F8C1226
23. Process Control 23-2

Process Control Current Output PID


Diagram
Instance name
PID_P
SV input SV MV Result output (MV)

PV input PV

Feed forward gain GAN

FFS
Feed forward static characteristic
FFD
Feed forward dynamic characteristic
Tracking MV input TR

Tracking request flag MVT

LP data variable LP_D

LP parameter variable LP_P

Modifier EN input Edge execution Index modification


― ― ―

Arguments:
Arg. Operand Type Const. Description
Input SV REAL √ SV input [Engineering value]
PV REAL √ PV input [Engineering value]
GAN 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 √ Tracking request flag
LP_D PTR ― LP data variable
LP_P PTR ― LP parameter variable
Output MV REAL ― Result output (MV) [%] (positional type)
Pointers to tag table are placed in LP data variable and LP parameter variable.
A setup example is shown below.
Array no.=0, tag no.=FIC100 are assumed for the used adjuster tag.
Notation Array Tag symbol
MCS connection DS connection
version version
(L1,L2,L3) (L2DS,L3DS)
Operand
LP_D LP_DATA[0] FIC100.SV FIC100.CLI
LP_P LP_PARA[0] FIC100.OA FIC100.TAG[0]
6F8C1226
23. Process Control 23-3

The following tag symbols are referenced by this instruction.


Operand Symbol Type R/W Description
Referenced RH REAL R PV range high [Engineering unit]
by LP_P.PVP Used for percent conversion of SV/PV
RL REAL R PV range low [Engineering unit]
Used for percent conversion of SV/PV
LP_D MODE UINT R control mode:Used for control operation execution, reset condition
(LP_DATA) CLI BOOL R Control stop alarm Used for control operation reset condition
MVE BOOL R MV error
SMV BOOL R Sequence MV
CMV BOOL R Computer MV
LP_P PVP UINT R Indicator PV no.
(LP_PARA) DT0 UINT R Scan time (number indicating multiple of scan time)
KP REAL R Proportional gain Used as PID gain
TI REAL R Integral time [min] Used as PID integral time
TD REAL R Rate time [min] Used as PID rate time
ETA REAL R Rate gain Used as PID rate gain parameter
ALP REAL R 2 degrees of freedom parameter α SV filter parameter
BET REAL R 2 degrees of freedom parameter β SV filter parameter
GAM REAL R 2 degrees of freedom parameter γ SV filter parameter
GAP REAL R Gap:Used as rate limiter condition in non-linear operation
GG REAL R Gap gain:Used as rate limiter coefficient in non-linear operation
MH REAL R MV high limit value[%]
ML REAL R MV low limit value[%]
DMV REAL R MV rate limiter[%/scan time]
CDR BOOL R Control direction Used as sign of PID operation
R/W: R=Read only, W=Write only, R/W=Read/Write

Instance structure:
Name Type Description
B4MODE UINT Control mode previous value (initial value: M) Used to detect change in control mode
CT REAL Actual time totalization (initial value: Main scan cycle) Used for scan time measurement
B4E REAL P term previous value (initial value: SV-PV)
During speed type operation, this is used to calculate the speed component from difference
with previous value
B4D REAL SV filter differential term input previous value (initial value: αγSV-PV)
Used to calculate change in input in differential approximation operation
B5D REAL SV filter differential term input next to previous value (initial value: αγSV-PV)
Used for exact differential term in improved bilinear transformation
B4D1 REAL SV filter differential term (initial value: 0) SV filter αγ term
B4D2 REAL SV filter proportional/integral term (initial value: (1-α)SV) αβ term of SV filter
B4MV REAL MV totalization limit previous value (initial value: TR)
High/low rate limiter previous MV totalization value (proportional/differential term assurance)
B4FFD REAL Feed forward dynamic characteristic difference calculation previous value (initial value: FFD)
Previous value for adding dynamic characteristic by difference
6F8C1226
23. Process Control 23-4

Function:
• There is no execution flag. This instruction is always executed. If the operation must be reset, set MVT as initialization
request. In this case, TR is also necessary in order to initialize MV.
• The result of executing the feed forward instruction (FFD_P) can be used as input (GAN, FFS, FFD) to feed forward. If feed
forward is not used, use fixed values (GAN=1, FFS=0, FFD=0).
• The PV parameter variable is referenced with the indicator PV no. (PVP) of the LP parameter variable.
• Direct I/O variables cannot be specified for PV data variable or LP parameter variable.
• Control operation function
• Hyper PID is used for control operation. Output is the high/low rate limited positional type MV value.
♦ SV filter
An SV filter with super 2 degrees of freedom PID is implemented. Hyper PID adds a delay filter to SV in order to reduce
the change in MV even when SV changes suddenly. This SV filter is not related to change in PV and PV change
(disturbance) characteristic is unchanged. When tuning PID, set the parameters to be appropriate for the disturbance.
Under this condition, the filter status can be optimized for the step change of SV.
The 2 degrees of freedom parameters (α, β, γ) of hyper PID are semi-fixed values. Under normal condition, the initial
values can be used without change.
The SV filter includes differential operation. This differential operation uses an improved bilinear transformation that is
an improved version of the bilinear transformation which is a popular digital operation. Under normal condition, bilinear
transformation is used and a switch is made to exact differential when the rate time setting is relatively shorter than the
scan time. The rate time can be changed during control operation without problem.
The SV filter operation is performed during each scan cycle. Control operation is performed based on the specified
control cycle (DT0).
♦ Anti-reset windup
An anti-reset windup (ARW) function is added to cancel the excessive saturation of the integrating term. The method
used here suppresses the change in the saturating direction of the integrating term when MV is saturated at high/low
limit. Also, the internal MV totalization is high/low limited by high limit (MH+MV rate limiter) and low limit (ML-MV rate
limiter).
Although the ARW function is provided, a slight reset windup condition occurs. This is designed to prevent MV from
changing when there is a minute change in disturbance (change in PV) and SV when MV is saturated. Therefore, if SV
is reversed when MV is saturated, tracking by MV may be delayed. In such case, handle this from the application
program by changing the control mode to M mode and tracking manually, or temporarily switching to non-PID control
operation and using batch processing control for example.
♦ Non-linear processing
A gap function is incorporated as non-linear PID. When the deviation is within the gap width, the change in MV output
is suppressed by multiplying the rate limiter by gap gain.
6F8C1226
23. Process Control 23-5

Program example:
PID_01
FIC100.SV PID_P FIC100.MV In case of L1
SV MV
LD ST
FIC100.PV
PV
LD
Variables:
1 Variable Data type Dec.
GAN
LD PID_01 PID_P VAR
0 Controller Variables:
FFS Variable Data type
LD
!FIC100 typeLP_PARA
0
FFD !FIC100 typeLP_DATA
LD !FIC100 typePV_DATA
FIC100.MV
TR
LD
0
MVT
LD
FIC100.SV
LP_D
LD
FIC100.OA
LP_P
LD

• Performs PID operation of adjuster tag (FIC100).


• This example uses basic PID (feed forward not used). For advanced PID, see the program example for the feed forward
instruction (feed forward used).

Error information:
• If nonnumeric data is entered in input data, the result is output as nonnumeric.
• If RH=RL, the Divide Error Flag is set to ON and the previous value is held in output.
• If the LP parameter specification is incorrect (such as specifying variable other than LP tag parameter), the Table Operation
Error is set to ON and the previous value is held in output.

Notes:
• MV output when control is stopped
When PID operation is stopped because of tracking request or control stop warning, the output is as follows depending on
the condition for stopping.
Stop condition MV output
Tracking request flag (TR)=ON Tracking MV input (TR)
Mode=M or RM Tracking MV input (TR)
When mode changes Previous MV (held)
Control stop warning (CLI)=ON or MV error (MVE)=ON Previous MV (held)
Setting MV (SMV=ON or CMV=ON) Tracking MV input (TR)
6F8C1226
23. Process Control 23-6

Process Control Current Output Sample PI


Diagram
Instance name
SPI_P
SV input SV MV Result output (MV)

PV input PV

Feed forward gain GAN

FFS
Feed forward static characteristic

Feed forward dynamic characteristic FFD

Tracking MV input TR

Tracking request flag MVT

LP data variable LP_D

LP parameter variable LP_P

Modifier EN input Edge execution Index modification


⎯ ⎯ ⎯

Arguments:
Arg. Operand Type Const. Description
SV REAL √ SV input [Engineering value]
PV REAL √ PV input [Engineering value]
GAN 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
Input 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 √ Tracking request flag
LP_D PTR ― LP data variable
LP_P PTR ― LP parameter variable
Output MV REAL ― Result output (MV) [%] (positional type)
Pointers to tag table are placed in LP data variable and LP parameter variable.
A setup example is shown below.
Array no.=0, tag no.=FIC100 are assumed for the used adjuster tag.
Notation Array Tag symbol

MCS connection DS connection


version version
(L1,L2,L3) (L2DS,L3DS)
Operand
LP_D LP_DATA[0] FIC100.SV FIC100.CLI
LP_P LP_PARA[0] FIC100.OA FIC100.TAG[0]
6F8C1226
23. Process Control 23-7

The following tag symbols are referenced by this instruction.


Operand Symbol Type R/W Description
Referenced RH REAL R PV range high [Engineering unit]
by LP_P.PVP Used for percent conversion of SV/PV
RL REAL R PV range low [Engineering unit]
Used for percent conversion of SV/PV
LP_D MODE UINT R control mode:Used for control operation execution, reset condition
(LP_DATA) CLI BOOL R Control stop alarm Used for control operation reset condition
MVE BOOL R MV error
SMV BOOL R Sequence MV
CMV BOOL R Computer MV
LP_P PVP UINT R Indicator PV no.
(LP_PARA) KP REAL R Proportional gain Used as PID gain
TI REAL R Integral time [min] Used as PID integral time
TD REAL R Rate time [min] Used as PID rate time
ETA REAL R Rate gain Used as PID rate gain parameter
ALP REAL R 2 degrees of freedom parameter α SV filter parameter
BET REAL R 2 degrees of freedom parameter β SV filter parameter
GAM REAL R 2 degrees of freedom parameter γ SV filter parameter
GAP REAL R Gap:Used as rate limiter condition in non-linear operation
GG REAL R Gap gain:Used as rate limiter coefficient in non-linear operation
MH REAL R MV high limit value[%]
ML REAL R MV low limit value[%]
DMV REAL R MV rate limiter[%/scan time]
CDR BOOL R Control direction Used as sign of PID operation
T0 UINT R Sample PI sample cycle
(A number indicating integral multiple of scan time)
T1 UINT R Sample PI control time
(A number indicating integral multiple of scan time)
R/W: R=Read only, W=Write only, R/W=Read/Write

Instance structure:
Name Type Description
B4MODE UINT Control mode previous value (initial value: M) Used to detect change in control mode
CT REAL Actual time totalization (initial value: Main scan cycle) Used for scan time measurement
B4E REAL P term previous value (initial value: SV-PV)
During speed type operation, this is used to calculate the speed component from difference
with previous value
B4D REAL SV filter differential term input previous value (initial value:αγSV-PV)
Used to calculate change in input in differential approximation operation
B5D REAL SV filter differential term input next to previous value (initial value: αγ SV-PV)
Used for exact differential term in improved bilinear primary transformation
B4D1 REAL SV filter differential term (initial value: 0) SV filter αγ term
B4D2 REAL SV filter proportional/integral term (initial value: (1-α)SV) αβ term of SV filter
B4MV REAL MV totalization limit previous value (initial value: TR)
High/low rate limiter previous MV totalization value (proportional/differential term assurance)
B4FFD REAL Feed forward dynamic characteristic difference calculation previous value (initial value: FFD)
Previous value for adding dynamic characteristic by difference
6F8C1226
23. Process Control 23-8

Function:
• There is no execution flag. This instruction is always executed. If the operation must be reset, set MVT as initialization
request. In this case, TR is also necessary in order to initialize MV.
• The result of executing the feed forward instruction (FFD_P) can be used as input (GAN, FFS, FFD) to feed forward. If feed
forward is not used, use fixed values (GAN=1, FFS=0, FFD=0).
• The PV parameter variable is referenced with the indicator PV no. (PVP) of the LP parameter variable.
• Direct I/O variables cannot be specified for PV data variable or LP parameter variable.
• Control operation function
Hyper PID is used for control operation. Output is the high/low rate limited positional type MV value.
♦ SV filter
An SV filter with super 2 degrees of freedom PID is implemented. Hyper PID adds a delay filter to SV in order to reduce
the change in MV even when SV changes suddenly. This SV filter is not related to change in PV and PV change
(disturbance) characteristic is unchanged. When tuning PID, set the parameters to be appropriate for the disturbance.
Under this condition, the filter status can be optimized for the step change of SV.
The 2 degrees of freedom parameters (α, β, γ) of hyper PID are semi-fixed values. Under normal condition, the initial
values can be used without change.
The SV filter includes differential operation. This differential operation uses an improved bilinear transformation that is
an improved version of the bilinear transformation which is a popular digital operation. Under normal condition, bilinear
transformation is used and a switch is made to exact differential when the rate time setting is relatively shorter than the
scan time. The rate time can be changed during control operation without problem.
The SV filter operation is performed during each scan cycle. Control operation is performed based on the specified
control cycle (T0, T1).
♦ Anti-reset windup
An anti-reset windup (ARW) function is added to cancel the excessive saturation of the integrating term. The method
used here suppresses the change in the saturating direction of the integrating term when MV is saturated at high/low
limit. Also, the internal MV totalization is high/low limited by high limit (MH+MV rate limiter) and low limit (ML-MV rate
limiter).
Although the ARW function is provided, a slight reset windup condition occurs. This is designed to prevent MV from
changing when there is a minute change in disturbance (change in PV) and SV when MV is saturated. Therefore, if SV
is reversed when MV is saturated, tracking by MV may be delayed. In such case, handle this from the application
program by changing the control mode to M mode and tracking manually, or temporarily switching to non-PID control
operation and using batch processing control for example.
Non-linear processing
A gap function is incorporated as non-linear PID. When the deviation is within the gap width, the change in MV output is
suppressed by multiplying the rate limiter by gap gain.
6F8C1226
23. Process Control 23-9

♦ Sampling and control


The sample PI adjusts the time where control is intermittent in the control cycle of the PID operation.
Output is updated during the control time (T1) at the front half of the sample time (T0).
CL

T1 Control time
T0 Sample time

MV

In sample PI, control operation is executed continuously during T1. Unlike intermittent control withΔT of PID, the
operation cycle is always the scan cycle. Therefore, the continuity of the proportional term and differential term is broken.
This discontinuity is handled by initializing the proportional term and differential term each time control execution is
started (beginning of T1).
The SV filter section is calculated during each cycle irrelevant of T0 and T1.

Program example:
PID_01
In case of L1
FIC100.SV SPI_P FIC100.MV
SV MV
LD ST
FIC100.PV
PV
LD
1
Variables:
GAN Variable Data type Dec.
LD PID_01 SPI_P VAR
0 Controller Variables:
FFS Variable Data type
LD
0 !FIC100 typeLP_PARA
FFD !FIC100 typeLP_DATA
LD
!FIC100 typePV_DATA
FIC100.MV
TR
LD
0
Scan cycle: 0.5s
MVT Sample time (T0): 20
LD Control time (T1): 5
FIC100.SV
LP_D
LD
FIC100.OA
LP_P
LD

• Performs sample PI operation of adjuster tag (FIC100). (Sample time: 10s, control time: 2.5s)
• This example uses basic PID (feed forward not used). For advanced PID, see the program example (assuming PID_P as
SPI_P) for the feed forward instruction (feed forward used).
6F8C1226
23. Process Control 23-10

Error information:
• If nonnumeric data is entered in input data, the result is output as nonnumeric.
• If RH=RL, the Divide Error Flag is set to ON and the previous value is held in output.
• If the LP parameter specification is incorrect (such as specifying variable other than LP tag parameter), the Table Operation
Error is set to ON and the previous value is held in output.

Notes:
• MV output when control is stopped
When PID operation is stopped because of tracking request or control stop warning, the output is as follows depending on
the condition for stopping.
Stop condition MV output
Tracking request flag (TR)=ON Tracking MV input (TR)
Mode=M or RM Tracking MV input (TR)
When mode changes Previous MV (held)
Control stop warning (CLI)=ON or MV error (MVE)=ON Previous MV (held)
Setting MV (SMV=ON or CMV=ON) Tracking MV input (TR)
6F8C1226
23. Process Control 23-11

Process Control Pulse Output PID


Diagram
Instance name
PIDP_P
SV input SV DMV Result output (ΔMV)

PV input PV CL Output request


Pulse output update
Feed forward gain GAN

Feed forward static characteristic FFS

Tracking request flag MVT

LP data variable LP_D

LP parameter variable LP_P

Modifier EN input Edge execution Index modification


― ― ―

Arguments:
Arg. Operand Type Const. Description
Input SV REAL √ SV input [Engineering value]
PV REAL √ PV input [Engineering value]
REAL Feed forward gain
GAN √ PID proportional gain compensation
Specify 1.0 when feed forward is not used
REAL Feed forward static characteristic [%]
FFS √
Specify 0.0 when feed forward is not used
MVT BOOL √ Tracking request flag
LP_D PTR ― LP data variable
LP_P PTR ― LP parameter variable
Output DMV REAL ― Result output (ΔMV) [%] (speed type)
CL BOOL ― Output request Pulse output update request
Pointers to tag table are placed in LP data variable and LP parameter variable.
A setup example is shown below.
Array no.=0, tag no.=FIC100 are assumed for the used adjuster tag.
Notation Array Tag symbol
MCS connection DS connection
version version
(L1,L2,L3) (L2DS,L3DS)
Operand
LP_D LP_DATA[0] FIC100.SV FIC100.CLI
LP_P LP_PARA[0] FIC100.OA FIC100.TAG[0]
6F8C1226
23. Process Control 23-12

The following tag symbols are referenced by this instruction.


Operand Symbol Type R/W Description
Referenced by RH REAL R PV range high [Engineering unit]
LP_P.PVP Used for percent conversion of SV/PV
RL REAL R PV range low [Engineering unit]
Used for percent conversion of SV/PV
LP_D MODE UINT R control mode:Used for control operation execution, reset condition
(LP_DATA) CLI BOOL R Control stop alarm Used for control operation reset condition
MVE BOOL R MV error
SMV BOOL R Sequence MV
CMV BOOL R Computer MV
VPI BOOL R Valve position input error Used as MV high/low limit condition
LP_P PVP UINT R Indicator PV no.
(LP_PARA) DT0 UINT R Scan time (number indicating multiple of scan time)
KP REAL R Proportional gain Used as PID gain
TI REAL R Integral time [min] Used as PID integral time
TD REAL R Rate time [min] Used as PID rate time
ETA REAL R Rate gain Used as PID rate gain parameter
ALP REAL R 2 degrees of freedom parameter α SV filter parameter
BET REAL R 2 degrees of freedom parameter β SV filter parameter
GAM REAL R 2 degrees of freedom parameter γ SV filter parameter
GAP REAL R Gap:Used as rate limiter condition in non-linear operation
GG REAL R Gap gain:Used as rate limiter coefficient in non-linear operation
MH REAL R MV high limit value[%]
ML REAL R MV low limit value[%]
DMV REAL R MV rate limiter[%/scan time]
CDR BOOL R Control direction Used as sign of PID operation
VP UINT R Valve position input PV no.
Used as the presence of valve position input which is the basis of pulse
output high/low limit
R/W: R=Read only, W=Write only, R/W=Read/Write

Instance structure:
Name Type Description
B4MODE UINT Control mode previous value (initial value: M) Used to detect change in control mode
CT REAL Actual time totalization (initial value: Main scan cycle) Used for scan time measurement
B4E REAL P term previous value (initial value: SV-PV)
During speed type operation, this is used to calculate the speed component from difference
with previous value
B4D REAL SV filter differential term input previous value (initial value: αγSV-PV)
Used to calculate change in input in differential approximation operation
B5D REAL SV filter differential term input next to previous value (initial value: αγSV-PV)
Used for exact differential term in improved bilinear primary transformation
B4D1 REAL SV filter differential term (initial value: 0) SV filter αγ term
B4D2 REAL SV filter proportional/integral term (initial value: (1-α)SV) αβ term of SV filter
6F8C1226
23. Process Control 23-13

Function:
• There is no execution flag. This instruction is always executed. If the operation must be reset, set MVT as initialization
request.
• The result of executing the feed forward instruction (FFD_P) can be used as input (GAN, FFS) to feed forward. If feed
forward is not used, use fixed values (GAN=1, FFS=0).
• The PV parameter variable is referenced with the indicator PV no. (PVP) of the LP parameter variable.
• Direct I/O variables cannot be specified for PV data variable or LP parameter variable.
• Control operation function
Hyper PID is used for control operation.
Output is the high/low rate limited positional type MV value.
♦ SV filter
An SV filter with super 2 degrees of freedom PID is implemented.
Hyper PID adds a delay filter to SV in order to reduce the change in MV even when SV changes suddenly. This SV
filter is not related to change in PV and PV change (disturbance) characteristic is unchanged. When tuning PID, set the
parameters to be appropriate for the disturbance. Under this condition, the filter status can be optimized for the step
change of SV.
The 2 degrees of freedom parameters (α, β, γ) of hyper PID are semi-fixed values. Under normal condition, the initial
values can be used without change.
The SV filter includes differential operation. This differential operation uses an improved bilinear transformation that is
an improved version of the bilinear transformation which is a popular digital operation. Under normal condition, bilinear
transformation is used and a switch is made to exact differential when the rate time setting is relatively shorter than the
scan time. The rate time can be changed during control operation without problem.
The SV filter operation is performed during each scan cycle. Control operation is performed based on the specified
control cycle (DT0).
♦ Non-linear processing
A gap function is incorporated as non-linear PID.
When the deviation is within the gap width, the change in MV output is suppressed by multiplying the rate limiter by gap
gain.
6F8C1226
23. Process Control 23-14

Program example:
PID_01
FIC100.SV PIDP_P FIC100.PMV In case of L1
SV DMV
LD ST
FIC100.PV FIC100.POR
PV CL
LD ST
1
GAN Variables:
LD
Variable Data type Dec.
0
FFS PID_01 PIDP_P VAR
LD Controller Variables:
0 Variable Data type
MVT
LD !FIC100 typeLP_PARA
FIC100.SV !FIC100 typeLP_DATA
LP_D !FIC100 typePV_DATA
LD
FIC100.OA
LP_P
LD

• Performs PID operation of adjuster tag (FIC100).


• This example directly outputs to pulse output ΔMV (PMV) and pulse output request (POR) of the adjuster tag.
• This example uses basic PID (feed forward not used). For advanced PID, see the program example for the feed forward
instruction (feed forward used).

Error information:
• If nonnumeric data is entered in input data, the result is output as nonnumeric.
• If RH=RL, the Divide Error Flag is set to ON and the previous value is held in output.
• If the LP parameter specification is incorrect (such as specifying variable other than LP tag parameter), the Table Operation
Error is set to ON and the previous value is held in output.
6F8C1226
23. Process Control 23-15

Process Control Pulse Output Sample PI


Diagram
Instance name
SPIP_P
SV input SV DMV Result output (ΔMV)

PV input PV CL Output request


Pulse output update
Feed forward gain GAN

Feed forward static characteristic FFS

Tracking request flag MVT

LP data variable LP_D

LP parameter variable LP_P

Modifier EN input Edge execution Index modification


― ― ―

Arguments:
Arg. Operand Type Const. Description
Input SV REAL √ SV input [Engineering value]
PV REAL √ PV input [Engineering value]
GAN 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
MVT BOOL √ Tracking request flag
LP_D PTR ― LP data variable
LP_P PTR ― LP parameter variable
Output DMV REAL ― Result output (ΔMV) [%] (speed type)
CL BOOL ― Output request Pulse output update request
Pointers to tag table are placed in LP data variable and LP parameter variable.
A setup example is shown below.
Array no.=0, tag no.=FIC100 are assumed for the used adjuster tag.
Notation Array Tag symbol
MCS connection DS connection
version version
(L1,L2,L3) (L2DS,L3DS)
Operand
LP_D LP_DATA[0] FIC100.SV FIC100.CLI
LP_P LP_PARA[0] FIC100.OA FIC100.TAG[0]
6F8C1226
23. Process Control 23-16

The following tag symbols are referenced by this instruction.


Operand Symbol Type R/W Description
Referenced by RH REAL R PV range high [Engineering unit]
LP_P.PVP Used for percent conversion of SV/PV
RL REAL R PV range low [Engineering unit]
Used for percent conversion of SV/PV
LP_D MODE UINT R control mode:Used for control operation execution, reset condition
(LP_DATA) CLI BOOL R Control stop alarm Used for control operation reset condition
MVE BOOL R MV error
SMV BOOL R Sequence MV
CMV BOOL R Computer MV
VPI BOOL R Valve position input error Used as MV high/low limit condition
LP_P PVP UINT R Indicator PV no.
(LP_PARA) KP REAL R Proportional gain Used as PID gain
TI REAL R Integral time [min] Used as PID integral time
TD REAL R Rate time [min] Used as PID rate time
ETA REAL R Rate gain Used as PID rate gain parameter
ALP REAL R 2 degrees of freedom parameter α SV filter parameter
BET REAL R 2 degrees of freedom parameter β SV filter parameter
GAM REAL R 2 degrees of freedom parameter γ SV filter parameter
GAP REAL R Gap:Used as rate limiter condition in non-linear operation
GG REAL R Gap gain:Used as rate limiter coefficient in non-linear operation
MH REAL R MV high limit value[%]
ML REAL R MV low limit value[%]
DMV REAL R MV rate limiter[%/scan time]
CDR BOOL R Control direction Used as sign of PID operation
T0 UINT R Sample PI sample cycle
(A number indicating integral multiple of scan time)
T1 UINT R Sample PI control time
(A number indicating integral multiple of scan time)
VP UINT R Valve position input PV no. Used as the presence of valve position input
which is the basis of pulse output high/low limit
R/W: R=Read only, W=Write only, R/W=Read/Write

Instance structure:
Name Type Description
B4MODE UINT Control mode previous value (initial value: M) Used to detect change in control mode
CT REAL Actual time totalization (initial value: Main scan cycle) Used for scan time measurement
B4E REAL P term previous value (initial value: SV-PV)
During speed type operation, this is used to calculate the speed component from difference
with previous value
B4D REAL SV filter differential term input previous value (initial value: αγ SV-PV)
Used to calculate change in input in differential approximation operation
B5D REAL SV filter differential term input next to previous value (initial value: αγ SV-PV)
Used for exact differential term in improved bilinear primary transformation
B4D1 REAL SV filter differential term (initial value: 0) SV filter αγ term
B4D2 REAL SV filter proportional/integral term (initial value: (1-α)SV) αβ term of SV filter
6F8C1226
23. Process Control 23-17

Function:
• There is no execution flag. This instruction is always executed. If the operation must be reset, set MVT as initialization
request.
• The result of executing the feed forward instruction (FFD_P) can be used as input (GAN, FFS) to feed forward. If feed
forward is not used, use fixed values (GAN=1, FFS=0).
• The PV parameter variable is referenced with the indicator PV no. (PVP) of the LP parameter variable.
• Direct I/O variables cannot be specified for PV data variable or LP parameter variable.
• Control operation function
Hyper PID is used for control operation.
The high/low rate limited speed type MV value and output request flag indicating the pulse update timing are output.
♦ SV filter
An SV filter with super 2 degrees of freedom PID is implemented.
Hyper PID adds a delay filter to SV in order to reduce the change in MV even when SV changes suddenly. This SV
filter is not related to change in PV and PV change (disturbance) characteristic is unchanged. When tuning PID, set the
parameters to be appropriate for the disturbance. Under this condition, the filter status can be optimized for the step
change of SV.
The 2 degrees of freedom parameters (α, β, γ) of hyper PID are semi-fixed values. Under normal condition, the initial
values can be used without change.
The SV filter includes differential operation. This differential operation uses an improved bilinear transformation that is
an improved version of the bilinear transformation which is a popular digital operation. Under normal condition, bilinear
transformation is used and a switch is made to exact differential when the rate time setting is relatively shorter than the
scan time. The rate time can be changed during control operation without problem.
The SV filter operation is performed during each scan cycle. Control operation is performed based on the specified
control cycle (T0, T1).
♦ Non-linear processing
A gap function is incorporated as non-linear PID.
When the deviation is within the gap width, the change in MV output is suppressed by multiplying the rate limiter by gap
gain.
♦ Sampling and control
The sample PI adjusts the time where control is intermittent in the control cycle of the PID operation.
Output is updated during the control time (T1) at the front half of the sample time (T0).
CL

T1 Control time
T0 Sample time

MV

In sample PI, control operation is executed continuously during T1. Unlike intermittent control with ΔT of PID, the
operation cycle is always the scan cycle. Therefore, the continuity of the proportional term and differential term is
broken. This discontinuity is handled by initializing the proportional term and differential term each time control
execution is started (beginning of T1).
The SV filter section is calculated during each cycle irrelevant of T0 and T1.
6F8C1226
23. Process Control 23-18

Program example:
PID_01
FIC100.SV SPIP_P FIC100.PMV In case of L1
SV DMV
LD ST
FIC100.PV FIC100.POR
PV CL
Variables:
LD ST
Variable Data type Dec.
1
GAN PID_01 SPIP_P VAR
LD Controller Variables:
0 Variable Data type
FFS
LD !FIC100 typeLP_PARA
0 !FIC100 typeLP_DATA
MVT !FIC100 typePV_DATA
LD
FIC100.SV
LP_D Scan cycle: 0.5s
LD
Sample time (T0): 20
FIC100.OA
Control time (T1): 5
LP_P
LD

• Performs sample PI operation of adjuster tag (FIC100). (Sample time: 10s, control time: 2.5s)
• This example outputs directly to adjuster tag pulse output ΔMV (PVM) and pulse output request (POR).
• This example uses basic PID (feed forward not used). For advanced PID, see the program example (assuming PIDP_P as
SPIP_P) for the feed forward instruction (feed forward used).

Error information:
• If nonnumeric data is entered in input data, the result is output as nonnumeric.
• If RH=RL, the Divide Error Flag is set to ON and the previous value is held in output.
• If the LP parameter specification is incorrect (such as specifying variable other than LP tag parameter), the Table Operation
Error is set to ON and the previous value is held in output.
6F8C1226
23. Process Control 23-19

Process Control Feed Forward


Diagram
Instance name
FFD_P
Input variable X GAN Feed forward gain

Feed forward parameter FF_P FFS Feed forward static characteristic

LP data variable LP_D FFD Feed forward dynamic characteristic

Modifier EN input Edge execution Index modification


― ― ―

Arguments:
Arg. Operand Type Const. Description
Input X REAL √ Input variable [Engineering value]
FF_P PTR ― Feed forward parameter variable
LP_D PTR ― LP data variable
Output GAN REAL ― Feed forward gain
FFS REAL ― Feed forward static characteristic [%]
FFD REAL ― Feed forward dynamic characteristic [%]
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 Array Tag symbol
MCS connection DS connection
version version
(L1,L2,L3) (L2DS,L3DS)
Operand
LP_D LP_DATA[0] FIC100.SV FIC100.CLI
The following tag symbols are referenced by this instruction.
Operand Symbol Type R/W Description
LP_D MODE UINT R control mode
(LP_DATA) Used for control operation execution, reset condition
CLI BOOL R Control stop alarm Used for control operation reset condition
MVE BOOL R MV error
SMV BOOL R Sequence MV
CMV BOOL R Computer MV
R/W: R=Read only, W=Write only, R/W=Read/Write

Feed forward parameter structure:


Name Type Description
K REAL Gain
K0 REAL Supplementary gain
H REAL Gain high limit
L REAL Gain low limit
X0 REAL MV standard value
C REAL MV coefficient
TP REAL Process time constant
TD REAL Disturbance time constant
DB REAL Output dead band
The feed forward parameters are created from a combination of user defined structures and user variables.
6F8C1226
23. Process Control 23-20

Instance structure:
Name Type Description
B4MODE UINT Control mode previous value (initial value: M) Used to detect change in control mode
B4D REAL Feed forward dynamic characteristic input value
B4Y REAL Feed forward dynamic characteristic temporary delay

Function:
• There is no execution flag. This instruction is always executed.
• Direct I/O variables cannot be specified for PV parameter variable or LP parameter variable.
• Control operation function
Three types of output, gain compensation (GAN), static characteristic compensation (FFS), and dynamic characteristic
compensation (FFD) are calculated as gain scheduling type feed forward.

KO 1+TPS
X K
1+TDS

HL

limit

1+(Dn―X0)C/X0 Difference Non-linearize

GAN FFS FFD


6F8C1226
23. Process Control 23-21

Program example:

In case of L1 User defined structure


typeFFD_PARA:
PID_01 Member Data type
FIC100.SV PID_P FIC100.MV
SV MV K Real
LD ST K0 Real
FIC100.PV
PV H Real
FFD_1 LD L Real
IND100.PV FFD_P X0 Real
X GAN GAN
LD C Real
FF_P TP Real
FF_P FFS FFS TD Real
LD
FIC100.SV
DB Real
LP_D FFD FFD
LD
FIC100.MV
Variables:
TR Variable Data type Dec.
LD PID_01 PID_P VAR
0 FFD_1 FFD_P VAR
MVT
LD Controller Variables:
FIC100.SV
Variable Data type
LP_D !FIC100 typeLP_PARA
LD
!FIC100 typeLP_DATA
FIC100.OA
LP_P !FIC100 typePV_DATA
LD !IND100 typePV_DATA
FF_P typeFFD_PARA

Performs PID operation of adjuster tag (FIC100) with feed forward of disturbance element (IND100.PV) added.

Error information:
• If nonnumeric data is entered in input data, the result is output as nonnumeric.
6F8C1226
23. Process Control 23-22

Process Control Double Cross Limit


Diagram
Instance name
DCL_P
Master input variable PV ?
FSV Fuel adjuster SV

Air flow AIR ASV Air adjuster SV

Fuel flow FUEL

Fuel MV tracking value FTR

Air MV tracking value ATR

Double cross limit parameter DCL_P

Fuel LP data variable LP_FD

Fuel LP parameter variable LP_FP

Air LP data variable LP_AD

Air LP parameter variable LP_AP

Modifier EN input Edge execution Index modification


― ― ―

Arguments:
Arg. Operand Type Const. Description
Input PV REAL √ Master input variable [%]
AIR REAL √ Air flow [Engineering value]
FUEL REAL √ Fuel flow [Engineering value]
FTR REAL √ Fuel MV tracking value [Engineering value]
ATR REAL √ Air MV tracking value [Engineering value]
DCL_P PTR ― Double cross limit parameter table
LP_FD PTR ― Fuel LP data variable
LP_FP PTR ― Fuel LP parameter variable
LP_AD PTR ― Air LP data variable
LP_AP PTR ― Air LP parameter variable
Output FSV REAL ― Fuel adjuster SV [Engineering value]
ASV REAL ― Air adjuster SV [Engineering value]
Pointers to tag table are placed in LP data variable and LP parameter variable.
A setup example is shown below. Array no.=0, tag no.=FIC100 are assumed for the used adjuster tag.
Notation Array Tag symbol
MCS DS connection
connection version
version (L2DS,L3DS)
Operand (L1,L2,L3)
LP_FD,LP_AD LP_DATA[0] FIC100.SV FIC100.CLI
LP_FP,LP_AP LP_PARA[0] FIC100.OA FIC100.TAG[0]
6F8C1226
23. Process Control 23-23

The following tag symbols are referenced by this instruction.


Operand Symbol Type R/W Description
Referenced by RH REAL R PV range high [Engineering unit]
LP_FP/AP.PV Used for percent conversion of AIR/FUEL
(PV_PARA) RL REAL R PV range low [Engineering unit]
Used for percent conversion of AIR/FUEL
LP_FP/AP PVP UINT R Indicator PV no.
(LP_PARA)
R/W: R=Read only, W=Write only, R/W=Read/Write
6F8C1226
23. Process Control 23-24

Double cross limit parameter structure:


Name Type Description
K1 REAL Smoke emitting limit when load is increasing [%]
K2 REAL Smoke emitting limit when load is decreasing [%]
K3 REAL Air excess limit when load is decreasing [%]
K4 REAL Air excess limit when load is increasing [%]
BETA REAL Transform coefficient (β > 0)
MU REAL Air excess rate (μ > 0)
L REAL Air low limit [%]
ADV REAL (Not used)
FDV REAL (Not used)
The double cross limit parameters are created from a combination of user defined structures and user variables.

Instance structure:
Name Type Description
B4FMODE UINT (Not used)
B4AMODE UINT (Not used)
PD1 REAL (Not used)
PD2 REAL (Not used)
DLM1 REAL (Not used)
DLM2 REAL (Not used)

Function:
• There is no execution flag. This instruction is always executed.
• Direct I/O variables cannot be specified for LP parameter variable, LP data variable, or DCL parameter variable.
• Control operation function
The fuel and air settings are calculated using combustion control as a model.

Master input
MED

AIR.PV 1 100-K3
% UNIT F
βμ 100

100+K1
100

MED

FUEL.PV 100+K4 L
% βμ UNIT A
100 low
limit
100-K2
100
6F8C1226
23. Process Control 23-25

Program example:

In case of L1 User defined structure


typeDCL_PARA :
Master PID DCL control Member Data type
PID_01 DCL_01 K1 Real
PID_P DCL_P
DIC100.SV DIC100.MV DIC100.MV FIC100.SV K2 Real
SV MV PV FSV
LD ST LD ST K3 Real
PV AIR K4 Real
DIC100.PV AIC100.PV ASV AIC100.SV
LD LD ST BETA Real
MU Real
1 GAN FIC100.PV FUEL
LD
L Real
LD
ADV Real
0 FFS FIC100.MV FTR FDV Real
LD LD

0 FFD AIC100.MV ATR Variables:


LD LD Variable Data type Dec.
PID_01 PID_P VAR
DIC100.MV TR DCL_P DCL_P
LD LD PID_02 PID_P VAR
PID_03 PID_P VAR
0 MVT FIC100.SV LP_FD DCL_01 typeDCL_PARA VAR
LD LD
Controller Variables:
DIC100.SV LP_D FIC100.OA LP_FP Variable Data type
LD LD !DIC100 typeLP_PARA
!DIC100 typeLP_DATA
DIC100.OA LP_P AIC100.SV LP_AD
LD LD !DIC100 typePV_DATA
!FIC100 typeLP_PARA
AIC100.OA LP_AP
LD !FIC100 typeLP_DATA
Fuel flow PID Air flow PID !FIC100 typePV_DATA
PID_02 PID_03 !AIC100 typeLP_PARA
PID_P PID_P !AIC100 typeLP_DATA
FIC100.SV SV MV FIC100.MV AIC100.SV SV MV AIC100.MV
LD ST LD ST !AIC100 typePV_DATA

FIC100.PV PV AIC100.PV PV
LD LD

1 GAN 1 GAN
LD LD

0 FFS 0 FFS
LD LD

0 FFD 0 FFD
LD LD

FIC100.MV TR AIC100.MV TR
LD LD

0 MVT 0 MVT
LD LD

FIC100.SV LP_D AIC100.SV LP_D


LD LD

FIC100.OA LP_P AIC100.OA LP_P


LD LD

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.
6F8C1226
23. Process Control 23-26

Error information:
• If nonnumeric data is entered in input data, the result is output as nonnumeric.
• The fuel flow and air flow are calculated with % value as input when the respective indicator is RH=RL.
• If the LP data specification is invalid (such as specifying variable other than LP tag data), the Table Operation Error is set to
ON and the previously held value is output.
6F8C1226
24. Tag Operartion Funtions 24-1

24 Tag Operartion

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.
6F8C1226
24. Tag Operartion Funtions 24-2

Tag Operation Change Adjuster Mode


Diagram
CMLP_P
Execution control input E Output

Mode MODE

LP data variable LP_D

Modifier EN input Edge execution Index modification


√ √ —

Arguments:
Arg. Operand Type Const. Description Remarks
E BOOL √ Execution control input
Input MODE UINT √ Mode (0:M/1:A/2:C/3:RM)
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 MODE UINT W Control mode
(LP_DATA)
R/W: R=Read only, W=Write only, R/W=Read/Write

Function:
• When the Execution Control Input E is OFF, OFF is output without performing any operation.
• When the Execution Control Input E is ON, the mode of the LP data variable specified with LP_D is set to the value specified
with MODE and ON is output as the result.
Execution Action Output
control input
OFF — OFF
ON Sets the mode of the specified LP data variable. ON
6F8C1226
24. Tag Operartion Funtions 24-3

Program example:
SIGNAL1 CMLP_P SIGNAL2
1 E 1
LD ST

1 MODE
LD

FIC100.SV LP_D
LD

• When the Execution Control Input SIGNAL1 is ON, sets the adjuster tag (FIC100) mode to A.

Error information:
• If the LP parameter specification is incorrect (such as specifying variable other than LP tag parameter), the Table Operation
Error is set to ON and the instruction itself is treated as no process.
• If the mode is out of range (4 or greater) the instruction is treated as no process.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
24. Tag Operartion Funtions 24-4

Tag Operation Change Push Button Mode


Diagram
CMPB_P
Execution control input E Output

Mode MODE

PB data variable PB_D

Modifier EN input Edge execution Index modification


√ √ —

Arguments:
Arg. Operand Type Const. Description Remarks
E BOOL √ Execution control input
Input MODE UINT √ Mode (0:M/1:A/2:C/3:RM)
PB_D PTR — PB data variable
Output — BOOL — Output
The C mode is valid only when tag type is 2PC in DC connection version. Otherwise, the mode is M/A/RM.
A pointer to tag table is placed in PB data variable.
A setup example is shown below.
Array no.=0, tag no.=XV100 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 MODE UINT W control mode
(PB_DATA)
Referenced by TYPE UINT R Tag type (used only in DS connection version only)
PB_D (SOV/MOT/MOV/PB4/PB8/PB2/2PC)
(PB_PARA)
R/W: R=Read only, W=Write only, R/W=Read/Write

Function:
• When the Execution Control Input E is OFF, OFF is output without performing any operation.
• When the Execution Control Input E is ON, the mode of the PB data variable specified with PB_D is set to the value specified
with MODE and ON is output as the result.
Execution Action Output
control input
OFF — OFF
ON Sets the mode of the specified PB data variable. ON
6F8C1226
24. Tag Operartion Funtions 24-5

Program example:
SIGNAL1 CMPB_P SIGNAL2
1 E 1
LD ST

1 MODE
LD

XV100.SCN LP_D
LD
• When the Execution Control Input SIGNAL1 is ON, sets the push button tag (XV100) mode to A.

Error information:
• If the PB parameter specification is incorrect (such as specifying variable other than PB tag parameter), the Table Operation
Error is set to ON and the instruction itself is treated as no process.
• If the mode is out of range (4 or greater) the instruction is treated as no process.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
24. Tag Operartion Funtions 24-6

Tag Operation Change Sequence Mode


Diagram
CMSQ_P
Execution control input E Output

Mode MODE

SQ data variable SQ_D

Modifier EN input Edge execution Index modification


√ √ -

Arguments:
Arg. Operand Type Const. Description Remarks
E BOOL √ Execution control input
Input MODE UINT √ Mode (0:M/1:A/2:C/3:RM)
SQ_D PTR — SQ data variable
Output — BOOL — Output
A pointer to tag table is placed in SQ data variable.
A setup example is shown below.
Array no.=0, tag no.=SEQ100 are assumed for the used sequence tag.
Notation Operand Array Tag symbol
SQ_D SQ_DATA[0] SEQ100.STA
The following tag symbols are referenced by this instruction.
Operand Symbol Type R/W Description
SQ_D MODE UINT W control mode
(SQ_DATA)
R/W: R=Read only, W=Write only, R/W=Read/Write

Function:
• When the Execution Control Input E is OFF, OFF is output without performing any operation.
• When the Execution Control Input E is ON, the mode of the SQ data variable specified with SQ_D is set to the value
specified with MODE and ON is output as the result.
Execution Action Output
control input
OFF — OFF
ON Sets the mode of the specified SQ data variable. ON
6F8C1226
24. Tag Operartion Funtions 24-7

Program example:
SIGNAL1 CMSQ_P SIGNAL2
1 E 1
LD ST

1 MODE
LD

SEQ100.STA SQ_D
LD
• When the Execution Control Input SIGNAL1 is ON, sets the sequence tag (SEQ100) mode to A.

Error information:
• If the SQ parameter specification is incorrect (such as specifying variable other than SQ tag parameter), the Table Operation
Error is set to ON and the instruction itself is treated as no process.
• If the mode is out of range (4 or greater) the instruction is treated as no process.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
24. Tag Operartion Funtions 24-8

Tag Operation Set SV


Diagram
SSV_P
Execution control input E Output

Target value SVP

Tilt SVK

Tilt unit SVT

LP parameter variable LP_P

LP data variable LP_D

Modifier EN input Edge execution Index modification


√ √ —

Arguments:
Arg. Operand Type Const. Description Remarks
E BOOL √ Execution control input
SVP REAL √ Target value
SVK REAL √ Tilt
Input
SVT REAL √ Tilt unit (1: sec./60:min./3600: hr)
LP_P PTR — LP parameter variable
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
LP_P SVP REAL R/W SV ramp target value
(LP_PARA) SVK REAL R/W SV ramp increment
SVT REAL R/W SV ramp time coefficient
LP_D SSV BOOL W SEQ-SV intervention status
(LP_DATA)
R/W: R=Read only, W=Write only, RW=Read/Write
6F8C1226
24. Tag Operartion Funtions 24-9

Function:
• When the Execution Control Input E is OFF, OFF is output without performing any operation.
• When the Execution Control Input E is ON, sets the setup information (SVP, SVK, SVT) of the LP parameter variable
specified by LP_P to the value specified with input argument, sets the SSV of LP data variable specified by LP_D to ON, and
output ON as the result. (Start of Set SV directive)
• This instruction provides the setup information (SVP, SVK, SVT) and directive (SSV) to perform ramp SV action, but does
not perform the actual ramp SV action. A separate program must be created to perform the ramp SV action. (See program
example)
• This instruction is used together with the Reset SV (RSV_P) instruction.
Execution Action Output
control input
OFF No process OFF
ON Starts the Set SV directive of the specified LP variable ON

Error information:
• If the LP parameter and LP data specifications are incorrect (such as specifying variable other than LP tag parameter), the
Table Operation Error is set to ON and the instruction itself is treated as no process.
• If a "nonnumeric" is input as input data, Nonnumeric Input Error is set to ON and the instruction is treated as no process.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
24. Tag Operartion Funtions 24-10

Program example:
SSV control section
SSV_REQ SSV_P SIGNAL1 SSV_REQ RSV_P SIGNAL2 In case of L3DS
P E N E
ST ST
FIC100.CLI
80 SVP LP_D
LD LD

5 SVK
LD

1 SVT
LD
FIC100.
TAG[0] LP_P
LD
FIC100.CLI
LP_D
LD

Instrumentation FB section SSV execution section


PID_01
FIC100.SV PID_P FIC100.MV FIC100.MVE FIC100.CLI FIC100.SSV SSV_EXEC
SV MV / / ( )
LD ST DLM_REAL_1
FIC100.PV SSV_EXEC SEL_REAL SSV_EXEC DLM_REAL SSV_EXEC FIC100.SV
PV G E
LD LD ST
FIC100.SV
1 GAN IN0 IN
LD LD
FIC100.SV
0 FFS P IN1
LD
LD
ZF[23] DIV_REAL MUL_REAL DIV_REAL
0 FFD D
LD LD
FIC100.MV
TR 1000
LD LD
FIC100.
0 MVT SVK
LD LD
FIC100.CLI FIC100.
LP_D SVT
LD LD
FIC100.
TAG[0] LP_P
LD

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
Controller Variables:
Variable Data type
!FIC100 typeLP_PARA_DS
!FIC100 typeLP_DATA_DS
ZF ARRAY[0..4095] OF REAL
6F8C1226
24. Tag Operartion Funtions 24-11

• 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.
6F8C1226
24. Tag Operartion Funtions 24-12

Tag Operation Reset SV


Diagram
RSV_P
Output E Execution control input

LP data variable LP_D

Modifier EN input Edge execution Index modification


√ √ —

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 SSV BOOL W SEQ-SV intervention status
(LP_DATA)
R/W: R=Read only, W=Write only, R/W=Read/Write

Function:
• When the Execution Control Input E is OFF, OFF is output without performing any operation.
• When the Execution Control Input E is ON, the SSV of the LP data variable specified with LP_D is reset to OFF and ON is
output as the result. (Resetting Set SV directive)
• This instruction is used together with the Set SV (SSV_P) instruction.
Execution Action Output
control input
OFF No process OFF
ON Resets the Set SV directive of the specified LP variable ON

Program example:
Refer to the program example of the Set SV (SSV_P) instruction.

Error information:
• If the LP data specification is incorrect (such as specifying variable other than LP tag parameter), the Table Operation Error
is set to ON and the instruction itself is treated as no process.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
24. Tag Operartion Funtions 24-13

Tag Operation Set MV


Diagram
SMV_P
Execution control input E Output

Target value MVP

Tilt MVK

Tilt unit MVT

LP parameter variable LP_P

LP data variable LP_D

Modifier EN input Edge execution Index modification


√ √ —

Arguments:
Arg. Operand Type Const. Description Remarks
E BOOL √ Execution control input
MVP REAL √ Target value
MVK REAL √ Tilt
Input
MVT REAL √ Tilt unit (1: sec./60:min./3600: hr)
LP_P PTR — LP parameter variable
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
LP_P MVP REAL R/W MV ramp target value
(LP_PARA) MVK REAL R/W MV ramp increment
MVT REAL R/W MV ramp time coefficient
LP_D SMV BOOL W SEQ-MV intervention status
(LP_DATA)
R/W: R=Read only, W=Write only, R/W=Read/Write
6F8C1226
24. Tag Operartion Funtions 24-14

Function:
• When the Execution Control Input E is OFF, OFF is output without performing any operation.
• When the Execution Control Input E is ON, sets the setup information (MVP, MVK, MVT) of the LP parameter variable
specified by LP_P to the value specified with input argument, sets the SMV of LP data variable specified by LP_D to ON, and
output ON as the result. (Start of Set MV directive)
• 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.
Execution Action Output
control input
OFF No process OFF
ON Starts the Set MV directive of the specified LP variable ON

Error information:
• If the LP parameter and LP data specifications are incorrect (such as specifying variable other than LP tag parameter), the
Table Operation Error is set to ON and the instruction itself is treated as no process.
• If a "nonnumeric" is input as input data, Nonnumeric Input Error is set to ON and the instruction is treated as no process.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
24. Tag Operartion Funtions 24-15

Program example:
SMV control section
SMV_REQ SMV_P SIGNAL1 SMV_REQ RMV_P SIGNAL2 In case of L3DS
P E N E
ST ST
FIC100.CLI Variables:
80 SVP LP_D Variable Data type Dec.
LD LD
SMV_REQ BOOL VAR
5 SVK SMV_EXEC BOOL VAR
LD SIGNAL1 BOOL VAR
SIGNAL2 BOOL VAR
1 SVT
LD PID_01 PID_P VAR
FIC100. DLM_01 DLM_REAL VAR
TAG[0] LP_P Controller Variables:
LD
Variable Data type
FIC100.CLI
LP_D !FIC100 typeLP_PARA_DS
LD !FIC100 typeLP_DATA_DS
ZF ARRAY[0..4095] OF REAL
Instrumentation FB section SMV execution section
PID_01
FIC100.SV PID_P FIC100.MV FIC100.MVE FIC100.CLI FIC100.SMV SMV_EXEC
SV MV / / ( )
LD ST DLM_REAL_1
FIC100.PV SMV_EXEC SEL_REAL SMV_EXEC DLM_REAL SMV_EXEC FIC100.MV
PV G E
LD LD ST
FIC100.MV
1 GAN IN0 IN
LD LD
FIC100.
0 FFS MVP IN1
LD LD
ZF[23] DIV_REAL MUL_REAL DIV_REAL
0 FFD D
LD LD
FIC100.MV
TR 1000
LD LD
FIC100.
0 MVT MVK
LD LD
FIC100.CLI FIC100.
LP_D MVT
LD LD
FIC100.
TAG[0] LP_P
LD

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.
6F8C1226
24. Tag Operartion Funtions 24-16

Tag Operation Reset MV


Diagram
RMV_P
Execution control input E Output

LP data variable LP_D

Modifier EN input Edge execution Index modification


√ √ —

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 SMV BOOL W SEQ-MV intervention status
(LP_DATA)
R/W: R=Read only, W=Write only, R/W=Read/Write

Function:
• When the Execution Control Input E is OFF, OFF is output without performing any operation.
• When the Execution Control Input E is ON, the SMV of the LP data variable specified with LP_D is reset to OFF and ON is
output as the result. (Resetting Set MV directive)
• This instruction is used together with the Set MV (SMV_P) instruction.
Execution Action Output
control input
OFF No process OFF
ON Resets the Set MV directive of the specified LP variable ON

Program example:
Refer to the program example of the Set MV (SMV_P) instruction.

Error information:
• If the LP data specification is incorrect (such as specifying variable other than LP tag parameter), the Table Operation Error
is set to ON and the instruction itself is treated as no process.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
24. Tag Operartion Funtions 24-17

Tag Operation Shut CV


Diagram
SCV_P
Execution control input E Output

Mode MOD

MV value MV

LP parameter variable LP_P

LP data variable LP_D

Modifier EN input Edge execution Index modification


√ √ —

Arguments:
Arg. Operand Type Const. Description Remarks
E BOOL √ Execution control input
MOD UINT √ Mode (0:M/1:A/2:C/3:RM)
Input MV REAL √ MV value[%]
LP_P PTR — LP parameter variable
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
LP_P MVP REAL R/W MV ramp target value
(LP_PARA) MVK REAL R/W MV ramp increment
MVT REAL R/W MV ramp time coefficient
LP_D SMV BOOL W SEQ-MV intervention status
(LP_DATA)
R/W: R=Read only, W=Write only, R/W=Read/Write
6F8C1226
24. Tag Operartion Funtions 24-18

Function:
• When the Execution Control Input E is OFF, OFF is output without performing any operation.
• When the Execution Control Input E is 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 ON, sets the mode
to the mode specified with the input argument, and outputs 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.
Execution Action Output
control input
OFF No process OFF
ON Starts the Set MV directive of the specified LP variable ON

Error information:
• If the LP parameter and LP data specifications are incorrect (such as specifying variable other than LP tag parameter), the
Table Operation Error is set to ON and the instruction itself is treated as no process.
• If a "nonnumeric" is input as input data, Nonnumeric Input Error is set to ON and the instruction is treated as no process.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
24. Tag Operartion Funtions 24-19

Program example:
SCV control section
SCV_REQ SCV_P SIGNAL1 SCV_REQ RMV_P SIGNAL2 In case of L3DS
P E N E
ST ST
FIC100.CLI Variables:
0 MOD LP_D Variable Data type Dec.
LD LD
SCV _REQ BOOL VAR
10 MV SMV_EXEC BOOL VAR
LD SIGNAL1 BOOL VAR
FIC100. SIGNAL2 BOOL VAR
TAG[0] LP_P
LD PID_01 PID_P VAR
FIC100.CLI DLM_01 DLM_REAL VAR
LP_D Controller Variables:
LD
Variable Data type
!FIC100 typeLP_PARA_DS
!FIC100 typeLP_DATA_DS
ZF ARRAY[0..4095] OF REAL
Instrumentation FB section SMV execution section
PID_01
FIC100.SV PID_P FIC100.MV FIC100.MVE FIC100.CLI FIC100.SMV SMV_EXEC
SV MV / / ( )
LD ST DLM_REAL_1
FIC100.PV SMV_EXEC SEL_REAL SMV_EXEC DLM_REAL SMV_EXEC FIC100.MV
PV G E
LD LD ST
FIC100.MV
1 GAN IN0 IN
LD LD
FIC100.MVP
0 FFS IN1
LD LD
ZF[23] DIV_REAL MUL_REAL DIV_REAL
0 FFD D
LD LD
FIC100.MV
TR 1000
LD LD
FIC100.
0 MVT MVK
LD LD
FIC100.CLI FIC100.
LP_D MVT
LD LD
FIC100.
TAG[0] LP_P
LD

• SCV control section


At the rise of SCV request (SCV_REQ), requests set MV directive (MV value: 10) to the adjuster tag (FIC100) 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).
• 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) (resulting in MV=10 immediately after the rise of SCV_REQ).
When the Set MV condition is not satisfied, MV holds the previous value.
6F8C1226
24. Tag Operartion Funtions 24-20

Tag Operation Push Button ON


Diagram
PB_P
Execution control input E Output

Push button no. (1 - 8) BNO

PB parameter variable PB_P

PB data variable PB_D

Modifier EN input Edge execution Index modification


√ √ —

Arguments:
Arg. Operand Type Const. Description Remarks
E BOOL √ Execution control input
BNO UINT √ Push button no. (1 to 8)
Input
PB_P PTR — PB parameter variable
PB_D PTR — PB data variable
Output — BOOL — Output
Pointers to tag table are placed in PB parameter variable and 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_P PB_PARA[0] XV100.TAG[0]
PB_D PB_DATA[0] XV100.ASA
The following tag symbols are referenced by this instruction.
Operand Symbol Type R/W Description
PB_P MODS UINT R Mode usage setting
(PB_PARA)
PB_D MODE UINT R Mode (0:M/1:A/2:C/3:RM)
(PB_DATA) RFO[n] BOOL W Button ON request (n=0: button 1 to 7: button 8)
R/W: R=Read only, W=Write only, R/W=Read/Write
6F8C1226
24. Tag Operartion Funtions 24-21

Function:
• When the Execution Control Input E is OFF, OFF is output without performing any operation.
• When the Execution Control Input E is ON, sets the specified push button ON.
When the button manipulation enable condition (PB_P.MODS="Not used" or (PB_P.MODS="Use" and PB_D.MODE=A
mode)) is satisfied, sets the corresponding bit of the RFO of the PB data variable specified with PB_D to ON and outputs ON
as the result. (Button ON directive)
• This instruction sets the button ON (RFO). The content of RFO 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.
Execution Action Output
control input
OFF No process OFF
ON Executes button ON directive of the specified PB variable ON

Program example:

In case of L3DS Variables:


Variable Data type Dec.
PB_REQ PB_REQ BOOL VAR
PB_P SIGNAL1
P E SIGNAL1 BOOL VAR
ST Controller Variables:
Variable Data type
2 BNO
LD !XV100 typePB_PARA_DS
XV100. !XV100 typePB_DATA_DS
TAG[0] PB_P
LD
XV100.
ASA PB_D
LD

• At the rise of PB request (PB_REQ), issues a button 2ON directive for the push button tag (XV100).

Error information:
• If the PB parameter and PB data specifications are incorrect (such as specifying variable other than PB tag parameter), the
Table Operation Error is set to ON and the instruction itself is treated as no process.
• If the push button on. (BNO) is out of range (not 1 to 8), the instruction is treated as no process.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
24. Tag Operartion Funtions 24-22

Tag Operation Push Button Lock


Diagram
LB_P
Execution control input E Output

Push button no. BNO

PB data variable PB_D

Modifier EN input Edge execution Index modification


√ √ —

Arguments:

Arg. Operand Type Const. Description Remarks


E BOOL √ Execution control input
Input BNO UINT √ Push button no. (0: reset, 1 to 8: button no.)
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 IFO[n] BOOL W Button lock request (n=0: button 1 to 7: button 8)
(PB_DATA) (corresponding button locked when 1, unlocked when all bits
are 0)
R/W: R=Read only, W=Write only, R/W=Read/Write
6F8C1226
24. Tag Operartion Funtions 24-23

Function:
• When the Execution Control Input E is OFF, OFF is output without performing any operation.
• When the Execution Control Input E is 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 ON (or resets all bits to OFF) and outputs
ON as the result. (Button lock directive)
• 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.
Execution Action Output
control input
OFF No process OFF
ON Executes button lock directive of the specified PB variable ON

Program example:

In case of L3DS

LB_REQ LB_P SIGNAL1 LB_REQ LB_P SIGNAL2


P E N E
ST ST

2 BNO 0 BNO Variables:


LD LD Variable Data type Dec.
XV100.ASA XV100.ASA PB_REQ BOOL VAR
PB_D PB_D
LD SIGNAL1 BOOL VAR
LD
SIGNAL2 BOOL VAR
Controller Variables:
Variable Data type
!XV100 typePB_PARA_DS
!XV100 typePB_DATA_DS

• 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:
• If the PB data specification is incorrect (such as specifying variable other than PB tag data), the Table Operation Error is set
to ON and the instruction itself is treated as no process.
• 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 OFF when the above error occurs.
6F8C1226
24. Tag Operartion Funtions 24-24

Tag Operation Action Timer


Diagram
ACT_P
Execution control input E Output

Directive to timer STATE


T data variable T_D

Modifier EN input Edge execution Index modification


√ √ —

Arguments:
Arg. Operand Type Const. Description Remarks
E BOOL √ Execution control input
STATE UINT √ Directive to timer
Input
(0: start/1: stop/2: reset)
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
T_D STAT BOOL W Start
(T_DATA) STOP BOOL W Stop
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)
T_DATA VAL INT R/W Clock value (current value)
STAT BOOL R Start
STOP BOOL R Stop
RST BOOL R Reset
UP BOOL R Timeout
R/W: R=Read only, W=Write only, R/W=Read/Write
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 Precision
(error)
0 to 255 0.1 s 0.0[s] to 3276.7[s] 0.1 [s] max.
256 to 511 0.1 min 0.0[min] to 3276.7[min] 0.1 [min] max.
(0.0[s] to 196602[s]) (6[s])
6F8C1226
24. Tag Operartion Funtions 24-25

Function:
• When the Execution Control Input E is OFF, OFF is output without performing any operation.
• When the Execution Control Input E is 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.
Directive to timer
Manipulation
STATE
STAT STOP RST
0: Start ON OFF OFF
1: Stop OFF ON OFF
2: Reset OFF OFF ON

Execution Action Output


control input
OFF No process OFF
ON Executes timer manipulation directive of the specified T ON
variable
• 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.

Timing chart:
Start Start
Stop Stop Reset Reset

Timer maximum(32767)

T_PARA[n].SET

T_DATA[nA].VAL
Timer initial value (0)

T_DATA[n].STAT

T_DATA[n].STOP
T_DATA[n].RST

T_DATA[n].UP
t

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
ON and the instruction itself is treated as no process.
• 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 OFF when the above error occurs.
6F8C1226
24. Tag Operartion Funtions 24-26

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.
• The timer precision (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:
In case of L3DS

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

STAT_REQ ACT_P SIGNAL1 STOP_REQ ACT_P SIGNAL2 RST_REQ ACT_P SIGNAL3


P E P E P E
ST ST ST

0 STATE 1 STATE STATE


2
LD LD LD
T_DATA[0] T_DATA[0] T_DATA[0]
T_D T_D T_D
LD LD LD

T_DATA[0].UP
UP time
process

• 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.
6F8C1226
24. Tag Operartion Funtions 24-27

Tag Operation Action Counter


Diagram
ACC_P
Execution control E Output
i
Directive to counter STATE

C data variable C_D

Modifier EN input Edge execution Index modification


√ √ —

Arguments:
Arg. Operand Type Const. Description Remarks
E BOOL √ Execution control input
STATE UINT √ Directive to counter
Input
0: Increment, 1: Decrement, 2: Reset
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
C_D INC BOOL W Increment
(C_DATA) DEC BOOL W Decrement
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)
C_DATA 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
DOWN BOOL R Count down
R/W: R=Read only, W=Write only, R/W=Read/Write
6F8C1226
24. Tag Operartion Funtions 24-28

Function:
• When the Execution Control Input E is OFF, OFF is output without performing any operation.
• When the Execution Control Input E is ON, the specified counter tag is activated.
Manipulates the INC, DEC, RST of the C data variable specified by C_D and outputs 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.
Directive to counter Manipulation
STATE INC DEC RST
0: Increment ON OFF OFF
1: Decrement OFF ON OFF
2: Reset OFF OFF ON

Execution control input Action Output


OFF No process OFF
ON Executes counter manipulation directive of the ON
specified C variable
• 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 UP DOWN
value and set value
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).

Timing chart:
Decrement Reset Decrement Reset
Increment Set value=0 Increment

Counter maximum(32767)
C_DATA[n].VAL
C_PARA[n].SET
Counter initial value(0)

-C_PARA[n].SET

Counter minimum(-32768)

C_DATA[n].UP
C_DATA[n].DOWN
t

Error information:
• If the C data specification is incorrect (such as specifying variable other than C tag data), the Table Operation Error is set to
ON and the instruction itself is treated as no process.
• 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 OFF when the above error occurs.
6F8C1226
24. Tag Operartion Funtions 24-29

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.

Program example:

In case of L3DS

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

INC_REQ ACC_P SIGNAL1 DEC_REQ ACC_P SIGNAL2 RST_REQ ACC_P SIGNAL3


P E P E P E
ST ST ST

0 STATE 1 STATE STATE


2
LD LD LD
C_DATA[0] C_DATA[0] C_DATA[0]
C_D C_D C_D
LD LD LD
C_DATA[0].
C_DATA[0].UP DOWN
UP time DOWN time
process process

• 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.
6F8C1226
24. Tag Operartion Funtions 24-30

Tag Operation Self Step Jump


Diagram
SJ_P
Execution control input E Output

Jump destination step instance STEP

Modifier EN input Edge execution Index modification


√ √ —

Arguments:
Arg. Operand Type Const. Description Remarks
E BOOL √ Execution control input
Input
STEP PTR — Jump destination step instance
Output — BOOL — Output

Function:
• When the Execution Control Input E is OFF, OFF is output without performing any operation.
• When the Execution Control Input E is ON, the step activation location is changed and ON is output as the result.
Deactivates the step to which this instruction is connected and activates the step specified by jump destination step (STEP).
Execution control input Action Output
OFF No process OFF
ON Changes the activation location to the specified step ON

Error information:
• If a variable other than a step is specified for the jump destination step (STEP) or if the connected destination of the
Execution Control Input (E) of this instruction is not a step type instruction (Step, Answer Step, Phase End Step), Boundary
Error is set to ON and this instruction is treated as no process.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
24. Tag Operartion Funtions 24-31

Program example:

In case of L3DS Variables:


Variable Data type Dec.
CONTINUE BOOL VAR
SEQ001 T1 BOOL VAR
SEQ
T2 BOOL VAR
T3 BOOL VAR
INI
T4 BOOL VAR
T1 SIGNAL1 BOOL VAR
1 PHASE1 Controller Variables:
Time#10s
Variable Data type
T2 !SEQ001 typeSQ_PARA_DS
2 PHASE2
!SEQ001 typeSQ_DATA_DS
Time#10s
T3
CONTINUE SJ_P SIGNAL1
S1 E
ST
T4
PHASE1 STEP
LD

• If the PHASE 1, 2 repeat condition (CONTINUE) is ON, self step jump (SJ_P) occurs and the active location changes from
S1 to PHASE1 when execution of PHASE1 and PHASE2 completes and S1 becomes active (repeats execution of PHASE1
and PHASE2).
• When the repeat condition (CONTINUE) is reset to OFF, self step jump is not performed when S1 becomes active and
continues to the next step when T4 is set to ON.
6F8C1226
24. Tag Operartion Funtions 24-32

Restriction:
• This instruction cannot be connected to non-SFC network (normal LD circuit). If it is connected to normal LD circuit,
unrelated step instruction (step instruction just before the SJ_P instruction in the execution sequence) will be deactivated. Or,
a boundary error may occur. A BOOL type LD/FBD circuit may be inserted between the Step instruction (or Answer Step
instruction, Phase End instruction) and SJ_P instruction.
SEQ instruction to which SFC network is connected

S11 Disabled
T12 TON_1 Enabled SJ_P SIGNAL1 COND1 SJ_P SIGNAL2
TON
S12 IN Q E E
ST ST

Time#10s STEP S11 STEP S11 STEP


LD LD LD

• A variable other than a step name cannot be specified as the jump destination step (STEP) of a SJ_P instruction. If a
variable other than a step name is specified, a boundary error may occur and SJ_P instruction is treated as a no process.
• Only the inside of the level (operation and phase) to which the SJ_P instruction is connected to may be specified. Jump to
other level is not possible.
Operation Phase 1
SEQ001 P11
SEQ
T11
Enabled
INI P12
T1 T12
COND3 SJ_P SIGNAL3
1 PHASE1 P13 E
Time#10s ST
T2 T13
Enabled P11 STEP
2 PHASE2 P14 LD
Time#10s PhaseEnd
T3
COND1 SJ_P SIGNAL1
S1 E Phase 2
ST
T4 P21
PHASE1 STEP
Disabled
T21
LD
P22
COND2 SJ_P SIGNAL2
S2 E T22
ST
Disabled COND4 SJ_P SIGNAL4
T4 P23 E
P23 STEP ST
LD T23
P11 STEP
P24 LD
PhaseEnd
6F8C1226
24. Tag Operartion Funtions 24-33

• In the case of parallel processing, jump to other parallel process, outside the parallel processes, or into the parallel process
is not possible.

S11 Disabled S13 Enabled


T12 T13
COND1 SJ_P SIGNAL1 COND2 SJ_P SIGNAL2
S12 E S14 E
ST ST

S13 STEP S13 STEP


LD LD

S1
T1

S11 Disabled S13


T12 T13
COND1 SJ_P SIGNAL1
S12 E S14
ST

S13 STEP Disabled


LD

T2
COND1 SJ_P SIGNAL1
S2 E
ST

S14 STEP
LD

• The SJ_P instruction cannot connect to a Phase Step instruction. Connection is allowed to Step instruction, Answer Step
instruction, and Phase End Step instruction. If a SJ_P instruction is connected to a Phase Step instruction, the Phase Step
instruction itself may be inactive, but the inside of the phase is not inactive.

S11
Disabled
T12
COND1 SJ_P SIGNAL?
1 PHASE1 E
Time#10s ST
T12
S11 STEP
S12 LD
Enabled
T13
COND2 SJ_P SIGNAL2
S13 E
ST

S12 STEP
LD
6F8C1226
24. Tag Operartion Funtions 24-34

Tag Operation Reset Jump


Diagram
RJ_P
Execution control input E Output

SQ parameter SQ_P
i bl
Jump destination STEP
i

Modifier EN input Edge execution Index modification


√ √ —

Arguments:
Arg. Operand Type Const. Description Remarks
E BOOL √ Execution control input
Input SQ_P PTR — SQ parameter variable
STEP PTR — Jump destination step instance
Output — BOOL — Output
A pointer to tag table is placed in SQ parameter variable.
A setup example is shown below.
Array no.=0, tag no.=SEQ100 are assumed for the used sequence tag.
Notation Operand Array Tag symbol
SQ_P SQ_PARA[0] SEQ100.TAG[0]
The following tag symbols are referenced by this instruction.
Operand Symbol Type R/W Description
Referenced by ALIT[0..31] BOOL ARRAY W Alarm bit (all bits are cleared when RJ is executed)
SQ_P PHNO[0..31] BOOL ARRAY W Active phase map (all bits are cleared when RJ is
(SQ_DATA) executed)
ALNO[0..31] BOOL ARRAY W Alarm phase map (all bits are cleared when RJ is
executed)
CNNO[0..31] BOOL ARRAY W Confirm wait phase map (all bits are cleared when RJ is
executed)
APNO UINT W Active phase no. setting (cleared when RJ is executed)
R/W: R=Read only, W=Write only, R/W=Read/Write

Function:
• When the Execution Control Input E is OFF, OFF is output without performing any operation.
• When the Execution Control Input E is ON, resets the sequence tag information specified by the SQ parameter variable
(SQ_P), activates the step specified by jump destination step (STEP, and outputs ON as the result.
Execution Action Output
control input
OFF No process OFF
ON Changes the activation location to the specified step ON

Error information:
• If the jump destination step (STEP) is specified incorrectly, Boundary Error is set to ON and the instruction is treated as no
process.
• When EN is used, ENO output is reset to OFF when the above error occurs.
6F8C1226
24. Tag Operartion Funtions 24-35

Program example:
In case of L3DS
Variables:
Variable Data type Dec.
SEQ001 RJ_REQ BOOL VAR
SEQ T1 BOOL VAR
T2 BOOL VAR
INI T3 BOOL VAR
T1 T4 BOOL VAR
SIGNAL1 BOOL VAR
1 PHASE1
Controller Variables:
Time#10s
Variable Data type
T2
!SEQ001 typeSQ_PARA_DS
2 PHASE2
!SEQ001 typeSQ_DATA_DS
Time#10s
T3

S1 RJ_REQ RJ_P SIGNAL1


E
T4 ST

PHASE1 SEQ001 SQ_P


LD

INI STEP
LD

• When the reset jump condition (RJ_REQ) is OFF, PHASE1, PHASE2, and S1 are repeatedly executed in sequence. When
the reset jump condition (RJ_REQ) is ON, all active information and alarm information of sequence tag (SEQ001) are reset
and INI is activated regardless of the current active location.
6F8C1226
24. Tag Operartion Funtions 24-36

Restriction:
• The sequence that may be specified with the RJ_P instruction can only specify within the same program. Specification from
other task or user defined function block and phase level is not possible (compile error will occur). To specify from another
task (program), use a global variable.
Example that will result in compile error
Program (MS_001)

Operation Phase 1
SEQ001 P11 RJ_REQ2
SEQ RJ_P SIGNAL2
P E
T11
ST
INI
P12
SEQ001 SQ_P
T1
T12 LD
1 PHASE1
P13 INI STEP
Time#10s
T2 FB_1 LD
T13
USER_FB
P14
PhaseEn

Program (MS_002) User FB(USER_FB)

RJ_REQ1 RJ_P SIGNAL1 RJ_REQ4 RJ_P SIGNAL4


P E P E
ST ST

SEQ001 SQ_P SEQ001 SQ_P


LD LD

INI STEP INI STEP


LD LD

Normal example (using global variable)


Program (MS_001)

Operation Phase 1
SEQ001 P11
SEQ Global_RJ Global_RJ
RJ_P
P E (R) T11
INI
P12
T1 SEQ001 SQ_P T12
1 PHASE1 LD
P13 RJ_REQ2 Global_RJ
Time#10s INI STEP P (S)
T2 T13
LD
FB_1
P14
USER_FB PhaseEn
RJ_REQ1 Global_RJ
P (S)

Program(MS_002) User FB(USER_FB)

RJ_REQ1 Global_RJ RJ_REQ4 Global_RJ


P (S) P (S)
6F8C1226
24. Tag Operartion Funtions 24-37

• Only operation step can specify RJ_P instruction. Phase step cannot specify RJ_P instruction. If RJ_P is used in a phase, a
boundary error will occur and the RJ_P instruction will be treated as no process.
Program (MS_001)

Operation Phase 1
SEQ001 P11
SEQ Boundary error
T11
INI Normal P12 RJ_REQ3 RJ_P SIGNAL3
T1 RJ_REQ1 P E
RJ_P SIGNAL1 T12
P E ST
1 PHASE1 P13
ST SQ_P
Time#10s SEQ001
T2 SQ_P T13 LD
SEQ001
2 PHASE2 LD P14 STEP
P11
Time#10s PhaseEn LD
INI STEP
T3
LD

• No variable other than a step name can be specified as the jump destination step (STEP) of a RJ_P instruction. If a variable
other than a step name is specified, a boundary error may occur and RJ_P instruction is treated as a no process.
• A step in a parallel process cannot be specified as the jump destination step (STEP) of a RJ_P instruction (activation
location cannot be changed within a parallel process). If a step in a parallel process is specified, steps are executed in
sequence from that location and holds at the end of the parallel process (waiting for other parallel process to end). In such
case, the reactivation location must be switch.

S11 S13 S11 S13


T12 T13 RJ_REQ1 T12 T13
RJ_P SIGNAL1
S12 S14 P E S12 S14
ST

SEQ001 SQ_P Hold


LD
RJ destination cannot S13 STEP
be specified LD
6F8C1226
25.RAS 25-1

25 RAS

No. Instruction Remarks


1 Cyclic Trace DATALOGC
2 Calendar Data Acquisition GET_CLND nV dedicated instruction
3 Interlock Diagnosis DIAG_D
6F8C1226
25.RAS 25-2

RAS Cyclic Trace


Diagram
Instance name
DATALOGC

Modifier EN input Edge execution Index modification


— — —

Instance structure:
Name Type Description
NAME WORD ARRAY [0 to 24] Trace variable name
POINTER DINT Trace variable pointer
DATATYPE DINT Trace data type
RH DINT Range high limit
RL DINT Range low limit
EU DINT Unit
COMMENT WORD ARRAY [0 to 7] Comment
INDEX DINT Link buffer pointer
DATA DINT ARRAY [0 to 55] Link buffer
NOTINIT DINT Initialization flag

Function:
• A function block to perform cyclic trace that is written within a program.
• A single variable can be traced with a single function block description.
• Periodically traces static variable and temporary variable, or global variable used within a program. (When the cycle time is
less than 50ms, the cyclic trace data is lacking by the transmission load.)
• Specify the task to trace, the trace FB name to use, and variable name from [Product view] - [View] - [Data trace] of the V
engineering tool. Refer to the V Engineering Tool User's Guide for details.

Important:
• Do not specify direct output variable as the variable name to perform cyclic trace. Correct value cannot be traced.
In this case, perform cycle trace specifying a batch output variable rather than a direct output variable.
6F8C1226
25.RAS 25-3

Program example:
DATALOGC_1 DATALOGC_2
DATALOGC DATALOGC

• Performs cyclic trace of two variables VAR_BOOL and VAR_REAL specified from the V engineering tool.

Data log trace screen:


• The following data log trace screen shows an example of programming two DATALOGC within a program and tracing
variables VAR_BOOL and VAR_REAL.
6F8C1226
25.RAS 25-4

Calendar Data Acquisition

RAS Calendar Data Acquisition nv dedicated


instruction
LD/FBD language GET_CLND
Execution control Data storage
notation E
input destination
Calendar data type specification
specification TYPE

Modifier EN input Edge execution Index modification


√ √ -
ST language notation GET_CLND(E, TYPE, Data storage destination specification);

Arguments

Arg. Operand Type Const. Description Remarks


E BOOL √ Execution control input
Input Calendar data type
TYPE UINT √
specification
Data storage destination
Output - PTR -
specification

Function
• When execution control input E is OFF, calendar data acquisition is not executed.
• When execution control input E is ON, calendar data in the format specified with calendar data type specification is obtained,
and output to the variable specified with data storage destination.
• The calendar data type and calendar format are as follows.

Calendar data type Calendar format

15 8 7 0
0 Month 01:Year 2001 or later
0 Day 00:Year 2097
1 BCD code 0 Hour
0 Minute
0 Second

15 0
Year
Day Month
2 DT type
TOD type

Other than above Invalid


6F8C1226
25.RAS 25-5

Program example
[LD/FBD language notation]

REQ
GET_CLND
E BCD_DAT

1 TYPE
BCD
Storesデータフォーマットで
calendar data in the
カレンダデータを格納
BCD data format.

[ST language notation]


GET_CLND(REQ, 1, BCD_DAT);

• When execution control input REQ is ON, calendar data in the format specified with calendar data type specification TYPE is
obtained, and stored to the specified variable BCD_DAT.

Error information
• No processing is performed unless calendar data type specification TYPE is valid specification.
• When EN is used, ENO is reset to OFF when the above error occurs.
6F8C1226
25.RAS 25-6

Interlock Diagnosis

RAS Interlock Diagnosis


LD/FBD language Instance name
notation
Interlock circuit DIAG_D
BI BO Interlock circuit
input output
Interlock circuit ENA
diagnosis permission
Interlock circuit DSP
screen permission

Interlock group GRP


number
Modifier EN input Edge execution Index modification
- - -
ST language notation [Instance name] (BI, ENA, DSP, GRP);
[Variable name] := [Instance name]. BO;

Arguments:

Arg. Operand Type Const. Description Remarks


BI BOOL - Interlock circuit input
Interlock circuit diagnosis 1:Permitted, 0:
ENA BOOL √
permission Prohibited
Input
Interlock circuit screen 1:Permitted, 0:
DSP BOOL √*1
permission Prohibited
GRP UINT √*1 Interlock group number 1 to 32
Output BO BOOL - Interlock circuit output
*1: Only constants can be specified.

Instance structure:

Name Type Description Remarks


Can be accessed from the user
BO BOOL Interlock circuit output
program.
Cannot be accessed from the user
RESERVE Reserved (79W)
program.

Function:
• This function block creates, monitors, and diagnoses the interlock signals of the entire system.
It can display the diagnosis result for the interlock signals of the entire system by using the V Engineering Tool's add-in
software, "Interlock Diagnosis Package." For details, refer to "Interlock Diagnosis Package Operation Manual (6E8C4679)."
• LD circuit that consists of a contact, b contact, contact force, left bus, and horizontal/vertical connection lines is input to
interlock circuit input BI. The number of available contacts is 1 to 32.
• Only coils (normal coils) can be connected to interlock circuit output BO.
• Interlock circuit diagnosis permission ENA can be specified with constants and variables. Interlock diagnosis is performed
when ENA is ON, or stopped when it is OFF.
When ENA=FALSE(OFF), the interlock circuit is not disconnected because interlock circuit output BO= interlock circuit input
BI.
• Interlock circuit screen permission DSP can be specified only with constants. The interlock diagnosis screen is displayed
when it is ON, or not displayed when it is OFF.
When the interlock circuit consists of the main circuit and other sub circuits, only relevant interlock signals can be displayed
on the interlock diagnosis screen by setting DSP=TRUE(ON) for the main circuit and DSP=FALSE(OFF) for the sub circuits.
• Interlock group number GRP is a number for grouping the interlock signals of the entire system by plant monitoring section
for efficient diagnosis and monitoring. It can be specified to 1 to 32 using only constants.
6F8C1226
25.RAS 25-7

• Function block DIAG_D can be used only in programs for the POU type. Also, DIAG_D is used in conditions where it
operates in every cycle in the scan system tasks (mains task (MS), high-speed task (HS), ultra-high speed task (SS)) (e.g.
there are cycles not executed due to the IF statement).
• The group specified with interlock group number GRP must use the interlock circuit in the same task.

Restrictions:
• I/O variable, index modification, non-pointer BOOL cannot be specified directly for the variable specified for contacts of the
interlock circuit.
• Only coils (normal coils) can be connected to interlock circuit output BO.
• Interlock group number GRP must use the interlock circuit in the same task.
Correct example: Group number is used in MS010, MS100, and MS250.
Wrong example: Group number is used in MS010 and HS050.
• Function block DIAG_D cannot be used in functions or function blocks for the POU type.
6F8C1226
25.RAS 25-8

Program example:

[LD/FBD language notation]

DIAG_D_1
X1 X2 X5 DIAG_D Y0
BI BO
X3 X4 1
LD ENA
1 Only normal coil can
DSP be connected.
LD
Interlock circuit 30
LD GRP

[ST language notation]


Z1 := X1 AND X2;
Z2 := X3 AND NOT(X4);
Z3 := (Z1 OR Z2) AND X5;
DIAG_D_1(Z3, 1, 1, 30);
Y0 := DIAG_D_1.BO;

• Because ENA input is ON, the state of interlock circuit input BI is monitored. Interlock circuit output BO outputs the state of
interlock circuit input BI as it is.

Error information:
• If I/O variable, index modification, or non-pointer BOOL that cannot be specified directly for the variable specified for
contacts of the interlock circuit is specified, the monitoring result is not displayed correctly when the state of interlock circuit
input BI becomes OFF.
• If the calendar of the controller is abnormal, the monitoring result cannot be displayed correctly.
6F8C1226
26. SFC 26-1

26 SFC

No. Instruction Remarks

1 Step

2 Initial Step

3 Transition

Divergence/Convergence of
4
Sequence

Divergence/Convergence of
5
Simultaneous sequence

6 Link

B
BOOL
7 Action
U
User Defined

Note
8 Sequence SEQ

Note
9 Phase Step N

Note
10 Phase End Step P hase End

Note
11 Answer Step Ans

Note: V-Tool3 and Worksheet Editor do not support these instructions yet.
6F8C1226
26. SFC 26-2


SFC Step

Diagram Step name LD circuit or action

EN input Edge execution Index modification


Modifier
— — —

Function:
• Represents the minimum unit of SFC network operation.
• When the state of predecessor transition becomes ON, the connected steps become active and the ladder circuit or action
connected on the right side of the step is executed.
• The step state can be determined from the following variables:
Step flag: step name .X (ON when step is active, OFF when step is inactive)
Step execution duration: step name .T (represents the duration when step is active and is cleared to zero the first time
the step is active)
• Steps cannot be placed consecutively. A transition must be placed between steps.
• Step is not executed consecutively within the same scan.

Program example:
T0 T0
SIGNAL1 SIGNAL1
S1 Transition T1 S1
=ON
T1 T1

S2 N SIGNAL2 S2 N SIGNAL2

S2.T GE_TIME T2 S2.T GE_TIME T2


T#30s S3 T#30s S3

S3.X S3.X

Scan
T0
T2
S1.X

S1.T
T1
S2.X

S2.T

• When transition T1 becomes ON while step S1 is active, step S1 becomes inactive and step S2 becomes active. Step S1
remains active until transition T1 becomes ON.
6F8C1226
26. SFC 26-3

Important:
• All steps within an SFC network, whether they are active or inactive, are executed during each scan. With LD circuits directly
connected in step flag status, active steps are executed ON and inactive steps are executed OFF. Therefore, do not use
coils with the same variable name in more than one step. A sample program and its process is shown below.
(1)When an LD circuit is connected to the step
If a coil with the same variable name is used in steps S1 and S3, the BOOL variable SIGNAL1 is set to ON when step S1 is
active. Next, the BOOL variable SIGNAL1 becomes OFF because step S3 is inactive. In other words, SIGNAL1=OFF is the final
value of this variable.

T0 SIGNAL1
S1 Step S1=Active: BOOL variable SIGNAL1=ON

T1
SIGNAL2
S2

T2
SIGNAL1
Step S3=Inactive: BOOL variable SIGNAL1=OFF
S3

T3

(2)When an action is connected to the step


If a BOOL action with the same variable name is used in steps S1 and S3, the connected action is executed because step S1
is active and the BOOL variable SIGNAL1 is set to ON. Next, the connected action is not executed because step S3 is inactive.
In other words, SIGNAL1 remains ON in the action connected to step S1.

T0
S1 N SIGNAL1 Step S1=Active: BOOL variable due to action execution SIGNAL1=ON
T1
SIGNAL2
S2

T2

S3 N SIGNAL1 Step S3=Inactive: BOOL variable due to action not executed SIGNAL1=unchanged

T3
6F8C1226
26. SFC 26-4

SFC Initial Step

Diagram Step name LD circuit or action

EN input Edge execution Index modification


Modifier
— — —

Function:
• Represents the minimum unit of SFC network operation.
• Only during controller cold start, the connected initial step becomes active unconditionally and makes all other steps
connected to the same SFC network inactive. Also, the connected ladder circuit and action are executed.
• The step state can be determined from the following variables:
Step activation flag: step name .X (ON when step is active, OFF when step is inactive)
Step duration: step name .T (represents the duration when step is active and is cleared to zero when the step first
becomes active)
• One initial step is required in an SFC network.
• Initial steps cannot be placed consecutively. A transition must be placed between initial step and other step.
• Initial step is not executed consecutively within the same scan.

Program example:
<During cold start>

When INI.T≥30s and


INI.X=ON
INI N SIGNAL2 INI N SIGNAL2

INI.T GE_TIME INI.X INI.T GE_TIME INI.X


T#30s S1 T#30s S1

T1 T1

• During controller cold start, initial step INI becomes active and other steps S1 on the same circuit become inactive.
• After initial step INI has been active for 30 seconds, it becomes inactive and step S1 becomes active.
6F8C1226
26. SFC 26-5

SFC Transition

Diagram LD circuit or BOOL output FBD circuit Variable (BOOL)

EN input Edge execution Index modification


Modifier
— — —

Function:
• Defines the transition condition from step to step.
• Transition to the next step is performed when the variable specified for transition is ON.
• An LD circuit or FBD circuit with BOOL output may be specified on the left connecting side of the transition. The operation
result of this connected circuit is assigned to the variable specified with the transition and transition is made to the next step
when the operation result is ON.
• The operation of the network stops when the SFC network ends with the transition.

Program example:
T0 T0
SIGNAL1 SIGNAL1
S1 S1

T1 When transition T1
T1=ON
S2 N SIGNAL2 S2 N SIGNAL2

S2.T GE_TIME T2 S2.T GE_TIME T2


T#30s S3 T#30s S3

S3.X S3.X
• Step S2 becomes active when transition T1 becomes ON. Step S1 remains active until transition T1 becomes ON.

T0 T0
SIGNAL1 SIGNAL1
S1 S1

T1 T1
When S2.T≥30s
S2 N SIGNAL2 S2 N SIGNAL2

S2.T GE_TIME T2 S2.T GE_TIME T2


T#30s S3 T#30s S3

S3.X S3.X
• When step S2 is active, if duration of S2 exceeds 30 seconds, step S2 becomes inactive and step S3 becomes active.
6F8C1226
26. SFC 26-6

SFC Divergence/Convergence of Sequence

Variable (BOOL) Variable (BOOL) Variable (BOOL)

Diagram

Variable (BOOL) Variable (BOOL) Variable (BOOL)

EN input Edge execution Index modification


Modifier
— — —

Function:
• Selectively executes the SFC flow according to the transition condition placed at the beginning of each divergence of
sequence.
• Only one circuit is executed with the divergence of sequence. Scan is made from the left transition state and the first branch
circuit that satisfies the condition is executed. If more than one transition is satisfied, the priority of transition evaluation is
from left to right.
• A step must be placed on the predecessor divergence of sequence.
• A transaction must be placed on the predecessor divergence of sequence.

Program example:
SIGNAL1
Transitions T12 and T13 are both ON
S1

T11 T12 T13 T14

S2 S4 S6 S8

T2 T4 T6 T8

S3 S5 S7 S1
T3 T5 T7

• When transitions T12 and T13 both become ON while step S1 is active, step S1 becomes inactive and step S4 becomes
active.
• The step execution priority for the divergence of sequence is S2 > S4 > S6 > S8.
6F8C1226
26. SFC 26-7

SFC Divergence/Convergence of Simultaneous sequence

Variable (BOOL)

Diagram

Variable (BOOL)

EN input Edge execution Index modification


Modifier
— — —

Function:
• Simultaneously executes more than one step following divergence of simultaneous sequences.
• Up to 15 divergences of simultaneous sequences are allowed.
• Divergence of simultaneous sequences ends when execution of all branch circuit ends. (Transition to steps following the
convergence of simultaneous sequences is not performed until execution of all branch circuit completes.)
• A transition must be placed on the predecessor divergence of simultaneous sequences.
• A transition must be placed below the successor convergence of simultaneous sequences.

Program example:
SIGNAL1
S1

T1

S2 S4 S6 S8

T2 T4 T6 T8

S3 S5 S7 S9

T3

S10
• When transition T1 becomes ON while step S1 is active, step S1 becomes inactive and steps S2, S4, S6, and S8 become
active.
• When steps S3, S5, S7, and S9 become active, if transition T3 is ON, steps S3, S5, S7, and S9 are made inactive and step
S10 becomes active.
6F8C1226
26. SFC 26-8

SFC Link

Diagram
Step name

EN input Edge execution Index modification


Modifier
— — —

Function:
• Represents the link destination (loop or jump destination) of the network.
• If the predecessor transition condition becomes ON, transition is made to the step specified by the link.

Program example:
(1) Loop specification
T0 T0
SIGNAL1 SIGNAL1
S1 S1

T1 T1
S2 S2
Equivalent circuit
T2 T2
S3 S3

T3 T3

S1
Note) Tools use representation on left.
• When transition T3 becomes ON while step S3 is active, step S3 becomes inactive and step S1 becomes active.

(2) Jump specification


T0 T0
SIGNAL1 SIGNAL1
S1 S1

T1 T11 T11 T1

S2 S3 S2
Equivalent circuit
T2 T21 T2 T21

S3 S4 S3 S4
T3 T4 T3 T4

S5 S5

• When transition T11 becomes ON while step S1 is active, step S1 becomes inactive and step S3 becomes active.
6F8C1226
26. SFC 26-9

SFC Action

BOOL action User defined action

B Variable (BOOL) U Action name I


Diagram
B: Qualifier specification U: Qualifier specification
I: Indicator variable

EN input Edge execution Index modification


Modifier
— — —

Function:
• An action can be added to a step and it is executed when the step becomes active.
• More than one action can be connected to a step.
• A qualifier (action qualifier) can be used to specify the behavior of the action.
• The action state can be determined from the following variables:
Active flag :action name .Q (ON when action is active, OFF when action is inactive)
Activation :action name .A (ON when action is executed, OFF when action is not executed)
Action timer work :action name .T (action duration with timer)
• Two types of actions are available:
BOOL action :Specified with a qualifier in the action box and a variable (BOOL).
The specified action variable (BOOL) can be controlled according to the qualifier.
User defined action :Specified with a qualifier in the action box, action name, and indicator variable.
(Indicator variable is optional.) The execution of the program specified with action name can be
controlled according to the qualifier. Also, the indicator variable may be updated within the action
program.
• The following qualifier types and actions are available:
Qualifier types:
Qualifier Action
N or none Specified action variable is ON while the action input is ON. Or executes the specified program.
R: Reset Resets the set state of the specified action variable when the action input is ON. Or resets the set
state of the specified program. (The actual reset is performed by the corresponding set action.)
S: Set Specified action variable is set while the action input is ON. Or continues execution of the
specified program.
L: time Limited Keeps the specified action variable to ON for the specified interval when the action input is ON.
Or executes the specified program. If the input becomes OFF before the specified interval, the
specified action variable is immediately reset to OFF. Or stops execution of the specified
program.
6F8C1226
26. SFC 26-10

Qualifier Action
D: Time delayed When action input is ON, sets the specified action variable to ON after the specified delay. Or
executes the specified program. If the input becomes OFF before the specified interval, the
specified variable is not set to ON and the specified program is not executed.
P: Pulse Sets the specified action variable to ON only when the action input changes from OFF to ON. Or
executes the specified program. Unlike P0 or P1, this action performs final scan.
P0: Pulse Sets the specified action variable to ON only when the action input changes from ON to OFF. Or
(falling edge) executes the specified program. Unlike P, this action does not perform final scan.
P1: Pulse Sets the specified action variable to ON only when the action input changes from OFF to ON. Or
(rising edge) executes the specified program. Unlike P, this action does not perform final scan.
SD: Stored and time Retains the state when the action input is ON and sets the specified action variable to ON after
delayed the specified delay. Or executes the specified program. The action is not executed if there is a
reset before the specified interval.
DS: Delayed and When the action input is ON, performs set operation, sets the specified action variable, and
Stored executes the specified program after the specified delay. Does not perform set operation if the
input becomes OFF before the specified interval. The corresponding reset action is necessary to
reset the stored action.
SL: Stored and time Retains the action state when the action input is ON and then sets the specified action variable
limited and executes the specified program for the specified interval. The set action must be reset before
it can be reused.
NH: N without final Same action as N without final scan.
scan
SH: S without final Same action as S without final scan.
scan
LH: L without final Same action as L without final scan.
scan
DH: D without final Same action as D without final scan.
scan

Note: Final scan


After an action connected to a step becomes active, an action is executed for 1 scan where the step changes from active to
inactive. This is referred to as final scan.
6F8C1226
26. SFC 26-11

Qualifier action diagram:


The following figures show the operation of an action. AN is action name.
(1) N or none
Scan
Step status
AN.Q
AN.A (Actual operation)
Final scan performed

(2) S: Set and R: Reset


Scan
S step status
R step status
AN.Q
AN.A (Actual operation)
Final scan performed

(3) L: Limited
Scan

Step status
AN.Q

AN.A (Actual operation)

Final scan performed Final scan performed

Setting time

AN.T
Setting time Setting time

(4) D: Time delayed


Scan

Step status
AN.Q

AN.A (Actual operation)

Final scan performed

Setting time

AN.T
Setting time Setting time
6F8C1226
26. SFC 26-12

(5) P: Pulse
Scan
Step status
AN.Q
AN.A (Actual operation)
Final scan performed

(6) P0: Pulse (falling edge)


Scan
Step status
AN.Q
AN.A (Actual operation)
1 scan time

(7) P1: Pulse (rising edge)


Scan
Step status
AN.Q
AN.A (Actual operation)
1 scan time

(8) SD: Stored and time delayed


Scan
SD step status
R step status
AN.Q
AN.A (Actual operation)
Final scan performed
Setting time

AN.T

Setting time Setting time


6F8C1226
26. SFC 26-13

(9) DS: Delayed and stored


Scan
DS step status
R step status
AN.Q
AN.A (Actual operation)
Final scan performed
Setting time

AN.T
Setting time Setting time

(10) SL: Stored and time limited


Scan
SL step status
R step status
AN.Q
AN.A (Actual operation)
Final scan performed
Setting time

AN.T
Setting time Setting time

(11) NH: N without final scan


Scan
Step status
AN.Q
AN.A (Actual operation)
Final scan not performed

(12) SH: S without final scan


Scan
S step status
R step status
AN.Q
AN.A (Actual operation)
Final scan not performed
6F8C1226
26. SFC 26-14

(13) LH: L without final scan


Scan

Step status
AN.Q

AN.A (Actual operation)

Final scan not performed Final scan not performed

Setting time

AN.T
Setting time Setting time

(14) DH: D without final scan


Scan

Step status
AN.Q

AN.A (Actual operation)

Final scan not performed

Setting time

AN.T
Setting time Setting time

Important:
• When specifying an action qualifier, always use R to reset the action variable specified with S, SD, DS, SL, or SH. A Coil
instruction cannot be used to reset action variables.
6F8C1226
26. SFC 26-15

Program example:

T0 T0
SIGNAL1 SIGNAL1
S1 Transition S1
T1=ON
T1 T1

S2 N SIGNAL2 S2 N SIGNAL2

T2 T2

S3 S3

T3 T3
Scan

T0
T2
S1.X

SIGNAL1

T1
S2.X

SIGNAL2
T2

• When transition T1 becomes ON while step S1 is active, step S1 becomes inactive and step S2 becomes active.
• The connected N action variable SIGNAL2 is ON only while step S2 is ON.
6F8C1226
26. SFC 26-16

SFC Sequence
Diagram

SQ parameter
SEQ

Modifier EN input Edge execution Index modification


— — —

Function:
• Associates connected SFC network with sequence tag.
• Controls the execution of SFC network according to the mode of the associated sequence tag.
C mode: SFC network execution (continuous progress)
A mode: SFC network execution (conf progress)
M/RM mode: SFC network halt (jump to end of SFC network)
(Refer to the Phase Step instruction for details concerning continuous progress and conf progress.)
• Single step execution
When the mode of the sequence tag is M/RM, the SFC network can be executed for just one process cycle from the tool
(pressing the button on the program editor control panel) or by setting the sequence tag SSE ON.
Single step execution example:
Initialized state During execution (1 scan only) After executing 1 scan>

SEQ001 SEQ001 SEQ001


SEQ Single step SEQ After 1 scan SEQ
execution >
INI INI INI
T1 T1 T1
>
1 PHASE1 1 PHASE1 1 PHASE1
Time#10s Time#10s Time#10s
T2 T2 T2
2 PHASE2 2 PHASE2 2 PHASE2
Time#10s Time#10s Time#10s
T3 T3 T3

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 1 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 1 step at a time from the initial step.
6F8C1226
26. SFC 26-17

• 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 Step A or C Resets all active information and activates specified step
(RJ_P)
Instruction Step A or C Makes self step inactive and activates specified step
(SJ_P)
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
M
Change the mode to RM (press the button twice) in the point screen of the sequence.
Press the [Phase change] button.
[Change]
Select the change destination phase from the phase list and press .
• 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 "Chapter 24 Tag Intervention Instructions" for information on instructions RJ_P and SJ_P.
6F8C1226
26. SFC 26-18

Program example:
In M or RM mode In A or C mode

SEQ001 SEQ001
SEQ SEQ

INI INI
T1 T1
1 PHASE1 1 PHASE1
Time#10s Time#10s
T2 T2
2 PHASE2 2 PHASE2
Time#10s Time#10s
T3 T3

• 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]
6F8C1226
26. SFC 26-19

SFC Phase Step


Diagram
N Step name
Congestion timer
N: Phase no. (1-32)

Modifier EN input Edge execution Index modification


- - -

Function:
• Unlike the Step instruction, action (sub screen) is performed from the phase step itself.
• When the transition condition of the previous step becomes 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 OFF and the ladder circuit is not executed. When "acknowledge operation" is performed the
connection on the right side of the phase step becomes 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 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 (ON when step is active, OFF when step is inactive)
Step execution duration :step name .T (represents the duration when step is active and is cleared to zero 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
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 Interlock Single
Sequence mode
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:
[conf progress]
• Press the 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.
6F8C1226
26. SFC 26-20

Conf progress example:


PHASE1: Active (phase execution complete) PHASE2 :Active (executing within phase) PHASE2 :Active (executing within phase)
PHASE3 :Active (Conf progress wait) PHASE3 :Active (executing within phase)
>
1 PHASE1 Transition T1 1 PHASE1 Acknowledge 1 PHASE1
Time#10s =TRUE(ON) Time#10s CNE=ON Time#10s
T1 T1 T1
> || > >
2 PHASE2 3 PHASE3 2 PHASE2 3 PHASE3 2 PHASE2 3 PHASE3
Time#10s Time#10s Time#10s Time#10s Time#10s Time#10s

T2 T2 T2
4 PHASE4 4 PHASE4 4 PHASE4
Time#10s Time#10s Time#10s
T3 T3 T3

Sequence tag (parameter) Sequence tag (data)


: :
FA1: Interlock/single setting1 Interlock MODE: mode A
FA2: Interlock/single setting2 Interlock :
FA3: Interlock/single setting3 Standalone

If transition (T1) becomes 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)

SEQ001
SEQ P1INI
T11
INI
S11
T1
T12
1 PHASE1
Time#10s S12
T2
T13
2 PHASE2
Time#10s S13
T3 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 in phase level is not allowed (phase step nesting is not allowed). If phase steps are nested, operation will be
unstable (not as expected).
6F8C1226
26. SFC 26-21

SFC Phase End Step


Diagram

Step name
phase_End

Modifier EN input Edge execution Index modification


- - -
Function:
• Represents the minimum unit of SFC network operation.
• When the transition condition in the previous step becomes 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 1 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 (ON when step is active, 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.

Program example:
Main screen (operation) Sub screen (phase)

SEQ001
SEQ P1INI
T11
INI
S11
T1
T12
1 PHASE1
Time#10s S12
T2
T13
2 PHASE2
Time#10s S13
T3 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).
6F8C1226
26. SFC 26-22

SFC Answer Step


Diagram

Step name
Ans
Answer timer

Modifier EN input Edge execution Index modification


- - -

Function:
• Represents the minimum unit of SFC network operation.
• When the state of the predecessor transition becomes 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 (ON when step is active, OFF when step is inactive)
Step execution duration :stepname.T (represents the duration when step is active and is cleared to zero 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.

Program example:
Main screen (operation) Sub screen (phase)

SEQ001
SEQ P1INI
T11
INI SIGNAL1
S11 PB_P
↑ E
T1 Ans
Time#10s 1 BNO
1 PHASE1 PB_DATA[1].
FI[1]
Time#10s T12 PB_PARA[1] PB_P
T2
PB_DATA[1] PB_D
S12
PhaseEnd

• 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.
6F8C1226
Appendix A Using Any Function A-1

Appendix A: Using Any Function


Remarks
No. Instruction
(Real instruction)
Arithmetic Operations
Add + ADD_xx
1
Multiply * MUL_xx
Subtract - SUB_xx
2
Divide / DIV_xx
Logical Operations
Bitwise Boolean AND AND AND_xx
3 Bitwise Boolean OR OR OR_xx
Bitwise Boolean XOR XOR XOR_xx
4 Bitwise Boolean NOT ~ NOT_xx
Comparison Functions
Greater Than > GT_xx
Greater Than or Equal >= GE_xx
5 Equal = EQ_xx
Less Than or Equal <= LE_xx
Less Than < LT_xx
6 Not Equal <> NE_xx

Any Function Instructions

These are Standard Functions for any data types. The user can use these symbols without selection of the data
type.

• Any Function Instructions are supported in Program Editor (Full graphic).


• Any Function Instructions are complex instructions, and are different from the other basic ones.
• V-Tool’s compiler converts them into the basic instructions.
• Their data type is automatically fixed, when they are compiled.
Instruction Kind Instruction Data type
Arithmetic Operations Using the output data type, their data type is fixed.
Logical Operations
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.
• About the 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 kind 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.
6F8C1226
Appendix A Using Any Function A-2

Arithmetic operation Add / Multiply

Input 1 x Output

Diagram 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 √ Input 1…n 2 ≤ n ≤ 15
Output — — Output

Input 1 x Output
Input 2

Input n

Input 1…n Symbol (x) 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 tables for the input data type that can be used at once.
The data type that doesn't exist in the following tables becomes the compile error.
[Table: Rules of data types] √: Compile OK, —: Compile Error
Input 1…n data type
Output data type Input 1…n data type
INT DINT UINT REAL WORD
INT INT √ — — — —
DINT — — — — —
UINT — — — — —
REAL — — — — —
WORD — — — — —
DINT INT √ √ √ — √
DINT √ √ √ — √
UINT √ √ √ — √
REAL — — — — —
WORD √ √ √ — √
UINT INT — — — — —
DINT — — — — —
UINT — — √ — √
REAL — — — — —
WORD — — √ — √
REAL INT √ — √ √ —
DINT — — — — —
UINT √ — √ √ —
REAL √ — √ √ —
WORD — — — — —
6F8C1226
Appendix A Using Any Function A-3

• 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
It converts it from "WORD" to "DINT". WORD_TO_DINT
It converts it from "WORD" to "UINT". WORD_TO_UINT
• Refer to the description of "Arithmetic Operation Instructions" for a detailed description of each instruction (ADD /
SUB / MUL / DIV).

Program example
SAMPLE1 + SAMPLE4 SAMPLE1 Type Conversion Instruction ADD_REAL SAMPLE4
“INT” “REAL” “INT” “INT - REAL Conversion” “REAL”
LD ST LD INT_TO_REAL ST
SAMPLE2 Internal SAMPLE2
“REAL” Process “REAL”
LD LD
SAMPLE3 Type Conversion Instruction
SAMPLE3 “UINT-REAL Conversion”
“UINT” “UINT”
LD UINT_TO_REAL
LD
[Operation description]
• As the output data type is "REAL", "ADD_REAL" is used.
• To operate variable SAMPLE1 ("INT") and variable SAMPLE3 ("UINT") by "REAL", Type Conversion Instructions
are automatically inserted.
6F8C1226
Appendix A Using Any Function A-4

Arithmetic operation Subtract / Divide

Input 1 x Output

Diagram 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 √ Input 1,2
Output — — Output

Input 1 x Output

Input 2

Input 1…n Symbol (x) 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 tables for the input data type that can be used at once.
The data type that doesn't exist in the following tables becomes the compile error.
[Table: Rules of data types] √: Compile OK, —: Compile Error
Input 1…n data type
Output data type Input 1…n data type
INT DINT UINT REAL WORD
INT INT √ — — — —
DINT — — — — —
UINT — — — — —
REAL — — — — —
WORD — — — — —
DINT INT √ √ √ — √
DINT √ √ √ — √
UINT √ √ √ — √
REAL — — — — —
WORD √ √ √ — √
UINT INT — — — — —
DINT — — — — —
UINT — — √ — √
REAL — — — — —
WORD — — √ — √
REAL INT √ — √ √ —
DINT — — — — —
UINT √ — √ √ —
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.
6F8C1226
Appendix A Using Any Function A-5

Type Conversion Type Conversion Instruction


It converts it from "WORD" to "DINT". WORD_TO_DINT
It converts it from "WORD" to "UINT". WORD_TO_UINT
• Refer to the description of "Arithmetic Operation Instructions" for a detailed description of each instruction (ADD /
SUB / MUL / DIV).

Program example
SAMPLE1 - SAMPLE3 SAMPLE1 Type Conversion Instruction SUB_REAL SAMPLE3
“INT” “REAL” “INT” “INT - REAL Conversion” “REAL”
LD ST LD INT_TO_REAL ST
SAMPLE2 Internal SAMPLE2
“REAL” Process “REAL”
LD LD

[Operation description]
• As the output data type is "REAL", "ADD_REAL" is used.
• To operate variable SAMPLE1 ("INT") and variable SAMPLE3 ("UINT") by "REAL", the Type Conversion
Instructions are automatically inserted.
6F8C1226
Appendix A Using Any Function A-6

Bitwise Boolean AND / Bitwise Boolean OR / Bitwise


Logical operation
Boolean XOR

Input 1 xxx Output

Diagram 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 √ Input 1…n 2 ≤ n ≤ 15
Output — — Output

Input 1 xxx Output


Input 2

Input n

Input 1…n Symbol (xxx) Output


See below AND See below
OR
XOR

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 doesn't exist in the following tables becomes the compile error.
[Table: Rules of data types] √: Compile OK, —: Compile Error
Input 1…n data type
Output data type Input 1…n data type
BOOL WORD DWORD
BOOL BOOL √ — —
WORD — — —
DWORD — — —
WORD BOOL — — —
WORD — √ —
DWORD — — —
DWORD BOOL — — —
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 a detailed description of each instruction (Bitwise
Boolean AND / Bitwise Boolean OR / Bitwise Boolean XOR).
6F8C1226
Appendix A Using Any Function A-7

Program example
SAMPLE1 AND SAMPLE4 SAMPLE1 AND_DWORD SAMPLE4
“DWORD” “DWORD” “DWORD” “DWORD”
LD ST LD ST
SAMPLE2 Internal SAMPLE2
“DWORD” Process “DWORD”
LD LD
SAMPLE3 SAMPLE3 Type Conversion Instruction
“WORD” “WORD” “WORD - DWORD Conversion”
LD LD WORD_TO_DWORD

[Operation description]
• As the output data type is "DWORD", "AND_DWORD" is used.
• To operate variable SAMPLE3 ("WORD") by "DWORD", Type Conversion Instructions are automatically inserted.
6F8C1226
Appendix A Using Any Function A-8

Logical operation Bitwise Boolean NOT

Input ~ Output
Diagram

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 x Output

Input Symbol (x) 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 tables for the input data type that can be used at once.
The data type that doesn't exist in the following tables becomes the compile error.
[Table: Rules of data types] √: Compile OK, —: Compile Error
Input data type
Output data type
BOOL WORD DWORD
BOOL √ — —
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 a detailed description of each instruction (Bitwise
Boolean NOT).

Program example
SAMPLE1 ~ SAMPLE2 Internal SAMPLE1 Type Conversion Instruction NOT_DWORD SAMPLE2
“WORD” “DWORD” Process “WORD” “WORD - DWORD Conversion” “DWORD”
LD ST LD WORD_TO_DWORD ST

[Operation description]
• As the output data type is "DWORD", "NOT_DWORD" is used.
• To operate variable SAMPLE1 ("WORD") by "DWORD", Type Conversion Instructions are automatically inserted.
6F8C1226
Appendix A Using Any Function A-9

Greater Than / Greater Than or Equal / Equal / Less


Comparison Function
Than or Equal / Less Than

Input 1 xx Output

Diagram 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 √ Input 1…n 2 ≤ n ≤ 15
Output — BOOL — Output

Input 1 xx Output
Input 2

Input n

Input 1…n Symbol (xx)


See below >
>=
=
<=
<

Function
• Refer to the following rule tables for the input data type that can be used at once.
The data type that doesn't exist in the following tables becomes the compile error.
[Table: Rules of data types] √: Compile OK, —: Compile Error
Input i in 1…n Input j in 1…n data type
data type INT DINT UINT REAL WORD DWORD
INT √ √ √ √ √ —
DINT √ √ √ — √ —
UINT √ √ √ √ √ √
REAL √ — √ √ — —
WORD √ √ √ — √ √
DWORD — — √ — √ √
• When all the rules of "Input 1 …n" are “√", the compiler is successes.
• The type of the instruction symbol is fixed by the input data type.
If "Input 1 ... n" has two kinds or more of the data type, the data type is fixed by the rule in the following tables.
[Table: Rules of data types] —: Compile Error
Input i in 1…n Input j in 1…n data type
data type INT DINT UINT REAL WORD DWORD
INT INT DINT DINT REAL DINT —
DINT DINT DINT DINT — DINT —
UINT DINT DINT UINT REAL UINT DWORD
REAL REAL — REAL REAL — —
WORD DINT DINT UINT — WORD DWORD
DWORD — — DWORD — DWORD DWORD
6F8C1226
Appendix A Using Any Function A-10

• If the data type of the inputs have three kinds or more of the data type, the data type of the instruction symbol is
fixed by the following flow.
Input 1
“INT” “INT” “REAL” “REAL”
Input 2
“INT”
Type of Instruction symbol
Input 3 (Data Type)
“REAL” “REAL”

Input n
“UINT”

• If the data type of inputs (1…n) and the fixed data type are different, the input data type fix according to the fixed
data type. That is, the Type Conversion Instruction is inserted between input data and the instruction.
• If the input data type is "WORD", "Bit string - Integer conversion" of the Type Conversion Instructions is inserted.
Type Conversion Type Conversion Instruction
It converts it from "WORD" to "DINT". WORD_TO_DINT
It converts it from "WORD" to "UINT". WORD_TO_UINT

Important
• “Comparison Function Instructions” are used following the data types that are not supported.
“TIME”, “TIME_OF_DAY (Abbreviation: TOD)”,
“DATE (Abbreviation: D)”, “DATE_AND_TIME (Abbreviation: DT)”

Program example
SAMPLE1 > SAMPLE5 SAMPLE1 Type Conversion Instruction GT_REAL SAMPLE5
“INT” “REAL” “INT” “INT - REAL Conversion” “REAL”
LD ST LD INT_TO_REAL ST
SAMPLE2 Internal SAMPLE2
“REAL” Process “REAL”
LD LD
SAMPLE3 SAMPLE3 Type Conversion Instruction
“UINT” “UINT” “UINT - REAL Conversion”
LD LD UINT_TO_REAL

[Operation description]
• Because variable SAMPLE1, variable SAMPLE2 and variable SAMPLE3 are different each the data type, the
data type of instruction fix “REAL” by previous table “Fix the data type”.
• To convert the variable SAMPLE1 ("INT") and variable SAMPLE3 ("UINT") into "REAL ", the type conversion
instruction is automatically inserted.
6F8C1226
Appendix A Using Any Function A-11

Comparison Function Not Equal

Input 1 <> Output


Diagram
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 √ Input 1,2 Input number=2
Output — BOOL — Output

Input 1 xx Output

Input 2

Input 1…n Symbol (xx)


See below <>

Function
• Refer to the following rule tables for the input data type that can be used at once.
The data type that doesn't exist in the following tables becomes the compile error.
[Table: Rules of data types] √: Compile OK, —: Compile Error
Input 2 data type
Input 1 data type
INT DINT UINT REAL WORD DWORD
INT √ √ √ √ √ —
DINT √ √ √ — √ —
UINT √ √ √ √ √ √
REAL √ — √ √ — —
WORD √ √ √ — √ √
DWORD — — √ — √ √
• When all the rules of "Input 1, 2" are “√", the compiler is successes.
• The type of the instruction symbol is fixed by the input data type. If "Input 1, 2 " have two kinds or more of the data
type, the data type is fixed by the rule in the following tables.
[Table: Rules of data types] —: Compile Error
Input 2 data type
Input 1 data type
INT DINT UINT REAL WORD DWORD
INT INT DINT DINT REAL DINT —
DINT DINT DINT DINT — DINT —
UINT DINT DINT UINT REAL UINT DWORD
REAL REAL — REAL REAL — —
WORD DINT DINT UINT — WORD DWORD
DWORD — — DWORD — DWORD DWORD
• If the data type of inputs (1, 2) and the fixed data type are different, the input data type fix according to the fixed
data type. That is, Type Conversion Instruction is inserted between input data and the instruction.
• If the input data type is "WORD", "Bit string - Integer conversion" of the Type Conversion Instructions is inserted.
Type Conversion Type Conversion Instruction
It converts it from "WORD" to "DINT". WORD_TO_DINT
It converts it from "WORD" to "UINT". WORD_TO_UINT
6F8C1226
Appendix A Using Any Function A-12

Important
• “Comparison Function Instructions” are used following the data types that are not supported.
“TIME”, “TIME_OF_DAY (Abbreviation: TOD)”,
“DATE (Abbreviation: D)”, “DATE_AND_TIME (Abbreviation: DT)”

Program example
SAMPLE1 <> SAMPLE3 SAMPLE1 Type Conversion Instruction NE_REAL SAMPLE3
“INT” “REAL” Internal “INT” “INT - REAL Conversion” “REAL”
LD ST Process LD INT_TO_REAL ST
SAMPLE2 SAMPLE2
“REAL” “REAL”
LD LD
[Operation description]
• Because variable SAMPLE1 and variable SAMPLE2 are different each the data type, the data type of instruction
fix “REAL” by previous table “Fix the data type”.
• To convert the variable SAMPLE1 ("INT") into "REAL ", the type conversion instruction is automatically inserted.
6F8C1226
Index 1

Index
Answer Step ····························································26-22
Symbol Arccosine·································································11-11
Arcsine ····································································11-10
, ··········································································· 20-13
Arctangent ·······························································11-12
. . , ········································································· 20-15
Arithmetic Shift ··························································13-6
. . : ········································································· 20-11
Array-String Conversion···········································10-52
: ············································································· 20-9
Average Value····························································9-10
A Average of Table Data ···············································9-12

ABS ··········································································· 11-6


B
ACC_P····································································· 24-27
ACOS ······································································ 11-11 BC ·············································································15-6

ACT_P ····································································· 24-24 BCD-Duration Conversion ·······································10-20

ADC··········································································· 14-4 BCD-Integer Conversion ·········································10-17

ADD································································ 14-2, 14-19 BCD-Real Numbers Conversion······························10-19

AND··········································································· 12-2 BIN···········································································10-32

ARRAY_TO_STRING················································ 10-52 BIN Conversion ·······················································10-32

ASC Module String Data Input ································ 16-12 Bit Counter ································································15-6

ASC Module String Data Output ····························· 16-15 Bit String- Integer Conversion ·································10-15

ASCDEC_TO_DINT ················································· 10-44 Bit String-Bit String Conversion ·······························10-16

ASCHEX_TO_DINT·················································· 10-46 Bitwise Boolean AND·················································12-2

ASCII (Decimal)-Double Integer Conversion ··········· 10-44 Bitwise Boolean AND of Table Data···························12-3

ASCII (Hexadecimal)-Double Integer Conversion ··· 10-46 Bitwise Boolean NOT·················································12-6

ASCII-HEX Conversion ············································ 10-36 Bitwise Boolean NOT XOR of Table Data ················12-10

ASCII-Real Numbers Conversion ···························· 10-40 Bitwise Boolean NOT of Table Data···························12-7

ASCREAD································································ 16-12 Bitwise Boolean OR ···················································12-4

ASCWRITE ······························································ 16-15 Bitwise Boolean OR of Table Data ·····························12-5

ASC_TO_REAL························································ 10-40 Bitwise Boolean XOR·················································12-8

ASIN ········································································ 11-10 Bitwise Boolean XOR of Table Data···························12-9

ATAN ······································································· 11-12


C
ATOH_T··································································· 10-36
AVE············································································ 9-10 CASE ·········································································20-8

AVEL·········································································· 9-12 CMLP_P·····································································24-2

Absolute Value ·························································· 11-6 CMPB_P ····································································24-4

Action (BOOL type) ··················································· 26-9 CMSQ_P ····································································24-6

Action (User defined type) ········································ 26-9 CONCAT_D_TOD ····················································10-35

Action Counter ························································ 24-27 CONCAT_STRING ·····················································19-6

Action Timer ···························································· 24-24 COS ···········································································11-8

Add ··········································································· 14-2 CTD ·············································································4-4

Add Time Data ························································ 14-19 CTU ·············································································4-2

Add with Carry··························································· 14-4 CTUD···········································································4-6


6F8C1226
Index 2

Calendar Data Acquisition ········································ 25-4 DT ············································································17-26


Change Adjuster Mode ············································· 24-2 DT_TO_DATE···························································10-34
Change Push Button Mode ······································· 24-4 DT_TO_TOD ····························································10-34
Change Sequence Mode ·········································· 24-6 DUPLEX_CHG ···························································22-2
Coil ·············································································· 2-9 DUPLEX_DOWN ························································22-3
Common Logarithms ················································ 11-4 DWORD_BCD_TO_DINT ·········································10-17
Communication FB (XMIT_N)·································· 21-46 DWORD_BCD_TO_INT············································10-17
Communication FB (XMIT_T) ·································· 21-44 DWORD_BCD_TO_REAL ········································10-19
Concatenate Time Data ·········································· 10-35 DWORD_BCD_TO_TIME ·········································10-20
Concatenate String ··················································· 19-6 DWORD_BCD_TO_UINT ·········································10-17
Conditional Execution Instruction································ 3-4 DWORD_TO_DINT···················································10-15
Controller global variable ············································ 1-9 DWORD_TO_INT ·····················································10-15
Cosine ······································································· 11-8 DWORD_TO_UINT···················································10-15
Current Output PID···················································· 23-2 DWORD_TO_WORD················································10-16
Current Output Sample PI ········································· 23-6 Data Exchange ····························································7-9
Cyclic Trace······························································· 25-2 Data Structure ·····························································1-6
Data Type·····································································1-4
D Dead Band ································································17-2
DATALOGC ······························································· 25-2 Dead Time ·······························································17-26
DB ············································································· 17-2 Decode······································································15-5
DCL_P ····································································· 23-22 Decrement ·······························································14-16
DEC································································ 14-16, 15-5 Define String ····························································19-11
DEF_STRING··························································· 19-11 Delete String ······························································19-8
DEG-RAD Conversion ············································· 10-30 Derivative···································································17-4
DEG_TO_RAD ························································· 10-30 Direct I/O ·································································16-20
DELETE ····································································· 19-8 Divergence/Convergence of Sequence·····················26-6
DIAG_D ····································································· 25-6 Divergence/Convergence of Simultaneous Sequences
·············································································26-7
DIF2··········································································· 17-4
Divide ······································································14-12
DINT_TO_ASCDEC ·················································10-48
Divide Time Data ·····················································14-24
DINT_TO_ASCHEX·················································· 10-50
Double Cross Limit ··················································23-22
DINT_TO_BCD_DWORD ··········································· 10-7
Double Integer-ASCII (Decimal) Conversion ···········10-48
DINT_TO_BCD_WORD ············································· 10-7
Double Integer-ASCII (Hexadecimal) Conversion····10-50
DINT_TO_DWORD ···················································· 10-6
Down Counter······························································4-4
DINT_TO_INT ···························································· 10-3
Duplex Online-Standby Change ································22-2
DINT_TO_REAL ························································· 10-5
Duplex Self-System Down ·········································22-3
DINT_TO_TIME·························································· 10-9
Duration-Real Numbers Conversion························10-24
DINT_TO_UINT·························································· 10-3
Duration–BCD Conversion ······································10-25
DINT_TO_WORD ······················································· 10-6
Duration-Integer Conversion ···································10-22
DIS_P ········································································ 18-6
DIV ······························································· 14-12, 14-24
E
DI_T··········································································· 18-9
DLM········································································· 17-35 EI_T ···········································································18-8

DO··········································································· 20-24 ELSE (CASE statement) ··········································20-17


6F8C1226
Index 3

ELSE (IF statement) ·················································· 20-4 G


ELSEIF ······································································ 20-5
GE ···············································································8-4
ENC··········································································· 15-4
GET_CLND ································································25-4
END_CASE······························································ 20-19
GET_IO_STS····························································16-25
END_FOR································································ 20-22
GET_IP_INF ·····························································16-17
END_IF ······································································ 20-7
GET_SIO_STS ·························································16-22
END_REPEAT·························································· 20-30
GT················································································8-2
END_WHILE ···························································· 20-26
Global variable ····························································1-9
EN_P ········································································· 18-5
Greater Than ·······························································8-2
EQ ··············································································· 8-6
Greater Than or Equal ·················································8-4
EQUALIZE_ADDR······················································ 22-5
EQUALIZE_VAR························································· 22-4
H
EXIT (FOR statement) ············································· 20-21
HEX-ASCII Conversion·············································10-38
EXIT (REPEAT statement) ······································· 20-29
HTOA_T ···································································10-38
EXIT (WHILE statement) ·········································· 20-25
EXP ··········································································· 11-3
I
EXPT ······································································· 14-18
I/O Degeneracy Recovery Request ·························16-31
Encode······································································ 15-4
I/O Degeneracy Request ·········································16-29
End of Conditional Execution Instruction ···················· 3-4
I/O Memory Read ······················································16-2
Engineering Unit Conversion··································· 17-39
I/O Memory Write·······················································16-4
Equal ··········································································· 8-6
I/O Module State Read ············································16-25
Essential Succession PID········································ 17-41
I/O Node State Read ···············································16-22
Event Program Startup ·············································· 18-7
IF ···············································································20-2
Exponential ······························································· 11-3
ILNL ·········································································17-20
Extract String····························································· 19-5
ILNL_REAL2 ····························································17-23

F INC ··········································································14-14
INSERT ······································································19-7
FBD Language ···························································· 1-2
INTG ··········································································17-6
FFD_P ····································································· 23-19
INT_TO_BCD_DWORD··············································10-7
FIND ········································································ 19-10
INT_TO_BCD_WORD ················································10-7
FOR_DO·································································· 20-20
INT_TO_DINT·····························································10-3
Falling Edge Detector ················································· 2-7
INT_TO_DWORD ·······················································10-6
Feed Forward ·························································· 23-19
INT_TO_REAL····························································10-5
Find String······························································· 19-10
INT_TO_TIME ····························································10-9
Fix MV ····································································· 17-14
INT_TO_UINT·····························································10-3
Forced Coil································································ 2-15
INT_TO_WORD··························································10-6
Forced Negated Coil ················································· 2-16
IOFB_REQ ·······························································16-29
Forced Negative Transition-sensing Coil··················· 2-20
IORC_REQ·······························································16-31
Forced Positive Transition-sensing Coil ···················· 2-19
IO_T ·········································································16-20
Forced RESET Coil···················································· 2-18
Increment ································································14-14
Forced SET Coil ························································ 2-17
Index Registers··························································1-22
Function ···································································· 1-18
Initial Step··································································26-4
Function Block ·························································· 1-21
6F8C1226
Index 4

Initialize Table Data ··················································· 7-11 Logical Shift·······························································13-8


Insert String ······························································· 19-7
Instruction Behavior when Exceeding Data Boundary M
············································································ 1-26 MAV ·········································································17-29
Integer-BCD Conversion ··········································· 10-7 MAV_N·····································································17-32
Integer-Bit String Conversion ···································· 10-6 MAX ·············································································9-2
Integer-Duration Conversion ····································· 10-9 MAXL ···········································································9-4
Integer-Integer Conversion········································ 10-3 MID ············································································19-5
Integer-Real Numbers Conversion ···························· 10-5 MIN ··············································································9-6
Integrator··································································· 17-6 MINL ············································································9-8
Interlock Diagnosis···················································· 25-6 MOD ········································································14-13
Interrupt Disable························································ 18-9 MOVE ··········································································7-6
Interrupt Enable························································· 18-8 MPX ···········································································9-20
Inverse Polynomial Line Function ···························· 17-20 MREAD ······································································16-2
Inverse Polygonal Line Function (high-speed version) MREAD_N··································································16-6
·········································································· 17-23
MUL ································································14-9, 14-23
Inverter ········································································ 2-8
MUX···········································································9-18

J MV Calculation ························································17-11
MVF ·········································································17-14
Jump ··········································································· 3-3
MVS ·········································································17-11
Jump Control Reset ···················································· 3-2
MWRITE ·····································································16-4
Jump Control Set ························································ 3-2
MWRITE_N ································································16-9

L Master Control Reset···················································3-5


Master Control Set·······················································3-5
LABEL ········································································· 3-3
Maximum ·····································································9-2
LAG2 ······································································· 17-37
Maximum of Table Data ···············································9-4
LB_P········································································ 24-22
Minimum······································································9-6
LD Language ······························································ 1-2
Minimum of Table Data················································9-8
LE ················································································ 8-8
Move Data ···································································7-6
LEFT·········································································· 19-3
Move Table Data··························································7-7
LEN ··········································································· 19-2
Moving Average·······················································17-29
LIMIT ········································································· 9-14
Moving Average (low-speed version) ······················17-32
LN·············································································· 11-5
Multiplex ····································································9-18
LOG··········································································· 11-4
Multiplex of Table Data ··············································9-20
LT ·············································································· 8-10
Multiply ······································································14-9
Label ··········································································· 3-3
Multiply Time Data ···················································14-23
Lag/Lead Filter ························································ 17-37
Leftmost Extract String ·············································· 19-3 N
Less Than·································································· 8-10
NE··············································································8-12
Less Than or Equal ····················································· 8-8
NEG ·········································································10-29
Limiter ······································································· 9-14
NOT ···········································································12-6
Link············································································ 26-8
Natural Logarithms ····················································11-5
Local variable ······························································ 1-9
Negated Coil ·····························································2-10
6F8C1226
Index 5

Negative Transition-sensing Coil ······························· 2-14 Push Button ON·······················································24-20


Negative Transition-sensing Contact ·························· 2-5
Network variable ························································· 1-9 R
Non-tracking type static variable································· 1-9 RAD-DEG Conversion ·············································10-31
Normally Closed Contact ············································ 2-3 RAD_TO_DEG ·························································10-31
Normally Closed Contact Gate ··································· 7-4 REAL_TO_ASC ························································10-42
Normally Open Contact··············································· 2-2 REAL_TO_BCD_DWORD ········································10-12
Normally Open Contact Gate ······································ 7-2 REAL_TO_BCD_WORD ···········································10-12
Not Equal ·································································· 8-12 REAL_TO_DINT ·······················································10-10
REAL_TO_INT··························································10-10
O REAL_TO_TIME ·······················································10-14
OR ············································································· 12-4 REAL_TO_UINT ·······················································10-10
Off-Delay Timer ··························································· 5-6 REPEAT ···································································20-27
On-Delay Timer ··························································· 5-3 REPLACE···································································19-9
RESET Coil ································································2-12
P RETURN ····································································18-2
PB_P ······································································· 24-20 RIGHT ········································································19-4
PCT ········································································· 17-40 RJ_P ········································································24-34
PID2 ·········································································· 17-8 RMV_P ·····································································24-16
PID3 ········································································ 17-41 ROL ···········································································13-5
PIDP_P ···································································· 23-11 ROR ···········································································13-4
PID_P ········································································ 23-2 RS················································································6-3
PLN ········································································· 17-16 RSTC ·········································································15-3
PLN_REAL2····························································· 17-18 RSV_P······································································24-12
POU (Program Organization Unit)····························· 1-15 RTC············································································5-14
Partial Equalizer (address specification) ··················· 22-5 RTC_N ·······································································5-15
Partial Equalizer (variable specification) ··················· 22-4 Rate Limiter ·····························································17-35
Percent Conversion ··············································· 17-40 Reading and Writing Variable ····································1-13
Phase End Step ······················································ 26-21 Real Number Format ···················································1-8
Phase Step······························································ 26-19 Real Numbers-ASCII Conversion ····························10-42
Polygonal Line Function (high-speed version) ········ 17-18 Real Numbers-BCD Conversion ······························10-12
Polynomial Line Function ········································ 17-16 Real Numbers-Duration Conversion························10-14
Positive Transition-sensing Coil································· 2-13 Real Numbers-Integer Conversion ··························10-10
Positive Transition-sensing Contact ···························· 2-4 Real Time Calendar ···················································5-14
Power ······································································ 14-18 Real Time Clock ························································5-15
Program ···································································· 1-17 Remainder ·······························································14-13
Program Disable ······················································· 18-6 Replace String ···························································19-9
Program Enable ························································ 18-5 Reset Carry································································15-3
Program Structure ····················································· 1-14 Reset Jump ·····························································24-34
Pulse Output PID····················································· 23-11 Reset MV ·································································24-16
Pulse Output Sample PI ·········································· 23-15 Reset SV ··································································24-12
Pulse Timer ································································· 5-9 Reset Type Flip-Flop ····················································6-3
Push Button Lock ···················································· 24-22 Return ········································································18-2
6F8C1226
Index 6

Rightmost Extract String ··········································· 19-4 Socket Communication Receive···················21-22, 21-33


Rising Edge Detector ·················································· 2-6 Socket Communication Send ·························21-2, 21-14
Rotate Bits Left·························································· 13-5 Special Module Data Input ········································16-6
Rotate Bits Right ······················································· 13-4 Special Module Data Output ·····································16-9
Square Root ······························································11-2
S State Change Detection Read ·································16-17
SBB ··········································································· 14-7 Static variable ······························································1-9
SCV_P ····································································· 24-17 Station global variable ·················································1-9
SEL············································································ 9-16 Step ···········································································26-2
SEMA ·········································································· 6-4 Step Counting····························································1-27
SET Coil ···································································· 2-11 String Length ·····························································19-2
SETC ········································································· 15-2 String-Array Conversion ··········································10-54
SFA············································································ 13-6 Subtract ·····································································14-6
SFC Language ···························································· 1-3 Subtract Time Data··················································14-21
SFL············································································ 13-8 Subtract with Carry ····················································14-7
SHL ··········································································· 13-3 Super Two Degrees of Freedom PID ·························17-8
SHR ··········································································· 13-2 System Flags·····························································1-22
SIN ············································································ 11-7
SJ_P ········································································ 24-30 T
SMV_P····································································· 24-13 TAN············································································11-9
SPIP_P ···································································· 23-15 TAND ·········································································12-3
SPI_P········································································· 23-6 TEST ········································································12-11
SQRT········································································· 11-2 THEN ·········································································20-3
SR ··············································································· 6-2 TIME_TO_BCD_DWORD ·········································10-25
SS ············································································· 5-12 TIME_TO_BCD_WORD············································10-25
SSV_P ······································································· 24-8 TIME_TO_DINT ························································10-22
START_P ··································································· 18-7 TIME_TO_INT ··························································10-22
STRING_TO_ARRAY················································ 10-54 TIME_TO_REAL ·······················································10-24
SUB ································································ 14-6, 14-21 TIME_TO_UINT ························································10-22
Selector ····································································· 9-16 TINZ ···········································································7-11
Self Step Jump························································ 24-30 TMOV···········································································7-7
Semaphore·································································· 6-4 TNOT ·········································································12-7
Sequence ································································ 26-16 TOF··············································································5-6
Set Carry ··································································· 15-2 TOFM_P·······································································5-6
Set MV····································································· 24-13 TON ·············································································5-3
Set SV ······································································· 24-8 TONM_P ······································································5-3
Set Type Flip-Flop ······················································· 6-2 TOR ···········································································12-5
Shift Bits Left ····························································· 13-3 TO_INDEX ·······························································10-56
Shift Bits Right··························································· 13-2 TP ················································································5-9
Shut CV ··································································· 24-17 TRST ··········································································15-9
Sign Negative·························································· 10-29 TRUNC ····································································10-27
Sine ··········································································· 11-7 TSET ··········································································15-7
Single Shot ································································ 5-12 TXNR ·······································································12-10
6F8C1226
Index 7

TXOR ········································································· 12-9 WORD_TO_DINT ·····················································10-15


Table Bit Reset ·························································· 15-9 WORD_TO_DWORD················································10-16
Table Bit Set ······························································ 15-7 WORD_TO_INT························································10-15
Tag Number Conversion·········································· 10-56 WORD_TO_UINT ·····················································10-15
Tangent ····································································· 11-9 XCHG ··········································································7-9
Task ··········································································· 1-14 XMIT_N ····································································21-46
Temporary variable ······················································ 1-9 XMIT_T·····································································21-44
Test·········································································· 12-11 XOR ···········································································12-8
Time Data Type Conversion ···································· 10-34
Transition ··································································· 26-5
Truncation································································ 10-27

U
UINT_TO_BCD_DWORD ··········································· 10-7
UINT_TO_BCD_WORD ············································· 10-7
UINT_TO_DINT·························································· 10-3
UINT_TO_DWORD ···················································· 10-6
UINT_TO_INT ···························································· 10-3
UINT_TO_REAL ························································· 10-5
UINT_TO_TIME·························································· 10-9
UINT_TO_WORD ······················································· 10-6
UNT ········································································· 17-39
UNTIL ······································································ 20-28
URCV_N ·································································· 21-33
URCV_T··································································· 21-22
USEND_N ······························································· 21-14
USEND_T ·································································· 21-2
Up Counter·································································· 4-2
Up Down Counter ······················································· 4-6
User Defined Function ·············································· 18-3
User Defined Function Block····································· 18-4

V
Variable Declaration Examples·································· 1-10
Variable Memory Allocation Rules ······························· 1-9

W
WHILE ····································································· 20-23
WORD_BCD_TO_DINT ··········································· 10-17
WORD_BCD_TO_INT ·············································· 10-17
WORD_BCD_TO_REAL··········································· 10-19
WORD_BCD_TO_TIME ··········································· 10-20
WORD_BCD_TO_UINT ··········································· 10-17
Unified Controller nv series & Integrated Controller V series
Programming Instructions (LD/FBD/SFC/ST)
October 31, 2008 Second Edition

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

© Toshiba Corporation 2008 No part of this document may be reproduced


All Right Reserved. without the prior written consent of Toshiba.

10E_6F8C1226_Controller_V_series_1022_単.indd 3 08.10.22 5:14:22 PM


Integrated Controller V series

1226.2.0810

10E_6F8C1226_Controller_V_series_1022_単.indd 4 08.10.22 5:14:24 PM

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy