Omron NY532-5400 Reference Manual page 139

Ny-series
Hide thumbs Also See for NY532-5400:
Table of Contents

Advertisement

• The value of Index after repeat processing is different in a ladder diagram and ST. In a ladder dia-
gram, the value of StepVal is not added to Index at the end of repeat processing. In ST, the value of
StepVal is added to Index at the end of repeat processing. Processing is repeated the same number
of times.
The following example is for when InitVal is 1, EndVal is 100 and StepVal is 1.
Ladder diagram: The value of Index will be 100 after 100 repetitions.
ST: The value of Index will be 101 after 100 repetitions.
• Caution is required when you specify upward or downward differentiation for a LD, AND, or OR
instruction in a FOR loop in a ladder diagram and an array is used for the LD, AND, or OR instruction.
For upward or downward differentiation, the value of the specified variable at the previous execution
is compared with the value of the specified variable at the current execution to determine upward or
downward differentiation. Normally, the value of the specified variable does not change every time
the instruction is executed. However, if an array is specified in a FOR loop, the array element
changes each time the instruction is executed. Therefore, upward or downward differentiation is
determined by comparing different array elements.
The following table shows the relationship between the values of x[i-1] and x[i], and the increment
processing for Count1[i].
Value of x[i-1]
TRUE
TRUE
FALSE
FALSE
Upward differentiation is detected by comparing x[i] to x[i−1].
• In the following programming, upward differentiation of x[i] is detected by the R_TRIG instruction. An
instance of the R_TRIG instruction is provided for each element of x[i], so it is possible to detect the
elements of x[i] for which there was upward differentiation. The following table shows the relationship
between the value of x[i] for the previous execution of R_TRIG_instance[i], the value of x[i] for the cur-
rent execution of R_TRIG_instance[i], and the increment processing of Count2[i].
Value of x[i] for previous
execution of R_TRIG_in-
stance[i]
TRUE
TRUE
FALSE
FALSE
NY-series Instructions Reference Manual (W560)
Value of x[i]
Increment processing for Count1[i]
TRUE
Not executed.
FALSE
Not executed.
TRUE
Executed.
FALSE
Not executed.
Value of x[i] for current
execution of R_TRIG_in-
stance[i]
TRUE
FALSE
TRUE
FALSE
2 Instruction Descriptions
FOR
EN
ENO
i
DINT#0
InitVal
Index
EndVal
DINT#10
StepVal
DINT#1
x[i]
Inc
EN
ENO
InOut
Count1[i]
NEXT
EN
ENO
Increment processing for
Count2[i]
Not executed.
Not executed.
Executed.
Not executed.
2
2-87

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents