Omron CQM1H series Operation Manual page 111

Hide thumbs Also See for CQM1H series:
Table of Contents

Advertisement

Programming and Adjustment
Mean Value Processing
!
Caution
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.
00000
* "n" indicates the allocated word for analog input.
1. ANDW instruction
Hexadecimal (decimal)
FFFF (–0001)
to
F830 (–2000)
07D0 (2000)
to
0000 (0000)
Mean value processing is used to convert unstable input or shut out noise inter-
ference. 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.
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 to the
2. XORW instruction
Hexadecimal (decimal)
0FFF (–0001)
to
0830 (–2000)
07D0 (2000)
to
0000 (0000)
Section 3-3
ANDW(34)
#0FFF
n
DM 0200
XORW(36)
#0800
DM 0200
DM 0200
Hexadecimal (decimal)
0FD0 (4048)
to
0800 (2048)
07FF (2047)
to
0030 (0048)
91

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cqm1 series

Table of Contents