Program Example; Changing Of Input Characteristics - Mitsubishi Electric MELSEQ FX3S Series User Manual

Hide thumbs Also See for MELSEQ FX3S Series:
Table of Contents

Advertisement

FX
Series Programmable Controllers
3S
User's Manual - Hardware Edition

11.3.8 Program example

Create the following program to read out analog conversion (A/D conversion) data.
The following program will store the converted A/D value of channel-1 data into D100 and that of channel-2
data into D101.
Even if the input data is not stored into D100 or D101, the data registers D8270 or D8271 can be directly used
as timer/counter setting value or in a PID instruction.
M8000
FNC 12
Normally
ON
FNC 12
M8000
FNC 12
Normally
ON
FNC 12

11.3.9 Changing of input characteristics

The input characteristics can be changed using a sequence program in the PLC.
Example: Changing of input characteristics
This section describes an example of a program that can change the digital output range of 100 to 500 (when
the voltage input is 1 to 5 V) to digital output range of 0 to 10000.
1) Input characteristics
Voltage input characteristics
(product specifications)
1000
500
100
0
1 V
2) Example of program
For example, create the following program to change the digital input data:
M8000
Normally ON
M8000
Normally ON
FNC230
LD>=
M100
K5
D8274
MOV
K5
D8275
MOV
D100
D8270
MOV
D8271
D101
MOV
5 V
10 V
Analog input
FNC 12
MOV
FNC 12
MOV
FNC237
D110
K100
AND<=
FNC 21
SUB
FNC 22
MUL
FNC 23
DDIV
Sets the averaging time for channel-1
Sets the averaging time for channel-2
Stores the A/D converted
channel-1 digital data into D100.
Stores the A/D converted
channel-2 digital data into D101.
Digital output value to be changed
Y-axis
10000
0 100 (1 V) 500 (5 V)
Digital value actually obtained
by A/D conversion
K1
D8274
D8270
D110
D110
K500
M100
D110
K100
D111
D111
K10000
D112
D100
K400
D112
11 Use of Built-in Analog
11.3 Built-in analog input function
X-axis
Sets the averaging scaling to "1" for
the channel-1 data.
Check to make sure the digital value
(D110) is in range.
Calculation for changing input
characteristics.
Stores the operation result in D100.
11
12
13
14
15
16
17
A
B
C
105

Advertisement

Table of Contents
loading

Table of Contents