14 F2-4AD2DA 4-Ch. In / 2-Ch. Out Combination Analog

14 F2-4AD2DA 4-Ch. In / 2-Ch. Out Combination Analog
F2-4AD2DA
4-Ch. In / 2-Ch. Out
Combination Analog
In This Chapter. . . .
— Module Specifications
— Connecting the Field Wiring
— Module Operation
— Writing the Control Program
14
14--2
F2-4AD2DA 4-Ch. In / 2-Ch. Out Combination Analog
Module Specifications
F2-4AD2DA
4-Ch. In / 2-Ch. Out
The F2-4AD2DA Analog Input/Output
module provides several hardware
features:
S On-board 250 ohm, 1/2 watt
precision resistors provide
substantial over-current-protection
for 4--20mA current loops.
S Analog inputs and outputs are
optically isolated from the PLC
logic.
S The module has a removable
terminal block so the module can
be easily removed or changed
without disconnecting the wiring.
S With a DL240/250--1/260 CPU, you
can update all input and output
channels in one scan.
S On-board active analog filtering
and RISC-like microcontroller
provide digital signal processing to
maintain precision analog
measurements in noisy
environments.
S Low-power CMOS design requires
less than 80mA from an external
18--26.4 VDC power supply.
IN/
OUT
ANALOG
F2-4AD2DA
18 26.4 VDC
80 mA
ANALOG
4 IN / 2 OUT
4--20mA
0V
+24V
IN-IN
CH1+
CH2+
CH3+
CH4+
OUT--
OUT
CH1+
CH2+
F2--4AD2DA
The following tables provide the specifications for the F2-4AD2DA Analog
Input/Output Module. Review these specifications to make sure the module meets
your application requirements.
Input
Specifications
Number of Input Channels
4, single ended (one common)
Range
4 to 20 mA current
Resolution
12 bit (1 in 4096)
Input Impedance
250Ω, 0.1%, ½W, 25ppm/_C current input resistance
Maximum Continuous Overload
--40 to +40 mA, each current input
Input Stability
1 count
Crosstalk
--70 dB, 1 count maximum
Common Mode Rejection
--50 dB at 800 Hz
Active Low-Pass Filter
--3 dB at 50Hz, 2 poles (--12 dB per octave)
Step Response
10 mS to 95%
Full Scale Calibration Error
12 counts maximum, at 20 mA current input
Offset Calibration Error
8 counts maximum, at 4 mA current input
Maximum Input Inaccuracy
0.3% @ 25C (77F)
0.45% @ 0 to 60C (32 to 140F)
Recommended External Fuse
0.032A, series 217 fast-acting, current inputs
DL205 Analog Manual 7th Ed. Rev. B 4/10
F2-4AD2DA 4-Ch. In / 2-Ch. Out Combination Analog
Output
Specifications
General Module
Specifications
14--3
Number of Output Channels
2 single ended (one common)
2,
Range
4 to 20 mA current
Resolution
12 bit (1 in 4096)
Peak Withstanding Voltage
75 VDC,
VDC current outputs
External Load Resistance
0Ω minimum,
minimum current outputs
Loop Supply Voltage Range
18--30VDC, current outputs
Maximum Load / Power Supply
910Ω/24V 620Ω/18V,
910Ω/24V,
620Ω/18V 1200Ω/30V,
1200Ω/30V current outputs
Linearity Error (best fit)
1 count (0.025%
(0 025% of full scale) maximum
Settling Time
100 μs maximum (full scale change)
Maximum Inaccuracy
0.1% @ 25C (77F)
0.3% @ 0 to 60C (32 to 140F)
Full Scale Calibration Error
5 counts at 20 mA current output
Offset Calibration Error
3 counts at 4 mA current output
Digital
g
Input
p and Output
p Points Required
q
16 point
p
(X)
( ) inputs
p
16 point
i (Y) outputs
PLC Update
p
Rate
4 input
p channels p
per scan maximum ((D2--240/250--1/260 CPU))
2 output
t t channels
h
l per scan maximum
i
(D2(D2 -240/250240/250 -1/260
1/260 CPU)
1 input and 1 output channel per scan maximum (D2--230 CPU)
Power Budget Requirement
60 mA @ 5 VDC (supplied by base)
External Power Supply Requirement
18 to 26.4 VDC, 80 mA maximum plus 20 mA per loop output
Accuracy vs. Temperature
45 ppm/C full scale calibration range
(including maximum offset change)
Operating Temperature
0 to 60_ C (32 to 140 F)
Storage Temperature
--20 to 70_ C (--4 to 158 F)
5 to 95% (non-condensing)
Environmental Air
No corrosive gases permitted
Vibration
MIL STD 810C 514.2
Shock
MIL STD 810C 516.2
Noise Immunity
NEMA ICS3--304
One count in the specification table is equal to one least significant bit of the analog data value (1 in 4096).
Combination
Analog
Configuration
Requirements
The F2-4AD2DA Analog module requires 16 discrete input and 16 discrete output
points. The module can be installed in any slot of a DL205 system, except when you
use the DL230 programming method. The available power budget may also be a
limiting factor. Check the user manual for your particular model of CPU and I/O base
for more information regarding power budget and number of local, local expanison
or remote I/O points.
DL205 Analog Manual 7th Ed. Rev. B 4/10
F2-4AD2DA
4-Ch. In / 2-Ch. Out
Relative Humidity
14--4
F2-4AD2DA 4-Ch. In / 2-Ch. Out Combination Analog
Special
Placement
Requirements
(DL230 and
Remote I/O Bases)
Even though the module can be placed in any slot, it is important to examine the
configuration if you are using a DL230 CPU. As you can see in the section on writing
the program, you use V-memory locations to extract the analog data. If you place
the module so that either the input or output points do not start on a V-memory
boundary, the instructions cannot access the data. This also applies when the
module is placed in remote I/O bases (D2--RSSS in CPU slot).
F2-4AD2DA
Correct!
Slot 0
Slot 1
Slot 2
Slot 3
Slot 4
8pt
Input
8pt
Input
16pt
Output
16pt
In / Out
8pt
Output
X0
-X7
X10
-X17
Y0
-Y17
X20 Y20
--X37 Y37
V40500
V40400
Output Data is correctly entered so input and
output points start on a V-memory boundary.
V40501
MSB
LSB
Y
3
7
Y40
-Y47
V40502
V40401
MSB
LSB
X
3
7
Y
2
0
X
2
0
Incorrect
F2-4AD2DA
4-Ch. In / 2-Ch. Out
F2-4AD2DA
Slot 0
Slot 1
Slot 2
Slot 3
Slot 4
8pt
Input
8pt
Input
8pt
Output
16pt
In / Out
16pt
Output
X0
-X7
X10
-X17
Y0
-Y7
X20 Y10
--X37 Y27
Y30
-Y47
V40401
V40500
V40501
V40501
V40502
V40400
V40500
Output Data is split over two locations, so instructions cannot write data from a DL230.
MSB
Y
3
7
V40501
Y Y
3 2
0 7
DL205 Analog Manual 7th Ed. Rev. B 4/10
LSB
Y
2
0
MSB
Y
1
7
V40500
Y Y
1 7
0
LSB
Y
0
F2-4AD2DA 4-Ch. In / 2-Ch. Out Combination Analog
14--5
To use the V-memory references required for a DL230 CPU, the first input and
output addresses assigned to the module must be one of the following X and Y
locations. The table also shows the V-memory addresses that correspond to these
locations.
X
X0
X20
V
V40400 V40401 V40402 V40403 V40404 V40405 V40406 V40407
Y
Y0
V
V40500 V40501 V40502 V40503 V40504 V40505 V40506 V40507
Y20
X40
Y40
X60
Y60
X100
Y100
X120
Y120
X140
Y140
X160
Y160
Connecting the Field Wiring
Wiring Guidelines
S
Use shielded wiring and ground the shield at the signal source. Do not
ground the shield at both the module and the load or source.
S
Do not run the signal wiring next to large motors, high current switches,
or transformers. This may cause noise problems.
S
Route the wiring through an approved cable housing to minimize the
risk of accidental damage. Check local and national codes to choose
the correct method for your application.
The F2-4AD2DA requires at least one field-side power supply. You may use the
same or separate power sources for the module supply and loop supply. The
module requires 18--26.4VDC, at 80 mA. In addition, each current loop requires 20
mA (a total of 120 mA for six current loops). If you want to use a separate power
supply make sure that it meets these requirements.
The DL205 bases have built-in 24 VDC power supplies that provide up to 300mA of
current. You may use this instead of a separate supply if you are using only one
combination module. The current required is 80 mA (module) plus up to 120 mA (six
current loops) for a total of 200 mA.
It is desirable in some situations to power the loops separately in a location remote
from the PLC. This will work as long as the loop’s power supply meets the voltage
and current requirements, and its minus (--) side and the module supply’s minus (--)
side are connected together.
WARNING: If you are using the 24 VDC base power supply, make sure you
calculate the power budget. Exceeding the power budget can cause unpredictable
system operation that can lead to a risk of personal injury or damage to equipment.
DL205 Analog Manual 7th Ed. Rev. B 4/10
F2-4AD2DA
4-Ch. In / 2-Ch. Out
User Power
Supply
Requirements
Your company may have guidelines for wiring and cable installation. If so, you
should check those before you begin the installation. Here are some ideas to
consider:
S Use the shortest wiring route whenever possible.
14--6
F2-4AD2DA 4-Ch. In / 2-Ch. Out Combination Analog
The DL205 base has a switching type power supply. As a result of switching noise,
you may notice 3--5 counts of instability in the analog input data if you use the
base power supply. If this is unacceptable, you should try one of the following:
1. Use a separate linear power supply.
2. Connect the 24VDC common to the frame ground, which is the screw
terminal marked “G” on the base.
Current Loop
Transmitter
Impedance
By using these methods, the input stability is rated at 1 count.
Standard 4 to 20 mA transmitters and transducers can operate from a wide variety
of power supplies. Not all transmitters are alike and the manufacturers often specify
a minimum loop or load resistance that must be used with the transmitter.
The F2-4AD2DA provides 250 ohm resistance for each input channel. If your
transmitter requires a load resistance below 250 ohms, you do not have to make
any adjustments. However, if your transmitter requires a load resistance higher
than 250 ohms, you need to add a resistor in series with the module.
Consider the following example for a transmitter being operated from a 30 VDC
supply with a recommended load resistance of 750 ohms. Since the module has a
250 ohm resistor, you need to add an additional resistor.
Example:
R = Tr − Mr
R = 750 − 250
R ≥ 500
R -- resistor to add
Tr -- Transmitter total resistance requirement
Mr -- Module resistance (internal 250 ohms)
F2-4AD2DA
4-Ch. In / 2-Ch. Out
Two-wire Transmitter
+
-DC Supply
+30V
0V
Module Channel 1
R
IN1+
IN--
In the example, add a 500 ohm resistor
(R) in series with the module.
DL205 Analog Manual 7th Ed. Rev. B 4/10
250 ohms
F2-4AD2DA 4-Ch. In / 2-Ch. Out Combination Analog
14--7
Wiring Diagram The F2-04AD2DA module has a removable connector to make wiring easier. Simply
squeeze the top and bottom retaining clips and gently pull the connector from the
module. Use the following diagram to connect the field wiring. The diagram shows
separate module and loop power supplies. If you desire to use only one field-side
supply, just combine the supplies’ positive (+) terminals into one node, and remove the
loop supply.
Note 1: Shields should be connected at their respective signal source.
Note 2: Unused channels should remain open (no connections) for minimum power consumption.
Note 3: More than one external power supply can be used provided all the power supply commons are
connected together.
Note 4: A series 217, 0.032A, fast-acting fuse is recommended for 4--20 mA current input loops.
Note 5: If the power supply common of an external power supply is not connected to 0V on the module, then
the output of the external transmitter must be isolated. To avoid “ground loop” errors, recommended 4--20mA
transmitter types are:
a. For 2 or 3 wire: Isolation between input signal and power supply.
b. For 4 wire: Isolation between input signal, power supply, and 4--20 mA output.
Note 6: If an analog channel is connected backwards, then incorrect data values will be returned for that
channel. Input signals in the -4 to +4 mA range return a zero value. Signals in the -4 to -40 mA range return a
non-zero value.
Note 7: To avoid small errors due to terminal block losses, connect 0V, IN-- and OUT-- on the terminal block as
shown. The module’s internal connection of these nodes is not sufficient to permit module performance up to
the accuracy specifications.
Note 8: Choose a output transducer resistance according to the maximum load / power supply listed in the
Output Specifications table.
Typical User Wiring
Module Supply
18-26.4VDC
See Note 1
--
+
Internal
Module
Wiring
--
IN/
OUT
+
+24 VDC
IN--
--
CH2
3--wire
+
4--20mA
Transmitter
-CH3
2-wire
+
4--20mA
Transmitter
-CH4
2-wire
+
4--20mA
Transmitter
DC to DC
Converter
+
0 VDC
+5V
+15V
0V
--15V
F2-4AD2DA
IN1+
IN2+
Fuse
250 ohms
IN3+
Fuse
250 ohms
IN4+
Fuse
IN--
250 ohms
OUT1+
IN
D to A
Converter
OUT2+
Ch 1
Current sinking
Ch 1 load
0--910 ohms
(@ 24V)
D to A
Converter
Ch 2
Current sinking
Ch 2 load
0--910 ohms
(@ 24V)
-+
See Note 8
See Note 1
0V
+24V
250 ohms
OUT--
Fuse
A to D
Converter
18 26.4 VDC
80 mA
ANALOG
4 IN / 2 OUT
4--20mA
CH1+
CH2+
CH3+
CH4+
OUT--
OUTCH1+
CH2+
F2--4AD2DA
18--30 VDC
Supply
0V
Loop Supply
DL205 Analog Manual 7th Ed. Rev. B 4/10
F2-4AD2DA
4-Ch. In / 2-Ch. Out
-CH1
4--wire
+
4--20mA
Transmitter
ANALOG
14--8
F2-4AD2DA 4-Ch. In / 2-Ch. Out Combination Analog
Module Operation
Input Channel
Scanning
Sequence for
a DL230 CPU
(Multiplexing)
Before you begin writing the control program, it is important to take a few minutes to
understand how the module processes and represents the analog signals.
The F2-4AD2DA module can supply different amounts of data per scan, depending
on the type of CPU you are using. The DL230 can obtain one channel of input data
per CPU scan. Since there are four channels, it can take up to four scans to get data
for all channels. Once all channels have been scanned the process starts over with
channel 1. Unused channels are not processed, so if you select only two channels,
then each channel will be updated every other scan.
Scan
System With
DL230 CPU
Read Inputs
Execute Application Program
Read the data
Store data
Scan N
Channel 1
Scan N+1
Channel 2
Scan N+2
Channel 3
Scan N+3
Channel 4
Scan N+4
Channel 1
F2-4AD2DA
4-Ch. In / 2-Ch. Out
Write to Outputs
Input Channel
Scanning
Sequence for a
DL240, DL250--1
or DL260 CPU
(Pointer Method)
If you are using a DL240, DL250--1 or DL260 CPU, you can obtain all four channels
of input data in one scan. This is because the DL240/250--1/260 CPU supports
special V-memory locations that are used to manage the data transfer. This is
discussed in more detail in the section on Writing the Control Program.
Scan
System With
DL240/250--1/260
CPU
Read Inputs
Execute Application Program
Read the data
Store data
Write to Outputs
DL205 Analog Manual 7th Ed. Rev. B 4/10
Scan N
Ch1, 2, 3, 4
Scan N+1
Ch 1, 2, 3, 4
Scan N+2
Ch1, 2, 3, 4
Scan N+3
Ch 1, 2, 3, 4
Scan N+4
Ch 1, 2, 3, 4
F2-4AD2DA 4-Ch. In / 2-Ch. Out Combination Analog
Output Channel
Update
Sequence for a
DL230 CPU
(Multiplexing)
14--9
If you are using a DL230 CPU, you can send one channel of data to the output
module on each scan. Since there are two channels, it can take two scans to
update both channels. However, if you are only using one channel, then you can
update that channel on every scan.
Scan
System With
DL230 CPU
Read inputs
Execute Application Program
Calculate the data
Write data
Scan N
Channel 1
Scan N+1
Channel 2
Scan N+2
Channel 1
Scan N+3
Channel 2
Scan N+4
Channel 1
Write to outputs
If you are using a DL240, DL250--1 or DL260 CPU, you can update both channels
on every scan. This is because the DL240/250--1/260 CPU supports special
V-memory locations that are used to manage the data transfer. This is discussed in
more detail in the section on Writing the Control Program.
System With
DL240/250--1/260
CPU
Scan
Read inputs
Execute Application Program
Calculate the data
Write data
Scan N
Channel 1,2
Scan N+1
Channel 1,2
Scan N+2
Channel 1,2
Scan N+3
Channel 1,2
Scan N+4
Channel 1,2
Write to outputs
DL205 Analog Manual 7th Ed. Rev. B 4/10
F2-4AD2DA
4-Ch. In / 2-Ch. Out
Output Channel
Update
Sequence for a
DL240, DL250--1
or DL260 CPU
(Pointer Method)
14--10
F2-4AD2DA 4-Ch. In / 2-Ch. Out Combination Analog
Understanding
the I/O
Assignments
You may recall the F2-4AD2DA module appears to the CPU as 16 discrete input
and 16 discrete output points. These points provide the data value and channel
identification. Note, if you are using a DL240/250 CPU, you may never have to use
these bits, but it may help you understand the data format.
Since all output points are automatically mapped into V-memory, it is very easy to
determine the location of the data words that will be assigned to the module.
F2-4AD2DA
Slot 0
Slot 1
Slot 2
Slot 3
Slot 4
8pt
Input
8pt
Input
16pt
Output
16pt
In / Out
8pt
Output
X0
-X7
X10
-X17
Y0
-Y17
X20 Y20
--X37 Y37
V40500
V40400
MSB
Not Used
F2-4AD2DA
4-Ch. In / 2-Ch. Out
Input Data Bits
YY
3 3
5 4
V40501
Output Data Bits
LSB
Y
2
0
MSB
X XXX
3 3 3 3
7 6 5 4
Y40
-Y47
V40502
V40401
Input Data Bits
LSB
X
2
0
Within this word location, the individual bits represent specific information about the
analog signal.
The first twelve bits of the input word
represent the analog data in binary
V40401
format.
MSB
LSB
Bit
Value
Bit
Value
1 1 1 1 11 9 8 7 6 5 4 3 2 1 0
0
1
6
64
5 4 3 2 10
1
2
7
128
2
4
8
256
= data bits
3
8
9
512
4
16
10
1024
5
32
11
2048
DL205 Analog Manual 7th Ed. Rev. B 4/10
14--11
F2-4AD2DA 4-Ch. In / 2-Ch. Out Combination Analog
Active Channel
Indicator Inputs
Diagnostic
Indicator Inputs
Two of the inputs are binary encoded to
indicate the active input channel.
Remember, the V-memory bits are
mapped directly to discrete inputs. The
module automatically turns on and off
these inputs to indicate the active input
channel for each scan.
Scan
X35 X34
Channel
N
Off
Off
1
N+1
Off
On
2
N+2
On
Off
3
N+3
On
On
4
N+4
Off
Off
1
The last two inputs are used for module
diagnostics.
Module Busy — The first diagnostic
input (X36 in this example) indicates a
“busy” condition. This input will always
be active on the first PLC scan to tell the
CPU the analog data is not valid. After
the first scan, the input usually only
comes
on
when
environmental
(electrical) noise problems are present.
The programming examples in the next
section will show how you can use this
input. The wiring guidelines presented
earlier in this chapter provide steps that
can help reduce noise problems.
V40401
MSB
LSB
X X
3 3
5 4
X
2
0
= channel inputs
V40401
MSB
LSB
X X
3 3
7 6
X
2
0
= diagnostic inputs
Note: When using the pointer
method, the value placed into the
V-memory location will be 8000
instead of the bit being set.
Output Data Bits
The first twelve bits of the output word
represent the analog data in binary
format.
Bit
Value
Bit
Value
0
1
6
64
1
2
7
128
2
4
8
256
3
8
9
512
4
16
10
1024
5
32
11
2048
V40501
MSB
LSB
11 9 8 7 6 5 4 3 2 1 0
10
= data bits
DL205 Analog Manual 7th Ed. Rev. B 4/10
F2-4AD2DA
4-Ch. In / 2-Ch. Out
Module Failure — The last diagnostic input (X37 in this example) indicates that the
analog module is not operating. For example, if the 24 VDC input power is missing,
or if the terminal block is loose, then the module will turn on this input point. The
module will also return a data value of zero to further indicate there is a problem.
This input point cannot detect which individual channel is at fault. If the cause of the
failure goes away, the module turns this bit off.
14--12
F2-4AD2DA 4-Ch. In / 2-Ch. Out Combination Analog
Output
Channel
Selection Bits
Module
Resolution
Two of the outputs select the active
channel. Remember, the V-memory bits
are mapped directly to discrete outputs.
Turning a bit OFF selects its channel. By
controlling these outputs, you can select
which channel(s) gets updated.
Y35
Y34 Channel
On
Off
1
Off
On
2
Off
Off
1 & 2 (same data to
both channels)
On
On
None (both channels
hold current values)
Since the module has 12-bit resolution,
the analog signal is converted into 4096
counts ranging from 0 -- 4095 (212). For
example, a 4mA signal would be 0, and a
20mA signal would be 4095. This is
equivalent to a binary value of 0000
0000 0000 to 1111 1111 1111, or 000 to
FFF hexadecimal. The diagram shows
how this relates to the signal range.
F2-4AD2DA
4-Ch. In / 2-Ch. Out
Each count can also be expressed in
terms of the signal level by using the
equation shown.
DL205 Analog Manual 7th Ed. Rev. B 4/10
V40501
MSB
LSB
Y Y
3 3
5 4
Y
2
0
= channel control outputs
4 -- 20mA
20mA
4mA
0
4095
Resolution = H − L
4095
H = high limit of the signal range
L = low limit of the signal range
16mA / 4095 = 3.907A per count
F2-4AD2DA 4-Ch. In / 2-Ch. Out Combination Analog
14--13
Writing the Control Program
Before you begin writing the program, there are a few supplemental examples that
can be extremely beneficial. They include:
Analog Input
Power Failure
Detection
S
Input power failure detection
S
Output data calculation
S
Input data scaling
Take a close look at these examples. They may be helpful for your application.
The analog module has a microcontroller that can diagnose analog input circuit
problems. You can easily create a simple ladder rung to detect these problems.
This rung shows an input point that would be assigned if the module was used as
shown in the previous and following examples.
Multiplexing method
V-memory location V2000 holds
V2000
K0
X37
C1
=
OUT
Pointers method
V2000
K8000
C1
=
Calculating the
Output Data
OUT
V-memory location V2000 holds
channel 1 data. When a data value
of 8000 is returned, then the analog
channel is not operating properly.
A = U 4095
H−L
A = Analog value (0 -- 4095)
U = Engineering units
H = high limit of the engineering
unit range
L = low limit of the engineering
unit range
Consider the following example which controls pressure from 0.0 to 99.9 PSI. By
using the formula, you can easily determine the digital value that should be sent to
the module. The example shows the conversion required to yield 49.4 PSI. Notice
the formula uses a multiplier of 10. This is because the decimal portion of 49.4
cannot be loaded, so you adjust the formula to compensate for it.
A = 10U
4095
10(H − L)
A = 494
4095
1000 − 0
A = 2023
DL205 Analog Manual 7th Ed. Rev. B 4/10
F2-4AD2DA
4-Ch. In / 2-Ch. Out
Your program has to calculate the digital
value to send to the analog output
channels. There are many ways to do
this, but most applications are
understood more easily if you use
measurements in engineering units.
This is accomplished by using the
conversion formula shown.
You may have to make adjustments to
the formula depending on the scale you
choose for the engineering units.
channel 1 data. When a data value
of zero is returned and input X37 is
on, then the analog channel is not
operating properly.
14--14
F2-4AD2DA 4-Ch. In / 2-Ch. Out Combination Analog
The example program below shows how you would write the program to perform
the engineering unit conversion. This example will work with all CPUs and assumes
that you have calculated or loaded the engineering unit values and stored them in
V2300 and V2301 for channels 1 and 2 respectively. Also, we move the final values
to V2004 and V2005, which are memory locations that are used in the following
examples. You can use any user V locations, but they must match the locations that
are specified as the source for the output data (see the next section for an
example).
NOTE: The DL205 offers instructions that allow you to perform math operations
using BCD format. It is usually easier to perform any math calculations in BCD.
SP1
LD
V2300
MUL
K4095
DIV
K1000
F2-4AD2DA
4-Ch. In / 2-Ch. Out
OUT
V2004
SP1
LD
V2301
MUL
K4095
DIV
K1000
OUT
V2005
DL205 Analog Manual 7th Ed. Rev. B 4/10
The LD instruction loads the engineering units used with channel 1 into
the accumulator. This example assumes the numbers are BCD. Since
SP1 is used, this rung automatically executes on every scan. You could
also use an X, C, etc. permissive contact.
Multiply the accumulator by 4095 (to start the conversion).
Divide the accumulator by 1000 (because we used a multiplier of 10,
we have to use 1000 instead of 100).
Store the BCD result in V2004 (the actual steps required to send the
data are shown later).
The LD instruction loads the engineering units used with channel 2 into
the accumulator. This example assumes the numbers are BCD. Since
SP1 is used, this rung automatically executes on every scan. You could
also use an X, C, etc. permissive contact.
Multiply the accumulator by 4095 (to start the conversion).
Divide the accumulator by 1000 (because we used a multiplier of 10,
we have to use 1000 instead of 100).
Store the BCD result in V2005 (the actual steps required to send the
data are shown later).
F2-4AD2DA 4-Ch. In / 2-Ch. Out Combination Analog
Scaling the
Input Data
Most applications usually require
measurements in engineering units,
which provide more meaningful data.
This is accomplished by using the
conversion formula shown.
You may have to make adjustments to
the formula depending on the scale you
choose for the engineering units.
14--15
Units = A H − L
4095
H = High limit of the engineering
unit range
L = Low limit of the engineering
unit range
A = Analog value (0 -- 4095)
For example, if you wanted to measure pressure (PSI) from 0.0 to 99.9, you would
have to multiply the analog value by 10 in order to imply a decimal place when you
view the value with the programming software or a handheld programmer. Notice
how the calculations differ when you use the multiplier.
Analog Value of 2024, slightly less than half scale, should yield 49.4 PSI
Example without multiplier
Example with multiplier
Units = A H − L
4095
Units = 10 A H − L
4095
Units = 2024 100 − 0
4095
Units = 20240 100 − 0
4095
Units = 49
Units = 494
Handheld Display
Handheld Display
V 2001 V 2000
0000 0049
V 2001 V 2000
0000 0494
This value is more accurate
Note, this example uses SP1, which is always on. You
could also use an X, C, etc. permissive contact.
SP1
LD
V2000
Load channel 1 data to the accumulator.
MUL
K1000
Multiply the accumulator by 1000 (to start the conversion).
DIV
K4095
Divide the accumulator by 4095.
OUT
V2010
Store the result in V2010.
DL205 Analog Manual 7th Ed. Rev. B 4/10
F2-4AD2DA
4-Ch. In / 2-Ch. Out
The example program below shows how you would write the program to perform
the engineering unit conversion. This example assumes you have BCD data
loaded into the appropriate V-memory locations using instructions that apply for the
model of CPU you are using.
14--16
F2-4AD2DA 4-Ch. In / 2-Ch. Out Combination Analog
Read / Write
Program
(Pointer Method)

230
 

240 250-- 1 260
The DL240, DL250--1 and DL260 CPUs have special V-memory locations
assigned to each base slot that greatly simplify the programming requirements.
These V-memory locations:
S specify the number of input and output channels to scan.
S
specify the storage location for the input data.
S
specify the source location for the output data.
NOTE: To use the pointer method, DL250 CPUs must have firmware revision 1.09
or later, and F2-AD2DA modules must be revision C1 or later.
The example program shows how to setup these locations. Place this rung
anywhere in the ladder program, or in the initial stage if you are using stage
programming instructions. This is all that is required to read the input data into
V-memory locations. The CPU automatically converts the binary input data to BCD
format. Once the input data is in V-memory, you can perform math on the data,
compare the data against preset values, and so forth. For the output data, you have
to calculate the digital value in BCD (as shown previously) before you send the data
to the module, unless you select the binary data format option shown below.
V2000 and V2004 are used as the beginning of the data areas in the example, but
you can use any user V-memory locations. Also, in the previous examples the
module was installed in slot 3. You should use the V-memory locations for your
application. The pointer method automatically converts values to BCD.
SP0
LD
K 0402
- or -
LD
K 8482
F2-4AD2DA
4-Ch. In / 2-Ch. Out
Loads a constant that specifies the number of channels to scan
and the data format. The upper byte, most significant nibble
(MSN) selects the data format (0=BCD, 8=Binary), the LSN
selects the number of input channels (1, 2, 3, or 4). The lower
byte, most significant nibble (MSN) selects the data format
(0=BCD, 8=Binary), the LSN selects the number of output
channels (1, 2).
The binary format is used for displaying data on some operator
interfaces. The DL230/240 CPUs do not support binary math
functions, whereas the DL250 does.
OUT
V7663
Special V-memory location assigned to slot 3 that contains the
number of input and output channels.
LDA
O2000
This constant designates the first V-memory location that will be
used to store the input data. For example, the O2000 entered here
would mean:
Ch1 -- V2000, Ch 2 -- V2001, Ch 3 -- V2002, Ch 4 -- V2003
OUT
V7673
The constant O2000 is stored here. V7673 is assigned to slot 3 and
acts as a pointer, which means the CPU will use the value in this
location to determine exactly where to store the incoming data.
LDA
O2004
This constant designates the first V-memory location that will be
used to obtain the analog output data. For example, the O2004
entered here would mean: Ch1 -- V2004, Ch 2 -- V2005.
OUT
V7703
The constant O2004 is stored here. V7703 is assigned to slot 3 and
acts as a pointer, which means the CPU will use the value in this
location to determine exactly where to obtain the output data.
DL205 Analog Manual 7th Ed. Rev. B 4/10
F2-4AD2DA 4-Ch. In / 2-Ch. Out Combination Analog
14--17
The tables below show the special V-memory locations used by the DL240,
DL250--1 and DL260 for the CPU base and local expansion base I/O slots. Slot 0
(zero) is the module next to the CPU or D2--CM module. Slot 1 is the module two
places from the CPU or D2--CM, and so on. Remember, the CPU only examines the
pointer values at these locations after a mode transition. Also, if you use the DL230
(multiplexing) method, verify that these addresses in the CPU are zero.
The Table below applies to the DL240, DL250--1 and DL260 CPU base.
CPU Base: Analog In/Out Module Slot-Dependent V-memory Locations
Slot
0
1
2
3
4
5
6
7
No. of Channels
V7660 V7661 V7662 V7663 V7664 V7665 V7666 V7667
Input Pointer
V7670 V7671 V7672 V7673 V7674 V7675 V7676 V7677
Output Pointer
V7700 V7701 V7702 V7703 V7704 V7705 V7706 V7707
The Table below applies to the DL250--1 or DL260 expansion base 1.
Expansion Base D2--CM #1: Analog In/Out Module Slot-Dependent V-memory Locations
Slot
0
1
2
3
4
5
6
7
No. of Channels
V36000 V36001 V36002 V36003 V36004 V36005 V36006 V36007
Input Pointer
V36010 V36011 V36012 V36013 V36014 V36015 V36016 V36017
Output Pointer
V36020 V36021 V36022 V36023 V36024 V36025 V36026 V36027
The Table below applies to the DL250--1 or DL260 expansion base 2.
Expansion Base D2--CM #2: Analog In/Out Module Slot-Dependent V-memory Locations
Slot
0
1
2
3
4
5
6
7
V36100 V36101 V36102 V36103 V36104 V36105 V36106 V36107
Input Pointer
V36110 V36111 V36112 V36113 V36114 V36115 V36116 V36117
Output Pointer
V36120 V36121 V36122 V36123 V36124 V36125 V36126 V36127
The Table below applies to the DL260 CPU expansion base 3.
Expansion Base D2--CM #3: Analog In/Out Module Slot-Dependent V-memory Locations
Slot
0
1
2
3
4
5
6
7
No. of Channels
V36200 V36201 V36202 V36203 V36204 V36205 V36206 V36207
Input Pointer
V36210 V36211 V36212 V36213 V36214 V36215 V36216 V36217
Output Pointer
V36220 V36221 V36222 V36223 V36224 V36225 V36226 V36227
The Table below applies to the DL260 CPU expansion base 4.
Expansion Base D2--CM #4: Analog In/Out Module Slot-Dependent V-memory Locations
Slot
0
1
2
3
4
5
6
7
No. of Channels
V36300 V36301 V36302 V36303 V36304 V36305 V36306 V36307
Input Pointer
V36310 V36311 V36312 V36313 V36314 V36315 V36316 V36317
Output Pointer
V36320 V36321 V36322 V36323 V36324 V36325 V36326 V36327
DL205 Analog Manual 7th Ed. Rev. B 4/10
F2-4AD2DA
4-Ch. In / 2-Ch. Out
No. of Channels
14--18
F2-4AD2DA 4-Ch. In / 2-Ch. Out Combination Analog
Reading Input
Values
(Multiplexing)

230
 

240 250-- 1 260
The DL230 CPU does not have the special V-memory locations that allow you to
automatically enable the data transfer. Since all channels are multiplexed into a
single data word, the control program must be setup to determine which channel is
being read. Since the module appears as X input points to the CPU, it is very easy to
use the active channel status bits to determine which channel is being monitored.
Note, this example is for a module installed as shown in the previous examples. The
addresses used would be different if the module was installed in another I/O
arrangement. You can place these rungs anywhere in the program or if you are
using stage programming, place them in a stage that is always active.
Load data when module is not busy.
X36
LD
V40401
ANDD
KFFF
Store Channel 1
X36
X34
X35
Store Channel 2
X36
X34
X35
F2-4AD2DA
4-Ch. In / 2-Ch. Out
Store Channel 3
X36
X34
X35
Store Channel 4
X36
X34
X35
DL205 Analog Manual 7th Ed. Rev. B 4/10
Loads the complete data word into the accumulator.
The V-memory location depends on the I/O
configuration. See Appendix A for the memory map.
This instruction masks the channel identification bits.
Without this, the values used will not be correct so do
not forget to include it.
BCD
It is usually easier to perform math operations in
BCD, You can leave out this instruction if your
application does not require it.
OUT
V2000
When the module is not busy and X36, X34 and X35
are off, channel 1 data is stored in V2000.
OUT
V2001
When the module is not busy and X34 is on and X35
and X36 are off, channel 2 data is stored in V2001.
OUT
V2002
OUT
V2003
When the module is not busy and X34 and X36 are
off and X35 is on, channel 3 data is stored in V2002.
When the module is not busy and both X34 and X35 are
on and X36 is off, channel 4 data is stored in V2003.
F2-4AD2DA 4-Ch. In / 2-Ch. Out Combination Analog
Single Input
Channel
Selected
(Multiplexing)
Since you do not have to determine which channel is selected, the single channel
program is even simpler.
Store channel 1 when module is not busy.
X36
X34
X35
LD
V40401
Loads the complete data word into the accumulator.
The V-memory location depends on the I/O
configuration. See Appendix A for the memory map.
This instruction masks the channel identification
bits. Without this, the values used will not be
correct so do not forget to include it.
ANDD
KFFF
Writing Output
Values
(Multiplexing)
14--19
BCD
It is usually easier to perform math operations in
BCD. You can leave out this instruction if your
application does not require it.
OUT
V2000
When the module is not busy and X34 and X35 are
off, channel 1 data is stored in V2000.
The DL230 CPU does not have the special V-memory locations that allow you to
automatically enable the data transfer. Since all channels are multiplexed into a
single data word, the control program must be setup to determine which channel to
write. Since the module appears as Y output points to the CPU, it is very easy to use
the channel selection outputs to determine which channel to update.
Note, this example is for a module installed as shown in the previous examples. The
addresses used would be different if the module was used in a different I/O
arrangement. You can place these rungs anywhere in the program or if you are
using stage programming, place them in a stage that is always active.
This example is a two-channel multiplexer that updates each channel on alternate
scans. SP7 is a special relay that is on for one scan, then off for one scan.
NOTE: You must send binary data to the module. If the data is already in binary
format, you should not use the BIN instruction shown in this example.
SP7
Loads the data for channel 1 into the accumulator.
LD
V2001
Loads the data for channel 2 into the accumulator.
Send data to V-memory assigned to the module.
SP1
Convert the data to binary (you must omit this step if
BIN
you have converted the data elsewhere).
SP1 is always on.
The OUT instruction sends the data to the module. Our
example starts with V40501, but the actual value
depends on the location of the module in your
application.
OUT
V40501
Select the channel to update.
SP7
Y34
OUT
SP7
Y35
OUT
Selects channel 1 for update when Y34 is OFF
(Y35--ON deselects channel 2). Note, Y34 and Y35 are
used due to the previous examples. If the module was
installed in a different I/O arrangement, the addresses
would be different.
Selects channel 2 for update when Y35 is OFF
(Y34--ON deselects channel 1). Note, Y34 and Y35 are
used due to the previous examples. If the module was
installed in a different I/O arrangement, addresses
would be different.
DL205 Analog Manual 7th Ed. Rev. B 4/10
F2-4AD2DA
4-Ch. In / 2-Ch. Out
Load data into the accumulator.
SP7
LD
V2000
14--20
F2-4AD2DA 4-Ch. In / 2-Ch. Out Combination Analog
Sending Data to
One Channel
(Multiplexing)
If you are not using both channels, or if you want to control the updates separately,
use the following program.
SP1
LD
V2000
The LD instruction loads the data into the
accumulator. Since SP1 is used, this rung
automatically executes on every scan. You could
also use an X, C, etc. permissive contact.
BIN
The BIN instruction converts the accumulator data
to binary (you must omit this step if you have
already converted the data elsewhere).
ANDD
K0FFF
The ANDD instruction masks off the channel select
bits to prevent an accidental channel selection.
OUT
V40501
The OUT instruction sends the data to the
module. Our example starts with V40501, but the
actual value depends on the location of the
module in your application.
Y34
RST
Y35
OUT
F2-4AD2DA
4-Ch. In / 2-Ch. Out
Sending the Same
Data to Both
Channels
(Multiplexing)
Y34--OFF selects channel 1 for updating.
Y35--ON deselects channel 2 (do not update).
If both channel selection outputs are off, both channels will be updated with the
same data.
SP1
LD
V2000
The LD instruction loads the data into the
accumulator. Since SP1 is used, this rung
automatically executes on every scan. You could
also use an X, C, etc. permissive contact.
BIN
The BIN instruction converts the accumulator data
to binary (you must omit this step if you have
already converted the data elsewhere).
ANDD
K0FFF
The ANDD instruction masks off the channel select
bits to prevent an accidental channel selection.
OUT
V40501
The OUT instruction sends the data to the
module. Our example starts with V40501, but the
actual value depends on the location of the
module in your application.
Y34
RST
Y34--OFF selects channel 1 for updating.
Y35
RST
Analog and
Digital Value
Conversions
Y35--OFF selects channel 2 for updating.
Sometimes it is useful to be able to quickly convert between the signal levels and
the digital values. This is especially helpful during machine startup or
troubleshooting. The table provides formulas to make this conversion easier.
Range
If you know the digital value ...
4 to 20mA
A = 16D + 4
4095
For example, if you have measured the
signal at 10mA, you could use the formula
to easily determine the digital value (D)
that should be stored in the V-memory
location that contains the data.
DL205 Analog Manual 7th Ed. Rev. B 4/10
If you know the analog signal level ...
D = 4095 (A − 4)
16
D = 4095 (A − 4)
16
4095
D=
(10mA − 4)
16
D = (255.93) (6)
D = 1536
F2-4AD2DA 4-Ch. In / 2-Ch. Out Combination Analog
Filtering Input
Noise (DL250--1,
DL260 CPUs Only)

230
 

240 250-- 1 260
14--21
Add the following logic to filter and smooth analog input noise in DL250--1 or DL260
CPUs. This is especially useful when using PID loops. Noise can be generated by
the field device and/or induced by field wiring.
The analog value in BCD is first converted to a binary number because there is not a
BCD-to-real conversion instruction. Memory location V1400 is the designated
workspace in this example. The MULR instruction is the filter factor, which can be
from 0.1 to 0.9. The example uses 0.2. A smaller filter factor increases filtering. You
can use a higher precision value, but it is not generally needed. The filtered value is
then converted back to binary and then to BCD. The filtered value is stored in
location V1402 for use in your application or PID loop.
NOTE: Be careful not to do a multiple number conversion on a value. For example,
if you are using the pointer method to get the analog value, it is in BCD and must be
converted to binary. However, if you are using the conventional method of reading
analog and are masking the first twelve bits, then it is already in binary and no
conversion using the BIN instruction is needed.
SP1
LD
V2000
BIN
BTOR
Loads the analog signal, which is a BCD value
and has been loaded from V-memory location
V2000, into the accumulator. Contact SP1 is
always on.
Converts the BCD value in the accumulator to
binary. Remember, this instruction is not
needed if the analog value is originally
brought in as a binary number.
Converts the binary value in the accumulator
to a real number.
Subtracts the real number stored in location
V1400 from the real number in the accumulator,
and stores the result in the accumulator. V1400
is the designated workspace in this example.
MULR
R0.2
Multiplies the real number in the
accumulator by 0.2 (the filter factor),
and stores the result in the
accumulator. This is the filtered value.
ADDR
V1400
Adds the real number stored in
location V1400 to the real number
filtered value in the accumulator, and
stores the result in the accumulator.
OUTD
V1400
RTOB
BCD
OUT
V1402
Copies the value in the accumulator to
location V1400.
Converts the real number in the
accumulator to a binary value, and
stores the result in the accumulator.
Converts the binary value in the accumulator
to a BCD number. Note: The BCD instruction
is not needed for PID loop PV (loop PV is a
binary number).
Loads the BCD number filtered value from
the accumulator into location V1402 to use in
your application or PID loop.
DL205 Analog Manual 7th Ed. Rev. B 4/10
F2-4AD2DA
4-Ch. In / 2-Ch. Out
SUBR
V1400
Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertisement