Writing the Control Program .................................................................................. 3-15
Page 2
Chapter 3: F2-04AD-2 , F2-04AD-2L, 4-Channel Analog Voltage Input
V
C
C
C
C
0V
C
C
CH3–C
F2-0
2
IN
1
C 5mA
A
O
G
0
0
10VDC
+/
C
OG
A
4C
Module Specifications
F2-04AD-2
The F2-04AD-2 analog Input module provides several
hardware features.
• Analog inputs are optically isolated
from the PLC logic.
• The module has a removable terminal block
so the module can be easily removed or
changed without disconnecting the wiring.
• With a D2-240, D2-250-1, D2-260 and D2-262
CPU, all four channels can be read in one scan.
• On-board active analog filtering and
microcontroller provide digital signal
processing to maintain precision analog
measurements in noisy environments..
INANALOG
F2-04AD-2
4AD-
10-30VDC
0-30VD
5mA
0V
+24V
+24
H1–
CH1–
H1+
CH1+
CH2–
H2–
CH2+
H2+
CH3–
CH3+
H3+
H4–
CH4–
H4+
CH4+
NAL
IN
ANALOG IN
-5,
0-5, 0 - 10VDC
-5, +/-10VD
+/-5, +/-10VDC
NAL
4CH
H
3-2
F2-04AD-2L is Obsolete
F2-04AD-2
NOTE: In 2009 the F2-04AD-2L was discontinued. A re-designed F2-04AD-2 was released at the same time which
can be powered by either 12VDC or 24VDC input power supplies. This new module is a direct replacement for prior
F2-04AD-2 and all F2-04AD-2L modules. The new module is a single circuit board design and the jumper link locations
are different. See Setting the Module Jumpers on page 3-5. Also, some specifications were changed on page 3-3.
Otherwise, the re-designed module functions the same as the prior designs.
Analog Input Configuration Requirements
The F2-04AD-2 analog input module requires 16 discrete input points and can be installed
in any slot of a DL205 system. The available power budget and discrete I/O points are the
limiting factors. For more information regarding power budget and number of local, local
expansion or remote I/O points, check the user manual for the particular CPU model and I/O
base being used.
DL205 Analog I/O Manual, 7th Edition, Rev. G
Page 3
Chapter 3: F2-04AD-2, F2-04AD-2L, 4-Channel Analog Voltage Input
All specifications are the same for both modules except for the input voltage requirements.
Review these specifications to make sure the module meets your application requirements.
Input Specifications
Number of Channels
Input Range
Resolution
Common Mode Rejection
Step Response
Crosstalk
Active Low-pass Filtering
Input Impedance
Absolute Maximum Ratings
Converter Type
Linearity Error (End to End)
Input Stability
Full Scale Calibration Error
(Offset error included)
Offset Calibration Error
Maximum Inaccuracy
Accuracy vs. Temperature
4, single ended (one common)
0–5 VDC, 0–10 VDC, ±5V, ±10V
12 bit (1 in 4096) unipolar (0–4096)
13 bit (1 in 8192) bipolar (-4095 to +4095)
- 50db at 800Hz
8.2 ms (*10ms) to 95% of full step change
-70db, 1 count maximum
-3 db at 80Hz, 2 poles (-12db per octave)
Greater than 20MΩ
±75VDC
Successive approximation
± 1 count (0.025% of span) maximum unipolar
± 2 counts maximum bipolar
± 1 count
± 3 counts maximum
± 1 count maximum (0V input)
± 0.1% @ 25°C (77°F)
± 0.3% 0–60°C (32–140°F)
± 50ppm / °C full scale calibration change (including maximum
offset change of 2 counts)
General Specifications
PLC Update Rate
Digital Inputs
Input points required
Power Budget Requirement
External Power Supply
Operating Temperature
Storage Temperature
Relative Humidity
Environmental Air
Vibration
Shock
Noise Immunity
NOTE: Values in parenthesis with an asterisk are for older modules with two circuit board design and date codes 0609F4
and previous. Values not in parenthesis are for single circuit board models with date code 0709G and above.
1 channel per scan maximum (D2-230 CPU)
4 channels per scan maximum (D2-240/D2-250-1/D2-260/D2-262 CPU)
12 binary data bits, 2 channel ID bits, 1 sign/diagnostic bit,
1 diagnostic bit
16 point (X) input module
110mA (*60mA maximum, 5VDC (supplied by base)
F2-04AD-2: 5mA, 10–30 VDC (*90mA max, 18–26.4 VDC)
F2-04AD-2L: *90mA max, 10–15 VDC
0°C to 60°C (32°F to 140°F)
-20°C to 70°C (-4°F to 158°F)
5–95% (non-condensing)
No corrosive gases permitted
MIL STD 810C 514.2
MIL STD 810C 516.2
NEMA ICS3-304
DL205 Analog I/O Manual, 7th Edition, Rev. G
3-3
Page 4
Chapter 3: F2-04AD-2 , F2-04AD-2L, 4-Channel Analog Voltage Input
F2-04AD-2
7
0
7
0
7
0
Special Placement Requirements (D2-230 and Remote I/O Bases)
Even though the module can be placed in any slot, it is important to examine the configuration
if a D2-230 CPU is used, as can be seen in the section about Writing the Program, located in
this chapter. V-memory locations are used to extract the analog data. If the module is placed so
the input points do not start on a V-memory boundary, the instructions cannot access the data.
This also applies when placing this module in a remote base using a D2-RSSS in the CPU slot.
Correct
Data is correctly entered so input
points start on a V-memory boundary.
Incorrect
Slot 0 Slot 1 Slot 2 Slot 3 Slot 4
8pt
8pt
Input
Input
X10
X0
-
X17
X7
V40400
MSB
X
3
7
F2-04AD-2
Slot 0Slot 1Slot 2Slot 3Slot 4
8pt
Input
X0
X7
16pt
Input
X10
X27
16pt
Input
X20
X37
V40401
16pt
Input
X30
X47
16pt
Input
X40
X57
V40402
16pt
Input
X50
X67
16pt
Output
Y0
Y17
V40500
LSB
16pt
Output
Y0
Y17
X
2
0
Data is split over two locations, so instructions cannot access data from a D2-230.
MSB
V40401
LSB
MSB
V40400
LSB
3-4
X
3
X
X
2
3
X
X
2
1
X
X
1
7
X
0
To use the V-memory references required for a D2-230 CPU, the first input address assigned
to the module must be one of the following X locations. The table also shows the V-memory
addresses that correspond to these X locations.
Chapter 3: F2-04AD-2, F2-04AD-2L, 4-Channel Analog Voltage Input
Setting the Module Jumpers
Selecting the Number of Channels
There are two jumpers, labeled +1 and +2, that are used to select the number of channels that
will be used. Use the figures below to locate the jumpers on the module. The module is set from
the factory for four channel operation.
The unused channels are not processed, so if only channels 1 through 3 are selected, then
channel 4 will not be active. The following table shows how to place the jumpers to select the
number of channels.
No. of Channels +1 +2
1 No No
1, 2 Yes No
1, 2, 3 No Yes
1, 2, 3, 4 Yes Yes
Yes = jumper installed
No = jumper removed
Jumper location on modules having
Date Code 0609F4 and previous
(two circuit board design)
+1+2
Jumper +1
These jumpers are located on the
motherboard, the one with the black
D-shell style backplane connector.
For example, to select all 4 channels
(1 - 4), leave both jumpers installed. To
select channel 1, remove both jumpers
Jumper location on modules having
Date Code 0709G and above
(single circuit board design)
Use jumpers
+1 and +2 to
select number
of channels.
+1
+2
DL205 Analog I/O Manual, 7th Edition, Rev. G
3-5
Page 6
Chapter 3: F2-04AD-2 , F2-04AD-2L, 4-Channel Analog Voltage Input
Jumper
Selecting the Input Signal Range
There is another jumper, labeled either J2 or J3 that is used to select between the 5V ranges
and the 10V ranges (depending whether it is a single or double circuit board module). See the
figures below to locate the jumper on the module being used. The module comes from the
factory set for 10V operation (jumper not installed).
Note: Install jumper J2 or J3 for 0–5 V or ±5V operation.
Remove J2 or J3, or store on a single pin, for 0–10 V or ±10V operation.
Jumper J2 location on modules having
Date Code 0609F4 and previous
(two circuit board design)
J2
Jumper J2 is located on the smaller
circuit board, which is on top of the
motherboard.
Install J2 for 0–5 V or W5V operation.
Remove J2, or store on a single pin, for
0–10 V or W10V operation.
Jumper J3 location on modules having
Date Code 0709G and above
(single circuit board design)
J3
Install J3 for 0–5 V or W5V
operation. Remove J3, or store on
a single pin, for 0–10 V or W10V
operation.
3-6
DL205 Analog I/O Manual, 7th Edition, Rev. G
Page 7
Chapter 3: F2-04AD-2, F2-04AD-2L, 4-Channel Analog Voltage Input
Connecting the Field Wiring
Wiring Guidelines
Your company may have guidelines for wiring and cable installation. If so, check them before
starting the installation. Here are some general things to consider:
• Use the shortest wiring route whenever possible.
• Use shielded wiring and ground the shield at the transmitter source.
Do not ground the shield at both the module and the source.
• Do not run the signal wiring next to large motors, high current
switches, or transformers. This may cause noise problems.
• 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.
User Power Supply Requirements
The F2-04AD-2 module requires at least one field-side power supply. The same or separate
power sources can be used for the module supply and the voltage transmitter supply. The
module requires 10–30 VDC, at 5mA, from the external power supply.
The DL205 AC bases have a built-in 24VDC power supply that provide up to 300mA of
current. This can be used instead of a separate supply. Check the power budget to be safe.
It is desirable in some situations to power the transmitters separately in a location remote
from the PLC. This will work as long as the transmitter supply meets the voltage and current
requirements, and the transmitter’s minus (-) side and the module supply’s minus (-) side are
connected together.
WARNING: If the 24VDC base power supply is used, Be sure to 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.
The DL205 base has a switching type power supply. As a result of switching noise, W3–5
counts of instability may be noticed in the analog input data if this power supply is used. If this
is unacceptable, try using 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 on the screw terminal marked “G” on the base.
By using these methods, the input stability is rated at W1 count.
DL205 Analog I/O Manual, 7th Edition, Rev. G
3-7
Page 8
Chapter 3: F2-04AD-2 , F2-04AD-2L, 4-Channel Analog Voltage Input
50 mA
Custom Input Ranges
At times, there may be a need to connect a (current) transmitter with an unusual signal range.
By changing the wiring slightly and adding an external resistor to convert the current to voltage,
the module can be easily adapted to meet the specifications for a transmitter that does not
adhere to one of the standard input ranges. The following diagram shows how this can be done.
The example below only shows channel 1, but the other channels can be used as well.
Moduleinternal circuitry
0V
24 V
CH1
CH2
CH3
+
--
Fieldwiring
Current
Transmitter
0 V
24 V
IN +
IN --
R
Converter
+5 V
DC to DC
+15 V
0 V
-- 15 V
Analog Switch
AtoD
Converter
R =
I
V
,
max
max
O V
CH4
R = value of external resistor
V
= high limit of selected voltage range (5V or 10V)
max
I
= maximum current supplied by the transmitter
max
Example: current transmitter capable of 50mA, 0–10 V range selected.
10V
R =
R = 200q
50mA
NOTE: The choice of resistor can affect the accuracy of the module. A resistor that has ± 0.1% tolerance and
a ± 50 ppm / °C temperature coefficient is recommended.
If a 4–20 mA signal is used and converted to voltage using this method, a broken transmitter
condition can easily be detected. For example, if using the 0–5V range and the lowest signal
for the 4–20 mA transmitter is 4mA, the lowest digital value for the signal is not 0, but instead
is 819.
If the transmitter is working properly, the smallest value would be 819 in the DL205. If the
value is less than about 750 (allowing for tolerance), then the transmitter is broken.
3-8
DL205 Analog I/O Manual, 7th Edition, Rev. G
Page 9
Chapter 3: F2-04AD-2, F2-04AD-2L, 4-Channel Analog Voltage Input
Wiring Diagram
The module has a removable connector to simplify wiring the module. Just squeeze the top
and bottom retaining clips and gently pull the connector from the module. Use the following
diagram to connect the field wiring
Retaining clip
18-26.4VDC
+-
0VDC
+24VDC
CH1 -
CH1 +
CH2 -
CH2 +
CH3 -
CH3 +
CH4 -
CH4 +
See NOTE 1
-
CH1
Voltage
Transmitter
CH2
Voltage
Transmitter
CH3
Voltage
Transmitter
CH4
Voltage
Transmitter
+
+
+
+
Typical User Wiring
-
+
-
+
-
+
-
+
NOTE: Shields should be grounded at the signal source.
0V
Internal
Module
Wiring
24V
CH1
CH2
CH3
CH4
0V
DC to DC
Converter
Analog Switch
+15V
-15V
A to D
Converter
+5V
0V
INANALOG
F2-04AD-2
10-30VDC 5mA
0V
+24V
CH1–
CH1+
CH2–
CH2+
CH3–
CH3+
CH4–
CH4+
ANALOG IN0-5, 0 - 10VDC+/-5, +/-10VDC
Retaining clip
4CH
DL205 Analog I/O Manual, 7th Edition, Rev. G
3-9
Page 10
Chapter 3: F2-04AD-2 , F2-04AD-2L, 4-Channel Analog Voltage Input
Module Operation
Channel Scanning Sequence (Multiplexing) for a D2-230 CPU
Before beginning to write the control program, it is important to take a few minutes to
understand how the module processes and represents the analog signals.
Depending on the type of CPU being used, the module can supply different amounts of data
per scan. The D2-230 can obtain one channel of 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 only
two channels are selected, then each channel will be updated every other scan. The multiplexing
method can also be used for the D2-240, 250-1, D2-260 and D2-262 CPUs.
Scan
Read Inputs
ExecuteApplication Program
Read thedata
Storedata
WritetoOutputs
Scan N
Scan N+1
Scan N+2
Scan N+3
Scan N+4
System With
DL230CPU
Channel1
Channel2
Channel3
Channel4
Channel1
3-10
DL205 Analog I/O Manual, 7th Edition, Rev. G
Page 11
Chapter 3: F2-04AD-2, F2-04AD-2L, 4-Channel Analog Voltage Input
Channel Scanning Sequence (Pointer method) for
D2-240, D2-250-1, D2-260 or D2-262 CPUs
If either a D2-240, a D2-250-1, a D2-260 or a D2-262 CPU are used, all four channels of
input data can be collected in one scan. This is because the D2-240, D2-250-1, D2-260 and
D2-262 CPUs support 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 later in this
chapter.
Scan
System With
Read Inputs
D2-240, D2-250--1,
D2-260 or D2-262 CPU
Execute ApplicationProgram
Read the data
Storedata
WritetoOutputs
Scan N
Scan N+1
Scan N+2
Scan N+3
Scan N+4
Ch 1, 2, 3, 4
Ch 1, 2, 3, 4
Ch 1, 2, 3, 4
Ch 1, 2, 3, 4
Ch 1, 2, 3, 4
Analog Module Updates
Even though the channel updates to the CPU are synchronous with the CPU scan, the module
asynchronously monitors the analog transmitter signal and converts the signal to a 12-bit
binary representation. This enables the module to continuously provide accurate measurements
without slowing down the discrete control logic in the RLL program.
For the vast majority of applications, the values are updated much faster than the signal
changes. However, in some applications, the update time can be important. The module takes
approximately 8.2 milliseconds to sense 95% of the change in the analog signal.
NOTE: This is not the amount of time required to convert the signal to a digital representation. The conversion to the digital
representation takes only a few microseconds. Many manufacturers list the conversion time, but it is the settling time of the
filter that really determines the update time.
DL205 Analog I/O Manual, 7th Edition, Rev. G
3-11
Page 12
Chapter 3: F2-04AD-2 , F2-04AD-2L, 4-Channel Analog Voltage Input
= databits
Understanding Input Assignments
It was mentioned earlier in this chapter that the F2-04AD-2 module appears as a 16-point
discrete input module to the CPU. These points can be used to obtain:
• An indication of which channel is active
• The digital representation of the analog signal
• Module diagnostic information
Since all input points are automatically mapped into V-memory, it is very easy to determine the
location of the data word that will be assigned to the module.
F2-04AD-2
Slot 0 Slot 1 Slot 2 Slot 3 Slot 4
8pt
Input
X0
X7
V40400
MSB
X
3
7
8pt
Input
X10
X17
X
X
X
3
3
3
6
5
4
16pt
Input
X20
X37
V40401
Data Bits
16pt
Input
X40
X57
V40402
16pt
Output
Y0
Y7
LSB
X
2
0
Within these word locations, the individual bits represent specific information about the analog
signal.
Analog Data Bits
The first twelve bits represent the analog data inbinary
format.
Chapter 3: F2-04AD-2, F2-04AD-2L, 4-Channel Analog Voltage Input
V40401
Active Channel Indicator Inputs
Two of the inputs are binary-encoded to
indicate the active channel (remember,
the V-memory bits are mapped directly to
discrete inputs). The inputs automatically
turn on and off to indicate the current
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
MSB
X
3
5
= channel inputs
V40401
X
3
4
Module Diagnostic and Sign Inputs
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
extreme environmental (electrical) noise
problems are present.
The last input (X37 in this example) is used for two purposes.
Signal Sign - When using bipolar ranges the value returned needs to be known if it is either
positive or negative. When this input is off, the value stored represents a positive analog signal
(0V or greater). If the input is on, then the value stored represents a negative input signal (less
than 0V).
Channel Failure - The last diagnostic input can also indicate an analog channel failure. For
example, if the 24VDC input power is missing or if the terminal block is loose, the module will
turn on this input point and also returns a data value of zero (remember, if this input is on and
the data value is not equal to zero, then it is just showing the sign).
The next section, Writing the Control Program, shows how these inputs can be used in a
program.
MSB
X
X
3
3
7
6
= Module Busy
= diagnostic and sign
LSB
LSB
X
2
0
X
2
0
DL205 Analog I/O Manual, 7th Edition, Rev. G
3-13
Page 14
Chapter 3: F2-04AD-2 , F2-04AD-2L, 4-Channel Analog Voltage Input
Unipolar
HorL=highorlow limit of therange
Bipolar
Module Resolution
Since the module has 12-bit unipolar resolution,
the analog signal is converted into 4096 counts
ranging from 0 - 4095 (212). For example, with a
0–10 V scale, a 0V signal would be 0 and a 10V
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.
Each count can also be expressed in terms of the
signal level by using the equation shown.
Each count can also be expressed in terms of the signal level by using the equation shown.
The following table shows the smallest detectable signal change that will result in one LSB
change in the data value for each input signal range.
Ranges
+V
0V
04095
Unipolar Resolution
Bipolar Resolution
+V
0V
-- V
Ranges
H–L
=
4095
H–L
=
8191
04095-- 4095
Voltage Range
0 to +10V
-10V to +10V
0 to +5V
-5V to +5V
Signal Span
(H–L)
10V40952.44 mV
20V81912.44 mV
5V40951.22 mV
10V81911.22 mV
Divide By
Smallest Detectable
Change
3-14
DL205 Analog I/O Manual, 7th Edition, Rev. G
Page 15
Chapter 3: F2-04AD-2, F2-04AD-2L, 4-Channel Analog Voltage Input
incoming data.
Writing the Control Program
Reading Values: Pointer Method and Multiplexing
There are two methods of reading values:
• The pointer method
• Multiplexing
The multiplexing method must be used when using a D2-230 CPU. The multiplexing method
must also be used with remote I/O modules (the pointer method will not work). Either
method can be used with the D2-240, D2-250-1, D2-260 and D2-262 CPUs, but for ease of
programming it is strongly recommended to use the pointer method.
Pointer Method for the D2-240, D2-250-1, D2-260 and D2-262 CPUs
The DL205 series has special V-memory locations assigned to each base slot that will greatly
simplify the programming requirements. These V-memory locations allow you to:
• Specify the data format
• Specify the number of channels to scan
• Specify the storage locations.
NOTE: D2-250 CPUs with firmware release version 1.06 or later support this method. If the D2-230 example needs to be
used, module placement in the base is very important. Review the section earlier in this chapter for guidelines.
The example program shows how to setup these locations. Place this rung anywhere in the
ladder program, or in the initial stage if stage programming instructions are being used. This is
all that is required to read the data into V-memory locations. Once the data is in V-memory,
math can be used on the data, compare the data against preset values, and so forth. V2000 is
used in the example but you can use any user V-memory location. In this example the module
is installed in slot 2. Be sure to use the V-memory locations for the module placement. The
pointer method automatically converts values to BCD (depending on the LD statement in the
ladder logic).
SP0
LD
K
00
04K0084
OUT
V7662
LDA
O2000
OUT
V7672
LD
-or-
Loads aconstant that specifiesthe number of channelsto scanand
the dataformat.The upperbyte, most significant nibble (MSN)
selectsthe dataformat(i.e. 0=BCD, 8=Binary), theLSN selectsthe
number of channels (i.e.1,2,3,or4).
Thebinaryformatisusedfor displaying data on some operator
interfaces.The D2-230/24 0CPUsdonot support binary math
functions,whereas theD2-250-1, D2-260, and D2-262 do.
SpecialV-memorylocationassigned to slot 2that contains the
number of channels to scan.
This loadsanoctal valuefor thefirst V-memory location that will be
used to storethe incoming data.For example, theO2000 entered
here would designatethe followingaddresses.
Ch1--V2000,Ch2 -- V2001, Ch3--V2002,Ch4-- V2003
Theoctal address (O2000)isstoredhere. V7672isassigned to slot
2and acts as a pointer,which meansthe CPUwilluse theoctal
valueinthislocationtodetermine exactlywheretostore the
DL205 Analog I/O Manual, 7th Edition, Rev. G
3-15
Page 16
Chapter 3: F2-04AD-2 , F2-04AD-2L, 4-Channel Analog Voltage Input
The tables below show the special V-memory locations used by the D2-240, D2-250-1,
D2-260 and D2-262 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 D2-230 (multiplexing) method, verify that these
addresses in the CPU are zero.
The Table below applies to the D2-240, D2-250-1, D2-260 and D2-262 CPU base.
CPU Base: Analog Input Module Slot-Dependent V-memory Locations
Slot
No. of Channels
Storage Pointer
The Table below applies to the D2-250-1, D2-260 or D2-262 CPU base 1.
Expansion Base D2-CM #1: Analog Input Module Slot-Dependent V-memory Locations
Slot
No. of Channels
Storage Pointer
The Table below applies to the D2-250-1, D2-260 or D2-262 CPU base 2.
Expansion Base D2-CM #2: Analog Input Module Slot-Dependent V-memory Locations
Chapter 3: F2-04AD-2, F2-04AD-2L, 4-Channel Analog Voltage Input
Using Bipolar Ranges (Pointer Method) for
D2-240, D2-250-1, D2-260 and D2-262 CPUs
Some additional logic is needed with bipolar ranges to determine whether the value being
returned represents a positive voltage or a negative voltage. For example, the user may need to
know the direction of a motor. With the D2-240, D2-250-1, D2-260, and D2-262 CPUs, the
last input cannot be used to show the sign for each channel (X37 in the previous examples).
This is because the pointer method reads all four channels in one scan. Therefore, if X37 were
used, it would not be possible to determine if the first three channels returned negative voltage.
Only the last channel can be checked to determine if it returned a negative voltage. A simple
solution is to check if the returned value is greater than or equal to 8001. If it is greater than
or equal to 8001 the returned value is negative.
The sign bit is the most significant bit, which combines 8000 with the data value. If the value
is greater than or equal to 8001, only the most significant bit and the active channel bits will
need to be masked to determine the actual data value.
The following program shows how to accomplish this. Since a negative value is always meant
to be known, these rungs should be placed before any other operations that use the data, such
as math instructions, scaling operations, and so forth. Also, if stage programming instructions
are being used, place these rungs in a stage that is always active. Please note, this logic is only
needed for each channel that is using bipolar input signals. The following example only shows
two channels.
Check Channel1
SP1
LD
V2000
ANDD
K7FFF
Load channel 1datafromV-memoryintothe
accumulator. Remember,the data canbe negative.
Contact SP1 is always on.
This instruction masks thesignbit of theBCD dataifit
is set. Withoutthis step, negative values will not be
correct,sodo not forget to include it.
V2000K8001
Check Channel2
SP1
V2001K8001
OUT
V2020
²
LD
V2001
ANDD
K7FFF
OUT
V2021
²
Putthe actual signal value in V2020. Nowyou canuse
thedatanormally.
C1
Channel 1datais negativewhenC1ison(avalue of -- 1
OUT
reads as 8001,--2 is 8002, etc.).
Load channel 2fromV-memoryintothe accumulator.
Remember, the datacan be negative.Contact SP1 is
always on.
This instruction masks thesignbit of theBCD dataifit
is set. Withoutthis step, negative values will not be
correct,sodo not forget to include it.
Putthe actual signal value in V2021. Nowyou canuse
thedatanormally.
C2
Channel 2datais negativewhenC2ison(avalue of -- 1
OUT
reads as 8001,--2 is 8002, etc.).
DL205 Analog I/O Manual, 7th Edition, Rev. G
3-17
Page 18
Chapter 3: F2-04AD-2 , F2-04AD-2L, 4-Channel Analog Voltage Input
our
Reading Values (Multiplexing) for
D2-230, D2-240, D2-250-1, D2-260 and D2-262 CPUs
The D2-230 CPU does not have the special V-memory locations which will allow data transfer
to be automatically enabled. 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 16 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 is installed in a different I/O arrangement. The rungs can be placed
anywhere in the program, or if stage programming is being used, place them in a stage that is always
active.
LoadDatawhenModuleis not busy
X36
StoreChannel 1
X36X34X35
LD
V40401
ANDD
KFFF
BCD
OUT
V2000
Loads thecompletedatawordintothe accumulator.
TheV-memorylocation depends on theI/O
configuration.See AppendixAforthe memorymap.
This instructionmasks thechannel identification
bits.Withoutthis,the values used will notbecorrect
so do not forget to include it.
It is usually easier to perform math operations in
BCD, so it is besttoconvertthe datatoBCD
immediately. Yo ucan leaveout this instructionify
application does not requireit.
When themodule is not busy and X34 and X35are
off, channel 1dataisstoredinV2000.
3-18
StoreChannel 2
X36X34X35
StoreChannel 3
X36X34X35
StoreChannel 4
X36X34X35
OUT
V2001
OUT
V2002
OUT
V2003
When X34ison and X35isoff,channel 2datais
stored in V2001.
When X34isoff and X35is on, channel 3datais
stored in V2002.
When bothX34 and X35are on,channel 4datais
stored in V2003.
DL205 Analog I/O Manual, 7th Edition, Rev. G
Page 19
Chapter 3: F2-04AD-2, F2-04AD-2L, 4-Channel Analog Voltage Input
Storechannel1when module is not busy.
channel1dataisstoredinV2000.
Loaddatawhenmoduleis not busy.
channel2’s value is negative.
Single Channel Selected
The single channel program makes it easy to determine which channel has been selected.
X36X34X35
Using Bipolar Ranges (Multiplexing)
Some additional logic is needed with bipolar ranges to determine whether the value being
returned represents a positive voltage or a negative voltage. For example, the direction of a
motor may be needed to be known. Since the D2-230 only reads one channel per scan, the last
input can be used to show the sign (X37 in the examples).
The following program shows how to accomplish this. Since a negative value is always needed
to be known, these rungs should be placed before any other operations that use the data, such
as math instructions, scaling operations, and so forth. Also, if stage programming instructions
are being used, place these rungs in a stage that is always active. Please note, this logic is only
needed for each channel that is using bipolar input signals. The following example only shows
two channels but the rungs can be repeated for all four channels if needed.
This instruction masksthe channelidentification bits.
Without this,the values used will not be correct, so do
not forget to include it.
It is usually easier to perform math operationsinBCD,
so it is besttoconvert the datatoBCD immediately.
Youcan leave out this instruction if your application
does notrequire it.
When themoduleis not busyand X34 and X35are off,
Loadsthe complete datawordintothe
accumulator. TheV-memoryloc ation depends
on the I/O configuration. SeeAppendixAfor
thememorymap.
This instructionmas ks thechannel identification
bits. Without this,the values used will not be
correct,sodo not forget to include it.
It is usually easier to perform math operationsin
BCD, so it is besttoconvert thedatatoBCD
immediately. Yo ucan leave out this instructionif
your application does not require it.
When themoduleisnot busyand X34 and X35
areoff,channel 1 dataisstoredinV2000. C0 is
resettoindicatechannelone’s valueispositive.
C0
RST
If X37is on, then thedatavalue representsa
C0
negative voltage.C0isset to indicate channel1’s
SET
value is negative.
When themoduleisnot busy, andX34 is on
and X35isoff,channel2dataisstoredin
V2001. C1 is resettoindicatethat channel2’s
value is positive.
C1
RST
C1
If X37is on, then thedatavalue repres ents a
negative voltage.C1isset to indicate that
SET
DL205 Analog I/O Manual, 7th Edition, Rev. G
3-19
Page 20
Chapter 3: F2-04AD-2 , F2-04AD-2L, 4-Channel Analog Voltage Input
Load data when moduleisnot busy.
Using 2’s Complement (Multiplexing) for
D2-230, D2-240, D2-250-1, D2-260 and D2-262 CPUs
The 2’s complement data format may be required to display negative values on some operator
interface devices. It could also be used to simplify data averaging on bipolar signals.
The example shows two channels, but these steps can be repeated for all four channels if
necessary.
This instructionmas ks thechannelidentification bits.
Without this,the values used will notbecorrect,so
do not forget to include it.
When themoduleis not busyand X34 and X35are
off, channel 1 dataisstoredinV2000. C0 is resetto
indicate that channel 1’svalue is pos itive.
C0
RST
C0
If X37is on, then the datavalue representsa
negative voltage. C0 is settoindicatethat channel
SET
1’svalue is negative.
Invert thebit pattern in theaccumulator.
Channel1dataisindoublewordstarting at V2040.
When themoduleis not busyand X34isonand X35
is off, channel2dataisstoredinV2001.C1isreset
to indicate channel2’s valueis positive.
C1
RST
If X37ison, then the datavalue representsa
C1
negative voltage. C1 is settoindicate that channel
SET
2’svalue is negative.
Invert thebit pattern in theaccumulator.
3-20
BCD
ADDD
K1
X36X34X35
OUTD
V2042
Channel2dataisindoublewordstarting at V2042.
DL205 Analog I/O Manual, 7th Edition, Rev. G
Page 21
Chapter 3: F2-04AD-2, F2-04AD-2L, 4-Channel Analog Voltage Input
Multiplexing method
Analog Power Failure Detection
The analog module has a microcontroller which can diagnose analog input circuit problems. A
ladder rung can be added to program to detect these problems. This rung shows an input point
that would be assigned if the module was used as shown in the previous examples. A different
point would be used if the module was installed in a different I/O configuration.
V2000K0=X37
OUT
V-memory locationV2000 holds
C0
channel 1data. Whenadatavalue
of zero is returned and inputX37 is
on,then theanalogcircuitry is not
operating properly.
Pointers method
V2000 K8000
=
OUT
V-memory locationV2000 holds
C0
channel 1data. When a datavalue
of 8000 is returned,then the analog
circuitry is not operatingproperly.
Scaling the Input Data
Most applications usually require measurements in
engineering units which provides more meaningful data.
This is accomplished by using the conversion formula
shown.
Adjustments may be needed to the formula depending on
the scale being used for the engineering units.
For example, if pressure (psi) is to be measured from
0.0–99.9 then multiply the value by 10 in order to
imply a decimal place when viewing the value with the
programming software or with a handheld programmer.
Notice how the calculations differ when the multiplier is used.
An analog value of 2024, slightly less than half scale, should yield 49.4 psi.
H – L
Units = A
4095
U = Engineering Units
A = Analog Value (0 – 4095)
H = High limit of the engineering
unit range
L = Low limit of the engineering
unit range
Example without multiplierExample with multiplier
Units = A
4095
Units = 2024
4095
H – L
100 – 0
Units = 49
Units = 10A
4095
Units = 20240
4095
Units = 494
H – L
100 – 0
DL205 Analog I/O Manual, 7th Edition, Rev. G
3-21
Page 22
Chapter 3: F2-04AD-2 , F2-04AD-2L, 4-Channel Analog Voltage Input
The Conversion Program
The following example shows how to write the program to perform the engineering unit
conversion from input data formats 0–4095. This example assumes the raw input data read at
V2000 is in BCD format.
NOTE: This example uses SP1, which is always on, but any permissive contact such as, X, C, etc., can be used.
SP1
LD
V2000
MUL
K1000
DIV
K4095
OUT
V2010
When SP1 is on, load channel1datatothe accumulator.
Multiply theaccumulator by 1000(to startthe conversion).
Divide theaccumulator by 4095.
Storethe result in V2010.
Analog and Digital Value Conversions
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. Remember, that
this module does not operate like other versions of analog input modules. The bipolar ranges
use 0–4095 for both positive and negative voltages. The sign bit allows this, which actually
provides better resolution than those modules that do not offer a sign bit. The following table
provides formulas to make this conversion easier.
Range If the digital value is known
0–5V
–5V to +5V
0–0V
–10V to +10V
5D
A =
4095
5D
A =
4095
If the analog signal level is
known.
4095
D =
D = 4095
(A)
5
ABS(A)
10
3-22
As an example, if the range being used is ±10V and
the measured signal is 6V, use the formula to the
right to determine the digital value that is stored in
the V-memory location that contains the data.
DL205 Analog I/O Manual, 7th Edition, Rev. G
4095
D =
(A)
10
4095
D =
(6V)
10
D = (409.5) (6)
D = 2457
Page 23
Chapter 3: F2-04AD-2, F2-04AD-2L, 4-Channel Analog Voltage Input
Filtering Input Noise for D2-250-1, D2-260 and D2-262 CPUs
Add the following logic to filter and smooth analog input noise in D2-250-1, D2-260 and
D2-262 CPUs. This is especially useful when using PID loops. Noise can be generated by the
field device and or induced by field wiring.
In the following example, the analog value in BCD is first converted to a binary number.
Memory location V1400 is the designated work space in this example. The MULR instruction
is the filter factor, which can be from 0.1–0.9. The example uses 0.2. Using a smaller filter
factor increases filtering. A higher precision value can be used, 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: Please review intelligent instructions (IBox) in Chapter 5 of D2-USER-M, which simplify this and
other functions. The IBox instructions are supported by the D2-250-1, D2-260 and D2-262.
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
SUBR
V1400
MULR
R0.2
ADDR
V1400
OUTD
V1400
RTOB
BCD
OUT
V1402
Loadsthe analog signal, whichisaBCDvalue
and has beenloadedfromV-memorylocation
V2000,intothe accumulator.Contac t SP1 is
always on.
Converts theBCD value in theaccumulator to
binary. Remember,thisinstruc tion is not
neededifthe analog value is originally
broughtinasabinary number.
Converts thebinaryvalue in theaccumulator
toarealnumber.
Subtractsthe real numberstoredinloc ation
V1400 from thereal numberinthe accumulator,
and stores theresultinthe accumulator.V1400
is thedesignatedworkspaceinthisexample.
Multipliesthe real number in the
accumulatorby0.2 (the filter factor),
and stores theresultinthe
accumulator.This is thefiltered value.
Adds thereal numberstoredin
locationV1400 to therealnumber
filtered valueinthe accumulator, and
stores theresult in theaccumulator.
Copies thevalue in theaccumulator to
location V1400.
Converts thereal number in the
accumulatortoabinar yvalue, and
stores theresult in theaccumulator.
Converts thebinaryvalue in theaccumulator
to aBCD number.Note: TheBCD instruction
is not needed forPID loop PV (loopPVisa
binary number).
Loads theBCD number filtered valuefrom
theaccumulator intolocationV1402touse in
your applicationorPID loop.
DL205 Analog I/O Manual, 7th Edition, Rev. G
3-23
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.