How to write your own data-analysis tools
Quite often, a researcher has to modify data-acquisition and analysis software to account for variations in an experiment. Coding a data-acquisition application using traditional programming languages can be a frustrating and time-consuming task for a nonprogrammer.
The Array Basic language (Galactic Industries Corp., Salem, NH) was designed to simplify creating scientific data-analysis tools by providing an optimized environment for processing various types of x-y (trace) data. "Array" indicates that it treats all trace-type data, including spectra and chromatograms, as arrays of data. In Array Basic an operation can be performed quickly on a data set over the entire array or subsections of the array. Single-statement operations are used to perform advanced matrix operations.
"Basic" describes the program`s similarity to the BASIC programming language. This gives Array Basic a very familiar interface because many professionals have programmed in BASIC at one time or another.
A number of trace and array processing algorithms can be written with Array Basic array-manipulation functions. When Array Basic operates on an entire array, it is much faster than loops operating on one data point at a time or equivalent point-by-point algorithms written in compiled programming languages.
Array Basic has been optimized and expanded over the standard implementations of BASIC to include commands specifically designed to process analytical-instrumentation data. Most of the standard data-array operations to be performed are included as primitives (standard functions) of the Array Basic command set. For example, there is no need to write a real fast-Fourier-transform routine in Array Basic. A single command "RFFT" does just that.
The language`s primitives are faster than compiled programs written to do the same operations. This is because they are written in highly optimized 32-bit assembly language. Because complex multipoint operations are performed using single operations, the speed of a compiled program is realized with the ease of an interpreted language. And complementing the array-processing speed, the language allows virtually total control over the system, including access to hardware input/output ports, interrupts, and serial ports. This simplicity in programming Windows applications eases the programming task, especially for custom applications for experiments (see figure).
To augment the built-in command set, Array Basic also allows calling any other dynamic link library (DLL) that gives access to any Windows function, as well as many of the DLLs from other developers. Thus, a function not already found in Array Basic can be called as an external procedure with a single command. Scientists also have the ability to create complex graphical displays. Other options include multiple independently controlled trace boxes, fast trace animation, and full mouse control. There are numerous view-oriented commands for GRAMS/386 (Galactic Industries), a Windows package originally developed for acquiring, processing, and managing spectral and chromatographic data but also able to handle data from other types of analytical instruments.
In addition to Array Basic, there are several lower-level programming language extensions found in Array Basic Control (ABC), a package available for GRAMS/386, Levels 2 and 3. The extensions function similarly to low-level assembly language programming while being accessible to even the most casual user. These extensions are extensively table-driven and provide capabilities not found in the standard Array Basic command set. These functions are targeted at hardware-control applications including instrument control, interrupt handlers, simple multitasking, and quick port input/output. Other capabilities are bit-wise operations, serial communications-port support, advanced ASCII parsing and file input/output, software interrupt calling, and DOS and non-DOS memory blocks for dynamic memory addressing. n
Spectral-subtraction-program screen demonstrates Array Basic creation of graphical user interfaces. Users can easily design multiple independent trace boxes with overlaid spectra, tabbed dialogs, and modeless dialog technology.
CHRISTOPHER BELIVEAU is a technical support engineer with Galactic Industries Corp., 395 Main St., Salem, NH 03079-2464; email: [email protected].