265
2.2 Function Tables
2.2.1 Type conversion functions
2-3
2
FUNCTION TABLES
2.2
Function Tables
2.2.1
Type conversion functions
Function name
Argument
Processing details
Page
BOOL_TO_INT(_E)
,
Converts bit type data into word (signed) or double word (signed) type
data.
5-2
BOOL_TO_DINT(_E)
,
BOOL_TO_STR(_E)
,
Converts bit type data into string type data.
5-5
BOOL_TO_WORD(_E)
,
Converts bit type data into word (unsigned)/16-bit string or double
word (unsigned)/32-bit string type date.
5-7
BOOL_TO_DWORD(_E)
,
BOOL_TO_TIME(_E)
,
Converts bit type data into time type data.
5-10
INT_TO_DINT(_E)
,
Converts word (signed) type data into double word (signed) type data.
5-12
DINT_TO_INT(_E)
,
Converts double word (signed) type data into word (signed) type data.
5-14
INT_TO_BOOL(_E)
,
Converts word (signed) or double word (signed) type data into bit type
data.
5-16
DINT_TO_BOOL(_E)
,
INT_TO_REAL(_E)
,
Converts word (signed) or double word (signed) type data into single-
precision real type data.
5-19
DINT_TO_REAL(_E)
,
INT_TO_LREAL(_E)
,
Converts word (signed) or double word (signed) type data into double-
precision real type data.
5-22
DINT_TO_LREAL(_E)
,
INT_TO_STR(_E)
,
Converts word (signed) or double word (signed) type data into string
type data.
5-25
DINT_TO_STR(_E)
,
INT_TO_WORD(_E)
,
Converts word (signed) or double word (signed) type data into word
(unsigned)/16-bit string type data.
5-29
DINT_TO_WORD(_E)
,
INT_TO_DWORD(_E)
,
Converts word (signed) or double word (signed) type data into double
word (unsigned)/32-bit string type data.
5-32
DINT_TO_DWORD(_E)
,
INT_TO_BCD(_E)
,
Converts word (signed) or double word (signed) type data into BCD
type data.
5-35
DINT_TO_BCD(_E)
,
INT_TO_TIME(_E)
,
Converts word (signed) or double word (signed) type data into time
type data.
5-38
DINT_TO_TIME(_E)
,
REAL_TO_INT(_E)
,
Converts single-precision real type data into word (signed) or double
word (signed) type data.
5-41
REAL_TO_DINT(_E)
,
LREAL_TO_INT(_E)
,
Converts double-precision real type data into word (signed) or double
word (signed) type data.
5-44
LREAL_TO_DINT(_E)
,
REAL_TO_LREAL(_E)
,
Converts single-precision real type data into double-precision real
type data.
5-47
LREAL_TO_REAL(_E)
,
Converts double-precision real type data into single-precision real
type data.
5-50
REAL_TO_STR(_E)
,
Converts single-precision real type data into string type (exponential
form) data.
5-53
WORD_TO_BOOL(_E)
,
Converts word (unsigned)/16-bit string or double word (unsigned)/32-
bit string type data into bit type data.
5-57
DWORD_TO_BOOL(_E)
,
WORD_TO_INT(_E)
,
Converts word (unsigned)/16-bit string type data into word (signed) or
double word (signed) type data.
5-60
WORD_TO_DINT(_E)
,
DWORD_TO_INT(_E)
,
Converts double word (unsigned)/32-bit string type data into word
(signed) or double word (signed) type data.
5-63
DWORD_TO_DINT(_E)
,
WORD_TO_DWORD(_E)
,
Converts word (unsigned)/16-bit string type data into double word
(unsigned)/32-bit string type data.
5-66
DWORD_TO_WORD(_E)
,
Converts double word (unsigned)/32-bit string type data into word
(unsigned)/16-bit string type data.
5-69
WORD_TO_STR(_E)
,
Converts word (unsigned)/16-bit string or double word (unsigned)/32-
bit string type data into string type data.
5-72
DWORD_TO_STR(_E)
,
WORD_TO_TIME(_E)
,
Converts word (unsigned)/16-bit string or double word (unsigned)/32-
bit string type data into time type data.
5-75
DWORD_TO_TIME(_E)
,
STR_TO_BOOL(_E)
,
Converts string type data into bit type data.
5-78
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
163
2-4
2.2 Function Tables
2.2.1 Type conversion functions
STR_TO_INT(_E)
,
Converts string type data into word (signed) or double word (signed)
type data.
5-81
STR_TO_DINT(_E)
,
STR_TO_REAL(_E)
,
Converts string type data into single-precision real type data.
5-84
STR_TO_WORD(_E)
,
Converts string type data into word (unsigned)/16-bit string or double
word (unsigned)/32-bit string type data.
5-88
STR_TO_DWORD(_E)
,
STR_TO_TIME(_E)
,
Converts string type data into time type data.
5-92
STR_TO_BCD(_E)
,
Converts string type data into BCD type data.
5-95
BCD_TO_INT(_E)
,
Converts BCD type data into word (signed) or double word (signed)
type data.
5-100
BCD_TO_DINT(_E)
,
BCD_TO_STR(_E)
,
Converts BCD type data into string type data.
5-104
TIME_TO_BOOL(_E)
,
Converts time type data into bit type data.
5-107
TIME_TO_INT(_E)
,
Converts time type data into word (signed) or double word (signed)
type data.
5-109
TIME_TO_DINT(_E)
,
TIME_TO_STR(_E)
,
Converts time type data into string type data.
5-112
TIME_TO_WORD(_E)
,
Converts time type data into word (unsigned)/16-bit string or double
word (unsigned)/32-bit string type data.
5-114
TIME_TO_DWORD(_E)
,
BITARR_TO_INT(_E)
, n,
Converts specified number of bits from bit array into word (signed)
type, word (unsigned)/16-bit string type, double word (signed) type, or
double word (unsigned)/32-bit string type data.
5-117
BITARR_TO_DINT(_E)
, n,
INT_TO_BITARR(_E)
, n,
Outputs low-order n bits of word (signed) type, word (unsigned)/16-bit
string type, double word (signed) type, or double word (unsigned)/32-
bit string type data.
5-119
DINT_TO_BITARR(_E)
, n,
CPY_BITARR(_E)
, n,
Copies specified number of bits from bit array.
5-121
GET_BIT_OF_INT(_E)
, n,
Reads a value of specified bit of word (signed) type data.
5-123
SET_BIT_OF_INT(_E)
, n,
Writes a value to the specified bit of word (signed) type data.
5-125
CPY_BIT_OF_INT(_E)
, n1, n2,
Copies a specified bit of word (signed) type data to the specified bit of
another word (signed) type data.
5-127
GET_BOOL_ADDR
,
Converts the type of data into bit type.
5-129
GET_INT_ADDR
,
Converts the type of data into word (signed) type.
GET_WORD_ADDR
,
Converts the type of data to word (unsigned)/16-bit string type.
Function name
Argument
Processing details
Page
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
s
d
184
2.2 Function Tables
2.2.2 Standard functions of one numeric variable
2-5
2
FUNCTION TABLES
2.2.2
Standard functions of one numeric variable
2.2.3
Standard arithmetic functions
2.2.4
Standard bitwise Boolean functions
2.2.5
Standard selection functions
Function name
Argument
Processing details
Page
ABS(_E)
,
Outputs the absolute value of an input value.
5-131
Function name
Argument
Processing details
Page
ADD_E
, ,... ,
(Number of pins
variable)
Outputs the sum ( +
+···+ ) of input values.
5-135
MUL_E
, ,... ,
(Number of pins
variable)
Outputs the product (
···
) of input values.
5-138
SUB_E
, ,
Outputs the difference ( ) between input values.
5-141
DIV_E
, ,
Outputs the quotient ( ) of input values.
5-144
MOD(_E)
, ,
Outputs the remainder after division of input values (
).
5-147
EXPT(_E)
, ,
Outputs the exponentiation of an input value.
5-150
MOVE(_E)
,
Moves the input value to .
5-153
Function name
Argument
Processing details
Page
AND_E
, ,... ,
(Number of pins
variable)
Outputs the Boolean AND of input values.
5-157
OR_E
, ,... ,
(Number of pins
variable)
Outputs the Boolean OR of input values.
XOR_E
, ,... ,
(Number of pins
variable)
Outputs the Boolean exclusive OR of input values.
NOT(_E)
,
Outputs the Boolean NOT of input values.
Function name
Argument
Processing details
Page
SEL(_E)
, , ,
Outputs the value selected from the input values.
5-162
MAXIMUM(_E)
, ,... ,
(Number of pins
variable)
Outputs the maximum value of the input values.
5-165
MINIMUM(_E)
, ,... ,
(Number of pins
variable)
Outputs the minimum value of the input values.
LIMITATION(_E)
, , ,
Outputs the input value controlled by the upper and lower limit control.
5-168
MUX(_E)
n, , ,... ,
(Number of pins
variable)
Outputs one of the multiple input values.
5-171
s
d
s1
s2
s28
d
s1
s2
s28
s1
s2
s28
d
s1
s2
s28
s1
s2
d
s1
s2
s1
s2
d
s1
s2
s1
s2
d
s1
s2
s1
s2
d
s
d
d
s1
s2
s28
d
s1
s2
s28
d
s1
s2
s28
d
s
d
s1
s2
s3
d
s1
s2
s28
d
s1
s2
s28
d
s1
s2
s3
d
s1
s2
s28
d
167
2-6
2.2 Function Tables
2.2.6 Standard comparison functions
2.2.6
Standard comparison functions
2.2.7
Standard character string functions
2.2.8
Functions of time data types
2.2.9
Standard bistable function blocks
Function name
Argument
Processing details
Page
GT_E
, ,... ,
(Number of pins
variable)
Outputs the comparison value of an input value.
5-174
GE_E
, ,... ,
(Number of pins
variable)
EQ_E
, ,... ,
(Number of pins
variable)
LE_E
, ,... ,
(Number of pins
variable)
LT_E
, ,... ,
(Number of pins
variable)
NE_E
, ,
Function name
Argument
Processing details
Page
MID(_E)
, n1, n2,
Outputs the specified number of characters, extracted from the
specified start position in the input character string.
5-178
CONCAT(_E)
, ,
Concatenates the character strings and outputs the operation result.
5-181
INSERT(_E)
, , n,
(Number of pins
variable)
Inserts a character string between other character strings and outputs
the operation result.
5-184
DELETE(_E)
, n1, n2,
Deletes the specified range in a character string and outputs the
operation result.
5-187
REPLACE(_E)
, , n1, n2,
Replaces the specified range in a character string with the specified
character string and outputs the operation result.
5-190
Function name
Argument
Processing details
Page
ADD_TIME(_E)
, ,
Outputs the sum ( +
) of the input values (time type).
5-193
SUB_TIME(_E)
, ,
Outputs the difference ( - ) of input values (time type).
5-196
MUL_TIME(_E)
, ,
Outputs the product (
) of input values (time type).
5-199
DIV_TIME(_E)
, ,
Outputs the quotient ( ) of input values (time type).
5-202
Function name
Argument
Processing details
Page
SR(_E)
, ,
Discriminates two input values and outputs 1 (TRUE) or 0 (FALSE).
(Set-dominant)
5-204
RS(_E)
, ,
Discriminates two input values and outputs 1 (TRUE) or 0 (FALSE).
(Reset-dominant)
5-207
s1
s2
s28
d
s1
s2
s28
d
s1
s2
s28
d
s1
s2
s28
d
s1
s2
s28
d
s1
s2
d
s
d
s1
s2
d
s1
s2
d
s
d
s1
s2
d
s1
s2
d
s1
s2
s1
s2
d
s1
s2
s1
s2
d
s1
s2
s1
s2
d
s1
s2
s1
s2
d
s1
s2
d
121
2.2 Function Tables
2.2.10 Standard edge detection function blocks
2-7
2
FUNCTION TABLES
2.2.10
Standard edge detection function blocks
2.2.11
Standard counter function blocks
2.2.12
Standard timer function blocks
The function and function block of the application functions execute the operation
with the combination of multiple sequence instructions. Therefore, if the interrupt
occurs in the application function operations, unintended operation results may
occur.
For using an interrupt program, use Disable interrupt/ Enable interrupt (DI/EI
instruction) as necessary.
Function name
Argument
Processing details
Page
R_TRIG(_E)
,
Detects the rising edge of a signal and outputs pulse signals.
5-210
F_TRIG(_E)
,
Detects the falling edge of a signal and outputs pulse signals.
5-213
Function name
Argument
Processing details
Page
CTU(_E)
, , n, ,
Counts the number of times that the signal turns ON.
5-215
CTD(_E)
, , n, ,
Counts down the number of times that the signal turns ON.
5-218
CTUD(_E)
, , ,
n, , ,
Counts/counts down the number of times that the signal turns ON.
5-221
COUNTER_FB_M
, , , ,
Counts the number of times that the signal turns ON from to .
5-225
Function name
Argument
Processing details
Page
TP(_E)
TP_HIGH(_E)
, n, ,
Holds the signal ON for the specified time.
5-227
TON(_E)
TON_HIGH(_E)
, n, ,
Turns ON the signal after the specified time.
5-230
TOF(_E)
TOF_HIGH(_E)
, n, ,
Turns OFF the signal after the specified time.
5-233
TIMER_10_FB_M
TIMER_100_FB_M
TIMER_HIGH_FB_M
TIMER_LOW_FB_M
TIMER_CONT_FB_M
TIMER_CONTHFB_M
, , , ,
Turns ON the signal after the specified time counted from input value
to .
5-236
s
d
s
d
s1
s2
d1
d2
s1
s2
d1
d2
s1
s2
s3
s4
d1
d2
d3
s1
s2
s3
d1
d2
s3
s2
s
d1
d2
s
d1
d2
s
d1
d2
s1
s2
s3
d1
d2
s3
s2
190
2-8
2.3 Operator Tables
2.3.1 Arithmetic operations
2.3
Operator Tables
2.3.1
Arithmetic operations
2.3.2
Logical operations
2.3.3
Comparison operations
Operator name
Argument
Processing details
Page
Structured ladder/FBD
ST
ADD
+
, ,... ,
(Number of pins
variable)
Outputs the sum ( + +···+
) of input values.
6-2
MUL
*
, ,... ,
(Number of pins
variable)
Outputs the product (
···
) of input values.
6-4
SUB
-
, ,
Outputs the difference (
) between input values.
6-6
DIV
/
, ,
Outputs the quotient ( ) of input values.
6-8
(Not supported)
MOD
, ,
Outputs the remainder after division of input values ( ).
6-10
(Not supported)
**
, ,
Outputs the exponentiation of an input value.
6-11
Operator name
Argument
Processing details
Page
Structured ladder/FBD
ST
AND
&
AND
, ,... ,
(Number of pins
variable)
Outputs the Boolean AND of input values.
6-13
OR
OR
, ,... ,
(Number of pins
variable)
Outputs the Boolean OR of input values.
XOR
XOR
, ,... ,
(Number of pins
variable)
Outputs the Boolean exclusive OR of input values.
(Not supported)
NOT
,
Outputs the Boolean NOT of input values.
Operator name
Argument
Processing details
Page
Structured ladder/FBD
ST
GT
>
, ,... ,
(Number of pins
variable)
Outputs the comparison value of an input value.
6-16
GE
>=
, ,... ,
(Number of pins
variable)
EQ
=
, ,... ,
(Number of pins
variable)
LE
<=
, ,... ,
(Number of pins
variable)
LT
<
, ,... ,
(Number of pins
variable)
NE
<>
, ,
s1
s2
s28
d
s1
s2
s28
s1
s2
s28
d
s1
s2
s28
s1
s2
d
s1
s2
s1
s2
d
s1
s2
s1
s2
d
s1
s2
s1
s2
d
s1
s2
s28
d
s1
s2
s28
d
s1
s2
s28
d
s
d
s1
s2
s28
d
s1
s2
s28
d
s1
s2
s28
d
s1
s2
s28
d
s1
s2
s28
d
s1
s2
d
22
1
OVERVIEW
2
FUNCTION TABLES
3
CONFIGURATION
OF FUNCTIONS
4
HOW TO READ
FUNCTIONS
5
APPLICATION
FUNCTIONS
6
OPERATOR
I
INDEX
3
3-1
CONFIGURATION OF FUNCTIONS
3.1 Configuration of Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2
3.2 Input Pins Variable Function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3
41
3-2
3.1 Configuration of Functions
3.1
Configuration of Functions
Instructions available in the CPU module can be divided into a function name and an argument.
The application of a function name and an argument are as follows:
• Function name ....... Indicates the function.
• Argument .............. Indicates the I/O data used in the function.
Arguments are classified into source data, destination data, executing condition, and execution
result.
(1) Source
(a) A source is data used in an operation.
(b) The following source types are available depending on the device specified in a
function:
• Constant . . . . . . . . . . . . . . . . . . . . .Specifies a numeric value used in an operation.
Constants are set during programming so that
they cannot be changed while the program is
being executed.
Perform index modification when using them as
variable data.
• Bit device and word device . . . . . . .Specifies the device in which the data used in
the operation are stored.
Data must be stored to the specified device
before executing the operation.
By changing the data to be stored to the
specified device while a program is being
executed, the data used in the function can be
changed.
(c) Contacts cannot be input directly to sources that use bit devices.
(2) Destination
(a) Data after the operation are stored to a destination.
(b) Set a device in which data are to be stored to a destination.
(c) Coils cannot be directly connected to destinations that store bit devices.
(3) Executing condition (EN)
(a) An input variable EN inputs an executing condition of a function.
(4) Execution result (ENO)
(a) An output variable ENO outputs an execution result.
For details of the configuration of functions for labels and structures, refer to
MELSEC-Q/L/F Structured Programming Manual (Fundamentals).
s
d
14
3.2 Input Pins Variable Function
3-3
3
CONFIGURATION
OF FUNCTIONS
3.2
Input Pins Variable Function
Some functions allow the number of input pins to be changed.
To change the number of input pins, select the target function and change the number.
For the number of input pins change operation
GX Works2 Version 1 Operating Manual
(Structured Project)
Adding a pin
Deleting a pin
Documents you may be interested
Documents you may be interested