EasyManua.ls Logo

Omron CQM1 - Page 117

Omron CQM1
312 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
98
Programming and Adjustment Section 3-3
The XORW instruction is used to reverse Bit 12 of the stored value so that the
range of the value will be shifted.
Scaling is executed so that F830 to 07D0 (hexadecimal) will correspond to
0030 to 0FD0 (hexadecimal).
Use the SCL and SCL2 instructions to convert the range further.
Mean Value Processing Mean value processing is used to convert unstable input or shut out noise
interference. Either the mean value processing function of the Analog Input
Unit or the AVG instruction can be used.
In this section, mean value processing using the AVG instruction is explained.
Refer to 2-2 Functions for details on the mean value processing function of
the Analog Input Unit.
The AVG instruction makes it possible to average conversion data the number
of times specified by the user per scan.
!Caution The AVG instruction cannot handle 2’s complement. If the conversion data is
2’s complement (i.e., the Analog Input Unit is set to a range of –10 to 10 V),
use the AVG instruction with the following program.
When input 00000 turns ON, any conversion data (F830 to 07D0) in a range
of –10 to 10 V is converted into a positive value (0030 to 0FD0) by the ANDW
and XORW instructions. Then the mean value of the converted data is
obtained by the AVG instruction. Ten data values in BCD are stored in DM
0300 to obtain the mean value of the converted data. The mean value is
stored in DM 0000.
While input 00000 is ON, the mean value of the latest 10 data values is
always stored in DM 0000.
When the AVG instruction is used, the number of words equal to the number
of data values to obtain the mean value plus two words must be secured next
* "n" indicates the allocated word for analog input.
ANDW(34)
#0FFF
n
DM 0200
XORW(36)
#0800
DM 0200
DM 0200
00000
07D0 (2000)
to
0000 (0000)
07D0 (2000)
to
0000 (0000)
0FFF (–0001)
to
0830 (–2000)
0FD0 (4048)
to
0800 (2048)
07FF (2047)
to
0030 (0048)
1. ANDW instruction
Hexadecimal (decimal) Hexadecimal (decimal) Hexadecimal (decimal)
2. XORW instruction
FFFF (–0001)
to
F830 (–2000)

Table of Contents

Related product manuals