|
|||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||
|
|
T&M Main | Archives | Feedback
Data Acquisition (DAQ) Fundamentals: Part II of a Multi-Part Series (cont.) Digital I/O
Let's turn our attention to Digital I/O. DIO interfaces are often used on PC DAQ systems to control processes, generate patterns for testing, and communicate with peripheral equipment. In each case, the important parameters include the number of digital lines available, the rate at which you can accept and source digital data on these lines, and the drive capability of the lines. If the digital lines are used for controlling events such as turning on and off heaters, motors, or lights, a high data rate is usually not required because the equipment can't respond very quickly. The number of digital lines, of course, needs to match the number of processes that are controlled. In each of these examples, the amount of current required to turn the devices on and off must be less than the available drive current from the board. With the proper digital signal conditioning accessories, however, you can use the low-current TTL signals to/from the DAQ hardware to monitor/control high voltage and current signals from industrial hardware. For example, the voltage and current needed to open and close a large valve may be on the order of 100 VAC at 2 A. Because the output of a digital I/O board is 0 to 5 V dc at several milliamperes, an SSR Series, ER-8/16, SC-206X Series, or SCXI module is needed to switch the power signal to control the valve. A common application is to transfer data between a computer and equipment such as data loggers, data processors, and printers. Because this equipment usually transfers data in one-byte (8-bit) increments, the digital lines on a plug-in digital I/O board are arranged in groups of eight. In addition, some boards with digital capabilities will have handshaking circuitry for communication synchronization purposes. The number of channels, data rate, and handshaking capabilities are all-important specs that should be understood and matched to the application. Timing I/O
Counter/timer circuitry is useful for many applications, including counting the occurrences of a digital event, digital pulse timing, and generating squarewaves and pulses. You can implement all of these applications using three counter/timer signals: gate, source, and output. The gate is a digital input that's used to enable or disable the function of a counter. The source is a digital input that causes the counter to increment each time it toggles, and therefore provides the timebase for the operation of the counter. Finally, the output generates digital squarewaves and pulses at the output line. The most significant specifications for operation of a counter/timer are its resolution and clock frequency. The resolution is the number of bits the counter uses. A higher resolution simply means that the counter can count higher. The clock frequency determines how fast you can toggle the digital source input. With higher frequency, the counter increments faster and therefore can detect higher frequency signals on the input and generate higher frequency pulses on the output. The counter/timer ASIC used on the National Instruments E Series DAQ boards, for example, has 16 and 24-bit counters with a clock frequency of 20 MHz. The DAQ-STC is a National Instruments ASIC designed specifically for DAQ applications. In A League Of Its Own
In comparison with the off-the-shelf counter/timer chips generally used on DAQ boards, the DAQ-STC is in a league of its own. For example, the DAQ-STC is an up/down counter/timer, meaning that it can use additional external digital signals to count up or down, depending on whether the level is high or low. This type of counter/timer can measure positioning from rotary or linear encoders. Other special functions include buffered pulse-train generation, timing for equivalent time sampling, relative time stamping, and instantaneous changing of sampling rate. No discussion would be complete without touching on software. Software transforms the PC and DAQ hardware into a complete DAQ, analysis, and display system. DAQ hardware without software is useless--and DAQ hardware with poor software is almost useless. The majority of DAQ applications use driver software. Driver software is the layer of software that directly programs the registers of the DAQ hardware, managing its operation and its integration with the computer resources, such as processor interrupts, DMA, and memory. Driver software hides the low-level, complicated details of hardware programming, providing you with an easy-to-understand interface. For example, look at the code listing here. It shows NI-DAQ function calls used in C to read and scale a voltage from an analog input channel of an NI Model MIO-16E-10 board. ![]() The increasing sophistication of DAQ hardware, computers, and software continues to emphasize the importance and value of good driver software. Properly selected driver software can deliver an optimal combination of flexibility and performance, while also significantly reducing the time required to develop your DAQ application. When selecting driver software, there are several factors to consider. First, consider which functions are available. Driver functions for controlling DAQ hardware can be grouped into analog I/O, digital I/O, and timing I/O. Although most drivers will have this basic functionality, you will want to make sure that the driver can do more than simply get data on and off your chosen board. Make sure that the driver has the functionality to (1) acquire data at specified sampling rates, and (2) acquire data in the background while processing in the foreground. Moreover, make sure it can use programmed I/O, interrupts, and DMA to transfer data, and make sure it can stream data to and from disk. Also, can it perform several functions simultaneously? Can it integrate more than one DAQ board? Does it integrate seamlessly with signal conditioning equipment? These and other functions of the DAQ driver, which are included in the National Instruments NI-DAQ driver software, can save you a considerable amount of time. Which Operating System?
You must also determine which operating system (OS) you can use with the driver. Make sure that the driver software is compatible with the OSs you plan to use now and in the future. The driver should also be designed to capitalize on the different features and capabilities of the OS. For example, while drivers written for Windows 3.x may run under Windows 95, only drivers written in full 32-bit code for Windows 95 can take advantage of the increased performance and robustness available with Windows 95. Drivers for Windows 95 should also be able to work together with Windows 95 Plug-and-Play to ensure that your system is easy to set up and configure. You may also need the flexibility to port your code between platforms, say from a Windows PC to a Macintosh or a Sun SPARCstation. As an example, National Instruments' NI-DAQ driver software is available for Windows 95/NT/3.1, DOS, Mac OS, and Sun Solaris. NI-DAQ protects your software investment because you can switch between hardware products or operating systems with little or no modification to your application. Choice Of Programming Language
You must also consider which programming languages can be used with the driver. Make sure that the driver can be called from your favorite programming language, and is designed to work well within that development environment. A programming language such as Visual Basic (VB), for example, has an event-driven development environment that uses controls for developing the application. If you're developing in the VB environment, you need to make sure that the driver has custom controls, such as those in NI-DAQ, to match the methodology of the programming language. Also, are the hardware functions you need accessible in software? A problem can occur when you purchase DAQ hardware, and then combine the hardware with software, only to find that the chosen software doesn't handle a required hardware feature. This problem occurs most frequently when different companies develop the hardware and software. By asking this question, you can save yourself time searching through the software manuals looking for a function that doesn't exist. Also, you have to ask yourself if the driver limits performance. Because the driver is an additional layer, it may indeed cause some performance limitations. In addition, OSs such as Windows 3.1 can have significant interrupt latencies. If not dealt with properly, these latencies can greatly reduce the performance of your DAQ system. As an example, National's NI-DAQ driver has code written specifically to reduce the interrupt latencies of Windows and to provide acquisition rates up to 1 Msample/second. The answers to these questions will give you an indication of the effort that has gone into developing the driver software. Ideally, you want to get your driver software from a company that has as much expertise in the development of the DAQ software as it does in the development of DAQ hardware. Application Software
An additional way to program DAQ hardware is to use application software. But even if you use application software, it's important to know the answers to the previous questions, because the application software will use driver software to control the DAQ hardware. Application software adds analysis and presentation capabilities to the driver software. Application software also integrates instrument control (such as IEEE-488/GPIB, RS-232, and VXI) with data acquisition. National Instruments, for example, offers LabWindows/CVI, application software for the traditional C programmer, and LabVIEW application software with graphical programming methodology, for developing instrumentation, acquisition, and control applications. Both products can be augmented with add-on toolkits for special functions. ComponentWorks gives instrumentation capabilities to VB through OLE (object linking and embedding; a Microsoft software standard) custom controls. For the spreadsheet user, a product called Measure offers DAQ capabilities directly within the Windows Excel environment. For the Windows DAQ user who wants ready-to-run virtual instruments, a product called VirtualBench can offer an oscilloscope, dynamic signal analyzer, function generator, DMM (digital multimeter), and data logger. A typical screenshot from VirtualBench is shown here; it depicts an oscilloscope and function generator. ![]() To develop a high quality DAQ system for measurement and control or test-and-measurement, you must understand each of the components involved. Of all the DAQ system components, the element that should be examined most closely is software. Software Is Key
Because plug-in DAQ boards don't have displays, the software is the only interface you have to a system. The software is the component that relays all the information about the system, and it's the element that controls the system. The software integrates the transducers, signal conditioning, DAQ hardware, and analysis hardware into a complete and functional DAQ system. ![]() Using the signal processing functions in LabWindows/CVI's advanced analysis library, you can perform frequency analysis, filtering, and windowing operations from your data. When developing a DAQ system, be sure to completely evaluate the software. The hardware components can be selected by determining the requirements of your system and making sure that the hardware specs are compatible with your system and your needs. Carefully selecting the proper software--whether it be driver level or application software--can save you a lot of development time and money.
Read Data Acquisition (DAQ) Fundamentals: Part I of a Multi-Part Series
|
||||||||||||||||||||||||||||||||||
|
Copyright © 2003 ChipCenter-QuestLink About ChipCenter-Questlink |
|||||||||||||||||||||||||||||||||||