User Manual - Motion Control Module Instructions - Eng - V1.0
User Manual - Motion Control Module Instructions - Eng - V1.0
User Manual - Motion Control Module Instructions - Eng - V1.0
LSIS strives to maximize customers' profit in gratitude of choosing us for your partner.
Users Manual
XGF-M32E
Read
Keep
http://www.lsis.com
Safety Instruction
Warning
Caution
The marks displayed on the product and in the users manual have the
following meanings.
Be careful! Danger may be expected.
Be careful! Electric shock may occur.
The users manual even after read shall be kept available and accessible to
any user of the product.
A user or a seller is required to note that this device has completed the
Electro-Magnetic Compatibility Registration for business (A-class), not for
family use.
Safety Instruction
Safety Instruction
Safety Instruction
Before PLC system is powered on, be sure that all the covers of
the terminal are securely closed. If not, electric shock may be caused
Caution
Let the wiring installed correctly after checking the voltage rated
of each product and the arrangement of terminals. If not, fire,
electric shock or abnormal operation may be caused.
Secure the screws of terminals tightly with specified torque when
wiring. If the screws of terminals get loose, short circuit, fire or abnormal
operation may be caused.
Surely use the ground wire of Class 3 for FG terminals, which is
exclusively used for PLC. If the terminals not grounded correctly,
abnormal operation may be caused.
Dont let any foreign materials such as wiring waste inside the
module while wiring, which may cause fire, damage on the product
or abnormal operation.
Safety Instruction
Caution
Dont remove PCB from the module case nor remodel the module.
Fire, electric shock or abnormal operation may occur.
Prior to installing or disassembling the module, let all the
external power off including PLC power. If not, electric shock or
abnormal operation may occur.
Keep any wireless installations or cell phone at least 30cm away
from PLC. If not, abnormal operation may be caused.
Caution
Revision History
Revision History
Versio
n
V 1.0
Date
Remark
Chapter
13. 9
First Edition
The number of Users manual is indicated right part of the back cover.
2013
The Users Manual describes the product. you may connect our website(http://www.lsis.biz/)
and download the information as a PDF file.
Description
It describes how to use XG5000 software especially
XG5000
XGK/XGB
Users Manual
XGK/XGB CPU.
(XGI-
CPUU/CPUS/CPUH/CPUE/CPUU/D)
module.
Title
Description
It describes CPU specifications and technical terms for
(XGK-
CPUA/CPUE/CPUH/CPUS/CPUU)
XG-PM Manual
Motion
Manual
Control
Module
Contents
Ch 1. Introduction ................................................................................................................... 1-1
1.1 Features of IEC 61131-3 Language ......................................................................................................................... 1-1
1.2 Types of Language.................................................................................................................................................... 1-1
Chapter 1
Introduction
Chapter 1 Introduction
This users guide describes the languages supported by Motion control module. The Motion control module is based on the
standard language of International Electrotechnical Commission (IEC).
1-1
Chapter 2
Software Structure
Project
Global/Direct Variable
Parameter
Basic Parameter
I/O Parameter
Scan Program
2-1
Chapter 2
Software Structure
2.2 Project
For a Motion control module program, the first priority is given to project configuration. Creating a project comprises of configuring
and programming all elements necessary for a Motion control system (scan programs, task definitions, basic parameters, I/O
parameters, and so on).
The main task processes the command executed every control cycle and communication cycle.
The periodic task processes the command executed every cycle that is set as the multiple of the control cycle.
The Initialization task is executed when the modules operation mode is converted from Stop to Run.
For more details on each task, refer to the Motion Control Module manual (4.3 Motion Control task).
2-2
Chapter 3
Common Elements
3.1 Expression
3.1.1 Identifiers
Identifiers must be mixed of alphabet, numeric and all letters starting with underlined letters.
Identifiers are used as variable names.
Blank (space) is not allowed in identifiers.
In case of variable or instance name, identifiers may consist of Korean, Alphabet and Chinese characters.
Theres no difference between small letters and capitals in alphabet; all the letters of the alphabet are recognized as upper
case.
Types
Examples
Types
1.
Examples
Integer
Real number
Binary number
2#1111_1111, 2#11100000
Octal number
Hexadecimal number
BOOL data
0, 1, TRUE, FALSE
When using real numbers with exponents, the followings are not allowed.
Ex) 12E-5 ( ) 12.0E-5 ( )
3-1
Chapter 3
Common Elements
Integer includes binary, octal, hexadecimal numbers and decimal, which can be distinguished by placing # in front of
each numerical character.
0 ~ 9 and A ~ F are used (including small letters a ~ f) in expressing hexadecimal.
There is no need have plus/minus signs in expressing hexadecimal.
Boolean data may be expressed as an integer 0 or 1.
2.
Character String
Character string covers all the letters with single quotation marks.
In case of the character string constant and the initialization, the length is limited up to 31 letters.
Ex) CONVEYER
3.
Content
Duration (no underline)
Examples
T#14ms, T#14.7s, T#14.7m, T#14.7h
t#14.7d, t#25h15m, t#5d14h12m18s356ms
Reserved word
Date prefix
D#
TOD#
DT#
3-2
Chapter 3
Content
Common Elements
Examples
D#1984-06-25
d#1984-06-25
TOD#15:36:55.36
tod#15:36:55.369
DT#1984-06-25-15:36:55.36
dt#1984-06-25-15:36:55.369
Date
Time of Day
Date and Time
1
2
3
4
5
6
7
8
SINT
INT
DINT
LINT
USINT
UINT
UDINT
ULINT
Short Integer
Integer
Double Integer
Long Integer
Unsigned Short Integer
Unsigned Integer
Unsigned Double Integer
Unsigned Long Integer
Size
(bits)
8
16
32
64
8
16
32
64
REAL
Real Numbers
32
10
LREAL
64
11
12
13
TIME
DATE
TIME_OF_DAY
Duration
Date
Time Of Day
32
16
32
14
DATE_AND_TIME
64
15
16
17
18
19
20
STRING
BOOL
BYTE
WORD
DWORD
LWORD
Character String
Boolean
Bit String of Length 8
Bit String of Length 16
Bit String of Length 32
Bit String of Length 64
32*8
1
8
16
32
64
No.
Reserved Word
Data Type
Range
-128 ~ 127
-32,768 ~ 32,767
-2,147,483,648 ~ 2,147,483,647
63
63
-2 ~ 2 -1
0 ~ 255
0 ~ 65,535
0 ~ 4,294,967,295
64
0 ~ 2 -1
-3.402823466e+038 ~ -1.175494351e-038
or 0 or
1.175494351e-038 ~ 3.402823466e+038
-1.7976931348623157e+308 ~
-2.2250738585072014e-308
or 0 or 2.2250738585072014e-308 ~
1.7976931348623157e+308
T#0S ~ T#49D17H2M47S295MS
D#1984-01-01 ~ D#2163-6-6
TOD#00:00:00 ~ TOD#23:59:59.999
DT#1984-01-01-00:00:00 ~
DT#2163-12-31-23:59:59.999
0,1
16#0 ~ 16#FF
16#0 ~ 16#FFFF
16#0 ~ 16#FFFFFFFF
16#0 ~ 16#FFFFFFFFFFFFFFFF
3-3
Chapter 3
Common Elements
ANY
ANY_BIT
ANY_NUM
ANY_REAL
ANY_INT
REAL
LREAL
LINT
DINT
INT
SINT
ULINT
UDINT
UINT
USINT
ANY_STRING
ANY_DATE
TIME
DATE_AND_TIME
DATE
TIME_OF_DAY
LWORD
DWORD
WORD
BYTE
BOOL
Data expressed as ANY_NUM includes LREAL, REAL, LINT, DINT, INT, SINT, ULINT, UDINT, UINT and USINT.
For example, if a data type is expressed as ANY_BIT, it can use one of the following data types: LWORD, DWORD, WORD,
BYTE and BOOL.
3-4
Initial Value
0
0
0
0.0
T#0s
D#1984-01-01
TOD#00:00:00
DT#1984-01-01-00:00:00
' ' (empty string)
Chapter 3
Common Elements
USINT
8 bit , range: 2#0000_0000 ~ 2#1111_1111, 16#00 ~ 16#FF
15
87
WORD
16 bit, range: 2#0000_0000 _0000_0000 ~ 2#1111_1111_1111_1111 16#0000 ~ 16#FFFF
31
16 15
DWORD
32 bit, range: 2#0000_...000 ~ 2#1111_...111 16#00000000 ~ 16#FFFFFFFF
63
32
31
LWORD
64 bit, range: 2#0000_...000 ~ 2#1111_...111, 16#0000000000000000 ~ 16#FFFFFFFFFFFFFFFF
# Unsigned Integer
7
USINT
8 bit , range: 0 ~ 255
15
87
UINT
16 bit, range: 0 ~ 65,535
31
16 15
UDINT
32 bit, range: 0 ~ 4,294,967,295
63
32
31
31
ULINT
64 bit, range: 0 ~ 264-1
SINT
8 bit, range: -128 ~ 127
15
87
INT
16 bit, range: -32,768 ~ 32,767
31
16 15
DINT
32 bit. range: -2,147,483,648 ~ 2,147,483,647
63
32
LINT
64 bit, range: -263 ~ 263-1
3-5
Chapter 3
Common Elements
REAL
23 22
Exponent
Fraction
LREAL S
52 51
Exponent
Fraction
: e=b30b29...b23, e=b62b61...b52 )
# Time
31
TIME
32 bit, range: 0 ~ 4,294,967,295ms ,T#49d17h2m47s295ms
# Date
DT
48 47
63
32 31
0000000000000000
TOD
64 bit, range: DT#1984-01-01-00:00:00 ~ DT#2163-12-31-23:59:59.999
16 15
31
0
DATE
TOD
32 bit, range: TOD#00:00:00 ~ TOD#23:59:59.999
15
87
DATE
16 bit, range: D#1984-01-01 ~ D#2163-6-6
#BCD
7
BYTE
43
1
10
10
8 bit, range: 0 ~ 99
87
15
WORD
31
DWORD
0
1
10
10
10
10
16 bit, range: 0 ~ 9999
24
23
16 15
15
14
13
3-6
87
10
10
10
10
10
10
10
10
64 bit, range: 0 ~ 9,999,999,999,999,999
10
10
10
10
10
32 bit, range: 0 ~ 99,999,999
63
LWORD
10
32
48 47
12
10
11
10
10
31
10
16 15
7
10
10
10
10
10
10
10
Chapter 3
Common Elements
3.3 Variable
A variable has its own value and refer to data used in a program. Variable refer to something that can vary such as an input/output
of PLC, memory, and so on.
Prefix
X
None
B
W
D
L
Meaning
Input Location
Output Location
G Area Position of Internal Memory (Memory Location)
D Area Position of Internal Memory (Memory Location)
M Area Position of Internal Memory (Memory Location)
P Area Position of Internal Memory (Memory Location)
Meaning
1 bit size
1 bit size
1 byte (8 bits) size
1 word (16 bits) size
1 double word (32 bits) size
1 long word (64 bits) size
Expression format
%[Location Prefix][Size Prefix] n1.n2.n3
Number
I, Q
M, R, W
n1
0: Internal I/O
1~36: Axis number
n2
3-7
Chapter 3
Common Elements
Examples
st
%QX0.1
%IW2.1
%MD48
%MW40.3
st
th
rd
th
1. Variable types
The variable type defines how to declare variables.
Variable types
VAR
VAR_CONSTANT
VAR_EXTERNAL
VAR_EXTERNAL_CONSTAN
T
Description
General variable available to read/write
Read only variable
Declaration to use the variable declared as VAR_GLOBAL
Declaration to use the variable declared as VAR_GLOBAL
Read only variable
2. Data type
Data type sets a variable data type.
3. Memory allocation
Memory allocation assigns memory for a variable.
Auto
---- The compiler sets a variable location automatically (Automatic Allocation Variable).
Assign (AT)
---- A user sets a location of variable, using a direct variable (Direct Variable).
3-8
Chapter 3
Common Elements
Reference
The location of Automatic Allocation Variable is not fixed. If variable VAL1, for example, was declared as BOOL, it is not fixed in
the internal memory; the compiler and linker fix its location. If the program is compiled again after modification, the location may
change.
The merit of Automatic Allocation Variable is that users do not have to care the location of the internal variables because its
location is not overlapped as long as a variable name is different from others.
Use of Direct Variable is not recommended except %
and % Q
overlapped in a wrong-used case.
Initial Value Assignment: assigns an initial value. A variable is set with an initial value as shown in section 3.2.3. Initial Value if
not assigned.
Reference
The initial value is not assigned when it comes to VAR_EXTERNAL.
You can not input the initial value to the variables to which G area, D area, M area is allocated during variable declaration.
For the variable whose data value should be retained even after the PLCs power is shut off, you need to use the Retention
function in case of a blackout. You can apply this function by setting a checkbox based on the below instructions.
1) Retention Variable retains its data when the system is set as Warm Restart.
2) In case of Cold Restart, variables are initialized as the initial values set by users or the basic initial values.
Variables, which are not declared as VAR_RETAIN, must be initialized as the initial values set by a user or the basic initial
values in case of Warm Restart or Cold Restart.
Users can declare variables 'Array' with Elementary Data Type. When declaring the Array Variable, users are supposed to set
Data Type and Array Size; STRING type among Elementary Data Types is not allowed.
Effective scope of variable declaration, the area which is available to use the variable, is limited to the program where
variables are declared. And users can't use variables declared in other program in the above area. On the contrary, users
can get an access to 'Global Variable' from other program elements by declaring it as 'VAR_EXTERNAL'.
3-9
Chapter 3
Common Elements
Data Type
INT
REAL
BOOL
DWORD
ARRAY OF INT[10]
Initial Value
1234
-
Memory Allocation
Auto
Auto
%MX10
Auto
Auto
Chapter 3
Common Elements
Reserved words
TYPE ... END_TYPE
VAR ... END_VAR
VAR_INPUT ... END_VAR
VAR_OUTPUT ... END_VAR
VAR_IN_OUT ... END_VAR
VAR_EXTERNAL ... END_VAR
VAR_ACCESS ... END_VAR
VAR_GLOBAL ... END_VAR
WHILE ... DO ... END_WHILE
WITH
3-11
Chapter 3
Common Elements
An internally used function automatically selects in XG-PM, depending on a user-selected variable type. For instance, two
inputs are selected among ADD function and I/O variables are selected as DINT, ADD2_DINT is selected as described above.
Although IEC allows an operation between and among same types, XG-PM has a Strict type check (ViewProgram Check)
option to allow an operation if its operand sizes (BYTE, WORD, DWORD, and LWORD) are same.
3-12
Chapter 4
LD (Ladder Diagram)
LD program is the graphical representation of a PLC program using symbols such as a coil or contact used in relay logic
diagram.
Configuration
rung
comment
Line
No.
Line0
THERE
Label
START
Line1
TON
IN
Line2
SET_TIME
function
Function
block
SIGN
PT
ET
CUR_TIME
Line3
rung
%I0.0.0
STOP
Line4
DOWN
ADD
contact
Horizontal
link
EN
EN0
DATA1
IN1
OUT
DATA2
IN2
vertical
link
UP
( )
DATA3
coil
jump label
THERE
Line5
bus line
4.2 Bus
Bus line as a power line is vertically placed on either sides of a LD graphic diagram.
No
Symbol
Name
Description
4-1
Chapter 4
LD (Ladder Diagram)
4.3 Link
The value (BOOL 1) of left bus line transmits to the right side by the ladder diagram. The line that transmits value is called as
'power flow line' or 'connection line' which is connected to a contact or coil. Power flow line has always a BOOL value and there
is only one power flow line in one rung that is connected by lines.
There are two types of a connection line of LD: horizontal connection line and vertical connection line.
No.
Symbol
Name
Description
4.4 Contact
'Contact' transmits a value to the right horizontal connection line, which is the result of logical AND operation of : the state of left
horizontal connection line, Boolean input/output related to the current contact or memory variables. It does not change the
value of variable related to the contact. Standard contact symbols are as follows.
Static contact
No
Symbol
Name
***
1
***
2
4-2
Description
Chapter 4
No
Symbol
***
Description
Positive Transition-Sensing
Contact
P
***
LD (Ladder Diagram)
4.5 Coil
The coil stores the state of the left connection line or the processing result of state transition in the associated BOOL variable.
Standard coil symbols are as follows.
Coils are placed in the right extreme of LD, and its right is a right bus line.
Momentary Coils
No.
Symbol
Name
***
1
( )
Coil
Description
Put the state of left connection line into the associated BOOL
variable (marked with ***).
Put the negated value of the state of left connection line into the
***
2
( )
Negated Coil
No.
Symbol
Name
Description
***
3
(S)
***
4
(R)
4-3
Chapter 4
LD (Ladder Diagram)
Symbol
***
(P)
***
6
(N)
Name
Description
If the state of its left connection that was off in the previous scan
is on in the current scan, the associated BOOL variable (marked
with ***) is on during the current scan.
If the state of its left connection that was on in the previous scan
is off in the current scan, the associated BOOL variable (marked
with ***) is on during the current scan.
The connection to a function or a function block is done by entering suitable data or variable to their input/output.
Example
CLK_U
SEL
EN
START
CTUD
CU
QU
FULL
CLK_D
CD
CD
STOP
CV
DOWN
EN0
ET
REG1
VAL1
IN0
RESET
VAL2
IN1
SWITCH
LD
PLAN
PV
Function
Function
block
To enable power flow inside function or function block, it must contain at least one BOOL-type input and BOOL-type output.
EN and ENO are BOOL-type input/output in a function while a data type of the first input and first output are BOOL-type in a
function block.
4-4
Chapter 4
LD (Ladder Diagram)
Example
ABS
LIMIT
EQ
EN
EN0
EN
EN0
EN
EN0
IN1
OUT
IN1
OUT
MN
OUT
IN
IN2
MX
T1
F1
C2
TOF
F_TRIG
CTU
IN
PT
CLK
ET
CU
R
Q
CV
PV
Conventionally, the ladder logic connecting a Boolean input to a function is called EN and the corresponding output Boolean is
called ENO, or enable out. If the value of EN is 1, then the function executes, otherwise it is do not execute. In all cases, the
value of EN copies the output ENO.
If an error occurs in the execution of a function, the function is responsible to set ENO to false (BOOL 0). EN is connected to
the power flow line but ENO does not have to be connected to it. However, when connecting the power flow line to the function
output instead of the ENO, the output data type must be a BOOL type.
When connecting the power flow line to the function output, do not connect anything to the ENO output. All the inputs of a
function are assigned by entering its data at the left side of the function. The output of a function is stored at the output variable
on its right side.
Assignment of input of a function block in a LD is the same as that of a function. The name of function block is the instance
name, which can be user-defined and must be unique to LD in which the function block appears.
You do not have to assign output variables because they are in the instance. If a function block is connected to the power flow
line, it is always executes because there is neither EN nor ENO in it.
Therefore, use Jump (-->>) to determine whether or not to execute a function block according to the logic result. When
connecting the power flow line to the function block, connect it to the input/output
4-5
Chapter 4
LD (Ladder Diagram)
Example
CLK
REG1
N
START
CON1
Line1
ABS
SWITCH
EN
DOWN
Line2
EMERGE
PLACE1
EN0
IN1
OUT
D0
Line3
PLACE2
Line4
PLACE1
IN
Line5
Line6
T2
TON
PT
TEST
START
Q
ET
Line7
PLACE2
CON2
STOP
Line8
You can place a function or a function block in any place of LD. You can create a program by connecting the power flow line to
the output and then insert the contact to it.
Example
ADD
CLK
RESET
EN
EN0
PLAN
IN1
OUT
DOWN
IN2
START
IN
4-6
PT
VAL2
N
D0
SWITCH
TEST
S1
P
STOP
CON2
VAL1
T4
TOF
Q
ET
S1
SR
REG1
CON1
Q1
CON2
REG1
EMERGE
( )
Chapter 4
LD (Ladder Diagram)
Example
Correct
EQ
EN
REG1
EQ
EN0
EN
EN0
STOP
D0
DOWN
IN1
START
OUT
D0
IN2
DOWN
IN1
OUT
IN2
SWITCH
START
EN0
EQ
EN
EN0
REG1
STOP
D0
DOWN
IN1
OUT
IN2
START
IN1
DOWN
OUT
IN2
Correct
4-7
Chapter 5
5.1 Functions
5.1.1 Type Conversion Function
It converts each input data type into an output data type.
Function Group
REAL_TO_***
LREAL_TO_***
SINT_TO_***
Function
REAL_TO_SINT
REAL_TO_INT
REAL_TO_DINT
REAL_TO_LINT
REAL_TO_USINT
REAL_TO_UINT
REAL_TO_UDINT
REAL_TO_ULINT
REAL_TO_DWORD
REAL_TO_LREAL
LREAL_TO_SINT
LREAL_TO_INT
LREAL_TO_DINT
LREAL_TO_LINT
LREAL_TO_USINT
LREAL_TO_UINT
LREAL_TO_UDINT
LREAL_TO_ULINT
LREAL_TO_LWORD
LREAL_TO_REAL
SINT_TO_INT
SINT_TO_DINT
SINT_TO_LINT
SINT_TO_USINT
SINT_TO_UINT
SINT_TO_UDINT
SINT_TO_ULINT
SINT_TO_BOOL
SINT_TO_BYTE
SINT_TO_WORD
SINT_TO_DWORD
REAL
REAL
REAL
REAL
REAL
REAL
REAL
REAL
REAL
REAL
LREAL
LREAL
LREAL
LREAL
LREAL
LREAL
LREAL
LREAL
LREAL
LREAL
SINT
SINT
SINT
SINT
SINT
SINT
SINT
SINT
SINT
SINT
SINT
SINT
INT
DINT
LINT
USINT
UINT
UDINT
ULINT
DWORD
LREAL
SINT
INT
DINT
LINT
USINT
UINT
UDINT
ULINT
LWORD
REAL
INT
DINT
LINT
USINT
UINT
UDINT
ULINT
BOOL
BYTE
WORD
DWORD
Remarks
-
5-1
Chapter 5
Function Group
INT_TO_***
DINT_TO_***
LINT_TO_***
USINT_TO_***
5-2
Function
SINT_TO_LWORD
SINT_TO_REAL
SINT_TO_LREAL
INT_TO_SINT
INT_TO_DINT
INT_TO_LINT
INT_TO_USINT
INT_TO_UINT
INT_TO_UDINT
INT_TO_ULINT
INT_TO_BOOL
INT_TO_BYTE
INT_TO_WORD
INT_TO_DWORD
INT_TO_LWORD
INT_TO_REAL
INT_TO_LREAL
DINT_TO_SINT
DINT_TO_INT
DINT_TO_LINT
DINT_TO_USINT
DINT_TO_UINT
DINT_TO_UDINT
DINT_TO_ULINT
DINT_TO_BOOL
DINT_TO_BYTE
DINT_TO_WORD
DINT_TO_DWORD
DINT_TO_LWORD
DINT_TO_REAL
DINT_TO_LREAL
LINT_TO_SINT
LINT_TO_INT
LINT_TO_DINT
LINT_TO_USINT
LINT_TO_UINT
LINT_TO_UDINT
LINT_TO_ULINT
LINT_TO_BOOL
LINT_TO_BYTE
LINT_TO_WORD
LINT_TO_DWORD
LINT_TO_LWORD
LINT_TO_REAL
LINT_TO_LREAL
USINT_TO_SINT
SINT
SINT
SINT
INT
INT
INT
INT
INT
INT
INT
INT
INT
INT
INT
INT
INT
INT
DINT
DINT
DINT
DINT
DINT
DINT
DINT
DINT
DINT
DINT
DINT
DINT
DINT
DINT
LINT
LINT
LINT
LINT
LINT
LINT
LINT
LINT
LINT
LINT
LINT
LINT
LINT
LINT
USINT
LWORD
REAL
LREAL
SINT
DINT
LINT
USINT
UINT
UDINT
ULINT
BOOL
BYTE
WORD
DWORD
LWORD
REAL
LREAL
SINT
INT
LINT
USINT
UINT
UDINT
ULINT
BOOL
BYTE
WORD
DWORD
LWORD
REAL
LREAL
SINT
INT
DINT
USINT
UINT
UDINT
ULINT
BOOL
BYTE
WORD
DWORD
LWORD
REAL
LREAL
SINT
Remarks
-
Chapter 5
Function Group
UINT_TO_***
UDINT_TO_***
ULINT_TO_***
Function
USINT_TO_INT
USINT_TO_DINT
USINT_TO_LINT
USINT_TO_UINT
USINT_TO_UDINT
USINT_TO_ULINT
USINT_TO_BOOL
USINT_TO_BYTE
USINT_TO_WORD
USINT_TO_DWORD
USINT_TO_LWORD
USINT_TO_REAL
USINT_TO_LREAL
UINT_TO_SINT
UINT_TO_INT
UINT_TO_DINT
UINT_TO_LINT
UINT_TO_USINT
UINT_TO_UDINT
UINT_TO_ULINT
UINT_TO_BOOL
UINT_TO_BYTE
UINT_TO_WORD
UINT_TO_DWORD
UINT_TO_LWORD
UINT_TO_REAL
UINT_TO_LREAL
UINT_TO_DATE
UDINT_TO_SINT
UDINT_TO_INT
UDINT_TO_DINT
UDINT_TO_LINT
UDINT_TO_USINT
UDINT_TO_UINT
UDINT_TO_ULINT
UDINT_TO_BOOL
UDINT_TO_BYTE
UDINT_TO_WORD
UDINT_TO_DWORD
UDINT_TO_LWORD
UDINT_TO_REAL
UDINT_TO_LREAL
UDINT_TO_TOD
UDINT_TO_TIME
ULINT_TO_SINT
ULINT_TO_INT
USINT
USINT
USINT
USINT
USINT
USINT
USINT
USINT
USINT
USINT
USINT
USINT
USINT
UINT
UINT
UINT
UINT
UINT
UINT
UINT
UINT
UINT
UINT
UINT
UINT
UINT
UINT
UINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
ULINT
ULINT
INT
DINT
LINT
UINT
UDINT
ULINT
BOOL
BYTE
WORD
DWORD
LWORD
REAL
LREAL
SINT
INT
DINT
LINT
USINT
UDINT
ULINT
BOOL
BYTE
WORD
DWORD
LWORD
REAL
LREAL
DATE
SINT
INT
DINT
LINT
USINT
UINT
ULINT
BOOL
BYTE
WORD
DWORD
LWORD
REAL
LREAL
TOD
TIME
SINT
INT
Remarks
5-3
Chapter 5
Function Group
BOOL_TO_***
BYTE_TO_***
WORD_TO_***
5-4
Function
ULINT_TO_DINT
ULINT_TO_LINT
ULINT_TO_USINT
ULINT_TO_UINT
ULINT_TO_UDINT
ULINT_TO_BOOL
ULINT_TO_BYTE
ULINT_TO_WORD
ULINT_TO_DWORD
ULINT_TO_LWORD
ULINT_TO_REAL
ULINT_TO_LREAL
BOOL_TO_SINT
BOOL_TO_INT
BOOL_TO_DINT
BOOL_TO_LINT
BOOL_TO_USINT
BOOL_TO_UINT
BOOL_TO_UDINT
BOOL_TO_ULINT
BOOL_TO_BYTE
BOOL_TO_WORD
BOOL_TO_DWORD
BOOL_TO_LWORD
BYTE_TO_SINT
BYTE_TO_INT
BYTE_TO_DINT
BYTE_TO_LINT
BYTE_TO_USINT
BYTE_TO_UINT
BYTE_TO_UDINT
BYTE_TO_ULINT
BYTE_TO_BOOL
BYTE_TO_WORD
BYTE_TO_DWORD
BYTE_TO_LWORD
WORD_TO_SINT
WORD_TO_INT
WORD_TO_DINT
WORD_TO_LINT
WORD_TO_USINT
WORD_TO_UINT
WORD_TO_UDINT
WORD_TO_ULINT
WORD_TO_BOOL
WORD_TO_BYTE
ULINT
ULINT
ULINT
ULINT
ULINT
ULINT
ULINT
ULINT
ULINT
ULINT
ULINT
ULINT
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BYTE
BYTE
BYTE
BYTE
BYTE
BYTE
BYTE
BYTE
BYTE
BYTE
BYTE
BYTE
WORD
WORD
WORD
WORD
WORD
WORD
WORD
WORD
WORD
WORD
DINT
LINT
USINT
UINT
UDINT
BOOL
BYTE
WORD
DWORD
LWORD
REAL
LREAL
SINT
INT
DINT
LINT
USINT
UINT
UDINT
ULINT
BYTE
WORD
DWORD
LWORD
SINT
INT
DINT
LINT
USINT
UINT
UDINT
ULINT
BOOL
WORD
DWORD
LWORD
SINT
INT
DINT
LINT
USINT
UINT
UDINT
ULINT
BOOL
BYTE
Remarks
-
Chapter 5
Function Group
DWORD_TO_***
LWORD_TO_***
TIME_TO_***
DATE_TO_***
Function
WORD_TO_DWORD
WORD_TO_LWORD
WORD_TO_DATE
DWORD_TO_SINT
DWORD_TO_INT
DWORD_TO_DINT
DWORD_TO_LINT
DWORD_TO_USINT
DWORD_TO_UINT
DWORD_TO_UDINT
DWORD_TO_ULINT
DWORD_TO_BOOL
DWORD_TO_BYTE
DWORD_TO_WORD
DWORD_TO_LWORD
DWORD_TO_REAL
DWORD_TO_TIME
DWORD_TO_TOD
LWORD_TO_SINT
LWORD_TO_INT
LWORD_TO_DINT
LWORD_TO_LINT
LWORD_TO_USINT
LWORD_TO_UINT
LWORD_TO_UDINT
LWORD_TO_ULINT
LWORD_TO_BOOL
LWORD_TO_BYTE
LWORD_TO_WORD
LWORD_TO_DWORD
LWORD_TO_LREAL
LWORD_TO_DT
WORD
WORD
WORD
DWORD
DWORD
DWORD
DWORD
DWORD
DWORD
DWORD
DWORD
DWORD
DWORD
DWORD
DWORD
DWORD
DWORD
DWORD
LWORD
LWORD
LWORD
LWORD
LWORD
LWORD
LWORD
LWORD
LWORD
LWORD
LWORD
LWORD
LWORD
LWORD
DWORD
LWORD
DATE
SINT
INT
DINT
LINT
USINT
UINT
UDINT
ULINT
BOOL
BYTE
WORD
LWORD
REAL
TIME
TOD
SINT
INT
DINT
LINT
USINT
UINT
UDINT
ULINT
BOOL
BYTE
WORD
DWORD
LREAL
DT
TIME_TO_UDINT
TIME_TO_DWORD
DATE_TO_UINT
DATE_TO_WORD
TIME
TIME
DATE
DATE
UDINT
DWORD
UINT
WORD
TOD_TO_UDINT
TOD
UDINT
TOD_TO_DWORD
TOD
DWORD
DT_TO_LWORD
DT
LWORD
DT_TO_DATE
DT
DATE
DT_TO_TOD
DT
TOD
TOD_TO_***
DT_TO_***
Remarks
-
5-5
Chapter 5
Function
1
2
ABS
SQRT
3
4
5
LN
LOG
EXP
6
7
8
9
10
11
SIN
COS
TAN
ASIN
ACOS
ATAN
Function
General Function
Absolute value operation
Square root operation
Logarithm
Natural logarithm operation
Common logarithm Base to 10 operation
Natural exponential operation
Trigonometric function
Sine operation
Cosine operation
Tangent operation
Arc sine operation
Arc Cosine operation
Arc Tangent operation
Remarks
-
Function
Description
Operation function whose input number (n) can be extended up to 8.
ADD
Addition (OUT <= IN1 + IN2 + ... + INn)
MUL
Multiplication (OUT <= IN1 * IN2 * ... * INn)
Operation function of which input number is fixed.
SUB
Subtraction (OUT <= IN1 - IN2)
DIV
Division (OUT <= IN1 / IN2)
MOD
Calculate remainder (OUT <= IN1 Modulo IN2)
IN2
EXPT
Exponential operation (OUT <= IN1 )
MOVE
Copy data (OUT <= IN)
Remarks
-
5-6
No.
Function
Description
DEG
RAD
Remarks
-
Chapter 5
Function
Description
SHL
SHR
ROL
ROR
Remarks
-
Function
AND
Logical AND (OUT <= IN1 AND IN2 AND ... AND INn)
OR
XOR
Exclusive OR (OUT <= IN1 XOR IN2 XOR ... XOR INn)
NOT
XNR
Exclusive logic AND (OUT <= IN1 XNR IN2 XNR ... XNR INn)
Remarks
-
Function
MAX
MIN
LIMIT
MUX
Remarks
-
Function
Description
SWAP
XCHG
Remarks
-
5-7
Chapter 5
Function
GT
GE
EQ
LE
LT
NE
Remarks
-
OUT <= (IN1>IN2) & (IN2>IN3) & ... & (INn-1 > INn)
Greater than or equal to comparison
OUT <= (IN1>=IN2) & (IN2>=IN3) & ... & (INn-1 >= INn)
Equal to comparison
OUT <= (IN1=IN2) & (IN2=IN3) & ... & (INn-1 = INn)
'Less than or equal to' comparison
OUT <= (IN1<=IN2) & (IN2<=IN3) & ... & (INn-1 <= INn)
Less than comparison
OUT <= (IN1<IN2) & (IN2<IN3) & ... & (INn-1 < INn)
Not equal to comparison
OUT <= (IN1<>IN2) & (IN2<>IN3) & ... & (INn-1 <> INn)
Function
Description
ADD_TIME
SUB_TIME
SUB_DATE
SUB_TOD
SUB_DT
CONCAT_TIME
Remarks
-
5-8
Function
Description
BIT_BYTE
BYTE_BIT
BYTE_WORD
WORD_BYTE
WORD_DWORD
DWORD_WORD
DWORD_LWORD
Remarks
-
Chapter 5
No.
Function
Description
LWORD_DWORD
DEC
10
DECO
11
ENCO
12
INC
Remarks
-
No.
Function Block
Description
SR
RS
Remarks
-
Function Block
Description
R_TRIG
F_TRIG
FF
Remarks
-
5.2.3 Counter
No.
1
Function Block
CTU_***
CTD_***
CTUD_***
CTR
Description
Up Counter
Remarks
-
INT,DINT,LINT,UINT,UDINT,ULINT
Down Counter
INT,DINT,LINT,UINT,UDINT,ULINT
Up Down Counter
INT,DINT,LINT,UINT,UDINT,ULINT
Ring Counter
5-9
Chapter 5
5.2.4 Timer
No.
Function Block
Description
TP
TON
On-Delay Timer
TOF
Off-Delay Timer
TMR
Integrating Timer
TP_RST
TRTG
TOF_RST
TON_UINT
TOF_UINT
10
TP_UINT
11
TMR_UINT
12
TMR_FLK
Blink timer
13
TRTG_UINT
Pulse Timer
Remarks
-
TP with reset
Retriggerable Timer
Function Block
Description
FOR
NEXT
BREAK
CALL
SBRT
RET
RETURN
JMP
INIT_DONE
END
5-10
Remarks
-
Chapter 5
Function Block
Description
Remarks
MC_Power
Servo on/off
MC_Home
MC_Stop
Stop immediately
MC_Halt
Stop
MC_MoveAbsolute
MC_MoveRelative
MC_MoveAdditive
MC_MoveVelocity
MC_MoveContinuousAbsolute
10
MC_MoveContinuousRelative
11
MC_TorqueControl
12
MC_SetPosition
13
MC_SetOverride
Speed/Acceleration override
14
MC_ReadParameter
Reads parameter
15
MC_WriteParameter
Writes parameter
16
MC_Reset
17
MC_TouchProbe
18
MC_AbortTrigger
19
LS_Connect
20
LS_DisConnect
21
LS_ReadServoParameter
22
LS_WriteServoParameter
23
LS_EncoderPreset
Encoder preset
24
LS_Jog
JOG operation
MC_CamIn
CAM operation
26
MC_CamOut
27
MC_GearIn
28
MC_GearOut
28
MC_GearInPos
MC_AddAxisToGroup
Chapter 5
No.
5-12
Function Block
Description
Remarks
30
MC_RemoveAxisFromGroup
31
MC_UngroupAllAxes
32
MC_GroupEnable
Enable a group
33
MC_GroupDisable
Disable a group
34
MC_GroupHome
35
MC_GroupSetPosition
36
MC_GroupStop
37
MC_GroupHalt
Group stop
38
MC_GroupReset
39
MC_MoveLinearAbsolute
40
MC_MoveLinearRelative
41
MC_MoveCircularAbsolute
42
MC_MoveCircularRelative
Group incremental
operation
position
linear
interpolation
Chapter 6
Basic Functions
6-1
Chapter 6
Basic Functions
1.1. ABS
ABS
Availability
XGF-M32E
Flags
_ERR, _LER
Function
Description
Input
ABS
BOOL
EN
ENO
BOOL
ANY_NUM
IN
OUT
ANY_NUM
Output ENO: 1
OUT: absolute value
UINT
UDINT
ULINT
REAL
LREAL
Function
1.
2.
Flag
Flag
_ERR
6-2
Description
If IN value is (-)min value, _ERR and _LER flags are set.
ex) if data type is SINT and IN and value is -128, an error is activated.
DT
USINT
TOD
LINT
DATE
DINT
TIME
INT
LWORD
SINT
IN
OUT
DWORD
WORD
BYTE
Variable
ANY type variable
BOOL
Chapter 6
Basic Functions
Program Example
1. LD
2. ST
ABS_Value := ABS(EN:=%GX0, IN:=Value);
(1)
(2)
(3)
1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1
(16#FFF9)
0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1
(16#0007)
6-3
Chapter 6
Basic Functions
1.2. ACOS
ACOS
Availability
XGF-M32E
Flags
_ERR, _LER
Function
Description
Input
ACOS
BOOL
ANY_REAL
EN
IN
ENO
OUT
BOOL
ANY_REAL
Function
It converts input IN into its Arc Cosine value and produces output OUT. The output range is between 0 and .
OUT = ACOS (IN)
Flag
Flag
_ERR
6-4
Description
Unless an IN value is between -1.0 and 1.0, _ERR, _LER flags are set.
DT
TOD
DATE
TIME
LREAL
IN
OUT
REAL
ULINT
UDINT
UINT
USINT
LINT
DINT
INT
SINT
LWORD
DWORD
WORD
BYTE
Variable
ANY type variable
BOOL
Chapter 6
Basic Functions
Program Example
1. LD
2. ST
(1) If the transition condition (%IX0.1.3) is on, Arc Cosine operation function, ACOS executes
(2) If INPUT is 0.8660... (
6-5
Chapter 6
Basic Functions
1.3. ADD
Addition
ADD
Availability
XGF-M32E
Flags
_ERR, _LER
Function
Description
Input EN: executes the function in case of 1
IN1: value to be add
IN2: value to add
ADD
BOOL
EN
ENO
BOOL
ANY_NUM
IN1
OUT
ANY_NUM
ANY_NUM
IN2
UINT
UDINT
ULINT
REAL
LREAL
DT
USINT
TOD
LINT
DATE
DINT
TIME
INT
LWORD
WORD
SINT
IN1
IN2
OUT
DWORD
BYTE
Variable
BOOL
Function
1.
It adds input variables up (IN1, IN2, ..., and INn, n: number of inputs, up to 8) and produces output ,OUT.
OUT = IN1 + IN2 + ... + INn
Flag
Flag
_ERR
Description
When the output value is out of its data type, _ERR, _LER flags are set.
If REAL (or LREAL) type operation exceeds the max. or min. value of REAL (or LREAL) in the middle of operation
because it performs operation sequentially from IN1 to IN8, _ERR, _LER flag are set and the result is unlimited or
abnormal value.
(1.#INF000000000000e+000, 1.#SNAN00000000000e+000, 1.#QNAN00000000000e+000).
6-6
Chapter 6
Basic Functions
Program Example
1. LD
2. ST
0 0 0 0 0 0 0 1 0 0 1 0 1 1 0 0
+(ADD)
0 0 0 0 0 0 0 0 1 1 0 0 1 0 0 0
+(ADD)
0 0 0 0 0 0 0 0 0 1 1 0 0 1 0 0
0 0 0 0 0 0 1 0 0 1 0 1 1 0 0 0
6-7
Chapter 6
Basic Functions
1.4. ADD_TIME
Time addition
ADD_TIME
Availability
XGF-M32E
Flags
_ERR, _LER
Function
Description
Input
ADD_TIME
BOOL
TIME,TOD,DT
TIME
EN
IN1
IN2
ENO
OUT
BOOL
TIME,TOD,DT
Output
TOD
DT
IN1
OUT
DATE
TIME
LREAL
REAL
ULINT
UDINT
UINT
USINT
LINT
DINT
INT
SINT
LWORD
DWORD
WORD
BYTE
Variable
ANY type variable
BOOL
also TIME_OF_DAY.
Function
1.
2.
3.
Flag
Flag
Description
If an output value is out of range of related data type, _ERR, _LER flag are set. An error occurs:
1) When the result of adding the time and the time is out of range of TIME data type :
_ERR
T#49D17H2M47S295MS
2) The result of adding TOD (Time of Day) and the time exceeds 24h;
3) The result of adding the date and DT (Date and the Time of Day) exceeds the year, 2163.
6-8
Chapter 6
Basic Functions
Program Example
1. LD
2. ST
6-9
Chapter 6
Basic Functions
1.5. AND
AND
Availability
XGF-M32E
Flags
Function
Description
Input EN: executes the function in case of 1
IN1: input 1
IN2: input 2
AND
BOOL
ANY_BIT
ANY_BIT
ENO
OUT
EN
IN1
IN2
BOOL
ANY_BIT
Function
It performs a logical AND operation on the input variables by bit and produces output ,OUT.
IN1
IN2
6-10
DT
TOD
DATE
TIME
LREAL
REAL
ULINT
UDINT
UINT
USINT
LWORD
LINT
DWORD
DINT
WORD
INT
BYTE
IN1
IN2
OUT
SINT
Variable
BOOL
Chapter 6
Basic Functions
Program Example
1. LD
2. ST
ST doesnt support AND.
In case of AND2_BYTE
(1) If the transition condition (%IX0.1.1) is on, the AND function executes.
(2) If INI = %MB10 and IN2 = ABC, the result of AND is shown in OUT (%DB0).
6-11
Chapter 6
Basic Functions
1.6. ASIN
ASIN
Availability
XGF-M32E
Flags
_ERR, _LER
Function
Description
Input
ASIN
BOOL
ANY_REAL
EN
IN
ENO
OUT
BOOL
ANY_REAL
Function
It produces an output (Arc Sine value) of IN. The output value is between -/2 and /2.
OUT = ASIN (IN)
Error
Flag
_ERR
6-12
Description
If an input value exceeds the range from -1.0 to 1.0, _ERR and _LER flags are set.
DT
TOD
DATE
LREAL
TIME
REAL
IN
OUT
ULINT
UDINT
UINT
USINT
LINT
DINT
INT
SINT
LWORD
DWORD
WORD
BYTE
Variable
ANY type variable
BOOL
Chapter 6
Basic Functions
Program Example
1. LD
2. ST
6-13
Chapter 6
Basic Functions
1.7. ATAN
ATAN
Availability
XGF-M32E
Flags
Function
Description
Input EN: executes the function in case of 1
IN: Input value of Arc Tangent operation
ATAN
BOOL
ANY_REAL
EN
IN
ENO
OUT
BOOL
ANY_REAL
Function
It produces an output (Arc Tangent value) of IN value. The output value is between -/2 and /2.
OUT = ATAN (IN)
Program Example
1. LD
2. ST
RESULT := ATAN(EN:=%GX0, IN1:= INPUT);
(1) If the transition condition (%GX0) is on, ATAN function executes.
(2) If INPUT = 1.0, then output RESULT will be 0.7853... ( /4 rad = 45).
6-14
DT
TOD
DATE
TIME
LREAL
ULINT
UDINT
REAL
IN
OUT
UINT
USINT
LINT
DINT
INT
SINT
LWORD
DWORD
WORD
BYTE
Variable
ANY type variable
BOOL
Chapter 6
Basic Functions
1.8. BOOL_TO_***
BOOL_TO_***
Availability
XGF-M32E
Flags
Function
Description
Input EN: executes the function in case of 1
BOOL_TO_***
BOOL
*ANY_BIT
ANY_INT
STRING
UINT
UDINT
ULINT
DT
USINT
TOD
LINT
DATE
DINT
TIME
INT
LREAL
SINT
REAL
LWORD
OUT
DWORD
Variable
WORD
ENO
OUT
BYTE
EN
IN
BOOL
BOOL
BOOL
Function
It converts input IN type and produces output ,OUT.
Function
Output type
Description
BOOL_TO_SINT
SINT
BOOL_TO_INT
INT
BOOL_TO_DINT
DINT
BOOL_TO_LINT
LINT
BOOL_TO_USINT
USINT
BOOL_TO_UINT
UINT
BOOL_TO_UDINT
UDINT
BOOL_TO_ULINT
ULINT
BOOL_TO_BYTE
BYTE
BOOL_TO_WORD
WORD
BOOL_TO_DWORD
DWORD
BOOL_TO_LWORD
LWORD
It converts BOOL into the output data type whose upper bits are
filled with 0.
6-15
Chapter 6
Basic Functions
Program Example
1. LD
BOOL_TO_***
%MX0
BOOL_VAL
(BOOL)
EN
ENO
IN
OUT
OUT_VAL
(BYTE)
2. ST
1
(BOOL_TO_SINT)
6-16
0 0 0 0 0 0 0 1
Chapter 6
Basic Functions
1.9. BTYE_TO_***
BYTE_TO_***
Availability
XGF-M32E
Flags
Function
Description
Input EN: executes the function in case of 1
BYTE_TO_***
DT
TOD
DATE
ULINT
TIME
UDINT
LREAL
UINT
REAL
USINT
OUT
Variable
ANY type variable
DINT
*ANY_BIT
ANY_INT
STRING
INT
OUT
SINT
IN
LWORD
BYTE
DWORD
BOOL
WORD
ENO
BYTE
EN
BOOL
BOOL
Output type
Description
BYTE _TO_SINT
SINT
Converts into SINT type without changing its internal bit array.
BYTE _TO_INT
INT
BYTE _TO_DINT
DINT
BYTE _TO_LINT
LINT
BYTE _TO_USINT
USINT
Converts into USINT type without changing its internal bit array.
BYTE _TO_UINT
UINT
BYTE _TO_UDINT
UDINT
BYTE _TO_ULINT
ULINT
BYTE _TO_BOOL
BOOL
BYTE _TO_WORD
WORD
BYTE _TO_DWORD
DWORD
BYTE _TO_LWORD
LWORD
6-17
Chapter 6
Basic Functions
Program Example
1. LD
BYTE_TO_***
%MX10
IN_VAL
EN
ENO
IN
OUT
OUT_VAL
2. ST
ST language doesnt support BYTE_TO_***
In case of BYTE_TO_SINT
(BYTE_TO_***)
OUTPUT (OUT) : OUT_VAL (SINT) = 24
6-18
Chapter 6
Basic Functions
1.10. CONCAT_TIME
CONCAT_TIME
Availability
XGF-M32E
Flags
Function
Description
Input
BOOL
CONCAT_TIME
EN
ENO
BOOL
DATA
IN1
TIME OF DAY
IN2
OUT
1. LD
%MX1
CONCAT_TIME
EN
ENO
START_DATE
IN1
START_TIME
IN2
OUT
START_DT
2. ST
START_DT := CONCAT_TIME(EN:=%MX1, IN1:= START_DATE, IN2:= START_TIME);
(1)
(2)
6-19
Chapter 6
Basic Functions
1.11. COS
Cosine operation
COS
Availability
XGF-M32E
Flags
Function
Description
Input
COS
BOOL
ANY_REAL
EN
IN
ENO
OUT
BOOL
ANY_REAL
Function
It produces INs Cosine operation value.
OUT = COS (IN)
Program Example
1. LD
6-20
DT
TOD
DATE
TIME
LREAL
ULINT
UDINT
UINT
USINT
LINT
DINT
INT
SINT
LWORD
DWORD
REAL
IN
OUT
WORD
BYTE
Variable
ANY type variable
BOOL
Chapter 6
Basic Functions
2. ST
3/ 2
3 / 2 ).
= 0.866
0.5235
(COS)
6-21
Chapter 6
Basic Functions
1.12. DATE_T0_***
DATE_TO_***
Availability
XGF-M32E
Flags
Function
Description
Input
DATE_TO_***
BOOL
DATE
EN
IN
ENO
OUT
BOOL
WORD,UINT
STRING
Output
IN
Function
It converts an input IN type and produces output, OUT.
Function
6-22
Output type
Description
DATE_TO_UINT
UINT
DATE_TO_WORD
WORD
DT
TOD
DATE
TIME
LREAL
REAL
ULINT
UDINT
UINT
USINT
LINT
DINT
INT
SINT
LWORD
DWORD
WORD
Variable
BYTE
BOOL
Chapter 6
Basic Functions
Program Example
1. LD
DATE_TO
_***
EN
ENO
%MX0
IN_VAL
IN
OUT
OUT_VAL
2. ST
ST language doesnt support DATE_TO_****
(1) If the transition condition (%MX0) is on, DATE_TO_*** function executes.
(2) If IN_VAL (DATE) = D#2013-06-18, OUT_VAL (UNIT) = 10761
6-23
Chapter 6
1.13.
Basic Functions
DINT_TO_***
DINT_TO_***
Availability
XGF-M32E
Flags
_ERR, _LER
Function
Description
Input
DINT_TO_***
BOOL
DINT
EN
IN
ENO
OUT
DT
TOD
DATE
TIME
LREAL
REAL
ULINT
INT
UDINT
SINT
UINT
LWORD
USINT
DWORD
LINT
WORD
OUT
DINT
Variable
BYTE
BOOL
Function
It converts Input IN type and produces output, OUT.
6-24
Function
Output type
Description
DINT_TO_SINT
SINT
DINT_TO_INT
INT
DINT_TO_LINT
LINT
DINT_TO_USINT
USINT
DINT_TO_UINT
UINT
DINT_TO_UDINT
UDINT
DINT_TO_ULINT
ULINT
DINT_TO_BOOL
BOOL
DINT_TO_BYTE
BYTE
If input is -128
Except this, an error occurs.
If input is -32,768
32normal conversion.
,767,
,
normal
255 conversion.
65normal conversion.
,535,
2
,147,483,647,
normal conversion.
2
,147,483,647,
normal conversion.
Chapter 6
Basic Functions
Function
Output type
DINT_TO_WORD
WORD
DINT_TO_DWORD
DWORD
Converts into DWORD type without changing the internal bit array.
DINT_TO_LWORD
LWORD
DINT_TO_REAL
REAL
DINT_TO_LREAL
LREAL
Description
Takes the low 16 bit and converts into WORD type.
Flag
Flag
Description
If a conversion error occurs, _ERR, _LER flags are set.
_ERR
When an error occurs, it takes as many lower bits as the bit number of the output type and produces
an output without changing the internal bit array.
Program Example
1. LD
DINT_TO
_***
%MX1
DINT_VAL
EN
ENO
IN
OUT
SINT_VAL
2. ST
ST language doesnt support DINT_TO_***
In case of DINT_TO_SINT
6-25
Chapter 6
Basic Functions
1.14. DIV
Division
DIV
Availability
XGF-M32E
Flags
_ERR, _LER
Function
Description
Input EN: executes the function in case of 1
IN1: the value to be divided (dividend)
DIV
BOOL
EN
ENO
BOOL
ANY_NUM
IN1
OUT
ANY_NUM
ANY_NUM
IN2
UINT
UDINT
ULINT
REAL
LREAL
DT
USINT
TOD
LINT
DATE
DINT
TIME
INT
IN1
IN2
OUT
SINT
LWORD
WORD
DWORD
BYTE
Variable
BOOL
Function
It divides IN1by IN2 and produces an output omitting decimal fraction from the quotient.
OUT = IN1/IN2
IN1
IN2
OUT
-2
-3
-7
-3
-7
-2
Remarks
Error
Flag
6-26
Flag
Description
_ERR
If the value to divide (divisor) is 0, and the results exceeds the maximum value of each type, _ERR,
_LER flags are set.
Chapter 6
Basic Functions
Program Example
1. LD
2. ST
/(DIV)
(IN2): VALUE2(INT) = 100(16#0064)
6-27
Chapter 6
Basic Functions
1.15. DIV_
1.16. DT_TO_***
DT type conversion
DT_TO_***
Availability
XGF-M32E
Flags
_ERR, _LER
Function
Description
Input
DT_TO_***
BOOL
EN
ENO
BOOL
DT
IN
OUT
LWORD,DATE
TOD,STRING
Output
DT
TOD
TIME
LREAL
REAL
DATE
OUT
ULINT
UDINT
UINT
USINT
LINT
DINT
INT
SINT
LWORD
DWORD
WORD
Variable
BYTE
BOOL
Function
It converts Input IN type and produces output, OUT.
6-28
Function
Output type
Description
DT_TO_LWORD
LWORD
DT_TO_DATE
DATE
DT_TO_TOD
TOD
Chapter 6
Basic Functions
Program Example
1. LD
%MX20
DT_TO_***
EN
ENO
IN_VAL
IN
OUT
OUT_VAL
2. ST
ST language doesnt support DT_TO_***
In case of DT_TO_DATE
6-29
Chapter 6
Basic Functions
1.17. DWORD_TO_***
DWORD_TO_***
Availability
XGF-M32E
Flags
_ERR, _LER
Function
Description
Input EN: executes the function in case of 1
DWORD_TO_***
BOOL
DWORD
ENO
OUT
EN
IN
BOOL
*ANY
ULINT
REAL
DT
UDINT
TOD
UINT
DATE
USINT
TIME
LINT
LREAL
DINT
INT
SINT
LWORD
WORD
OUT
DWORD
Variable
BYTE
BOOL
Function
It converts Input IN type and produces output. OUT.
Function
6-30
Output type
Description
DWORD_TO_SINT
SINT
DWORD_TO_INT
INT
DWORD_TO_DINT
DINT
Converts into DINT type without changing the internal bit array.
DWORD_TO_LINT
LINT
DWORD_TO_USINT
USINT
DWORD_TO_UINT
UINT
DWORD_TO_UDINT
UDINT
Converts into UDINT type without changing the internal bit array.
DWORD_TO_ULINT
ULINT
DWORD_TO_BOOL
BOOL
DWORD_TO_BYTE
BYTE
DWORD_TO_WORD
WORD
DWORD_TO_LWORD
LWORD
DWORD_TO_REAL
REAL
Converts into REAL type without changing the internal bit array.
DWORD_TO_TIME
TIME
Converts into TIME type without changing the internal bit array.
Chapter 6
Function
Output type
Basic Functions
Description
Converts into TOD type without changing the internal bit array.
DWORD_TO_TOD
TOD
_LER flags are set and it is alternately converted within the range of
TOD.
Program Example
1. LD
DWORD_TO
_***
%MX0
IN_VAL
EN
ENO
IN
OUT
OUT_VAL
2. ST
ST language doesnt support DWORD_TO_***
In case of DWORD_TO_TOD
6-31
Chapter 6
Basic Functions
1.18. EQ
Equal to comparison
EQ
Availability
XGF-M32E
Flags
Function
Description
Input
EQ
BOOL
ANY
ANY
EN
IN1
IN2
ENO
OUT
BOOL
BOOL
WORD
DWORD
LWORD
SINT
INT
DINT
LINT
USINT
UINT
UDINT
ULINT
REAL
LREAL
TIME
DATE
TOD
DT
IN1
IN2
BYTE
Variable
ANY type variable
BOOL
Function
1.
2.
Program Example
1. LD
6-32
Chapter 6
Basic Functions
2. ST
6-33
Chapter 6
Basic Functions
1.19. EXP
EXP operation
EXP
Availability
XGF-M32E
Flags
_ERR, _LER
Function
Description
Input
EXP
EN
IN
BOOL
ANY_REAL
ENO
OUT
BOOL
ANY_REAL
Output
Function
It calculates the natural exponent with exponent IN and produces output, OUT.
OUT =
IN
Error
Flag
_ERR
6-34
Description
If output is out of the range of a type, _ERR and _LER flags are set.
DT
TOD
DATE
LREAL
TIME
REAL
IN
OUT
ULINT
UDINT
UINT
USINT
LINT
DINT
INT
SINT
LWORD
DWORD
WORD
BYTE
Variable
ANY type variable
BOOL
Chapter 6
Basic Functions
Program Example
1. LD
2. ST
RESULT = e
6-35
Chapter 6
Basic Functions
1.20. EXPT
Exponential operation
EXPT
Availability
XGF-M32E
Flags
_ERR, _LER
Function
Description
Input EN: executes the function in case of 1
IN1: real number
EXPT
IN2: exponent
EN
ENO
BOOL
ANY_REAL
IN1
OUT
ANY_REAL
ANY_REAL
IN2
BOOL
Function
It calculates IN1 with exponent IN2 and produces output, OUT.
IN2
OUT = IN1
Error
Flag
_ERR
6-36
Description
If an output is out of range of related data type, _ERR and _LER flags are set.
DT
TOD
DATE
TIME
LREAL
ULINT
UDINT
REAL
IN1
IN2
OUT
UINT
USINT
LINT
DINT
INT
SINT
LWORD
WORD
DWORD
BYTE
Variable
BOOL
Chapter 6
Basic Functions
Program Example
1. LD
2. ST
(1) If the transition condition %GX0) is on, EXPT exponential function executes.
3
(2) If input INPUT1= 1.5, INPUT2 = 3, output RESULT = 1.5 = 1.5 1.5 1.5 = 3.375.
3
3.375 = 1.5
6-37
Chapter 6
Basic Functions
1.21. FI
1.22. GE
GE
Availability
XGF-M32E
Flags
Function
Description
Input
GE
BOOL
ANY
ANY
EN
IN1
IN2
ENO
OUT
BOOL
BOOL
WORD
DWORD
LWORD
SINT
INT
DINT
LINT
USINT
UINT
UDINT
ULINT
REAL
LREAL
TIME
DATE
TOD
DT
IN1
IN2
BYTE
Variable
ANY type variable
BOOL
Function
If IN1 IN2 IN3... INn (n: number of inputs), an output is 1.
Otherwise it is 0.
Program Example
1. LD
6-38
Chapter 6
Basic Functions
2. ST
6-39
Chapter 6
Basic Functions
1.23. GT
GT
Availability
XGF-M32E
Flags
Function
Description
Input
GT
BOOL
ANY
ANY
EN
IN1
IN2
ENO
OUT
BOOL
BOOL
WORD
DWORD
LWORD
SINT
INT
DINT
LINT
USINT
UINT
UDINT
ULINT
REAL
LREAL
TIME
DATE
TOD
DT
IN1
IN2
BYTE
Variable
ANY type variable
BOOL
Function
1.
2.
If IN1 > IN2 > IN3... > INn (n: number of inputs), an output is 1.
Otherwise it is 0.
Program Example
1. LD
2. ST
%MX0 := GT(EN:= %GX0, IN1:= VALUE1, IN2:= VALUE2, IN3:= VALUE3);
(1) If the transition condition (%GX0) is on, GT function executes.
(2) If input variable VALUE1 = 300, VALUE2 = 200, and VALUE3 = 100, comparison result is VALUE1 > VALUE2 >
VALUE3. The output % MX0 = 1.
6-40
Chapter 6
Basic Functions
1.24. IN T_TO_***
INT_TO_***
Availability
XGF-M32E
Flags
_ERR, _LER
Function
Description
Input
INT_TO_***
BOOL
INT
EN
IN
ENO
OUT
BOOL
*ANY
DT
TOD
DATE
LREAL
TIME
REAL
ULINT
UDINT
UINT
SINT
USINT
LWORD
LINT
DWORD
DINT
WORD
OUT
INT
Variable
BYTE
BOOL
*ANY: exclude INT, TIME, DATE, TOD and DT from ANY type.
Function
It converts input IN type and produces output, OUT.
Function
Output Type
Description
INT_TO_SINT
SINT
INT_TO_DINT
DINT
INT_TO_LINT
LINT
INT_TO_USINT
INT_TO_UINT
USINT
UINT
32767, normal
Otherwise
an errorconversion.
occurs.
INT_TO_UDINT
UDINT
h INT_TO_ULINT
ULINT
INT_TO_BOOL
BOOL
INT_TO_BYTE
BYTE
INT_TO_WORD
WORD
Converts into WORD type without changing the internal bit array.
INT_TO_DWORD
DWORD
INT_TO_LWORD
LWORD
INT_TO_REAL
REAL
INT_TO_LREAL
LREAL
6-41
Chapter 6
Basic Functions
Flag
Flag
Description
_ERR
Program Example
1. LD
INT_TO_***
EN
ENO
%MX0
IN_VAL
IN
OUT
OUT_WORD
2. ST
0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0
(INT_TO_WORD)
6-42
0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0
Chapter 6
Basic Functions
1.25. LE
LE
Availability
XGF-M32E
Flags
Function
Description
Input
LE
BOOL
ANY
ANY
EN
IN1
IN2
ENO
OUT
BOOL
BOOL
WORD
DWORD
LWORD
SINT
INT
DINT
LINT
USINT
UINT
UDINT
ULINT
REAL
LREAL
TIME
DATE
TOD
DT
IN1
IN2
BYTE
Variable
ANY type variable
BOOL
Function
1.
2.
Program Example
1. LD
6-43
Chapter 6
Basic Functions
2. ST
6-44
Chapter 6
Basic Functions
1.26. LIMIT
LIMIT
Availability
XGF-M32E
Flags
Function
Description
Input
LIMIT
BOOL
ANY
ANY
ANY
EN
MN
IN
MX
ENO
OUT
BOOL
ANY
BYTE
WORD
DWORD
LWORD
SINT
INT
DINT
LINT
USINT
UINT
UDINT
ULINT
REAL
LREAL
TIME
DATE
TOD
DT
Variable
BOOL
MN
IN
MX
OUT
Function
1.
2.
3.
If input IN value is between MN and MX, the IN is an output. That is, if MN IN MX, OUT = IN.
If input IN value is less than MN, MN is an output. That is, if IN < MN, OUT = MN.
If input IN value is greater than MX, MX is an output. That is, if IN > MX, OUT = MX.
Program Example
1. LD
%MX0
LIMIT
EN
ENO
LIMIT_LOW
MN
IN_VALUE
IN
LIMIT_HIGH
MX
OUT
OUT_VAL
6-45
Chapter 6
Basic Functions
2. ST
OUT_VAL := LIMIT(EN:= %MX0, MX:= LIMIT_LOW, IN:= IN_VALUE, MX:= LIMIT_HIGH);
LIMIT_LOW
IN_VALUE
LIMIT_HIGH
OUT_VAL
1000
2000
3000
2000
1000
500
3000
1000
1000
4000
3000
3000
1000
4000
(MX) : LIMIT_HIGH(INT) =
3000
(LIMIT)
6-46
3000
Chapter 6
Basic Functions
1.27. LINT_TO_***
LINT_TO_***
Availability
XGF-M32E
Flags
_ERR, _LER
Function
Description
Input
LINT_TO_***
BOOL
LINT
EN
IN
ENO
OUT
BOOL
*ANY
DT
TOD
DATE
TIME
LREAL
DINT
REAL
INT
ULINT
SINT
UDINT
LWORD
UINT
DWORD
USINT
WORD
OUT
LINT
Variable
BYTE
BOOL
*ANY: exclude LINT, TIME, DATE, TOD, and DT from ANY type.
Function
It converts input IN type and produces output, OUT.
Function
Output type
LINT_TO_SINT
SINT
LINT_TO_INT
INT
Description
127, n
If input is -128
If input is 32,768
31
31
LINT_TO_DINT
DINT
LINT_TO_USINT
USINT
If input is 0
LINT_TO_UINT
UINT
If input is 0
255,
ise
an error
normal
occurs.
conversion. Othe
65,535
LINT_TO_UDINT
UDINT
If input is 0
32
LINT_TO_ULINT
ULINT
If input is 0
63
LINT_TO_BOOL
BOOL
LINT_TO_BYTE
BYTE
LINT_TO_WORD
WORD
LINT_TO_DWORD
DWORD
LINT_TO_LWORD
LWORD
Converts into LWORD type without changing the internal bit array.
LINT_TO_REAL
REAL
6-47
Chapter 6
Basic Functions
Function
Output type
LINT_TO_LREAL
LREAL
Description
Converts LINT into LREAL type.
During the conversion, an error caused by the precision may occur.
Flag
Flag
_ERR
Description
If a conversion error occurs, _ERR and _LER flags are set. If an error occurs, lower bits equal to the
bit number of the output type are taken to produces an output without changing the Internal bit array.
Program Example
1. LD
2. ST
ST language doesnt support LINT_TO_***
In case of LINT_TO_DINT
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
INOUT (IN) : IN_VAL (LINT) = 123,456,789(16#00000000075BCD15)
0 0 0 0 0 1 1 1 0 1 0 1 1 0 1 1
1 1 0 0 1 1 0 1 0 0 0 1 0 1 0 1
(LINT_TO_DINT)
0 0 0 0 0 1 1 1 0 1 0 1 1 0 1 1
OUTPUT (OUT) : OUT_VAL (DINT) = 123,456,789 (16#075BCD15)
1 1 0 0 1 1 0 1 0 0 0 1 0 1 0 1
6-48
Chapter 6
Basic Functions
1.28. LN
LN
Availability
XGF-M32E
Flags
_ERR, _LER
Function
Description
Input EN: executes the function in case of 1
IN: input value of natural logarithm operation
LN
BOOL
ANY_REAL
EN
IN
ENO
OUT
BOOL
ANY_REAL
DT
TOD
DATE
LREAL
TIME
REAL
IN
OUT
ULINT
UDINT
UINT
USINT
LINT
DINT
INT
SINT
LWORD
DWORD
WORD
BYTE
Variable
ANY type variable
BOOL
Function
It finds a natural logarithm value of IN and produces output, OUT.
OUT = ln (IN)
Error
Flag
_ERR
Description
If an input is 0 or a negative number, _ERR and _LER flags are set.
6-49
Chapter 6
Basic Functions
Program Example
1. LD
2. ST
RESULT := LN(EN:= %%GX0, IN1:= INPUT);
6-50
Chapter 6
Basic Functions
LOG
LOG
Availability
XGF-M32E
Flags
_ERR, _LER
Function
Description
Input
LOG
EN
IN
BOOL
ANY_REAL
ENO
OUT
Output
BOOL
ANY_REAL
DT
TOD
DATE
TIME
LREAL
IN
OUT
REAL
ULINT
UDINT
UINT
USINT
LINT
DINT
INT
SINT
LWORD
DWORD
WORD
BYTE
Variable
ANY type variable
BOOL
Function
It finds the value of Base 10 Logarithm of IN and produces output, OUT.
OUT = log10 (IN) = log (IN)
Error
Flag
_ERR
Description
If input value IN is 0 or a negative number, _ ERR and _LER flags are set.
6-51
Chapter 6
Basic Functions
Program Example
1. LD
2. ST
RESULT := LOG(EN:= %GX0, IN:= INPUT);
6-52
Chapter 6
Basic Functions
1.29. LREAL_TO_***
LREAL_TO_***
Availability
XGF-M32E
Flags
_ERR, _LER
Function
Description
Input
Output
UINT
UDINT
ULINT
REAL
DT
USINT
TOD
LINT
DATE
DINT
TIME
INT
LREAL
SINT
DWORD
LWORD
OUT
WORD
Variable
BYTE
BOOL
Function
It converts input IN type and produces output, OUT.
Function
Output type
LREAL_TO_SINT
SINT
LREAL_TO_INT
INT
Operation
127, normal co
nversion.
LREAL_TO_DINT
DINT
31
LREAL_TO_LINT
LINT
LREAL_TO_USINT
USINT
LREAL_TO_UINT
UINT
LREAL_TO_UDINT
UDINT
LREAL_TO_ULINT
ULINT
32normal conversion.
,767,
63
65,535, n
32
64
Chapter 6
Basic Functions
Function
Output type
Operation
Otherwise an error occurs (decimal round-off).
LREAL_TO_LWORD
LWORD
LREAL_TO_REAL
REAL
Converts into LWORD type without changing the internal bit array.
Converts LREAL into REAL type normally.
During the conversion, an error caused by the precision may occur.
Flag
Flag
_ERR
Description
If an overflow occurs because an input value is greater than the value available for the output type,
_ERR and _LER flags are set. If an error occurs, an output is 0.
Program Example
1. LD
LREAL_TO
_***
%MX0
LREAL_VAL
EN
ENO
IN
OUT
REAL_VAL
2. ST
ST language doesnt support LREAL_TO_***
In case of LREAL_TO_REAL
-1.34E-12
(LREAL_TO_REAL)
6-54
-1.34E-12
Chapter 6
Basic Functions
1.30. LT
LT
Availability
XGF-M32E
Flags
Function
Description
Input
LT
BOOL
ANY
ANY
EN
IN1
IN2
ENO
OUT
BOOL
BOOL
WORD
DWORD
LWORD
SINT
INT
DINT
LINT
USINT
UINT
UDINT
ULINT
REAL
LREAL
TIME
DATE
TOD
DT
IN1
IN2
BYTE
Variable
ANY type variable
BOOL
Function
1. If IN1 < IN2 < IN3... < INn (n: number of inputs), output value OUT is 1.
2. Otherwise output, OUT is 0.
Program Example
1. LD
6-55
Chapter 6
Basic Functions
2. ST
%GX0 := LT(EN:= %MX0, IN1:= VALUE1, IN2:= VALUE2, IN3:= VALUE3);
6-56
Chapter 6
Basic Functions
1.31. LWORD_TO_***
LWORD_TO_***
Availability
XGF-M32E
Flags
Function
Description
Input
LWORD_TO_***
BOOL
EN
ENO
BOOL
LWORD
IN
OUT
*ANY
Output
DT
TOD
DATE
ULINT
TIME
UDINT
LREAL
UINT
REAL
USINT
LINT
DINT
INT
DWORD
SINT
WORD
OUT
LWORD
Variable
BYTE
BOOL
*ANY: exclude LWORD, REAL, TIME, DATE and TOD from ANY type.
Function
It converts input IN type and produces output, OUT.
Function
Output type
LWORD_TO_SINT
SINT
LWORD_TO_INT
INT
LWORD_TO_DINT
DINT
LWORD_TO_LINT
LINT
Converts into LINT type without changing the internal bit array.
LWORD_TO_USINT
USINT
LWORD_TO_UINT
UINT
LWORD_TO_UDINT
UDINT
LWORD_TO_ULINT
ULINT
Converts into ULINT type without changing the internal bit array.
LWORD_TO_BOOL
BOOL
LWORD_TO_BYTE
BYTE
LWORD_TO_WORD
WORD
LWORD_TO_DWORD
DWORD
LWORD_TO_LREAL
LREAL
LWORD_TO_DT
DT
Description
Chapter 6
Basic Functions
Function
Output type
Description
with a value out of DT range (DT#2163-12-31-23:59:59:999), _ERR, _LER
flags are set and it is alternately converted within the range of DT.
Program Example
1. LD
LWORD_TO
_***
%MX0
IN_VAL
EN
ENO
IN
OUT
OUT_VAL
2. ST
ST language doesnt support LWORD_TO_***
In case of LWORD_TO_LINT
6-58
-1
Chapter 6
Basic Functions
1.32. MAX
Maximum value
MAX
Availability
XGF-M32E
Flags
Function
Description
Input
MAX
BOOL
ANY
ANY
EN
IN1
IN2
ENO
OUT
BOOL
ANY
Output
Variable
BOOL
BYTE
WORD
DWORD
LWORD
SINT
INT
DINT
LINT
USINT
UINT
UDINT
ULINT
REAL
LREAL
TIME
DATE
TOD
DT
IN1
IN2
OUT
6-59
Chapter 6
Basic Functions
Function
It produces the maximum value among input IN1, IN2,..., INn (n: number of inputs).
Program Example
1. LD
%MX0
MAX
EN
ENO
VALUE1
IN1
OUT
VALUE2
IN2
OUT_VALUE
2. ST
OUT_VALUE := MAX(EN:= %MX0, IN1:= VALUE1, IN2:= VALUE2);
0 0 0 0 0 0 0 0 0 1 1 0 0 1 0 0
(MAX)
6-60
0 0 0 0 0 0 0 0 1 1 0 0 1 0 0 0
0 0 0 0 0 0 0 0 1 1 0 0 1 0 0 0
Chapter 6
Basic Functions
1.33.
1.34. MIN
Minimum value
MIN
Availability
XGF-M32E
Flags
Function
Description
Input
MIN
BOOL
ANY
ANY
EN
IN1
IN2
ENO
OUT
BOOL
ANY
Variable
BOOL
BYTE
WORD
DWORD
LWORD
SINT
INT
DINT
LINT
USINT
UINT
UDINT
ULINT
REAL
LREAL
TIME
DATE
TOD
DT
IN1, IN2, ..., OUT must be of all the same data type.
IN1
IN2
OUT
6-61
Chapter 6
Basic Functions
Function
Produces the minimum value among input IN1, IN2, ... , INn (n: number of inputs).
Program Example
1. LD
%MX100
MIN
EN
ENO
VALUE1
IN1
OUT
VALUE2
IN2
OUT_VALUE
2. ST
OUT_VALUE := MIN(EN:= %MX100, IN1:= VALUE1, IN2:= VALUE2);
0 0 0 0 0 0 0 0 0 1 1 0 0 1 0 0
(MIN)
6-62
0 0 0 0 0 0 0 0 1 1 0 0 1 0 0 0
0 0 0 0 0 0 0 0 0 1 1 0 0 1 0 0
Chapter 6
Basic Functions
1.35. MOD
MOD
Availability
XGF-M32E
Flags
Function
Description
Input
MOD
BOOL
ANY_INT
ANY_INT
EN
IN1
IN2
ENO
OUT
IN2: divisor
BOOL
ANY_INT
ULINT
DT
UDINT
TOD
UINT
DATE
USINT
TIME
LINT
LREAL
DINT
REAL
INT
IN1
IN2
OUT
SINT
LWORD
WORD
DWORD
BYTE
Variable
BOOL
IN1, IN2, ..., OUT must be of all the same data type.
Function
1.
IN2
2
-2
2
-2
0
OUT
1
1
-1
-1
0
6-63
Chapter 6
Basic Functions
Program Example
1. LD
MOD
%MX100
EN
ENO
VALUE1
IN1
OUT
VALUE2
IN2
OUT_VAL
2. ST
OUT_VAL := MOD(EN:= %MX100, IN1:= VALUE1, IN2:= VALUE2);
(1) If the transition condition (%MX100) is on, MOD function executes.
(2) If the dividend VALUE1 = 37 and the divisor VALUE2 = 10, the remainder value OUT_VAL is 7 as a result of
dividing 37 by 10.
0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 1
(MOD)
6-64
0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0
0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1
Chapter 6
Basic Functions
1.36. MOVE
MOVE
Availability
XGF-M32E
Flags
Function
Description
Input
MOVE
BOOL
ANY
EN
IN
ENO
OUT
BOOL
ANY
Variable
BOOL
BYTE
WORD
DWORD
LWORD
SINT
INT
DINT
LINT
USINT
UINT
UDINT
ULINT
REAL
LREAL
TIME
DATE
TOD
DT
IN
OUT
Function
Moves an IN value to OUT.
Program Example
This is a program that transfers the 8-contact inputs %I0.0 %I0.7 to the variable D and then moves them to
output %Q0.0 %Q0.7.
1. LD
6-65
Chapter 6
Basic Functions
2. ST
D := MOVE(EN:= %MX100, IN:= %IB0.0);
%QB0.0 := MOVE(EN:= %MX100, IN:= D);
6-66
Chapter 6
Basic Functions
1.37. MUL
Multiplication
MUL
Availability
XGF-M32E
Flags
_ERR, _LER
Function
Description
Input
MUL
BOOL
IN2: multiplier
EN
ENO
BOOL
ANY_NUM
IN1
OUT
ANY_NUM
ANY_NUM
IN2
Variables connected to IN1, IN2, ..., OUT are all of the same
UINT
UDINT
ULINT
REAL
LREAL
DT
USINT
TOD
LINT
DATE
DINT
TIME
INT
LWORD
WORD
SINT
IN1
IN2
OUT
DWORD
BYTE
Variable
BOOL
data type.
Function
Multiplies an IN1, IN2,..., INn (n: number of inputs) and outputs the result as OUT.
OUT = IN1 IN2 ... INn
Flag
Flag
_ERR
Description
If an output value is beyond the range of its data-type, _ERR and _LER flags are set.
If REAL, LREAL type operation exceeds the maximum or minimum value in the middle of the operation because it
performs the operation sequentially from IN1 to IN8, _ERR, _LER flag are set and the result is an unlimited or
abnormal value.
(1.#INF000000000000e+000, 1.#SNAN00000000000e+000, 1.#QNAN00000000000e+000).
6-67
Chapter 6
Basic Functions
Program Example
1. LD
%MX0
MUL
EN
ENO
VALUE1
IN1
OUT
VALUE2
IN2
VALUE3
IN3
OUT_VAL
2. ST
OUT_VAL := MUL(EN:= %MX0, IN1:= VALUE1, IN2:= VALUE2, IN3:= VALUE3);
0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0
+(MUL)
0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0
+(MUL)
0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0
6-68
Chapter 6
Basic Functions
1.38.
1.39. MUX
MUX
Availability
XGF-M32E
Flags
_ERR, _LER
Function
Description
Input
MUX
BOOL
INT
ANY
ANY
EN
K
IN0
IN1
ENO
OUT
BOOL
ANY
IN1, , IN6)
Output
Variable
BOOL
BYTE
WORD
DWORD
LWORD
SINT
INT
DINT
LINT
USINT
UINT
UDINT
ULINT
REAL
LREAL
TIME
DATE
TOD
DT
IN0
IN1
OUT
Function
1.
2.
Selects one among several inputs (IN0, IN1, , INn) with K value and produces it.
If K = 0, IN0 is an output; if K = 1, IN1 is an output; if K = n, INn is an output.
Flag
Flag
_ERR
Description
If K is greater than or equal to n which is the number of input variable INn, then IN0 is an output and
_ERR, _LER flags are set. If K is negative, _ERR and _LER flags are set
6-69
Chapter 6
Basic Functions
Program Example
1. LD
%MX0
MUX
ENO
EN
S
VALUE0
IN0
VALUE1
IN1
VALUE2
IN2
OUT
OUT_VAL
2. ST
OUT_VAL := MUX(EN:= %MX0, K:= S, IN0:= VALUE0, IN1:= VALUE1, IN2:= VALUE2);
16#0011
(IN1) : VALUE1(WORD) =
16#0022
(IN2) : VALUE2(WORD) =
16#0033
(MUX)
6-70
Chapter 6
Basic Functions
1.40. NE
NE
Availability
XGF-M32E
Flags
Function
Description
Input
NE
BOOL
ANY
ANY
EN
IN1
IN2
ENO
OUT
BOOL
BOOL
WORD
DWORD
LWORD
SINT
INT
DINT
LINT
USINT
UINT
UDINT
ULINT
REAL
LREAL
TIME
DATE
TOD
DT
IN1
IN2
BYTE
Variable
ANY type variable
BOOL
6-71
Chapter 6
Basic Functions
Function
1.
2.
Program Example
1. LD
2. ST
%QX0.0 := NE(EN:= %IX0.0, IN1:= VALUE1, IN2:= VALUE2);
6-72
Chapter 6
Basic Functions
1.41. NE
NOT
Availability
XGF-M32E
Flags
Function
Description
Input
NOT
BOOL
ANY_BIT
EN
IN
ENO
OUT
BOOL
ANY_BIT
Output
DT
TOD
DATE
TIME
LREAL
REAL
ULINT
UDINT
UINT
USINT
LWORD
LINT
DWORD
DINT
WORD
INT
BYTE
IN
OUT
SINT
Variable
BOOL
6-73
Chapter 6
Basic Functions
Function
It inverts the IN (by bit) and produces output, OUT.
IN
OUT
Program Example
1. LD
2. ST
%QB0.0 := NOT_BYTE(EN:= %MX0, IN1:=MB10);
6-74
Chapter 6
Basic Functions
Logic Sum
OR
Availability
XGF-M32E
Flags
Function
Description
Input
OR
BOOL
ANY_BIT
ANY_BIT
EN
IN1
IN2
ENO
OUT
BOOL
ANY_BIT
DT
TOD
DATE
TIME
LREAL
REAL
ULINT
UDINT
UINT
USINT
LWORD
LINT
DWORD
DINT
WORD
INT
BYTE
IN
OUT
SINT
Variable
BOOL
Function
It performs a logical OR on the input variables by bit and produces output, OUT.
IN1
OR
IN2
OUT
6-75
Chapter 6
Basic Functions
Program Example
1. LD
2. ST
%QB0.0 := OR2_BYTE(EN:=%MX0, IN1:=%MB10, IN2:=ABC);
6-76
Chapter 6
Basic Functions
REAL_TO_***
Availability
XGF-M32E
Flags
_ERR, _LER
Function
Description
Input
REAL_TO_***
DT
TOD
DATE
ULINT
TIME
UDINT
LREAL
UINT
REAL
USINT
OUT
LINT
Variable
Output
DINT
ANY_INT,DWORD
LREAL,STRING
INT
OUT
SINT
IN
LWORD
REAL
DWORD
BOOL
WORD
ENO
BYTE
EN
BOOL
BOOL
Function
It converts the IN type and outputs it as OUT.
Function
Output Type
REAL_TO_SINT
SINT
REAL_TO_INT
INT
Description
If integer part of input is -128 127, normal conversion. Otherwise
an error occurs. (Decimals round-off)
If integer part of input is -32,768
DINT
REAL_TO_LINT
LINT
REAL_TO_USINT
USINT
REAL_TO_UINT
UINT
REAL_TO_DINT
31
63
REAL_TO_UDINT
UDINT
REAL_TO_ULINT
ULINT
REAL_TO_DWORD
DWORD
Chapter 6
Basic Functions
Function
Output Type
REAL_TO_LREAL
LREAL
Description
Converts REAL into LREAL type normally.
Flag
Flag
Description
If overflow occurs (input value is greater than the value to be stored in output type), _ERR, _LER flags
_ERR
%MX0
REAL_VAR
EN
ENO
IN
OUT
DINT_VAR
2. ST
ST language doesnt support REAL_TO_***
In case of REAL_TO_DINT
6-78
Chapter 6
Basic Functions
Rotate to Left
ROL
Availability
XGF-M32E
Flags
Function
Description
Input
ROL
BOOL
*ANY_BIT
INT
EN
IN
N
ENO
OUT
BOOL
*ANY_BIT
DT
TOD
DATE
TIME
LREAL
REAL
ULINT
UDINT
UINT
USINT
LINT
DINT
LWORD
INT
DWORD
SINT
WORD
IN
OUT
BYTE
Variable
ANY type variable
BOOL
Function
It rotates input IN to the left as many as N bit number.
1 0 1 0 0 0 1 1
1 0 0 0 1 1 1 0
N (when N=2)
6-79
Chapter 6
Basic Functions
Program Example
This is the program that rotates the value of input data (2#1100_1100_1100_1100:16#CCCC) to the left by 3 bits if
input %IX0.0 is on.
1. LD
2. ST
6-80
1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0
(ROL)
0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0
Chapter 6
Basic Functions
1.42. ROR
Rotate to right
ROR
Availability
XGF-M32E
Flags
Function
Description
Input
ROR
BOOL
*ANY_BIT
INT
EN
IN
N
ENO
OUT
BOOL
*ANY_BIT
Output
DT
TOD
DATE
TIME
LREAL
REAL
ULINT
UDINT
UINT
USINT
LINT
DINT
LWORD
INT
DWORD
SINT
WORD
IN
OUT
BYTE
Variable
ANY type variable
BOOL
Function
It rotates input IN to the right as many as N bit number.
1 0 1 0 0 0 1 1
1 1 1 0 1 0 0 0
N
6-81
Chapter 6
Basic Functions
Program Example
This is the program that rotates input data value (2#1110_0011_0011_0001: 16#E331) to the right by 3 bits if
input %I0.0 is on.
1. LD
2. ST
6-82
1 1 1 0 0 0 1 1 0 0 1 1 0 0 0 1
(ROR)
0 0 1 1 1 1 0 0 0 1 1 0 0 1 1 0
Chapter 6
Basic Functions
1.43. SEL
1.44. SHL
Shift Left
SHL
Availability
XGF-M32E
Flags
Function
Description
Input
SHL
BOOL
*ANY_BIT
INT
EN
IN
N
ENO
OUT
BOOL
*ANY_BIT
Output
DT
TOD
DATE
TIME
LREAL
REAL
ULINT
UDINT
UINT
USINT
LINT
DINT
LWORD
INT
DWORD
SINT
WORD
IN
OUT
BYTE
Variable
ANY type variable
BOOL
Function
1.
2.
1 0 1 0 0 0 1 1
1 0 0 0 1 1 0 0
N will be filled with 0
6-83
Chapter 6
Basic Functions
Program Example
This is the program that shifts input data value (2#1100_1100_1100_1100:16#CCCC) to the left by 3 bits if
input %IX0.0 is on
1. LD
2. ST
6-84
1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0
(ROL)
0 1 1 0 0 1 1 0 0 1 1 0 0 0 0 0
Chapter 6
Basic Functions
1.45. SHR
Shift Right
SHR
Availability
XGF-M32E
Flags
Function
Description
Input
SHR
BOOL
*ANY_BIT
INT
EN
IN
N
ENO
OUT
BOOL
*ANY_BIT
Output
DT
TOD
DATE
TIME
LREAL
REAL
ULINT
UDINT
UINT
USINT
LINT
DINT
LWORD
INT
DWORD
SINT
WORD
IN
OUT
BYTE
Variable
ANY type variable
BOOL
Function
1. It shifts input IN to the right as many as N bit number.
2. N number bit on the leftmost of input IN is filled with 0.
1 0 1 0 0 0 1 1
0 0 1 0 1 0 0 0
N will be filled with 0
6-85
Chapter 6
Basic Functions
Program Example
1. LD
SHR
EN ENO
%MX0
IN_VALUE
IN
OUT
OUT_VALUE
2. ST
(1) If the transition condition (%MX0) is on, function SHL (Shift Left) executes.
(2) Data bit set as input variable shift to the right by 3 bits and produces outputs, OUT_VALUE.
6-86
1 1 1 0 0 0 1 1 0 0 1 1 0 0 0 1
(ROR
)
0 0 0 1 1 1 0 0 0 1 1 0 0 1 1 0
Chapter 6
Basic Functions
1.46. SIN
Sine operation
SIN
Availability
XGF-M32E
Flags
Function
Description
Input
SIN
BOOL
ANY_REAL
EN
IN
ENO
OUT
BOOL
ANY_REAL
Output
DT
TOD
DATE
TIME
LREAL
ULINT
UDINT
UINT
USINT
LINT
REAL
IN
OUT
DINT
INT
SINT
LWORD
DWORD
WORD
BYTE
Variable
ANY type variable
BOOL
Function
Finds the Sine operation value of IN and produces output, OUT.
OUT = SIN (IN)
Program Example
1. LD
6-87
Chapter 6
Basic Functions
2. ST
(1) If the transition condition (%IX0.0) is on, function SIN (Sine operation) executes.
(2) If the value of input variable INPUT is 1.0471 .. . (/3 rad = 60), RESULT declared as output variable is 0.8660 ....
(
3 /2 ). SIN(/3) =
3 /2 = 0.8660
INPUT (IN) : INPUT (REAL) =
1.0471
(SIN)
6-88
Chapter 6
Basic Functions
SINT_TO_***
Availability
XGF-M32E
Flags
_ERR, _LER
Function
Description
Input
SINT_TO_***
BOOL
SINT
EN
IN
BOOL
*ANY
ENO
OUT
Output
DT
LREAL
TOD
REAL
DATE
ULINT
TIME
UDINT
UINT
USINT
LINT
LWORD
DINT
DWORD
INT
WORD
OUT
SINT
Variable
BYTE
BOOL
*ANY: exclude SINT, TIME, DATE, TOD and DT from ANY type.
Function
It converts the IN type and outputs it as OUT.
Function
Output type
Description
SINT_TO_INT
INT
SINT_TO_DINT
DINT
SINT_TO_LINT
LINT
SINT_TO_USINT
USINT
SINT_TO_UINT
UINT
SINT_TO_UDINT
UDINT
SINT_TO_ULINT
ULINT
SINT_TO_BOOL
BOOL
SINT_TO_BYTE
BYTE
Converts into BYTE type without changing the internal bit array.
SINT_TO_WORD
WORD
SINT_TO_DWORD
DWORD
SINT_TO_LWORD
LWORD
SINT_TO_REAL
REAL
SINT_TO_LREAL
LREAL
6-89
Chapter 6
Basic Functions
Flag
Flag
_ERR
Description
If a conversion error occurs, _ERR and _LER flags are set. If an error occurs, take the lower bits
as many as bit number of output type and output it without changing the internal bit array.
Program Example
1. LD
SINT_TO_***
EN
ENO
%MX0
IN_VAL
IN
OUT
OUT_VAL
2. ST
0 1 0 0 0 0 0 0
(SINT_TO_BYTE)
6-90
0 1 1 0 0 1 0 0
Chapter 6
Basic Functions
1.47. SQRT
SQRT
Availability
XGF-M32E
Flags
_ERR, _LER
Function
Description
Input
SQRT
BOOL
ANY_REAL
EN
IN
ENO
OUT
BOOL
ANY_REAL
DT
TOD
DATE
LREAL
TIME
REAL
IN
OUT
ULINT
UDINT
UINT
USINT
LINT
DINT
INT
SINT
LWORD
DWORD
WORD
BYTE
Variable
ANY type variable
BOOL
Function
It finds the square root value of IN and output it as OUT.
OUT =
IN
Flag
Flag
_ERR
Description
If the value of IN is a negative number, _ERR and _LER flag are set.
Program Example
1. LD
%MX0
SQRT
EN ENO
INPUT
IN
OUT
RESULT
6-91
Chapter 6
Basic Functions
2. ST
(1) If the transition condition (%MX0) is on, function SQRT (square root operation) executes.
(2) If the value of input variable declared as INPUT is 9.0, RESULT declared as output variable is 3.0.
9.0 = 3.0
6-92
Chapter 6
Basic Functions
1.48. STRING_
1.49. SUB
Subtraction
SUB
Availability
XGF-M32E
Flags
_ERR, _LER
Function
Description
Input
SUB
EN
ENO
BOOL
ANY_NUM
IN1
OUT
ANY_NUM
ANY_NUM
IN2
BOOL
USINT
UINT
UDINT
ULINT
REAL
LREAL
DT
LINT
TOD
DINT
DATE
INT
TIME
SINT
IN1
IN2
OUT
LWORD
DWORD
WORD
BYTE
Variable
BOOL
Function
It subtracts IN2 from IN1 and outputs it as OUT.
OUT = IN1 IN2
Flag
Flag
_ERR
Description
If output value is out of range of related data type, _ERR and _LER flags are set.
If LREAL type operation exceeds the maximum or minimum value in the middle of operation because it performs
operation serially from IN1 to IN8, _ERR,_LER flag is set and the result is an unlimited or abnormal value.
(1.#INF000000000000e+000, 1.#SNAN00000000000e+000, 1.#QNAN00000000000e+000)
6-93
Chapter 6
Basic Functions
Program Example
1. LD
%MX0
SUB
EN
ENO
VALUE1
IN1
OUT
VALUE2
IN2
OUT_VAL
2. ST
0 0 0 0 0 0 0 1 0 0 1 0 1 1 0 0
-(SUB)
6-94
0 0 0 0 0 0 0 0 1 1 0 0 1 0 0 0
0 0 0 0 0 0 0 0 0 1 1 0 0 1 0 0
Chapter 6
Basic Functions
1.50. SUB_DATE
Date subtraction
SUB_DATE
Availability
XGF-M32E
Flags
_ERR, _LER
Function
Description
Input
SUB_DATE
BOOL
DATE
DATE
EN
IN1
IN2
ENO
OUT
BOOL
TIME
Output
Function
It subtracts IN2 (specific date) from IN1 (standard date) and outputs the difference between two dates as OUT.
Flag
Flag
Description
If output value is out of range (TIME data type), _ERR and _LER flags are set.
_ERR
An error occurs: 1) when date difference exceeds the range of TIME data type
(T#49D17H2M47S295MS); 2) the result of date operation is a negative number.
Program Example
1. LD
6-95
Chapter 6
Basic Functions
2. ST
6-96
Chapter 6
Basic Functions
1.51. SUB_DT
SUB_DT
Availability
XGF-M32E
Flags
_ERR, _LER
Function
Description
Input
SUB_DT
BOOL
DATE_AND_TIME
DATE_AND_TIME
EN
IN1
IN2
ENO
OUT
BOOL
TIME
Function
It subtracts IN2 (specific date and time of day) from IN1 (standard date and time of day) and outputs the time difference as
OUT.
Flag
Flag
_ERR
Description
If output value is out of range of TIME data type, _ERR and _LER flags are set.
If the result of date and time of day subtraction operation is a negative number, an error occurs.
Program Example
1. LD
%MX0
SUB_DT
ENO
EN
CURRENT_DT
IN1
START_DT
IN2
OUT
WORK_TIME
6-97
Chapter 6
Basic Functions
2. ST
DT#1995-12-13-12:00:00
6-98
T#2D2H30M
Chapter 6
Basic Functions
1.52. SUB_TIME
Time subtraction
SUB_TIME
Availability
XGF-M32E
Flags
_ERR, _LER
Function
Description
Input
SUB_TIME
BOOL
EN
ENO
BOOL
TIME,TOD,DT
IN1
OUT
TIME,TOD,DT
TIME
IN2
TOD
DT
IN1
OUT
DATE
TIME
LREAL
REAL
ULINT
UDINT
UINT
USINT
LINT
DINT
INT
SINT
LWORD
DWORD
WORD
BYTE
Variable
ANY type variable
BOOL
Function
1. If IN1 is TIME, it subtracts the time from the standard time and produces OUT (time difference).
2. If IN1 is TIME_OF_DAY, it subtracts the time from the standard time of day and outputs the time of a day as OUT.
3. If IN1 is DATE_AND_TIME, it subtracts the time from the standard date and the time of day and produces the date
and the time of day as OUT.
Flag
Flag
Description
If the output value is out of range of related data type, _ERR and _LER flags are set.
_ERR
If the result subtracting the time from the standard time is a negative number or the result subtracting
the time from the time of day is a negative number, an error occurs.
6-99
Chapter 6
Basic Functions
Program Example
1. LD
2. ST
(1) If the transition condition (%IX0.0) is on, function SUB_TIME (time subtraction) executes.
(2) If total working time declared as input variable TARGET_TIME is T#2H30M, the elapsed time ELAPSED_TIME is
T#1H10M30S300MS, the remaining working time declared as output variable TIME_TO_GO is
T#1H19M29S700MS.
T#2H30M
(SUB_DATE)
6-100
Chapter 6
Basic Functions
1.53. SUB_TOD
TOD Subtraction
SUB_TOD
Availability
XGF-M32E
Flags
_ERR, _LER
Function
Description
Input
SUB_TOD
BOOL
TIME_OF_DAY
TIME_OF_DAY
EN
IN1
IN2
ENO
OUT
BOOL
TIME
Output
Function
It subtracts the IN2 (specific time of day) from IN1 (standard time of day) and outputs the time difference as OUT.
Flag
Flag
_ERR
Description
If the result subtracting the time of day from the time of day is a negative number, an error occurs.
Program Example
1. LD
6-101
Chapter 6
Basic Functions
2. ST
TOD#14:20:30.500
(SUB_TOD)
6-102
Chapter 6
Basic Functions
1.54. TAN
Tangent Operation
TAN
Availability
XGF-M32E
Flags
Function
Description
Input
TAN
BOOL
ANY_REAL
EN
IN
ENO
OUT
BOOL
ANY_REAL
Output
DT
TOD
DATE
TIME
LREAL
ULINT
UDINT
UINT
USINT
LINT
REAL
IN
OUT
DINT
INT
SINT
LWORD
DWORD
WORD
BYTE
Variable
ANY type variable
BOOL
Function
It performs Tangent operation of IN and produces output, OUT.
OUT = TAN(IN)
Program Example
1. LD
%MX0
TAN
INPUT
EN
ENO
IN
OUT
RESULT
6-103
Chapter 6
Basic Functions
2. ST
0.7853
(TAN)
6-104
Chapter 6
Basic Functions
1.55. ***
TIME_TO_***
Availability
XGF-M32E
Flags
Function
Description
Input
TIME_TO_***
BOOL
EN
ENO
BOOL
TIME
IN
OUT
DWORD,UDINT
STRING
OUT
DT
TOD
DATE
TIME
LREAL
REAL
ULINT
UDINT
UINT
USINT
LINT
DINT
INT
SINT
LWORD
DWORD
WORD
Variable
BYTE
BOOL
Function
It converts the IN type and produces OUT.
Function
Output type
TIME_TO_UDINT
UDINT
TIME_TO_DWORD
DWORD
Description
Converts TIME into UDINT type. It converts only data type without
changing the data (internal bit array state).
Converts TIME into DWORD type. It converts only data type without
changing the data (internal bit array state).
6-105
Chapter 6
Basic Functions
Program Example
1. LD
TIME_TO
_***
%MX0
IN_VAL
EN
ENO
IN
OUT
OUT_VAL
2. ST
0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0
(TIME_TO_UDINT)
6-106
0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0
Chapter 6
Basic Functions
1.56. TOD_TO_***
TOD_TO_***
Availability
XGF-M32E
Flags
Function
Description
Input
TOD_TO_***
BOOL
EN
ENO
BOOL
TIME 0F DAY
IN
OUT
DWORD,UDINT
STRING
OUT
DT
TOD
DATE
TIME
LREAL
REAL
ULINT
UDINT
UINT
USINT
LINT
DINT
INT
SINT
LWORD
DWORD
WORD
Variable
BYTE
BOOL
Function
It converts the IN type and outputs it as OUT.
Function
TOD_TO_UDINT
TOD_TO_DWORD
Output
type
UDINT
DWORD
Description
Converts TOD into UDINT type.
Converts only data type without changing a data (internal bit array state).
Converts TOD into DWORD type.
Converts only data type without changing a data (internal bit array state).
6-107
Chapter 6
Basic Functions
Program Example
1. LD
TOD_TO
_***
%MX0
IN_VAL
EN
ENO
IN
OUT
OUT_VAL
2. ST
TOD#12:00:00
(TOD_TO_STRING)
6-108
Chapter 6
Basic Functions
RUNC
UDINT_TO_***
Availability
XGF-M32E
Flags
_ERR, _LER
Function
Description
Input
UDINT_TO_***
BOOL
UDINT
EN
IN
ENO
OUT
BOOL
*ANY
USINT
UINT
DT
LINT
TOD
DINT
DATE
INT
TIME
SINT
LREAL
LWORD
REAL
DWORD
ULINT
WORD
OUT
UDINT
Variable
BYTE
BOOL
Function
It converts the IN type and outputs it as OUT.
Function
Output
Description
type
UDINT_TO_SINT
SINT
UDINT_TO_INT
INT
UDINT_TO_DINT
DINT
UDINT_TO_LINT
LINT
UDINT_TO_USINT
USINT
UDINT_TO_UINT
UINT
UDINT_TO_ULINT
ULINT
UDINT_TO_BOOL
BOOL
UDINT_TO_BYTE
BYTE
UDINT_TO_WORD
WORD
UDINT_TO_DWORD
DWORD
Converts into DWORD type without changing the internal bit array.
UDINT_TO_LWORD
LWORD
6-109
Chapter 6
Basic Functions
Output
Function
Description
type
REAL
UDINT_TO_LREAL
LREAL
UDINT_TO_TOD
TOD
TIME
Converts into TIME type without changing the internal bit array.
Flag
Flag
Description
_ERR
If a conversion error occurs, _ERR and _LER flags are set. If an error occurs, take the lower bits
as many as a bit number of an output data type and produces the output without changing the
internal bit array.
Program Example
1. LD
UDINT_TO
_***
%MX0
IN_VAL
EN
ENO
IN
OUT
OUT_VAL
2. ST
(1) If the input condition (%MX0) is on, function UDINT_TO_*** will be executed.
(2) If input variable IN_VAL (UDINT) = 123, output variable OUT_VAL (TIME) = T#123MS.
INPUT (IN) : IN_VAL (UDINT) = 123
6-110
Chapter 6
Basic Functions
1.57. UINT_TO_***
UINT_TO_***
Availability
XGF-M32E
Flags
_ERR, _LER
Function
Description
Input
UINT_TO_***
BOOL
UINT
EN
IN
ENO
OUT
BOOL
*ANY
DT
USINT
TOD
LINT
DATE
DINT
TIME
INT
LREAL
SINT
REAL
LWORD
ULINT
DWORD
UDINT
WORD
OUT
UINT
Variable
BYTE
BOOL
Function
It converts the IN type and outputs it as OUT.
Function
UINT_TO_SINT
UINT_TO_INT
UINT_TO_DINT
UINT_TO_LINT
UINT_TO_USINT
UINT_TO_UDINT
UINT_TO_ULINT
UINT_TO_BOOL
UINT_TO_BYTE
UINT_TO_WORD
UINT_TO_DWORD
UINT_TO_LWORD
UINT_TO_REAL
UINT_TO_LREAL
UINT_TO_DATE
Output type
SINT
INT
DINT
LINT
USINT
UDINT
ULINT
BOOL
BYTE
WORD
DWORD
LWORD
REAL
LREAL
DATE
Description
If input is 0~127, normal conversion. Otherwise an error occurs.
If input is 0~32,767, normal conversion. Otherwise an error occurs.
Converts UINT into UDINT type normally.
Converts UINT into ULINT type normally.
If input is 0~255, normal conversion. Otherwise an error occurs.
Converts UINT into UDINT type normally.
Converts UINT into ULINT type.
Takes the lower 1 bit and converts into BOOL type.
Takes the lower 8 bits and converts into BYTE type.
Converts into WORD type without changing the internal bit array.
Converts into DWORD type filling the upper bits with 0.
Converts into LWORD type filling the upper bits with 0.
Converts UINT into REAL type.
Converts UINT into LREAL type.
Converts into DATE type without changing the internal bit array.
6-111
Chapter 6
Basic Functions
Flag
Flag
_ERR
Description
If a conversion error occurs, _ERR and _LER flags are set. If error occurs, it takes as many
lower bits as a bit number of output type and produces an output without changing its internal bit
array.
Program Example
1. LD
UINT_TO
_***
%MX0
IN_VAL
EN
ENO
IN
OUT
OUT_VAL
2. ST
0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
(UINT_TO_WORD)
6-112
0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
Chapter 6
Basic Functions
1.58. ULINT_TO_***
ULINT_TO_***
Availability
XGF-M32E
Flags
_ERR, _LER
Function
Description
Input
ULINT_TO_***
BOOL
ULINT
EN
IN
ENO
OUT
BOOL
*ANY
Output
DT
USINT
TOD
LINT
DATE
DINT
TIME
INT
LREAL
SINT
REAL
LWORD
ULINT
DWORD
UDINT
WORD
OUT
UINT
Variable
BYTE
BOOL
Function
It converts the IN type and outputs it as OUT.
Function
Output type
Description
ULINT_TO_SINT
SINT
ULINT_TO_INT
INT
ULINT_TO_DINT
DINT
ULINT_TO_LINT
LINT
ULINT_TO_USINT
USINT
ULINT_TO_UINT
UINT
ULINT_TO_UDINT
UDINT
ULINT_TO_BOOL
BOOL
ULINT_TO_BYTE
BYTE
ULINT_TO_WORD
WORD
ULINT_TO_DWORD
DWORD
ULINT_TO_LWORD
LWORD
Converts into LWORD type without changing the internal bit array.
ULINT_TO_REAL
REAL
ULINT_TO_LREAL
LREAL
Chapter 6
Basic Functions
Flag
Flag
Description
If a conversion error occurs, _ERR and _LER flags are set. If error occurs, it takes as many lower
_ERR
bits as a bit number of output type and produces an output without changing its internal bit array
Program Example
1. LD
ULINT_TO
_***
%MX0
IN_VAL
EN
ENO
IN
OUT
OUT_VAL
2. ST
6-114
Chapter 6
Basic Functions
1.59. USINT_TO_***
USINT_TO_***
Availability
XGF-M32E
Flags
_ERR, _LER
Function
Description
Input
USINT_TO_***
BOOL
USINT
EN
IN
ENO
OUT
BOOL
*ANY
DT
TOD
DATE
LINT
TIME
DINT
LREAL
INT
REAL
SINT
ULINT
LWORD
UDINT
DWORD
UINT
WORD
OUT
USINT
Variable
BYTE
BOOL
*ANY: exclude USINT, TIME, DATE, TOD and DT from ANY type.
Function
It converts the IN type and outputs it as OUT.
Function
Output type
Description
USINT_TO_SINT
SINT
USINT_TO_INT
INT
USINT_TO_DINT
DINT
USINT_TO_LINT
LINT
USINT_TO_UINT
UINT
USINT_TO_UDINT
UDINT
USINT_TO_ULINT
ULINT
USINT_TO_BOOL
BOOL
USINT_TO_BYTE
BYTE
Converts into BYTE type without changing the internal bit array.
USINT_TO_WORD
WORD
USINT_TO_DWORD
DWORD
USINT_TO_LWORD
LWORD
USINT_TO_REAL
REAL
USINT_TO_LREAL
LREAL
6-115
Chapter 6
Basic Functions
Flag
Flag
Description
If a conversion error occurs, _ERR and _LER flags are set. If error occurs, it takes as many lower
_ERR
bits as a bit number of output type and produces an output without changing its internal bit array.
Program Example
1. LD
USINT_TO
_***
%MX0
IN_VAL
EN
ENO
IN
OUT
OUT_VAL
2. ST
0 1 1 1 1 0 1 1
(UINT_TO_SINT)
6-116
0 1 1 1 1 0 1 1
Chapter 6
Basic Functions
1.60. WDT_RST
1.61. WORD_TO_***
WORD_TO_***
Availability
XGF-M32E
Flags
Function
Description
Input
WORD_TO_***
BOOL
WORD
EN
IN
ENO
OUT
BOOL
*ANY
UDINT
ULINT
DT
UINT
TOD
USINT
DATE
LINT
TIME
DINT
LREAL
INT
REAL
SINT
LWORD
DWORD
OUT
WORD
Variable
BYTE
BOOL
*ANY: exclude WORD, REAL, LREAL, TIME, TOD and DT from ANY type.
Function
It converts the IN type and outputs it as OUT.
Function
Output type
Description
WORD _TO_SINT
SINT
WORD _TO_INT
INT
WORD _TO_DINT
DINT
WORD _TO_LINT
LINT
WORD _TO_USINT
USINT
WORD _TO_UINT
UINT
WORD _TO_UDINT
UDINT
WORD _TO_ULINT
ULINT
WORD _TO_BOOL
BOOL
WORD _TO_BYTE
BYTE
WORD _TO_DWORD
DWORD
WORD _TO_LWORD
LWORD
WORD _TO_DATE
DATE
Converts into INT type without changing the internal bit array.
Converts into INT type without changing the internal bit array.
Converts into DATE type without changing the internal bit array.
6-117
Chapter 6
Basic Functions
Program Example
1. LD
%MX0
WORD_TO_***
EN
ENO
IN_VAL
IN
OUT
OUT_VAL
2. ST
0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1
(WORD_TO_INT)
6-118
0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1
Chapter 6
Basic Functions
1.62. XOR
Exclusive OR
XOR
Availability
XGF-M32E
Flags
Function
Description
Input
XOR
BOOL
ANY_BIT
ANY_BIT
EN
IN1
IN2
ENO
OUT
BOOL
ANY_BIT
DT
TOD
DATE
TIME
LREAL
REAL
ULINT
UDINT
UINT
USINT
LWORD
LINT
DWORD
DINT
WORD
INT
BYTE
IN
OUT
SINT
Variable
BOOL
Function
1.
Do XOR operation for IN1 and IN2 per bit and to produces OUT.
IN1
XOR
IN2
OUT
6-119
Chapter 6
Basic Functions
Program Example
1. LD
2. ST
XOR
(IN2) : ABC(BYTE) = 16#F0
6-120
Chapter 7
Application Functions
7-1
Chapter 7
Application Functions
1.1. _BYT
BIT_BYTE
Availability
XGF-M32E
Flags
Function
Description
BIT_BYTE
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
EN
IN1
IN2
IN3
IN4
IN5
IN6
IN7
IN8
ENO
OUT
BOOL
BYTE
Input
Output
Function
It combines 8 bits into one byte.
IN8: MSB (Most Significant Bit), IN1: LSB (Least Significant Bit).
Program Example
1. LD
%MX3
7-2
BIT_BYTE
EN
ENO
INPUT1
IN1
INPUT2
IN2
INPUT3
IN3
INPUT4
IN4
INPUT5
IN5
INPUT6
IN6
INPUT7
IN7
INPUT8
IN8
OUT
OUTPUT
Chapter 7
Application Functions
2. ST
OUTPUT := BIT_BYTE(EN:=%MX3, IN1:=INPUT1, IN2:=INPUT2, IN3:=INPUT3, IN4:=INPUT4, IN5:=INPUT5,
IN6:=INPUT6,
IN7:=INPUT7, IN8:=INPUT8);
(1) If the transition condition (%MX3) is on, BIT_BYTE function executes.
(2) If 8 input are (from INPUT1 to INPUT 8) {0,1,1,0,1,1,0,0}, OUTPUT (BYTE) = 2#0110_1100.
7-3
Chapter 7
Application Functions
BMOV
1.2. BSUM
BSUM
Availability
XGF-M32E
Flags
Function
Description
Input
BSUM
BOOL
EN
ENO
BOOL
*ANY_BIT
IN
OUT
INT
Output
Function
1. If EN is 1, it counts bit number of 1 among IN bit string and produces output, OUT.
2. Input data types are BYTE, WORD, DWORD and LWORD.
Function
IN type
BSUM
BYTE
BSUM
WORD
BSUM
DWORD
BSUM
LWORD
Description
7-4
DT
TOD
DATE
TIME
LREAL
REAL
ULINT
UDINT
UINT
USINT
LINT
DINT
INT
LWORD
SINT
DWORD
IN
WORD
Variable
BYTE
BOOL
Chapter 7
Application Functions
Program Example
1. LD
%MX0
SWITCHS
EN
BSUM
ENO
IN
OUT
ON_COUNT
2. ST
ON_COUNT := BSUM(EN:=%MX0, IN:=SWITCHS);
7-5
Chapter 7
1.3.
Application Functions
BIT
Divides byte into 8 bits
BYTE_BIT
Availability
XGF-M32E
Flags
Function
Description
BYTE_BIT
BOOL
BYTE
EN
IN
ENO
Q01
Q02
Q03
Q04
Q05
Q06
Q07
Q08
Input
Output
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
Function
1.
2.
7-6
Chapter 7
Application Functions
Program Example
1. LD
%MX0
BYTE_BIT
ENO
EN
INPUT
IN
Q01
BIT1
Q02
BIT2
Q03
BIT3
Q04
BIT4
Q05
BIT5
Q06
BIT6
Q07
BIT7
Q08
BIT8
2. ST
BYTE_BIT(EN:=%MX0, IN:= INPUT, Q01=> BIT1, Q02=> BIT2, Q03=> BIT3, Q04=> BIT4, Q05=> BIT5, Q06=> BIT6, Q07=>
BIT7, Q08=> BIT8);
(1) If the execution condition (%MX0) is on, BYTE_BIT function executes.
(2) If INPUT = 16#AC = 2#1010_1100, it distributes INPUT from Q01 to Q08 in order. The order is 2#{0, 0, 1, 1, 0, 1, 0, 1}.
7-7
Chapter 7
1.4.
Application Functions
BYTE_TO_
1.5. BYTE_WORD
BYTE_WORD
Availability
XGF-M32E
Flags
Function
Description
Input
BYTE_WORD
BOOL
EN
ENO
BOOL
BYTE
LOW
OUT
WORD
BYTE
HIGH
Output
Function
It combines two bytes into one word.
LOW: lower BYTE input, HIGH: upper BYTE input
Program Example
1. LD
BYTE_WORD
EN
ENO
%MX3
BYTE_IN1
LOW
BYTE_IN2
HIGH
OUT
OUTPUT
2. ST
OUTPUT := BYTE_WORD(EN:=%MX3, LOW:=BYTE_IN1, HIGH:=BYTE_IN2);
(1) If the transition condition (%MX3) is on, BYTE_WORD function executes.
(2) If input BYTE_IN1 = 16#56 and BYTE_IN2 = 16#AD, output variable OUTPUT = 16#AD56.
7-8
Chapter 7
Application Functions
1.6.
1.7. DEC
DEC
Availability
XGF-M32E
Flags
Function
Description
Input
DEC
BOOL
EN
ENO
BOOL
*ANY_BIT
IN
OUT
*ANY_BIT
Output
DT
TOD
DATE
TIME
LREAL
REAL
ULINT
UDINT
UINT
USINT
LINT
DINT
LWORD
INT
DWORD
SINT
WORD
IN
OUT
BYTE
Variable
ANY type variable
BOOL
Function
1.
2.
3.
FUNCTION
IN/OUT type
DEC
BYTE
DEC
WORD
DEC
DWORD
DEC
LWORD
Description
You can select one of these functions according to in/out data type.
7-9
Chapter 7
Application Functions
Program Example
1. LD
%MX0
DEC
%MW100
EN
ENO
IN
OUT
%MW20
2. ST
%MW20 := DEC(EN:=%MX0, IN:=%MW100);
7-10
Chapter 7
Application Functions
1.8. DECO
DECO
Availability
XGF-M32E
Flags
_ERR, _LER
Function
Description
Input
DEC0
BOOL
EN
ENO
BOOL
INT
IN
OUT
*ANY_BIT
Output
DT
TOD
DATE
TIME
LREAL
REAL
ULINT
UDINT
UINT
USINT
LINT
DINT
LWORD
INT
DWORD
SINT
WORD
IN
OUT
BYTE
Variable
ANY type variable
BOOL
Function
1. If EN is 1, it turns on the designated position bit of output bit-string data according to the value of IN, and produces
an output.
2. Output data types are BYTE, WORD, DWORD and LWORD.
FUNCTION
OUT type
DECO
BYTE
DECO
WORD
DECO
DWORD
DECO
LWORD
Description
You can select one of these functions according to output data type.
Flag
Flag
_ERR
Description
If input data is a negative number or bit position data is out of output-type range, (in case of
DECO_WORD, its more than 16), then OUT is 0 and _ERR/_LER flags are set.
7-11
Chapter 7
Application Functions
Program Example
1. LD
%MX0
DECO
ON_
POSITION
EN
ENO
IN
OUT
RELAYS
2. ST
RELAYS := DECO(EN:=%MX0, IN:=ON_POSITION);
7-12
Chapter 7
Application Functions
1.9. DEG
DEG
Availability
XGF-M32E
Flags
DATE
TIME
LREAL
IN
OUT
REAL
ULINT
DINT
INT
UDINT
UINT
Output
SINT
LWORD
Variable
ANY type variable
DWORD
BOOL
ANY_REAL
WORD
ANY_REAL
ENO
OUT
BYTE
EN
IN
BOOL
BOOL
USINT
LINT
Input
DEG
DT
Description
TOD
Function
Function
It converts radian input into degree output.
Function
DEG
DEG
Input type
REAL
LREAL
Output type
REAL
LREAL
Description
It converts input (radian) into output (degree).
Program Example
1. LD
%MX0
DEG
RAD_VAL
EN
ENO
IN
OUT
DEG_VAL
2. ST
DEG_VAL := DEG(EN:=%MX0, IN:=RAD_VAL);
(1) If the transition condition (%M0) is on, DEG function executes.
(2) If input variable RAD_VAL = 1.0, then output variable DEG_VAL = 5.7295779513078550e+001.
7-13
Chapter 7
Application Functions
1.10. DI
1.11. DWORD_LWORD
DWORD_LWORD
Availability
XGF-M32E
Flags
Function
Description
DWORD_LWORD
BOOL
DWORD
DWORD
EN
LOW
HIGH
ENO
OUT
Input
Output
BOOL
LWORD
Function
It combines 2 DWORD data into one LWORD data.
LOW: lower DWORD Input, HIGH: upper DWORD Input
Program Example
1. LD
%MX11
DWORD_LWORD
EN
ENO
INPUT1
LOW
INPUT2
HIGH
OUT
RESULT
2. ST
RESULT := DWORD_LWORD(EN:=%MX11, LOW:=INPUT1, HIGH:=INPUT2);
(1) If the transition condition (%MX11) is on, DWORD_LWORD function executes.
(2) If input variable INPUT1 = 16#1A2A_3A4A and INPUT2 = 16#8C7C_6C5C, then, output variable RESULT =
16#8C7C_6C5C_1A2A_3A4A.
7-14
Chapter 7
Application Functions
1.12. DWORD_LWORD
DWORD_WORD
Availability
XGF-M32E
Flags
Function
Description
DWORD_WORD
BOOL
DWORD
EN
IN
ENO
LOW
HIGH
BOOL
WORD
WORD
Input
Output
Function
It divides one DWORD into two WORD data.
LOW: lower WORD Output, HIGH: upper WORD Output
Program Example
1. LD
%MX5
DWORD_WORD
EN
ENO
INPUT
IN
LOW
WORD_OUT1
HIGH
WORD_OUT2
2. ST
DWORD_WORD(EN:=%MX5, IN:=INPUT, LOW=>WORD_OUT1, HIGH=>WORD_OUT2);
(1) If the transition condition (%MX5) is on, DWORD_WORD function executes.
(2) If input variable INPUT = 16#1122_AABB, then, WORD_OUT1 = 16#AABB and WORD_OUT2= 16#1122.
7-15
Chapter 7
Application Functions
ENCO
ENCO
Availability
XGF-M32E
Flags
_ERR, _LER
Function
Description
Input
ENCO
BOOL
EN
ENO
BOOL
*ANY_BIT
IN
OUT
INT
Output
Function
1.
2.
FUNCTION
IN type
ENCO
BYTE
ENCO
WORD
ENCO
DWORD
ENCO
LWORD
Description
Flag
Flag
_ERR
7-16
Description
OUT is -1 if no bit among input data is 1; _ERR and _LER flags are set.
DT
TOD
DATE
TIME
LREAL
REAL
ULINT
UDINT
UINT
USINT
LINT
DINT
LWORD
INT
DWORD
SINT
WORD
IN
OUT
BYTE
Variable
ANY type variable
BOOL
Chapter 7
Application Functions
Program Example
1. LD
%MX0
ENCO
SWITCHS
EN
ENO
IN
OUT
ON_
POSITION
2. ST
ON_POSITION := ENCO(EN:=%MX0, IN:=SWITCHS);
7-17
Chapter 7
Application Functions
1.13. NIC
Increase IN data by 1
INC
Availability
XGF-M32E
Flags
Function
Description
Input
INC
BOOL
EN
ENO
BOOL
*ANY_BIT
IN
OUT
*ANY_BIT
Output
DT
TOD
DATE
TIME
LREAL
REAL
ULINT
UDINT
UINT
USINT
LINT
DINT
LWORD
INT
DWORD
SINT
WORD
IN
OUT
BYTE
Variable
ANY type variable
BOOL
Function
1.
2.
3.
FUNCTION
IN/OUT type
INC
BYTE
INC
WORD
INC
DWORD
INC
LWORD
Description
You can select one of these functions according to the in/out data type.
7-18
Chapter 7
Application Functions
Program Example
1. LD
%MX0
INC
%MW10
EN
ENO
IN
OUT
%MW100
2. ST
%MW100 := INC(EN:=%MX0, IN:=%MW10);
7-19
Chapter 7
Application Functions
1.14. LWORD_DWORD
LWORD_DWORD
Availability
XGF-M32E
Flags
Function
BOOL
LWORD
LWORD_DWORD
EN
ENO
IN
LOW
HIGH
Description
BOOL
DWORD
DWORD
Input
Output
Function
1.
Program Example
1. LD
%MX10
LWORD_DWORD
EN
ENO
INPUT
IN
LOW
WORD_OUT1
HIGH
WORD_OUT2
2. ST
LWORD_DWORD(EN:=%MX10, IN:=INPUT, LOW=>DWORD_OUT1, HIGH=>DWORD_OUT2);
7-20
Chapter 7
Application Functions
1.15. RAD
RAD
Availability
XGF-M32E
Flags
Function
Description
Input
Output
RAD
BOOL
EN
ENO
BOOL
ANY_REAL
IN
OUT
ANY_REAL
DT
TOD
DATE
TIME
LREAL
IN
OUT
REAL
ULINT
UDINT
UINT
USINT
LINT
DINT
INT
SINT
LWORD
DWORD
WORD
Variable
ANY type variable
BYTE
BOOL
Function
1.
2.
Function
Input type
Output type
RAD
REAL
REAL
RAD
LREAL
LREAL
Description
It converts a degree value ( ) into a radian value.
Program Example
1. LD
RAD
%MX0
DEG_VAL
EN
ENO
IN
OUT
RAD_VAL
2. ST
RAD_VAL := RAD(EN:=%MX0, IN:= DEG_VAL);
(1) If the transition condition (%MX0) is on, RAD_REAL function executes.
(2) If input variable DEG_VAL = 127( ), its output RAD_VAL = 2.21656823.
7-21
Chapter 7
Application Functions
1.16. ROTATE_
1.17. SWAP
SWAP
Availability
XGF-M32E
Flags
IN
OUT
Function
It swaps upper data for lower data.
Function
SWAP
SWAP
SWAP
SWAP
Input type
BYTE
WORD
DWORD
LWORD
Description
Swaps upper nibble for lower nibble data.
Swaps upper byte for lower byte data.
Swaps upper word for lower word data.
Swaps upper double word for lower double word data.
Program Example
1. LD
%MX0
SWAP
INPUT
EN
ENO
IN
OUT
RESULT
2. ST
RESULT := SWAP(EN:=%MX0, IN:=INPUT);
(1) If the transition condition (%MX0) is on, SWAP function executes.
(2) If INPUT (BYTE) = 16#5F, RESULT (BYTE) = 16#F5.
7-22
DATE
TIME
LREAL
REAL
ULINT
UDINT
UINT
USINT
LINT
Output
DINT
INT
Variable
ANY type variable
LWORD
*ANY_BIT
DWORD
BOOL
OUT
WORD
ENO
IN
BYTE
EN
BOOL
BOOL
*ANY_BIT
Input
SINT
SWAP
DT
Description
TOD
Function
Chapter 7
Application Functions
UNI
Unites data
UNI
Availability
XGF-M32E
Flags
_ERR, _LER
Function
Description
DT
TOD
DINT
INT
LWORD
SINT
DWORD
IN
OUT
WORD
Variable
ANY type variable
BYTE
SEG
DATE
TIME
Output
LREAL
*ANY_BIT
REAL
OUT
ULINT
BOOL
UDINT
IN
ENO
UINT
EN
BOOL
BOOL
*ARRAY OF
ANY_BIT
*ARRAY
OF INT
USINT
LINT
Input
UNI
Function
1.
It unites an input data array from the lower bit to a configured bit set by SEG and produces an output.
Function
UNI
UNI
UNI
UNI
Input type
BYTE
WORD
DWORD
LWORD
Output type
BYTE
WORD
DWORD
LWORD
Description
It cuts an input array into bit data set by SET and produces
an output (united data) with the same array type of input.
7-23
Chapter 7
Application Functions
b15
SEG[0]:3
B1
B2
IN[0]
SEG[1]:4
B4
B5
b0
B3
SEG[2]:5
B8
B10
B9
b0
B7
b15
B6
IN[1]
b15
IN[2]
B11
b15
B15
IN[3]
b0
B0
SEG[3]:4
B14 B13
b0
B12
After
Combination
OUT
SEG[3]:4
b15
D3
D2
D1
SEG[1]:4
SEG[2]:5
D0
C4
C3
C2
C1
C0
B3
B2
B1
B0
SEG[0]:3
b0
A0
A2
A1
If the sum of value set by SEG exceeds the bit number of input data type, _ERR and _LER flags are set.
Flag
Flag
_ERR
Description
If the sum of value set by SEG exceeds the bit number of input data type, _ERR and _LER flags are set. If
the number of arrays of IN and SEG is different, output OUT is 0 and _ERR and _LER flags are set.
Program Example
1. LD
%MX0
UNI
EN
ENO
IN_ARY
IN
OUT
SEG_ARY
SEG
RESULT
2. ST
RESULT := UNI(EN:=%MX0, IN:=IN_ARY, SEG:=SEG_ARY);
Chapter 7
Application Functions
IN_ARY[0]
A3B5
SEG_ARY[0]
IN_ARY[1]
B4C6
SEG_ARY[1]
IN_ARY[2]
C5D7
SEG_ARY[2]
IN_ARY[3]
D6E8
SEG_ARY[3]
SEG_ARY[0]
IN_ARY[1]
SEG_ARY[1]
IN_ARY[2]
SEG_ARY[2]
IN_ARY[3]
SEG_ARY[3]
IN_ARY[0]
7-25
Chapter 7
Application Functions
1.18. WORD_BYTE
WORD_BYTE
Availability
XGF-M32E
Flags
Function
Description
WORD_BYTE
BOOL
WORD
EN
IN
ENO
LOW
HIGH
BOOL
BYTE
BYTE
Input
Output
Function
1. It divides one word data into two byte data.
LOW: lower byte output, HIGH: upper byte output
Program Example
1. LD
%MX3
WORD_BYTE
EN
ENO
INPUT
IN
LOW
BYTE_OUT1
HIGH
BYTE_OUT2
2. ST
WORD_BYTE(EN:=%MX3, IN:=INPUT, LOW=>BYTE_OUT1, HIGH=>BYTE_OUT2);
(1) If the transition condition (%MX3) is on, WORD_BYTE function executes.
(2) If input variable INPUT is 16#ABCD, then BYTE_OUT1 = 16#CD and BYTE_OUT2 = 16#AB.
7-26
Chapter 7
Application Functions
1.19. WORD_DWORD
WORD_DWORD
Availability
XGF-M32E
Flags
Function
Description
WORD_DWORD
BOOL
WORD
WORD
EN
LOW
HIGH
ENO
OUT
Input
Output
BOOL
DWORD
Function
It combines two WORD data into one DWORD.
LOW: lower WORD input, HIGH: upper WORD input.
Program Example
1. LD
2. ST
RESULT := WORD_DWORD(EN:=%IX0.0, LOW:=INPUT1, HIGH:=INPUT2);
(1) If the transition condition (%IX0.0) is on, WORD_DWORD function executes.
(2) If input variable INPUT1 = 16#1020 and INPUT2 = 16#A0B0, output variable RESULT=16#A0B0_1020.
7-27
Chapter 7
Application Functions
1.20. XCHG
XCHG
Availability
XGF-M32E
Flags
Function
Description
XCHG
BOOL
EN
ENO
BOOL
Variable
DINT
LINT
USINT
UINT
UDINT
ULINT
REAL
LREAL
TIME
DATE
TOD
DT
ANY
INT
SRC2
SINT
SRC2
SRC1: In/Output 1
SRC2: In/Output 2
LWORD
ANY
In/Out
DWORD
ANY
WORD
SRC1
Output
BYTE
SRC1
BOOL
ANY
Input
SRC1
SRC2
Function
1. Exchanges input1 data with input2 data.
Function
7-28
In/Out type
Description
XCHG
BOOL
XCHG
BYTE
XCHG
WORD
XCHG
DWORD
XCHG
LWORD
XCHG
SINT
XCHG
INT
XCHG
DINT
XCHG
LINT
XCHG
USINT
XCHG
UINT
XCHG
UDINT
XCHG
ULINT
XCHG
REAL
XCHG
LREAL
Chapter 7
Function
In/Out type
Application Functions
Description
XCHG
TIME
XCHG
DATE
XCHG
TOD
XCHG
DT
Program Example
1. LD
XCHG
%MX0
EN
ENO
INPUT1
SRC1
SRC1
INPUT1
INPUT2
SRC2
SRC2
INPUT2
2. ST
XCHG(EN:=%MX0, SRC1:=INPUT1, SRC2:=INPUT2);
(1) If the transition condition (%MX0) is on, XCHG function executes.
(2) If INPUT1 = 0 and INPUT2 = 1, it will exchange two input data. After the function execution, INPUT1 = 1 and INPUT2 = 0.
7-29
Chapter 7
Application Functions
1.21. XNR
XNR
Availability
XGF-M32E
Flags
Function
Description
Input
XNR
BOOL
EN
ENO
BOOL
ANY_BIT
IN1
OUT
ANY_BIT
ANY_BIT
IN2
Output
OUT
Function
1.
It performs XNR operation on the input variables by bit and produces output, OUT.
IN1
XNR
7-30
IN2
OUT
DT
TOD
DATE
TIME
LREAL
REAL
ULINT
IN2
UDINT
UINT
USINT
LINT
LWORD
DINT
DWORD
INT
WORD
IN1
SINT
BYTE
Variable
BOOL
Chapter 7
Application Functions
Program Example
1. LD
2. ST
%QB0.0 := XNR(EN:=%MX0, IN1:=%MB10, IN2:=ABC);
7-31
Chapter 8
8-1
Chapter 8
1.1. CTD
CTD
Availability
XGF-M32E
Flags
Function Block
Description
Input
CTD
BOOL
CD
BOOL
BOOL
LD
CV
ANY
*ANY_INT
PV
DT
TOD
DATE
TIME
LREAL
REAL
ULINT
UDINT
UINT
LINT
USINT
DINT
PV
CV
INT
SINT
LWORD
DWORD
WORD
BYTE
Variable
Any type variable
BOOL
8-2
Down counter function block CTD decreases the current value (CV) by 1 with every rising pulse input.
CV decreases only when CV is more than the minimum value of INT (-32768); after reaching it, CV does not
change its value.
When LD is 1, PV is loaded into CV (CV=PV).
Output Q is 1 when CV is 0 or a negative number.
Function Block
PV
Description
CTD_INT
INT
CTD_DINT
DINT
CTD_LINT
LINT
CTD_UINT
UINT
CTD_UDINT
UDINT
CTD_ULINT
ULINT
Chapter 8
Time Chart
PV setting
CV (current value)
max. coefficient
Q (down counter output)
Program Example
1. LD
2. ST
INST_CTD_INT(CD:=%IX0.0, LD:=_10N, PV:=5, Q=>COUNT_Q, CV=>COUNT_CV);
%QX0.0 := COUNT_Q
This is the program that sets the output contact (%QX0.0) when the down counter pulse input enters the input contact
(%IX0.0) five times.
(1) Register the name of CTD function block (COUNT_D).
(2) Make the input contact (%IX0.0) attached to CD.
(3) Make the flag _10N (1 scan On contact) that loads PV into CV.
(4) Set the PV value as 5 in range of INT ((-32,768~32,767).
(5) Set the CV value as the random output variable (COUNT_CV).
(6) Set the Q value as the random output variable (COUNT_Q).
(7) Compile and write your program to the PLC after completing the program.
(8) After writing, change the PLC mode (Stop -> Run).
(9) If program runs, PV 5 will be loaded into CV (Count_CV).
(10) The current value CV (COUNT_CV) decreases by 1 when the pulse input enters the input contact (%IX0.0).
8-3
Chapter 8
(11) When the down counter pulse input enters the input contact five times, CV (COUNT_CV) will be 0 and Q
(COUNT_CV) will be 1.
(12) If Q (COUNT_Q) is 1, the output contact (%Q0.0) will be set.
8-4
Chapter 8
1.2. CTU
CTU
Availability
XGF-M32E
Flags
Function Block
Description
Input
R: reset input
CTU
BOOL
CU
BOOL
CV
*ANY_INT
BOOL
*ANY_INT
PV
STRING
DT
TOD
DATE
TIME
LREAL
REAL
ULINT
UDINT
UINT
LINT
USINT
DINT
PV
CV
INT
SINT
LWORD
DWORD
WORD
BYTE
Variable
Any type variable
BOOL
Function Block
PV
Description
CTU_INT
INT
CTU_DINT
DINT
CTU_LINT
LINT
CTU_UINT
UINT
CTU_UDINT
UDINT
CTU_ULINT
ULINT
8-5
Chapter 8
Time Chart
R (reset input)
CU (up counter input)
CV (current value)
max.
coefficient
preset
value
Program Example
1.
This is the program that sets the output contact (%QX0.0) when the increase counter pulse input enters the input
contact (%IX0.0) ten times
1. LD
2. ST
INST_CTU_INT(CU:=%IX0.0, R:=%IX0.1, PV:=10, Q=>COUNT_Q, CV=>COUNT_CV);
%QX0.0 := COUNT_Q;
8-6
Chapter 8
8-7
Chapter 8
CTUD
Availability
XGF-M32E
Flags
Function Block
Description
Input
BOOL
BOOL
BOOL
BOOL
*ANY_INT
CU
CD
R
LD
PV
CTUD
QU
QD
CV
BOOL
BOOL
*ANY_INT
R: reset
LD: loads a preset value
PV: preset value
Output QU: up counter output
QD: down counter output
STRING
DT
TOD
DATE
TIME
LREAL
REAL
ULINT
UDINT
LINT
UINT
DINT
USINT
INT
PV
CV
SINT
LWORD
DWORD
WORD
BYTE
Variable
Any type variable
BOOL
Function
1. Up/Down counter function block CTUD increases the current value (CV) by 1 with every rising up-counter pulse
input (CU) and decreases CV by 1 with every rising down-counter pulse input (CD).
2. Note that CV is between -32768 and 32767 (INT).
3. When LD is 1, PV is loaded into CV (CV=PV).
4. When the reset input R is 1, CV is cleared (0).
5. When CV reaches PV, the output QU is 1; when CV is 0 or a negative integer, the output QD is 1.
6. The operation for each input signal executes in order of R > LD > CU > CD. Note that if the input signals are fed to
the input (CU, CD, R, and LD) of CTUD at the same time, the operation of CTU follows the above priority.
8-8
Function Block
PV
Description
CTUD_INT
INT
CTUD_DINT
DINT
CTUD_LINT
LINT
CTUD_UINT
UINT
CTUD_UDINT
UDINT
CTUD_ULINT
ULINT
63
32
63
Chapter 8
Time Chart
R (reset input)
CU (CTU input)
Q (CTU output)
QD (down counter output)
Program Example
1. LD
2. ST
INST_CTUD_INT(CU:=%IX0.0, CD:=%IX0.1, R:=%MX0, LD:=%MX1, PV:=STACK_MAX, QU=>STACK_FULL,
QD=>STACK_EMPTY, CV=>STORED_NUMBER);
Conditions are: the temporary loading part STACK_MAX is 100; IN is 1 with every material-input signal while OUT is 1
with every material-output signal. If the material input process is faster than the material-output one and every material
is loaded so that the STACK_MAX is equal to or more than 100, then QU is 1 (STACK_FULL = 1); if there's no material
left in the loading part, QD is 1 (STACK_EMPTY = 1). At the STORED_NUMBER, the number of remaining material in
the loading part is shown.
8-9
Chapter 8
%MX1
%MX0
%IX0.1.0
%IX1.1.0
STACK_MAX(100)
STORED_
NUMBER
STACK
_FULL
STACK_
EMPTY
8-10
Chapter 8
1.3. FF
FF
Availability
XGF-M32E
Flags
Function Block
Description
FF
BOOL
CLK
BOOL
Input
Output
Function
FF reverses output Q as the input status connected to CLK is changed from 0 to 1.
Time Chart
CLK
Q
Program Example
1. LD
2. ST
INST_FF(CLK:=%IX0.0, Q=>DETECT);
(1) By watching the status of input variable, %IX0.0, when the input is changed from 0 to 1, the DETECT is reversed.
8-11
Chapter 8
1.4. F_TRIG
F_TRIG
Availability
XGF-M32E
Flags
Function Block
Description
F_TRIG
BOOL
CLK
Input
BOOL
Output
Function
1. The output Q of function block F_TRIG is 1 with the falling pulse input to CLK. And 1 scan later, without further falling
pulse input, the output Q is 0 ever after.
Time Chart
CLK
Q
(1 scan or F_TRIG execution time)
Program Example
1. LD
2. ST
INST_F_TRIG(CLK:=%IX0.0, Q=>FALL_DETECT);
(1)
8-12
If the input variable (%IX0.0) changes from 1 to 0, while detecting its state, the output variable FALL_DETECT
is 1. And 1 scan later, the output variable FALL_DETECT is 0.
Chapter 8
1.5. RS
RS
Availability
XGF-M32E
Flags
Function Block
Description
RS
BOOL
BOOL
S
R1
BOOL
BOOL
BOOL
BOOL
Q1
BOOL
Input
Output
RS
RS
Q1
Q1
S
R_1
R1
BOOL
BOOL
Function
Q1
R1
R_1R1
S
Q1
Q1
&
&
Q1
SS
1
QQ1
If R1 is 1, output Q1 is 0 regardless of the state of S. The output variable Q1 is 1 when it maintains the previous state,
R1 is 0, and S is 1, it is 1. The initial state of Q1 is 0.
Time Chart
RR11
R_1
S
SS
Q1
Q1
Q1
8-13
Chapter 8
Program Example
1. LD
SET1SET1
RS
SET1
Q1
S
RESET1
R1
RESET11
RESET
RESULT
SS
RS
RS
QQ1
1
RESULT
RESULT
RR_1
1
2. ST
INST_RS(S:=SET1, R_1:=RESET1, Q=>RESULT);
It outputs the operation results with RESET1 as Reset condition and SET1 as Set condition to RESULT.
Replace the operation conditions; as the above time chart, R_1 to RESET1, S to SET1 and Q1 to RESULT.
8-14
Chapter 8
1.6. RTC_SET
1.7. R_TRIG
R_TRIG
Availability
XGF-M32E
Flags
Function Block
Description
Input
R_TRIG
BOOL
CLK
BOOL
Output Q: rising edge detection result
Function
The output Q of function block R_TRIG is 1 with the rising pulse input to CLK. And 1 scan later, without further rising
pulse input, the output Q is 0.
Time Chart
CLK
Q
(1 scan or R_TRIG execution time)
Program Example
1. LD
IN_SINGAL
R_TRIG
CLK
Q
RISE_DETECT
2. ST
INST_R_TRIG(CLK:=IN_SIGNAL, Q=>RISE_DETECT);
If the input variable IN_SIGNAL changes from 0 to 1, while detecting its state, the output variable RISE_DETECT is 1.
And 1 scan later, the output variable RISE_DETECT is 0.
8-15
Chapter 8
1.8. SR
SR
Availability
XGF-M32E
Flags
Function Block
Description
Input
SR
BOOL
BOOL
S1
R
Q1
SR
SR
BOOL
R: reset condition
SS_1
1
RR
BOOL
BOOL
BOOL
BOOL
Q1
Q1
BOOL
BOOL
Output
Function
Q1
S1
S1
S_1
QQ1
1
&
Q1
R
QQ1
1
&
SS11
S_1
R
RR
Q1
Q1
Q1
8-16
Chapter 8
Program Example
1. LD
SET1 SET1
SR
SET1
S1
RESET1
Q1
RESULT
S1
S_1
RESET
1
RESET1
SR
SR
QQ1
1
RESULT
RESULT
RR
2. ST
INST_SR(S_1:=SET1, R:=RESET1, Q=>RESULT);
8-17
Chapter 8
1.9. TOF
TOF
Availability
XGF-M32E
Flags
Function Block
Description
Input
TOF
BOOL
TIME
IN
PT
Q
ET
BOOL
TIME
Output
Q: timer output
ET: elapsed time
Function
1.
2.
3.
If IN is 1, Q is 1. And after IN becomes 0 and the preset time (PT) of TOF passes, Q becomes 0.
After IN becomes 0, the elapsed time (ET) is shown.
If IN becomes 1 before ET reaches the preset time, ET is 0 again.
Time Chart
IN
Q
Setting (PT)
Time
ET
8-18
PT
Chapter 8
Program Example
1. LD
TOF
T_OFF
T#10S
IN
TIMER_OK
PT
ET
ET_TIME
2. ST
INST_TOF(IN:=T_OFF, PT:=T#10S, Q=>TIMER_OK, ET=>ET_TIME);
T_OFF
TIMER_OK
10S
10S
Setting Time
(10S)
ET_TIME
(1)
(2)
(3)
Output variable TIMER_OK is 1 when input variable T_OFF becomes 1. TIMER_OK is 0 only if 10 seconds
passes after T_OFF becomes 0.
If T_OFF becomes 1 again in 10 seconds after it turned off, TOF is initialized (TIMER_OK is 1).
After T_OFF becomes 0, the elapsed time (ET_TIME) is measured and shown.
8-19
Chapter 8
1.10. TON
TON
Availability
XGF-M32E
Flags
Function Block
Description
Input
TON
BOOL
TIME
IN
PT
Q
ET
BOOL
TIME
Output
Q: timer output
ET: elapsed Time
Function
1.
2.
3.
Time Chart
IN
Q
Setting
(PT)
Time
ET
8-20
PT
PT
Chapter 8
Program Example
1. LD
TON
T_ON
T#10S
IN
TIMER_OK
PT
ET
ET_TIME
2. ST
INST_TON(IN:=T_ON, PT:=T#10S, Q=>TIMER_OK, ET=>ET_TIME);
TON
10s
10s
TIMER_OK
Setting Time
10S
ET_TIME
(1) The output TIMER_OK = 1 ten seconds later after the input T_ON is asserted (T_ON = 1).
(2) After input variable T_ON is 1, the elapsed time is output to output variable, ET_TIME.
(3) When T_ON = 0 before ET_TIME reaches the preset time (10s), ET_TIME is 0.
(4) If T_ON = 0 after TIMER_OK = 1, then TIMER_OK = 0 and ET_TIME = 0.
8-21
Chapter 8
1.11. TP
TP
Availability
XGF-M32E
Flags
Function Block
Description
Input
TP
BOOL
TIME
IN
PT
Q
ET
BOOL
TIME
Output
Q: timer output
ET: elapsed Time
Function
1.
2.
3.
Time Chart
IN
Q
Setting
(PT)
Time
ET
8-22
PT
PT
PT
Chapter 8
Program Example
1. LD
TP
T_TP
T#10S
IN
TIMER_OK
PT
ET
ET_TIME
2. ST
INST_TP(IN:=T_TP, PT:=T#10S, Q=>TIMER_OK, ET=>ET_TIME);
T_TP
TIMER_OK
10s
10s
10s
Setting (10S)
Time
ET_TIME
(1) TIMER_OK is 1 during 10 seconds after input T_TP was asserted (T_TP = 1). While ET_TIME increases during
10 seconds, the state of input T_TP doesn't affect TIMER_OK.
(2) ET_TIME increases when it reaches T#10S and then it becomes 0 when T_TP = 0.
Note
TP function block keeps operating until its operation is complete even if the contact is changed from on to off. In case
of a variable using array index, array index error occurs only when the contact is on. Therefore, TP function block
does not produce any array index error as long as the contact is off although function block is operating.
8-23
Chapter 9
9-1
Chapter 9
1.1. CTR
Ring Counter
CTR
Availability
XGF-M32E
Flags
Function Block
BOOL
INT
BOOL
CD
PV
RST
CTR
Q
CV
Description
Input
Output
BOOL
INT
Function
1.
2.
3.
CTR function block (Ring Counter) functions: current value (CV) increases with the rising pulse input (CD) and if, after CV
reaches PV, CD becomes 1, then CV is 1.
When CV reaches PV, output Q is 1.
If CV is less than PV or reset input (RST) is 1, output Q is 0.
Time Chart
R (Reset)
CD (Pulse input)
PV (Preset value)
CV (Current value)
Q (CTR output)
9-2
Chapter 9
Program Example
Output %QX0.0 is on with 10-time rising pulse input of %IX0.0 is depicted as follows:
1. LD
2. ST
9-3
Chapter 9
1.2. DUTY
1.3. TMR
Integration Timer
TMR
Availability
XGF-M32E
Flags
TMR
Function Block
Description
TMR
BOOL
TIME
BOOL
IN
PT
RST
Q
ET
Input
Output
Q: timer output
ET: elapsed time
BOOL
TIME
Function
1. When IN is 1, elapsed time is produced at ET.
2. Even if IN is 0 before ET reaches PT, ET keeps its value. If IN is 1 again, elapsed time is produced at ET integrating its
previous value.
3. If ET reaches PT, Q is 1.
4. If RST is 1, Q and ET are 0.
Time Chart
IN
RST
PT
ET
PT
Q
9-4
Chapter 9
Program Example
1. LD
2. ST
INST_TMR(IN:=T_TMR, PT:=T#10S, RST:=%IX1.1.12, Q=>TIMER_OK, ET=>ET_TIME);
T_TMR
%IX1.1.12
PT(10S)
ET_TIME
10S
TIMER_OK
(1) If 10 seconds passes after input variable T_TMR is 1, output variable TIMER_OK is 1.
(2) Elapsed time is produced at ET_TIME after T_TMR is 1.
(3) ET_TIME keeps its value even if T_TMR is 0 before ET_TIME reaches its preset time 10 seconds.
(4) If T_TMR is 1, elapsed time is produced at ET_TIME integrating its previous value.
(5) If input contact %IX0.0 is 1, elapsed time ET_TIME and output variable TIMER_OK are all cleared.
9-5
Chapter 9
1.4. TMR_FLK
TMR_FLK
Availability
XGF-M32E
Flags
FLK
Function Block
Description
Input
TMR_FLK
BOOL
TIME
TIME
BOOL
IN
ON
OFF
RST
Q
ET
BOOL
TIME
Output
Function
1. As soon as IN gets 1, Q becomes 1 and Q maintains its value during on setting time.
2. After setting time which is set by on, Q is 0 during the time which is set by off.
3. If IN is 0, it stops its function of either on or off operation and keeps its time. If IN is 1 again, it executes with its previous data.
4. Output Q is 0 while IN is 0.
5. If ON is 0, output Q is always 0.
Time Chart
IN
ON
ON TIME
ON TIME
OFF TIME
OFF
9-6
OFF TIME
Chapter 9
Program Example
1. LD
2. ST
INST_TMR_FLK(IN:=T_TMR_FLK, ON:=T#5S, OFF:=T#2S, RST:=%IX0.0, Q=>%QX0.0, ET=>ET_TIME);
9-7
Chapter 9
1.5. TMR_UINT
TMR_UINT
Availability
XGF-M32E
Flags
Function Block
Description
TMR_UINT
BOOL
UINT
UINT
BOOL
Q
ET
IN
PT
UNIT
RST
Input
Output
Q: timer output
ET: elapsed time
BOOL
UDINT
Function
1. Elapsed time is produced at ET after IN is 1.
2. Even if IN is 0 before ET reaches PT, ET keeps its value. If IN is 1 again, elapsed time is increased.
3. Q is 1 when elapsed time reaches preset time.
4. If RST is 1, Q and ET are 0.
5. Setting time is PT x UNIT (ms).
Time Chart
IN
RST
Setting Time
(PT * UNIT)
ET
9-8
PT * UNIT
Chapter 9
Program Example
1. LD
2. ST
INST_TMR_UINT(IN:=T_TMR, PT:=10, UNIT:=1000, RST:=%IX0.0, Q=>TIMER_OK, ET=>ET_TIME);
T_TMR
%IX1.1.5
Setting Time
(10,000ms)
ET_TIME
TIMER_OK
10 * 1000
9-9
Chapter 9
1.6. TOF_RST
TOF_RST
Availability
XGF-M32E
Flags
Function Block
Description
Input
TOF_RST
BOOL
TIME
BOOL
IN
PT
RST
Q
ET
BOOL
TIME
Output
Function
1. Q is 1 when IN is 1 and Q is 0 when preset time (PT) elapses after IN became 0.
2. Elapsed time is produced at ET after IN is 0.
3. Elapsed time is 0 if IN is 1 before ET reaches PT.
4. If RST is 1, Q and ET are 0.
Time Chart
IN
RST
Setting Time
(PT)
ET
Q
9-10
PT
PT
Chapter 9
Program Example
1. LD
2. ST
INST_TOF_RST(IN:=T_TOF_RST, PT:=T#10S, RST:=%IX0.0, Q=>TIMER_OK, ET=>ET_TIME);
T_TOF_RST
%IX1.1.15
Setting Time
(10S)
10S
10S
ET_TIME
TIMER_OK
(1) If input variable T_TOF_RST is 1, output variable TIMER_OK is 1. And TIMER_OK is 0 when 10 seconds elapse
after T_TOF_RST became 0.
(2) If T_TOF_RST is 1 within 10 seconds after it turns off, TOF_RST is initialized.
(3) Elapsed time is produced at ET_TIME.
(4) If input contact %IX0.0 is 1, elapsed time ET_TIME and output contact TIMER_OK are all cleared.
Note
TOF_RST Function Block keeps operating after the contact is on until its operation is complete. In case of a variable
using array index, array index error occurs only when the contact is on. Therefore, TOF_RST Function Block does not
produce any array index error as long as the contact is off ,although function block is operating.
9-11
Chapter 9
1.7. TOF_UINT
TOF_UINT
Availability
XGF-M32E
Flags
Function Block
Description
TOF_UINT
BOOL
UINT
UINT
BOOL
IN
PT
UNIT
RST
Input
Q
ET
BOOL
TIME
Output
Function
1. Q is 1 when IN is 1. And Q is 0, if setting time (PT) passes after IN is 0.
2. Elapsed time is produced at ET after IN is 0.
3. If IN is 1 before ET reaches PT, ET becomes 0 again.
4. If RST is 1, Q and ET are 0.
5. Setting time is PT x UNIT (ms).
Time Chart
IN
RST
Setting Time
(PT * UNIT)
ET
Q
9-12
PT*UNIT
PT*UNIT
Chapter 9
Program Example
1. LD
2. ST
INST_TOF_UINT(IN:=T_TOF, PT:=10, UNIT:=1000, RST:=%IX0.0, Q=>TIMER_OK, ET=>ET_TIME);
T_TOF
%IX1.1.5
Setting Time
(10 * 1000)
10 * 1000
10 * 1000
ET_TIME
TIMER_OK
Note
TOF_UINT Function Block keeps operating after the contact is on until its operation is complete. In case of a
variable using array index, array index error occurs only when the contact is on. Therefore, TOF_UINT Function
Block does not produce any array index error as long as the contact is off although function block is operating.
9-13
Chapter 9
1.8. TON_UINT
TON_UINT
Availability
XGF-M32E
Flags
Function Block
Description
Input
TON_UINT
BOOL
UINT
UINT
IN
PT
UNIT
Q
ET
BOOL
TIME
Output
Function
1. Elapsed time is produced at ET after IN is 1.
2. Elapsed time ET is 0, if IN is 0 before ET reaches PT.
3. Q is 0, if IN is 0 after Q is 1.
4. Preset time is PT x UNIT[ms].
Time Chart
IN
Setting Time
(PT* UNIT)
ET
Q
9-14
PT * UNIT
Chapter 9
Program Example
1. LD
TON_UINT
Q
IN
T_TON
10
1000
PT
ET
TIMER_OK
ET_TIME
UINT
2. ST
INST_TON_UINT(IN:=T_TON, PT:=10, UNIT:=1000, Q=>TIMER_OK, ET=>ET_TIME);
TP_RST
T_TON
Setting time
(10,000ms)
ET_TIME
10*1000
TIMER_OK
9-15
Chapter 9
1.9. TP_RST
TP_RST
Availability
XGF-M32E
Flags
Function Block
Description
Input
TP_RST
BOOL
TIME
BOOL
IN
PT
RST
Q
ET
BOOL
TIME
Output
Function
1. If IN is 1, Q is 1. And if elapsed time reaches preset time, timer output Q is 0.
2. ET increases its value from when IN is 1, keeps its value at PT and is cleared when IN is 0.
3. It doesn't matter whether IN changes its state or not while timer output Q is 1 (during a pulse output).
4. If RST is 1, output Q and ET are 0.
Time Chart
IN
RST
Setting Time
(PT)
ET
PT
9-16
Chapter 9
Program Example
1. LD
2. ST
INST_TP_RST(IN:=T_TP_RST, PT:=T#10S, RST:=%IX0.0, Q=>TIMER_OK, ET=>ET_TIME);
(1) If input variable T_TP_RST is 1, output variable TIMER_OK is 1. And 10 seconds later, TIMER_OK is 0. Once
TP_RST timer executes, input T_TP_RST doesn't matter during 10 seconds.
(2) ET_TIME value increases and stops at 10S. And if T_TP_RST is 0, ET_TIME becomes 0.
(3) If input contact %IX0.0 is 1, TIIMER_OK and ET_TIME are all cleared.
Note
TP_RST Function Block keeps operating after the contact is on until its operation is complete. In case of a variable
using array index, array index error occurs only when the contact is on. Therefore, TP_RST Function Block does not
produce any array index error as long as the contact is off although function block is operating.
9-17
Chapter 9
1.10. TP_UINT
TP_UINT
Availability
XGF-M32E
Flags
Function Block
Description
Input
TP_UINT
BOOL
UINT
UINT
BOOL
IN
PT
UNIT
RST
Q
ET
BOOL
TIME
Output
Function
(1) If IN is 1, Q is 1. And if elapsed time reaches preset time, timer output Q is 0.
(2) ET increases its value from when IN is 1, keeps its value at PT and is cleared when IN is 0.
(3) It does not matter whether IN changes its state or not while timer output Q is 1 (during a pulse output).
(4) If RST is 1, output Q and ET are 0.
(5) Preset time is PT x UNIT[ms].
Time Chart
IN
RST
Setting Time
(PT*UNIT)
ET
9-18
PT*UNIT
Chapter 9
Program Example
1. LD
2. ST
INST_TP_UINT(IN:=T_TP, PT:=10, UNIT:=100, RST:=%IX0.0, Q=>TIMER_OK, ET=>ET_TIME);
Note
TP_UINT Function Block keeps operating after the contact is on until its operation is complete. In case of a variable
using array index, array index error occurs only when the contact is on. Therefore, TP_UINT Function Block does not
produce any array index error as long as the contact is off although function block is operating.
9-19
Chapter 9
1.11. TRTG
Retriggerable Timer
TRTG
Availability
XGF-M32E
Flags
Function Block
Description
Input
TRTG
BOOL
TIME
BOOL
IN
PT
RST
Q
ET
BOOL
TIME
Output
Function
1. Q is 1 as soon as IN becomes 1. And if elapsed time reaches preset time, timer output Q is 0.
2. If IN turns on again before elapsed time reaches preset time, then elapsed time is set as 0 and increased again. And if it reaches
PT, Q is 0.
3. If RST is 1, timer output Q and elapsed time ET are 0.
Time Chart
IN
RST
Setting Time
(PT)
ET
Q
9-20
PT
Chapter 9
Program Example
1. LD
2. ST
INST_TRTG(IN:=T_TRTG, PT:=10, RST:=%IX0.0, Q=>TIMER_OK, ET=>ET_TIME);
(1) TIMER_OK is 1 during 10 seconds after input variable T_TRTG becomes 1 from 0. If T_TRTG becomes 1 from 0
after timer executes, ET_TIME is set as 0 and increased again.
(2) TIMER_OK is 1 during 10 seconds even when T_TRTG becomes 0 from 1.
(3) ET_TIME value increases and stops at T#10S. And it is 0 when T_TRTG is 0.
(4) If input contact %IX0.0 is 1, TIMER_OK and ET_TIME are all cleared.
Note
TRTG Function Block keeps operating after the contact is on until its operation is complete. In case of a variable
using array index, array index error occurs only when the contact is on. Therefore, TRTG Function Block does not
produce any array index error as long as the contact is off although function block is operating.
9-21
Chapter 9
1.12. TRTG_UINT
TRTG_UINT
Availability
XGF-M32E
Flags
Function Block
Description
Input
TRTG_UINT
BOOL
UINT
UINT
BOOL
IN
PT
UNIT
RST
Q
ET
BOOL
TIME
Output
Function
1.
2.
3.
4.
Q is 1 as soon as IN becomes 1. And if elapsed time reaches preset time, timer output Q is 0.
If IN turns on again before elapsed time reaches preset time, then elapsed time is set as 0 and increased again. And if it
reaches PT, Q is 0.
If RST is 1, timer output Q and elapsed time ET are 0.
Preset time is PT x UNIT[ms].
Time Chart
IN
RST
Setting Time
(PT*UNIT)
PT*UNIT
Q
9-22
Chapter 9
Program Example
1. LD
2. ST
INST_TRTG_UINT(IN:=T_TRTG, PT:=10, UNIT:=100, RST:=%IX0.0, Q=>TIMER_OK, ET=>ET_TIME);
Note
TRTG_UINT Function Block keeps operating after the contact is on until its operation is complete. In case of a variable
using array index, array index error occurs only when the contact is on. Therefore, TRTG_UINT Function Block does
not produce any array index error as long as the contact is off, although function block is operating.
9-23
Chapter 10
MC_MoveAbsolute
MC_MoveRelative
MC_MoveAdditive
MC_Halt
MC_MoveVelocity
MC_TorqueControl
MC_MoveContinousAbsolute
MC_MoveContinousRelative
Continuous
Motion
Discrete Motion
MC_Stop
Stopping
Done
ErrorStop
*1
*6
*4
*3
*5
Disabled
MC_Home
Homing
Done
Standstill
*2
*1 ErrorStop: in case axis error occurs regardless of the current state of axis
*2 Disabled: in case MC_Power.Enable input is Off when axis error does not occur
*3 ErrorStop Disabled: in case MC_Reset command has issued when MC_Power.Status output is Off
*4 ErrorStop Standstill: in case MC_Reset command has issued when MC_Power.Status output is on and
MC_Power.Enable input is On
*5 Disabled Standstill: in case of turning On MC_Power.Enable input when MC_Power.Status output is On
*6 Stopping Standstill: in case of turning Off MC_Stop.Execute input when MC_Stop.Done output is On
10-1
Chapter 10
Description
Disabled
Disabled state indicates the state in which no command is given to a single axis, and no
error occurs. In case there is no motion control module at the time of first operation, each
axis begins in the disabled state. Afterwards, axis status is changed to standstill state in
case servo-on status emerges when Enable input of servo On/Off (MC_Power) motion
function block is On. The axis becomes disabled state when Enable input of serve On/Off
(MC_Power) motion function block is Off in case of not being in ErrorStop state. In case
there is motion function block which is currently being performed, the command is
interrupted.(The CommandAborted output of the motion block function is On)
ErrorStop
No matter which state the current axis is in, it is changed to ErrorStop state when axis error
occurs, and the axis decelerates to stop. In the state where error occurs, ErrorStop state is
maintained even though servo On/Off (MC_Power) motion function block is executed. The
motion axis which is in ErrorStop state maintains stationary state, and any command
except for error reset is not executed.
StandStill
When the power of axis is activated, there is no error in the axis and any command is not
made, the axis state indicates StandStill state.
Homing
Stopping
In case emergency stop (MC_Stop) function block is executed, the axis state is changed
to stopping state. When the axis is in stopping state, other motion commands cannot be
given to the axis until the Stop is completed (until Done output is activated). If Done output
is On, and Execute input is On, the state is switched to Standstill status.
Continuous Motion
It indicates state where operation continues until the current axis becomes operation stop
status.
Discrete Motion
Synchronized Motion
10-2
Chapter 10
*1
MC_GroupHalt
GroupMoving
MC
_G
*2
rou
pS
MC_GroupStop
top
Error
GroupStopping
Error
GroupHoming
Done
Error
Done
MC
_G
op
*1
ro
up
St
Ho
p
ou
*3
GroupErrorStop
me
G
C_
Error
et
es
MC_GroupEnable
GroupDisabled
GroupStandby
MC_GroupDisable
MC_UngroupAllAxes
MC_RemoveAxisFromFroup
MC_AddAxisToGroup
MC_RemoveAxisFromGroup
MC_UngroupAllAxes
*4
R
up
*2
r
_G
MC
MC_AddAxisToGroup
MC_RemoveAxisFromGroup
*5
*1 GroupMoving: in case of performing the motion function block of general group operation
*2 GroupStopping, GroupErrorStop: The relevant motion function block is not performed when different motion function
block is performed in GroupStopping or GroupErrorStop state, and when MC_GroupReset function block is performed
in GroupErrorStop state, the state of the relevant group is changed to GroupStandby.
*3 GroupStopping -> GroupStandby: when MC_GroupStop.DONE output is On and MC_SroupStop.EXECUTE input
is Off
*4 GroupStandby -> GroupDisabled: in case there is no axis belonging to the group when performing the axis remove
command (MC_RemoveAxisFromGroup, MC_UnGroupAllAxes)
*5 GroupStandby: in case more than one axis belongs to the group when performing the axis add or remove command
in group (MC_AddAxisToGroup, MC_RemoveAxisFromGroup)
*6 GroupDisabled: When performing MC_GroupDisable or MC_UnGroupAllDisable function block, the relevant group is
changed to GroupDisabled state regardless of its current state.
10-3
Chapter 10
Execute
Busy
Active
Done
Error
CommandAborted
(a)
(b) (c)
(a)
(d) (e)
Variable
Execute
(a)
(f)
(g)
(a)
(h)
Description
This is an input to run the relevant function block in Edge operation function block.
Function block is executed in the rising Edge. (Figure a state)
This is an output to indicate the relevant motion function block is currently running (= not
completed), and this indicates the output of motion function block can be changed.
Busy
Busy output is On in the rising Edge of Execute input (Figure a state), and it is Off when
Done output is On (Figure b state), CommandAborted output is On (Figure d state), or
Error output is On (Figure f state).
This indicates the relevant motion function block is actually controlling axis.
When running many motion function block to one axis (in case only one motion function
Active
block is controlling and other notion function blocks are Buffered), Active output is On in
only one motion function block which is controlling, and in motion function blocks which
are Buffered, Busy output is On.
This is an output to indicate operation of the relevant motion function block has been
successfully completed.
Done
If Done output is On, Busy and Active output is Off. (Figure d state)
Done output is Off when Execute input is Off (Figure e state), if Execute output was Off
when Done output became On, it remains On only during 1 scan (Figure h state).
This is an output to indicate an error occurs while running motion function block.
Error
Error output is Off when Execute input is Off (Figure f state). If Execute output was Off
when Error output became On, it remains On only during 1 scan (Figure h state).
ErrorID
10-4
This outputs error code regarding the relevant error when an error occurs while running
motion function block. ErrorID output and elimination time are same with Error output.
Chapter 10
This indicates the relevant motion function block is interrupted by the other motion
function block. CommandAborted output is Off when Execute input is Off (Figure g
CommandAborted
state). If Execute output was Off when Done output became On, it remains On only
during one scan.
When Execute input is On in Edge operation(Execute input) motion function block, depending on
the state of axis, one output in Busy, Done, Error, and CommandAborted output is On. Busy, Done,
Error, and CommandAborted output are available to be On one at a time, and if one output in four is
On, other three outputs become Off.
Motion function block for level motion
Enable
Busy
Vaild
Error
(a)
(b)
Variable
(c)
(d) (e)
(f)
(g)
Description
This is an input to run function block for level operation motion.
Enable
This runs motion function block in the rising Edge (Figure a state), and stops it in the falling
Edge(Figure b state).
This is an output to indicate the relevant motion function block is currently running ((= not
Busy
completed), and it indicates the output of motion function block can be changed. Busy output is On
in the rising Edge of Enable input (Figure b state), and it remains on while motion function is in
operation.
This is an output to indicate the relevant motion function block is successfully performed and output
Valid
Error
Chapter 10
Axis input
Each motion function block can be specified by Axis input to the axis which is subject to the relevant command.
Motion control module can control 1-32 actual axes and 37~40 virtual axes, and 41-41 encoders can be used as
main axis depending on motion function block. Therefore, values of 1~32, 37~40, and 41~42 can be input in Axis
input depending on motion function block. When it is out of the range which is available to set in each motion function
block, "error 0x0006occurs.
Buffer Mode
mcAborting
mcBuffered
mcBlendingLow
mcBlendingPrevious
mcBlendingNext
mcBlendingHigh
Explanation
10-6
Chapter 10
TRANSITION Mode
TMNone
TMCornerDistance
Explanation
Do not generate a connection track.
Generate a connection track which specifies the corner distance of a
connection track and draws circular arcs at the specified corner
distance.
TransitionMode TMNone
Connection track is not generated. TransitionMode input is available only to TMNone in case BufferMode input of motion
function block is Aborting or Buffered.
The Figure below shows the case when running BufferMode of motion function block in the setting of Aborting. The
Figure in the left shows that motion function block is executed in the setting of Aborting while motion function block
is running. Motion function block is forced to be terminated at 'end point / starting point ' without reaching 'end point
'. The Figure in the right shows that deceleration pause is performed at the moment of the execution of Aborting
function block, and the next motion function block is executed.
The Figure below shows that the case when running BufferMode of motion function block in the setting of Buffered. The
Figure in the left shows that motion function block is executed in the setting of 'Buffered while motion function block
is running. Motion function block is executed after motion function block has reached target position. The Figure in
the right shows that when Buffered function block is executed, the next motion function block is executed after it reaches
original target position.
10-7
Chapter 10
The radius of a connection track is specified and the connection track which draws a circle having specified radius is
output. This mode is operated only when BufferMode is BlendingXXXX, and it is operated in TMNone when
BufferMode is Aborting or Buffered.
When drawing a connection track, the maximum speed of the path complies with the specified speed in BufferMode, and
the length of radius complies with the value specified in TransitionParameter.
The Figure below shows the generation of a connection track which draws radius circle in two linear interpolation
commands. The Figure in the left shows that motion function block is executed in the setting of TMcornerDistance
while motion function block is running. The original target position of motion function block was end point / starting
point , but straight-line motion is stopped and circular motion is started at the point ahead as far as radius 'd' (end point
). Circular operation starts at end point and finishes at starting point , and executes motion function block .
The Figure in the right shows that the speed does not stop in the middle of two function blocks and continues.
10-8
Chapter 10
10-9
Chapter 10
MC_Power
Availability
Servo On/OFF
XGF-M32E
MC_Power
BOOL
UINT
Enable
Axis
Status
Axis
Vaild
Error
ErrorID
BOOL
UINT
BOOL
BOOL
WORD
Input-Output
UINT
Axis
Specify the axis to be commanded (1~32: real axis, 37~40: virtual axis)
Enable
BOOL
Status
BOOL
Valid
Indicate the validity of motion function block output. (same with Status output here)
BOOL
Error
WORD
ErrorID
Output the number of error occurred while motion function block is running.
Input
BOOL
Output
(1) This motion function block is to give servo On/Off command to the relevant axis.
(2) When Enable input is On, Servo On command is given to the relevant axis, and when it is Off, servo Off command is
given.
(3) If servo On command is executed when the axis is in 'Disable' state, the axis state is 'StandStill', and failure in servo
On brings 'ErrorStop' state.
10-10
Chapter 10
MC_Home
Availability
XGF-M32E
MC_Home
BOOL
UINT
LREAL
UINT
Execute
Axis
Position
BufferMode
Done
Axis
Busy
Active
CommandAborted
Error
ErrorID
BOOL
UINT
BOOL
BOOL
BOOL
BOOL
WORD
Input-Output
UINT
Axis
Specify the axis to be commanded (1~32: real axis, 37~40: virtual axis)
BOOL
Execute
LREAL
Position
UINT
BufferMode
Input
Output
BOOL
Done
BOOL
Busy
BOOL
Active
Indicate that the current motion function block is controlling the relevant axis.
BOOL
CommandAborted
Indicate that the current motion function block is interrupted by other command.
BOOL
Error
WORD
ErrorID
Output the number of error occurred while motion function block is running.
(1) This motion function block is to give a homing command to the relevant axis.
(2) Homing method is operated as specified in the operation parameter of the relevant axis in advance.
(3) As for Position input, absolute position of axis is specified when Reference Signal is detected or homing is completed.
(4) While this motion function block is running, the axis is 'Homing' state, and when the command is completed, it is
switched to 'Standstill'.
10-11
Chapter 10
MC_STOP
Availability
Stop immediately
XGF-M32E
MC_Stop
BOOL
UINT
LREAL
LREAL
Execute
Axis
Deceleration
Jerk
Done
Axis
Busy
CommandAborted
Error
ErrorID
BOOL
UINT
BOOL
BOOL
BOOL
WORD
Input-Output
UINT
Axis
Specify the axis to be commanded (1~32: real axis, 37~40: virtual axis)
BOOL
Execute
Give immediate stop command to the relevant axis in the rising Edge.
LREAL
Deceleration
LREAL
Jerk
BOOL
Done
BOOL
Busy
BOOL
CommandAborted
Indicate that the current motion function block is interrupted while it is running.
BOOL
Error
WORD
ErrorID
Output the number of error occurred while motion function block is running.
Input
Output
(1) This motion function block is to give an emergency stop command to the relevant axis.
(2) When executing immediate stop (MC_Stop) motion function block, the existing motion function block being executed
in the relevant axis is stopped, and the axis state changed to 'Stopping'. When the relevant axis is in 'Stopping state,
other motion function block cannot be executed in the relevant axis until the stopping is completed (until the Done
output is activated).
(3) CommandAborted output indicates that the current motion function block is interrupted while it is running. Other motion
function block cannot interrupt immediate stop (MC_Stop) motion function block while immediate stop (MC_Stop)
motion function block is running, therefore, CommandAborted output is On in general when the power of servo is
blocked or servo Off command is executed.
(4) If Execute input is On or the speed of axis is not 0, the axis is in 'Stopping' state, and when Done output is On and
Execute input is Off, it is switched to 'Standstill' state.
10-12
Chapter 10
MC_Halt
Availability
Stop
XGF-M32E
MC_Halt
BOOL
UINT
LREAL
LREAL
UINT
Execute
Axis
Deceleration
Jerk
BufferMode
Done
Axis
Busy
Active
CommandAborted
Error
ErrorID
BOOL
UINT
BOOL
BOOL
BOOL
BOOL
WORD
Input-Output
UINT
Axis
Specify the axis to be commanded (1~32: real axis, 37~40: virtual axis)
BOOL
Execute
LREAL
Deceleration
LREAL
Jerk
UINT
BufferMode
Input
Output
BOOL
Done
BOOL
Busy
BOOL
Active
Indicate that the current motion function block is controlling the relevant axis.
BOOL
CommandAborted
Indicate that the current motion function block is interrupted while it is running.
BOOL
Error
WORD
ErrorID
Output the number of error occurred while motion function block is running.
(1) This motion function block is to give a stop command to the relevant axis.
(2) The axis is 'DiscreteMotion' state while this motion function block is running, and when the speed of the relevant axis is
0, Done output is On and changed to 'Standstill' state.
10-13
Chapter 10
MC_MoveAbsolute
Availability
XGF-M32E
MC_MoveAbsolute
BOOL
UINT
BOOL
LREAL
LREAL
LREAL
LREAL
LREAL
UINT
UINT
Execute
Axis
ContinuousUpdate
Position
Velocity
Acceleration
Deceleration
Jerk
Direction
BufferMode
Done
Axis
Busy
Active
CommandAborted
Error
ErrorID
BOOL
UINT
BOOL
BOOL
BOOL
BOOL
WORD
Input-Output
UINT
Axis
Specify the axis to be commanded (1~32: real axis, 37~40: virtual axis)
Input
BOOL
Execute
Give an absolute position operation command to the relevant axis in the rising
Edge.
Specify the update setting of input value.
BOOL
ContinuousUpdate
LREAL
Position
LREAL
Velocity
LREAL
Acceleration
LREAL
Deceleration
LREAL
Jerk
Direction
UINT
10-14
BufferMode
Chapter 10
Output
BOOL
Done
BOOL
Busy
BOOL
Active
Indicate that the current motion function block is controlling the relevant axis.
BOOL
CommandAborted
Indicate that the current motion function block is interrupted while it is running.
BOOL
Error
WORD
ErrorID
Output the number of error occurred while motion function block is running.
(1) This motion function block is to give the relevant absolute position operation commands.
(2) Operation direction of the axis in Infinite length repetition operation is set in Direction input, and if Infinite length
repetition operation is set to Prohibited, Direction input is ignored. When Direction input is the shortest distance(=2),
the relevant axis doing Infinite length repetition operation automatically selects the direction which allows the shortest
distance. The available range is 0-4 (0-Not specified, 1-Forward direction, 2-Shortest distance, 3-Reverse direction,
4-Current direction), and "error 0x1017 occurs in case of excess of the range.
(3) On condition that there is no motion function block is on standby after the current motion function block, If the speed
is 0 after reaching the target point, operation is completed and Done output is On.
(4) The axis is in 'DiscreteMotion' state while this motion function block is running, and it is switched to 'Standstill' state
when operation is completed.
10-15
Chapter 10
MC_MoveRelative
Availability
XGF-M32E
MC_MoveRelative
BOOL
UINT
BOOL
LREAL
LREAL
LREAL
LREAL
LREAL
UINT
Execute
Axis
ContinuousUpdate
Distance
Velocity
Acceleration
Deceleration
Jerk
BufferMode
Done
Axis
Busy
Active
CommandAborted
Error
ErrorID
BOOL
UINT
BOOL
BOOL
BOOL
BOOL
WORD
Input-Output
UINT
Axis
Specify the axis to be commanded (1~32: real axis, 37~40: virtual axis)
Input
BOOL
Execute
Give an absolute position operation command to the relevant axis in the rising
Edge.
Specify the update setting of input value.
BOOL
ContinuousUpdate
LREAL
Distance
LREAL
Velocity
LREAL
Acceleration
LREAL
Deceleration
LREAL
Jerk
UINT
BufferMode
Output
BOOL
Done
BOOL
Busy
BOOL
Active
Indicate that the current motion function block is controlling the relevant axis.
BOOL
CommandAborted
Indicate that the current motion function block is interrupted while it is running.
10-16
Chapter 10
BOOL
Error
WORD
ErrorID
Output the number of error occurred while motion function block is running.
(1) This motion function block is to give relative position operation command to the relevant axis.
(2) Relative position motion (MC_MoveRelative) is the motion function block which moves as far as the target distance
specified in Distance input from the current position.
(3) Moving direction is decided depending on the sign of the target distance specified in Distance input, and positive (+ or
No sign) moving direction leads to the forward direction, and negative (-) moving direction leads to the reverse direction.
(4) If there is no motion function block is on standby after the current motion function block and the speed is 0 after moving
to the target distance, operation is completed and Done output is On.
(5) The axis is in "DiscreteMotion" state when this motion function block is running, and it is switched to "StandStill" state
when operation is completed.
10-17
Chapter 10
MC_MoveAdditive
Availability
XGF-M32E
MC_MoveAdditive
BOOL
UINT
BOOL
LREAL
LREAL
LREAL
LREAL
LREAL
UINT
Execute
Axis
ContinousUpdate
Distance
Velocity
Acceleration
Deceleration
Jerk
BufferMode
Done
Axis
Busy
Active
CommandAborted
Error
ErrorID
BOOL
UINT
BOOL
BOOL
BOOL
BOOL
WORD
Input-Output
UINT
Axis
Specify the axis to be commanded (1~32: real axis, 37~40: virtual axis)
Input
BOOL
Execute
Give an absolute position operation command to the relevant axis in the rising
Edge.
Specify the update setting of input value.
BOOL
ContinuousUpdate
LREAL
Distance
LREAL
Velocity
LREAL
Acceleration
LREAL
Deceleration
LREAL
Jerk
UINT
BufferMode
Output
BOOL
Done
BOOL
Busy
BOOL
Active
Indicate that the current motion function block is controlling the relevant axis.
BOOL
CommandAborted
Indicate that the current motion function block is interrupted while it is running.
10-18
Chapter 10
BOOL
Error
WORD
ErrorID
Output the number of error occurred while motion function block is running.
(1) This motion function block is to give the relevant additive position operation commands.
(2) Additive position motion (MC_MoveAdditive) is the motion function block which additionally moves as far as the
position specified in Distance input from the final target position of the currently running motion function block or the
latest motion function block executed in 'DiscreteMotion' state. If the current axis is executing motion function block
ContinuousMotion state, it executes operation based on the position where additive position motion
(MC_MoveAdditve) is executing.
(3) Moving direction is decided depending on the sign of the specified target distance in Distance input, and positive (+
or No sign) moving direction leads to forward direction, and negative (-) moving direction leads to reverse direction.
(4) When reaching the target position without motion function block on standby after the current motion function block,
'Done' output is On.
(5) The axis is in 'DiscreteMotion' state while this motion function block is running, and it is switched to 'Standstill' state
when operation is completed.
10-19
Chapter 10
MC_MoveVelocity
Availability
XGF-M32E
MC_MoveVelocity
BOOL
UINT
BOOL
LREAL
LREAL
LREAL
LREAL
UINT
UINT
Execute
Axis
ContinuousUpdate
Velocity
Acceleration
Deceleration
Jerk
Direction
BufferMode
InVelocity
Axis
Busy
Active
CommandAborted
Error
ErrorID
BOOL
UINT
BOOL
BOOL
BOOL
BOOL
WORD
Input-Output
UINT
Axis
Specify the axis to be commanded (1~32: real axis, 37~40: virtual axis)
Input
BOOL
Execute
Give an absolute position operation command to the relevant axis in the rising
Edge.
Specify the update setting of input value.
BOOL
ContinuousUpdate
LREAL
Velocity
LREAL
Acceleration
LREAL
Deceleration
LREAL
Jerk
UINT
Direction
UINT
BufferMode
Output
BOOL
InVelocity
BOOL
Busy
BOOL
Active
Indicate that the current motion function block is controlling the relevant axis.
10-20
Chapter 10
BOOL
CommandAborted
Indicate that the current motion function block is interrupted while it is running.
BOOL
Error
WORD
ErrorID
Output the number of error occurred while motion function block is running.
(1) This motion function block is to give specified velocity operation command to the relevant axis.
(2) Giving a stop command or execution of other motion function block allow to interrupt specified velocity motion.
(3) Specify the operation speed in Velocity input. Positive sign (+ or No sign) of the operation speed value leads to
forward direction, and negative (-) sign leads to reverse direction.
(4) Specify the operation direction in Direction input. But, the operation direction is affected by the sign of the specified
speed value by Velocity input. For example, if you specify the negative number for the Velocity value and reverse
direction for Direction input, the relevant axis lastly does forward direction operation.
(5) Output InVelocity is On when the relevant axis reaches the specified speed, and it is Off when the specified speed
operation is interrupted.
(6) The axis is in 'ContinuousMotion' state when this motion function block is running.
10-21
Chapter 10
MC_MoveContinuousAbsolute
Availability
XGF-M32E
MC_MoveContinousAbsolute
BOOL
UINT
BOOL
LREAL
LREAL
LREAL
LREAL
LREAL
LREAL
UINT
UINT
Execute
Axis
ContinousUpdate
Position
EndVelocity
Velocity
Acceleration
Deceleration
Jerk
Direction
BufferMode
InEndVelocity
Axis
Busy
Active
CommandAborted
Error
ErrorID
BOOL
UINT
BOOL
BOOL
BOOL
BOOL
WORD
Input-Output
UINT
Axis
Specify the axis to be commanded (1~32: real axis, 37~40: virtual axis)
Input
BOOL
Execute
Give an absolute position operation command to the relevant axis in the rising
Edge.
Specify the update setting of input value.
BOOL
ContinuousUpdate
LREAL
EndVelocity
Specify the operation speed after reaching the target position. [u/s]
LREAL
Velocity
LREAL
Acceleration
LREAL
Deceleration
LREAL
Jerk
Direction
UINT
10-22
BufferMode
Chapter 10
Output
BOOL
InEndVelocity
Indicate the operation at the specified speed after reaching the target position.
BOOL
Busy
BOOL
Active
Indicate that the current motion function block is controlling the relevant axis.
BOOL
CommandAborted
Indicate that the current motion function block is interrupted while it is running.
BOOL
Error
WORD
ErrorID
Output the number of error occurred while motion function block is running.
(1) This motion function block is to give Specified velocity operation after relative position operation command to the
relevant axis.
(2) When executing MC_MoveContinuousAbsolute, the relevant axis moves to the position specified in Position and
operates at the specified speed in EndVelocity if there is no motion function block is on standby.
(3) Giving a stop command or execution of other motion function block allow to interrupt speed operation.
(4) Set the operation direction of the axis in infinite length repetition operation in Direction input, and if infinite length
repetition operation is set to Prohibited, Direction input is ignored. When Direction input is the shortest distance (=2),
the relevant axis selects the direction which allows the shortest distance and operates if it does infinite length
repetition operation. The range can be set to 0~4(0-No specified, 1-Forward direction, 2-Shortest distance, 3Reverse direction, 4-Current direction), if the value outside the range is set and motion function block is executed,
Error is On and 0x1017 occurs in ErrorID.
(5) Output InEndVelocity is on when the relevant axis starts speed operation after reaching the specified position, and
when the specified operation is interrupted, it is Off.
(6) The axis is in 'ContinuousMotion' state while this command is executing.
10-23
Chapter 10
MC_MoveContinuousRelative
Availability
XGF-M32E
MC_MoveContinousRelative
BOOL
UINT
BOOL
LREAL
LREAL
LREAL
LREAL
LREAL
LREAL
UINT
Execute
Axis
ContinousUpdate
Distance
EndVelocity
Velocity
Acceleration
Deceleration
Jerk
BufferMode
InEndVelocity
Axis
Busy
Active
CommandAborted
Error
ErrorID
BOOL
UINT
BOOL
BOOL
BOOL
BOOL
WORD
Input-Output
UINT
Axis
Specify the axis to be commanded (1~32: real axis, 37~40: virtual axis)
Input
BOOL
Execute
Give an absolute position motion command to the relevant axis in the rising
Edge.
Specify the update setting of input value.
BOOL
ContinuousUpdate
LREAL
Distance
LREAL
EndVelocity
Specify the operation speed after reaching the target position. [u/s]
LREAL
Velocity
LREAL
Acceleration
LREAL
Deceleration
LREAL
Jerk
UINT
BufferMode
Output
BOOL
InEndVelocity
Indicate the operation at the specified speed after reaching the target position.
BOOL
Busy
10-24
Chapter 10
BOOL
Active
Indicate that the current motion function block is controlling the relevant axis.
BOOL
CommandAborted
Indicate that the current motion function block is interrupted while it is running.
BOOL
Error
WORD
ErrorID
Output the number of error occurred while motion function block is running.
(1) This motion function block gives MC_MoveContinuousRelative command to the relevant axis.
(2) When executing MC_MoveContinuousRelative, the relevant axis operates at the speed specified in EndVelocity
after moving the distance specified in Distance if there is no motion function block is on standby.
(3) Giving a stop command or operation of other motion function block allow to interrupt specified velocity motion.
(4) Output InEndVelocity is On when the relevant axis starts speed operation and reaches the specified speed after
moving the specified distance, and when specified velocity motion is interrupted, it is Off.
(5) The axis is in 'ContinuousMotion' state while this motion function block is running.
10-25
Chapter 10
MC_TorqueControl
Availability
Torque control
XGF-M32E
MC_TorqueControl
BOOL
UINT
BOOL
LREAL
LREAL
LREAL
LREAL
LREAL
LREAL
UINT
UINT
Execute
Axis
ContinousUpdate
Torque
TorqueRamp
Velocity
Acceleration
Deceleration
Jerk
Direction
BufferMode
InTorque
Axis
Busy
Active
CommandAborted
Error
ErrorID
BOOL
UINT
BOOL
BOOL
BOOL
BOOL
WORD
Input-Output
UINT
Axis
Input
BOOL
Execute
Give an absolute position operation command to the relevant axis in the rising
Edge.
Specify the update setting of input value.
BOOL
ContinuousUpdate
LREAL
Torque
LREAL
TorqueRamp
LREAL
Velocity
Unused
LREAL
Acceleration
Unused
LREAL
Deceleration
Unused
LREAL
Jerk
Unused
UINT
Direction
UINT
BufferMode
10-26
Chapter 10
Output
Indicate that the input torque value and currently operating torque value are
BOOL
InTorque
BOOL
Busy
BOOL
Active
Indicate that the current motion function block is controlling the relevant axis.
BOOL
CommandAborted
Indicate that the current motion function block is interrupted while it is running.
BOOL
Error
WORD
ErrorID
Output the number of error occurred while motion function block is running.
same.
(1) This motion function block is to give torque control command to the relevant axis.
(2) When executing torque control (MC_Torque), the relevant axis performs the control to keep the torque value
specified in Torque input.
(3) Giving a stop command or operation of other motion function block allow to interrupt specified velocity motion.
(4) Specify the gradient to reach the target torque value in TorqueRamp input.
(5) Specify the maximum speed in torque control operation in Speed input, and the value in negative number is not
allowed. Rotation direction is decided depending on the size of load in torque and the relative axis.
(6) Specify the operation direction in Direction input. When setting the value outside the range and executing motion
function block, Error is On and 0x1017 occurs in ErrorID.
(7) Output InTorque is On when the relevant axis reaches the specified torque, and when torque control operation is
interrupted, it is Off.
(8) The axis is in 'ContinuousMotion' state when this motion function block is running.
10-27
Chapter 10
MC_Setposition
Availability
XGF-M32E
MC_SetPosition
BOOL
UINT
LREAL
BOOL
UINT
Execute
Axis
Position
Relative
ExcutionMode
Done
Axis
Busy
Error
ErrorID
BOOL
UINT
BOOL
BOOL
WORD
Input-Output
UINT
Axis
Specify the axis to be commanded (1~32: real axis, 37~40: virtual axis)
BOOL
Execute
Specify the current position of the relevant axis in the rising Edge.
LREAL
VelFactor
LREAL
AccFactor
LREAL
JerkFactor
BOOL
Enabled
BOOL
Busy
BOOL
Error
WORD
ErrorID
Output the number of error occurred while motion function block is running.
Input
Output
(1) This motion function block is to set the current position of the relevant axis.
(2) Specify the position in Position input. When executing motion function block, if Relative input is Off, the position
of the relevant axis is replaced by the value of Position input, and if Relative input is On, the value of Position input
is added to the current position of the relevant axis.
(3) ExcutionMode input specifies the setting point. 0 means to be set immediately after motion function block, and 1
means to be set at the same point with Buffered in sequential operation setting. The value unable to be set
causes "error0x101B.
0 (mcImmediately): Change the parameter value immediately after executing function block (rising Edge in Execute
input). If the relevant axis is in running, operation can be affected.
1 (mcQueued): Changed at the same point with Buffered in Buffermode. (Error! Reference Source Not Found.
Refer to input)
10-28
Chapter 10
MC_Setoverride
Availability
Velocity/Acceleration override
XGF-M32E
MC_SetOverride
BOOL
UINT
LREAL
LREAL
LREAL
Execute
Axis
VelFactor
AccFactor
JerkFactor
Enabled
Axis
Busy
Error
ErrorID
BOOL
UINT
BOOL
BOOL
WORD
Input-Output
UINT
Axis
Specify the axis to be commanded (1~32: real axis, 37~40: virtual axis)
BOOL
Enable
LREAL
VelFactor
LREAL
AccFactor
LREAL
JerkFactor
BOOL
Enabled
BOOL
Busy
BOOL
Error
WORD
ErrorID
Output the number of error occurred while motion function block is running.
Input
Output
(1) This motion function block is to override the speed of the relevant axis, acceleration, and the change rate of
acceleration.
(2) Override rate which is applied to the relevant axis can be specified and changed while Enable input is On. If Enable
input is Off, override rate right before the Off is maintained.
(3) Speed override rate is specified in VelFactor input. If the specified value is 0.0, the relevant axis stops but it is not
changed to 'StandStill' state.
(4) Specify acceleration/deceleration and override rate of jerk (change rate of acceleration) in AccFactor and
JerkFactor input respectively.
(5) Negative number cannot be input in each Facotr, and if it is input, "error 0x10C1 occurs.
(6) Default of each override rate is 1.0, and it means 100% of the command speed of function block currently running.
(7) Override operation does not affect the serve axis of the relevant axis.
10-29
Chapter 10
MC_ReadParameter
Availability
Read Parameter
XGF-M32E
MC_ReadParameter
BOOL
UINT
INT
Enable
Axis
ParameterNumber
Vaild
Axis
Busy
Error
ErrorID
Value
BOOL
UINT
BOOL
BOOL
WORD
LREAL
Input-Output
UINT
Axis
Specify the axis to be commanded (1~32: real axis, 37~40: virtual axis)
BOOL
Enable
INT
ParameterNumber
BOOL
Vaild
Indicate whether the output of the current motion function block is valid.
BOOL
Busy
BOOL
Error
WORD
ErrorID
Output the number of error occurred while motion function block is running.
LREAL
Value
Input
Output
(1)
(2)
(3)
(4)
10-30
This command is a motion function block which outputs parameter of the relevant axis.
The value of the relevant parameter is continuously output in Value while Enable input is On.
Specify the number of parameter to read in ParameterNumber input.
The numbers of parameter are as below.
Chapter 10
Unit
0:pulse,1:mm,2:inch,3:degree
1 ~ 4,294,967,295 [pulse]
0:Unit/Time, 1:rpm
LREAL Positive number [Unit/s, rpm]
Basic
Speed limit
Parameter
Encoder select
Gear ratio(Motor)
1 ~ 65,535
Gear ratio(Machine)
1 ~ 65,535
0:E.Stop, 1:Stop
10
LREAL [Unit]
11
LREAL [Unit]
12
13
0:Disable, 1:Enable
14
15
16
17
0 ~ 100
1 ~ 1000 [ms]
20
0:Warning, 1:Alarm
21
22
23
JOG acceleration
24
JOG deceleration
25
JOG jerk
18
Extented
19
Parameter
10-31
Chapter 10
MC_Write Parameter
Availability
Write Parameter
XGF-M32E
MC_WriteParameter
BOOL
UINT
INT
LREAL
UINT
Execute
Axis
ParameterNumber
Value
ExcutionMode
Vaild
Axis
Busy
Error
ErrorID
BOOL
UINT
BOOL
BOOL
WORD
Input-Output
UINT
Axis
Specify the axis to be commanded (1~32: real axis, 37~40: virtual axis)
BOOL
Execute
INT
ParameterNumber
LREAL
Value
UINT
ExecutionMode
BOOL
Vaild
BOOL
Busy
BOOL
Error
WORD
ErrorID
Output the number of error occurred while motion function block is running.
Input
Output
(1) This motion function block is to write the value specified in parameter of the relevant axis.
(2) Parameter is written in the rising Edge of Execute input.
(3) Specify the number of parameter to write in ParameterNumber input. The value unable to be set causes "error
0x10F0.
(4) Specify the value to write in parameter for Value input.
(5) In ExecutionMode, correct the time when parameter is written and the values below can be set. The value unable
to be set causes "error 0x101B".
0 (mcImmediately): Change the parameter value immediately after executing function block (rising Edge in Execute
input). If the relevant axis is in running, operation can be affected.
1 (mcQueued): Changed at the same point with Buffered in Buffermode. (Error! Reference Source Not Found.
Refer to input )
10-32
Chapter 10
Unit
0:pulse,1:mm,2:inch,3:degree
1 ~ 4,294,967,295 [pulse]
0:Unit/Time, 1:rpm
LREAL Positive number [Unit/s, rpm]
Basic
Speed limit
Parameter
Encoder select
Gear ratio(Motor)
1 ~ 65,535
Gear ratio(Machine)
1 ~ 65,535
0:E.Stop, 1:Stop
10
LREAL [Unit]
11
LREAL [Unit]
12
13
0:Disable, 1:Enable
14
15
16
17
0 ~ 100
1 ~ 1000 [ms]
20
0:Warning, 1:Alarm
21
22
23
JOG acceleration
24
JOG deceleration
25
JOG jerk
18
Extented
19
Parameter
10-33
Chapter 10
MC_Reset
Availability
XGF-M32E
MC_Reset
BOOL
UINT
Execute
Axis
BOOL
ErrorType
Done
Axis
Busy
Error
ErrorID
BOOL
UINT
BOOL
BOOL
WORD
Input-Output
UINT
Axis
Specify the axis to be commanded (1~32: real axis, 37~40: virtual axis)
BOOL
Execute
BOOL
ErrorType
BOOL
Done
BOOL
Busy
BOOL
Error
WORD
ErrorID
Output the number of error occurred while motion function block is running.
Input
Output
(1) This motion function block is to reset the error of the relevant axis. When setting ErrorType to '0' and executing motion
function block in case the relevant axis is in ' ErrorStop' state, every axis error is reset and the axis state is switched to
'StandStill' or 'Disabled' state.
(2) If ErrorType is set to 1 and motion function block is executed, common error occurred in the relevant module is reset.
(3) Motion function block is executed in the rising Edge of Execute input.
10-34
Chapter 10
MC_TouchProbe
Availability
Touch probe
XGF-M32E
MC_TouchProbe
BOOL
UINT
UINT
BOOL
LREAL
LREAL
Execute
Axis
TriggerInput
WindowOnly
FirstPosition
LastPosition
Done
Axis
TriggerInput
Busy
CommandAborted
Error
ErrorID
RecordedPosition
BOOL
UINT
UINT
BOOL
BOOL
BOOL
WORD
LREAL
Input-Output
UINT
Axis
UINT
TriggerInput
BOOL
Execute
BOOL
WindowOnly
LREAL
FirstPosition
LREAL
LastPosition
BOOL
Done
BOOL
Busy
BOOL
CommandAborted
BOOL
Error
WORD
ErrorID
Output the number of error occurred while motion function block is running.
Input
Output
Indicate that the current motion function block is interrupted by other command.
REAL
RecordedPosition
Output the axis position where the trigger occurs.
(1) This motion function block is to execute 'TouchProbe' function which records the axis position at the time when the
trigger event occurs.
(2) TouchProbe function starts at the rising Edge of Execute input.
(3) Specify the signal to be used as a trigger in TriggerInput. The value unable to be set causes "error 0x10E1.
(4) When activating the window mode, allowable area where accepts the trigger signal of axis can be set. Operation
timing of each signal when the window mode is activated is as below.
10-35
Chapter 10
< In case TouchProbe function is the window mode, Operation timing >
10-36
Chapter 10
MC_AbortTrigger
Availability
XGF-M32E
Execute
Axis
TriggerInput
Done
Axis
TriggerInput
Busy
Error
ErrorID
BOOL
UINT
USINT
BOOL
BOOL
WORD
Input-Output
UINT
Axis
UINT
TriggerInput
Execute
The trigger on standby in the relevant axis in the rising Edge is disengaged.
BOOL
Done
BOOL
Busy
BOOL
Error
WORD
ErrorID
Output the number of error occurred while motion function block is running.
Input
BOOL
Output
(1) This motion function block is to disengage the trigger which is on standby in the relevant axis.
(2) Specify the trigger signal to be disengaged in TriggerInput. The value unable to be set causes "error 0x10E1.
10-37
Chapter 10
MC_CamIn
Availability
Camming run
XGF-M32E
MC_CamIn
BOOL
UINT
UINT
LREAL
LREAL
LREAL
LREAL
LREAL
LREAL
LREAL
UINT
UINT
UINT
UINT
Execute
Master
Slave
ContinousUpdate
MasterOffset
SlaveOffset
MasterScaling
SlaveScaling
MasterStartDistance
MasterSyncPosition
StartMode
MasterValueSource
CamTableID
BufferMode
InSync
Master
Slave
Busy
Active
CommandAborted
Error
ErrorID
EndOfProfile
BOOL
UINT
UINT
BOOL
BOOL
BOOL
BOOL
WORD
BOOL
Input-Output
UINT
Master
Set the main axis. (1~32: Actual axes, 37~40: Virtual axes, 41~42: Encoders)
UINT
Slave
Set the the serve axis. (1~32: Actual axes, 37~40: Virtual axes)
Execute
Give cam operation command to the relevant axis in the rising Edge.
Input
BOOL
ContinuousUpdate
LREAL
MasterOffset
LREAL
SlaveOffset
Set the offset value of the the serve axis cam table.
LREAL
MasterScaling
LREAL
SlaveScaling
LREAL
MasterStartDistance
Specify the position of the main axis where cam operation of the slave.
LREAL
MasterSyncPosition
Specify the starting point at cam table when cam operation starts.
Set the cam operation mode.
UINT
StartMode
10-38
Chapter 10
MasterValueSource
UINT
CamTableID
UINT
BufferMode
Output
Indicate that cam operation is normally being fulfilled.
BOOL
InSync
BOOL
Busy
BOOL
Active
Indicate that the current motion function block is controlling the relevant axis.
BOOL
CommandAborted
Indicate that the current motion function block is interrupted while it is running.
BOOL
Error
WORD
ErrorID
Output the number of error occurred while motion function block is running.
(1) This motion function block is to operate the serve axis cam depending on the main axis.
(2) Cam operation command can be given to the serve axis even if the main axis is in stop state.
(3) You must give cam operation abort (MC_CamOut) command to the serve axis or operate other motion function
block to stop cam operation.
(4) The axis is in 'Synchronized Motion' while this motion function block is running.
(5) Set the offset of cam table to be applied in MasterOffset and SlaveOffset. MasterOffset sets the offset with the
starting point of the main axis, and SlaveOffset sets the offset with the starting point of the serve axis. Refer to the
Figure below.
10-39
Chapter 10
(6) Set the magnification of cam data to be applied in MasterScaling and SlaveScaling. Set the magnification of the
main axis data in MasterScaling, and set the magnification of the the serve axis data. Refer to the Figure below.
SlaveScaling = 2.0
SlaveScaling = 1.0
MasterScaling = 1.0
MasterScaling = 2.0
(7) MasterSyncPosition input specifies the position of the main axis within the table where the synchronization of actual cam
operation is completed, and MasterStartDistane input specifies the relative position of the main axis where the
synchronization starts.
10-40
Chapter 10
command, take back the position of the synchronization starting point by the length of a table until it escapes the
MasterStartDistance range.
Actual synchronization position can vary depending on MasterScaling and SlaveScaling because MasterSyncPosition is a
value based on the inside of cam table, but MasterOffset and MasterStartDistance value remain unaffected.
(8) Once cam operation starts normally, InSync output is On, and EndOfProfile output is 1 scan On every time one cam table
operation is completed.
(9) Cam operation mode is set in StartMode. Setting range is 0 or 1, and the input value outside the setting range
causes an error.
(10) MasterValueSource selects the source of the main axis to be synchronized. If it is set to 0, the serve axis performs
cam operation based on the command position of the main axis which is calculated in motion control module, and
if it is set to 1, the serve axis performs cam operation based on the current position which is received by
communication in servo drive of main axis.
(11) CamTableID sets the number of cam table to be applied to cam operation. Setting range is 1~32 , and the input
value outside the setting range causes error "0x1115 in motion function block.
(12) The relevant axis is in "SynchronizedMotion" state while this motion function block is running.
6.4.2 Cam operation abort (MC_CamOut)
10-41
Chapter 10
MC_CamOut
Availability
Camming stop
XGF-M32E
MC_CamOut
BOOL
UINT
Execute
Slave
Done
Slave
Busy
Error
ErrorID
BOOL
UINT
BOOL
BOOL
WORD
Input-Output
UINT
Slave
Set the the serve axis. (1~32: Actual axes, 37~40: Virtual axes)
Execute
Give cam operation stop command to the relevant axis in the rising Edge.
BOOL
Done
BOOL
Busy
BOOL
Error
Input
BOOL
Output
WORD
ErrorID
Output the number of error occurred while motion function block is running.
(1) This motion function block immediately disengages cam operation running in the serve axis.
(2) If motion function block of which BufferMode is Aborting in the serve axis where cam operation is running, cam
operation is automatically disengaged and the relevant motion function block is executed. To execute cam
operation abort (MC_CamOut) motion function block, the relevant axis do operation which keeps the speed at the
time when cam operation is disengaged. If you want to completely stop the serve axis, use stop (MC_Halt) or
immediate stop (MC_Stop) motion function block.
10-42
Chapter 10
MC_GearIn
Availability
XGF-M32E
MC_GearIn
BOOL
UINT
UINT
BOOL
INT
UINT
UINT
LREAL
LREAL
LREAL
UINT
Execute
Master
Slave
ContinousUpdate
RatioNumerator
RatioDenominator
MasterValueSource
Acceleration
Deceleration
Jerk
BufferMode
InGear
Master
Slave
Busy
Active
CommandAborted
Error
ErrorID
BOOL
UINT
UINT
BOOL
BOOL
BOOL
BOOL
WORD
Input-Output
UINT
Master
Set the main axis. (1~32: Actual axes, 37~40: Virtual axes, 41~42: Encoders)
UINT
Slave
Set the the serve axis. (1~32: Actual axes, 37~40: Virtual axes)
Execute
Give gear operation command to the relevant axis in the rising Edge.
Input
BOOL
ContinuousUpdate
INT
RatioNumerator
UINT
RatioDenominator
UINT
MasterValueSource
LREAL
Acceleration
LREAL
Deceleration
LREAL
Jerk
UINT
BufferMode
Chapter 10
Output
BOOL
InGear
BOOL
Busy
BOOL
Active
Indicate that the current motion function block is controlling the relevant axis.
BOOL
CommandAborted
Indicate that the current motion function block is interrupted while it is running.
BOOL
Error
WORD
ErrorID
Output the number of error occurred while motion function block is running.
(1) This motion function block is an operation to synchronize the speed of the main axis and the serve axis depending
on gear ratio which is set.
(2) Giving gear operation abort (MC_GearOut) commands to the relevant axis or execution of other motion function
block allow to disengage gear operation.
(3) RatioNumerator and RatioDenominator set the numerator and denominator to be applied to the serve axis
respectively. If the numerator is set to negative number, the rotation direction of the serve axis is the opposite of
the main axis.
(4) MasterValueSource select the data of the main axis which is a standard of synchronization. If it is set to 0,
synchronization operation is based on the command position of the main axis of motion control module, and if it is
set to 1, synchronization operation is based on the current position. Other values set besides these two make
Error of motion function block On and cause 0x1114 in ErrorID.
(5) When this motion function block is executed, the serve axis is synchronized with the main axis through
acceleration/deceleration at the speed in synch with the relevant gear ratio.
(6) The serve axis is in 'SynchronizedMotion' while this motion function block is running.
10-44
Chapter 10
MC_GearOut
Availability
XGF-M32E
MC_GearOut
BOOL
UINT
Execute
Slave
Done
Slave
Busy
Error
ErrorID
BOOL
UINT
BOOL
BOOL
WORD
Input-Output
UINT
Slave
Set the the serve axis. (1~32: Actual axes, 37~40: Virtual axes)
Input
UINT
BufferMode
Output
BOOL
Done
BOOL
Busy
BOOL
Error
WORD
ErrorID
Output the number of error occurred while motion function block is running.
(1) This motion function block immediately disengages gear operation running in the spindle.
(2) If motion function block of which BufferMode is Aborting in the spindle where cam operation is running, gear
operation is automatically disengaged and the relevant motion function block is executed. If gear operation abort
(MC_GearOut) motion function block is only to be executed, the relevant axis performs operation to maintain the
speed at the time when gear operation is disengaged. To completely stop the spindle, use stop (MC_Halt) or
immediate stop (MC_Stop) motion function block.
10-45
Chapter 10
MC_GearInPos
Availability
XGF-M32E
MC_GearInPos
BOOL
UINT
UINT
INT
UINT
UINT
LREAL
LREAL
UINT
LREAL
LREAL
LREAL
LREAL
LREAL
UINT
Execute
Master
Slave
RatioNumerator
RatioDenominator
MasterValueSource
MasterSyncPosition
SlaveSyncPosition
SyncMode
MasterStartDistance
Velocity
Acceleration
Deceleration
Jerk
BufferMode
InSync
Master
Slave
StartSync
Busy
Active
CommandAborted
Error
ErrorID
UINT
UINT
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
WORD
Input-Output
UINT
Master
Set the main axis. (1~32: Actual axes, 37~40: Virtual axes, 41~42: Encoders)
UINT
Slave
Set the the serve axis. (1~32: Actual axes, 37~40: Virtual axes)
BOOL
Execute
Give a gear operation command to the relevant axis in the rising Edge.
INT
RatioNumerator
UINT
RatioDenominator
Input
MasterValueSource
LREAL
MasterSyncPosition
Specify the position of the main axis where gear operation starts.
LREAL
SlaveSyncPosition
LREAL
MasterStartDistance
LREAL
Velocity
10-46
Chapter 10
LREAL
Acceleration
LREAL
Deceleration
LREAL
Jerk
UINT
BufferMode
synchronization. [u/s ]
Specify the maximum deceleration of the spindle at the beginning of
2
synchronization. [u/s ]
3
Output
Indicate that gear operation is normally being fulfilled as the specified gear ratio is
BOOL
InSync
BOOL
StartSync
BOOL
Busy
BOOL
Active
Indicate that the current motion function block is controlling the relevant axis.
BOOL
CommandAborted
Indicate that the current motion function block is interrupted while it is running.
BOOL
Error
WORD
ErrorID
Output the number of error occurred while motion function block is running.
applied.
(1) This motion function block is an operation to synchronize the speed of the main axis and the spindle in the set
position depending on gear ratio which is set in the specific position.
(2) Giving gear operation abort (MC_GearOut) commands to the spindle or operation of other motion function block
allow to stop gear operation.
(3) RatioNumerator and RatioDenominator set the numerator and denominator of gear ratio to be applied to the
spindle respectively. If the numerator is set to negative number, the rotation direction of the spindle goes into
reverse of the main axis.
(4) MasterValueSource selects the source of the main axis to be synchronized. If it is set to 0 (mcSetValue),
synchronization is performed by putting the target position of the main axis in the current motion control period as a
source, and if it is set to 1(mcActualValue), synchronization is performed by putting the current position of the main
axis got feedback from the current motion control period as a source. Other values set besides these two cause
"error 0x10D1.
(5) Input the positions of the main axis and the spindle where gear operation is completed synchronization in
MasterSyncPosition input and SlaveSyncPosition input respectively. Input the distance where the spindle starts
synchronization in MasterStartDistance input, and the spindle starts synchronization at the position away the
distance set in MasterStartDistance input from the position set in MasterSyncPosition input.
(6) Once synchronization starts, StartSync output is On. When synchronization is completed and gear operation starts,
StartSync output is Off and InSync output is On.
(7) The spindle is in 'SynchronizedMotion' while this motion function block is running.
10-47
Chapter 10
10-48
Chapter 10
MC_AddAxisToGroup
Availability
XGF-M32E
MC_AddAxisToGroup
BOOL
UINT
UINT
UINT
Execute
AxesGroup
Axis
IdentInGroup
Done
AxesGroup
Axis
Busy
Error
ErrorID
BOOL
UINT
UINT
BOOL
BOOL
WORD
Input-Output
UINT
AxesGroup
UINT
Axis
Set the group where the relevant axis is added. (1 ~ 16 : Group 1 ~ Group 16)
Set the axis to be added to the relevant group. (1~32: Actual axes, 37~40: Virtual
axes)
Input
BOOL
Execute
Give group axis addition command to the relevant axis in the rising Edge.
UINT
IdentInGroup
BOOL
Done
BOOL
Busy
BOOL
Error
WORD
ErrorID
Output the number of error occurred while motion function block is running.
Output
(1) This motion function block adds Axis specified axis to the axis group specified in AxesGroup input.
(2) ID in the axis group specified to IdentInGroup must have unique value for each axis. (ID of each axis must be
different.) Maximum 4 axes can be included in each axis group, axis ID can be specified in the range of 1-4. If the
specified axis number is outside the range, error 0x0006 occurs, and if numbers in the axis group overlap, error
0x2051 occurs.
10-49
Chapter 10
MC_RemoveAxisFromGroup
Availability
XGF-M32E
MC_RemoveAxisFromGroup
BOOL
UINT
UINT
Execute
AxesGroup
IdentInGroup
Done
AxesGroup
Busy
Error
ErrorID
BOOL
UINT
BOOL
BOOL
WORD
Input-Output
UINT
AxesGroup
Set the group where the relevant axis is removed. (1 ~ 16 : Group1 ~ Group 16)
BOOL
Execute
Give group axis exclusion command to the relevant group in the rising Edge.
UINT
IdentInGroup
Input
Set the axis number in the relevant group to be removed from the relevant
group.
Output
BOOL
Done
BOOL
Busy
BOOL
Error
WORD
ErrorID
Output the number of error occurred while motion function block is running.
(1) This motion function block removes the axis which is specified to IdentInGroup in the axis group specified in
AxesGroup input.
(2) If the execution of group axis exclusion is tried when the axis group is not in GroupDisabled, GroupStandBy, and
GroupErrorStop state, "error 0x2003 or 0x2004 or 0x2005" occurs and the axis is not removed. In other words, the
axis cannot be removed when the axis group does not completely stop.
10-50
Chapter 10
MC_UngroupAllAxes
Availability
XGF-M32E
BOOL
UINT
MC_UngroupAllAxes
Execute
Done
AxesGroup
AxesGroup
Busy
Error
ErrorID
BOOL
UINT
BOOL
BOOL
WORD
Input-Output
UINT
AxesGroup
Set the group where every axis is to be removed. (1 ~ 16 : Group 1 ~ Group 16)
BOOL
Execute
UINT
IdentInGroup
Input
Set the axis number in the relevant group to be removed from the relevant
group.
Output
BOOL
Done
BOOL
Busy
BOOL
Error
WORD
ErrorID
Output the number of error occurred while motion function block is running.
(1) This motion function block removes every axis which belongs to the axis group specified in AxesGroup input.
(2) If this motion function block is executed when the axis group is not in GroupDisabled, GroupStandBy, and
GroupErrorStop state, "error 0x2003 or 0x2004 or 0x2005" occurs and the axis is not removed. In other words, the
axis cannot be removed when the axis group does not completely stop.
(3) When the axis which belongs to the group is successfully removed, the relevant group is switched to GroupDisabled
state.
10-51
Chapter 10
MC_GroupEnable
Availability
XGF-M32E
MC_GroupEnable
BOOL
UINT
Execute
AxesGroup
Done
AxesGroup
Busy
Error
ErrorID
BOOL
UINT
BOOL
BOOL
WORD
Input-Output
UINT
AxesGroup
Execute
Give group activation command to the relevant group in the rising Edge.
BOOL
Done
BOOL
Busy
BOOL
Error
WORD
ErrorID
Output the number of error occurred while motion function block is running.
Input
BOOL
Output
(1) This motion function block is to activate the axis group specified in AxesGroup input.
(2) When giving this command to the axis group in GroupDisable state, the relevant axis group is switched to
GroupStandby state.
(3) This motion function block does not affect the power state of each axis in the relevant group.
10-52
Chapter 10
MC_GroupDisable
Availability
XGF-M32E
MC_GroupDisable
BOOL
UINT
Execute
AxesGroup
Done
AxesGroup
Busy
Error
ErrorID
BOOL
UINT
BOOL
BOOL
WORD
Input-Output
UINT
AxesGroup
Execute
Give group disablement command to the relevant group in the rising Edge.
BOOL
Done
BOOL
Busy
BOOL
Error
WORD
ErrorID
Output the number of error occurred while motion function block is running.
Input
BOOL
Output
(1) This motion function block is to deactivate the axis group specified in AxesGroup input.
(2) The axis group which executes this motion function block is switched to GroupDisabled.
(3) This motion function block does not affect the power state of each axis in the relevant group.
10-53
Chapter 10
MC_GroupHome
Availability
XGF-M32E
MC_GroupHome
BOOL
UINT
LREAL[ ]
UINT
Execute
AxesGroup
Position
BufferMode
Done
AxesGroup
Busy
Active
CommandAborted
Error
ErrorID
BOOL
UINT
BOOL
BOOL
BOOL
BOOL
WORD
Input-Output
UINT
AxesGroup
BOOL
Execute
Give group homing command to the relevant group in the rising Edge.
LREAL[ ]
Position
Specify the absolute position of each axis when reference signal is detected.
UINT
BufferMode
Input
Output
BOOL
Done
BOOL
Busy
BOOL
Active
Indicate that the current motion function block is controlling the relevant axis.
BOOL
CommandAborted
Indicate that the current motion function block is interrupted while it is running.
BOOL
Error
WORD
ErrorID
Output the number of error occurred while motion function block is running.
(1) This motion function block is to give homing command to the axis group specified in AxesGroup input.
(2) Homing method is operated as specified in servo parameter of the relevant axis in advance.
(3) In Position input, specify the absolute position to the array to be set when homing is completed or Reference Signal
is detected. Values in the array and the axis in the group correspond in the order of [1, 2, 3, 4]. (1~4 are the axis ID in
the axis group)
(4) The axis group is in 'GroupHoming' state while this motion function block is running, and it is switched to
'GroupStandby' state when motion function block is completed.
10-54
Chapter 10
MC_GroupSetPosition
Availability
XGF-M32E
MC_GroupSetPosition
BOOL
UINT
Execute
AxesGroup
BOOL
UINT
Position
Relative
ExecuteMode
Done
AxesGroup
Busy
Active
CommandAborted
Error
ErrorID
BOOL
UINT
BOOL
BOOL
BOOL
BOOL
WORD
Input-Output
UINT
AxesGroup
Select the group to set the current position. (1 ~ 16 : Group 1 ~ Group 16)
Input
Give group current position setting command to the relevant group in the rising
BOOL
Execute
LREAL[ ]
Position
BOOL
Relative
UINT
ExecuteMode
Edge.
Output
BOOL
Done
BOOL
Busy
BOOL
Active
Indicate that the current motion function block is controlling the relevant axis.
BOOL
CommandAborted
Indicate that the current motion function block is interrupted while it is running.
BOOL
Error
WORD
ErrorID
Output the number of error occurred while motion function block is running.
(1) This motion function block sets the current position of the relevant axis group.
(2) Specify the position of each axis in the group to the array. When executing this motion function block, if Relative
input is Off, the position of the relevant axis is replaced by the Position input value, and if Relative input is On, the
Position input value is added to the current position of the relevant axis. Values in the array and the axis in the group
correspond in the order of [1, 2, 3, 4]. (1~4 are the axis ID in the axis group)
10-55
Chapter 10
(3) ExcutionMode input specifies the setting point. If it is 0, it is set immediately after the execution of a command, If it
is 1, it is set at the same point with Buffered of sequential operation setting. The value unable to be set causes
"error 0x201B.
0 (mcImmediately): Change the value of parameter immediately after the execution of motion function block (rising
Edge in Execute input). If the relevant axis is running, the operation can be affected.
1 (mcQueued): Changed at the same point of Buffered of Buffermode ( Refer to 10.1.4 BufferMode).
10-56
Chapter 10
MC_GroupStop
Availability
XGF-M32E
MC_GroupStop
BOOL
UINT
LREAL
LREAL
Execute
AxesGroup
Deceleration
Jerk
Done
AxesGroup
BOOL
UINT
Busy
Active
CommandAborted
Error
ErrorID
BOOL
BOOL
BOOL
BOOL
WORD
Input-Output
UINT
AxesGroup
BOOL
Execute
Give group immediate stop command to the relevant group in the rising Edge.
LREAL
Deceleration
LREAL
Jerk
BOOL
Done
BOOL
Busy
BOOL
Active
Indicate that the current motion function block is controlling the relevant axis.
BOOL
CommandAborted
Indicate that the current motion function block is interrupted while it is running.
BOOL
Error
WORD
ErrorID
Output the number of error occurred while motion function block is running.
Input
Output
(1) This motion function block is to give an emergency stop command to the relevant axis group.
(2) The relevant axis group moves on the route which it was following until it completely stops.
(3) When executing group immediate stop (MC_GroupStop) motion function block, motion function block which the
relevant axis group is performing is interrupted, and the axis is changed to 'GroupStopping'. When the relevant axis
group is in GroupStopping state, other motion function block cannot be given to the relevant axis until the stop is
completed (until Done output is On).
10-57
Chapter 10
(4) CommandAborted output indicates that the current motion function block is interrupted while it was executed.
Because other motion function block cannot interrupt group immediate stop (MC_GroupStop) command while
group immediate stop (MC_GroupStop) command is being executed, CommandAborted output is On when the
power of servo is cut, servo Off command is executed, or servo connection is disconnected.
(5) If Execute input is On or the speed of the axis is not 0, the axis is in ' GroupStopping' state, and if Done output is On
and Execute input is Off, the axis is switched to ' GroupStandBy' state.
10-58
Chapter 10
MC_GroupHalt
Availability
Stop a Group
XGF-M32E
MC_GroupHalt
BOOL
UINT
LREAL
LREAL
UINT
Execute
AxesGroup
Deceleration
Jerk
BufferMode
Done
AxesGroup
Busy
Active
CommandAborted
Error
ErrorID
BOOL
UINT
BOOL
BOOL
BOOL
BOOL
WORD
Input-Output
UINT
AxesGroup
BOOL
Execute
Give group stop command to the relevant group in the rising Edge.
LREAL
Deceleration
LREAL
Jerk
UINT
BufferMode
Input
Output
BOOL
Done
BOOL
Busy
BOOL
Active
Indicate that the current motion function block is controlling the relevant axis.
BOOL
CommandAborted
Indicate that the current motion function block is interrupted while it is running.
BOOL
Error
WORD
ErrorID
Output the number of error occurred while motion function block is running.
(1) This motion function block is to give a stop command to the relevant axis.
(2) The relevant axis group moves on the route which it was following until it completely stops.
(3) The axis is in 'GroupMoving' state while this motion function block is running, and if the axis group completely stops,
'Done' output is On and the group state is changed to 'GroupStandBy' state.
10-59
Chapter 10
MC_GroupReset
Availability
XGF-M32E
MC_GroupReset
BOOL
UINT
Execute
AxesGroup
Done
AxesGroup
Busy
Error
ErrorID
BOOL
UINT
BOOL
BOOL
WORD
Input-Output
UINT
AxesGroup
Execute
Give group error reset command to the relevant group in the rising Edge.
BOOL
Done
BOOL
Busy
BOOL
Error
WORD
ErrorID
Output the number of error occurred while motion function block is running.
Input
BOOL
Output
(1) This motion function block is to reset the error of the relevant axis group. When the relevant axis is in
'GroupErrorStop', the execution of motion function block resets the error occurred in the current relevant axis and
switches the axis group to 'GroupStandBy' state.
(2) When executing this motion function block, every error occurred in each axis in the group is reset. (This has the
same effect with when executing the axis error reset (MC_Reset) command in each axis.)
10-60
Chapter 10
MC_MoveLinearAbsolute
Availability
XGF-M32E
MC_MoveLinearAbsolute
BOOL
UINT
LREAL[ ]
LREAL
LREAL
LREAL
LREAL
UINT
UINT
LREAL
Execute
AxesGroup
Position
Velocity
Acceleration
Deceleration
Jerk
BufferMode
TransitionMode
TransitionParameter
Done
AxesGroup
Busy
Active
CommandAborted
Error
ErrorID
BOOL
UINT
BOOL
BOOL
BOOL
BOOL
WORD
Input-Output
UINT
AxesGroup
Set the group to perform absolute position linear interpolation operation. (1 ~ 16:
Group 1 ~ Group 16)
Input
Give absolute position linear interpolation operation command to the relevant group
BOOL
Execute
LREAL[ ]
Position
LREAL
Velocity
LREAL
Acceleration
LREAL
Deceleration
LREAL
Jerk
UINT
BufferMode
UINT
TransitionMode
LREAL
TransitionParameter
Output
BOOL
Done
BOOL
Busy
Chapter 10
BOOL
Active
Indicate that the current motion function block is controlling the relevant axis.
BOOL
CommandAborted
Indicate that the current motion function block is interrupted while it is running.
BOOL
Error
WORD
ErrorID
Output the number of error occurred while motion function block is running.
(1) This motion function block is to give an absolute position linear interpolation command to the axis group specified in
AxesGroup input.
(2) When this motion function block is executed, interpolation control is performed in a linear path from the current
position to the target position of each axis, and the moving direction is decided by the starting point and the target
point of each axis.
Beginning position < Target position: Forward direction operation
Beginning position > Target position: Reverse direction operation
(3) In Position input, specify the target position of each axis in the group as matrix. The values in the array and the axis
in the group correspond in the order of [1, 2, 3, 4]. (1~4 are axis ID in the axis group)
(4) Specify the speed, acceleration, deceleration, and the change rate of acceleration/deceleration of interpolation route
in Velocity, Acceleration, Deceleration, and Jerk inputs respectively.
(5) Velocity is to set the interpolation speed of the axis group, and it indicates the integrated speed of each axis.
Operation speeds of each configuration axis are calculated as follows.
S1 + S 2 + S 3 + S 4
2
(6) Refer to linear interpolation control part in motion control modules manual for more details.
10-62
Chapter 10
MC_MoveLinearRelative
Availability
XGF-M32E
MC_MoveLinearRelative
BOOL
UINT
LREAL[ ]
LREAL
LREAL
LREAL
LREAL
UINT
UINT
LREAL
Execute
AxesGroup
Distance
Velocity
Acceleration
Deceleration
Jerk
BufferMode
TransitionMode
TransitionParameter
Done
AxesGroup
Busy
Active
CommandAborted
Error
ErrorID
BOOL
UINT
BOOL
BOOL
BOOL
BOOL
WORD
Input-Output
UINT
AxesGroup
Set the group to do relative position linear interpolation operation. (1 ~ 16: Group 1
~ Group 16)
Input
Give relative position linear interpolation operation command to the relevant group
BOOL
Execute
LREAL[ ]
Distance
LREAL
Velocity
LREAL
Acceleration
LREAL
Deceleration
LREAL
Jerk
UINT
BufferMode
UINT
TransitionMode
LREAL
TransitionParameter
Output
BOOL
Done
BOOL
Busy
Chapter 10
BOOL
Active
Indicate that the current motion function block is controlling the relevant axis.
BOOL
CommandAborted
Indicate that the current motion function block is interrupted while it is running.
BOOL
Error
WORD
ErrorID
Output the number of error occurred while motion function block is running.
(1) This motion function block is to give a relative position linear interpolation command to the axis group specified in
AxesGroup input.
(2) When this motion function block is executed, interpolation control performed in a linear path from the current position
to the target position of each axis, and the moving direction is decided by the sign of the target distance of each axis.
Target distance > 0: Forward direction operation
Target distance < 0: Reverse direction operation
(3) In Distance input, specify the target distance of each axis in the group as array. The specified array and the axis in
the group correspond in the order of specified axis ID [ID1 target distance, ID2 target distance, ].
(4) Set the speed, acceleration, deceleration, and the change rate of acceleration/deceleration of interpolation route in
Velocity, Acceleration, Deceleration, and Jerk inputs respectively.
(5) Velocity is to set the interpolation speed of the axis group, and it indicates the integrated speed of each axis.
Operation speeds of each configuration axis are calculated as follows.
S1 + S 2 + S 3 + S 4
2
(6) Refer to linear interpolation control part in motion control modules manual for more details.
10-64
Chapter 10
MC_MoveCircularAbsolute
Availability
XGF-M32E
MC_MoveCircularAbsolute
BOOL
UINT
UINT
LREAL[ ]
LREAL[ ]
UINT
LREAL
LREAL
LREAL
LREAL
UINT
UINT
LREAL
Done
Execute
AxesGroup
CircMode
AuxPoint
EndPoint
PathChoice
Velocity
Acceleration
Deceleration
Jerk
BufferMode
TransitionMode
TransitionParameter
AxesGroup
Busy
Active
CommandAborted
Error
ErrorID
BOOL
UINT
BOOL
BOOL
BOOL
BOOL
WORD
Input-Output
UINT
AxesGroup
Set the group to do absolute position circular interpolation operation. (1 ~ 16: Group
1 ~ Group 16)
Input
Give absolute position circular interpolation operation command to the relevant
BOOL
Execute
UINT
CirMode
LREAL[ ]
AuxPoint
LREAL[ ]
EndPoint
BOOL
PathChoice
LREAL
Velocity
LREAL
Acceleration
LREAL
Deceleration
LREAL
Jerk
UINT
BufferMode
Chapter 10
UINT
TransitionMode
Unused
LREAL
TransitionParameter
Unused
BOOL
Done
BOOL
Busy
BOOL
Active
Indicate that the current motion function block is controlling the relevant axis.
BOOL
CommandAborted
Indicate that the current motion function block is interrupted while it is running.
BOOL
Error
WORD
ErrorID
Output the number of error occurred while motion function block is running.
Output
(1) This motion function block is to give an absolute position circular interpolation command to the axis group specified in
AxesGroup input.
(2) When this motion function block starts, each axis performs circular path interpolation control which refers to the set
auxiliary point, and the movement direction is decided by PathChoice input. When setting PathChoice input to 0,
circular interpolation operation is done clockwise, and when setting it to 1, circular interpolation operation is done
counterclockwise.
(3) Specify the absolute position of the auxiliary point to refer when doing circular interpolation of each axis in AuxPoint and
EndPoint inputs as array. The entered array and the axis in the group correspond in the order of the specified axis ID [ID1,
ID2, ID3, ]. (The 3 LEAL type sized array should be entered in Position input as there are 3 axes which comprise the
group to give a circular interpolation operation command.)
(4) Specify the speed, acceleration, deceleration, and the change rate of acceleration of interpolation route in Velocity,
Acceleration, Deceleration, and Jerk inputs respectively.
(5) Set the circular interpolation method in CircMode input. The circular interpolation methods which are different from
the value specified in CircMode are as below.
10-66
Chapter 10
(6) Refer to linear interpolation control part in motion control modules manual for more details.
10-67
Chapter 10
MC_MoveCircularRelative
Availability
XGF-M32E
MC_MoveCircularRelative
BOOL
UINT
UINT
LREAL[ ]
LREAL[ ]
USINT
LREAL
LREAL
LREAL
LREAL
UINT
UINT
LREAL
Execute
AxesGroup
CircMode
AuxPoint
EndPoint
PathChoice
Velocity
Acceleration
Deceleration
Jerk
BufferMode
TransitionMode
TransitionParameter
Done
AxesGroup
Busy
Active
CommandAborted
Error
ErrorID
BOOL
UINT
BOOL
BOOL
BOOL
BOOL
WORD
Input-Output
UINT
AxesGroup
Set the group to do absolute position circular interpolation operation. (1 ~ 16: Group
1 ~ Group 16)
Input
Give relative position circular interpolation operation command to the relevant
BOOL
Execute
UINT
CirMode
LREAL[ ]
AuxPoint
LREAL[ ]
EndPoint
BOOL
PathChoice
LREAL
Velocity
LREAL
Acceleration
LREAL
Deceleration
LREAL
Jerk
10-68
Chapter 10
UINT
BufferMode
UINT
TransitionMode
Unused
LREAL
TransitionParameter
Unused
BOOL
Done
BOOL
Busy
BOOL
Active
Indicate that the current motion function block is controlling the relevant axis.
BOOL
CommandAborted
Indicate that the current motion function block is interrupted while it is running.
BOOL
Error
(Refer to 10.1.4.BufferMode)
Output
WORD
ErrorID
Output the number of error occurred while motion function block is running.
(1) This motion function block is to give a relative position circular interpolation command to the axis group specified in
AxesGroup input.
(2) When this motion function block starts, each axis performs circular path interpolation control which refers to the set
auxiliary point, and the movement direction is decided by PathChoice input. When setting PathChoice input to 0,
circular interpolation operation is done clockwise, and when setting it to 1, circular interpolation operation is done
counterclockwise.
(3) Specify the relative position of the auxiliary point to refer when doing circular interpolation of each axis in AuxPoint and
EndPoint inputs as array. The entered array and the axis in the group correspond in the order of the specified axis ID [ID1,
ID2, ID3, ]. (The 3 LEAL type sized array should be entered in Position input as there are 3 axes which comprise the
group to give a circular interpolation operation command.)
(4) Specify the speed, acceleration, deceleration, and the change rate of acceleration of interpolation route in Velocity,
Acceleration, Deceleration, and Jerk inputs respectively.
(5) Set the circular interpolation method in CircMode input. The circular interpolation methods which are different from
the value specified in CircMode are as below.
Circular interpolation of midpoint specifying method (BORDER, CircMode = 0)
In this method, operation starts at the current position and it does circular interpolation through the specified
position of the central point to the target position.
The Figure below shows that the coordinate of the axis group at the
beginning of a command
corresponds to the current position, the coordinate entered in AuxPoint corresponds to the central point,
and the coordinate entered in EndPoint corresponds to the target position in a relative value.
10-69
Chapter 10
(6) Refer to linear interpolation control part in motion control modules manual for more details.
10-70
Chapter 10
LS_Connect
Availability
XGF-M32E
LS_Connect
BOOL
Execute
Done
Busy
Error
ErrorID
BOOL
BOOL
BOOL
WORD
Input
BOOL
Execute
Output
BOOL
Done
BOOL
Busy
BOOL
Error
WORD
ErrorID
Output the number of error occurred while motion function block is running.
(1) This motion function block is to give a command to connect communication with servo drive or external input/output
apparatus to the module.
(2) When slave devicees are normally connected, Done is On and Busy is Off.
(3) If an error occurs during the communication connection, Error is On and error number is output in ErrorID according
to the cause.
10-71
Chapter 10
LS_Disconnect
Availability
XGF-M32E
LS_Disonnect
BOOL
Execute
Done
Busy
Error
ErrorID
BOOL
BOOL
BOOL
WORD
Input
BOOL
Execute
Output
BOOL
Done
BOOL
Busy
BOOL
Error
WORD
ErrorID
Output the number of error occurred while motion function block is running.
(1) This motion function block gives a command which orders the module to disconnect the communication with servo
drive or external input/output apparatuses.
(2) If communication slave is disconnected, Done is On and Busy is off.
(3) If an error occurs during the execution of communication disconnection, Error is On and error number is output in
ErrorID according to the error situation.
10-72
Chapter 10
LS_ReadServoParameter
Availability
XGF-M32E
Execute
Axis
Index
SubIndex
Length
Done
Axis
Busy
Error
ErrorID
Value
BOOL
UINT
BOOL
BOOL
WORD
DINT
Input-Output
UINT
Axis
BOOL
Execute
Give servo parameter reading command to the relevant axis in the rising Edge.
UINT
Index
UINT
SubIndex
UINT
Length
BOOL
Done
BOOL
Busy
BOOL
Error
WORD
ErrorID
Output the number of error occurred while motion function block is running.
LREAL
Value
Input
Output
(1) This motion function block is to read the parameter (CoE Object) value of servo drive in the relevant axis, and reads
the servo parameter value of the position specified in Index and SubIndex of the axis specified by Axis input as much
as the size of Length and indicates it on Value output.
(2) Value output is eliminated to 0 when motion function block is running, and it is output as the read value when the
running is completed (Done output is On).
10-73
Chapter 10
(3) Index input can be set as below. If the value is set outside the range, "error 0x1F12 occurs.
Value
Description
16#0000 ~ 16#0FFF
16#1000 ~ 16#1FFF
Communication objects
16#2000 ~ 16#5FFF
16#6000 ~ 16#9FFF
(4) The value between 0~255 can be entered in SubIndex, and if the value is set outside the range, "error 0x1F12
occurs.
(5) The value between 1~4 can be set in Length, which means 1~4 Byte. If the value is set outside the range, error
0x1F12 occurs.
10-74
Chapter 10
LS_WriteServoParameter
Availability
XGF-M32E
MC_WriteServoParameter
BOOL
UINT
UINT
UINT
UINT
DINT
UINT
Execute
Axis
Index
SubIndex
Length
Value
ExecutionMode
Done
Axis
Busy
Error
ErrorID
BOOL
UINT
BOOL
BOOL
WORD
Input-Output
UINT
Axis
BOOL
Execute
Give servo parameter writing command to the relevant axis in the rising Edge.
UINT
Index
UINT
SubIndex
UINT
Length
DINT
Value
Input
ExecuteMode
0: Immediately executed
1: Applied at the same time with Buffered of BufferMode.
Output
BOOL
Done
BOOL
Busy
BOOL
Error
WORD
ErrorID
Output the number of error occurred while motion function block is running.
(1) This motion function block is to write the parameter (CoE Object) value of the relevant axis servo drive, and it writes
the value entered in Value as the size of the Length in servo parameter of the position specified as Index and
SubIndex of the axis specified in Axis input.
(2) Index input can be set as below. When it is set to the value besides the set value, error 0x1F12 occurs.
10-75
Chapter 10
Value
Description
16#0000 ~ 16#0FFF
16#1000 ~ 16#1FFF
Communication objects
16#2000 ~ 16#5FFF
16#6000 ~ 16#9FFF
(3) The value between the range of 0~255 can be entered in SubIndex, and if the value outside the range is set, error
0x1F12 occurs.
(4) The value between the range of 1~4 can be entered in Length, which means 1~4 Byte. If the value outside the range
is set, "error 0x1F12 occurs.
(5) The time when parameter is written is set in ExecutionMode, and values can be set as below. The value unable to
be set causes "error0x101B.
0 (mcImmediately): Change the parameter value immediately after the execution of motion function block(rising
Edge in Execute input) If the relevant axis is running, operation can be affected.
1 (mcQueued): Changed at the same time withBufferedof BufferMode. (Refer to 10.1.4. BufferMode input)
10-76
Chapter 10
LS_EncoderPreset
Availability
Encoder preset
XGF-M32E
LS_EncoerPreset
BOOL
UINT
LREAL
BOOL
Execute
Encoder
Position
Relative
Done
Busy
Error
ErrorID
BOOL
BOOL
BOOL
WORD
Input
BOOL
Execute
UINT
Encoder
LREAL
Position
BOOL
Relative
Output
BOOL
Done
BOOL
Busy
BOOL
Error
WORD
ErrorID
Output the number of error occurred while motion function block is running.
10-77
Chapter 10
LS_Jog
Availability
JOG operation
XGF-M32E
LS_Jog
BOOL
UINT
BOOL
BOOL
Enable
Axis
Direction
Low/High
Enabled
Axis
Busy
Error
ErrorID
BOOL
UINT
BOOL
BOOL
WORD
Input-Output
UINT
Axis
BOOL
Enable
BOOL
Direction
Set the rotation direction in jog (0: Forward direction, 1: Reverse direction)
BOOL
Low/High
Input
Output
BOOL
Enabled
BOOL
Busy
BOOL
Error
WORD
ErrorID
Output the number of error occurred while motion function block is running.
(1) This motion function block is to make the relevant axis perform jog operation.
(2) Jog is a manual operation function for test and is used to confirm the position address for system operation, wiring
condition check, and teaching. Jog can be used by dividing the speed into high speed and low speed.
(3) When Enable input is On (in jog), if the value set in Low/High is changed, speed change occurs without stop in jog,
and if the value set in JOG_DIR is changed, Jog is continued by changing the direction after the deceleration
pause.
10-78
Chapter 11
Expanded Functions
11-1
Chapter 11
Expanded Functions
1.1. FOR/NEXT/BREAK
LOOP command
FOR/NEXT/BREAK
Availability
XGF-M32E
Flags
_ERR, _LER
Function
Description
N
FOR
BREAK
Function
(1)
(2)
(3)
(4)
(5)
PLC repeats FOR ~ NEXT command n times and then processes the next step of NEXT command.
n is available 1 ~ 65,535.
FOR ~ NEXT command is able to use 16 NESTINGs.
REAK command is the instruction to escape FOR ~ NEXT loop.
Keep the range of WDT value to avoid delaying the scan time.
Program Example
FOR 100
.
.
.
ON
BREAK
.
.
.
NEXT
11-2
Chapter 11
Expanded Functions
1.2. CALL/SBRT/RET
CALL/SBRT/RET
Availability
XGF-M32E
Flags
Function
Description
NAME
CALL
SBRT
NAME
RET
RETURN
Function
(1)
(2)
(3)
(4)
With an input condition and the CALL n command, it operates a program among the SBRT n ~ RET command.
Nested CALL n command is usable, and the program among SBRT n ~ RET must be placed after END command.
A program which is in SBRT can call another SBRT. In this case, END command is impossible to use in the SBRT.
A program can escape the FOR ~ NEXT loop with a BREAK command.
Program Example
.
.
.
END
.
.
.
RET
(1) It calls a SBRT (Motor Start) if the program operates CALL command.
(2) SBRT command must be placed after the END command.
(3) When SBRT (Motor Start) is called, a program is run in the SBRT until RET command. It goes to the position again
where CALL command is called.
11-3
Chapter 11
Expanded Functions
1.3. JMP
JUMP command
JMP
Availability
XGF-M32E
Flags
Function
JMP
Description
LABLE
Function
(1) If a switch of JMP (LABLE) command is on, it jumps to the next of the assigned LABLE. All the commands
between JMP and LABLE are not processed.
(2) LABLE must not be duplicated, but JMP can be repeated.
(3) It is recommended that the program which must not be run in a state of emergency is placed between JMP and
LABLE.
Program Example
(1) When %IX0.0 is on, it does not operate ABS function.
11-4
Chapter 11
Expanded Functions
1.4. INIT_
1.5. END
END command
END
Availability
XGF-M32E
Flags
Function
Description
END
Terminate a program
Function
(1) It indicates the end of a program.
(2) After the processing of the END command, the program goes to the beginning of itself and process again.
11-5
Ch apter12
ST (Structured Text)
ST program can use all of text editor and has high portability.
12.2. Comments
There are two types in comments, one line comment and block comment.
- One line comment uses //, that line is used as comment line.
- Block comment considers text between * and *.
For example)
12-1
Chapter 12
ST (Structured Text)
12.3 Expression
(1) Expression consists of operator and operand. Operand may be constant, character, character string, time character, defined
variable (named variable, direct variable), defined function (function, function block). Operator of ST is described in the follow
table. And also expression is calculated according to order of operator of ST language table.
(2) Expression is calculated according to order of operator in <Table 1>. Operator having highest priority is calculated first and
then operator having second highest priority is calculated. This is repeated until end of calculation.
Ex.) A+B*C: first, multiplies B by C and adds the result to A.
Number
Operation
Symbol
Parenthesis
(Expression)
Function
Order
High
Ex.) ADD(X, Y)
3
not
Complement
NOT
Exponent
**
Multiplication
Division
Remain
MOD
Add
Subtract
Compare
same
Not same
<>
&
AND
10
XOR
11
Bool logical OR
OR
<Table 1> Operator of ST language
(3) Among same operations which have same order, operation in left of expression has higher order.
For example: A+B-C: first, adds A to B and subtracts C from result of A+B.
(4)
12-2
Low
Ch apter12
ST (Structured Text)
(5) When executing operation, the following condition is dealt with error.
(a) Division by 0
For example: A/(B*C): in case result of B*C is 0, operation error occurs.
(b) Operand is not applicable data type for operation.
For example: ADD(1,2,3): unable to determine the data type of number so compile error occurs
(c) Result of arithmetic operation exceeds range of data type.
For example: B*C: When B, C are UINT type, result is higher than 65,535, operation error occurs.
12.3.1 + Operator
(1) + Operator is used to add two operands.
(2) Expression
result := expression1 + expression2
Items
Description
Result
expression1
ANY_NUM type
expression2
ANY_NUM type
Example
Description
Val1 := 20;
Val2 := 4;
Note
ANY_NUM includes ANY_REAL type and ANY_INT. For more detail, refer to data type layer of ch.3.2.2
12.3.2 - Operator
(1) Subtracts right value from left value.
(2) Expression
result := expression1 - expression2
Items
Description
result
expression1
ANY_NUM
expression2
ANY_NUM
12-3
Chapter 12
ST (Structured Text)
Example
Description
Val1 := 20;
Val2 := 4;
12.3.3 * Operator
(1) Multiplies two operands
(2) Expression
result := expression1 * expression2
Items
result
expression1
expression2
Example
In1 := 2 ;
Result := 20 * In1 ;
Description
Named variable or direct variable
ANY_NUM type
ANY_NUM type
Description
Multiplies 20 by In1(2) and inputs result.
Value of result becomes 40.
Constant and variable can be used as operands (Val1, Val2).
12.3.4 / Operator
(1) Divides left value by right value.
(2) Data type of result is different according to data type of operand. If operand is REAL type, result is also REAL type. If operand
is integer, result is also integer. If 5 (int) is divided by 3 (int), result is real but number less than decimal point is removed.
(3) Expression
result := expression1 / expression2
Item
result
expression1
expression2
12-4
Description
Named variable or direct variable
ANY_NUM type
ANY_NUM type
Ch apter12
Example
In1 := 2 ;
Result := 20 / In1 ;
ST (Structured Text)
Description
Divides 20 by 2(ln1) and inputs result.
Result becomes 10.
Constant and variable can be used as operands.
12-5
Chapter 12
ST (Structured Text)
Notes
If some value is divided by 0, operation error flag (_ERR) is on and CPU is in RUN mode.
Example
Description
Named variable or direct variable
ANY_NUM type
ANY_NUM type
Description
Divides 12 by 10(ln1) and inputs remain into result
In1:= 10 ;
Result := 12 MOD In1 ;
Notes
If some value is divided by 0, operation error flag (_ERR) is on and CPU is in RUN mode.
12.3.6 ** Operator
(1) Exponential operator is used to multiply left number as many as right number times
(2) Expression
result := expression1 ** expression2
Items
result
expression1
expression2
Example
In1 := 3 ;
Result := 10 ** In1 ;
12-6
Description
Named variable or direct variable
ANY_REAL type
ANY_REAL type
Description
Multiplies 10 as many as 3 times and inputs it to result.
Result becomes 1000.
Constant and variable can be used as operands.
Ch apter12
ST (Structured Text)
Description
Named variable or direct variable
ANY_BIT type
ANY_BIT type
result
expression1
expression2
expression2
result
Example
Description
th
Since first bit and 5 bit of two operands are both 1, result is
2#00010001.
Constant and variable can be used as operands.
12.3.8 OR operator
(1) Executes logical bit OR operation.
(2) Expression
result := expression1 OR expression2
Items
result
expression1
expression2
Description
Named variable or direct variable
ANY_BIT type
ANY_BIT type
expression2
result
12-7
Chapter 12
ST (Structured Text)
Example
Description
Description
Named variable or direct variable
ANY_BIT type
ANY_BIT type
expression2
result
Example
Result := 2#10010011 XOR 2#00111101;
Description
Since first bits of two operands are 1, first bit of result is 0.
Result is 2#10101110.
12.3.10 = Operator
(1) Compares two operands if they are same.
(2) Expression
result := expression1 = expression2
Item
result
expression1
expression2
12-8
Description
Named variable or direct variable
ANY type
ANY type
Ch apter12
ST (Structured Text)
expression2
result
Example
Description
Val1 := 20;
Val2 := 20 ;
Result is 1.
Description
Named variable or direct variable
ANY type
ANY type
expression2
result
Example
Description
Val1 := 20;
Val2 := 20 ;
Result is 0.
Chapter 12
ST (Structured Text)
Item
result
expression1
expression2
Description
Named variable or direct variable
ANY type
ANY type
expression2
result
Example
Description
Val1 := 20;
Val2 := 10 ;
Result is 1.
Description
Named variable or direct variable
ANY type
ANY type
expression2
result
Example
Val1 := 20;
Val2 := 10 ;
Result is 0.
12-10
Description
Ch apter12
ST (Structured Text)
Description
Named variable or direct variable
ANY type
ANY type
expression2
result
Example
Description
Val1 := 20;
Compares two operands if left one is larger than right one or same.
Val2 := 20 ;
Result is 1.
Description
Named variable or direct variable
ANY type
ANY type
expression2
result
12-11
Chapter 12
ST (Structured Text)
Example
Description
Val1 := 2;
Compares two operands if left one is smaller than right one or same.
Val2 := 20 ;
Result is1.
Description
Named variable or direct variable
ANY_BIT type
Example
Description
Val1 = 2#1100;
Result is 2#0011.
12.3.17 - operator
(1) Adds negative sign into value.
(2) Expression
12-12
result := - expression
item
result
expression
Description
Named variable or direct variable
ANY_NUM type
Example
Description
Val1 = 10;
Result:= - Val1 ;
Result is -10.
Ch apter12
ST (Structured Text)
12.4 Statements
(1) Statements of ST language are summarized in <Table 2>.
(2) Statement is ended by semi colon(;).
Chapter 12
ST (Structured Text)
Number
Command
Example
Assignment
Recall of FB
Using output of FB
A:=CMD_TMR.Q;
RETURN
RETURN;
IF
D:=B*B -4*A*C;
IF D<1.0 THEN NROOTS :=0;
ELSIF D= 0.0 THEN
NROOTS := 1;
X1:= -B/(2.0*A);
ELSE
X1:= (-B+SQRT(D))/(2.0*A);
X2:= (-B-SQRT(D))/(2.0*A);
END_IF;
CASE
TW := BCD_TO_INT(THUMBWHEEL);
TW_ERROR := 0;
CASE TW OF
1, 5: DISPLAY := OVEN_TEMP;
2: DISPLAY := MOTOR_SPEED;
3: DISPLAY := GROSS TARE;
4,6..10: DISPLAY := STATUS(TW-4);
ELSE DISPLAY := 0;
TW_ERROR := 1;
END_CASE;
QW100 := INT_TO_BCD(DISPLAY);
FOR
J := 101;
FOR I := 1 TO 100 BY 2 DO
IF WORDS[I] = KEY THEN
12-14
Ch apter12
Number
Command
ST (Structured Text)
Example
J := I;
EXIT;
END_IF;
END_FOR ;
WHILE
J := 1;
WHILE J <= 100 & WORDS[J] <> KEY DO
J := J+2;
END_WHILE;
REPEAT
J := -1;
REPEAT
J := J+2;
UNTIL J = 101 OR WORDS[J] = KEY
END_REPEAT ;
EXIT
EXIT;
10
12.4.4 IF
(1) It is used for program to select more than one
(2) Expression
IF condition THEN statements [ELSE elsestatements ] END_IF
Or
IF condition THEN
statements
[ELSIF condition-n THEN
elseifstatements] . . .
[ELSE
elsestatements]
END_IF
Item
condition
Description
If condition is TRUE, a statement following THEN is executed.
In case of FLASE, ELSIF or ELSE executes.
statements
condition-n
Chapter 12
ST (Structured Text)
Item
Description
elseifstatements
elsestatements
Example
IF Val1 <= 10 THEN
Result := 10;
END_IF;
Description
If condition (Val1 <= 10) is TRUE, 10 is assigned into result.
Result := 10;
ELSIF Val1 <= 20 THEN
Result := 20;
ELSE
Result := 30;
END_IF;
12.4.5 CASE
(1) Diverges according to value of expression following CASE. Expression should be integer. When value of expression is not
included in case list, a statement after ELSE executes. If there is no ELSE, no statement list executes. If there is no branch
command, progresses flow of program executing other all statements.
(2) Expression
CASE expression OF
case_list : statement_list
{ case_list : statement_list}
[ELSE
statement_list]
END_CASE
Item
Description
expression
case_list
12-16
Ch apter12
Item
Description
case_list_element
subrange
statement_list
Example
CASE Val1 OF
ST (Structured Text)
Description
If value of Val1 is 1, 10 is assigned into result.
: Result := 10 ;
2..5
: Result := 20 ;
7, 10 : Result := 30 ;
ELSE
Result := 40 ;
END_CASE ;
12.4.6 FOR
(1) It is used to deal with repetition and uses three control statements. First, statement for initialization is necessary. If To
expression is TRUE (present counter value is less than end value), loop executes one time. Then counter values increases
as many as BY value and condition is checked again. In FOR statement, condition is checked first and loop executes later.
So no loop may be executed.
(2) Expression
FOR counter := start TO end [BY step] DO
statements
END_FOR
Item
counter
Description
Integer (SINT, INT, DINT) s
start, end, step should be the same type.
start
end
step
Indicates increment of count variable whenever loop executes. If this is not used,
increment is 1.
statements
12-17
Chapter 12
ST (Structured Text)
Example
Description
SUM := 0;
FOR counter := 0 TO 10 DO
SUM := SUM + 1;
END_FOR ;
SUM := 0;
FOR counter = 0 TO 10 BY 2 DO
SUM := SUM + 1;
END_FOR ;
Note
1) Because of long scan time, watch - dog may be on.
2) BY part can be skipped. In case of skip, it increases as many as 1.
3) If start is larger than end, FOR text is not executed.
12.4.7 WHILE
(1) It executes repeatedly until condition is 0. In WHILE statement, condition is checked first and loop is executed later. So no loop
executes.
(2) Expression
WHILE condition DO
statements
END_ WHILE
Item
condition
Description
If condition is TRUE, statements after DO executes.
In case of FLASE, it goes out from loop.
statements
Example
Counter := 0
WHILE Counter < 20 DO
Counter := Counter + 1;
END_WHILE ;
Description
If condition that counter is less than 20 is TRUE, a statement executes.
If condition is FALSE, it goes out from loop.
Note
In WHILE statement, in case, condition does not become 0, it cannot go out from loop. In this case, due to long scan
time, watch-dog is on. So be careful so that condition is not always TRUE.
12-18
Ch apter12
ST (Structured Text)
12.4.8 REPEAT
(1) Statement executes repeatedly until condition is TRUE. In REPEAT statement, loop executes first and condition is checked
later. So loop executes at least one time.
(2) Expression
REPEAT
statements
UNTIL condition
END_REPEAT
Item
condition
Description
If condition is FALSE, it executes repeatedly and if TRUE, goes out from
loop.
statements
Example
Counter := 0;
REPEAT DO
Counter := Counter + 1;
UNTIL Counter > 20
Description
First, Counter variable is set to 1. If the condition that Counter variable is
larger than 2 is met, it goes out from loop or it executes loop.
If Counter variable is 21, condition is TRUE and it goes out from loop.
END_REPEAT ;
Note
In REPEAT statement, in case condition doesnt become 1, it cannot go out from loop. In this case, due to long scan
time, watch-dog is on. So be careful so that condition is not always FALSE.
12-19
Chapter 12
ST (Structured Text)
12.4.9 EXIT
(1) It is used to go out from iteration statements (WHILE, FOR, REPEAT).
(2) If it is used outside iteration statements, error occurs.
(3) Expression
EXIT
Example
Description
SUM := 0;
FOR Counter := 0 TO 10 DO
SUM := SUM + 1;
EXIT;
END_FOR ;
Counter := 0;
WHILE Counter < 20 DO
Counter := Counter + 1 ;
IF Counter = 10 THEN
EXIT;
END_IF;
END_WHILE ;
Counter := 0;
REPEAT DO
Counter := Counter + 1 ;
IF Counter = 10 THEN
EXIT;
END_IF;
UNTIL Counter > 20
END_REPEAT ;
12-20
Ch apter12
ST (Structured Text)
environment.
Parameter
Function
Function Block
return value.
Input
Output
12-21
Chapter 12
ST (Structured Text)
Parameter
Function
Function Block
Note
To use the function block, write instance name of function block. Declare the function block as how to declare the
variable and write this variable name (instance name)
Ex.) Use of timer
12-22
Ch apter12
ST (Structured Text)
Parameter
Function
Function Block
parameters.
parameters.
INST(%IX0.0, T#1s, A, E) ;
Common
Input
parameter.
parameter.
INST(%IX0.0, T#1s, A, E) ;
position
INST(%IX0.0.0, T#1s, A, E) ;
Output
12-23
Chapter 12
ST (Structured Text)
Note
For function whose parameter type is variable, input parameter type should be determined.
Example
INT1 := ADD(1, 2, 3);
Description
Error occurs while determining function type
Example
Description
Note
- Input parameter EN is condition to execute the function. If you use the EN as follows, LIMIT function executes
when A is 1.
OUT := LIMIT(EN := A, MX := 20, MN := B, IN := 10) ;
ENO parameter becomes 1 when function executes without error. It cannot be used in ST and available in LD
Note
1. ST does not support the extension functions(BREAK, CALL, END, FOR, INIT_DONE, JMP, NEXT, RET, SBRT)
2. You cannot use the function whose name is same as operator name. (OR, XOR, AND, MOD, NOT)
12-24
Ch apter12
ST (Structured Text)
12.5.2 Example
(1) Function
Use of LD
Use of ST
1) Standard type
EN used
OutValue := ADD(EN := A, IN1 := Value1, IN2 := Value2);
EN not used
OutValue := ADD(IN1 := Value1, IN2 := Value2);
2) Nonstandard type
OutValue := ADD(Value1, Value2);
EN, ENO cannot be used
Use of LD
Use of ST
1) Standard type
INST(IN := A, PT := T#10S, Q => TimeOut);
2) Nonstandard type
INST(A, T#10S, TimeOut, TimeValue);
Output variable cannot be omitted. So you have to allocate the
applicable variable to output parameter ET. (TimeValue)
12-25
Chapter 12
ST (Structured Text)
(3) Application
Use of LD
Use of ST
%QX0.0 := Complete;
12-26
1. Decimal
Decimal number system means the number expressing an order or size (volume) using 0~9.
And, followed by 0, 1, 2, 3, 49, it is carried to 10 and keeps counting.
For instance, a decimal number, 153 can be expressed as follows in the view of line and weight of line.
153 = 100 + 50 + 3
=1*100 + 5*10 + 3*1
2
Decimal number
system symbols
(0~9)
Weight of line
2. Binary
Binary numeral presents a numeral meaning an order and size by using two symbols, 0 and 1. Therefore, it is carried to
10 followed by 0 and 1 and keeps counting. That is, a cipher of 0, 1 is called bit.
A1-1
Binary
Decimal
10
11
100
101
110
111
1000
For instance, let us think that the given binary numeral can be expressed in decimal number system.
10011101
As considering line number and the weight of line in decimal number system, try to attach bit number and bit weight from the
very right.
64
1
4
32
16
1
2
...
...
Bit number
binary numeral
...
...
128
...
...
...
...
weight of bit
How about summing the multiplication of weights of each bit code like decimal number system?
= 1 128 + 0 64 + 0 32 + 1 16 + 1 8 + 1 4 + 0 2 + 1 1
= 128 + 16 + 8 + 4 + 1
= 157
That is, as the above, a binary numeral is converted to a decimal numeral by adding the weights of bits of which code is 1.
A1-2
1 bit
1 byte
0 0 0 0 0 0 0 0 1 0 0 1 1 1 0 1
1 word (2 bytes)
3. Hexadecimal
Like decimal or binary numeral, hexadecimal numeral means the number representing an order and size by using 0~9
and A~F.
Then, followed by 0, 1, 2, D, E, F, it is carried to 10 and keeps counting.
Decimal
Hexadecimal
Binary
10
11
100
101
110
111
1000
1001
10
1010
11
1011
12
1100
13
1101
14
1110
15
1111
16
10
10000
17
11
10001
18
12
10010
A1-3
9 1 0 1
1010
0100
Number of line
hexadecimal
numeral
1001
1101
For instance, a decimal numeral, 157 can be expressed as follows and the weight of each bit can be also expressed as
follows.
line 4
line 3
line 2
line 1
0
A1-4
1
100
0
80
40
20
1
10
0
8
1
1
Weight of bit
Binary (BIN)
Decimal
Hexadecimal (H)
00000000
00000000
00000000
00000000
0000
00000000
00000001
00000000
00000001
0001
00000000
00000010
00000000
00000010
0002
00000000
00000011
00000000
00000011
0003
00000000
00000100
00000000
00000100
0004
00000000
00000101
00000000
00000101
0005
00000000
00000100
00000000
00000100
0006
00000000
00000111
00000000
00000111
0007
00000000
00001000
00000000
00001000
0008
00000000
00001001
00000000
00001001
0009
00000000
00010000
00000000
00001010
10
000A
00000000
00010001
00000000
00001011
11
000B
00000000
00010010
00000000
00001100
12
000C
00000000
00010011
00000000
00001101
13
000D
00000000
00010100
00000000
00001110
14
000E
00000000
00010101
00000000
00001111
15
000F
00000000
00000110
00000000
00010000
16
0010
00000000
00000111
00000000
00010001
17
0011
00000000
00001000
00000000
00010010
18
0012
00000000
00001001
00000000
00010011
19
0013
00000000
00100000
00000000
00010100
20
0014
00000000
00100001
00000000
00010101
21
0015
00000000
00100010
00000000
00010110
22
0016
00000000
00100011
00000000
00010111
23
0017
00000000
00000000
01100100
100
0064
00000001
00100111
00000000
01111111
127
007F
00000010
01010101
00000000
11111111
255
00FF
00010000
00000000
00000000
11100000
1,000
03E8
00100000
01000111
00000000
11111111
2,047
07FF
01000000
10010101
00000000
11111111
4,095
0FFF
10011001
10011001
00000111
00001111
9,999
270F
00100111
00010000
10,000
2710
01111111
11111111
32,767
7FFF
00000001
A1-5
b0
Sign bit
1: negative number
Representation ran: -32,768 ~ 32,767
If 32 bits
b31
b16
Sign bit
b15
b0
0
b0
1
b0
1
-0001 = 16#FFFF
A1-6
b0
Reserved Variable
Data Type
Address
Description
_RUN
BOOL
%FX0
RUN status
_STOP
BOOL
%FX1
STOP status
_ERROR
BOOL
%FX2
ERROR status
_RUN_EDIT_ST
BOOL
%FX5
_RUN_EDIT_CHK
BOOL
%FX6
_RUN_EDIT_DONE
BOOL
%FX7
_RUN_EDIT_NG
BOOL
%FX8
_FLASH_BUSY
BOOL
%FX9
Writing to FLASH
_FLASH_FAIL
BOOL
%FX10
_FORCE_IN
BOOL
%FX11
_FORCE_OUT
BOOL
%FX12
_PB1
BOOL
%FX14
_PB2
BOOL
%FX15
_BPRM_ER
BOOL
%FX35
_COMPRM_ER
BOOL
%FX36
_AXISPRM_ER
BOOL
%FX37
_AXESPRM_ER
BOOL
%FX38
_NETPRM_ER
BOOL
%FX39
_SDPRM_ER
BOOL
%FX40
_PGM_ER
BOOL
%FX41
Program error
_CODE_ER
BOOL
%FX42
_SWDT_ER
BOOL
%FX45
_AB_SD_ER
BOOL
%FX64
_TASK_ER
BOOL
%FX65
Task collision
_PTASK_CYCLE_ER
BOOL
%FX67
_CTASK_CYCLE_ER
BOOL
%FX168
_T20MS
BOOL
%FX96
_T100MS
BOOL
%FX97
_T200MS
BOOL
%FX98
Reserved Variable
Data Type
Address
Description
_T1S
BOOL
%FX99
1s cycle clock
_T2S
BOOL
%FX100
2s cycle clock
_T10S
BOOL
%FX101
_T20S
BOOL
%FX102
_T60S
BOOL
%FX103
_ON
BOOL
%FX104
_OFF
BOOL
%FX105
_1ON
BOOL
%FX106
_1OFF
BOOL
%FX107
_STOG
BOOL
%FX108
_ERR
BOOL
%FX112
_LER
BOOL
%FX113
_ARY_IDX_ERR
BOOL
%FX114
_ARY_IDX_LER
BOOL
%FX115
_OS_VER
DWORD
%FD4
OS version
_OS_DATE
DWORD
%FD5
OS distribution date
_OS_VER_PATCH
DWORD
%FD6
OS patch version
_SCAN_MAX
WORD
%FW14
_SCAN_MIN
WORD
%FW15
_SCAN_CUR
WORD
%FW16
_CTASK_SCAN_MAX
WORD
%FW17
_CTASK_SCAN_MIN
WORD
%FW18
_CTASK_SCAN_CUR
WORD
%FW19
ARRARY [0..7]
%FB40
_PLC_TIME
OF BYTE
_PLC_DATE
DATE
%FW24
_PLC_TOD
TIME_OF_DAY
%FD13
_FLASH_WR_RATIO
WORD
%FW28
_SCAN_WR
BOOL
%FX464
_CTASK_SCAN_WR
BOOL
%FX465
DWORD
%FD16
_FLASH_WR_CNT
A2-2
Reserved Variable
Data Type
Address
Description
_RUN_MODE
BOOL
%JX0.0
RUN mode on
_STOP_MODE
BOOL
%JX0.1
STOP mode on
_TEST_MODE
BOOL
%JX0.2
TEST mode on
_WARNING
BOOL
%JX0.3
Warning state
_ALARM
BOOL
%JX0.4
Alarm state
_LINKUP_INFO
BOOL
%JX0.5
_COMM
BOOL
%JX0.6
_COMM_ERR
BOOL
%JX0.7
_COM_ERR
BOOL
%JX0.8
_ERR_CODE
WORD
%JW0.1
_AX_RDY
ARRAY[0..32]
OF %JX0.32
Axis ready
OF %JX0.64
IO ready
BOOL
_IO_RDY
ARRAY[0..4]
BOOL
_AX_NUM
BYTE
%JB0.10
_IO_NUM
BYTE
%JB0.11
_AX_SDO_BUSY
ARRAY[0..32]
OF %JX0.96
OF %JX0.128
OF %JX0.160
OF %JX0.176
BOOL
_AX_SDO_ERR
ARRAY[0..32]
BOOL
_IO_SDO_BUSY
ARRAY[0..4]
BOOL
_IO_SDO_ERR
ARRAY[0..4]
BOOL
_PD0_ERR_CNT
WORD
%JW0.12
_AXxx_RDY
BOOL
%JXxx.0
Axis xx ready
_AXxx_WARNING
BOOL
%JXxx.1
_AXxx_ALARM
BOOL
%JXxx.2
_AXxx_SV_ON
BOOL
%JXxx.3
Reserved Variable
Data Type
Address
Description
_AXxx_SV_RDY
BOOL
%JXxx.4
_AXxx_AX_TYPE
BOOL
%JXxx.5
_AXxx_MST_INFO
BYTE
%JBxx.1
_AXxx_SVON_INCMPL
BOOL
%JXxx.16
_AXxx_COMM_WARN
BOOL
%JXxx.17
_AXxx_DEV_WARN
BOOL
%JXxx.18
_AXxx_SV_ERR
BOOL
%JXxx.32
_AXxx_HW_POT
BOOL
%JXxx.33
_AXxx_HW_NOT
BOOL
%JXxx.34
_AXxx_SW_POT
BOOL
%JXxx.35
_AXxx_SW_NOT
BOOL
%JXxx.36
_AXxx_SV_OFF
BOOL
%JXxx.37
_AXxx_POS_OVR
BOOL
%JXxx.38
_AXxx_VEL_OVR
BOOL
%JXxx.39
_AXxx_DEV_ERR
BOOL
%JXxx.40
_AXxx_HOME_INCMPL
BOOL
%JXxx.41
A2-4
_AXxx_COMM_ERR
BOOL
%JXxx.42
_AXxx_BUSY
BOOL
%JXxx.48
_AXxx_PAUSE
BOOL
%JXxx.49
Axis
_AXxx_STOP
BOOL
%JXxx.50
_AXxx_FAIL
BOOL
%JXxx.51
_AXxx_CMPL
BOOL
%JXxx.52
_AXxx_DIR
BOOL
%JXxx.53
_AXxx_JOG
BOOL
%JXxx.54
_AXxx_HOME
BOOL
%JXxx.55
_AXxx_P_CTRL
BOOL
%JXxx.56
_AXxx_V_CTRL
BOOL
%JXxx.57
_AXxx_T_CTRL
BOOL
%JXxx.58
_AXxx_LINTP
BOOL
%JXxx.59
_AXxx_CINTP
BOOL
%JXxx.60
xx
state
of
motion
commands
pause(velocity is zero)
Reserved Variable
Data Type
Address
Description
_AXxx_SYNC
BOOL
%JXxx.61
_AXxx_POS_CMPL
BOOL
%JXxx.64
_AXxx_INPOS
BOOL
%JXxx.65
_AXxx_LATCH_CMPL
BOOL
%JXxx.66
_AXxx_HOME_CMPL
BOOL
%JXxx.67
_AXxx_Disabled
BOOL
%JXxx.80
_AXxx_Standstill
BOOL
%JXxx.81
_AXxx_Discrete
BOOL
%JXxx.82
_AXxx_Continuous
BOOL
%JXxx.83
_AXxx_Synchronized
BOOL
%JXxx.84
_AXxx_Homing
BOOL
%JXxx.85
_AXxx_Stopping
BOOL
%JXxx.86
_AXxx_Errorstop
BOOL
%JXxx.87
_AXxx_TPOS
LREAL
%JLxx.2
_AXxx_CPOS
LREAL
%JLxx.3
_AXxx_CVEL
LREAL
%JLxx.4
_AXxx_ACCDEC
LREAL
%JLxx.5
_AXxx_CJERK
LREAL
%JLxx.6
_AXxx_CTRQ
LREAL
%JLxx.7
_AXxx_POS
LREAL
%JLxx.8
_AXxx_VEL
LREAL
%JLxx.9
_AXxx_TRQ
LREAL
%JLxx.10
_AXxx_POS_DEV
LREAL
%JLxx.11
_AXxx_ALM
BOOL
_AXxx_SV_ON_STS
BOOL
_AXxx_POT
BOOL
_AXxx_NOT
BOOL
_AXxx_HOME_INPUT
BOOL
_AXxx_LATCH1
BOOL
_AXxx_LATCH2
BOOL
_AXxx_SVPARAM_BUSY BOOL
_AXxx_DRV_IN
DWORD
%JDxx.25
_AXxx_AX_ERR
WORD
%JWxx.52
_AXxx_DRV_ERR
WORD
%JWxx.53
Reserved Variable
Address
Description
_AGxx_RDY
BOOL
%CXyy.0
_AGxx_WARNING
BOOL
%CXyy.1
_AGxx_SV_ON
BOOL
%CXyy.3
_AGxx_SV_RDY
BOOL
%CXyy.4
_AGxx_BUSY
BOOL
%CXyy.16
BOOL
%CXyy.17
_AGxx_STOP
BOOL
%CXyy.18
_AGxx_FAIL
BOOL
%CXyy.19
_AGxx_CMPL
BOOL
%CXyy.20
_AGxx_LINTP
BOOL
%CXyy.21
_AGxx_CINTP
BOOL
%CXyy.22
_AGxx_POS_CMPL
BOOL
%CXyy.32
_AGxx_Disabled
BOOL
%CXyy.48
_AGxx_Standby
BOOL
%CXyy.49
_AGxx_Moving
BOOL
%CXyy.50
_AGxx_Homing
BOOL
%CXyy.51
_AGxx_Stopping
BOOL
%CXyy.52
_AGxx_ErrorStop
BOOL
%CXyy.53
_AGxx_CMD_VEL
LREAL
%CLyy.1
_AGxx_CMD_ACCDEC
LREAL
%CLyy.2
_AGxx_ACT_VEL
LREAL
%CLyy.3
_AGxx_AX_NUM
WORD
%CWyy.17
_AGxx_AX1
BYTE
%CByy.36
_AGxx_AX2
BYTE
%CByy.37
_AGxx_AX3
BYTE
%CByy.38
_AGxx_AX4
BYTE
%CByy.39
_AGxx_PAUSE
A2-6
Data Type
Reserved Variable
_IN
Data Type
Address
ARRAY[0..7] OF %IX0.0
Description
Internal Digital input
BOOL
_ENC1
LREAL
%IL0.1
Encoder1 input
_ENC2
LREAL
%IL0.2
Encoder2 input
_OUT
ARRAY[0..7] OF %QX0.0
BOOL
_SLx_Controlword
UINT
%QWx.0
Controlword
_SLx_Target_Torque
INT
%QWx.1
Target torque
_SLx_Target_Position
DINT
%QDx.1
Target position
_SLx_Mode_of_Operation
USINT
%QBx.8
Operation mode
_SLx_Touch_Probe_Function
UINT
%QWx.5
_SLx_Statusword
UINT
%IWx.0
Statusword
_SLx_Torque_Actual_Value
INT
%IWx.1
_SLx_Position_Actual_Value
DINT
%IDx.1
_SLx_Following_Error_Actual_Value
DINT
%IDx.2
_SLx_Digital_Inputs
UDINT
%IDx.3
Digital input
_SLx_Mode_of_Operation_Display
USINT
%IBx.16
_SLx_Command_Speed(rpm)
INT
%IWx.9
Commanded speed
_SLx_Current_Speed(rpm)
INT
%IWx.10
Operating speed
_SLx_Touch_Probe_Status
UINT
%IWx.11
DINT
%IDx.6
_SLx_Touch_Probe_1_Positive_Edge_Position_Value
A2-7
Warranty
1. Warranty Period
The product you purchased will be guaranteed for 18 months from the date of manufacturing.
2. Scope of Warranty
Any trouble or defect occurring for the above-mentioned period will be partially replaced or repaired. However, please note the following
cases will be excluded from the scope of warranty.
(1)
(2)
(3)
(4)
(5)
(6)
Any trouble attributable to unreasonable condition, environment or handling otherwise specified in the manual,
Any trouble attributable to others products,
If the product is modified or repaired in any other place not designated by the company,
Due to unintended purposes
Owing to the reasons unexpected at the level of the contemporary science and technology when delivered.
Not attributable to the company; for instance, natural disasters or fire
3. Since the above warranty is limited to PLC unit only, make sure to use the product considering the safety for system configuration or
applications.
Environmental Policy
LS Industrial Systems Co., Ltd supports and observes the environmental policy as below.
Environmental Management
LS Industrial Systems considers the
environmental preservation as the preferential
management subject and every staff of LS
Industrial Systems use the reasonable
endeavors for the pleasurably environmental
preservation of the earth.
About Disposal
LS Industrial Systems PLC unit is designed to
protect the environment. For the disposal,
separate aluminum, iron and synthetic resin
(cover) from the product as they are reusable.
http://www.lsis.biz
HEAD OFFICE
LS tower, Hogye-dong, Dongan-gu, Anyang-si, Gyeonggi-do 1026-6,
Korea http://eng.lsis.biz
Tel : (82-2)2034-4870/Fax : 82-2-2034-4648 e-mail : cshwang@lsis.biz
LSIS Tokyo Office _ Tokyo, Japan
Address: 16FL. Higashi-Kan. Akasaka Twin Tower 17-22,
Akasaka.Monato-ku Tokyo 107-8470. Japan
Tel : 81-3-3582-9128/Fax : 81-3-3582-2667 e-mail : jschuna@lsis.biz
LSIS (ME) FZE _ Dubai, U.A.E.
Address : Jafza View Tower Lob 19, Room 205 Along Sheikh Zayed
Road Jebel Aali Free Zone Dubai, United Arab Emirates
Tel : 971-4-886-5360/Fax : 971-4-886-5361 e-mail : jungyongl@lsis.biz
LSIS Shanghai Office _ Shanghai, China
Address : Room E-G. 12FL Hiamin Empire Plaza. No.726. West.
Yan'an Road Shanghai 200050. P.R. China e-mail : liyong@lsis.com.cn
Tel : 86-21-5237-9977(609)/Fax : 89-21-5237-7189
LSIS Beijing Office _ Beijing, China
Address : B-Tower 17FL. Beijing Global Trade Center B/D. No. 36.
East BeisanHuan-Road. DongCheng-District. Beijing 100013. P.R. China
Tel : 86-10-5825-6027(666)/Fax : 86-10-5825-6028 e-mail : xunmj@lsis.com.cn
LSIS Guangzhou Office _ Guangzhou, China
Address : Room 1403.14FL. New Poly Tower.
2 Zhongshan Liu Road.Guangzhou.P.R China
Tel : 86-20-8328-6754/Fax : 86-20-8326-6287 e-mail : chenxs@lsis.com.cn
2013. 8