Analog IO Basic Knowledge PDF
Analog IO Basic Knowledge PDF
contec.com/support/basic-knowledge/daq-control/analog-io/
This section offers basic knowledge and glossary terms related to analog I/O, A/D
conversion, and D/A conversion in an easy-to-understand way that includes illustrations.
The content offered here is recommended knowledge for anyone looking to perform
measurement control using a computer as well as anyone considering automating data
logging or measurements. It may also prove a useful resource for individuals already
using CONTEC analog I/O devices.
Contents
1/20
Analog I/O device classification
The most effective way to solve this problem is to keep the number of digits within the
acceptable range by rounding or using either the floor or the ceiling. In other words, this
means replacing an amount within a certain range with a representative value. This is
referred to as quantization.
When quantizing analog values represented by a solid line, you get a stepped line. This
makes it possible to express any analog signal using a finite value. This technology is
active in things many people are familiar with, for example, in cellular phones. Cell
phones make calls by converting voices (analog) to digital sounds.
2/20
For example, the following figure shows a staircase in decimal numbers with the first
step as 1, as well as the result if the decimal numbers are replaced with binary numbers.
In this way, an analog quantity can be digitalized at 4 bits. This is the basic idea behind
quantizing analog quantities.
Bus isolation
Using a photocoupler, the computer and external I/O circuits are isolated. Because it's
possible to prevent electrical interference from being introduced, this method allows for
worry-free usability even if noise is easily generated in the wiring or if there is a concern
of the computer malfunctioning or becoming damaged.
3/20
Independent (channel-to-channel) isolation
In addition to bus isolation, independent isolation uses a photocoupler and an isolation
amplifier to add isolation between each input/output channel. This allows interference
between channels to be prevented and allows for accurate sampling even if the
equipment connected to the various channels have different ground levels.
What is a photocoupler?
A photocoupler is a device that contains a light-emitting diode coupled to a
phototransistor. The light-emitting diode outputs light when exposed to an electrical
current (about 10 mA). The phototransistor receives this light, which turns the
phototransistor ON, which results in an electrical current. Part of this optical signal is
electrically insulated from the outside.
5/20
What is resolution?
Resolution refers to the extent of fineness that the analog signal can be digitally
represented (approximately). A high resolution means that the voltage range can be
finely divided, resulting in a more accurate conversion to digital values.
Let's look at some example considerations for selecting a device with the optimal
resolution from among the wide variety of analog I/O devices.
For example, let's assume that we are using a sensor that converts an analog amount to
0 to 5 volts. So, between a device with an input range of 0 to 10 V and one with 0 to 5 V,
which is effective? If both have a resolution of 12 bits, the smallest divisible voltage for
the 0 to 10 V board is about 2.44 mV (10 ÷ 4096 = about 2.44). With the 0 to 5 V device,
the equation becomes 5÷4096, making the smallest divisible voltage 1.22 mV. Because
the sensor only outputs 0 to 5 V, the device with an input range of 0 to 5 V will provide
the opportunity for finest judgment.
What is gain?
Gain refers to magnification. Some analog input devices are equipped with a function
that can amplify the input signal. For example, with an external signal of 0 to 2.5 V, if the
input range of an analog input device is 0 to 10 V, amplifying the external signal (the
signal being input) by a factor of 4 and then converting the resulting 0 to 10 V signal
rather than converting it as is will allow for conversion with higher precision.
Sampling theorem
If sampling cannot be performed with a sampling cycle twice the input/measurement
frequency, accurate waveform measurements will not be possible.
7/20
What is conversion accuracy?
Conversion accuracy refers to the error range produced when performing A/D
conversions or D/A conversions. Errors are represented in units of 1 LSB. For example,
the smallest resoluble unit for an A/D conversion device with a resolution of 12 bits set to
an input range of ±10 V is 20 ÷ 4,096 ≈ 4.88 mV (1 LSB). If that A/D conversion board's
conversion accuracy is noted as ±2 LSB, it means that there is a possibility that errors
produced will be about 4.88 × 2 ≈ ±9.76 mV.
LSB is an abbreviation of least significant bit and signifies the least significant bit of
binary data.
With a 16-bit resolution device, the voltage between -10 V and 0 V can be expressed as
32,768 data segments, where -10 V is "0000H" and 0 V is "8000H." As such, 0 V to 10 V
8/20
becomes "8000H" to the max. "FFFFH", which must then be expressed as 32,767. For this
reason, the maximum value is referred to as "+10 V -1 LSB".
These relationships are the same for any analog I/O device. For example, with analog
output, to output a signal externally, "FFFF" is set to a device with 16-bit resolution, but
the maximum outputtable voltage is "+10 V -1 LSB".
Binary
representation
MSB
Voltage Analog voltage DATA LSB
meaning (V) (hexadecimal)
・
・
・
・
9/20
LSB
Abbreviation of least significant bit. Signifies the least significant bit of binary data.
MSB
Abbreviation of most significant bit. Signifies the most significant bit of binary data.
FSR
Abbreviation of full scale range. In the ±10 V range, FSR becomes "20".
Straight binary
A voltage of 0 V is given a digital value of 0, and the digital value increases in proportion
to the increase in voltage. A unipolar form is used.
Offset binary
The maximum (lowest) value of negative voltage is given a digital value of 0. In this way, 0
V is assigned a digital value in the middle, and the largest positive voltage value is given
the largest digital value. A bipolar form is used.
10/20
Complement binary(Two's complement)
To obtain the two's complement, the most significant bit of the offset binary code is
reversed. A two's complement expression is an easy-to-use code for calculations on a
computer. This data format can be found in bipolar forms.
The multiplexer method performs sampling while switching the multiplexer, meaning
that simultaneous conversion of more than one channel is impossible (because time is
needed to change between channels).
With the simultaneous sampling method, there are two types: where each channel is
equipped with an A/D converter, and where a sample/hold amplifier is equipped. Either
type is capable of performing simultaneous conversion over multiple channels.
11/20
Conversion rates and Nos. of channels
In a system where the analog input channels are switched through a multiplexer
method, to perform sampling over multiple channels, the settable sampling period must
maintain the following relationship. Conversion rate × sampling cycle ≤ sampling cycle"
What is a clock?
A clock indicates the timing at which conversion operations of an analog I/O device can
be synchronized. For sampling clocks that determine sampling cycles, the following main
methods are used.
Internal clock
A timer element capable of setting the sampling period is installed in the device. As a
clock source, this is a method for performing periodic conversions. Internal clocks are
useful for time-series processing at precise and rapid cycles.
12/20
External clock
External clocks can be used for devices equipped with external clock input terminals.
Conversion is performed in synchronization with a pulse signal or other signal input from
an external source. This method is useful for synchronizing with external devices.
Software clock
A software clock is a method of performing periodic conversions by synchronizing with
the system timer on a PC and sending a start command from the software. However,
because errors with VisualBasic's timer control and other functions are large, this
method is not suitable for systems requiring fast and accurate cycles.
What is a trigger?
A trigger is a source for determining the timing at which to start or stop a conversion.
Starting and stopping can both be set independently. The main triggers are as follows.
13/20
Software trigger
A software trigger starts/stops conversion operations using commands from software.
External trigger
An external trigger starts/stops conversion operations using an external signal (digital
signal). Conversion operation starts or stops when the pre-set edge movement (rising or
falling) is input from the external control signal.
14/20
What is buffer memory?
Buffer memory is where conversion data is temporarily stored. Such memory not only
enables fast and high-performance analog input processing but also significantly reduces
the load on the computer. Depending on the application, buffer memory can employ
either the FIFO method or the ring method.
FIFO method
With the FIFO (First In, First Out) method, converted data is stored in the buffer memory
in a first-come, first-served behavior with data written to the buffer memory first being
read first (in chronological order). The converted data read from within the memory is
delivered sequentially, with reading of the oldest conversion data remaining in the buffer
memory always readable. Data that exceeds the FIFO memory capacity will be discarded
and not written, and data that has been read will be discarded from the buffer memory.
Ring method
The ring method arranges the storage area in the buffer memory like a ring. Conversion
data is written sequentially, and when storing beyond the memory capacity, areas where
prior conversion data is stored are overwritten. Ring memory is useful when data is not
normally obtained but data near a conversion operation stop due to some event should
be obtained. With the ring method, once data is captured, it can be read multiple times
before it is overwritten.
Without applying a load on the PC's CPU, data can be transferred from the device
directly to the PC memory at a speed of 80 MB/sec (maximum 133 MB/sec).
Because the CPU's capacity is not reduced due to data transfer processes and the
like, it is able to perform other processes, thus reducing the impact on other
applications.
The necessary settings for input/output are already set to the device, and because
the board performs processing based on that information, it's possible to construct
a more efficient system than possible with normal input/output processing.
Normal processing
With normal input/output processing, after the CPU reads the data from the device, it
stores the information in the main unit's memory. This intermediate CPU cannot be used
for other processes. In the following figure, other processes are only possible after (4)
and (5) are finished.
Bus mastering
During bus mastering, the CPU instructs bus master processing for the device, allowing
data to be sent to the main unit's memory directly from the device (without going
through the CPU). In the following figure, other processes can be performed while (2)
and (3) are processing.
16/20
What is interruption?
This function generates priority processing externally by connecting a certain input
terminal to an IRQ (interrupt request line) on the computer. By detecting changes in
external devices, interruption can be used, for example, in applications that perform
specific processing and for processing emergency high-priority external commands, to
name a few.
This means that the total maximum current consumption of the board should not be
more than the rated power capacity of the computer (the maximum current that can be
supplied to the expansion slot).
If the rated power capacity is exceeded, the computer's power supply voltage will be
reduced, which could result in such trouble as runaway. For this reason, it's necessary to
take appropriate countermeasures, such as extending the computer's slots by using an
"expansion unit".
Example: The power supply capacity the computer can supply to the expansion slot is 3.6
A.
When mounting two 1.2 A external interface boards, the maximum current
consumption is as follows:
1.2 (A) × 2 (boards) = 2.4 A, which is lower than the power capacity of the computer (3.6
A). [Acceptable]
When mounting six 0.8 A external interface boards, the maximum current
consumption becomes:
0.8 (A) × 6 (boards) = 4.8 A, higher than the power capacity of the computer (3.6 A).
[Unacceptable]
External noise
Noise that is transferred through the air from outside the signal transmission line.
Noise that exists around wiring for movement system devices such as motors, and
noise that results from wiring located in the vicinity.
Internal noise
Noise caused by connection of analog input/output circuits.
Noise and offset voltages caused by ground potential differences between devices.
Interference noise and crosstalk caused by the wiring material.
Solution
18/20
The general rule, particularly when performing measurement, is that noise should not
affect the measurement target. To ensure this, it's necessary to take care that
impedance, ground levels, and the like, are matching. Familiarizing yourself with
solutions is not difficult, but it could be said that failing to consider these solutions can
have a large impact. The table below lists some countermeasures against noise.
Hard
Points to
Countermeasure Specific example Effect remember
19/20
Points to
Countermeasure Specific example Effect remember
Soft
Specific Points to
Countermeasure example Effect remember
20/20