|
|
|
To keep up with the demands of ever faster DA applications, you've got to get the most out of your PC-based system. With a little thought and the right configuration, you can optimize your system to make sure it acquires data as efficiently as possible.
It seems like every time you turn around computer hardware and software has experienced another quantum growth spurt. The new levels of performance brought on by this growth have established computer-based systems' place in data acquisition (DA). With the right components, these systems are effective measurement tools for a wide variety of applications, equaling or surpassing traditional instrumentation. But the trick is to make sure your system is acquiring data as efficiently and cost-effectively as possible for your particular application.
The DA device converts the voltage or current to digital readings, typically 12-bit or 16-bit. The A/D converters (ADCs) of most portable DA devices offer acquisition rates between 100 kHz and 1 MHz. These same ADCs typically store output in 16-bit integers, so the throughput rate (in bytes/s) is usually twice the acquisition rate.
Most DA devices have a FIFO buffer to temporarily store the converted analog inputs prior to their transfer to the host. Regardless of the transfer rate, the ADC can always acquire data at its maximum rate up to the size of the buffer. If you require more data than the buffer can hold, the transfer rate must match the acquisition rate.
For example, theoretically, a 100 kHz ADC must have a buffer large enough to hold 100 samples if the interrupt latency is 1 ms. In practice, though, the buffer should be several times larger. Average user requirements of current PC technology dictate 64 KB or less. If your DA device doesn't have a fixed-size FIFO buffer, you can install additional memory to acquire continuous data.
For short acquisitions, if the ADC buffer size and computer transfer rate support the ADC's maximum rate, the amount of data acquired is limited by the computer's available memory. Acquiring more data places harsher requirements on the interface speed, and it requires a hard disk of sufficient speed to store the data. Because the CPU can do only one thing at a time, the transfer of data from the ADC and the speed of writing to the hard disk should exceed the acquisition rate by at least a factor of two.
For example, suppose you want to acquire data with a 16-bit ADC at 100 kHz for several hours. The data are acquired at 200 KBps. As a result, you should make sure that both the interface between the ADC and the computer, as well as the hard disk and its computer interface, support a rate of at least 400 KBps. In fact, unless the CPU is fast enough to make its overhead negligible, rates of 600 KBps are probably necessary. You can easily attain these rates on today's computers, but bottlenecks occur as the acquisition rate to the hard disk is raised above 100 kHz.
Choosing a PC PlatformFor data acquisition (DA) applications requiring 200 KBps throughput or more, consider getting at least a 66 MHz 486DX system with 8 MB of RAM, an IDE hard drive (for desktop systems, a PCI controller), and an enhanced parallel port (for parallel interfaces between the computer and the DA device) or a Type II PCMCIA slot (for notebooks).Whatever computer you choose, keep in mind there are several nonessential functions you may want to eliminate when acquiring data at rates of 100-1000 kHz. Among the most common speed limiters are graphics and video modes, which require valuable memory and processor time to accommodate up to 64,000 colors. Some programs use memory buffers to store data. The more memory, the greater the acquisition speed and duration that the system provides. If your system has 16 MB of RAM, you can allocate 12 MB to serve as a buffer, which allows you to collect 6 million 16-bit samples, or 7.5 million 12-bit samples in packed mode. This not only eliminates the limitations of the hard drive but greatly increases the DA rate where speeds of 1 MHz can be reached easily. In addition, you need to keep a few things in mind if you are using a notebook. Configured for long battery life, these computers are not designed to operate at maximum rates. The notebook may be a 60 MHz machine, but because of the need to extend battery life, the processor may run at 15 MHz or less. This limits throughput. Also, power management utilities can shut down functions of the computer that require time to power up, causing an A/D converter buffer to be overrun. Be sure to check manufacturer specifications because all notebooks are configured differently. |
Data packing is simple and can be enabled in the A/D system via your PC's software. For 12-bit acquisitions, four samples are packed in three 16-bit integers, reducing the needed throughput by 25%. For most applications, particularly applications >250 kHz, data packing is recommended. You may lose some resolution, but depending on your required gain resolution, the loss is minimal (1/2 LSB).
There are four steps to maximizing hard disk performance: disable software disk caching, do not use hard disk compression, defragment your hard disk, and find your hard disk's sweet size. The first two functions remove unnecessary steps in saving data to the hard drive, which can substantially affect the maximum DA rate. The defragmentation utility consolidates all the free space of the drive, reducing computer time spent saving the acquisition to several places on the disk.
The fourth way to maximize performance is to identify the number of bytes the drive can write in one cycle. This is your hard disk's sweet size. If the number of bytes written is less than or greater than the sweet size, the system will experience dead time. To avoid this dead time, you can experimentally determine the appropriate size. Write a specific number of bytes to your hard drive repeatedly and note the time it takes for each write. Vary the number of bytes until the minimum time required to write the bytes becomes clear.