Mitsubishi Electronics Mitsubishi Digital Electronics Home Theater Server MELSEC-F ユーザーズマニュアル

ページ / 504
B-53
7 Examples of Practical Programs
7.1 Program That Uses Averaging Time
A
Comm
on I
te
ms
B
FX
3U
-4AD
FX
3UC
-4
A
D
C
FX
3U
-4A
D
-A
D
P
D
FX
3G
-2A
D
-BD
E
FX
3U
-4DA
F
FX
3U
-4D
A
-AD
P
G
FX
3G
-1D
A
-BD
H
FX
3U
-3
A-
ADP
I
FX
3U
-4
A
D
-P
T
       
         
   -
A
D
P
J
FX
3U
-4A
D
-P
TW
     
        
      -
A
D
P
FX
3G
/FX
3U
/FX
3UC
 PLC User's Manual - Analog Control Edition
FX
3U
-4AD/FX
3UC
-4AD (4-channel Analog Input)
7. Examples of Practical Programs
Use the functions incorporated in the 4AD to create practical programs. This chapter describes the examples
of practical programs.
• Program that uses the averaging time
• Program that uses convenient functions
• Program that uses the data history function
• Program that initializes 4AD (to the factory default status)
7.1
Program That Uses Averaging Time
This section describes a program that uses the analog data averaging time input to the 4AD or the digital filter
function of the 4AD.
1. Conditions
The sequence program described in this section is created under the following conditions.
1) System configuration
The FX
3U
-4AD (unit No.0) should be connected to the FX
3U
 Series PLC.
2) Input mode
Channels 1 and 2 should be set to mode 0 (voltage input, -10V to +10V 
→ -32000 to +32000).
Channels 3 and 4 should be set to mode 3 (current input, 4mA to 20mA 
→ 0 to 16000).
3) Averaging time
For channels 1 to 4, the averaging time should be set to "10".
4) Digital filter function
For channels 1 to 4, the digital filter function should be disabled (default).
5) Device assignment
2. Example of sequence program
• For  FX
3U
, FX
3UC
 Series PLCs
*1.
After setting the input mode, set the data writing time (waiting time) to 5 seconds or more for each
setting.
The specified input mode will be retained even if power failure occurs. After specifying the input mode,
if the same input mode is used, it is not necessary to set the input mode and waiting time (T0 K50).
*2.
To use the default value set for the digital filter function, it is not necessary to set the digital filter
function in the sequence program.
Device
Description
D0
A/D converted digital value for channel 1
D1
A/D converted digital value for channel 2
D2
A/D converted digital value for channel 3
D3
A/D converted digital value for channel 4
M8002
  FNC 12
  MOV
H3300
U0\G0
P
M8000
K50
T0
*1
T0
  FNC 16
  FMOV
K10
U0\G2
K4
P
Input modes of channels 1
to 4 will be specified.
For channels 1 and 2, the averaging time
will be set to "10".
Initial pulse
  FNC 16
  FMOV
K0
U0\G6
K4
P
The digital filter function of channels 1
and 2 will be disabled.
  FNC 15
  BMOV
U0\G10
D0
K4
RUN monitor
*2
The digital values set for channels
1 to 4 will be read out to D0 to D3.
*1