554
LIMIT, LIMITP, DLIMIT, DLIMITP
DLIMIT
(1) The function controls the output value to be stored at the device designated by ( , +1) by checking whether the input
value (BIN 32 bits) designated by ( , +1) is within the range of upper and lower limit values specified by ( , +1)
and ( , +1) or not.
(2) The values designated by ( , +1), ( , +1), or ( , +1) are within the range of -2147483648 to 2147483647.
(3) To perform controls based only on the upper limit value, set the lower limit value designated by ( , +1) to
"-2147483648".
(4) To perform controls based only on the lower limit value, set the upper limit value designated by ( , +1) to
"2147483647".
Operat
i
on
E
rror
(1) In the following case, an operation error occurs, the error flag (SM0) turns ON, and an error code is stored into SD0.
Program
E
xamp
l
e
(1) The following program conducts limit controls from 500 to 5000 on the data set as BCD values from X20 to X2F, and
stores the result at D1 when X0 is turned ON.
[Ladder Mode]
[List Mode]
Error
code
Error details
Q00J/
Q00/
Q01
QnH
QnPH QnPRH
QnU
LCPU
4100
The lower limit value specified in is greater than the upper limit value
specified in .
––
––
––
––
D
D
S3
S3
S1
S1
S2
S2
I
nput
v
a
l
ue
L
o
w
er
li
m
i
t
v
a
l
ue
U
pper
li
m
i
t
v
a
l
ue
I
nput
v
a
l
ue
L
o
w
er
li
m
i
t
v
a
l
ue
I
nput
v
a
l
ue
U
pper
li
m
i
t
v
a
l
ue
I
nput
v
a
l
ue
Output
v
a
l
ue
Output
v
a
l
ue
U
pper
li
m
i
t
v
a
l
ue
L
o
w
er
li
m
i
t
v
a
l
ue
Output
v
a
l
ue
+
1
+
1
+
1
+
1
+
1
D
S1
S2
S3
D
S1
S2
S1
S3
S1
+
1
S1
S1
+
1
S3
S3
+
1
S3
S3
+
1
D
D
+
1
D
D
+
1
S2
S2
+
1
S2
S2
+
1
S3
S3
When
When
When
S1
Va
l
ue
des
i
gnated
by
+
1,
Va
l
ue
des
i
gnated
by
Output
v
a
l
ue
(
)
S3
+
1, S3
S2
+
1,
S2
Output
v
a
l
ue
(
)
D
+
1, D
S1
0
S1
S1
S2
S2
S3
S3
S1
S1
S2
S2
S1
S2
Step
I
nstruct
i
on
De
vi
ce