Computers Chem.Vol. 16. No. I, pp. 71-72, 1992 Printedin GreatBritain. All rights reserved
0097~8485/92 s5.00 + 0.00 1992 Pergamon Press ptc
CopyrightQ
SOFTWARE DATA
TRANSLATION
NOTE
FROM INSTRUMENT TO ASCII
SPECIFIC
DANIEL C. MICHAELS, AE JA KIM, BRANNON C. Pew~oux, DAVID BARKSDALE and LBSLIE G. BUTLER’ Department of Chemistry, Louisiana State University, Baton Rouge, LA 70803-1804, USA. (Received 12 March 1991; in revisedform 16 September 1991)
Off-line data analysis is often an important component of NMR spectroscopy. Yet, the entire process for transferring and translating data from the spectrometer to a workstation can be quite complex. In recent years, the data transfer problem has been solved adequately for small data files with the serial data transfer program Kermit? (Casey et al., 1989). However, the second step of the process, conversion of binary-coded data files into more accessible ASCII text files, remains difficult. Herein, we describe briefly a data translation program written in a graphical programming language, LabVIEW. The advantage of a graphical programming language is the relative clarity of its operation, hence program maintenance and upgrade is facilitated.
Since an awareness of data flow is crucial to instntment control programs, we have found LabVIEW to be a very useful programming language for use with our homemade NMR instruments. The concept of data flow is also helpful in data translation programs. One measure of a programming language is the time required to gain facility. We note here that the first version of the date translation program was written by B. C. Perilloux and D. Barksdale, high school senior and college sophomore, respectively, as their second programming assignment.
TRANSLATION
Bruker NMR data is stored in 24bit integer, 48-bit real number and 6-bit character formats. Therefore, three virtual instruments, one for each format, were written as subroutines. A larger virtual instrument, MSL;-Translate, reads the binary-coded data files, calls the three other virtual instruments as needed, and writes an ASCII text file. The MSL-Translate front panel is shown in Fig. 1. The data shown is from a spectrum taken on a Bruker MSL200 spectrometer. Typically, the deuterium powder pattern is then fitted using a non-linear least-squares algorithm so as to obtain the quadrupole coupling constant and the asymmetry parameter (Kim et al., 1991). It is likely that the popularity of graphical programming languages will increase. For those of us who remember machine code and 256 bytes, not kbytes, of memory, this is a welcomed advance. Copies of MSL-Translate and the three format translating routines are available upon request. Even in the absence of the LabVIEW compiler, the program listings may be useful as a flow diagram for writing translation routines in some other programming language. Also, simple modifications of the MSL-Translate program could be used for instruments other than Bntker NMR spectrometers.
THE LabVIEW PROGRAMMING UNGUAGE LabVIEW is a graphical programming language specific to the Macintosh family of computers and is optimized for the purpose of instrument control with many I/O routines (LabVIEW Version 2.0, National Instruments Corp., 6504 Bridge Point Parkway, Austin, TX 78730). Complete software routines are called virtual instruments and consist of a user interface, the “Front Panel”, and the underlying program, the “Diagram”. Programming objects, both front panel and diagram, are icons selected from pull-down menus. The icons are “wired” together where the appearance of the wire indicates the type of data involved, scalar, array, boolean, string etc. The use of wires to transport data from one programming object, say an icon representing a disk read, to another object, naturally introduces the concept of data Bow.
*Author for correspondence. Fellow of the Alfred P. Sloan Foundation (1989-1991). tKermit Distribution, Columbia Univ. Center for Computing Activities, 612 West 115th St, New York, NY 10025. CAC
1*,1--F
OF BRUKER DATA
71
72
DANIBLC. MICHABLS et
al.
Bimry DcltoFile
1
Urltr
-_‘2sBR91
Rscll
Data
File
Error
Lou
Film
FMquoncy
Limit
-2oo(
NS
= I@ of
-1
TE
-
Tmmperatuw,
yt
Ra
-
Rotation,
-
Exponential
)lLB
NC -
171 [ljzzsrl
sc01-6
Normalization
Pulse PI-~
K Hz Line
Brmdming
Constant
Filmme
This is the front panel. for a virtual instrument used to translate data from the Bruker MSLPOO NHR format into serviceable ASCII files that can be manipulated on a Macintosh II. Input consists of a binary file (result of a Kermit data Reference: transfer) ; output is an ASCII text file. DISMSL, Chapter 18, User Proqramming in DISNMR, Minus One Sector for DISMSL Generated Files. Fig. 1 Program mailabifity~opies of the programs are available from the authors upon request. Acknowledgements-We gratefully acknowledge the Louisiana Educational Quality Support Fund for the purchase of LabVIEW and the Macintosh workstation and support from the PetroleumResearchFund of the American Chemical Society. The purchase of the solid-state200 MHz NMR spectrometerwas made possible by an NSF grant
(CHE-8711788). D, Barksdale gratefully acknowledge! support from the NSF Young Scholars Program. REFERENCES Casey P. K., JarrettW. L. & Mathias L. J. (1989) Rm. Lob. 2.5 Mar. Kim A. J., Fronczek F. R., Butler L. G., Chen S. & Keiter E. A. (1991) J. Am. Chvn. .Soc. 113, 9090-9096.