M32E_InstructionHelp
M32E_InstructionHelp
XGF-M32E
Safety Instruction
For your safety and effective operation, please read the safety instructions thoroughly before using the product.
► Safety Instructions should always be observed in order to prevent accident or risk with the safe and
► Instructions are divided into “Warning” and “Caution”, and the meaning of the terms is as follows.
Warning This symbol indicates the possibility of serious injury or death if some applicable
instruction is violated.
This symbol indicates the possibility of severe or slight injury, and property
Caution
damages if some applicable instruction is violated.
Moreover, even classified events under its caution category may develop into serious accidents relying on
situations. Therefore we strongly advise users to observe all precautions properly just like warnings.
► The marks displayed on the product and in the user’s manual have the following meanings.
► The user’s manual even after read shall be kept available and accessible to any user of the product.
1
Safety Instruction
Caution
Design the analog input / output signal or pulse input / output line at least 100mm away
from high voltage line or power line so that it is not affected by noise or magnetic field
direct vibration from being applied to the PLC. It may cause electric shock, fire or malfunction.
metallic dust from entering the product. It may cause electric shock, fire or malfunction.
Caution
Use PLC only in the environment specified in PLC manual or general standard of datasheet.
If not, electric shock, fire, abnormal operation of the product may be caused.
Before install or remove the module, be sure PLC power is off. If not, electric shock or damage
Be sure that every module is securely attached after adding a module or an extension
connector. If the product is installed loosely or incorrectly, abnormal operation, error or dropping
may be caused. In addition, contact failures under poor cable installation will be causing
malfunctions as well.
Make sure that the I / O connector is securely fastened. It may cause wrong input or output.
2
Safety Instruction
Warning
Prior to wiring works, make sure that every power is turned off. If not, electric shock or
Caution
Check rated voltages and terminal arrangements in each product prior to its wiring
process. Applying incorrect voltages other than rated voltages and misarrangement among
Secure terminal screws tightly applying with specified torque. If the screws get loose, short
circuit, fire or abnormal operation may be caused. Securing screws too tightly will cause
Be sure to earth to the ground using Class 3 wires for PE terminals which is exclusively
used for PLC. If the terminals not grounded correctly, abnormal operation or electric shock
may be caused.
Don’t let any foreign materials such as wiring waste inside the module while wiring,
3
Safety Instruction
Prior to cleaning or tightening the terminal screws, let all the external power off including
Caution
Prior to installing or disassembling the module, let all the external power off including
Keep any wireless equipment such as walkie-talkie or cell phones at least 30cm away
Caution
Product or battery waste shall be processed as industrial waste. The waste may discharge
4
Revision History
Revision History
Version Date Remark Revised position
V 1.0 2013.9 1. First Edition -
1. Domain address and CI changed -
V1.1 2015.7
2. General specifications changed by reason of changed IEC specifications. 2-1
1. Format and contents modification according to the change of company
V1.2 2020.7 -
name(LSIS LS ELECTRIC)
5
Abut User’s Manual
The User’s Manual describes the product. If necessary, you may refer to the following description and order accordingly. In
addition, you may connect our website (http://www.lselectric.co.kr/) and download the information as a PDF file.
Relevant User’s Manuals
Title Description
XG5000 User’s Manual XG5000 software user manual describing online function such as programming, print,
(for XGK, XGB) monitoring, debugging by using XGK, XGB CPU.
XG5000 User’s Manual XG5000 software user manual describing online function such as programming, print,
(for XGI, XGR) monitoring, debugging by using XGI, XGR CPU.
XGK/XGB Instructions & User’s manual for programming to explain how to use instructions that are used PLC system
Programming User’s Manual with XGK, XGB CPU.
XGI/XGR/XEC Instructions & User’s manual for programming to explain how to use instructions that are used PLC system
Programming User’s Manual with XGI, XGR, XEC CPU.
XGK-CPUA/CPUE/CPUH/CPUS/CPUU user manual describing about XGK CPU module,
XGK CPU User’s Manual
power module, base, IO module, specification of extension cable and system configuration,
(XGK-CPUA/E/H/S/U)
EMC standard.
XGI CPU User’s Manual XGI-CPUU/CPUH/CPUS user manual describing about XGI CPU module, power module,
(XGI-CPUU/CPUH/CPUS) base, IO module, specification of extension cable and system configuration, EMC standard.
XGR- CPUH/F, CPUH/T user manual describing about XGR CPU module, power module,
XGR Redundant Series
extension drive, base, IO module, specification of extension cable and system configuration,
User’s Manual
EMC standard.
XG-PM software user manual describing online function such as motion programing,
XG-PM User’s Manual
monitoring, debugging by using Positioning Module.
Motion Control Module Describes the specification, installation method, how to use various functions, programming
User’s Manual and external devices and wiring, etc. of XGF-M32E motion control module.
6
Table of Content
◎ Table of Content ◎
7
Table of Content
8
Table of Content
9
Table of Content
10
Chapter1 Introduction
Chapter 1 Introduction
This user’s guide describes the languages supported by Motion control module. The Motion control module is based on the
standard language of International Electrotechnical Commission (IEC).
▷ Illustrated language
a) Ladder Diagram (LD): It is a graphical language based on the ladder logic.
b) Function Block Diagram (FBD): It is a graphical language for depicting signal and data flows through function blocks.
▷ Character language
a) Instruction List (IL): It is a low-level ‘assembly like’ language based on similar instruction list languages.
b) Structured Text (ST):It is a high-level PASCAL type language.
▷ Sequential Function Chart (SFC)
1-1
Chapter1 Introduction
1-2
Chapter2 Software Structure
2.1 Introduction
Before creating a PLC program, ensure that you have an overall Motion control system defined in software terms. The overall PLC
system is defined as one project in Motion control module. In the project, you must define hierarchically all composition elements
necessary for the Motion control system.
I/O Parameter
User Data Type
Scan Program
Task Program
2-1
Chapter2 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).
2-2
Chapter3 Common Element
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.
▷ There’s no difference between small letters and capitals in alphabet; all the letters of the alphabet are recognized as upper
case.
Types Examples
Capital alphabet and number IW210, IW215Z, QX75, IDENT
Capital alphabets ,numbers and underline(_) LIM_SW_2, LIMSW5, ABCD, AB_CD
Capital alphabet and number characters starting
_MAIN, _12V7, _ABCD
with an underline(_)
Types Examples
Integer -12, 0, 123_456, +986
Real number -12.0, 0.0, 0.456, 3.14159_26
Real number with an exponent -1.34E-12, 1.0E+6, 1.234E6
Binary number 2#1111_1111, 2#11100000
Octal number 8#377(decimal 255) 8#340(decimal 224)
Hexadecimal number 16#FF(decimal 255) 16#E0(decimal 224)
BOOL data 0, 1, TRUE, FALSE
▷ When using real numbers with exponents, the followings are not allowed.
Ex) 12E-5 ( × ) 12.0E-5 ( ○ )
▷ Integer includes binary, octal, hexadecimal numbers and decimal, which can be distinguished by placing # in front of
3-1
Chapter3 Common Element
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’
(1) Duration
▷ Duration data starts with the reserved word, 'T#' or 't#'.
▷ Several data types such as date (d), hour (h), minute (m), second (s) and millisecond (ms) must be written in
sequence. Duration data can start with any unit (d,h,m,s and ms). In case of millisecond , the minimum unit can be
omitted but the medium unit between duration units must not be skipped.
▷ Cannot use the underline (_).
▷ Duration data can overflow at the maximum unit, if any, and the data with a decimal point is available except ‘ms’. It
does not exceed T#49d17h2m47s295ms (32bits by ‘ms’ unit)
▷ The data is limited to the third decimal place in the second unit (s).
▷ Decimal point is not available at ‘ms’ unit.
▷ Capital and small letters are both available.
Content Examples
3-2
Chapter3 Common Element
Content Examples
D#1984-06-25
Date
d#1984-06-25
TOD#15:36:55.36
Time of Day
tod#15:36:55.369
DT#1984-06-25-15:36:55.36
Date and Time
dt#1984-06-25-15:36:55.369
Size
No. Reserved Word Data Type (bits) Range
1 SINT Short Integer 8 -128 ~ 127
2 INT Integer 16 -32,768 ~ 32,767
3 DINT Double Integer 32 -2,147,483,648 ~ 2,147,483,647
4 LINT Long Integer 64 -263 ~ 263-1
5 USINT Unsigned Short Integer 8 0 ~ 255
6 UINT Unsigned Integer 16 0 ~ 65,535
7 UDINT Unsigned Double Integer 32 0 ~ 4,294,967,295
8 ULINT Unsigned Long Integer 64 0 ~ 264-1
-3.402823466e+038 ~ -1.175494351e-038
9 REAL Real Numbers 32 or 0 or
1.175494351e-038 ~ 3.402823466e+038
-1.7976931348623157e+308 ~
-2.2250738585072014e-308
10 LREAL Long Real Numbers 64
or 0 or 2.2250738585072014e-308 ~
1.7976931348623157e+308
11 TIME Duration 32 T#0S ~ T#49D17H2M47S295MS
12 DATE Date 16 D#1984-01-01 ~ D#2163-6-6
13 TIME_OF_DAY Time Of Day 32 TOD#00:00:00 ~ TOD#23:59:59.999
DT#1984-01-01-00:00:00 ~
14 DATE_AND_TIME Date and Time of Day 64
DT#2163-12-31-23:59:59.999
15 STRING Character String 32*8 -
16 BOOL Boolean 1 0,1
17 BYTE Bit String of Length 8 8 16#0 ~ 16#FF
18 WORD Bit String of Length 16 16 16#0 ~ 16#FFFF
19 DWORD Bit String of Length 32 32 16#0 ~ 16#FFFFFFFF
20 LWORD Bit String of Length 64 64 16#0 ~ 16#FFFFFFFFFFFFFFFF
3-3
Chapter3 Common Element
ANY
▷ 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
Chapter3 Common Element
# Bit String
BOOL
1 bit, range: 0, 1
7 0
USINT
8 bit , range: 2#0000_0000 ~ 2#1111_1111, 16#00 ~ 16#FF
15 87 0
WORD
16 bit, range: 2#0000_0000 _0000_0000 ~ 2#1111_1111_1111_1111 16#0000 ~ 16#FFFF
31 16 15 0
DWORD
32 bit, range: 2#0000_...000 ~ 2#1111_...111 16#00000000 ~ 16#FFFFFFFF
63 32 31 0
LWORD
64 bit, range: 2#0000_...000 ~ 2#1111_...111, 16#0000000000000000 ~ 16#FFFFFFFFFFFFFFFF
# Unsigned Integer
7 0
USINT
8 bit , range: 0 ~ 255
15 87 0
UINT
16 bit, range: 0 ~ 65,535
31 16 15 0
UDINT
32 bit, range: 0 ~ 4,294,967,295
63 32 31 0
ULINT
64 bit, range: 0 ~ 264-1
3-5
Chapter3 Common Element
# Time
31 0
TIME
32 bit, range: 0 ~ 4,294,967,295ms ,T#49d17h2m47s295ms
# Date
63 48 47 32 31 0
DT 0000000000000000 TOD DATE
64 bit, range: DT#1984-01-01-00:00:00 ~ DT#2163-12-31-23:59:59.999
31 16 15 0
TOD
32 bit, range: TOD#00:00:00 ~ TOD#23:59:59.999
15 87 0
DATE
16 bit, range: D#1984-01-01 ~ D#2163-6-6
#BCD
7 43 0
1 0
BYTE 10 10
8 bit, range: 0 ~ 99
15 87 0
3 2 1 0
WORD 10 10 10 10
16 bit, range: 0 ~ 9999
31 24 23 16 15 87 0
7 6 5 4 3 2 1 0
DWORD 10 10 10 10 10 10 10 10
32 bit, range: 0 ~ 99,999,999
63 48 47 32 31 16 15 0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
LWORD 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
64 bit, range: 0 ~ 9,999,999,999,999,999
3-6
Chapter3 Common Element
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.
Location prefix
No. Prefix Meaning
1 I Input Location
2 Q Output Location
3 G G Area Position of Internal Memory (Memory Location)
4 D D Area Position of Internal Memory (Memory Location)
5 M M Area Position of Internal Memory (Memory Location)
6 P P Area Position of Internal Memory (Memory Location)
Size prefix
No. Prefix Meaning
1 X 1 bit size
2 None 1 bit size
3 B 1 byte (8 bits) size
4 W 1 word (16 bits) size
5 D 1 double word (32 bits) size
6 L 1 long word (64 bits) size
Expression format
%[Location Prefix][Size Prefix] n1.n2.n3
Number I, Q M, R, W
0: Internal I/O The n1th data according to [size prefix]
n1
1~36: Axis number (starting from “0”)
The n2th data according to [size prefix] (starting The n2th data of the n1th data (starting
n2
from “0”) from “0”) : available to omit
3-7
Chapter3 Common Element
Examples
%QX0.1 1st output of Internal I/O (1 bit)
%IW2.1 1st word input of no.2 Axis (16bits)
%MD48 48th double word memory
%MW40.3 3rd bit of 40th word memory
(internal memory does not have a base or a slot number)
1. Variable types
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
Chapter3 Common Element
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 because the location of a variable is fixed and it could be
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 PLC’s 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
Chapter3 Common Element
Reserved words
ACTION ... END_ACTION
ARRAY ... OF
AT
CASE ... OF ... ELSE ... END_CASE
CONFIGURATION ... END_CONFIGURATION
Name of data type
DATE#, D#DATE_AND_TIME#, DT#
EXIT
FOR ... TO ... BY ... DO ... END_FOR
FUNCTION ... END_FUNCTION
FUNCTION_BLOCK ... END_FUNCTION_BLOCK
Name of function block
IF ... THEN ... ELSIF ... ELSE ... END_IF
OK
Operator (IL language)
Operator (ST language)
PROGRAM
PROGRAM ... END_PROGRAM
REPEAT ... UNTIL ... END_REPEAT
RESOURCE ... END_RESOURCE
RETAIN
RETURN
STEP ... END_STEP
STRUCTURE ... END_STRUCTURE
T#
TASK ... WITH
TIME_OF_DAY#, TOD#
TRANSITION ... FROM... TO ... END_TRANSITION
3-10
Chapter3 Common Element
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
Chapter3 Common Element
▷ 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
Chapter4 LD (Ladder Digagram)
4.1 Introduction
▷ 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
Line comment
No.
Line0 This is an example of LD program function
Function
THERE
START TON block SIGN ADD
Label UP
Line1 IN Q EN EN0 ( )
bus line
4.2 Bus
▷ Bus line as a power line is vertically placed on either sides of a LD graphic diagram.
4-1
Chapter4 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.
1 Horizontal connection line It transmits the left side value to the right side
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 Description
When the BOOL variable (marked with ***) is on, which
***
Normally open contact transmits the state of the left connection line to the right
1 connection line. Otherwise, the state of the right
connection line is OFF.
4-2
Chapter4 LD (Ladder Digagram)
*** When the BOOL variable (marked with ***), which was
Positive Transition-Sensing
3 off in the previous scan is on, it maintains on state during
Contact
one scan (current scan).
P
*** When the BOOL variable (marked with ***), which was
Negative Transition-
4 on in the previous scan is off, it maintains on state during
Sensing Contact
just one scan (current scan).
N
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 Description
***
Put the state of left connection line into the associated BOOL
Coil
1 ( ) variable (marked with ***).
Put the negated value of the state of left connection line into the
***
associated BOOL variable (marked with ***).
Negated Coil
2 ( ) That is, if the state of left connection line is off, the associated
BOOL variable is on and if the state of left connection line is on,
the associated BOOL variable is off.
Latched Coils
No. Symbol Name Description
*** It sets the associated BOOL variable (marked with ***) to off
4 Reset (Unlatch) Coil when the left link is in the on state and remains reset until set by
(R)
a Set coil.
4-3
Chapter4 LD (Ladder Diagram)
*** If the state of its left connection that was off in the previous scan
Positive Transition-
5 is on in the current scan, the associated BOOL variable (marked
(P) Sensing Coil
with ***) is on during the current scan.
*** If the state of its left connection that was on in the previous scan
Negative Transition-
6 is off in the current scan, the associated BOOL variable (marked
(N) Sensing Coil
with ***) is on during the current scan.
Example
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
Chapter4 LD (Ladder Digagram)
Example
Bool type input/output
of function
ABS EQ LIMIT
EN EN0 EN EN0 EN EN0
IN2 IN
MX
T1 F1 C2
PT ET R 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 whose data type is BOOL.
4-5
Chapter4 LD (Ladder Diagram)
Example
Line3
PLACE2
Line4
T2
PLACE1 START
TON
Line5 IN Q ( )
Line6 TEST PT ET
Line7
▷ 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
S1
CLK ADD RESET START VAL1 REG1 CON1 EMERGE
SR
EN EN0 P S1 Q1 ( )
STOP VAL2 CON2
PLAN IN1 OUT D0 N REG1 R
DOWN IN2
T4
CON2 SWITCH
TOF
IN Q
TEST PT ET
4-6
Chapter4 LD (Ladder Digagram)
Example
Correct
EQ REG1 EQ
EN EN0 EN EN0
STOP START
D0 IN1 OUT D0 IN1 OUT
Correct
4-7
Chapter4 LD (Ladder Diagram)
4-8
Chapter5 Function and Function Block
5.1 Functions
Function Group Function Input data type Output data type Remarks
REAL_TO_SINT REAL SINT -
REAL_TO_INT REAL INT -
REAL_TO_DINT REAL DINT -
REAL_TO_LINT REAL LINT -
REAL_TO_USINT REAL USINT -
REAL_TO_***
REAL_TO_UINT REAL UINT -
REAL_TO_UDINT REAL UDINT -
REAL_TO_ULINT REAL ULINT -
REAL_TO_DWORD REAL DWORD -
REAL_TO_LREAL REAL LREAL -
LREAL_TO_SINT LREAL SINT -
LREAL_TO_INT LREAL INT -
LREAL_TO_DINT LREAL DINT -
LREAL_TO_LINT LREAL LINT -
LREAL_TO_USINT LREAL USINT -
LREAL_TO_***
LREAL_TO_UINT LREAL UINT -
LREAL_TO_UDINT LREAL UDINT -
LREAL_TO_ULINT LREAL ULINT -
LREAL_TO_LWORD LREAL LWORD -
LREAL_TO_REAL LREAL REAL -
SINT_TO_INT SINT INT -
SINT_TO_DINT SINT DINT -
SINT_TO_LINT SINT LINT -
SINT_TO_USINT SINT USINT -
SINT_TO_UINT SINT UINT -
SINT_TO_UDINT SINT UDINT -
SINT_TO_***
SINT_TO_ULINT SINT ULINT -
SINT_TO_BOOL SINT BOOL -
SINT_TO_BYTE SINT BYTE -
SINT_TO_WORD SINT WORD -
SINT_TO_DWORD SINT DWORD -
SINT_TO_LWORD SINT LWORD -
5-1
Chapter5 Function and Function Block
Function Group Function Input data type Output data type Remarks
SINT_TO_REAL SINT REAL -
SINT_TO_LREAL SINT LREAL -
INT_TO_SINT INT SINT -
INT_TO_DINT INT DINT -
INT_TO_LINT INT LINT -
INT_TO_USINT INT USINT -
INT_TO_UINT INT UINT -
INT_TO_UDINT INT UDINT -
INT_TO_ULINT INT ULINT -
INT_TO_***
INT_TO_BOOL INT BOOL -
INT_TO_BYTE INT BYTE -
INT_TO_WORD INT WORD -
INT_TO_DWORD INT DWORD -
INT_TO_LWORD INT LWORD -
INT_TO_REAL INT REAL -
INT_TO_LREAL INT LREAL -
DINT_TO_SINT DINT SINT -
DINT_TO_INT DINT INT -
DINT_TO_LINT DINT LINT -
DINT_TO_USINT DINT USINT -
DINT_TO_UINT DINT UINT -
DINT_TO_UDINT DINT UDINT -
DINT_TO_ULINT DINT ULINT -
DINT_TO_***
DINT_TO_BOOL DINT BOOL -
DINT_TO_BYTE DINT BYTE -
DINT_TO_WORD DINT WORD -
DINT_TO_DWORD DINT DWORD -
DINT_TO_LWORD DINT LWORD -
DINT_TO_REAL DINT REAL -
DINT_TO_LREAL DINT LREAL -
LINT_TO_SINT LINT SINT -
LINT_TO_INT LINT INT -
LINT_TO_DINT LINT DINT -
LINT_TO_USINT LINT USINT -
LINT_TO_UINT LINT UINT -
LINT_TO_UDINT LINT UDINT -
LINT_TO_ULINT LINT ULINT -
LINT_TO_***
LINT_TO_BOOL LINT BOOL -
LINT_TO_BYTE LINT BYTE -
LINT_TO_WORD LINT WORD -
LINT_TO_DWORD LINT DWORD -
LINT_TO_LWORD LINT LWORD -
LINT_TO_REAL LINT REAL -
LINT_TO_LREAL LINT LREAL -
USINT_TO_SINT USINT SINT -
USINT_TO_***
USINT_TO_INT USINT INT -
5-2
Chapter5 Function and Function Block
Function Group Function Input data type Output data type Remarks
USINT_TO_DINT USINT DINT -
USINT_TO_LINT USINT LINT -
USINT_TO_UINT USINT UINT -
USINT_TO_UDINT USINT UDINT -
USINT_TO_ULINT USINT ULINT -
USINT_TO_BOOL USINT BOOL -
USINT_TO_BYTE USINT BYTE -
USINT_TO_WORD USINT WORD -
USINT_TO_DWORD USINT DWORD -
USINT_TO_LWORD USINT LWORD -
USINT_TO_REAL USINT REAL -
USINT_TO_LREAL USINT LREAL -
UINT_TO_SINT UINT SINT -
UINT_TO_INT UINT INT -
UINT_TO_DINT UINT DINT -
UINT_TO_LINT UINT LINT -
UINT_TO_USINT UINT USINT -
UINT_TO_UDINT UINT UDINT -
UINT_TO_ULINT UINT ULINT -
UINT_TO_*** UINT_TO_BOOL UINT BOOL -
UINT_TO_BYTE UINT BYTE -
UINT_TO_WORD UINT WORD -
UINT_TO_DWORD UINT DWORD -
UINT_TO_LWORD UINT LWORD -
UINT_TO_REAL UINT REAL -
UINT_TO_LREAL UINT LREAL -
UINT_TO_DATE UINT DATE -
UDINT_TO_SINT UDINT SINT -
UDINT_TO_INT UDINT INT -
UDINT_TO_DINT UDINT DINT -
UDINT_TO_LINT UDINT LINT -
UDINT_TO_USINT UDINT USINT -
UDINT_TO_UINT UDINT UINT -
UDINT_TO_ULINT UDINT ULINT -
UDINT_TO_BOOL UDINT BOOL -
UDINT_TO_***
UDINT_TO_BYTE UDINT BYTE -
UDINT_TO_WORD UDINT WORD -
UDINT_TO_DWORD UDINT DWORD -
UDINT_TO_LWORD UDINT LWORD -
UDINT_TO_REAL UDINT REAL -
UDINT_TO_LREAL UDINT LREAL -
UDINT_TO_TOD UDINT TOD -
UDINT_TO_TIME UDINT TIME -
ULINT_TO_SINT ULINT SINT -
ULINT_TO_*** ULINT_TO_INT ULINT INT -
ULINT_TO_DINT ULINT DINT -
5-3
Chapter5 Function and Function Block
Function Group Function Input data type Output data type Remarks
ULINT_TO_LINT ULINT LINT -
ULINT_TO_USINT ULINT USINT -
ULINT_TO_UINT ULINT UINT -
ULINT_TO_UDINT ULINT UDINT -
ULINT_TO_BOOL ULINT BOOL -
ULINT_TO_BYTE ULINT BYTE -
ULINT_TO_WORD ULINT WORD -
ULINT_TO_DWORD ULINT DWORD -
ULINT_TO_LWORD ULINT LWORD -
ULINT_TO_REAL ULINT REAL -
ULINT_TO_LREAL ULINT LREAL -
BOOL_TO_SINT BOOL SINT -
BOOL_TO_INT BOOL INT -
BOOL_TO_DINT BOOL DINT -
BOOL_TO_LINT BOOL LINT -
BOOL_TO_USINT BOOL USINT -
BOOL_TO_*** BOOL_TO_UINT BOOL UINT -
BOOL_TO_UDINT BOOL UDINT -
BOOL_TO_ULINT BOOL ULINT -
BOOL_TO_BYTE BOOL BYTE -
BOOL_TO_WORD BOOL WORD -
BOOL_TO_DWORD BOOL DWORD -
BOOL_TO_LWORD BOOL LWORD -
BYTE_TO_SINT BYTE SINT -
BYTE_TO_INT BYTE INT -
BYTE_TO_DINT BYTE DINT -
BYTE_TO_LINT BYTE LINT -
BYTE_TO_USINT BYTE USINT -
BYTE_TO_UINT BYTE UINT -
BYTE_TO_***
BYTE_TO_UDINT BYTE UDINT -
BYTE_TO_ULINT BYTE ULINT -
BYTE_TO_BOOL BYTE BOOL -
BYTE_TO_WORD BYTE WORD -
BYTE_TO_DWORD BYTE DWORD -
BYTE_TO_LWORD BYTE LWORD -
WORD_TO_SINT WORD SINT -
WORD_TO_INT WORD INT -
WORD_TO_DINT WORD DINT -
WORD_TO_LINT WORD LINT -
WORD_TO_USINT WORD USINT -
WORD_TO_*** WORD_TO_UINT WORD UINT -
WORD_TO_UDINT WORD UDINT -
WORD_TO_ULINT WORD ULINT -
WORD_TO_BOOL WORD BOOL -
WORD_TO_BYTE WORD BYTE -
WORD_TO_DWORD WORD DWORD -
5-4
Chapter5 Function and Function Block
Function Group Function Input data type Output data type Remarks
WORD_TO_LWORD WORD LWORD -
WORD_TO_DATE WORD DATE -
DWORD_TO_SINT DWORD SINT -
DWORD_TO_INT DWORD INT -
DWORD_TO_DINT DWORD DINT -
DWORD_TO_LINT DWORD LINT -
DWORD_TO_USINT DWORD USINT -
DWORD_TO_UINT DWORD UINT -
DWORD_TO_UDINT DWORD UDINT -
DWORD_TO_*** DWORD_TO_ULINT DWORD ULINT -
DWORD_TO_BOOL DWORD BOOL -
DWORD_TO_BYTE DWORD BYTE -
DWORD_TO_WORD DWORD WORD -
DWORD_TO_LWORD DWORD LWORD -
DWORD_TO_REAL DWORD REAL -
DWORD_TO_TIME DWORD TIME -
DWORD_TO_TOD DWORD TOD -
LWORD_TO_SINT LWORD SINT -
LWORD_TO_INT LWORD INT -
LWORD_TO_DINT LWORD DINT -
LWORD_TO_LINT LWORD LINT -
LWORD_TO_USINT LWORD USINT -
LWORD_TO_UINT LWORD UINT -
LWORD_TO_UDINT LWORD UDINT -
LWORD_TO_***
LWORD_TO_ULINT LWORD ULINT -
LWORD_TO_BOOL LWORD BOOL -
LWORD_TO_BYTE LWORD BYTE -
LWORD_TO_WORD LWORD WORD -
LWORD_TO_DWORD LWORD DWORD -
LWORD_TO_LREAL LWORD LREAL -
LWORD_TO_DT LWORD DT -
TIME_TO_UDINT TIME UDINT -
TIME_TO_***
TIME_TO_DWORD TIME DWORD -
DATE_TO_UINT DATE UINT -
DATE_TO_***
DATE_TO_WORD DATE WORD -
-
TOD_TO_UDINT TOD UDINT
TOD_TO_*** -
TOD_TO_DWORD TOD DWORD
-
DT_TO_LWORD DT LWORD
-
DT_TO_*** DT_TO_DATE DT DATE
-
DT_TO_TOD DT TOD
5-5
Chapter5 Function and Function Block
5-6
Chapter5 Function and Function Block
1. Bit-shift function
No. Function Description Remarks
-
1 SHL Shift input to the left of N bit(the right is filled with 0)
-
2 SHR Shift input to the right of N bit (the left is filled with 0)
-
3 ROL Rotate input to the left of N bit
-
4 ROR Rotate input to the right of N bit
5-7
Chapter5 Function and Function Block
5-8
Chapter5 Function and Function Block
5.2.3 Counter
5.2.4 Timer
5-9
Chapter5 Function and Function Block
-
7 TOF_RST TOF with reset
-
8 TON_UINT TON with integer setting
-
9 TOF_UINT TOF with integer setting
-
10 TP_UINT TP with integer setting
-
11 TMR_UINT TMR with integer setting
-
12 TMR_FLK Blink timer
-
13 TRTG_UINT Integer setting retriggerable timer
5-10
Chapter5 Function and Function Block
5-11
Chapter5 Function and Function Block
5-12
Chapter6 Basic Function
ABS
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
ANY type variable
IN ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OUT ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
■ Function
■ Flag
Flag Description
_ERR 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.
6-1
Chapter6 Basic Function
■ Program Example
1. LD
2. ST
6-2
Chapter6 Basic Function
1.1. ACOS
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
ANY type variable
IN ○ ○
OUT ○ ○
■ 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 Description
_ERR Unless an IN value is between -1.0 and 1.0, _ERR, _LER flags are set.
6-3
Chapter6 Basic Function
■ 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... ( 3 / 2), RESULT will be 0.5235... (π/6 rad = 30°).
6-4
Chapter6 Basic Function
1.2. ADD
Addition
ADD Availability XGF-M32E
Flags _ERR, _LER
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
■ 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 Description
_ERR 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-5
Chapter6 Basic Function
■ Program Example
1. LD
2. ST
6-6
Chapter6 Basic Function
1.3. ADD_TIME
Time addition
ADD_TIME Availability XGF-M32E
Flags _ERR, _LER
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
ANY type variable
IN1 ○ ○ ○
OUT ○ ○ ○
■ Function
■ 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-7
Chapter6 Basic Function
■ Program Example
1. LD
2. ST
+ (ADD_TIME)
6-8
Chapter6 Basic Function
1.4. AND
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
■ Function
It performs a logical AND operation on the input variables by bit and produces output ,OUT.
IN1 1111 ..... 0000
&
IN2 1010 ..... 1010
OUT 1010 ..... 0000
6-9
Chapter6 Basic Function
■ Program Example
1. LD
2. ST
ST doesn’t 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-10
Chapter6 Basic Function
1.5. ASIN
Function Description
Input EN: executes the function in case of 1
IN: input value of Arc Sine operation
ASIN
BOOL EN ENO BOOL Output ENO: outputs EN value as it is
ANY_REAL IN OUT ANY_REAL OUT: radian output value after Arc Sine operation
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
ANY type variable
IN ○ ○
OUT ○ ○
■ Function
It produces an output (Arc Sine value) of IN. The output value is between -π/2 and π/2.
OUT = ASIN (IN)
■ Error
Flag Description
_ERR If an input value exceeds the range from -1.0 to 1.0, _ERR and _LER flags are set.
6-11
Chapter6 Basic Function
■ Program Example
1. LD
2. ST
(2) If INPUT variable is 0.8660.... ( 3 /2), the RESULT will be 1.0471.... (π/3 radian = 60°).
6-12
Chapter6 Basic Function
1.6. ATAN
Function Description
ATAN
BOOL EN ENO BOOL Output ENO: outputs EN value as it is
ANY_REAL IN OUT ANY_REAL OUT: radian output value after Arc Tangent operation
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
ANY type variable
IN ○ ○
OUT ○ ○
■ 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-13
Chapter6 Basic Function
1.7. BOOL_TO_***
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
ANY type variable
OUT ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
■ 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 If the input value (BOOL) is 2#0, it produces the integer number ‘0’
BOOL_TO_LINT LINT and if it is 2#1, it produces the integer number ‘1’ according to the
BOOL_TO_USINT USINT output data type.
BOOL_TO_UINT UINT
BOOL_TO_UDINT UDINT
BOOL_TO_ULINT ULINT
BOOL_TO_BYTE BYTE
BOOL_TO_WORD WORD It converts BOOL into the output data type whose upper bits are
BOOL_TO_DWORD DWORD filled with 0.
BOOL_TO_LWORD LWORD
6-14
Chapter6 Basic Function
■ Program Example
1. LD
BOOL_TO_***
%MX0
EN ENO
2. ST
6-15
Chapter6 Basic Function
1.8. BTYE_TO_***
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
ANY type variable
OUT ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
■ Function
6-16
Chapter6 Basic Function
■ Program Example
1. LD
BYTE_TO_***
%MX10
EN ENO
2. ST
ST language doesn’t support BYTE_TO_***
In case of BYTE_TO_SINT
(BYTE_TO_***)
6-17
Chapter6 Basic Function
1.9. CONCAT_TIME
Function Description
■ Function
It concatenates IN1 (date) and IN2 (time of day) and produces output, OUT (DT).
■ Program Example
1. LD
%MX1 CONCAT_TIME
EN ENO
2. ST
START_DT := CONCAT_TIME(EN:=%MX1, IN1:= START_DATE, IN2:= START_TIME);
(CONCAT_TIME)
INPUT (IN2) : START_TIME (TOD) = TOD#08:30:00
6-18
Chapter6 Basic Function
1.10. COS
Cosine operation
COS Availability XGF-M32E
Flags
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
ANY type variable
IN ○ ○
OUT ○ ○
■ Function
■ Program Example
1. LD
6-19
Chapter6 Basic Function
2. ST
(2) If input INPUT = 0.5235 (π/6 rad = 30°), output RESULT = 0.8660 ... ( 3 / 2 ).
(COS)
6-20
Chapter6 Basic Function
1.11. DATE_T0_***
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
ANY type variable
IN ○ ○
■ Function
6-21
Chapter6 Basic Function
■ Program Example
1. LD
DATE_TO
%MX0 _***
EN ENO
2. ST
ST language doesn’t support DATE_TO_****
6-22
Chapter6 Basic Function
1.12. DINT_TO_***
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
ANY type variable
OUT ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
*ANY: exclude DINT, TIME and DATE from ANY type.
■ Function
6-23
Chapter6 Basic Function
■ Flag
Flag Description
■ Program Example
1. LD
DINT_TO
%MX1 _***
EN ENO
2. ST
ST language doesn’t support DINT_TO_***
In case of DINT_TO_SINT
6-24
Chapter6 Basic Function
1.13. DIV
Division
DIV Availability XGF-M32E
Flags _ERR, _LER
Function Description
ANY_NUM IN2
OUT: the divided result (quotient)
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
■ Function
It divides IN1by IN2 and produces an output omitting decimal fraction from the quotient.
OUT = IN1/IN2
■ Flag
Flag Description
If the value to divide (divisor) is ‘0’, and the results exceeds the maximum value of each type, _ERR,
_ERR _LER flags are set.
6-25
Chapter6 Basic Function
■ Program Example
1. LD
2. ST
/(DIV)
6-26
Chapter6 Basic Function
1.14. DIV_
1.15. DT_TO_***
DT type conversion
DT_TO_*** Availability XGF-M32E
Flags _ERR, _LER
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
ANY type variable
OUT ○ ○ ○
■ Function
6-27
Chapter6 Basic Function
■ Program Example
1. LD
%MX20 DT_TO_***
EN ENO
2. ST
ST language doesn’t support DT_TO_***
In case of DT_TO_DATE
(DT_TO_DATE)
6-28
Chapter6 Basic Function
1.16. DWORD_TO_***
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
ANY type variable
OUT ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
*ANY: exclude DWORD, LREAL and DATE from ANY type.
■ Function
6-29
Chapter6 Basic Function
■ Program Example
1. LD
DWORD_TO
%MX0 _***
EN ENO
2. ST
ST language doesn’t support DWORD_TO_***
In case of DWORD_TO_TOD
6-30
Chapter6 Basic Function
1.17. EQ
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
ANY type variable
IN1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
IN2 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
■ Function
■ Program Example
1. LD
6-31
Chapter6 Basic Function
2. ST
6-32
Chapter6 Basic Function
1.18. EXP
EXP operation
EXP Availability XGF-M32E
Flags _ERR, _LER
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
ANY type variable
IN ○ ○
OUT ○ ○
■ Function
It calculates the natural exponent with exponent IN and produces output, OUT.
IN
OUT = e
■ Error
Flag Description
_ERR If output is out of the range of a type, _ERR and _LER flags are set.
6-33
Chapter6 Basic Function
■ Program Example
1. LD
2. ST
6-34
Chapter6 Basic Function
1.19. EXPT
Exponential operation
EXPT Availability XGF-M32E
Flags _ERR, _LER
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
ANY type variable
IN1 ○ ○
IN2 ○ ○
OUT ○ ○
■ Function
■ Error
Flag Description
_ERR If an output is out of range of related data type, _ERR and _LER flags are set.
6-35
Chapter6 Basic Function
■ Program Example
1. LD
2. ST
(1) If the transition condition %GX0) is on, ‘EXPT’ exponential function executes.
(2) If input INPUT1= 1.5, INPUT2 = 3, output RESULT = 1.53 = 1.5 ×1.5 ×1.5 = 3.375.
3
3.375 = 1.5
6-36
Chapter6 Basic Function
1.20. FI
1.21. GE
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
ANY type variable
IN1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
IN2 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
■ Function
■ Program Example
1. LD
6-37
Chapter6 Basic Function
2. ST
6-38
Chapter6 Basic Function
1.22. GT
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
ANY type variable
IN1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
IN2 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
■ Function
1. If IN1 > IN2 > IN3... > INn (n: number of inputs), an output is 1.
2. 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-39
Chapter6 Basic Function
1.23. IN T_TO_***
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
ANY type variable
OUT ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
*ANY: exclude INT, TIME, DATE, TOD and DT from ANY type.
■ Function
6-40
Chapter6 Basic Function
■ Flag
Flag Description
■ Program Example
1. LD
%MX0 INT_TO_***
EN ENO
2. ST
6-41
Chapter6 Basic Function
1.24. LE
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
ANY type variable
IN1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
IN2 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
■ Function
■ Program Example
1. LD
6-42
Chapter6 Basic Function
2. ST
6-43
Chapter6 Basic Function
1.25. LIMIT
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
■ Function
1. If input IN value is between MN and MX, the IN is an output. That is, if MN ≤ IN ≤ MX, OUT = IN.
2. If input IN value is less than MN, MN is an output. That is, if IN < MN, OUT = MN.
3. 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_HIGH MX
6-44
Chapter6 Basic Function
2. ST
(LIMIT)
6-45
Chapter6 Basic Function
1.26. LINT_TO_***
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
ANY type variable
OUT ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
*ANY: exclude LINT, TIME, DATE, TOD, and DT from ANY type.
■ Function
6-46
Chapter6 Basic Function
■ Flag
Flag Description
If a conversion error occurs, _ERR and _LER flags are set. If an error occurs, lower bits equal to the
_ERR
bit number of the output type are taken to produces an output without changing the Internal bit array.
■ Program Example
1. LD
2. ST
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-47
Chapter6 Basic Function
1.27. LN
Function Description
Input EN: executes the function in case of 1
IN: input value of natural logarithm operation
LN
BOOL EN ENO BOOL Output ENO: outputs EN value as it is
ANY_REAL IN OUT ANY_REAL
OUT: natural logarithm value
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
ANY type variable
IN ○ ○
OUT ○ ○
■ Function
■ Error
Flag Description
_ERR If an input is 0 or a negative number, _ERR and _LER flags are set.
6-48
Chapter6 Basic Function
■ Program Example
1. LD
2. ST
6-49
Chapter6 Basic Function
LOG
Function Description
LOG
BOOL EN ENO BOOL Output END: outputs EN value as it is
ANY_REAL IN OUT ANY_REAL
OUT: the value of common logarithm operation
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
ANY type variable
IN ○ ○
OUT ○ ○
■ Function
■ Error
Flag Description
_ERR If input value IN is 0 or a negative number, _ ERR and _LER flags are set.
6-50
Chapter6 Basic Function
■ Program Example
1. LD
2. ST
6-51
Chapter6 Basic Function
1.28. LREAL_TO_***
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
ANY type variable
OUT ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
■ Function
6-52
Chapter6 Basic Function
■ Flag
Flag Description
If an overflow occurs because an input value is greater than the value available for the output type,
_ERR
_ERR and _LER flags are set. If an error occurs, an output is 0.
■ Program Example
1. LD
LREAL_TO
%MX0 _***
EN ENO
2. ST
(LREAL_TO_REAL)
6-53
Chapter6 Basic Function
1.29. LT
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
ANY type variable
IN1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
IN2 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
■ 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-54
Chapter6 Basic Function
2. ST
6-55
Chapter6 Basic Function
1.30. LWORD_TO_***
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
ANY type variable
OUT ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
*ANY: exclude LWORD, REAL, TIME, DATE and TOD from ANY type.
■ Function
LWORD_TO_DT DT Converts into DT type without changing the internal bit array. However,
6-56
Chapter6 Basic Function
■ Program Example
1. LD
LWORD_TO
%MX0 _***
EN ENO
2. ST
ST language doesn’t support LWORD_TO_***
In case of LWORD_TO_LINT
6-57
Chapter6 Basic Function
1.31. MAX
Maximum value
MAX Availability XGF-M32E
Flags
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
6-58
Chapter6 Basic Function
■ Function
It produces the maximum value among input IN1, IN2,..., INn (n: number of inputs).
■ Program Example
1. LD
%MX0 MAX
EN ENO
2. ST
6-59
Chapter6 Basic Function
1.32.
1.33. MIN
Minimum value
MIN Availability XGF-M32E
Flags
Function Description
IN1, IN2, ..., OUT must be of all the same data type.
DWORD
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
6-60
Chapter6 Basic Function
■ Function
Produces the minimum value among input IN1, IN2, ... , INn (n: number of inputs).
■ Program Example
1. LD
%MX100 MIN
EN ENO
2. ST
6-61
Chapter6 Basic Function
1.34. MOD
Function Description
IN1, IN2, ..., OUT must be of all the same data type.
DWORD
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
■ Function
6-62
Chapter6 Basic Function
■ Program Example
1. LD
%MX100 MOD
EN ENO
VALUE2 IN2
2. ST
6-63
Chapter6 Basic Function
1.35. MOVE
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
ANY type variable
IN ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OUT ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
■ Function
■ 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-64
Chapter6 Basic Function
2. ST
6-65
Chapter6 Basic Function
1.36. MUL
Multiplication
MUL Availability XGF-M32E
Flags _ERR, _LER
Function Description
Variables connected to IN1, IN2, ..., OUT are all of the same
data type.
DWORD
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
■ Function
Multiplies an IN1, IN2,..., INn (n: number of inputs) and outputs the result as OUT.
OUT = IN1 × IN2 × ... × INn
■ Flag
Flag Description
_ERR 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-66
Chapter6 Basic Function
■ Program Example
1. LD
%MX0 MUL
EN ENO
VALUE3 IN3
2. ST
6-67
Chapter6 Basic Function
1.37.
1.38. MUX
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
■ Function
1. Selects one among several inputs (IN0, IN1, …, INn) with K value and produces it.
2. If K = 0, IN0 is an output; if K = 1, IN1 is an output; if K = n, INn is an output.
■ Flag
Flag 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
_ERR, _LER flags are set. If K is negative, _ERR and _LER flags are set
6-68
Chapter6 Basic Function
■ Program Example
1. LD
%MX0 MUX
EN ENO
S K OUT OUT_VAL
VALUE0 IN0
VALUE1 IN1
VALUE2 IN2
2. ST
OUT_VAL := MUX(EN:= %MX0, K:= S, IN0:= VALUE0, IN1:= VALUE1, IN2:= VALUE2);
6-69
Chapter6 Basic Function
1.39. NE
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
ANY type variable
IN1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
IN2 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
6-70
Chapter6 Basic Function
■ Function
■ Program Example
1. LD
2. ST
6-71
Chapter6 Basic Function
1.40. NE
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
ANY type variable
IN ○ ○ ○ ○ ○
OUT ○ ○ ○ ○ ○
6-72
Chapter6 Basic Function
■ Function
■ Program Example
1. LD
2. ST
6-73
Chapter6 Basic Function
Logic Sum
OR Availability XGF-M32E
Flags
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
ANY type variable
IN ○ ○ ○ ○ ○
OUT ○ ○ ○ ○ ○
■ Function
It performs a logical OR on the input variables by bit and produces output, OUT.
IN1 1111 ..... 0000
OR
IN2 1010 ..... 1010
OUT 1111 ..... 1010
6-74
Chapter6 Basic Function
■ Program Example
1. LD
2. ST
%QB0.0 := OR2_BYTE(EN:=%MX0, IN1:=%MB10, IN2:=ABC);
6-75
Chapter6 Basic Function
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
ANY type variable
OUT ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
■ Function
6-76
Chapter6 Basic Function
■ Flag
Flag Description
If overflow occurs (input value is greater than the value to be stored in output type), _ERR, _LER flags
_ERR
are set. If an error occurs, the output is 0.
■ Program Example
1. LD
REAL_TO
%MX0 _***
EN ENO
2. ST
6-77
Chapter6 Basic Function
Rotate to Left
ROL Availability XGF-M32E
Flags
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
ANY type variable
IN ○ ○ ○ ○
OUT ○ ○ ○ ○
*ANY_BIT: exclude BOOL from ANY_BIT.
■ Function
1 0 1 0 0 0 1 1
1 0 0 0 1 1 1 0 N (when N=2)
6-78
Chapter6 Basic Function
■ 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-79
Chapter6 Basic Function
1.41. ROR
Rotate to right
ROR Availability XGF-M32E
Flags
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
ANY type variable
IN ○ ○ ○ ○
OUT ○ ○ ○ ○
*ANY_BIT: exclude BOOL from ANY type.
■ 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-80
Chapter6 Basic Function
■ 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-81
Chapter6 Basic Function
1.42. SEL
1.43. SHL
Shift Left
SHL Availability XGF-M32E
Flags
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
ANY type variable
IN ○ ○ ○ ○
OUT ○ ○ ○ ○
*ANY_BIT: exclude BOOL from ANY_BIT.
■ Function
1 0 1 0 0 0 1 1
1 0 0 0 1 1 0 0
N will be filled with 0
6-82
Chapter6 Basic Function
■ 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-83
Chapter6 Basic Function
1.44. SHR
Shift Right
SHR Availability XGF-M32E
Flags
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
ANY type variable
IN ○ ○ ○ ○
OUT ○ ○ ○ ○
*ANY_BIT: exclude BOOL from ANY_BIT.
■ Function
1 0 1 0 0 0 1 1
0 0 1 0 1 0 0 0
N will be filled with 0
6-84
Chapter6 Basic Function
■ Program Example
1. LD
%MX0 SHR
EN ENO
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-85
Chapter6 Basic Function
1.45. SIN
Sine operation
SIN Availability XGF-M32E
Flags
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
ANY type variable
IN ○ ○
OUT ○ ○
■ Function
■ Program Example
1. LD
6-86
Chapter6 Basic Function
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
6-87
Chapter6 Basic Function
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
ANY type variable
OUT ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
*ANY: exclude SINT, TIME, DATE, TOD and DT from ANY type.
■ Function
6-88
Chapter6 Basic Function
■ Flag
Flag Description
If a conversion error occurs, _ERR and _LER flags are set. If an error occurs, take the lower bits
_ERR
as many as bit number of output type and output it without changing the internal bit array.
■ Program Example
1. LD
%MX0 SINT_TO_***
EN ENO
2. ST
6-89
Chapter6 Basic Function
1.46. SQRT
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
ANY type variable
IN ○ ○
OUT ○ ○
■ Function
OUT = IN
■ Flag
Flag Description
_ERR If the value of IN is a negative number, _ERR and _LER flag are set.
■ Program Example
1. LD
%MX0 SQRT
EN ENO
6-90
Chapter6 Basic Function
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
(SQRT)
6-91
Chapter6 Basic Function
1.47. STRING_
1.48. SUB
Subtraction
SUB Availability XGF-M32E
Flags _ERR, _LER
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
■ Function
■ Flag
Flag Description
_ERR 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-92
Chapter6 Basic Function
■ Program Example
1. LD
%MX0 SUB
EN ENO
2. ST
6-93
Chapter6 Basic Function
1.49. SUB_DATE
Date subtraction
SUB_DATE Availability XGF-M32E
Flags _ERR, _LER
Function Description
■ 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-94
Chapter6 Basic Function
2. ST
6-95
Chapter6 Basic Function
1.50. SUB_DT
Function Description
■ 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 Description
If output value is out of range of TIME data type, _ERR and _LER flags are set.
_ERR
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
EN ENO
6-96
Chapter6 Basic Function
2. ST
(1) If the transition condition (%MX0) is on, function SUB_DT (Time and Date subtraction) executes.
(2) If the current date and time of day CURRENT_DT is DT#1995-12-15-14:30:00 and the starting date and the time of
day to work START_DT is DT#1995-12-13-12:00:00, the continuous working time declared as output variable
WORK_TIME is T#2D2H30M.
6-97
Chapter6 Basic Function
1.51. SUB_TIME
Time subtraction
SUB_TIME Availability XGF-M32E
Flags _ERR, _LER
Function Description
SUB_TIME
IN1: standard time of day
BOOL EN ENO BOOL IN2: the time to subtract
TIME,TOD,DT IN1 OUT TIME,TOD,DT Output ENO: without an error, it is 1.
TIME IN2 OUT: the subtracted result time or time of day
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
ANY type variable
IN1 ○ ○ ○
OUT ○ ○ ○
■ 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-98
Chapter6 Basic Function
■ 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.
6-99
Chapter6 Basic Function
1.52. SUB_TOD
TOD Subtraction
SUB_TOD Availability XGF-M32E
Flags _ERR, _LER
Function Description
■ Function
It subtracts the IN2 (specific time of day) from IN1 (standard time of day) and outputs the time difference as OUT.
■ Flag
Flag Description
_ERR 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-100
Chapter6 Basic Function
2. ST
(1) If the transition condition (%IX0.0) is on, function SUB_TOD (time of day subtraction) executes.
(2) If END_TIME declared as input variable is TOD#14:20:30.500 and the starting time to work, START_TIME is
TOD#12:00:00, the required time to work, WORK_TIME declared as output variable is T#2H20M30S500MS.
6-101
Chapter6 Basic Function
1.53. TAN
Tangent Operation
TAN Availability XGF-M32E
Flags
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
ANY type variable
IN ○ ○
OUT ○ ○
■ Function
■ Program Example
1. LD
%MX0 TAN
EN ENO
6-102
Chapter6 Basic Function
2. ST
(1) If the transition condition (%MX0) is on, function TAN (Tangent operation) executes.
(2) If the value of input variable declared as INPUT is 0.7853... (π/4 rad = 45°), RESULT declared as output variable is
1.0000.
TAN(π/4) = 1
(TAN)
6-103
Chapter6 Basic Function
1.54. ***
Function Description
DWORD,UDINT
TIME IN OUT Output ENO: outputs EN value as it is
STRING
OUT: type-converted data
DWORD
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
ANY type variable
OUT ○ ○
■ Function
6-104
Chapter6 Basic Function
■ Program Example
1. LD
TIME_TO
%MX0 _***
EN ENO
2. ST
6-105
Chapter6 Basic Function
1.55. TOD_TO_***
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
ANY type variable
OUT ○ ○
■ Function
Output
Function Description
type
Converts TOD into UDINT type.
TOD_TO_UDINT UDINT
Converts only data type without changing a data (internal bit array state).
Converts TOD into DWORD type.
TOD_TO_DWORD DWORD
Converts only data type without changing a data (internal bit array state).
6-106
Chapter6 Basic Function
■ Program Example
1. LD
TOD_TO
%MX0 _***
EN ENO
2. ST
(TOD_TO_STRING)
6-107
Chapter6 Basic Function
RUNC
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
ANY type variable
OUT ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
*ANY: exclude UDINT, DATE and DT from ANY type.
■ Function
Output
Function Description
type
UDINT_TO_SINT SINT If input is 0~127, normal conversion. Otherwise an error occurs.
UDINT_TO_INT INT If input is 0~32,767, normal conversion. Otherwise an error occurs.
If input is 0~2,147,483,647, normal conversion. Otherwise an error
UDINT_TO_DINT DINT
occurs.
UDINT_TO_LINT LINT Converts UDINT into LINT type normally.
UDINT_TO_USINT USINT If input is 0~255, normal conversion. Otherwise an error occurs.
UDINT_TO_UINT UINT If input is 0~65,535, normal conversion. Otherwise an error occurs.
UDINT_TO_ULINT ULINT Converts UDINT into ULINT type normally.
UDINT_TO_BOOL BOOL Takes the lower 1 bit and converts into BOOL type.
UDINT_TO_BYTE BYTE Takes the lower 8 bits and converts into BYTE type.
UDINT_TO_WORD WORD Takes the lower 16 bits and converts into WORD type.
UDINT_TO_DWORD DWORD Converts into DWORD type without changing the internal bit array.
UDINT_TO_LWORD LWORD Converts into LWORD type filling the upper bits with 0.
6-108
Chapter6 Basic Function
Output
Function Description
type
Converts UDINT into REAL type.
UDINT_TO_REAL REAL
During the conversion, an error caused by the precision may occur.
■ Flag
Flag Description
If a conversion error occurs, _ERR and _LER flags are set. If an error occurs, take the lower bits
_ERR 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 _***
EN ENO
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.
6-109
Chapter6 Basic Function
1.56. UINT_TO_***
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
ANY type variable
OUT ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
*ANY: exclude UINT, TIME, TOD and DT from ANY type.
■ Function
6-110
Chapter6 Basic Function
■ Flag
Flag Description
If a conversion error occurs, _ERR and _LER flags are set. If error occurs, it takes as many
_ERR 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 _***
EN ENO
2. ST
6-111
Chapter6 Basic Function
1.57. ULINT_TO_***
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
ANY type variable
OUT ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
*ANY: exclude UINT, TIME, TOD and DT from ANY type.
■ Function
ULINT_TO_BOOL BOOL Takes the lower 1 bit and converts into BOOL type.
ULINT_TO_BYTE BYTE Takes the lower 8 bits and converts into BYTE type.
ULINT_TO_WORD WORD Takes the lower 16 bits and converts into WORD type.
ULINT_TO_DWORD DWORD Takes the lower 32 bits and converts into DWORD type.
ULINT_TO_LWORD LWORD Converts into LWORD type without changing the internal bit array.
6-112
Chapter6 Basic Function
■ 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 _***
EN ENO
2. ST
(ULINT_TO_LINT)
6-113
Chapter6 Basic Function
1.58. USINT_TO_***
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
ANY type variable
OUT ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
*ANY: exclude USINT, TIME, DATE, TOD and DT from ANY type.
■ Function
6-114
Chapter6 Basic Function
■ 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 _***
EN ENO
2. ST
6-115
Chapter6 Basic Function
1.59. WDT_RST
1.60. WORD_TO_***
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
ANY type variable
OUT ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
*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 Takes the lower 8 bits and converts into SINT type.
WORD _TO_INT INT Converts into INT type without changing the internal bit array.
WORD _TO_DINT DINT Converts into DINT type filling the upper bits with 0.
WORD _TO_LINT LINT Converts into LINT type filling the upper bits with 0.
WORD _TO_USINT USINT Takes the lower 8 bits and converts into SINT type.
WORD _TO_UINT UINT Converts into INT type without changing the internal bit array.
WORD _TO_UDINT UDINT Converts into DINT type filling the upper bits with 0.
WORD _TO_ULINT ULINT Converts into LINT type filling the upper bits with 0.
WORD _TO_BOOL BOOL Takes the lower 1 bit and converts into BOOL type.
WORD _TO_BYTE BYTE Takes the lower 8 bits and converts into SINT type.
WORD _TO_DWORD DWORD Converts into DWORD type filling the upper bits with 0.
WORD _TO_LWORD LWORD Converts into LWORD type filling the upper bits with 0.
WORD _TO_DATE DATE Converts into DATE type without changing the internal bit array.
6-116
Chapter6 Basic Function
■ Program Example
1. LD
%MX0 WORD_TO_***
EN ENO
2. ST
6-117
Chapter6 Basic Function
1.61. XOR
Exclusive OR
XOR Availability XGF-M32E
Flags
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
ANY type variable
IN ○ ○ ○ ○ ○
OUT ○ ○ ○ ○ ○
■ Function
1. Do XOR operation for IN1 and IN2 per bit and to produces OUT.
IN1 1111 ..... 0000
XOR
IN2 1010 ..... 1010
OUT 0101 ..... 1010
6-118
Chapter6 Basic Function
■ Program Example
1. LD
2. ST
XOR
6-119
Chapter6 Basic Function
6-120
Chapter7 Application Function
1.1. _BYT
Function Description
BIT_BYTE
Input EN: executes the function in case of 1.
BOOL EN ENO BOOL
IN1 ~ IN8: Bit input
BOOL IN1 OUT BYTE
BOOL IN2 Output ENO: without an error, it is 1
BOOL IN3 OUT: Byte output
BOOL IN4
BOOL IN5
BOOL IN6
BOOL IN7
BOOL IN8
■ Function
7-1
Chapter7 Application Function
■ Program Example
1. LD
%MX3 BIT_BYTE
EN ENO
INPUT2 IN2
INPUT3 IN3
INPUT4 IN4
INPUT5 IN5
INPUT6 IN6
INPUT7 IN7
INPUT8 IN8
2. ST
7-2
Chapter7 Application Function
BMOV
1.2. BSUM
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
BYTE
REAL
TIME
DINT
UINT
SINT
LINT
TOD
INT
Variable
DT
ANY type variable
IN ○ ○ ○ ○
*ANY_BIT: exclude BOOL from ANY_BIT type.
■ 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.
7-3
Chapter7 Application Function
■ Program Example
1. LD
2. ST
7-4
Chapter7 Application Function
1.3. BIT
Divides byte into 8 bits
BYTE_BIT Availability XGF-M32E
Flags
Function Description
■ Function
7-5
Chapter7 Application Function
■ Program Example
1. LD
%MX0 BYTE_BIT
EN ENO
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);
7-6
Chapter7 Application Function
1.4. BYTE_TO_
1.5. BYTE_WORD
Function Description
■ Function
■ Program Example
1. LD
%MX3 BYTE_WORD
EN ENO
2. ST
7-7
Chapter7 Application Function
1.6.
1.7. DEC
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
BYTE
REAL
TIME
DINT
UINT
SINT
LINT
TOD
INT
Variable
DT
ANY type variable
IN ○ ○ ○ ○
OUT ○ ○ ○ ○
*ANY_BIT: exclude BOOL from ANY_BIT type.
■ Function
7-8
Chapter7 Application Function
■ Program Example
1. LD
2. ST
7-9
Chapter7 Application Function
1.8. DECO
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
BYTE
REAL
TIME
DINT
UINT
SINT
LINT
TOD
INT
Variable
DT
ANY type variable
IN ○ ○ ○ ○
OUT ○ ○ ○ ○
*ANY_BIT: exclude BOOL from ANY_BIT type.
■ 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.
■ Flag
Flag Description
If input data is a negative number or bit position data is out of output-type range, (in case of
_ERR
DECO_WORD, it’s more than 16), then OUT is 0 and _ERR/_LER flags are set.
7-10
Chapter7 Application Function
■ Program Example
1. LD
2. ST
7-11
Chapter7 Application Function
1.9. DEG
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
BYTE
REAL
TIME
DINT
UINT
SINT
LINT
TOD
INT
Variable
DT
ANY type variable
IN ○ ○
OUT ○ ○
■ Function
■ Program Example
1. LD
2. ST
7-12
Chapter7 Application Function
1.10. DI
1.11. DWORD_LWORD
Function Description
■ Function
■ Program Example
1. LD
%MX11 DWORD_LWORD
EN ENO
2. ST
7-13
Chapter7 Application Function
1.12. DWORD_LWORD
Function Description
■ Function
■ Program Example
1. LD
%MX5 DWORD_WORD
EN ENO
2. ST
7-14
Chapter7 Application Function
ENCO
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
BYTE
REAL
TIME
DINT
UINT
SINT
LINT
TOD
INT
Variable
DT
ANY type variable
IN ○ ○ ○ ○
OUT ○
*ANY_BIT: exclude BOOL from ANY_BIT type.
■ Function
■ Flag
Flag Description
_ERR OUT is -1 if no bit among input data is 1; _ERR and _LER flags are set.
7-15
Chapter7 Application Function
■ Program Example
1. LD
2. ST
7-16
Chapter7 Application Function
1.13. NIC
Increase IN data by 1
INC Availability XGF-M32E
Flags
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
BYTE
REAL
TIME
DINT
UINT
SINT
LINT
TOD
INT
Variable
DT
ANY type variable
IN ○ ○ ○ ○
OUT ○ ○ ○ ○
*ANY_BIT: exclude BOOL from ANY_BIT type.
■ Function
7-17
Chapter7 Application Function
■ Program Example
1. LD
2. ST
7-18
Chapter7 Application Function
1.14. LWORD_DWORD
Function Description
■ Function
■ Program Example
1. LD
%MX10 LWORD_DWORD
EN ENO
2. ST
7-19
Chapter7 Application Function
1.15. RAD
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
BYTE
REAL
TIME
DINT
UINT
SINT
LINT
TOD
INT
Variable
DT
ANY type variable
IN ○ ○
OUT ○ ○
■ Function
■ Program Example
1. LD
2. ST
7-20
Chapter7 Application Function
1.16. ROTATE_
1.17. SWAP
Flags
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
BYTE
REAL
TIME
DINT
UINT
SINT
LINT
TOD
INT
Variable
DT
ANY type variable
IN ○ ○ ○ ○
OUT ○ ○ ○ ○
*ANY_BIT: exclude BOOL from ANY_BIT type.
■ Function
■ Program Example
1. LD
2. ST
7-21
Chapter7 Application Function
UNI
Unites data
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
BYTE
REAL
TIME
DINT
UINT
SINT
LINT
TOD
INT
Variable
DT
ANY type variable
IN ○ ○ ○ ○
OUT ○ ○ ○ ○
*ANY_BIT: exclude BOOL from ANY_BIT type.
■ Function
1. It unites an input data array from the lower bit to a configured bit set by SEG and produces an output.
7-22
Chapter7 Application Function
After
Combination
If the sum of value set by SEG exceeds the bit number of input data type, _ERR and _LER flags are set.
■ Flag
Flag Description
If the sum of value set by SEG exceeds the bit number of input data type, _ERR and _LER flags are set. If
_ERR
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
SEG_ARY SEG
2. ST
7-23
Chapter7 Application Function
7-24
Chapter7 Application Function
1.18. WORD_BYTE
Flags
Function Description
■ Function
■ Program Example
1. LD
%MX3 WORD_BYTE
EN ENO
2. ST
7-25
Chapter7 Application Function
1.19. WORD_DWORD
Flags
Function Description
■ Function
■ Program Example
1. LD
2. ST
7-26
Chapter7 Application Function
1.20. XCHG
Flags
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
BYTE
REAL
TIME
DINT
UINT
SINT
LINT
TOD
INT
Variable
DT
ANY type variable
SRC1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
SRC2 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
■ Function
7-27
Chapter7 Application Function
■ Program Example
1. LD
2. ST
7-28
Chapter7 Application Function
1.21. XNR
Flags
Function Description
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
BYTE
REAL
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
■ Function
1. It performs XNR operation on the input variables by bit and produces output, OUT.
IN1 1111 ..... 0000
XNR
IN2 1010 ..... 1010
OUT 1010 ..... 0101
7-29
Chapter7 Application Function
■ Program Example
1. LD
2. ST
7-30
Chapter8 Basic Function Block
Flags
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
Any type variable
PV ○ ○ ○ ○ ○ ○
CV ○ ○ ○ ○ ○ ○
*ANY_INT: exclude SINT and USINT from ANY_INT type.
■ Function
1. Down counter function block CTD decreases the current value (CV) by 1 with every rising pulse input.
2. CV decreases only when CV is more than the minimum value of INT (-32768); after reaching it, CV does not
change its value.
3. When LD is 1, PV is loaded into CV (CV=PV).
4. Output Q is 1 when CV is 0 or a negative number.
Function Block PV Description
CTD_INT INT Decrease as much as the min INT(-32,768).
CTD_DINT DINT Decrease as much as the min DINT(-2,147,483,648).
CTD_LINT LINT Decrease as much as the min LINT(-9,223,372,036,854,775,808).
CTD_UINT UINT Decrease as much as the min UINT(0).
CTD_UDINT UDINT Decrease as much as the min UDINT(0).
CTD_ULINT ULINT Decrease as much as the min ULINT(0).
8-1
Chapter8 Basic Function Block
■ Time Chart
■ 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.
8-2
Chapter8 Basic Function Block
(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-3
Chapter8 Basic Function Block
1.1. CTU
Flags
STRING
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
Any type variable
PV ○ ○ ○ ○ ○ ○
CV ○ ○ ○ ○ ○ ○
*ANY_INT: exclude SINT and USINT from ANY_INT type.
■ Function
1. Up counter function block CTU increases the current value (CV) by 1 with every rising pulse input.
2. CV increases only when CV is less than the maximum value of INT (32767); after reaching it, CV does not change
its value.
3. When the reset input (R) is 1, CV is cleared (0).
4. Output Q is 1 when CV is equal to or more than PV.
5. PV value reloads the preset value and operate it when CTU function block executes.
8-4
Chapter8 Basic Function Block
■ Time Chart
R (reset input)
■ 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
%QX0.0 := COUNT_Q;
8-5
Chapter8 Basic Function Block
8-6
Chapter8 Basic Function Block
Flags
STRING
LWORD
WORD
LREAL
UDINT
USINT
ULINT
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
TOD
INT
DT
Variable
Any type variable
PV ○ ○ ○ ○ ○ ○
CV ○ ○ ○ ○ ○ ○
*ANY_INT: excluding SINT and USINT from ANY_INT types
■ 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-7
Chapter8 Basic Function Block
■ Time Chart
R (reset input)
CU (CTU input)
PV (PV setting)
CV (current value)
0
Q (CTU output)
■ Program Example
1. LD
2. ST
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-8
Chapter8 Basic Function Block
%MX1
%MX0
%IX0.1.0
%IX1.1.0
STACK_MAX(100)
STORED_
0
NUMBER
STACK
_FULL
STACK_
EMPTY
8-9
Chapter8 Basic Function Block
1.2. FF
FF Availability XGF-M32E
Flags
■ Function
FF reverses output Q as the input status connected to CLK is changed from 0 to 1.
■ Time Chart
CLK
■ 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-10
Chapter8 Basic Function Block
1.3. F_TRIG
Flags
F_TRIG
Input CLK: input signal
BOOL CLK Q BOOL
Output Q: falling edge detection result
■ 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) 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.
8-11
Chapter8 Basic Function Block
1.4. RS
RS Availability XGF-M32E
Flags
■ Function
R_1R1 Q1
&
SS ≥1
Q1
Q1
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
R1
R_1
SS
Q1
Q1
8-12
Chapter8 Basic Function Block
■ Program Example
1. LD
SET1
SET1 RS
RS
SS Q1
Q1 RESULT
RESULT
RESET1
RESET1 R1
R_1
2. ST
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-13
Chapter8 Basic Function Block
1.5. RTC_SET
1.6. R_TRIG
Flags
■ 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-14
Chapter8 Basic Function Block
1.7. SR
SR Availability XGF-M32E
Flags
■ Function
S1
S_1 Q1
Q1
≥1
R &
Q1
Q1
■ Time Chart
S_1
S1
RR
Q1
Q1
8-15
Chapter8 Basic Function Block
■ Program Example
1. LD
SET1
SET1 SR
SR
S1
S_1 Q1
Q1 RESULT
RESULT
RESET1
RESET1 RR
2. ST
8-16
Chapter8 Basic Function Block
1.8. TOF
Flags
■ Function
1. If IN is 1, Q is 1. And after IN becomes 0 and the preset time (PT) of TOF passes, Q becomes 0.
2. After IN becomes 0, the elapsed time (ET) is shown.
3. If IN becomes 1 before ET reaches the preset time, ET is 0 again.
■ Time Chart
IN
Q PT
Setting (PT)
Time
ET
8-17
Chapter8 Basic Function Block
■ Program Example
1. LD
TOF
T_OFF
IN Q TIMER_OK
T#10S PT ET ET_TIME
2. ST
T_OFF
TIMER_OK
10S 10S
Setting Time
(10S)
ET_TIME
(1) 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.
(2) If T_OFF becomes 1 again in 10 seconds after it turned off, TOF is initialized (TIMER_OK is 1).
(3) After T_OFF becomes 0, the elapsed time (ET_TIME) is measured and shown.
8-18
Chapter8 Basic Function Block
1.9. TON
Flags
■ Function
■ Time Chart
IN
PT PT
Q
Setting
Time (PT)
ET
8-19
Chapter8 Basic Function Block
■ Program Example
1. LD
TON
T_ON
IN Q TIMER_OK
T#10S PT ET ET_TIME
2. ST
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-20
Chapter8 Basic Function Block
1.10. TP
TP Availability XGF-M32E
Flags
■ Function
■ Time Chart
IN
Q PT PT
PT
Setting
(PT)
Time
ET
8-21
Chapter8 Basic Function Block
■ Program Example
1. LD
TP
T_TP
IN Q TIMER_OK
T#10S PT ET ET_TIME
2. ST
T_TP
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-22
Chapter9 Application Function Block
Ring Counter
Flags
■ Function
1. 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.
2. When CV reaches PV, output Q is 1.
3. If CV is less than PV or reset input (RST) is 1, output Q is 0.
■ Time Chart
9-1
Chapter9 Application Function Block
■ 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-2
Chapter9 Application Function Block
1.1. DUTYTMR
Integration Timer
Flags
TMR
Function Block Description
■ Function
■ Time Chart
9-3
Chapter9 Application Function Block
■ Program Example
1. LD
2. ST
INST_TMR(IN:=T_TMR, PT:=T#10S, RST:=%IX1.1.12, Q=>TIMER_OK, ET=>ET_TIME);
(1) If 10 seconds passes after input variable T_TMR is 1, output variable TIMER_OK 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-4
Chapter9 Application Function Block
1.2. TMR_FLK
Flags
FLK
Function Block Description
■ 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
OFF TIME
9-5
Chapter9 Application Function Block
■ Program Example
1. LD
2. ST
9-6
Chapter9 Application Function Block
1.3. TMR_UINT
Flags
■ Function
■ Time Chart
9-7
Chapter9 Application Function Block
■ 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
10 * 1000
TIMER_OK
9-8
Chapter9 Application Function Block
1.4. TOF_RST
Flags
■ Function
■ Time Chart
9-9
Chapter9 Application Function Block
■ 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);
(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-10
Chapter9 Application Function Block
1.5. TOF_UINT
Flags
■ Function
■ Time Chart
9-11
Chapter9 Application Function Block
■ 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);
☆ 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-12
Chapter9 Application Function Block
1.6. TON_UINT
Flags
■ Function
■ Time Chart
9-13
Chapter9 Application Function Block
■ Program Example
1. LD
T_TON TON_UINT
IN Q TIMER_OK
10 PT ET ET_TIME
1000 UINT
2. ST
INST_TON_UINT(IN:=T_TON, PT:=10, UNIT:=1000, Q=>TIMER_OK, ET=>ET_TIME);
TP_RST
9-14
Chapter9 Application Function Block
1.7. TP_RST
Flags
■ Function
■ Time Chart
9-15
Chapter9 Application Function Block
■ 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-16
Chapter9 Application Function Block
1.8. TP_UINT
Flags
■ Function
■ Time Chart
IN
RST
Setting Time
(PT*UNIT)
ET PT*UNIT
9-17
Chapter9 Application Function Block
■ 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-18
Chapter9 Application Function Block
1.9. TRTG
Retriggerable Timer
Flags
■ 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
9-19
Chapter9 Application Function Block
■ 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-20
Chapter9 Application Function Block
1.10. TRTG_UINT
Flags
■ 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.
4. Preset time is PT x UNIT[ms].
■ Time Chart
9-21
Chapter9 Application Function Block
■ 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-22
Chapter10 Motion Function Block
MC_Stop
Done Stopping
ErrorStop *1
*6
*4 *3
MC_Home
*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
Chapter10 Motion Function Block
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
Disabled
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)
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
ErrorStop 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.
When the power of axis is activated, there is no error in the axis and any command is not
StandStill
made, the axis state indicates StandStill state.
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
Stopping
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.
It indicates state where operation continues until the current axis becomes operation stop
Continuous Motion
status.
10-2
Chapter10 Motion Function Block
*1
MC_GroupHalt
GroupMoving MC
_G *2
rou
MC_GroupStop pS
top
Error GroupStopping
GroupHoming Error
Done Error
MC Done
_G *1 op
ro
up pSt *3 GroupErrorStop
Ho r ou
me G
C_
M Error
et
MC_GroupEnable R es *2
ro up
GroupDisabled GroupStandby _G
MC_GroupDisable MC
MC_UngroupAllAxes
MC_RemoveAxisFromFroup
MC_AddAxisToGroup *4 MC_AddAxisToGroup
MC_RemoveAxisFromGroup MC_RemoveAxisFromGroup
MC_UngroupAllAxes *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
Chapter10 Motion Function Block
Execute
Busy
Active
Done
Error
CommandAborted
(a) (b) (c) (a) (d) (e) (a) (f) (g) (a) (h)
Variable Description
This is an input to run the relevant function block in Edge operation function block.
Execute
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).
This outputs error code regarding the relevant error when an error occurs while running
ErrorID
motion function block. ErrorID output and elimination time are same with Error output.
10-4
Chapter10 Motion Function Block
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.
Enable
Busy
Vaild
Error
Variable 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
completed), and it indicates the output of motion function block can be changed. Busy output is On
Busy
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 & motion are valid.
Valid output is Off when Enable input is Off (Figure b state).
This is an output to indicate an error occurs while running motion function block.
If an error which cannot be automatically restored occurs while motion function block is in operation,
Error output is On, Busy & Valid output is Off (Figure d state), and motion function block stops
operating.
Error Error output is Off when Enable input is Off (Figure e state).
If an error which can be automatically restored occurs while function block is in operation, Error
output is On and Valid input is Off (Figure f state).
When the error in the relevant motion function block is restored, Error output is Off, and operation is
resumed (Figure g state).
※ Valid and Error outputs are not On at the same time.
10-5
Chapter10 Motion Function Block
■ 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 0x0006”occurs.
10-6
Chapter10 Motion Function Block
■ 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
Chapter10 Motion Function Block
■ TransitionMode “TMCornerDistance”
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
Chapter10 Motion Function Block
10-9
Chapter10 Motion Function Block
MC_Power Availability
MC_Power
BOOL Enable Status BOOL
UINT Axis Axis UINT
Vaild BOOL
Error BOOL
ErrorID WORD
Input-Output
UINT Axis Specify the axis to be commanded (1~32: real axis, 37~40: virtual axis)
Input
BOOL Enable Servo motor of the relevant axis is servo On while input is activated.
Output
BOOL Status Indicate the power permission status of the relevant axis.
BOOL Valid Indicate the validity of motion function block output. (same with Status output here)
BOOL Error Indicate whether an error occurs or not.
WORD ErrorID Output the number of error occurred while motion function block is running.
(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
Chapter10 Motion Function Block
MC_Home Availability
MC_Home
BOOL Execute Done BOOL
UINT Axis Axis UINT
LREAL Position Busy BOOL
UINT BufferMode Active BOOL
CommandAborted BOOL
Error BOOL
ErrorID WORD
Input-Output
UINT Axis Specify the axis to be commanded (1~32: real axis, 37~40: virtual axis)
Input
BOOL Execute Start the homing operation in rising Edge.
LREAL Position Specify the absolute position of axis when reference signal is detected.
Specify the sequential operation setting of motion function block.
UINT BufferMode
(Refer to 10.1.4.BufferMode)
Output
BOOL Done Indicate the completion state of motion function block.
BOOL Busy Indicate that execution of motion function block is not completed.
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 Indicate whether an error occurs or not.
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
Chapter10 Motion Function Block
MC_STOP Availability
MC_Stop
BOOL Execute Done BOOL
UINT Axis Axis UINT
LREAL Deceleration Busy BOOL
LREAL Jerk CommandAborted BOOL
Error BOOL
ErrorID WORD
Input-Output
UINT Axis Specify the axis to be commanded (1~32: real axis, 37~40: virtual axis)
Input
BOOL Execute Give immediate stop command to the relevant axis in the rising Edge.
LREAL Deceleration Specify deceleration in time of stop. [u/s2]
LREAL Jerk Specify the change rate of acceleration/deceleration. [u/s3]
Output
BOOL Done Indicate that the speed of the relevant axis reaches 0.
BOOL Busy Indicate that the execution of motion function block is not completed.
BOOL CommandAborted Indicate that the current motion function block is interrupted while it is running.
BOOL Error Indicate whether an error occurs or not.
WORD ErrorID Output the number of error occurred while motion function block is running.
(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
Chapter10 Motion Function Block
MC_Halt Availability
Stop XGF-M32E
MC_Halt
BOOL Execute Done BOOL
UINT Axis Axis UINT
LREAL Deceleration Busy BOOL
LREAL Jerk Active BOOL
UINT BufferMode CommandAborted BOOL
Error BOOL
ErrorID WORD
Input-Output
UINT Axis Specify the axis to be commanded (1~32: real axis, 37~40: virtual axis)
Input
BOOL Execute Give stop command to the relevant axis in the rising Edge.
LREAL Deceleration Specify deceleration in time of stop. [u/s2]
LREAL Jerk Specify the change rate of acceleration/deceleration. [u/s3]
Specify the sequential operation setting of motion function block.
UINT BufferMode
(Refer to 10.1.4.BufferMode)
Output
BOOL Done Indicate that the speed of the relevant axis reaches 0.
BOOL Busy Indicate that the execution of motion function block is not completed.
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 Indicate whether an error occurs or not.
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
Chapter10 Motion Function Block
MC_MoveAbsolute Availability
MC_MoveAbsolute
BOOL Execute Done BOOL
UINT Axis Axis UINT
BOOL ContinuousUpdate Busy BOOL
LREAL Position Active BOOL
LREAL Velocity CommandAborted BOOL
LREAL Acceleration Error BOOL
LREAL Deceleration ErrorID WORD
LREAL Jerk
UINT Direction
UINT BufferMode
Input-Output
UINT Axis Specify the axis to be commanded (1~32: real axis, 37~40: virtual axis)
Input
Give an absolute position operation command to the relevant axis in the rising
BOOL Execute
Edge.
Specify the update setting of input value.
BOOL ContinuousUpdate (Refer to 10.1.5.Changes in Parameters during Execution of Motion Function
Block)
LREAL Position Specify the target position.
LREAL Velocity Specify the maximum speed. [u/s]
LREAL Acceleration Specify the acceleration. [u/s2]
LREAL Deceleration Specify the deceleration. [u/s2]
LREAL Jerk Specify the change rate of acceleration/deceleration. [u/s3]
Specify the operation direction.
UINT Direction (0~4: 0-Not specified, 1-Forward direction, 2-Shortest distance, 3-Reverse
direction, 4-Current direction)
Specify the sequential operation setting of motion function block.
UINT BufferMode
(Refer to 10.1.4.BufferMode)
10-14
Chapter10 Motion Function Block
Output
BOOL Done Indicate whether to reach the specified distance.
BOOL Busy Indicate that the execution of motion function block is not completed.
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 Indicate whether an error occurs or not.
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
Chapter10 Motion Function Block
MC_MoveRelative Availability
MC_MoveRelative
BOOL Execute Done BOOL
UINT Axis Axis UINT
BOOL ContinuousUpdate Busy BOOL
LREAL Distance Active BOOL
LREAL Velocity CommandAborted BOOL
LREAL Acceleration Error BOOL
LREAL Deceleration ErrorID WORD
LREAL Jerk
UINT BufferMode
Input-Output
UINT Axis Specify the axis to be commanded (1~32: real axis, 37~40: virtual axis)
Input
Give an absolute position operation command to the relevant axis in the rising
BOOL Execute
Edge.
Specify the update setting of input value.
BOOL ContinuousUpdate (Refer to 10.1.5.Changes in Parameters during Execution of Motion Function
Block)
LREAL Distance Specify the target distance.
LREAL Velocity Specify the maximum speed. [u/s]
LREAL Acceleration Specify the acceleration. [u/s2]
LREAL Deceleration Specify the deceleration. [u/s2]
LREAL Jerk Specify the change rate of acceleration/deceleration. [u/s3]
Specify the sequential operation setting of motion function block.
UINT BufferMode
(Refer to 10.1.4.BufferMode)
Output
BOOL Done Indicate whether to reach the specified distance.
BOOL Busy Indicate that the execution of motion function block is not completed.
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
Chapter10 Motion Function Block
10-17
Chapter10 Motion Function Block
MC_MoveAdditive Availability
MC_MoveAdditive
BOOL Execute Done BOOL
UINT Axis Axis UINT
BOOL ContinousUpdate Busy BOOL
LREAL Distance Active BOOL
LREAL Velocity CommandAborted BOOL
LREAL Acceleration Error BOOL
LREAL Deceleration ErrorID WORD
LREAL Jerk
UINT BufferMode
Input-Output
UINT Axis Specify the axis to be commanded (1~32: real axis, 37~40: virtual axis)
Input
Give an absolute position operation command to the relevant axis in the rising
BOOL Execute
Edge.
Specify the update setting of input value.
BOOL ContinuousUpdate (Refer to 10.1.5.Changes in Parameters during Execution of Motion Function
Block)
LREAL Distance Specify the target distance.
LREAL Velocity Specify the maximum speed. [u/s]
LREAL Acceleration Specify the acceleration. [u/s2]
LREAL Deceleration Specify the deceleration. [u/s2]
LREAL Jerk Specify the change rate of acceleration/deceleration. [u/s3]
Specify the sequential operation setting of motion function block.
UINT BufferMode
(Refer to 10.1.4.BufferMode)
Output
BOOL Done Indicate whether to reach the specified distance.
BOOL Busy Indicate that the execution of motion function block is not completed.
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
Chapter10 Motion Function Block
(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
Chapter10 Motion Function Block
MC_MoveVelocity Availability
MC_MoveVelocity
BOOL Execute InVelocity BOOL
UINT Axis Axis UINT
BOOL ContinuousUpdate Busy BOOL
LREAL Velocity Active BOOL
LREAL Acceleration CommandAborted BOOL
LREAL Deceleration Error BOOL
LREAL Jerk ErrorID WORD
UINT Direction
UINT BufferMode
Input-Output
UINT Axis Specify the axis to be commanded (1~32: real axis, 37~40: virtual axis)
Input
Give an absolute position operation command to the relevant axis in the rising
BOOL Execute
Edge.
Specify the update setting of input value.
BOOL ContinuousUpdate (Refer to 10.1.5.Changes in Parameters during Execution of Motion Function
Block)
LREAL Velocity Specify the maximum speed. [u/s]
LREAL Acceleration Specify the acceleration. [u/s2]
LREAL Deceleration Specify the deceleration. [u/s2]
LREAL Jerk Specify the change rate of acceleration/deceleration. [u/s3]
Specify the operation speed. (1 ~ 3 : 1-Forward direction, 2-Reverse direction,
UINT Direction
3-Current direction)
Specify the sequential operation setting of motion function block.
UINT BufferMode
(Refer to 10.1.4.BufferMode)
Output
BOOL InVelocity Indicate whether to reach the specified speed.
BOOL Busy Indicate that the execution of motion function block is not completed.
BOOL Active Indicate that the current motion function block is controlling the relevant axis.
10-20
Chapter10 Motion Function Block
BOOL CommandAborted Indicate that the current motion function block is interrupted while it is running.
BOOL Error Indicate whether an error occurs or not.
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
Chapter10 Motion Function Block
MC_MoveContinuousAbsolute Availability
MC_MoveContinousAbsolute
BOOL Execute InEndVelocity BOOL
UINT Axis Axis UINT
BOOL ContinousUpdate Busy BOOL
LREAL Position Active BOOL
LREAL EndVelocity CommandAborted BOOL
LREAL Velocity Error BOOL
LREAL Acceleration ErrorID WORD
LREAL Deceleration
LREAL Jerk
UINT Direction
UINT BufferMode
Input-Output
UINT Axis Specify the axis to be commanded (1~32: real axis, 37~40: virtual axis)
Input
Give an absolute position operation command to the relevant axis in the rising
BOOL Execute
Edge.
Specify the update setting of input value.
BOOL ContinuousUpdate (Refer to 10.1.5.Changes in Parameters during Execution of Motion Function
Block)
LREAL EndVelocity Specify the operation speed after reaching the target position. [u/s]
LREAL Velocity Specify the maximum speed to reach the target position. [u/s]
LREAL Acceleration Specify the acceleration. [u/s2]
LREAL Deceleration Specify the deceleration. [u/s2]
LREAL Jerk Specify the change rate of acceleration/deceleration. [u/s3]
Specify the operation direction.
UINT Direction (0~4: 0-Not specified, 1-Forward direction, 2-Shortest distance, 3-Reverse
direction, 4-Current direction)
Specify the sequential operation setting of motion function block.
UINT BufferMode
(Refer to 10.1.4.BufferMode)
10-22
Chapter10 Motion Function Block
Output
BOOL InEndVelocity Indicate the operation at the specified speed after reaching the target position.
BOOL Busy Indicate that the execution of motion function block is not completed.
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 Indicate whether an error occurs or not.
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, 3-
Reverse 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
Chapter10 Motion Function Block
MC_MoveContinuousRelative Availability
MC_MoveContinousRelative
BOOL Execute InEndVelocity BOOL
UINT Axis Axis UINT
BOOL ContinousUpdate Busy BOOL
LREAL Distance Active BOOL
LREAL EndVelocity CommandAborted BOOL
LREAL Velocity Error BOOL
LREAL Acceleration ErrorID WORD
LREAL Deceleration
LREAL Jerk
UINT BufferMode
Input-Output
UINT Axis Specify the axis to be commanded (1~32: real axis, 37~40: virtual axis)
Input
Give an absolute position motion command to the relevant axis in the rising
BOOL Execute
Edge.
Specify the update setting of input value.
BOOL ContinuousUpdate (Refer to 10.1.5.Changes in Parameters during Execution of Motion Function
Block)
LREAL Distance Specify the target distance.
LREAL EndVelocity Specify the operation speed after reaching the target position. [u/s]
LREAL Velocity Specify the maximum speed to reach the target position. [u/s]
LREAL Acceleration Specify the acceleration. [u/s2]
LREAL Deceleration Specify the deceleration. [u/s2]
LREAL Jerk Specify the change rate of acceleration/deceleration. [u/s3]
Specify the sequential operation setting of motion function block.
UINT BufferMode
(Refer to 10.1.4.BufferMode)
Output
BOOL InEndVelocity Indicate the operation at the specified speed after reaching the target position.
BOOL Busy Indicate that the execution of motion function block is not completed.
10-24
Chapter10 Motion Function Block
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 Indicate whether an error occurs or not.
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
Chapter10 Motion Function Block
MC_TorqueControl Availability
MC_TorqueControl
BOOL Execute InTorque BOOL
UINT Axis Axis UINT
BOOL ContinousUpdate Busy BOOL
LREAL Torque Active BOOL
LREAL TorqueRamp CommandAborted BOOL
LREAL Velocity Error BOOL
LREAL Acceleration ErrorID WORD
LREAL Deceleration
LREAL Jerk
UINT Direction
UINT BufferMode
Input-Output
UINT Axis Specify the axis to be commanded (1~32: real axis)
Input
Give an absolute position operation command to the relevant axis in the rising
BOOL Execute
Edge.
Specify the update setting of input value.
BOOL ContinuousUpdate (Refer to 10.1.5.Changes in Parameters during Execution of Motion Function
Block)
LREAL Torque Specify the target torque. [u]
LREAL TorqueRamp Specify the ascending slope of torque. [u/s]
LREAL Velocity Unused
LREAL Acceleration Unused
LREAL Deceleration Unused
LREAL Jerk Unused
Specify the operation direction.
UINT Direction
(1~2 : 1-Forward direction, 2-Reverse direction)
Specify the sequential operation setting of motion function block.
UINT BufferMode
(Refer to 10.1.4.BufferMode)
10-26
Chapter10 Motion Function Block
Output
Indicate that the input torque value and currently operating torque value are
BOOL InTorque
same.
BOOL Busy Indicate that the execution of motion function block is not completed.
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 Indicate whether an error occurs or not.
WORD ErrorID Output the number of error occurred while motion function block is running.
(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
Chapter10 Motion Function Block
MC_Setposition Availability
MC_SetPosition
BOOL Execute Done BOOL
UINT Axis Axis UINT
LREAL Position Busy BOOL
BOOL Relative Error BOOL
UINT ExcutionMode ErrorID WORD
Input-Output
UINT Axis Specify the axis to be commanded (1~32: real axis, 37~40: virtual axis)
Input
BOOL Execute Specify the current position of the relevant axis in the rising Edge.
LREAL VelFactor Specify the override rate of speed.
LREAL AccFactor Specify the override rate of acceleration/deceleration.
LREAL JerkFactor Specify the override rate of the change rate of acceleration.
Output
BOOL Enabled Indicate that override rate is successfully applied.
BOOL Busy Indicate that the execution of motion function block is not completed.
BOOL Error Indicate whether an error occurs or not.
WORD ErrorID Output the number of error occurred while motion function block is running.
(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
Chapter10 Motion Function Block
MC_Setoverride Availability
MC_SetOverride
BOOL Execute Enabled BOOL
UINT Axis Axis UINT
LREAL VelFactor Busy BOOL
LREAL AccFactor Error BOOL
LREAL JerkFactor ErrorID WORD
Input-Output
UINT Axis Specify the axis to be commanded (1~32: real axis, 37~40: virtual axis)
Input
BOOL Enable Execute override operation in the relevant axis while input is activated.
LREAL VelFactor Specify the override rate of speed.
LREAL AccFactor Specify the override rate of acceleration/deceleration.
LREAL JerkFactor Specify the override rate of the change rate of acceleration.
Output
BOOL Enabled Indicate that override rate is successfully applied.
BOOL Busy Indicate that the execution of motion function block is not completed.
BOOL Error Indicate whether an error occurs or not.
WORD ErrorID Output the number of error occurred while motion function block is running.
(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
Chapter10 Motion Function Block
MC_ReadParameter Availability
MC_ReadParameter
BOOL Enable Vaild BOOL
UINT Axis Axis UINT
INT ParameterNumber Busy BOOL
Error BOOL
ErrorID WORD
Value LREAL
Input-Output
UINT Axis Specify the axis to be commanded (1~32: real axis, 37~40: virtual axis)
Input
BOOL Enable Execute override operation in the relevant axis while input is activated.
INT ParameterNumber Specify the number of parameter to read. (0 ~ 25)
Output
BOOL Vaild Indicate whether the output of the current motion function block is valid.
BOOL Busy Indicate that the execution of motion function block is not completed.
BOOL Error Indicate whether an error occurs or not.
WORD ErrorID Output the number of error occurred while motion function block is running.
LREAL Value Output the value of parameter.
(1) This command is a motion function block which outputs parameter of the relevant axis.
(2) The value of the relevant parameter is continuously output in Value while Enable input is On.
(3) Specify the number of parameter to read in ParameterNumber input.
(4) The numbers of parameter are as below.
10-30
Chapter10 Motion Function Block
번호 파라미터 항목 비고
0 Unit 0:pulse,1:mm,2:inch,3:degree
1 Purses per rotation 1 ~ 4,294,967,295 [pulse]
2 Travel per rotation 0.000000001 ~ 4,294,967,295 [Unit]
3 Speed command unit 0:Unit/Time, 1:rpm
LREAL Positive number [Unit/s, rpm]
4 Basic Speed limit (Change according to Unit, Pulses per rotation,
Parameter Travel per rotation, Speed command unit)
5 Emergency stop deceleration 0 or LREAL Positive number [Unit/s2]
6 Encoder select 0:Incremental Encoder,1:Absolute Encoder
7 Gear ratio(Motor) 1 ~ 65,535
8 Gear ratio(Machine) 1 ~ 65,535
9 Operating mode of the reverse rotation 0:E.Stop, 1:Stop
10 S/W upper limit LREAL [Unit]
11 S/W lower limit LREAL [Unit]
12 Infinite running repeat position LREAL Positive number [Unit]
13 Infinite running repeat 0:Disable, 1:Enable
14 Command Inposition range 0 or LREAL Positive number [Unit]
15 Tracking error over-range value 0 or LREAL Positive number [Unit]
16 Current position compensation amount 0 or LREAL Positive number [Unit]
17 Current speed filter time constant 0 ~ 100
18 Extented Error reset monitoring time 1 ~ 1000 [ms]
19 Parameter S/W limit during speed control 0:Don’t detect, 1:Detect
20 Tracking error level 0:Warning, 1:Alarm
LREAL Positive number [Unit]
21 JOG high Speed
(Jog low speed ~speed limit ) [Unit/s]
LREAL Positive number [Unit]
22 JOG low Speed
( < Jog high speed) [Unit/s]
23 JOG acceleration 0 or LREAL Positive number [Unit/ s2]
24 JOG deceleration 0 or LREAL Positive number [Unit/ s2]
25 JOG jerk 0 or LREAL Positive number [Unit/ s2]
10-31
Chapter10 Motion Function Block
MC_WriteParameter
BOOL Execute Vaild BOOL
UINT Axis Axis UINT
INT ParameterNumber Busy BOOL
LREAL Value Error BOOL
UINT ExcutionMode ErrorID WORD
Input-Output
UINT Axis Specify the axis to be commanded (1~32: real axis, 37~40: virtual axis)
Input
BOOL Execute Rising Edge corresponding parameters of input is written. .
INT ParameterNumber Specify the number of parameter to write. (0 ~ 25)
LREAL Value Specify the value of parameter to write.
UINT ExecutionMode Specify the time when parameter is written.
Output
BOOL Vaild Indicate whether parameter is successfully written.
BOOL Busy Indicate that the execution of motion function block is not completed.
BOOL Error Indicate whether an error occurs or not.
WORD ErrorID Output the number of error occurred while motion function block is running.
(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
Chapter10 Motion Function Block
10-33
Chapter10 Motion Function Block
MC_Reset Availability
MC_Reset
BOOL Execute Done BOOL
UINT Axis Axis UINT
BOOL ErrorType Busy BOOL
Error BOOL
ErrorID WORD
Input-Output
UINT Axis Specify the axis to be commanded (1~32: real axis, 37~40: virtual axis)
Input
BOOL Execute Reset the axis error in the rising Edge of input.
BOOL ErrorType The types of error to be reset (0: Axis error, 1: Common error)
Output
BOOL Done Indicate whether the axis error is successfully reset.
BOOL Busy Indicate that the execution of motion function block is not completed.
BOOL Error Indicate whether an error occurs or not.
WORD ErrorID Output the number of error occurred while motion function block is running.
(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
Chapter10 Motion Function Block
MC_TouchProbe Availability
MC_TouchProbe
BOOL Execute Done BOOL
UINT Axis Axis UINT
UINT TriggerInput TriggerInput UINT
BOOL WindowOnly Busy BOOL
LREAL FirstPosition CommandAborted BOOL
LREAL LastPosition Error BOOL
ErrorID WORD
RecordedPosition LREAL
Input-Output
UINT Axis Specify the axis to be commanded (1~32: real axis)
UINT TriggerInput Specify the signal to be used as a trigger. (0: TouchProbe 1, 1: TouchProbe 2)
Input
BOOL Execute TouchProbe function starts at the rising Edge of input.
BOOL WindowOnly Activate the window mode.
LREAL FirstPosition Specify the starting position of allowable area in the window mode.
LREAL LastPosition Specify the end position of allowable area in the window mode.
Output
BOOL Done Indicate that the trigger signal is successfully recorded.
BOOL Busy Indicate that the execution of motion function block is not completed.
BOOL CommandAborted Indicate that the current motion function block is interrupted by other command.
BOOL Error Indicate whether an error occurs or not.
WORD ErrorID Output the number of error occurred while motion function block is running.
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
Chapter10 Motion Function Block
< In case TouchProbe function is the window mode, Operation timing >
10-36
Chapter10 Motion Function Block
MC_AbortTrigger Availability
MC_AbortTrigger
BOOL Execute Done BOOL
UINT Axis Axis UINT
UINT TriggerInput TriggerInput USINT
Busy BOOL
Error BOOL
ErrorID WORD
Input-Output
UINT Axis Specify the axis to be commanded (1~32: real axis)
UINT TriggerInput Specify the trigger signal to be disengaged. (0: TouchProbe 1, 1: TouchProbe 2)
Input
BOOL Execute The trigger on standby in the relevant axis in the rising Edge is disengaged.
Output
BOOL Done Indicate the state of motion function block completion.
BOOL Busy Indicate that the execution of motion function block is not completed.
BOOL Error Indicate whether an error occurs or not.
WORD ErrorID Output the number of error occurred while motion function block is running.
(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
Chapter10 Motion Function Block
MC_CamIn Availability
MC_CamIn
BOOL Execute InSync BOOL
UINT Master Master UINT
UINT Slave Slave UINT
LREAL ContinousUpdate Busy BOOL
LREAL MasterOffset Active BOOL
LREAL SlaveOffset CommandAborted BOOL
LREAL MasterScaling Error BOOL
LREAL SlaveScaling ErrorID WORD
LREAL MasterStartDistance EndOfProfile BOOL
LREAL MasterSyncPosition
UINT StartMode
UINT MasterValueSource
UINT CamTableID
UINT BufferMode
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)
Input
BOOL Execute Give cam operation command to the relevant axis in the rising Edge.
Specify the update setting of input value.
BOOL ContinuousUpdate (Refer to 10.1.5.Changes in Parameters during Execution of Motion Function
Block)
LREAL MasterOffset Set the offset value of the main axis.
LREAL SlaveOffset Set the offset value of the the serve axis cam table.
LREAL MasterScaling Specify the magnification of the main axis.
LREAL SlaveScaling Specify the magnification of the serve axis cam table.
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.
0 : Cam table is applied as an absolute value (mcAbsolute)
UINT StartMode
1: Cam table is applied as a relative value based on the command starting point
(mcRelative)
10-38
Chapter10 Motion Function Block
(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
Chapter10 Motion Function Block
(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
(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
Chapter10 Motion Function Block
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
Chapter10 Motion Function Block
MC_CamOut Availability
MC_CamOut
BOOL Execute Done BOOL
UINT Slave Slave UINT
Busy BOOL
Error BOOL
ErrorID WORD
Input-Output
UINT Slave Set the the serve axis. (1~32: Actual axes, 37~40: Virtual axes)
Input
BOOL Execute Give cam operation stop command to the relevant axis in the rising Edge.
Output
BOOL Done Indicate the state of motion function block completion.
BOOL Busy Indicate that the execution of motion function block is not completed.
BOOL Error Indicate whether an error occurs or not.
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
Chapter10 Motion Function Block
MC_GearIn Availability
MC_GearIn
BOOL Execute InGear BOOL
UINT Master Master UINT
UINT Slave Slave UINT
BOOL ContinousUpdate Busy BOOL
INT RatioNumerator Active BOOL
UINT RatioDenominator CommandAborted BOOL
UINT MasterValueSource Error BOOL
LREAL Acceleration ErrorID WORD
LREAL Deceleration
LREAL Jerk
UINT BufferMode
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)
Input
BOOL Execute Give gear operation command to the relevant axis in the rising Edge.
Specify the update setting of input value.
BOOL ContinuousUpdate (Refer to 10.1.5.Changes in Parameters during Execution of Motion Function
Block)
INT RatioNumerator Specify the numerator of gear ratio. (-32768 ~ 32767)
UINT RatioDenominator Specify the denominator of gear ratio. (0 ~ 65535)
Select data of the main axis to be synchronized.
UINT MasterValueSource 0: Synchronize in the command position of the main axis.
1: Synchronize in the current position of the main axis.
LREAL Acceleration Specify the acceleration at the beginning of gear operation synchronization. [u/s2]
LREAL Deceleration Specify the deceleration at the beginning of gear operation synchronization. [u/s2]
LREAL Jerk Specify the change rate of acceleration/deceleration. [u/s3]
Specify the sequential operation setting of motion function block.
UINT BufferMode
(Refer to 10.1.4.BufferMode)
10-43
Chapter10 Motion Function Block
Output
BOOL InGear Indicate that gear operation is running by applying gear ration.
BOOL Busy Indicate that the execution of motion function block is not completed.
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 Indicate whether an error occurs or not.
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
Chapter10 Motion Function Block
MC_GearOut Availability
MC_GearOut
BOOL Execute Done BOOL
UINT Slave Slave UINT
Busy BOOL
Error BOOL
ErrorID WORD
Input-Output
UINT Slave Set the the serve axis. (1~32: Actual axes, 37~40: Virtual axes)
Input
Specify the sequential operation setting of motion function block.
UINT BufferMode
(Refer to 10.1.4.BufferMode)
Output
BOOL Done Indicate the state of motion function block completion.
BOOL Busy Indicate that the execution of motion function block is not completed.
BOOL Error Indicate whether an error occurs or not.
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
Chapter10 Motion Function Block
MC_GearInPos Availability
MC_GearInPos
BOOL Execute InSync UINT
UINT Master Master UINT
UINT Slave Slave BOOL
INT RatioNumerator StartSync BOOL
UINT RatioDenominator Busy BOOL
UINT MasterValueSource Active BOOL
LREAL MasterSyncPosition CommandAborted BOOL
LREAL SlaveSyncPosition Error BOOL
UINT SyncMode ErrorID WORD
LREAL MasterStartDistance
LREAL Velocity
LREAL Acceleration
LREAL Deceleration
LREAL Jerk
UINT BufferMode
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)
Input
BOOL Execute Give a gear operation command to the relevant axis in the rising Edge.
INT RatioNumerator Specify the numerator of gear ratio. (-32768~32767)
UINT RatioDenominator Specify the denominator of gear ratio. (0~65535)
Select the standard of the main axis value to be synchronized.
UINT MasterValueSource 0(mcSetValue): Synchronize in the target position of the main axis.
1(mcActualValue): Synchronize in the current position of the main axis.
LREAL MasterSyncPosition Specify the position of the main axis where gear operation starts.
LREAL SlaveSyncPosition Specify the position of the spindle where gear operation starts.
LREAL MasterStartDistance Specify the distance of the main axis where synchronization starts.
Specify the maximum speed of the spindle at the beginning of synchronization.
LREAL Velocity
[u/s]
10-46
Chapter10 Motion Function Block
(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
Chapter10 Motion Function Block
10-48
Chapter10 Motion Function Block
MC_AddAxisToGroup Availability
MC_AddAxisToGroup
BOOL Execute Done BOOL
UINT AxesGroup AxesGroup UINT
UINT Axis Axis UINT
UINT IdentInGroup Busy BOOL
Error BOOL
ErrorID WORD
Input-Output
UINT AxesGroup 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
UINT Axis
axes)
Input
BOOL Execute Give group axis addition command to the relevant axis in the rising Edge.
UINT IdentInGroup Set the ID of the relevant axis to be used in the relevant group. (1 ~ 4)
Output
BOOL Done Indicate the state of motion function block completion.
BOOL Busy Indicate that the execution of motion function block is not completed.
BOOL Error Indicate whether an error occurs or not.
WORD ErrorID Output the number of error occurred while motion function block is running.
(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
Chapter10 Motion Function Block
MC_RemoveAxisFromGroup Availability
MC_RemoveAxisFromGroup
BOOL Execute Done BOOL
UINT AxesGroup AxesGroup UINT
UINT IdentInGroup Busy BOOL
Error BOOL
ErrorID WORD
Input-Output
UINT AxesGroup Set the group where the relevant axis is removed. (1 ~ 16 : Group1 ~ Group 16)
Input
BOOL Execute Give group axis exclusion command to the relevant group in the rising Edge.
Set the axis number in the relevant group to be removed from the relevant
UINT IdentInGroup
group.
Output
BOOL Done Indicate the state of motion function block completion.
BOOL Busy Indicate that the execution of motion function block is not completed.
BOOL Error Indicate whether an error occurs or not.
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
Chapter10 Motion Function Block
MC_UngroupAllAxes Availability
MC_UngroupAllAxes
BOOL Execute Done BOOL
UINT AxesGroup AxesGroup UINT
Busy BOOL
Error BOOL
ErrorID WORD
Input-Output
UINT AxesGroup Set the group where every axis is to be removed. (1 ~ 16 : Group 1 ~ Group 16)
Input
BOOL Execute Give MC_UngroupAllAxes command to the relevant group in the rising Edge.
Set the axis number in the relevant group to be removed from the relevant
UINT IdentInGroup
group.
Output
BOOL Done Indicate the state of motion function block completion.
BOOL Busy Indicate that the execution of motion function block is not completed.
BOOL Error Indicate whether an error occurs or not.
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
Chapter10 Motion Function Block
MC_GroupEnable Availability
MC_GroupEnable
BOOL Execute Done BOOL
UINT AxesGroup AxesGroup UINT
Busy BOOL
Error BOOL
ErrorID WORD
Input-Output
UINT AxesGroup Set the group to be activated. (1 ~ 16 : Group 1 ~ Group 16)
Input
BOOL Execute Give group activation command to the relevant group in the rising Edge.
Output
BOOL Done Indicate the state of motion function block completion.
BOOL Busy Indicate that the execution of motion function block is not completed.
BOOL Error Indicate whether an error occurs or not.
WORD ErrorID Output the number of error occurred while motion function block is running.
(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
Chapter10 Motion Function Block
MC_GroupDisable Availability
MC_GroupDisable
BOOL Execute Done BOOL
UINT AxesGroup AxesGroup UINT
Busy BOOL
Error BOOL
ErrorID WORD
Input-Output
UINT AxesGroup Set the group to be deactivated. (1 ~ 16 : Group 1 ~ Group 16)
Input
BOOL Execute Give group disablement command to the relevant group in the rising Edge.
Output
BOOL Done Indicate the state of motion function block completion.
BOOL Busy Indicate that the execution of motion function block is not completed.
BOOL Error Indicate whether an error occurs or not.
WORD ErrorID Output the number of error occurred while motion function block is running.
(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
Chapter10 Motion Function Block
MC_GroupHome Availability
MC_GroupHome
BOOL Execute Done BOOL
UINT AxesGroup AxesGroup UINT
LREAL[ ] Position Busy BOOL
UINT BufferMode Active BOOL
CommandAborted BOOL
Error BOOL
ErrorID WORD
Input-Output
UINT AxesGroup Set the group returning to home. (1 ~ 16 : Group 1 ~ Group 16)
Input
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.
Specify the sequential operation setting of motion function block.
UINT BufferMode
(Refer to 10.1.4.BufferMode)
Output
BOOL Done Indicate the state of motion function block completion.
BOOL Busy Indicate that the execution of motion function block is not completed.
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 Indicate whether an error occurs or not.
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
Chapter10 Motion Function Block
MC_GroupSetPosition Availability
MC_GroupSetPosition
BOOL Execute Done BOOL
UINT AxesGroup AxesGroup UINT
Position Busy BOOL
BOOL Relative Active BOOL
UINT ExecuteMode CommandAborted BOOL
Error BOOL
ErrorID 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
Edge.
LREAL[ ] Position Specify the position.
BOOL Relative 0: Position value=Absolute position, 1: Position value=Relative position
0: Immediately applied the position value,
UINT ExecuteMode
1: Applied at the same point with ‘Buffered’ of Buffermode
Output
BOOL Done Indicate the state of motion function block completion.
BOOL Busy Indicate that the execution of motion function block is not completed.
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 Indicate whether an error occurs or not.
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
Chapter10 Motion Function Block
(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
Chapter10 Motion Function Block
MC_GroupStop Availability
MC_GroupStop
BOOL Execute Done BOOL
UINT AxesGroup AxesGroup UINT
LREAL Deceleration Busy BOOL
LREAL Jerk Active BOOL
CommandAborted BOOL
Error BOOL
ErrorID WORD
Input-Output
UINT AxesGroup Set the group to stop immediately. (1 ~ 16 : Group 1 ~ Group 16)
Input
BOOL Execute Give group immediate stop command to the relevant group in the rising Edge.
LREAL Deceleration Specify the deceleration in time of stop. [u/s2]
LREAL Jerk Specify the change rate of acceleration/deceleration. [u/s3]
Output
BOOL Done Indicate the state of motion function block completion.
BOOL Busy Indicate that the execution of motion function block is not completed.
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 Indicate whether an error occurs or not.
WORD ErrorID Output the number of error occurred while motion function block is running.
(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
Chapter10 Motion Function Block
(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
Chapter10 Motion Function Block
MC_GroupHalt Availability
MC_GroupHalt
BOOL Execute Done BOOL
UINT AxesGroup AxesGroup UINT
LREAL Deceleration Busy BOOL
LREAL Jerk Active BOOL
UINT BufferMode CommandAborted BOOL
Error BOOL
ErrorID WORD
Input-Output
UINT AxesGroup Set the group to stop. (1 ~ 16 : Group 1 ~ Group 16)
Input
BOOL Execute Give group stop command to the relevant group in the rising Edge.
LREAL Deceleration Specify the deceleration in the time of stop. [u/s2]
LREAL Jerk Specify the change rate of acceleration/deceleration. [u/s3]
Specify the sequential operation setting of motion function block.
UINT BufferMode
(Refer to 10.1.4.BufferMode)
Output
BOOL Done Indicate the state of motion function block completion.
BOOL Busy Indicate that the execution of motion function block is not completed.
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 Indicate whether an error occurs or not.
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
Chapter10 Motion Function Block
MC_GroupReset Availability
MC_GroupReset
BOOL Execute Done BOOL
UINT AxesGroup AxesGroup UINT
Busy BOOL
Error BOOL
ErrorID WORD
Input-Output
UINT AxesGroup Set the group to do error reset. (1 ~ 16 : Group 1 ~ Group 16)
Input
BOOL Execute Give group error reset command to the relevant group in the rising Edge.
Output
BOOL Done Indicate the state of motion function block completion.
BOOL Busy Indicate that the execution of motion function block is not completed.
BOOL Error Indicate whether an error occurs or not.
WORD ErrorID Output the number of error occurred while motion function block is running.
(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
Chapter10 Motion Function Block
MC_MoveLinearAbsolute Availability
MC_MoveLinearAbsolute
BOOL Execute Done BOOL
UINT AxesGroup AxesGroup UINT
LREAL[ ] Position Busy BOOL
LREAL Velocity Active BOOL
LREAL Acceleration CommandAborted BOOL
LREAL Deceleration Error BOOL
LREAL Jerk ErrorID WORD
UINT BufferMode
UINT TransitionMode
LREAL TransitionParameter
Input-Output
Set the group to perform absolute position linear interpolation operation. (1 ~ 16:
UINT AxesGroup
Group 1 ~ Group 16)
Input
Give absolute position linear interpolation operation command to the relevant group
BOOL Execute
in the rising Edge.
LREAL[ ] Position Specify the target position of each axis.
LREAL Velocity Specify the maximum speed of the route. [u/s]
LREAL Acceleration Specify the maximum acceleration. [u/s2]
LREAL Deceleration Specify the maximum deceleration. [u/s2]
LREAL Jerk Specify the change rate of acceleration/deceleration. [u/s3]
Specify the sequential operation setting of motion function block.
UINT BufferMode
(Refer to 10.1.4.BufferMode)
Specify the route change mode of group operation.
UINT TransitionMode
(Refer to 10.1.6.TransitionMode )
Specify the parameter of the route change setting of group operation..
LREAL TransitionParameter
(Refer to 10.1.6.TransitionMode )
Output
BOOL Done Indicate whether to reach the specified position.
BOOL Busy Indicate that the execution of motion function block is not completed.
10-61
Chapter10 Motion Function Block
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 Indicate whether an error occurs or not.
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.
Interpolation speed (F) = Target speed specified in the Velocity
(6) Refer to linear interpolation control part in motion control module’s manual for more details.
10-62
Chapter10 Motion Function Block
MC_MoveLinearRelative Availability
MC_MoveLinearRelative
BOOL Execute Done BOOL
UINT AxesGroup AxesGroup UINT
LREAL[ ] Distance Busy BOOL
LREAL Velocity Active BOOL
LREAL Acceleration CommandAborted BOOL
LREAL Deceleration Error BOOL
LREAL Jerk ErrorID WORD
UINT BufferMode
UINT TransitionMode
LREAL TransitionParameter
Input-Output
Set the group to do relative position linear interpolation operation. (1 ~ 16: Group 1
UINT AxesGroup
~ Group 16)
Input
Give relative position linear interpolation operation command to the relevant group
BOOL Execute
in the rising Edge.
LREAL[ ] Distance Set the target distance of each axis.
LREAL Velocity Specify the maximum speed of the route. [u/s]
LREAL Acceleration Specify the maximum acceleration. [u/s2]
LREAL Deceleration Specify the maximum deceleration. [u/s2]
LREAL Jerk Specify the change rate of acceleration/deceleration. [u/s3]
Specify the sequential operation setting of motion function block.
UINT BufferMode
(Refer to 10.1.4.BufferMode)
Specify the route change mode of group operation.
UINT TransitionMode
(Refer to 10.1.6.TransitionMode )
Specify the parameter of the route change setting of group operation..
LREAL TransitionParameter
(Refer to 10.1.6.TransitionMode )
Output
BOOL Done Indicate whether to reach the specified position.
BOOL Busy Indicate that the execution of motion function block is not completed.
10-63
Chapter10 Motion Function Block
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 Indicate whether an error occurs or not.
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.
Interpolation speed (F) = Target speed specified in the Velocity
(6) Refer to linear interpolation control part in motion control module’s manual for more details.
10-64
Chapter10 Motion Function Block
MC_MoveCircularAbsolute Availability
MC_MoveCircularAbsolute
BOOL Execute Done BOOL
UINT AxesGroup AxesGroup UINT
UINT CircMode Busy BOOL
LREAL[ ] AuxPoint Active BOOL
LREAL[ ] EndPoint CommandAborted BOOL
UINT PathChoice Error BOOL
LREAL Velocity ErrorID WORD
LREAL Acceleration
LREAL Deceleration
LREAL Jerk
UINT BufferMode
UINT TransitionMode
LREAL TransitionParameter
Input-Output
Set the group to do absolute position circular interpolation operation. (1 ~ 16: Group
UINT AxesGroup
1 ~ Group 16)
Input
Give absolute position circular interpolation operation command to the relevant
BOOL Execute
group in the rising Edge.
UINT CirMode Circular interpolation method setting [0: Midpoint, 1: Central point, 2: Radius]
Specify the position of auxiliary point depending on the circular interpolation
LREAL[ ] AuxPoint
method in an absolute coordinate.
LREAL[ ] EndPoint Specify the end point of circular arc in an absolute coordinate.
Circular route selection
BOOL PathChoice
0: Clockwise, 1: Counterclockwise
LREAL Velocity Specify the maximum speed of the route. [u/s]
LREAL Acceleration Specify the maximum acceleration. [u/s2]
LREAL Deceleration Specify the maximum deceleration. [u/s2]
LREAL Jerk Specify the change rate of acceleration/deceleration. [u/s3]
Specify the sequential operation setting of motion function block.
UINT BufferMode
(Refer to 10.1.4.BufferMode)
10-65
Chapter10 Motion Function Block
(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.
Circular interpolation of midpoint specifying method (BORDER, CircMode = 0)
In this method, operation starts at the starting point 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 starting point, the coordinate entered in AuxPoint
corresponds to the central point, and the coordinate entered in EndPoint corresponds to the target position in
an absolute value.
10-66
Chapter10 Motion Function Block
(6) Refer to linear interpolation control part in motion control module’s manual for more details.
10-67
Chapter10 Motion Function Block
MC_MoveCircularRelative Availability
MC_MoveCircularRelative
BOOL Execute Done BOOL
UINT AxesGroup AxesGroup UINT
UINT CircMode Busy BOOL
LREAL[ ] AuxPoint Active BOOL
LREAL[ ] EndPoint CommandAborted BOOL
USINT PathChoice Error BOOL
LREAL Velocity ErrorID WORD
LREAL Acceleration
LREAL Deceleration
LREAL Jerk
UINT BufferMode
UINT TransitionMode
LREAL TransitionParameter
Input-Output
Set the group to do absolute position circular interpolation operation. (1 ~ 16: Group
UINT AxesGroup
1 ~ Group 16)
Input
Give relative position circular interpolation operation command to the relevant
BOOL Execute
group in the rising Edge.
UINT CirMode Circular interpolation method setting [0: Midpoint, 1: Central point, 2: Radius]
Specify the position of auxiliary point depending on the circular interpolation
LREAL[ ] AuxPoint
method as the relative coordinate based on the starting point.
Specify the end point of circular arc as the relative coordinate based on the starting
LREAL[ ] EndPoint
point.
Circular route selection
BOOL PathChoice
0: Clockwise, 1: Counterclockwise
LREAL Velocity Specify the maximum speed of the route. [u/s]
LREAL Acceleration Specify the maximum acceleration. [u/s2]
LREAL Deceleration Specify the maximum deceleration. [u/s2]
LREAL Jerk Specify the change rate of acceleration/deceleration. [u/s3]
10-68
Chapter10 Motion Function Block
10-69
Chapter10 Motion Function Block
(6) Refer to linear interpolation control part in motion control module’s manual for more details.
10-70
Chapter10 Motion Function Block
LS_Connect Availability
LS_Connect
BOOL Execute Done BOOL
Busy BOOL
Error BOOL
ErrorID WORD
Input
Give communication connection command to the relevant module in the rising
BOOL Execute
Edge.
Output
BOOL Done Indicate whether to complete communication connection.
BOOL Busy Indicate that the execution of motion function block is not completed.
BOOL Error Indicate whether an error occurs or not.
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
Chapter10 Motion Function Block
LS_Disconnect Availability
LS_Disonnect
BOOL Execute Done BOOL
Busy BOOL
Error BOOL
ErrorID WORD
Input
Give communication disconnection command to the relevant module in the rising
BOOL Execute
Edge.
Output
BOOL Done Indicate whether to complete communication disconnection.
BOOL Busy Indicate that the execution of motion function block is not completed.
BOOL Error Indicate whether an error occurs or not.
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
Chapter10 Motion Function Block
LS_ReadServoParameter Availability
MC_ReadServoParameter
BOOL Execute Done BOOL
UINT Axis Axis UINT
UINT Index Busy BOOL
UINT SubIndex Error BOOL
UINT Length ErrorID WORD
Value DINT
Input-Output
UINT Axis Set the axis to be given a command. (1~32: Actual axes)
Input
BOOL Execute Give servo parameter reading command to the relevant axis in the rising Edge.
UINT Index Set the Index of servo parameter Object to be read. (0x0000~0x9FFF)
UINT SubIndex Set the SubIndex of servo parameter Object to be read. (0 ~ 255)
UINT Length Set the distance of servo parameter Object to be read by Byte. (1 ~ 4)
Output
BOOL Done Indicate that servo parameter is successfully read.
BOOL Busy Indicate that the execution of motion function block is not completed.
BOOL Error Indicate whether an error occurs or not.
WORD ErrorID Output the number of error occurred while motion function block is running.
LREAL Value Output the value of servo parameter.
(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
Chapter10 Motion Function Block
(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 Data Type Description
16#1000 ~ 16#1FFF Communication objects
16#2000 ~ 16#5FFF Manufacturer Specific Profile Area
16#6000 ~ 16#9FFF Standardized Device Profile Area
(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
Chapter10 Motion Function Block
LS_WriteServoParameter Availability
MC_WriteServoParameter
BOOL Execute Done BOOL
UINT Axis Axis UINT
UINT Index Busy BOOL
UINT SubIndex Error BOOL
UINT Length ErrorID WORD
DINT Value
UINT ExecutionMode
Input-Output
UINT Axis Set the axis to be given a command. (1~32: Actual axes)
Input
BOOL Execute Give servo parameter writing command to the relevant axis in the rising Edge.
UINT Index Set the Index of servo parameter Object to be written. (0x0000~0x9FFF)
UINT SubIndex Set the SubIndex of servo parameter Object to be written. (0 ~ 255)
UINT Length Set the distance of servo parameter Object to be written by Byte. (1 ~ 4)
DINT Value Set the value to be written in servo parameter.
Specify the time when performing servo parameter writing.
UINT ExecuteMode 0: Immediately executed
1: Applied at the same time with ‘Buffered’ of BufferMode.
Output
BOOL Done Indicate that servo parameter is successfully read.
BOOL Busy Indicate that the execution of motion function block is not completed.
BOOL Error Indicate whether an error occurs or not.
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
Chapter10 Motion Function Block
Value Description
16#0000 ~ 16#0FFF Data Type Description
16#1000 ~ 16#1FFF Communication objects
16#2000 ~ 16#5FFF Manufacturer Specific Profile Area
16#6000 ~ 16#9FFF Standardized Device Profile Area
(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 with‘Buffered’of BufferMode. (Refer to 10.1.4. BufferMode input)
10-76
Chapter10 Motion Function Block
LS_EncoderPreset Availability
LS_EncoerPreset
BOOL Execute Done BOOL
UINT Encoder Busy BOOL
LREAL Position Error BOOL
BOOL Relative ErrorID WORD
Input
BOOL Execute Specify the position of the relevant encoder in the rising Edge.
UINT Encoder Set the encoder to set the position. (1~2: Encoder 1~Encoder 2)
LREAL Position Specify the position to set. [u]
0: Absolute coordinate position
BOOL Relative
1: Relative coordinate position
Output
BOOL Done Indicate the state of motion function block completion.
BOOL Busy Indicate that the execution of motion function block is not completed.
BOOL Error Indicate whether an error occurs or not.
WORD ErrorID Output the number of error occurred while motion function block is running.
10-77
Chapter10 Motion Function Block
LS_Jog Availability
LS_Jog
BOOL Enable Enabled BOOL
UINT Axis Axis UINT
BOOL Direction Busy BOOL
BOOL Low/High Error BOOL
ErrorID WORD
Input-Output
UINT Axis Set the axis to be given a command. (1~32: Actual axes)
Input
BOOL Enable Give jog command to the relevant axis while input is On.
BOOL Direction Set the rotation direction in jog (0: Forward direction, 1: Reverse direction)
Set the jog speed in jog.
BOOL Low/High
(0: Jog low speed operation, 1: Jog high speed operation)
Output
BOOL Enabled Indicate that the relevant axis is in jog.
BOOL Busy Indicate that the execution of motion function block is not completed.
BOOL Error Indicate whether an error occurs or not.
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
Chapter11 Expanded Function
11-1
Chapter10 Expanded Function
1.1. FOR/NEXT/BREAK
LOOP command
Function Description
FOR N
NEXT
■ Function
(1) PLC repeats FOR ~ NEXT command n times and then processes the next step of NEXT command.
(2) n is available 1 ~ 65,535.
(3) FOR ~ NEXT command is able to use 16 NESTINGs.
(4) REAK command is the instruction to escape FOR ~ NEXT loop.
(5) Keep the range of WDT value to avoid delaying the scan time.
■ Program Example
FOR 100
.
.
.
ON
BREAK
.
.
.
NEXT
11-2
Chapter11 Expanded Function
1.2. CALL/SBRT/RET
Flags
Function Description
RET RETURN
■ Function
(1) With an input condition and the CALL n command, it operates a program among the SBRT n ~ RET command.
(2) Nested CALL n command is usable, and the program among SBRT n ~ RET must be placed after END command.
(3) A program which is in SBRT can call another SBRT. In this case, END command is impossible to use in the SBRT.
(4) A program can escape the FOR ~ NEXT loop with a BREAK command.
■ Program Example
(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
Chapter10 Expanded Function
1.3. JMP
JUMP command
Flags
Function Description
■ 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
11-4
Chapter11 Expanded Function
1.4. INIT_
1.5. END
END command
Flags
Function Description
■ Function
11-5
Chapter10 Expanded Function
11-6
Chapter12 ST (Strructured Text)
12.1 General
▷ ST program can use all of text editor and has high portability.
▷ It can express complicated expression and algorithm well
▷ A person skilled at computer language can use easily.
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
Chapter12 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.
(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) If operator has two operands, left operand executes first.
For example: SIN(A)*COS(B): SIN(A) executes first and COS(B) executes last.
(5) When executing operation, the following condition is dealt with error.
12-2
Chapter12 ST (Strructured Text)
(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
Items Description
Result Named variable or direct variable
expression1 ANY_NUM type
expression2 ANY_NUM type
Example Description
Val1 := 20; Adds Val1(20) to Val2(4) and inputs result
Val2 := 4; Value of Result becomes 24.
Result := Val1 + Val2; Constant and variable can be used as operands (Val1, Val2).
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
Items Description
result Named variable or direct variable
expression1 ANY_NUM
expression2 ANY_NUM
12-3
Chapter12 ST (Structured Text)
Example Description
Val1 := 20; Subtracts right value(Val2) from left value(Val1) and inputs result.
Val2 := 4; Value of result becomes 16
Result := Val1 - Val2; Constant and variable can be used as operands (Val1, Val2).
12.3.3 * Operator
Items Description
result Named variable or direct variable
expression1 ANY_NUM type
expression2 ANY_NUM type
Example Description
Multiplies 20 by In1(2) and inputs result.
In1 := 2 ;
Result := 20 * In1 ; Value of result becomes 40.
Constant and variable can be used as operands (Val1, Val2).
12.3.4 / Operator
(3) Expression
result := expression1 / expression2
Item Description
result Named variable or direct variable
expression1 ANY_NUM type
expression2 ANY_NUM type
12-4
Chapter12 ST (Strructured Text)
Example Description
Divides 20 by 2(ln1) and inputs result.
In1 := 2 ;
Result becomes 10.
Result := 20 / In1 ; Constant and variable can be used as operands.
12-5
Chapter12 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
Divides 12 by 10(ln1) and inputs remain into result
In1:= 10 ;
Constant and variable can be used as operands.
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 Description
result Named variable or direct variable
expression1 ANY_REAL type
expression2 ANY_REAL type
Example Description
Multiplies 10 as many as 3 times and inputs it to result.
In1 := 3 ;
Result becomes 1000.
Result := 10 ** In1 ; Constant and variable can be used as operands.
12-6
Chapter12 ST (Strructured Text)
Item Description
result Named variable or direct variable
expression1 ANY_BIT type
expression2 ANY_BIT type
Example Description
Result := 2#10010011 AND 2#00111101 ; Since first bit and 5th bit of two operands are both 1, result is
2#00010001.
Constant and variable can be used as operands.
12.3.8 OR operator
12-7
Chapter12 ST (Structured Text)
Example Description
Result := 2#10010011 OR 2#00111101 ; Since there are 1 except 7th bit in two operands, result is
2#10111111.
Example Description
Result := 2#10010011 XOR 2#00111101; Since first bits of two operands are 1, first bit of result is 0.
Result is 2#10101110.
12.3.10 = Operator
12-8
Chapter12 ST (Strructured Text)
Example Description
Val1 := 20; Compares Val1 and Val2 and output result.
Val2 := 20 ; Result is 1.
Result := Val1 = Val2 ;
Example Description
Val1 := 20; Compares Val1 and Val2 and output result.
Val2 := 20 ; Result is 0.
Result := Val1 <> Val2 ;
(1) Compares two operands if left one is larger than right one.
(2) Expression
result := expression1 > expression2
Item Description
12-9
Chapter12 ST (Structured Text)
Example Description
Val1 := 20; Compares two operands if left one is larger than right one.
Val2 := 10 ; Result is 1.
Result := Val1 > Val2 ;
(1) Compares two operands if left one is smaller than right one.
(2) Expression
result := expression1 < expression2
Item Description
result Named variable or direct variable
expression1 ANY type
expression2 ANY type
Example Description
Val1 := 20; Compares two operands if left one is smaller than right one.
Val2 := 10 ; Result is 0.
Result := Val1 < Val2 ;
12-10
Chapter12 ST (Strructured Text)
(1) Compares two operands if left one is larger than right one or same.
(2) Expression
result := expression1 >= expression2
Item Description
result Named variable or direct variable
expression1 ANY type
expression2 ANY type
Example Description
Val1 := 20; Compares two operands if left one is larger than right one or same.
Val2 := 20 ; Result is 1.
Result := Val1 >= Val2 ;
(1) Compares two operands if left one is smaller than right one or same.
(2) Expression
result := expression1 <= expression2
Item Description
result Named variable or direct variable
expression1 ANY type
expression2 ANY type
12-11
Chapter12 ST (Structured Text)
Example Description
Val1 := 2; Compares two operands if left one is smaller than right one or same.
Val2 := 20 ; Result is1.
Result := Val1 <= Val2 ;
Example Description
Val1 = 2#1100; Changes Val1 and output Result.
Result:= NOT Val1 ; Result is 2#0011.
12.3.17 - operator
Example Description
Val1 = 10; Adds negative sign into value and output is result.
Result:= - Val1 ; Result is -10.
12-12
Chapter12 ST (Strructured Text)
12.4 Statements
(1) Statements of ST language are summarized in <Table 2>.
(2) Statement is ended by semi colon(;).
12-13
Chapter12 ST (Structured Text)
12-14
Chapter12 ST (Strructured Text)
8 REPEAT J := -1;
REPEAT
J := J+2;
UNTIL J = 101 OR WORDS[J] = ‘KEY’
END_REPEAT ;
9 EXIT EXIT;
10 Null/Space command text ;
EXIT is used for all repetition texts (FOR, WHILE, REPEAT).
<Table 3> Command for ST
12.4.4 IF
Or
IF condition THEN
statements
[ELSIF condition-n THEN
elseifstatements] . . .
[ELSE
elsestatements]
END_IF
Item Description
If condition is TRUE, a statement following THEN is executed.
condition
In case of FLASE, ELSIF or ELSE executes.
statements If condition is TRUE, a statement more than one executes.
condition-n N conditions can be used.
elseifstatements If condition-n is TRUE, a statement more than one executes.
12-15
Chapter12 ST (Structured Text)
Item Description
elsestatements If condition or condition-n is false, a statement more than one executes.
Example Description
IF Val1 <= 10 THEN
If condition (Val1 <= 10) is TRUE, 10 is assigned into result.
Result := 10;
END_IF;
IF Val1 <= 10 THEN
If condition (Val1 <= 10) is TRUE, 10 is assigned into result.
Result := 10;
ELSE If condition is FALSE, 20 is assigned into result.
Result := 20;
END_IF;
IF Val1 <= 10 THEN If condition (Val1 <= 10) is TRUE, 10 is assigned into result.
Result := 10; If condition is FALSE, ELSEIF executes. If second condition (Val <= 20) is
ELSIF Val1 <= 20 THEN TRUE, 20 is assigned into result. If second is FALSE, a statement under
Result := 20; ELSE executes. Namely, 30 is assigned into result.
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 Only INT type is available.
12-16
Chapter12 ST (Strructured Text)
Item Description
subrange signed_integer .. signed_integer type
statement_list Executes more than one statements
Example Description
CASE Val1 OF If value of Val1 is 1, 10 is assigned into result.
1 : Result := 10 ; If value of Val1 is 2~5, 20 is assigned into result.
2..5 : Result := 20 ; If value of Val1 is 7 or 10, 30 is assigned into result.
7, 10 : Result := 30 ; In case of other values, 40 is assigned into result.
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 Description
counter Integer (SINT, INT, DINT) s
start, end, step should be the same type.
start Initial value of counter
end Last value of counter
step Indicates increment of count variable whenever loop executes. If this is not used,
increment is 1.
statements It executes according to three control texts.
Example Description
SUM := 0; Counter variable increases from 0 to 10 as many as 1. 1 is added
12-17
Chapter12 ST (Structured Text)
FOR counter := 0 TO 10 DO into SUM variable repeatedly. Final value of SUM is 11.
SUM := SUM + 1;
END_FOR ;
SUM := 0; Counter variable increases from 0 to 10 as many as 2. 1 is added
FOR counter = 0 TO 10 BY 2 DO into SUM variable repeatedly. Final value of SUM is 6.
SUM := SUM + 1;
END_FOR ;
Note
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 Description
condition If condition is TRUE, statements after DO executes.
In case of FLASE, it goes out from loop.
statements If condition is TRUE, statements more than one executes.
Example Description
Counter := 0
If condition that counter is less than 20 is TRUE, a statement executes.
WHILE Counter < 20 DO
Counter := Counter + 1; If condition is FALSE, it goes out from loop.
END_WHILE ;
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.4.8 REPEAT
(1) Statement executes repeatedly until condition is TRUE. In REPEAT statement, loop executes first and condition is checked
12-18
Chapter12 ST (Strructured Text)
UNTIL condition
END_REPEAT
Item Description
condition If condition is FALSE, it executes repeatedly and if TRUE, goes out from
loop.
statements Loop executes repeatedly until condition is TRUE.
Example Description
Counter := 0;
First, Counter variable is set to 1. If the condition that Counter variable is
REPEAT DO
Counter := Counter + 1; larger than 2 is met, it goes out from loop or it executes loop.
UNTIL Counter > 20 If Counter variable is 21, condition is TRUE and it goes out from loop.
END_REPEAT ;
Note
In REPEAT statement, in case condition doesn’t 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
Chapter12 ST (Structured Text)
12.4.9 EXIT
Example Description
SUM := 0; Counter variable increases from 0 to 10 as many as1. But because of EXT,
FOR Counter := 0 TO 10 DO loop ends. Counter variable becomes 0 and SUM becomes 1.
SUM := SUM + 1;
EXIT;
END_FOR ;
Counter := 0;
Text executes repeatedly when Counter is less than 20 and if Counter is
WHILE Counter < 20 DO
Counter := Counter + 1 ; larger than 20, loop ends. But because of IF statement and EXIT statement,
IF Counter = 10 THEN loop ends when Counter is 10.
EXIT;
END_IF;
END_WHILE ;
Counter := 0;
Counter variable increase as many as 1. If Counter is larger than 20, loop
REPEAT DO
Counter := Counter + 1 ; ends otherwise loop executes repeatedly. But because of IF statement and
IF Counter = 10 THEN EXIT statement, loop ends when Counter is 10.
EXIT;
END_IF;
UNTIL Counter > 20
END_REPEAT ;
12-20
Chapter12 ST (Strructured Text)
(1) There are two types (Standard type, nonstandard type) for use of function and function block. Both are available according to
environment.
Order of parameter does not matter. Order of parameter does not matter.
Q1 := LIMIT(MN := B, MX := 20, IN := 10) ; INST(IN := %IX0.0, PT := T#1s, Q => A, ET => E) ;
Q1 := LIMIT(MX := 20, MN := B, IN := 10) ; INST(PT := T#1s, IN := %IX0.0, Q => A, ET => E) ;
EN, ENO can be omitted.
Q1 := LIMIT(EN := A, MN := B, MX := 20, IN := 10,
ENO => Q2) ;
Common
Use“:=” for input parameter allocation. Use “:=” for input parameter allocation..
C := LIMIT(MN := B, MX := 20, IN := 10) ; INST(IN := %IX0.0, PT := T#1s, Q => A, ET => B) ;
Input
If output parameter name is OUT or Y (For user Use “=>” for out parameter allocation
defined function, function name), allocate as the Output parameter allocation can be omitted.
return value. INST(IN := %IX0.0, PT := T#1s, Q => A, ET => E) ;
Output For other output parameters, use“=>”.
Q1 := ARY_SCH(DATA := B, IN := C, P => Q2, N
=> Q3) ;
12-21
Chapter12 ST (Structured Text)
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
Chapter12 ST (Strructured Text)
You cannot change the order of all You cannot change the order of all
parameters. parameters.
You cannot omit any parameter You cannot omit any parameter
Q1 := LIMIT(B, 20, 10) ; INST(%IX0.0, T#1s, A, E) ;
Common
If output parameter name is OUT or Y (For For all output parameters, input in order of
user defined function, function name), position
allocate as the return value. INST(%IX0.0.0, T#1s, A, E) ;
For other output parameters, input in order
of position
Q1 := ARY_SCH(B, C, Q2, Q3) ;
Output
Note
12-23
Chapter12 ST (Structured Text)
For function whose parameter type is variable, input parameter type should be determined.
Example Description
INT1 := ADD(1, 2, 3); Error occurs while determining function type
Example Description
INT1 := ADD(INT#1, 2, 3); Sets the type of constant
INT1 := ADD(B, 2, 3); Uses variable (B)
INT1 := ADD_INT(1, 2, 3); Uses the type-defined function
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
Chapter12 ST (Strructured 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
Chapter12 ST (Structured Text)
(3) Application
Use of LD Use of ST
%QX0.0 := Complete;
12-26
Appendix1 Numerical System and Data Structure
Motion Control module remembers and processes every data as the states of on and off or ‘1’and ’0’. Therefore, any
numerical operation is processed by binary system (1 or 0). On the other hand, we conveniently use the decimal system, so
decimal or hexadecimal number systems must be converted to hexadecimal or decimal number systems, respectively in
order to write or read numerical data to/from PLC. This chapter describes the representation of decimal, binary, hexadecimal
and binary-coded decimal notation and the relations.
1. Decimal
Decimal number system means the “number expressing an order or size (volume) using 0~9.
And, followed by 0, 1, 2, 3, 4…9, 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
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
Appendix1 Numerical System and Data Structure
Binary Decimal
0 0
1 1
10 2
11 3
100 4
101 5
110 6
111 7
1000 8
…… ……
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.
7 6 5 4 3 2 1 0 Bit number
binary numeral
1 0 0 1 1 1 0 1
7 6 5 4 3 2 1 0
2 2 2 2 2 2 2 2
...
...
...
...
...
...
...
...
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
Appendix1 Numerical System and Data Structure
1 bit
1 0 0 1 1 1 0 1
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.
A1-3
Appendix1 Numerical System and Data Structure
3 2 1 0 Number of line
hexadecimal
4 A 9 D
numeral
= 19101
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 0 0 0 0 0 0 1 0 1 0 1 0 1 1 1
8000 4000 2000 1000 800 400 200 100 80 40 20 10 8 4 2 1 Weight of bit
1 5 7
A1-4
Appendix1 Numerical System and Data Structure
A1-5
Appendix1 Numerical System and Data Structure
Motion control module command is based on negative number system operation (Signed)
If the top level bit (MSB) is 0, it represents ‘positive number’ while if it is 1, it is expressed as ‘negative number’.
The top level bit expressing negative/positive is called ‘sign bit.’
Because of different position of MSB in 16 or 32 bits, be cautious of sign bit position.
If 16 bits
b16 b0
If 32 bits
b31 b16 b15 b0
A1-6
Appendix2 Flag and Parameter List
It displays the operation, stat and information of the Motion Control Module.
A2-1
Appendix2 Flag and Parameter List
A2-2
Appendix2 Flag and Parameter List
A2-3
Appendix2 Flag and Parameter List
A2-4
Appendix2 Flag and Parameter List
A2-5
Appendix2 Flag and Parameter List
A2-6
Appendix2 Flag and Parameter List
A2-7
Appendix2 Flag and Parameter List
A2-8
Warranty and Environmental Policy
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) Any trouble attributable to unreasonable condition, environment or handling otherwise specified in the manual,
(2) Any trouble attributable to others’ products,
(3) If the product is modified or repaired in any other place not designated by the company,
(4) Due to unintended purposes
(5) Owing to the reasons unexpected at the level of the contemporary science and technology when delivered.
(6) 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 ELECTRIC Co., Ltd supports and observes the environmental policy as below.
1
Warranty and Environment Policy
2
www.lselectric.co.kr
56, Samseong 4-gil, Mokcheon-eup, Dongnam-gu, Cheonan-si, Tel: 84-28-3823-7890 E-Mail: sjbaik@lselectric.biz (Hochiminh)