Data Acquisition Introduction
Data Acquisition Introduction
Data Acquisition Introduction
Acquisition
Developed by Advantech IAG Training Center
Table of Contents
(Internal Use Only).......................................................................................................I
Table of Contents..........................................................................................................I
Chapter 1 Introduction..........................................................................................1
1.1 DA&C system Overview...........................................................................1
2.2.1 Transducers..................................................................................20
2.2.2.1 Isolation........................................................................................23
2.2.2.2 Filtering........................................................................................24
2.2.3.5 Counter.........................................................................................58
Chapter 1 Introduction
applications, the new trend will be to separate the computing platform from the data
With over 25 years of Plug-in I/O card design and manufacturing experience,
Advantech has become a global leader, providing a full range of industrial data
acquisition and control products. There are five major categories - CompactPCI, PCI-
bus, ISA-bus, USB-bus, PC/104 & PCI-104 modules. With rich wiring terminal
modules and software support, Advantech provides high-speed, high quality, yet cost-
provides versatile rugged mounting kits and dual lockable cables for industrial test
Project Introduction:
LED flashlights are gaining popularity in the industrial field, not only do they
save energy, but they are also lighter and cheaper than their traditional counterparts.
One of our clients is a major manufacturer of automotive repair tools, including LED
flashlights, and they were looking to reduce the battery requirements in their
flashlights down to a one coin cell battery. Thus, they turned to Advantech help them
System Requirements:
grade USB DAQ module to verify their thermo specifications, which was difficult to
gauge due to the interference from the voltage circuits inside the flashlight. To make
sure quality is under control, they were looking for products that:
System Description:
USB-4718 was used to connect with thermocouple sensors, and then transfer
data to the desktops HDD. The WaveScan utility inside the desktop is free, providing
data logging, real-time waveform and historical trend functions. All the signals can be
displayed on the screen in real-time, providing offline analysis or transfer of the data
Conclusion:
After implementing Advantech products, the client not only saved cabling and
installation efforts, they also saved 70% on the test stations cost. Moreover, this test
tool can be used in the central or subcontractors office, providing increased flexibility
Project Introduction:
looking to reduce the cost of their audio quality analysis system. Thus, they turned to
System Requirements:
Our clients in-house R&D team wanted to create a PC-based measurement and
testing solution to analyze audio quality, and hoped to reduce costs compared to
Multiple analog input channels to test many products at the same time
devices)
System Description:
The PCI-1710HGs digital output channels were used to trigger the electronic
devices, which play preloaded music. The PCI-1710HGs analog input channels were
used to connect to the earphone port, which acquires audio signals from the electronic
devices. The test application will verify the data to see if the conditions match or not.
After that, the display will show the pass or fail information to the operator.
Conclusion:
solution increased production by 50% (it can now test two electronics devices at the
same time) and saved 29% on the test workstations cost. This solution can test all
audio electronic devices with specific fixtures. Furthermore, the ease of operability
allows their local R&D teams to mange the system themselves, reducing maintenance
costs.
The PCI-1710HGs advanced circuit design provides high quality with advanced
functions, including the five most popular measurement and control functions: 12-bit
A/D conversion, D/A conversion, digital input, digital output and counter/timer. The
high gain design allowed this system to measure even small signals (+/- 0.005V)
Machine
Project Introduction:
which simulates the wind and blade models they build in Simulink. Through this
unique solution, INER can modulate the speed of the dynes based on actual wind
direction and strength. This affordable and robust multi-function platform can rapidly
System Requirements:
INER wanted to develop a simulation and test station for their wind power
generation machines. To do so, they needed a rugged and robust real-time system to
run hardware-in-the-loop testing. Therefore, INER made a request for a new system
consumption design, sturdiness, compact size and also can support all
standard PC peripherals.
stand-alone mode. And users can burn the pre-set model to CF card without
System Description:
The customer used Simulink to build their physical wind and blade models, and
create a Wind Power Generation Simulation Platform for the HIL simulation. The
goal of the simulation is to gauge the efficiency and performance of their power
they can then modulate the speed of dynes according to the actual wind direction and
Conclusion:
INERs engineers need to run real-time analysis and control system testing to test
the wind power generation machines, and this platform offers an excellent
MATLAB/Simulink and related control modules, the engineers can conduct real-time
loop testing without the need of manual code generation and complicated debug
processes. This results in significant cost savings and reduced development time.
Project Introduction:
Recently libraries have been extending beyond the physical walls of a building,
2005, is the librarys response to the challenge of Google, and an attempt to meet the
changing needs and wants of the users, using Web 2.0 technology. Some aspects of
software, plug-ins, and widgets. Inspired by Web 2.0, it is an attempt to make the
System Requirements:
One of Koreas top vending machine makers wanted to leverage RFID (Radio
returning system. The idea was that customers reserve a book through the librarys
website, choose the location to physically pick up the book, and the computer would
provide the customer with a special barcode that they should print out and bring with
them. The customer then simply goes to the assigned location, shows the printed
barcode information to the vending machine, and the reserved book would show up
automatically.
Customers could also return the book to any applicable vending machine, and
due to the fact that all books are tagged with an RFID, the librarys website and
vending machine system can deliver and trace all the books automatically. To
Easy to mount
System Description:
In this solution, the USB-4751 is setup to control the drawer switches when the
which drawer is not occupied for customers to return their books. The USB-4622 acts
as a USB hub to gather all the necessary information. The industrial display interacts
Conclusion:
This system is the first library 2.0 system in Korea, and was integrated with an
online shopping business model, RFID and vending machine technology. Not only
was the manufacturer able to save cabling and installation efforts, but also a lot of
vending machines operations can be monitored remotely from the central control
room.
The purpose of this textbook is to assist beginners to learn the basic concept of
DA&C system, understand how to use Advantech DAQ products and do the
programming with Advantech DAQ drivers. If you are already familiar with the basic
knowledge, it is recommended to directly visit the latter (i.e., Chapter 5) which puts a
stress on software programming to improve users skill of DAQ control. After reading
this textbook, we expect that the users can know the architecture of DA&C system
well and its basic knowledge, and will also enhance the ability of using Advantech
utilities and examples in relation to the control the DAQ products by the Hands-on
create their programs in a short term to meet the requirements of their applications.
This textbook will be separated into five chapters. In Chapter 1, the overview of
industry and the application story of the data acquisition will be introduced. In
Chapter 2, the architecture of DA&C system and related features involved will be
addressed, especially the functions of DAQ hardware such as AI, AO, DIO and
counter. In terms of I/O interface, how to select a suitable Advantech DAQ product
for your application will be described in Chapter 3. Chapter 4 will show users how to
install Advantech DAQ products in the computer and you will find it is very easy to
control Advantech DAQ products by the utilities. Finally, software drivers and
examples given in Chapter 5 will lead users to experience how to use various
Advantech drivers for programming with different kinds of software program. This
The purpose of this chapter is to give users an overview about DA&C system.
Basic knowledge, common features and useful functions in relation to DA&C will be
introduced.
First of all, DA&C is the abbreviation of Data Acquisition & Control. Due to
the advancement of computer technology, the speed of CPU becomes faster and the
getting more attractive and popular; that is to say, more and more users tend to choose
position. But how can we measure these analog signals by the PC which can read
physical phenomena and transfer them to suitable signals which can be further
handled by DAQ cards. With the purpose of noise reduction and signal adjustment,
taken into account before the measurement. Subsequently, DAQ cards are required to
conduct the process of data acquisition and convert signals from analog to digital.
After capturing related signals, we can go further to display what we get, analyze
what signals mean and react to what happens; as a result, a computer with software
outside, we need the computer to send commands to next devices (e.g., actuators).
The implication is that signals are re-converted from digital to analog through DAQ
Therefore, the DA&C system can be viewed as a closed loop process (see Figure 2-
1), starting with sensors, then signal conditioning, DAQ cards and PC with
increasingly reliable, accurate and affordable in the last few years. The PC-based
DA&C systems are now widely used in industrial and laboratory applications.
Therefore, it is worth knowing how to select and build a DA&C system. This section
will give you an introduction about how a DA&C system operates and how to
configure such system. The contents are separated into Transducers, Signal
Conditioning, Data Acquisition & Control Hardware and Selection Guide which
2.2.1 Transducers
position into voltage, current or other signals. There are many kinds of transducers
The thermocouple operates on the principle that the junction of two dissimilar
metals generates a voltage that varies with the temperature (see Figure 2-2).
card also causes so-called reference junction or cold junction. These additional
junctions act as thermocouples themselves and produce their own voltages. Thus, the
final measured voltage (i.e., Vmeas) is the combination of the voltage generated by the
thermocouple and the voltage deriving from the cold junction. The method used to
Compensation (CJC).
type, and so on. In Figure 2-3, we can see that the measurable temperature range as
each other. In order to get accurate temperature readings through the thermocouple, it
is necessary to take CJC into consideration and implement the calculation based on
the conversion rule. It is a tough task; fortunately, most of software applications (e.g.,
Advantech Device Manager, Advantech DAQ drivers) can support this conversion
signals can meet the requirements of the following stage for further processing.
Besides, the signal conditioning is able to improve the quality of analog signals from
transducers before they are converted into digital signals by PC-based DAQ cards.
2.2.2.1 Isolation
Signal conditioners with isolation can remove such problems. This kind of devices
passes the signal from its input (i.e., signal source) to its output (i.e., measurement
Figure 2-4); put simply, there is no physical contact or connection between its input
and output during transmission. Besides, due to separated grounds, the isolation can
block high-voltage surges or interference current on input side, and prevent both
components on output side and following devices from the damage caused by high
common-mode voltage (Vcm) which is the difference of voltages between the local
ground and ground of the DAQ card. It means if one side of the signal source is
connected to a local ground, the signal source will be ground-referenced. But the
ground of the signal source and the ground of the card will not be exactly of the same
voltage. The difference between the ground voltages forms a common-mode voltage.
2.2.2.2 Filtering
noise within a certain band of frequency. In most cases, data acquisition is likely
subject to noise with 50 or 60 Hz which may come from power lines or machinery. As
a result, signal conditioning is often equipped with low-pass filtering to get rid of such
Filters are also used to prevent signal aliasing (i.e., a phenomenon caused by
lower sampling rate for a signal with higher frequency). According to Nyquist
sub-signals) is greater than one-second sampling rate, the measured signal could be
distorted and such sub-signals are usually defined as noise. The solution to the above
problem is to implement low-pass filters to screen this kind of sub-signals before the
Figure 2-9 The Low pass filter can prevent signal aliasing
Due to the fact that signals from transducers tend to be small in magnitude,
amplifying signals to better match the input range of following devices (e.g., analog-
to-digital converter) is required often (see Figure 2-6). When signals are big enough,
the measurement error caused by limited resolution (i.e., 1 LSB, Least Significant Bit)
can be ignored. On the contrary, when signals are smaller, 1 LSB could have a
significant influence on the measurement result. Thats why most of DAQ products
However, noise like signals probably becomes bigger through amplification, which
does affect the accuracy of measurement. In order to improve this situation, increasing
signal sources or transducers, and intensify the measured signals before they are
Figure 2-10 The amplifier or attenuator can boost the level of the input signal to better
Data acquisition and control hardware generally performs one or more of the
following functions: Analog Input, Analog Output, Digital Input, Digital Output and
Counter/Timer functions. This section will introduce these functions and explain some
tend to become a form of analog signals through sensors or transducers, and have to
be subsequently converted into digital ones before entering the main system for
Figure 2-11 The Analog Input card can transform the analog signal to the digital value
The common specification of AI (i.e. Analog Input) is shown in Table 2-1, these
items are often used to represent the performance of AI cards. This section will give
operation of multiplexer, input mode, sampling rate, resolution, trigger clock, data
reach ADC (i.e., Analog-to-Digital Converter) at a time. As shown in Figure 2-8, the
multiplexer selects a channel in turn and then passes the signal of that channel to ADC
for data conversion. Typically, ADC is the most valuable part of AI cards and nearly
determines the price of such products. Through the multiplexer, one ADC can be
On the other hand, simultaneous data acquisition for all channels is required
sometimes. The multiplexer, in fact, fails to acquire data at the same time because the
ADC behind the multiplexer is shared by all channels. In such context, one ADC for
one AI channel (e.g., PCI-1714, see Figure 2-9) is recommended for this kind of
Figure 2-13 PCI-1714U (Simultaneous 4-ch Analog Input Universal PCI Card)
Two input modes are relative to AI function, namely single-ended mode (SE) and
differential mode (Diff). In the SE mode, voltage reference (e.g., AIGND in Figure
2-10) is always fixed and co-owned by all AI channels; but in the Diff mode, each
channel has its own voltage reference (e.g., AI0-AI1, AI2-AI3, see Figure 2-11).
Please note that in the Diff mode it is necessary to form the pair and the pair is
channels in the Diff mode is half of the SE mode. Furthermore, the SE mode and the
Diff mode can coexist on the same AI card. For instance, Advantech DAQ cards
support these two input modes and allow users to set channels as SE or Diff
According to Figure 2-12, Sample & Hold and Quantization are central to
the process of AD conversion. First of all, an oscillator providing a pacer rate to the
ADC for data sampling is needed. When an analog signal is acquired as a discrete
signal by sampling, the latter has to be held steadily for a while so that the following
process of quantization can be done in the given time. After that, the discrete signal is
transferred to the digital signal (i.e., binary data) and the process of AD conversion is
completed.
addressed in the first place, that is, sampling rate and resolution. The sampling rate
means the number of samples per second (or other time unit) users want to acquire
through the ADC, and the resolution means the least change the ADC can recognize.
Normally, the unit for the sampling rate is Hz whereas the unit for the resolution is
bit.
For the sampling rate, users have to know something about the Nyquist sampling
theorem first. As mentioned in Section 2.2.2.2, the Nyquist theorem states that the
twice the maximum frequency of a sampled signal. Therefore, the greater the
sampling rate is, the higher the probability to rebuild the original signal based on the
For example, the maximal sampling rate of PCI-1710 is 100KHz. Due to the
implementation of multiplexer, users can determine how many channels they want to
employ for data acquisition. If one channel is used only, the maximal sampling rate
for this channel is 100KHz/1ch = 100KHz/ch. If four channels are adopted at the
same time, the maximal sampling rate for each channel is 100KHz/4ch = 25KHz/ch.
But AI cards without multiplexer (i.c., one ADC for one channel, such as PCI-1714)
are exceptions; in that case, the maximal sampling rate for each channel is the same
represent the smallest unit which can be identified by the ADC. For instance, if the
input range is 0~10V and 8-bit ADC is adopted, the full scale (i.e., 10V) can be
separated into 256 (i.e., 28) pieces and each piece (i.e., LSB) is equal to 40mV (i.e.,
10V/256). If the ADC is upgraded from 8-bit to 16-bit, 1 LSB is lessened to 150uV
(i.e., 10V/216), that indicates the accuracy of data conversion is much increasing.
The software polling is a simple way to react to special conditions. This involves
algorithm and pre-defined action. This program periodically checks the systems clock
or external trigger input so as to sense a sign for action taking. Whenever a sign is
detected, the program starts sampling each of inputs, stores acquired data in a frame
and then stops to wait for next sign. A frame is simply a list that contains the values
representing the acquired signals at the specific time; besides, frames can be saved in
RAM, or other types of memory for further use. With the software polling, the data
transfer rate can be up to 10KHz or higher, that totally depends on the performance of
a computer adopted by users. Furthermore, the data transfer rate cant be exactly fixed
all the time because the resource of the computer allocated to this program is not
always stable. In other words, the computer could constantly stay busy when the
polling loop is going, that implies no other tasks can be served then. If the above is a
concern, the interrupt or DMA mode which is executed in the background can be
especially more than one tasks are executed. Multitasking systems can be referred to
data acquisition in the background is to use an interrupt routine. The system clock or
external timing signal, rather than the polling loop, is usually used to generate an
interrupt to the computer. Whenever the interrupt occurs, the computer suspends
current activities and executes an Interrupt Service Routing. The interrupt service
routing in this case might be a short program which requests one frame of data and
stores it in memory. After the interrupt service routine is done, the computer resumes
the tasks from where they leave off in the beginning. Compared with the software
polling, the computer can perform other tasks in the foreground during data collection
except the interrupt service routine is executed (i.e., moving acquired data to
memory); besides, the data transfer rate through the interrupt mode can be up to
200KHz (e.g., USB-4716) which is much higher than the software polling.
The DMA mode offers a way to transfer data into memory at a higher rate
without getting the CPU involved. Actually, DMA is a kind of technique that leads to
high-speed data transfer from or to random access memory (RAM); in the meanwhile,
tasks connected to the CPU are not affected while reading or writing data at precise
points of time through the DMA mode. For example, data can be written to RAM at a
rate of up to 30MHz (e.g., PCI-1714) under DMA control, and this can be done
without taking time from the tasks of the microprocessor. Compared with the
shorter. In conclusion, the DMA mode facilitates high-speed data transfer without the
CPU intervention, more urgent tasks such as data analysis and graphic manipulation
can be handled by the CPU timely. Moreover, it also allows users to run all I/O
The comparison between the software polling, the interrupt and the DMA mode
performance)
Table 2-2 The difference between Software Polling, Interrupt and DMA
Figure 2-15 gives you a clear picture about the operation of data transfer. For the
software polling mode, a request from software program enables the ADC to sample
signals and move acquired data to PCs memory. In this case, the data transfer rate
depends on PCs performance and users program. For the interrupt or DMA mode,
acquired data are moved to on-board FIFO (First-In, First-Out) rather than PCs
memory, and this process doesnt get the CPU involved. Actually, the FIFO serves as
a buffer for acquired data, and generates buffer change event to move the
accumulated data to the PC at a time when the levels of 1/2 FIFO and full FIFO are
reached. Consequently, the data transfer rate can be much higher than the software
polling.
On the other hand, a pacer signal is required to trigger the ADC for data
conversion. Generally, the pacer signal can be supplied through three modes, namely
software trigger, internal pacer trigger and external trigger. The software
trigger means that the ADC is enabled by software commands; the internal pacer
trigger can provide stable and fast pulses to the ADC for high-speed data acquisition;
the external trigger allows users to take advantage of external devices to offer pulses
Analog output (AO) is just opposite to analog input (AI). Like the role of ADC in
(DAC) is required and at the heart of AO function (i.e., transfer data from digital to
analog). For example, a request to output 5V (i.e., digital command) is sent from the
Figure 2-20 The Analog Output card can output the analog signal from the computer
The common specification of the AO function is shown in Table 2-3, the items in
the table are often used to show the performance of AO cards. This section will
DAC, please refer to Section 2.2.3.1 (c) for details. With regard to the data transfer
mode, the software polling and the DMA mode are available for the AO function only,
please refer to Section 2.2.3.1 (d) to get more information about these two modes if
necessary. In terms of the output mode, there are two kinds of modes for users
selection, namely static update and waveform output. The former acts like the
software polling with a lower update rate, whereas the latter allows outputting a
waveform at a fixed and higher rate through the DMA transfer. PCI-1712 (1MHz) and
PCI-1721 (10MHz) both support the waveform output mode. However, the frequency
marked here doesnt mean the frequency of analog signal users can output through
this mode, it represents the number of points users can adopt to form a desired
waveform. For instance, users can have PCI-1712 output 1M points to structure a sine
waveform with 10KHz, which means this sine waveform should be composed of
around 100 points (actual output frequency also depends on other parameters in the
program).
Digital Input (DI) is usually used to get the status information of external devices
by sensing the level of measured voltages (see Figure 2-17). Rather than actual
readings in the AI, two states (i.e., on and off) are addressed in the DI function.
Normally, if the voltage of a measured signal for certain DI channel (or bit) is higher
than a specific value, the DI reading will be 1 and the status will be recognized as
on. On the contrary, in the context of lower than a specific value, the DI reading
Figure 2-21 The Digital Input card can receive or monitor On/Off status of a device
Table 2-4 presents common specification about the DI function. These items can
be used to show the features of DI cards. In this section, some significant properties
In general, there are two kinds of input level for the DI function, namely TTL
Transistors) and resistors. The name Transistor-Transistor Logic comes from the
feature of transistors which leads to the implementation of logic gate (e.g., AND, OR)
states. According to the position of switch, the way of connection for DI channels can
be classified into Dry Contact (i.e., always open) and Wet Contact (i.e., always
closed). In Figure 2-18, a pull-high resistor (i.e., 10K) is implemented to keep the
input at a high level (i.e., 5V). If the dry contact is used, due to the aforementioned
pull-high resistor, the DI will always stay high until the dry contact is closed (i.e.,
supply a voltage to the DI, so that the DI status fully depends on the output of the
external source. The user can select an external source which can offer 3.3V or 5V to
DI channels in order to meet the TTL input level. Generally, the TTL DI presents
high when a measured signal is between 2.0~5V DC, and changes to low when the
signal drops to 0~0.8VDC. The range of 0.8~2VDC is viewed as Tri-State, that means
Figure 2-22 Dry contact and Wet contact for TTL DI connection
components or circuits from the damage caused by noise interference. This function
can be applied to the DI to increase the degree of protection. In most cases, the
isolated DI (IDI) is designed through photo couplers which can transfer a signal
between two separated circuits in an optical way, so that the input level of the IDI can
be up to 25V or higher.
Similarly, the dry contact and the wet contact, mentioned in TTL section, can also
be applicable to the IDI (see Figure 2-19). A pull-high resistor makes the IDI stay high
in the first place. When the IDI channel is connected to the GND through the dry
contact, the IDI status changes to low. If the wet contact is utilized, the IDI status will
be subject to the external source. For example, the IDI of PCI-1750 presents high if
Figure 2-23 Dry contact and Wet contact for Isolated DI connection
It is worth stressing that the DI can act as interrupt triggering. An interrupt relative
to a change in state for each DI channel equips users to monitor the DI status more
efficiently. Three types of interrupt users can take advantage of include Event
The event trigger is commonly adopted compared with the other two. With this
function, if the state of the DI changes, an interrupt signal will be generated and
delivered to the system to handle this event. The event trigger can be activated by a
rising edge, a falling edge, or both at the same time, this setting should be based on
users application. For instance, if a user wants to give an alarm as soon as the
smoke detector. Once the DI status changes, the DI card will send an interrupt to the
Similar with the event trigger, the status change function can help users to monitor
changes in state of DI channels. It can monitor the status of the enabled digital input
channels and when one of the enabled channels changes its state, the DI card will
deliver an interrupt signal to the system to handle this event. It means we can detect if
there is any status change for several channels by using the status change function.
The pattern match offers a way to check whether changes in some specific DI
channels simultaneously meet the criteria preset by users. That is to say, the status of
DI channels is under supervision and the comparison between the measured and the
pre-defined is made constantly. When the measured matches the pre-defined, the DI
card will deliver an interrupt signal to the system for further processing. For example,
we can set a default value (i.e., FF) of one DI port, and there will be an interrupt once
all the DI channels are high which means FF. This function releases the CPU from
the burden of polling all of I/O points, and enables the PC to handle more I/O points
Digital Output (DO) is used to interpret a command from the computer and then
output two-level voltages (i.e., high or low) to following devices. For example,
to machinery, the DO can serve as a switch and make these happen in an easy way.
Figure 2-24 The Digital Output card can do On/Off control or act as a switch
Table 2-5 shows common spec. items about the DI, including output type, output
Three output types of the DO are available for users, namely TTL, Isolated
and Relay. As mentioned in Section 2.2.3.3 (a), the voltage level of TTL can be
3.3V or 5V. Consequently, the TTL DO means that the output voltage through DO
In terms of the isolated DO (IDO), Figure 2-21 can help users understand how it
works. First of all, a Darlington transistor (i.e., next to 2803) usually comes with the
IDO, and an external source (5 ~ 30 V DC or higher) as well as a load (e.g., bulb, fan)
are always required. When the IDO is enabled (i.e., on), the load is driven by the
external source and the current flows from the external source to the IDO (see the left
diagram). When the IDO is off, the load cant be driven, and the free-wheel diode
goes further to release surplus energy stored in the inductive load (see the right
diagram).
Figure 2-25 The Isolated DO card can work as a switch to control the load loop circuit
The relay is an electrical switch that can open or close one or many sets of contacts
core, a moveable iron armature and a set of contacts. When an electric current goes
over the coil, the magnetic field is generated and forces the armature to leave original
position so as to make or break contacts (i.e., on or off). The relay can switch one or
more poles, each of whose contacts can be thrown by energizing the coil in one of
SPST, with default value of NO, SPST, with default value of NC, SPDT, with one NO and one NC, also
also called Make contact also called Break contact called Break-before-Make contact
Table 2-6 A relay can be classified to three forms
Normally-Open (NO) means that the contact always stays open until the relay is
activated, whereas Normally-Closed (NC) represents that the contact stays closed
until the relay is driven. Besides, SPST (Single Pole Single Throw) indicates that
there is only one contact which can be connected or disconnected, whereas SPDT
(Simple Pole Double Throw) implies that there are two contacts for different
purposes. The pole with NO is also called Form A, the pole with NC is called
The output direction means the direction of current flow in the DO. There are two
types of the output direction, that is, Sink and Source. For the sink type DO, the
current flows into the DO channels (e.g., most of Advantech DO cards), whereas for
the source type DO, the current flows from the DO channels (e.g., PCI-1752USO).
Figure 2-22 can give you a clear picture about the difference between the sink and
source type DO. To select sink or source type, please base on the current flow
Figure 2-26 The output direction of the Sink and Source type
The power-on status function allows users to determine what DO value should be
outputted after the system reboots. This value can be the default setting or the same
with the last one before the system restarts. In other words, this function can resume
the DO value from where the DO value leaves off when the system reboots. It is
worth noting that this function helps users get rid of danger caused by wrong action
after unexpected system reset. If users want to make this function available, jumpers
Figure 2-27 The jumper which can set the power on configuration after hoe reset
2.2.3.5 Counter
The counter is usually used to count the number of events (total count value),
measure the duration of a pulse (pulse width) and calculate the rate of pulses
(frequency). For example, we can use a counter to read how many pulses you input
now, and further use the count value to divide by the time elapse so that we can know
Figure 2-28 The Counter Card can do counting for the events
Common specification about the counter is shown in Table 2-7. Due to the fact
that the counter function is supported by the IC chip 82C54 in most cases, this
pacer trigger for AD conversion. It includes three independent 16-bit counters which
can count values from 0 to 65535 (i.e., 2 16). Each counter has its own clock input,
control gate and output. Normally, one counter is used as an event counter to calculate
how many events coming from the input channel, the other two can be cascaded
together to form a 32-bit timer/counter. In fact, the 82C54 can support six operating
modes, that is, mode 0 - stop on terminal count, mode 1 - programmable one-shot
information about these six modes, please refer to the datasheet of 82C54.
After introducing the basic knowledge of the DA&C system, we will instruct you
how to select the DAQ products from Advantech in this Chapter. First of all, the
Naming Rule and the I/O interface will be introduced, and then we will take some
simple examples so that you can know how to select the right products for your
application.
There are many kinds of products with different I/O interfaces in Advantechs
catalog such as ISA, PCI, USB and CPCI interface. These I/O interfaces can be used
as a communication boundary between the computer and the DAQ card. To know the
Naming Rule of the DAQ cards, we have to understand the concepts of the I/O
interface first.
The 16-bit ISA interface is defined by the IBM PC/AT and it is also called the AT
Bus. Its data transfer rate is only 8.33MHz which is 16.66Mbytes/s (8.33MHz * 2
bytes). And the most significant feature of the ISA interface is that it can not support
PnP (Plug and Play) function, so we have to configure the setting in the software to
make sure it is corresponding to the setting on the hardware. By the way, since the
performance and transfer quality of the ISA bus are not as good as the ones of the PCI
As shown in the Figure 3-2, the PCL-818HG (HG means High Gain) is one of
our famous products. It is an ISA card which has AIO and DIO function, and we have
to set the base address or IRQ jumper manually on the card in order to configure the
device.
The Peripheral Component Interconnect interface which means PCI is the most
common interface in modern computer. It had displaced the ISA bus as the standard
expansion bus. Compare to the ISA bus, there are several superiorities for the PCI
bus. For instance, the data transfer rate for the 32-bit PCI standard bus can be as high
as 133Mbytes/s (33MHz), and the PCI bus can support PnP function so that the
system will configure the device setting automatically. Besides, most of the PCI bus
can support either 5V or 3.3V power suppliers (lower than ISA bus) which we usually
call the Universal Bus. Please refer to the Figure 3-3 to find the difference between
Figure 3-31 The Universal Bus and the difference between the 5V board and 3.3V board
We can compare the PCI interface in the Figure 3-4 with the ISA interface in the
Figure 3-1. This PCI card is PCI-1710HG which is also a multifunction card and the
HG is short for the High Gain. It means we can use the card which can support
3.1.3
CPCI Interface
interface with a different physical form factor. The CPCI interface utilizes the
Eurocard form factor popularized by the VME bus (Versa Module European bus) and
is usually defined for both 3U (160mm deep * 100mm high) and 6U (160mm deep *
The data transfer rate for the 32-bit CPCI bus is 133Mbytes/s (33MHz) and can
also support 256 buses as well as the PCI bus. In addition, the CPCI has the staged
power pins for Hot Swap capability, and the excellent shock and vibration resistance
characteristics which can be used in critical applications. Some CPCI cards also have
The Figure 3-6 shows the MIC-3714 which is a 4-channel AI card. Since there
has one ADC (Analog-to-Digital Converter) for each channel, this card can acquire
3.1.4
USB Interface
Up to now, the Universal Serial Bus (USB) interface is becoming popular and has
replaced many legacy varieties of the serial and parallel ports. It is because most of
the USB devices are small and are convenient to carry, and they usually consume little
power. The USB interface can also support PnP and Hot Swap function so that we can
connect the USB device without turning off the computer. Besides, the USB interface
can be easily expanded by using the Hub device and it can connect up to 127 USB
devices on one computer. So far the data transfer rate of the USB interface can be up
to 480Mbit/s (USB 2.0, High-Speed) and it is 40 times faster than the data transfer
rate of USB1.1 (12Mbit/s for Full Speed devices, 1.5Mbit/s for Low Speed) around 10
years ago.
Advantech has several USB devices, for example, the USB-4716 which is shown
in the Figure 3-8 is a multifunction USB module. Its sampling rate is 200kS/s by high-
computer.
This section will introduce the Naming Rule of the DAQ cards of Advantech.
First of all, please refer to the Figure 3-9 and Table 3-1 which show the Naming Rule
Multifunction Card PCL-711B 40 kS/s, 12-bit, 8-ch SE Input ISA Multifunction Card
PCL-812PG 30 kS/s, 12-bit, 16-ch SE Input ISA Multifunction Card
PCL-818HG/HD/L 100 kS/s, 12-bit, 16-ch ISA Multifunction Card
(L: 40 kS/s)
Analog Input Card PCL-813B 25 kS/s, 12-bit, 32-ch SE Isolated Analog Input ISA Card
Analog Output Card PCL-726 12-bit, 6-ch Analog Output ISA Card with 32-ch DI/O
PCL-727 12-bit, 12-ch Analog Output ISA Card with 32-ch DI/O
PCL-728 12-bit, 2-ch Isolated Analog Output ISA Card
Non-Isolated DI/O PCL-720+ 64-ch Digital I/O and Counter ISA Card
PCL-722 144-ch Digital I/O ISA Card
The Figure 3-10 and Table 3-2 show the Naming Rule and series products of
Multifunction Card PCM-3718H/HG/HO 100 kS/s, 12-bit, 16-ch Multifunction PC/104 Module
Analog Output Card PCM-3712 2-ch Analog Output PC/104 Module
Non-Isolated DI/O PCM-3724 48-ch Digital I/O PC/104 Module
PCM-3753I 96-ch Digital I/O PCI-104 Module
Card
Isolated DI/O Card PCM-3725 8-ch Relay and Isolated Digital Input PC/104 Module
PCM-3730 16-ch Isolated Digital I/O PC/104 Module
Counter Card PCM-3780 2-ch Counter/Timer with 24-ch DI/O PC/104 Module
Table 3-9 Advantech PC-104/PCI-104 interface DAQ cards
The Figure 3-11 and Table 3-3 show the Naming Rule and series products of
Multifunction Card PCI-1710/L/HG/HGL 100 kS/s, 12-bit, 16-ch PCI Multifunction Card
PCI-1711/L 100 kS/s, 12-bit, 16-ch SE Input PCI
Multifunction Card
PCI-1712/L 1 MS/s, 12-bit, 16-ch PCI Multifunction Cards
PCI-1716/L 250 kS/s, 16-bit, 16-ch PCI Multifunction Cards
PCI-1718HDU/HGU 100 kS/s, 12-bit, 16-ch Universal PCI
Multifunction Cards
(D: DB-37)
PCI-1741U 200 kS/s, 16-bit, 16-ch Universal PCI
Multifunction Card
PCI-1742U 1 MS/s, 16-bit, 16-ch Universal PCI
Multifunction Card
Analog Input Card PCI-1713 100 kS/s, 12-bit, 32-ch Isolated Analog Input PCI
Card
PCI-1714U 30 MS/s, 12-bit, Simultaneous 4-ch Analog Input
PCI Card
PCI-1721 12-bit, 4-ch Advanced Analog Output PCI Card
DI/O
PCI-1724U 14-bit, 32-ch Isolated Analog Output Universal
PCI Card
PCI-1727U 14-bit, 12-ch Analog Output Universal PCI Card
Card Card
PCI-1737U 24-ch Digital I/O Universal PCI Card
PCI-1739U 48-ch Digital I/O Universal PCI Card
PCI-1751 48-ch Digital I/O and 2-ch Counter PCI Card
PCI-1753/1753E 96-ch Digital I/O PCI Card/96-ch Digital I/O
Card
PCI-1752U/USO 64-ch Isolated Digital Output Universal PCI Card
1758UDI/UDO/UDIO
Isolated DI with Relay PCI-1760U 8-ch Relay and 8-ch Isolated Digital Input
Card
PCI-1762 16-ch Relay and 16-ch Isolated Digital Input PCI
Card
Counter Card PCI-1780U 8-ch, 16-bit Counter/Timer Universal PCI Card
Table 3-10 Advantech PCI interface DAQ cards
The Figure 3-12 and Table 3-4 show the Naming Rule and series products of
Multifunction Card MIC-3716 250 kS/s, 16-bit, 16-ch CPCI Multifunction Card
Analog Input Card MIC-3714 30 MS/s, Simultaneous 4-ch Analog Input CPCI
Card
Analog Output Card MIC-3723/3723R 16-bit, 8-ch Non-isolated Analog Output CPCI
Cards
Non-Isolated DI/O Card MIC-3753/3753R 72-ch Digital I/O CPCI Cards
Isolated DI/O Card MIC-3756 64-ch Isolated Digital I/O CPCI Card
MIC-3758 128-ch Isolated Digital I/O CPCI Card
Isolated DI with Relay Output MIC-3761 8-ch Relay and Isolated Digital Input CPCI Card
Card
Counter Card MIC-3780/3780R 8-ch Counter/Timer CPCI Cards
Table 3-11 Advantech CPCI interface DAQ cards
The Figure 3-13 and Table 3-5 show the Naming Rule and series products of
Multifunction Card USB-4711A 150 kS/s, 12-bit, 16-ch Multifunction USB Module
USB-4716 200 kS/s, 16-bit, 16-ch Multifunction USB Module
Analog Input Card USB-4718 8-ch Thermocouple Input USB Module with 8-ch
Isolated DI
Non-Isolated DI/O Card USB-4751/4751L 48-ch Digital I/O USB Module
(L: 24-ch)
Isolated DI/O Card USB-4750 32-ch Isolated Digital I/O USB Module
Isolated DI with Relay Output USB-4761 8-ch Relay and 8-ch Isolated DI USB Module
Card
Hub USB-4622 5-port USB 2.0 Hub
Table 3-12 Advantech USB interface DAQ cards
measurement, monitoring and applications control, the first step is to know the source
for what you need. This section will guide and help you to choose components for
Decide whether your DA&C system will be used primarily for measurement,
monitoring, control or analysis. Know the data requirements of your process, and
know the number of data collection points in your system. Knowing the required data
collection speed, the sampling rate, the type of measurement, the voltage or current
being produced, the desired accuracy and the output resolution at each data collection
point. Finally, know the timing of events in your system, and any special environment
Select the hardware required to achieve your fundamental goal. Advantech provides
Both ISA and PCI bus products are available. Your hardware selection should be
3. Resolution
2. Cables, signal conditioners and external boxes such as screw terminals or BNC
accessories.
Advantech also provides many kinds of the cables and wiring boards for your
application. Please refer to the Table 3-6 which shows all the signal conditioning
modules and terminal boards in Advantech. For the information of cables, please refer
(B: 24-ch)
PCLD-785/785B 16-ch Relay Output Board
(B: 24-ch)
PCLD-885 16-ch Power Relay Output Board
PCLD-786 8-ch SSR I/O Module Carrier Board
PCLD-7216 16-ch SSR I/O Module Carrier Board
PCLD-788 Relay Scanner/multiplexer Board (CE)
PCLD-789D Amplifier and Multiplexer Board
PCLD-8115 Industrial Wiring Terminal Board with CJC Circuit
PCLD-8710 Industrial Wiring Terminal Board with CJC Circuit
PCLD-8751 48-ch Opto-Isolated Digital Input Board
PCLD-8761 24-ch Opto-Isolated Digital Input/ 24-ch Relay Board
PCLD-8762 48-ch Relay Board
Pin-to-Pin Wiring Board ADAM-3909 DB-9 Wiring Terminal for DIN-rail Mounting
ADAM-3920 20-pin Flat Cable Wiring Terminal for DIN-Rail
ADAM-3925 DB-25 Wiring Terminal for DIN-rail Mounting
ADAM-3937 DB37 Wiring Terminal for DIN-rail Mounting
ADAM-3950 50-pin Flat Cable Wiring Terminal for DIN-rail
Mounting
ADAM-3951 Wiring Terminal Module with LED Indicators for DIN-
rail Mounting
ADAM-3962 DB62 Wiring Terminal For DIN-rail Mounting
ADAM-3968 68-pin SCSI-II Wiring Terminal for DIN-rall Mounting
Mounting
ADAM-39100 100-pin SCSI-II Wiring Terminal for DIN-rail
Mounting
Table 3-13 Advantech signal conditioning modules and terminal boards
More than any other single factor, software will determine your system start-up
time, as well as its effectiveness, suitability for your application, and ease of
Here we take some examples to show you how to select a suitable DAQ card in
Advantech.
Example 1: The customer would like to choose a card that has AI/O, DI/O, and
Example 2: The customer would like to choose a card which could measure
Temperature directly.
thermocouple module. By using our driver, it can convert the voltage signal from
thermocouple input.
Figure 3-43 USB-4718 (8-ch Thermocouple Input USB Module with 8-ch Isolated DI)
Solution: Since there are only 8 PCI slots on the customers computer, each PCI
DAQ card must have 125 DI/O channels (1000 points/8 slots). For this reason,
the customer can choose the PCI-1758UDI which has 128 DI/O isolated
channels. Therefore, there will be totally 1024 DI/O channels for the customers
Up States function so that the DO status will not changed even if the system is
hot reset.
Figure 3-44 PCI-1758UDIO (128-ch Isolated Digital I/O Universal PCI Card)
As we know, the speed of PC is getting faster and faster today, and more and
more users would like to choose PC as the platform for their application. Therefore,
Advantech also develops drivers based on the Windows system for the DAQ products
so that the users can set up their application under Windows system easily. This
Chapter will instruct you how to use the DAQ card of Advantech, how to startup
DAQ cards, the driver installation, and how to test Advantechs DAQ cards in the
Utility.
This section will first introduce the utility Advantech Device Manager. And
then guide you how through the installation of Advantechs DAQ cards which
includes ISA cards (have to install manually), and PCI, USB and CPCI cards (Plug-
and-Play devices) on the computer. We will also instruct you how to use the
Advantech Device Manager with Advantechs DAQ cards to do some tests to check if
The Advantech Device Manager is a convenient utility which can allow you to
configure the hardware and store the settings in the Windows registry. These settings
will be used when you call the APIs of Advantech 32-bit Device Drivers.
Now we will use USB-4716 as an example to show each function of this utility.
Please follow the steps to install the driver and utility, and learn how to do the test in
1. Please install the driver of USB-4716 and the Advantech Device Manager which
Figure 4-45 Install Driver and Advantech Device Manager from the driver CD
2. You can also download the files from the Advantech Support & Download
website.
http://support.advantech.com.tw/Support/SupportCategoryView.aspx?ID=1-2MLJZA
Please search the USB-4716 product and you can find the Universal 32-bit
http://support.advantech.com.tw/Support/DownloadSearchByProduct.aspx?
keyword=USB-
4716&ctl00_ContentPlaceHolder1_EbizTabStripNoForm1_Tab=Driver
Then please download the Advantech Device Manager and the driver of USB-
Figure 4-48 Download the Advantech Device Manager and the driver of USB-4716
3. After the installation, you can connect USB-4716 to the computer and you will
see the USB-4716 in the Installed Devices list in the Advantech Device
Manager. The Device Number is used to specify the device in the software
program while the BoardID is used to identify cards of the same type. The
Control Button is to let you configure the device setting, test the basic functions,
4. Click the Setup button and you can set the driver default device property
values, these values will be saved in system. The device properties will be
BoardID: USB device has a virtual Board ID. It is the ID of device. When
there are multiple USB devices connected to Host, we can use this ID to identify each
device. This ID exists in EPROM of USB device, so it will not disappear or change
when the module is powered off. It can be set form 0~15 (Default is 0). Please note if
multi-devices are connected to the Host, each device must have different Board ID
or Host will fail to find the device. And we can find the device with specified Board
AO Channel 0/1 Ref: Set the D/A reference voltage for the A/O output channel.
6. First of all, please click on the Analog input tab in the test utility and the analog
input test panel will appear as shown in the Figure 4-7. Select the range for each
channel in the Input range field. Configure the sampling rate by dragging the
7. Click on the Analog output tab to switch to the analog output test panel as
shown in the Figure 4-8. The panel allows the sine, square, and triangle
manually. Configure the waveform frequency by dragging the scroll bar. Switch
8. Click on the Digital input tab to switch to the digital input test panel. The up or
9. Click on the Digital output tab to switch to the digital output test panel. By
pressing the buttons on the panel, the desired values may be outputted to the
corresponding ports. The up or down arrows may be used to switch the digital
output channel.
10. Click on the Counter tab to switch to the counter test panel. The panel provides
event counting and pulse output functions. The pulse frequency may be
configured by scrolling the scroll bar. The counter channel may be switched by
For the ISA cards, we take PCL-818L (40 kS/s, 12-bit, 16-ch ISA Multifunction
Card) as an example.
1. Install the Advantech Device Manager and Drivers from the driver CD or
Advantech website.
2. After the installation, we have to check the system resource to install the PCL-
818L manually since ISA cards (PCL and PCM series) can not support Plug-and-
Play function.
3. First of all, please check the Base I/O Address in the Windows Device Manager.
You can see that the address 300-376H is not shared by other add-on devices in
Figure 4-56 Check the Base I/O Address in the Device Manager
4. Please check the Interrupt Request (IRQ) in the Windows Device Manager. You
can see that the IRQ 7 is not shared by other add-on devices in the Figure 4-13.
5. Please check the DMA channel in the Windows Device Manager. You can see that
the DMA channel 1 is shared by other add-on devices in the Figure 4-14.
6. Please refer to the hardware manual of PCL-818L to set the jumper and switch on
the PCL-818L card. For example, the Figure 4-15 shows how to set the Base I/O
Address.
7. Scroll down the List of Supported Devices and select the PCL-818L to be
installed. Click the Add button to install the PCL-818L in the Advantech
8. After clicking the Add button, a configuration dialog box will load for the
specified device as shown in the Figure 4-17. Please set the device configuration
in the Advantech Device Manager. Please also note the software setting should be
corresponding to the hardware setting. And the resource (Base Address, IRQ and
Figure 4-61 Set the device configuration in the Advantech Device Manager
9. After configuring the device, click the OK button and the device will be shown
in the Installed Devices field as shown in the Figure 4-18. Then we can do some
10. As shown in the Figure 4-19, the AI0 will read 2.5V by inputting a 2.5V DC
voltage signal to the AI0 channel. You can also do the test with other functions
For the PCI, USB and CPIC cards, we do not need to install the devices
manually since they can all support Plug-and-Play function. And here we take PCI-
1. Install the Advantech Device Manager and Drivers from the driver CD. Or you
can also download the files from the Advantech Support& Download website.
http://support.advantech.com.tw/support/DownloadSRDetail.aspx?SR_ID=1-O1VSR
2. After the installation of the driver, we can plug the PCI-1710HG card on the PC
directly and the hardware will be installed after the PC boots or re-scans the
devices in Windows Device Manager. All the bus-related configurations (Ex. Base
3. In the Setup, you can set the Device Configuration such as the A/D channels
Click the Options button, a window will pop up and you can select the expansion
board for the extended application (Ex. use PCLD-8710 to measure the temperature).
On the other hand, you can do the Auto-calibration of the AI can AO functions by
clicking the Calibration button. For more information about the calibration, please
4. By testing, we can set the analog output value in the AO tab. Here we set the
5. Then connecting AO0 channel to AI0 channel directly, you can see the AI0 will
6. Now we do the DIO test. In the beginning, you can see all the DI statuses are
High as shown in the Figure 4-26. It is because there are pull-up resistors in the
DI channels of PCI-1710HG.
By connecting the DO0 channel to the DI0 channel, the DI0 status will become
Low since the DO0 status is Off which means there is no voltage output.
Whenever you On the DO0 button in the DO tab, the DI status will become
7. Finally, we can test the counter function by inputting a TTL signal to the counter
of PCI-1710HG. As shown in the Figure 4-29, the counter starts to count by the 1
WaveScan2.0 is another Advantechs useful utility which makes it easier for the
user to acquire, observe and store data. This utility is based on the ActiveDAQ GUI
control and the ActiveDAQ Pro Device control. With data acquisition and data display
functions provided by the controls, WaveScan2.0 can achieve the purpose of real-time
monitoring and history checking. In this section, we will instruct you how to use the
WaveScan2.0 utility and will also take an example for your reference. For the
ActiveDAQ Pro device and GUI controls, we will introduce them in the Chapter 5.
1. Please refer to the Figure 4-30 for the main interface and interface elements of the
WaveScan2.0 first.
2. The Popup menu contains various mouse modes: XPan, YPan and etc.
is high]
4. The Plot data line style is used to show different curve styles for AI or DI
5. The History Playback GroupBox contains controls related with the playback
6. The Start button is used to begin or stop data acquisition. The HistoryMode
button is used to switch between data acquisition mode and historical data
playback mode.
7. The Device GroupBox contains the button for opening the device
configuration page. It also contains the storage options for AI/DI data.
8. The Graph GroupBox contains the button for adjusting the resolution of the
area and the button for opening the Graph configuration page.
9. The Signal GroupBox is used to select the data source between AI data, DI
2. By clicking the Setting button in the Device GroupBox on the main interface, a
window will pop up and you can set the FAI (Fast Analog Input), soft AI and/or
DI configuration here.
For the FAI setting, please refer to the Figure 4-31. You can click the
SelectDevice button to select a device. The start channel, channel count and data
count should be set. The return data type should be set to analog or digital. If Cyclic is
selected, then AI operation will function cyclically. External triggering can be selected
in the drop-down box of PacerSource for acquisition cards that support external
PacerSource. The user can specify advanced properties in the Trigger Setting
GroupBox. When fast AI is used, if data loss occurs, then the user should increase the
For the Soft AI and/or DI setting, please refer to the Figure 4-32. In the Soft AI
function, you only need to set the start channel, the channel count and the acquisition
interval for AI operation. While in the Soft DI function, you only need to set the
device for DI operation, the DI channel for acquisition and the shared acquisition
3. For the Gain Setting, please click the SetRange button to open the
RangeSetting dialog box. In the dialog box, you can set the gain of each channel
by using the control in the InputRange GroupBox and set each channel to single-
and PCI1718HG + PCLD-8710 are supported; for other cards, the AI | Thermo
GroupBox will be disabled.), channels can be set for temperature data acquisition.
You can set the current channel to acquire temperature data by clicking Thermo in the
AI | Thermo GroupBox and then the ExpChan (reserved) and TCType (thermocouple
4. Now we will use the Advantech DEMO Board as an example to show how to use
the WaveScan2.0 to acquire and store data. Please select the Advantech DEMO
After clicking the Add button, a window will pop up to let you set the Base I/O
Figure 4-80 Set the Base I/O Address of the Advantech DEMO Board
5. Then please click the Setting button in the Device GroupBox to open the Setting
page. And you can just follow the setting as shown in the Figure 4-32. When the
software triggering acquisition will be enabled when the Start button is clicked.
6. To store historical data, select the corresponding check box in the Device
Figure 4-81 Start the AI acquisition and store the historical data
7. The WaveScan2.0 can store temporary data when storing data during the
store data to the specified path and folder and then a file with the suffix .wsp
(WaveScan2.0 project) will be generated. You can open this file for history
playback. Please note the data loss will occur if the data has not been stored before
8. For historical data playback, you should click the History button in the Signal
GroupBox and select the file from the file dialog box.
9. The file is played by the control in the PlayBack GroupBox. The buttons indicates
start/pause, accelerate and stop respectively. You can also adjust the playing speed
and process by clicking on the playing speed and playing process sliders on the
left.
10. The Convert button is used to convert historical binary data to text data in order
To have a complete DA&C system, we have to learn not only the basic
knowledge of DA&C modules but also how to use the driver for the programming.
Advantech provides several drivers for the user to develop their programming on their
driver and so on. This Chapter will introduce the Advantech drivers first, and then
The Advantech Device Driver which also called 32-Bit DLL driver is the base of
all other drivers in Advantech. It means no matter what software program we want to
use for controlling the hardware, it has to be commanded through the Advantech
Device Driver. As shown in the Figure 5-1, different users will use different software
programs for their different applications, for example, Visual C++, Visual Basic,
different kinds of drivers for these software programs so that the user can control the
DAQ cards easily. But all these drivers are relative to the Advantech Device Driver, so
it is a MUST for Advantechs DAQ cards. And so far the Advantech Device Driver
For the features of the Advantech Device Driver, it can provide comprehensive
same programs can be easily adopted by different cards with the same functions. This
driver can support high-speed functions that utilize DMA or interrupt for data
acquisition. The DMA transferring of data uses less CPU time and speeds the data
transfer rate. These functions are used to transfer large amounts of data at high speed.
And the Advantech Device Driver can also support event handling functions. Users
can get the status of data transferring and acquisition when events are signaled within
the device. Manual status check is not necessary. This improves the system efficiency.
Besides, except the installation of the Advantech Device Driver while using the
DAQ card, we also have to install the Advantech Device Manager to let the device
work since it includes the ADSAPI32.DLL file. Please refer to the Figure 5-2, the
ADSAPI32.DLL file is a bridge between the Advantech Device Driver and other
drivers in Advantech.
We provide a lot of examples and sample codes for Visual C, Visual Basic, Borland
C and Delphi so that the user can develop the application by programming more
easily. You can find the All_Examples file in the Examples folder in driver CD, or
http://support.advantech.com.tw/support/DownloadFile.aspx?File_Id=1-
2NE5PI&Solution_ID=1-
94DDU&filename=All_Examples.zip&utm_campaign=All_Examples.zip&utm_sour
ce=support.advantech.com.tw&utm_medium=Download
After the installation, you will find the libraries and examples in the folder as
To know how to build an application by sing the Advantech Device Driver in VC,
performing I/O operations within any compatible ActiveX control container, such as
Visual Basic, Delphi and .Net environment, etc. Compared to the Advantech Device
Driver, you can easily perform the I/O operations through properties, events and
methods with the ActiveDAQ Pro driver. And you can also perform versatile I/O
operations to control your Advantech DAQ devices. But please note the ActiveDAQ
Pro driver is still based on the Advantech Device Driver as shown in the Figure 5-6.
Therefore, you still have to install the Advantech Device Driver before using the
device.
device.
thermocouple measurement.
You can use these ActiveX controls in any development tool that supports them,
including Microsoft Visual C++, Microsoft Visual Basic, Borland C++ Builder,
In the ActiveDAQ Pro driver, efforts have been made to improve on the technical
summary.
Graphic User Interface (GUI) control components, which enable users to conveniently
and quickly build graph display modules for data acquisition so as to supervise the
evolution of the object. The ActiveDAQ Pro GUI control collection also helps users
Button Control: It offers various display styles (2D and 3D) and is a
graph styles and can be used to display one or more values on the same
interface.
LED Control: This control provides data display and editing functions with
the seven-segment nixie tube mode. After the Formatstring has been chosen
or defined by the user, the displayed value of the control will be adjusted
box.
interpolation for scattered 3D data points so that the user can conveniently
NumEditor Control: This control provides the user with the functions of
data displaying and editing. After the Formatstring has been chosen or
defined by the user, the values of the control will be adjusted automatically
graph styles. A Slider control can be used to set or display one or more
values.
The ActiveDAQ Pro driver can fully support all Advantech DAQ cards and
functions with complete high speed data acquisition, including AI, AO, DIO and
counter cards. These high speed functions are preformed by interrupt and DMA data
The ActiveDAQ Pro driver has become less-hardware dependent and it has relied
more on intuition during the user interface. The target of this driver is to decrease the
development difficulties. It has become easier for both entry level and advanced level
users to manage. And the ActiveDAQ Pro driver can offer total independent control
The property page will offer selections which will give easy access to all settings
specialized situations. Besides, physical properties like voltage, current and frequency
can be directly applied by the user and will automatically be reassigned to the data
needed by GainCode and sampling rate. Making these changes has ensured that the
Proper default settings have been added to all methods and properties. That
means quicker execution for the user, which will offer a prompt response.
When the user opts for some specific methods in the ActiveDAQ Pro driver, it
can result automatically in appropriate properties and parameters. For example, the
The ActiveDAQ Pro driver can support Microsoft Windows 2000/XP and Vista
operation system. And it can support all widely known development platforms based
on ActiveX technology. These platforms include Microsoft Visual Basic, Visual C++,
For the installation of the ActiveDAQ Pro driver, please find the file in the driver
http://support.advantech.com.tw/support/DownloadSRDetail.aspx?SR_ID=1-29WPJY
After the installation, you can find the examples of the ActiveDAQ Pro Device
and GUI controls in the folder as shown in the Figure 6-12. We provide examples for
Figure 5-98 Examples for the ActiveDAQ Pro Device and GUI controls
To know how to add or use the ActiveDAQ Pro ActiveX controls in different
(Virtual Instrument). Every VI in LabView has three main parts; the first one is the
front panel, the second is the block (or wiring) diagram window and the last one is the
the user to control Advantech DAQ cards in the LabView program. These two drivers
are totally different, but they can both work with LabView version 7, 7.1, 8.0 or
higher. And they can both form an interface between the Advantech Device Driver,
which contains all the relevant functions to control the DAQ cards, and the LabView
software. It means the Advantech LabView drivers can form a VI in the LabView
package, which enables other applications to be used in conjunction with the DAQ
cards.
Figure 5-100 Through the structure, Advantech LabView driver becomes NI Style
For the installation of the Advantech LabView Drivers, please find the files in the
http://support.advantech.com.tw/support/DownloadSRDetail.aspx?SR_ID=1-29WTFD
Cards with the LabView software. This driver feature has both high speed and normal
speed data acquisition functions, and provides two different set of interfaces for users.
One is Easy I/O VIs for ease-to-use, and the other is Advanced I/O VIs for
complex applications. You can find these VIs in the User Libraries in the LabView
Besides, we also provide a lot of LabView examples which includes fast AI, fast
AO, PortIO, slow IO and other aspects for the users to develop their application
quickly. You can find these examples in the folder as shown in the Figure 5-18. For
1. Easy VIs perform simple operations. You can run these VIs from the front
panel or use them as subVIs in basic applications. They provide a basic, convenient
interface with only the most commonly used inputs and outputs, such as AI, AO, DIO,
and Counter/Timer functions. They are actually composed of Intermediate VIs. Unlike
Intermediate VIs, Easy VIs automatically alerts you to error with a dialog box that
developing applications than Easy VIs. Utility VIs consist of convenient groupings of
Intermediate VIs. Intermediate VIs are used in most applications. Each Intermediate
and Advanced VI contains an error in input cluster and an error out output cluster,
which give you more control over error handling than Easy VIs. With each VI, you
can check for errors or pass the error cluster to other VIs. In each data acquisition
palette, for Intermediate VIs, there are calling flows available for guidance.
3. Utility VIs are also intermediate-level VIs. They are for situations where you
need more functionality control than the Easy I/O VIs provide but want to limit the
For using the LAbViewDAQ VIs, please install the driver which can be found in
the driver CD, or you can also download it from the website.
http://support.advantech.com.tw/support/DownloadSRDetail.aspx?SR_ID=1-29WTFD
After the installation, you can find the LabViewDAQ VIs by right-click on the
block diagram window in the LabView program. And then select Fucntion ->
All Functions -> User Libraries -> Advantech DAQ as shown in the Figure 6-
19.
Furthermore, it is deserved to mention that the LabViewDAQ VIs can replace NIs
DAQ VIs. This function was made especially for the users who use NI DAQ card and
have developed their own application in LabView before. In the past, these users must
have to modify their LabView program if they want to replace the NI DAQ card with
the Advantech DAQ card. But now, they can just use the LabViewDAQ VIs to replace
the NI VIs since the pin assign of the LabViewDAQ VI is identical to NI DAQ VI.
Therefore, by replacing the VI, existing programs based on NI DAQ driver can be
To know how to replace NI DAQ VIs, we make a demo video which can be
available on the website to show you the process. Generally, all examples that NI
http://support.advantech.com.tw/support/KnowledgeBaseSRDetail.aspx?SR_ID=1-
1Y5SWB
2. While running with the Advantech DAQ card (Ex. PCI-1714), there will be an
Figure 5-106 The NI VIs can not support the Advantech hardware
3. Then please right click the VI and replace it by LabViewDAQ VI. Please also
5. Running again, you can find that this example can already work with the
So far, we have already introduced all the basic knowledge for the Advantech
DA&C system. Now we want to instruct you to know how to control the Advantechs
DAQ cards by programming. And since most of the users would like to acquire their
data in a High Speed which also means High Sampling Rate, our driver provides
some API (Application Program Interface) to support the INT and DMA functions
which are introduced in the section 2.3.2.1. By using these API, the user can achieve
the purpose of High speed analog data acquisition. So in this section, we will not
only introduce the programming of the software polling, but will also specially
introduce the INT and DMA functions to let you know how they work by
programming. And finally, we will guide you to complete a project for the
ActiveDAQ Pro Driver. After this, we believe you will be more familiar with our
By referring to the Figure 5-25 or in the Drivers Manual, we can find all the
functions we can use to trigger the data conversion by software command. The driver
provides two kinds of functions. One is for single channel reading such as
sample multiple data periodically by these functions, a software timer can be used to
Now please refer to the AD_SOFT examples for VC program which you can find
open the corresponding installed device by its device number (DeviceNum) and return
the DriverHandle for later operations. Please note this function must be called before
any other methods that perform I/O operations. Then we can use the
Hardware Manual for detailed information on input voltage range and the
corresponding GainCode.
Figure 5-111 Open the device and retrieve/configure the devices features
After that, we can use a timer to read back the current voltage from an AI channel
device after the operation of any function. The user must call this function to release
the resources.
You can refer to the flow chart as show in the Figure 5-28. The DRV_AIConfig
configures the input range for the specified channel. If the input range needs to be
DRV_AIVoltageIn function reads the voltage of input channels. The Device Drivers
also provide a binary data reading function, DRV_AIBinaryIn. The functions for
multiple channel sampling are similar to those for single data reading, except the input
Except for the software polling, all the other analog sampling methods, including
DMA, bus-master DMA, interrupt etc., are identified as FAI (Fast Analog Input)
functions. The operation modeling and flow control in all kinds of FAI sampling
In FAI data operation, the size of buffer is not determined by the FIFO size.
However, before you engage sampling, you must set up your sampling count, i.e. the
data count that you want, while it is also the size of sampling data buffer in our
example. Commonly we need to create a sampling data buffer first and pass the
pointer to the driver for later acquisition. The buffer is created by the user, commonly
according to your sampling count, but used in the kernel mode by the driver. In order
to have enough space and make sure the data not to be lost, the buffer size (sampling
Please refer to the Table 5-1 as below for setting buffer size:
(recommended)
FIFO/2 Size of channels
(recommended)
(recommended)
DMA
Cards without or Interrupt
For the cards using FIFO, if it is sampled by interrupt, the buffer size should be an
even number and a multiple of half the FIFO size, while it is recommended to be a
multiple of the channel count. If it is sampled by DMA, the buffer size should be an
even number. If it is bus-master DMA, there is no limit to the size of buffer, while 4k
for each method needs to be created first and use its pointer as a function parameter in
order to pass all necessary settings, including the previous initiated buffer, to the
driver.
Please note that DAQ cards only support the functions the hardware supports.
For example, PCL-818 supports interrupt and DMA sampling and PCI-1712 supports
bus-master DAM sampling. Trying to call an unsupported function will return an error
code. Please refer to functions support table and the Hardware Manual for more
details.
3. Data transfer
Once the data sampling is engaged, users have to know the current sampling
status and transfer data from sampling buffer to user buffer in time for later operation.
Two methods are used to get the sampling status. One is to enable the required events
(by calling DRV_EnableEvent) and wait for the event notification (by calling
DRV_CheckEvent), then check the status (by calling DRV_FAICheck); the other
When the event is signaled or the checked status indicates that either buffer is full,
call the data transfer function DRV_FAITransfer to fetch data from sampling data
ADS_EVT_INTERRUPT Triggered when a certain number of interrupts occur. The number is specified
two equal parts, the low buffer and the high buffer. Data from the device will fill
them separately. This event will be signaled when either buffer is full.
Applications can call the DRV_FAICheck to check which buffer is full, and
then call the DRV_FAITransfer to take away the data in this buffer. If the data
signaled.
ADS_EVT_TERMINATED Triggered when a high speed analog input operation finishes, or when
ADS_EVT_BUFCHANGE occurs.
DRV_CheckEvent.
Table 5-15 Events supported for FAI transferring
The Figure 5-29 explains how the sampling buffer works and when the data is
transferred:
Figure 5-114 The operation of the sampling buffer and the data transferring
The four graphs as shown above show the sampling buffer working on a proper
cycle:
(1) The sampling data buffer is used as two equal size sections, the 1st half (Low
Half) and the 2nd half (High Half). When the sampling starts, the driver will write
(2) When the DRV_EnableEvent function is called, should the 1st half be full,
the user's program. The user's program should transfer the data in time, otherwise the
(3) At the same time, data sampling keeps going on the 2nd half during the data
transfer.
(4) When the DRV_EnableEvent function is called, should the 2nd half be full,
sampling will be completed for non-cyclic mode, while for cyclic mode, data will log
As described above, if the data has not been transferred in time, the previously
After the sampling, we need to copy the data from the sampling data buffer to the
transfer buffer for analysis (by calling DRV_FAITransfer), so that the transfer
buffer should also be allocated. However, the size of the transfer buffer should be no
less than 2*sampling count bytes when the data type is raw data (2 bytes per raw
data), or no less than 4*sampling count bytes when the data type is float data (4 bytes
DRV_FAITerminate is used to stop the data sampling. When the user calls the
cyclic mode, the driver will stop the operation and free some resources and send the
ADS_EVT_TERMINATED event to the user. Then the user can do operation such
In non-cyclic mode, when the operation completes, the driver will stop
automatically. If the user does not call the DRV_EnableEvent, the event
not be stopped until the user calls the DRV_FAITerminate. Calling the
recommended.
There are two kinds of interrupt operations for analog input. One generates a
hardware interrupt for each conversion. The other one keeps the conversion data in
FIFO, and then generates a hardware interrupt for a half-full FIFO or full FIFO
depending on the hardware. The driver will catch these interrupts. Various events will
Similar to the software polling, this type of transferring also provides two kinds
of functions. One is for single channel reading, and the other is for multiple- channel
reading.
Please refer to the Figure 5-32 which shows the typical function call flow for
event and then starts the analog input operation by DRV_FAIIntStart. The driver
will send a proper event to notify the status of the acquisition progress.
DRV_CheckEvent may then be used to check the signaled event and handle the
time.
Figure 5-117 The flow chart of the FAI transferring by Interrupt (Event Notification)
2. No Event Notification
The DRV_FAIIntStart function starts the analog input operation with interrupt
transferring. The DRV_FAICheck function may be used to check the status of the
notification of the acquisition status will be received. The only way to retrieve the
status is to call the DRV_FAICheck to check the status of the acquisition progress.
Figure 5-118 The flow chart of the FAI transferring by Interrupt (No Event Notification)
Besides single data reading, the driver also provides the DRV_FAIIntScanStart
function for multiple channel reading. For this kind of operation, you should set the
Otherwise, for cyclic mode, the first data in the buffer may not correspond to the
starting channel.
Now please refer to the AD_INT examples for VC program which you can
same as the software polling, we have to use the DRV_DeviceOpen to open the
retrieve the device's features. But please note we have to allocate a buffer for the data
buffer for data storage. At the same time, we can create a thread to do the event check
Figure 5-121 Initiate the FAI (Interrupt) operation and create a thread
In the thread, we can use the DRV_CheckEvent to check whether the buffer
change occurs, and also use the DRV_FAICheck to retrieve the current status of FAI
operations (not ready: 0, first half ready: 1, second half ready: 2). Once there is an
event, the DRV_FAITransfer will transfer data from FAI sampling buffer to user's
Finally, please remember to free the buffer you allocate and use the
releasing resources and sending a terminate event to the user after the data conversion.
If you want to close the program, please use the DRV_DeviceClose to close
Figure 5-122 Check the status of FAI operation and transfer the data
DMA Transferring is the fastest data acquisition type of the analog input operation.
The data directly flows from the device to the memory without the interference of the
CPU. The driver will monitor the progress of the conversion and send a proper event
DRV_FreeDMABuffer must be used to free the allocated DMA buffer. For PCI-
necessary to call these two functions. The DMA buffer size must exceed 4K bytes.
The DRV_EnableEvent function enables the notification event and then starts
DRV_FAIDmaExStart (PCI series cards). The driver will send a proper event to
notify the status of the acquisition progress. DRV_CheckEvent may then be used to
check the signaled event and handle the data. The operation may be stopped by the
Figure 5-123 The flow chart of the FAI transferring by DMA (Event Notification)a
2. No Event Notification
The DRV_FAIDmaStart function starts the analog input operation with DMA
transferring. The DRV_FAICheck function may be used to check the status of the
data. The operation may be stopped by the DRV_FAITerminate function when the
notification of the acquisition status will not be received. The only way to monitor the
progress.
Figure 5-124 The flow chart of the FAI transferring by DMA (No Event Notification)
function for multiple channels reading for ISA series. For PCI series cards,
operation. For such kinds of operation, you should set the acquisition number to a
multiple of the number of channels. Under this configuration, the data will be stored
in the data serially according to the channel number and the first data in the buffer can
always be the first channel's data, which means the data for a specific channel are
always stored in a fixed position in the buffer. Then you can trace the data according
the channel number easily. Otherwise, for cyclic acquisition, the first data in the
circular buffer may not be for the starting channel, so you must trace your data
For the programming of the DMA function, you can refer to the AD_DMA_BM
with the AD_INT: Open device; Get device features; Allocate a memory buffer;
Enable event; Create a thread to check event and retrieve the status of FAI operation;
Terminate the FAI operation finally. The only difference is we will use the
buffer for data storage. For more information, please refer to the examples and the
We will show you in this section a project using the ActiveDAQ Pro controls to do
the programming. After this practice, we believe you will be more familiar with the
First of all, please install the Advantech Device Manager and the ActiveDAQ Pro
driver. Then please follow the steps as below to add the ActiveDAQ Pro controls in
the VB.Net project in Visual Studio 2005. For more information, please refer to the
2. As shown in the Figure 5-42, right-click and select Choose Toolbox Items in the
Toolbox. Then Add the ActiveDAQ Pro Controls in COM Components tab. You
can add the AI, AO, DIO, Counter and other GUI controls here. After clicking the
OK button, you will see the controls are already added in the Toolbox as shown
3. Drag the AI control onto the Form, and right-click to check its properties.
4. To start the programming, you can refer to the Figure 5-45 to design the Form for
AI function. You can create a button to select device, and create two textboxes to
Then create a button to read the AI and also create a textbox (textBox3) to
You will find that the programming steps of the ActiveDAQ Pro drive is the same
example in the Advantech ActiveDAQ Pro Control Help. This property can set an
You can refer to the Figure 5-48 to design the Form for AO function. Double-
click the Send button and modify the example code from the Advantech
ActiveDAQ Pro Control Help. The programming as shown in the Figure 5-49 is for
your reference.
6. For the DIO function, the programming is very easy. You can just use the
channel. And you can also refer to the programming in the Figure 5-52 to use the
Counter function.
Figure 5-138 Design the Form for DIO and Counter functions
7. Finally, you can complete a VB.Net project which has AI, AO, DIO and Counter
Advantech DAQ cards such as PCI-1710 or USB-4716. For example, you can just
the AO output value is correct. The Error-handling mechanism will help you to
Figure 5-139 A VB.Net project which has AI, AO, DIO and Counter functions
Besides, if you want to acquire data in high speed mode, you can refer to example
Control Help. This function can retrieve bulk data from specified AI channels to the
user or control allocated memory using FAI. You need to set the parameter
dataCount as the actual sampled data count and it will be retrieved by the return
value of the method. You also have to use the AdvAI.DataSampleRate to set the
You can just paste the example code onto your project and modify your
programming as shown in the Figure 5-56. After compiling the program, you can do
the test by inputting a signal to the Advantech DAQ devices to check if the reading
value is correct.
If you are still not sure of how to do your programming, you can refer to the
Pro\Device Controls\Examples.
Figure 5-141 The programming for FAI operation by using ActiveDAQ Pro AI control
This Chapter will take an example showing you how to duplicate the customers
problem and do the trouble shooting. We can also do some more analyses with the
One customer had used PCI-1710HG for a long time. In the past, they always used
the platform which has Pentium 4 CPU, and they can measure the temperature with
they encounter Restart and Blue Screen issue (The error massage is
"Multiple_IRP_Send_Request") when using the system which has AMD CPU or Intel
core 2 dual CPU. The problem can be both occurred in the customers program and
1. For this case, we can check some system information first so that we can know
Ans: The customer use AMD Athlon(tm) 7750 Dual-Core CPU on the WinXP system.
Do the customer use the latest driver, and which programming software do the
customer use?
Ans: Yes, the customer already install the latest driver and they use the VC++ for the
programming.
2. Then we can try to duplicate the customers problem so that we can verify it
more easily. But please not we should do the test on the platform which has AMD
Dual-Core CPU.
Ans: Yes, it can read AI values correctly and its version is 1.5.7.1. From this result,
we can confirm that there is n problem with the basic function of the customers card.
When running our example such as AD_SOFT, AD_INT and Thermo, are there
problems?
Ans: Yes, when running the Thermo example, it indeed encounters Blue Screen issue
properly. If using the driver from CD 2.6 version, the API TCMuxRead can only
read the value "NAN". On the AMD platform, both the latest driver and older
3. So far we already duplicate the customers problem, but we can still do some
more tests so that the RD can find the root cause more easily.
Ans: Yes, the system will also return blue screen when running the Thermo example.
If we are using the platform which doesnt support Hyper Threading or Core 2
Ans: Yes, under this situation PCI-1710HG can measure the temperature properly.
From the test results, we can conclude that the problem will only occur on the
Hyper Threading or Core 2 Dual platform. So we can interpret what we do and what