Omron NJ501-1500 Reference Manual page 437

Machine automation controller nj-series
Hide thumbs Also See for NJ501-1500:
Table of Contents

Advertisement

Inputting Numbers Up to BufSize
Each time the instruction is executed, the value of In is stored in Buf[CurIndex]. The average of CurIn-
dex + 1 numbers that start from Buf[0] is calculated and stored in Out.
When the number of instruction executions reaches BufSize, the value of Q changes to TRUE.
Second Execution of Instruction
1
CurIndex=def
2345
In=abc
Third Execution of Instruction
CurIndex=def
2
In=abc
3456
Inputting Numbers after Reaching BufSize
Each time the instruction is executed, Buf[0] to Buf[BufSize
cyclic fashion. The average of Buf[0] to Buf[BufSize
The value of CurIndex returns to 1 after it reaches BufSize and it is then incremented again. The value
of Q remains TRUE.
Fourth Execution of Instruction
CurIndex=def
3
In=abc
4567
Fifth Execution of Instruction
CurIndex=def
1
In=abc
5678
NJ-series Instructions Reference Manual (W502)
Buf[0]=ghi[1]
1234
The value of In is stored in Buf[1].
Buf[1]=ghi[2]
2345
Buf[2]=ghi[3]
0
Average of Buf[0] and Buf[1]
Out=jkl
1789
Incremented
CurIndex=def
2
FALSE because the number of numbers
Q=mno
FALSE
stored has not reached BufSize.
Buf[0]=ghi[1]
1234
Buf[1]=ghi[2]
2345
Buf[2]=ghi[3]
3456
The value of In is stored in Buf[2].
2345
Average of Buf[0] to Buf[2]
Out=jkl
Incremented
3
CurIndex=def
TRUE because the number of
TRUE
Q=mno
numbers stored has reached BufSize.
1] is calculated and stored in Out.
Buf[0] is overwritten with the value of In.
Buf[0]=ghi[1]
4567
Buf[1]=ghi[2]
2345
Buf[2]=ghi[3]
3456
Average of Buf[0] to Buf[2]
3456
Out=jkl
Returns to 1.
1
CurIndex=def
TRUE because the number of
TRUE
Q=mno
numbers stored has reached BufSize.
Buf[0]=ghi[1]
4567
Buf[1] is overwritten with the value of In.
Buf[1]=ghi[2]
5678
Buf[2]=ghi[3]
3456
Out=jkl
Average of Buf[0] to Buf[2]
4567
CurIndex=def
Incremented
2
TRUE because the number of
Q=mno
TRUE
numbers stored has reached BufSize.
2 Instruction Descriptions
1] are overwritten with the value of In in
2
2-389

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Nj501-1300Nj501-1400

Table of Contents