Product category:
Data acquisition Software and Communications
News Release from: United Electronic Industries | Subject: PowerDAQ for Linux Ver 3.5
Edited by the Engineeringtalk Editorial
Team on 11 March 2004
Near-enough real-time achieved with
Linux DAQ
Significant improvements in the latest version of Linux, kernel 2.6, give an OS response times bordering on hard real time; UEI is taking advantage of this for data acquisition.
People in the embedded community are getting very excited about the significant improvements in the latest version of Linux, kernel 2.6, which gives OS response times bordering on hard real time United Electronic Industries is the first supplier of data-acquisition cards to offer drivers that work with this increasingly popular OS
This article was originally published on Engineeringtalk on 1 Oct 2002 at 8.00am (UK)
Related stories
System runs real-time control over Etherenet
PowerDNA (which refers to distributed, networked automation and control) is a system that sets new benchmarks for hard real-time I/O using standard Ethernet cabling.
Compact cube implements 64 PID loops
Combining high density with high performance, the PowerPID is a compact multiloop process controller that operates standalone or interfaces with a host in hard real time.
Thanks to these drivers, which are included in the free PowerDAQ for Linux Ver 3.5 support package, test engineers can take full advantage of these benefits.
A dramatic example is the time it takes the kernel to alert a user program to an interrupt: in a series of real-world benchmark tests conducted at the UEI laboratories on PowerDAQ PCI-bus hardware, the Linux 2.6/PowerDAQ driver combination can pass notification of an interrupt to an application program in an average of roughly 11us, which represents more than a 90% reduction in response time from Linux 2.4.
Until now, the only way to get reasonable Linux response to interrupts or other critical events as required in data-acquisition, test and automation tasks has been to add a real-time patch from third-party suppliers.
In Linux 2.6, though, several improvements give it inherent performance that approaches that of a real-time system; among these are pre-emption points in the kernel, an improved scheduler and better synchronisation.
Now, unless a user's requirements are absolutely hard real time, it might not be necessary to go with a special configuration or patch.
Further reading
Ethernet gains hard real-time capabilities
DaqBIOS shatters all the misconceptions about Ethernet's ability to handle any and all automation tasks.
Interface aids real-time acquisition on PCI
UEI has created the hardware and software that makes it possible to implement a LabView Real Time target on a standard PCIbus system using the firm's line of high-performance I/O cards.
Excel DAQ addon module distributed for free
Previously sold for $195, the ProfessorDAQ addon for Excel is now distributed at no charge.
Best of all, UEI's drivers work flawlessly with Linux 2.6-and they ship free with all of the firm's PCI and PXI products including multifunction, simultaneous-sampling, analogue output and digital I/O cards.
Further, these are professionally developed, fully supported drivers.
Users need not worry about the quality or completeness of a public-domain driver, or whether it really works with their hardware, or with this latest version of Linux.
UEI has verified and tested its Linux drivers to make certain that PowerDAQ hardware runs exactly as predicted under this environment.
What's special about Linux 2.6? In previous versions of Linux, system calls could take a long time to run, and during that time the OS was blocked from servicing any interrupts.
However, in Linux 2.6 the kernel code adds a number of pre-emption points that allow the scheduler to see if a high-priority task is waiting, whereupon it blocks the current process so it can then schedule that higher priority process.
Scheduling and task switching is also improved.
Previously, Linux would select the next task to run by examining all of them in the queue and positioning them in importance.
This action used up time.
Now, as soon as a task is ready, Linux automatically sorts it into position on the current queue.
Then the scheduler need only choose the task on top of the queue, thereby eliminating any extra waiting.
A related improvement is support for fast user-space mutexes.
A mutex is a program object that allows multiple threads to share a resource, such as file access, but not simultaneously.
Any thread that needs a given resource must lock the mutex from other threads while using that resource.
In Linux 2.6, mutex functions can check from the user space whether blocking is necessary-if it isn't necessary, a thread need not perform a system call to block another thread, again saving time and making thread execution and task switching faster.
Another major addition to the kernel is that its internal threading infrastructure can now run the Native Posix Thread Library.
Test and automation systems often must poll hardware on a regular schedule, and Posix timers ease the task of scheduling them.
To investigate the improvement that the Linux 2.6 kernel brings to data-acquisition and automation tasks, UEI's software engineers took a PowerDAQ MF multifunction card and ran a simple benchmark program.
The test platform has a 1GHz Pentium III and 256M bytes of RAM.
The benchmark program ran under the Mandrake 9.1 distribution with recompiled kernels for Linux 2.4.20 and 2.6.
The benchmark program uses the capability of an MF board to assert an interrupt when the state of a digital input changes.
When the interrupt is received in the low-level driver, the test reads the processor time-stamp counter (TSC), which runs at the same speed as the processor for the most precise timebase possible.
When the user program receives the event corresponding to the interrupt, the test program again reads the TSC and subtracts the two values to find the time it took the kernel to get the event from the driver's interrupt service routine to the user's program.
The benchmark program ran the test algorithm 1000 times in roughly 30s.
The engineers ran two test scenarios: 1 - No load In this synchronous test, the benchmark program was the only user application running on the system, and there was nothing else keeping the system busy such as display refreshes, mouse movements or hard-disk activity.
The PowerDAQ combination running under Linux 2.6 has an average response time of 10.9us, a reduction of 91.8% compared to Linux 2.4; the worst-case response time drops by 99.2% to 15.8us 2 - Heavy load In this synchronous test, the engineers made life as difficult as possible for the benchmark program by opening/closing other applications such as OpenOffice, and by moving various windows on the screen with the mouse.
Once again, the PowerDAQ card cut its average response time by 92.4%, this time to 11.3us; the worst-case time (63.5us) dropped by 99.0% of its previous value.
A chart giving details on the benchmark results is available at UEI's web site.
From these benchmark numbers, it should be clear that a PowerDAQ card running under Linux 2.6 offers response times that rival those of a hard real-time OS, and in many applications this level of performance should be quite sufficient.
For those users who do need hard real-time performance, though, the PowerDAQ Linux Ver 3.5 driver is completely compatible with the real-time patches from organizations such as FSMLabs and RTAI.
Further, because of UEI's LabVIEW for Linux drivers, test engineers who wish to program under LabVIEW and gain the benefits of this new Linux kernel can do so without delay.
These benefits are available immediately for all of UEI's PCI and PXI cards; the PowerDAQ for Linux Ver 3.5 driver set ships for free as part of the PowerDAQ Software Suite that accompanies every board the firm sells.
The LabVIEW for Linux driver likewise comes at no charge.
These drivers are also available for free downloading from UEI's web site.
For the moment, the only way to use Linux kernel 2.6 on a desktop distribution is to manually compile and install it; UEI guarantees support for any build.
When any of the major Linux vendors release desktop distributions based on kernel 2.6, which should happen in the next months, UEI will immediately test them to ensure that the PowerDAQ Linux Ver 3.5 driver is completely compatible.
• United Electronic Industries: contact details and other news
• Email this article to a colleague
• Register for the free Engineeringtalk email newsletter
• Engineeringtalk Home Page

