Mod_E - Mitsubishi Electric MELSEC FX Series Structured Programming Manual

Hide thumbs Also See for MELSEC FX Series:
Table of Contents

Advertisement

FXCPU Structured Programming Manual
(Application Functions)
5.3.5
MOD(_E)
Outline
This function performs division using two values (A / B = C ... remainder), and outputs the remainder.
1. Format
Function name
MOD

MOD_E

*1.
Output variable
*2.
Refer to the Cautions
2. Set data
Variable
EN
Input
_IN1 (
variable
_IN2 (
ENO
Output
variable
*1
In explanation of functions, I/O variables inside ( ) are described.
Explanation of function and operation
This function performs division (
specified in
s1
data stored in devices specified in
Example: When the data type is word [signed]
5
(Word
s1
[signed] data)
Cautions
1) Use the function having "_E" in its name to connect a bus.
2) When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different
from simple projects. Use labels when handling 32-bit data.
You can specify 32-bit counters directly, however, because they are 32-bit devices.
Use global labels when specifying labels.
3) Note that the "MOD" description method is different from other function description methods in the ST
language.
144
FX
3U(C)
Structured ladder
MOD
Label 1
_IN1
Label 2
_IN2
X000
MOD_E
EN
Label 1
_IN1
Label 2
_IN2
Execution condition
Data to be divided, or word device which stores such data
)
s1
Data for division (divisor), or word device which stores such data
)
s2
Execution status
Word device which will store the operation result
(
)
d
/
s1
s2
and
, and outputs the remainder to a device specified in
s2
s1
/
2
s2
(Word
[signed] data)
FX
3G
FX
2N(C)
FX
Expression in each language
_IN1 MOD _IN2; *2
Example:
*1
Label 3
Label 3:=
Label 1 MOD Label 2;
MOD_E(EN,_IN1,_IN2,Output
label; *2
ENO
Example:
MOD_E(X000,Label 1,
*1
Label 3
Label 2,Label 3);
Description
) using word [signed]/double word [signed] data stored in devices
and
.
s2
(Quotient)
(Remainder)
2
Not output
d
(Word
[signed] data)
5.3 Standard Arithmetic Functions
1N(C)
FX
1S
FX
U
/FX
2C
ST
Bit
ANY_INT
ANY_INT
Bit
ANY_INT
using the data type of
d
1
FX
0N
FX
0(S)
Data type

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Fx-kp-ok-e09r927

Table of Contents