4
edited by computer ~ e r i e ~ , 24 Eastern Michigan University, JOHN Ypsilanti, w. MI MOORE 48197 Computer Interfacing for Chemists Eric D. Salin McGill University, Montreal, Quebec, Canada Traditionally, computers have heen used hy chemists for computation purposes. This has included hoth the processing of experimental data and calculational modeling. Recent de- velooments in electronic technoloev have drastically reduced the Eost and size of computers with a subsequent rwolution in modern instrumentation and lahoratory data acquisition capabilities. Since the modern chemist is quite likely to en- counter computer-controlled instrumentation and general purpose lahoratory computers, it is a university's responsi- hility to prepare a student for these encounters. The needs of a new graduate are somewhat difficult to predict because of the many career paths which may he followed upon gradua- tion; however, students studying for advanced degrees are quite likely to spend much of their working lives involved ei- ther directlv with comvuters or suvervisine those who are. A course'has evolved at this university <o meet the needs of certain chemistry students. While it will not meet exactly the needs of all students, a degree of flexihility is provided so that students can receive maximum henefit. The orientation of the course is based on the premise that an automated ex- periment can he considered to consist of three distinct sec- tions: the experiment, the computer and the interface. The interface consists of hoth the software and hardware necessary to do the following 1) Extract data from the experimental apparatus and place it in a usable format in the computer. 2) Control the experiment (if necessary). An emphasis on the interfacing aspect evolved because ex- perimental and computational expertise already existed within the Department and University. While students had received formal instruction in computer science, electronics, mathematics and statistics. a course was needed which inte- grated and supplemented previous course material into a svnereistic bodv of knowledee svecificallv adavted toward the . " " . solution of chemical proble&s.~he following are the goals of the entire course: 1) Students should be able to make an intelligent selection of a computer system or components to solve a specific lahoratory data acquisition problem. 2) Students should be able to discuss intelligently problems with specialists in either hardware or software. 3) Students should obtain a level of education which will allow them to select further courses for themselves based on their foreseeable needs, or to educate themselves by further inde- pendent study. 4) Students should obtain a level of technical competence that would allow them to do simple interfacing with a minimum of assistance. Course Content Many students will be satisfied hy obtaining the first three eoals. Others will need to reach the fourth eoal. The entire - course was partitioned to provide a curriculum suitable for hoth types of student. The needs of the first type of student Table 1. Lecture Topics 1. Number Systems and Computer Arithmetic 2. Computer Structure 3. Instructions 4. 8502 instructions 5. Programming Examples. 8080 and 6502 6. Assemblers, Editors, Operating Systems. and High Level Languages 7. BASIC and interfacing 8. Data Domain Conversions 9 Computer Hardware and Peripherals 10 Bus Access and Direct Memory Access 11. Electronics, Analog-Operational Amplifiers 12. Elecronics, Digitai-Multiplexers. Gating and Counting 13. Transducers 14. Data Handling Techniques were met by an intensive lecture and lahoratory course of one term (12 weeks). The second type of student received addi- tional exposure in a seminar course and an independent in- terfacing project that the student would take after successful comoletion of the first term course. The vroiect and seminar have provided the forum for intensive hteraction that has oroven valuable for all the varticioants. The goals of the course can he met by the study of certain subjects as indicated by the lecture topics in Table 1. Small computers and electronics must he studied extensively. Mathematics and statistics must also he included, but to a lesser degree. The study of small computers is oriented toward their use in a lahoratorv environment. Both the computational and acquisitional limitations of the computer hardware and software must he considered with respect to the needs as dictated by the theory of the experiment and the statistics df data acquisition. The choice of computer software is at least as important as the choice of hardware. One usually finds that far more time will he spent on software development than on other processes (1,2). Software development usually continues throughout the research while hardware can often he left unchaneed. Hieh level languages are particularly important for the computa- tional vortions of the vroaram. If extensive computation is required, then the choke becomes quite critical with respect to peripherals and acquisition time. Compiler languages like FORTRAN usually run considerably faster than an inter- preter language such as BASIC; however, FORTRAN usually requires a rapid mass storage device such as a disk, thus in- creasing the cost of the system. Students must be aware of limitations of this type. New languages are appearing which may provide suhstantial henefit in the lahoratory. Pascal (3) is a flexible language which promotes good programming techniques for large programs, thus easing the software maintenance vrohlems as new versonnel beein to use existine software. Other languages such as Forth (4) appear to be well suited to laboratory control situations and networking. Students in the course are not "taught" any of these lan- guages, though an introduction to BASIC is provided. They Volume 59 Number 1 January 1982 53

Computer interfacing for chemists

  • Upload
    eric-d

  • View
    215

  • Download
    2

Embed Size (px)

Citation preview

Page 1: Computer interfacing for chemists

edited by

computer ~er ie~, 24 Eastern Michigan University, JOHN Ypsilanti, w. MI MOORE 48197

Computer Interfacing for Chemists Eric D. Salin McGill University, Montreal, Quebec, Canada

Traditionally, computers have heen used hy chemists for computation purposes. This has included hoth the processing of experimental data and calculational modeling. Recent de- velooments in electronic technoloev have drastically reduced the Eost and size of computers with a subsequent rwolution in modern instrumentation and lahoratory data acquisition capabilities. Since the modern chemist is quite likely to en- counter computer-controlled instrumentation and general purpose lahoratory computers, it is a university's responsi- hility to prepare a student for these encounters. The needs of a new graduate are somewhat difficult to predict because of the many career paths which may he followed upon gradua- tion; however, students studying for advanced degrees are quite likely to spend much of their working lives involved ei- ther directlv with comvuters or suvervisine those who are.

A course'has evolved at this university <o meet the needs of certain chemistry students. While it will not meet exactly the needs of all students, a degree of flexihility is provided so that students can receive maximum henefit. The orientation of the course is based on the premise that an automated ex- periment can he considered to consist of three distinct sec- tions: the experiment, the computer and the interface. The interface consists of hoth the software and hardware necessary to do the following

1) Extract data from the experimental apparatus and place it in a usable format in the computer.

2) Control the experiment (if necessary).

An emphasis on the interfacing aspect evolved because ex- perimental and computational expertise already existed within the Department and University. While students had received formal instruction in computer science, electronics, mathematics and statistics. a course was needed which inte- grated and supplemented previous course material into a svnereistic bodv of knowledee svecificallv adavted toward the . " " . solution of chemical proble&s.~he following are the goals of the entire course:

1) Students should be able to make an intelligent selection of a computer system or components to solve a specific lahoratory data acquisition problem.

2) Students should be able to discuss intelligently problems with specialists in either hardware or software.

3) Students should obtain a level of education which will allow them to select further courses for themselves based on their foreseeable needs, or to educate themselves by further inde- pendent study.

4) Students should obtain a level of technical competence that would allow them to do simple interfacing with a minimum of assistance.

Course Content

Many students will be satisfied hy obtaining the first three eoals. Others will need to reach the fourth eoal. The entire - course was partitioned to provide a curriculum suitable for hoth types of student. The needs of the first type of student

Table 1. Lecture Topics

1. Number Systems and Computer Arithmetic 2. Computer Structure 3. Instructions 4. 8502 instructions 5. Programming Examples. 8080 and 6502 6. Assemblers, Editors, Operating Systems. and High Level Languages 7. BASIC and interfacing 8. Data Domain Conversions 9 Computer Hardware and Peripherals

10 Bus Access and Direct Memory Access 11. Electronics, Analog-Operational Amplifiers 12. Elecronics, Digitai-Multiplexers. Gating and Counting 13. Transducers 14. Data Handling Techniques

were met by an intensive lecture and lahoratory course of one term (12 weeks). The second type of student received addi- tional exposure in a seminar course and an independent in- terfacing project that the student would take after successful comoletion of the first term course. The vroiect and seminar have provided the forum for intensive hteraction that has oroven valuable for all the varticioants.

The goals of the course can he met by the study of certain subjects as indicated by the lecture topics in Table 1. Small computers and electronics must he studied extensively. Mathematics and statistics must also he included, but to a lesser degree. The study of small computers is oriented toward their use in a lahoratorv environment. Both the computational and acquisitional limitations of the computer hardware and software must he considered with respect to the needs as dictated by the theory of the experiment and the statistics df data acquisition.

The choice of computer software is at least as important as the choice of hardware. One usually finds that far more time will he spent on software development than on other processes (1 ,2) . Software development usually continues throughout the research while hardware can often he left unchaneed. Hieh level languages are particularly important for the computa- tional vortions of the vroaram. If extensive computation is required, then the choke becomes quite critical with respect to peripherals and acquisition time. Compiler languages like FORTRAN usually run considerably faster than an inter- preter language such as BASIC; however, FORTRAN usually requires a rapid mass storage device such as a disk, thus in- creasing the cost of the system. Students must be aware of limitations of this type. New languages are appearing which may provide suhstantial henefit in the lahoratory. Pascal ( 3 ) is a flexible language which promotes good programming techniques for large programs, thus easing the software maintenance vrohlems as new versonnel beein to use existine software. Other languages such as Forth (4) appear to be well suited to laboratory control situations and networking.

Students in the course are not "taught" any of these lan- guages, though an introduction to BASIC is provided. They

Volume 59 Number 1 January 1982 53

Page 2: Computer interfacing for chemists

are simply expected to learn the advantages and disadvan- taees of each as well as the sienificance of operatine svstems - - . and programming in assembler languages.

Operatine svstems are not discussed extensively; however, the ttttport&features of an operating system a i d how they might be important in an acquisition problem are mentioned. he use of kditors and assemblers is presented in lecture; however, their utility becomes quite evident during laboratory exoeriments. so emnhasis is not necessarv.

The discussion of computer hardware is quite important for several reasons. Students must eain a certain knowledge . of peripherals and the major subsystems: busses, processor, memory, and inputloutput, so that they can successfully specify and buy a computer system. The lecture material is heavily reinforced by the requirements of the first project.

The electronics lectures cover material that could be clas- sified into four general topic areas: analog electronics, digital

extensively. Sampling theory ( 5 ) and signal-to-noise ratio enhancement techniques ( 6 ) are available in text form and, while mathematical in nature, are included in the electronics lectures due to their significance in the data collection pro- cess.

While the laboratories (Table 2) do not coordinate exactly with the timine of the lectures, this has not been a problem. Students are expected to do additional reading as required by their needs and each laboratory is written with some theory

tional experiments are available. Several of the experiments are particularly valuable. The

BASIC of the AIM-65 is very well-configured for direct control of inputloutput devices by using PEEK and POKE com- mands, which allow the examination and alteration of memory (or memory mapped devices). In experiment 5, the students output data directly to a strip chart recorder through a digital to analog converter. A calculated waveform such as a damp- ened sine wave is usuallv outout. This is a verv easv and im- . . . . pressive experiment and gives the students a great deal of confidence in themselves and the equipment. The analug- . - . to-digital conversion experiment requires that students properly write, document, and debug a program which will collect and store data as fast as possible. This requires that the procram be written in assembler code for maximum speed andco&ol. I t is helpful, but not necessary, to have an &il- liscope available so that the students can observe the hand- shak:lng process between the analog to digital converter and the 6522. Students learn in this experiment the speed limi- tations of the hardware and software. For many, i t is a so- bering experience to learn that a device that can execute in- structions in microseconds cannot collect data much faster than 20 KHz.

The last two proerams, with their data collection and output capabilities, usbalyy serve as building blocks for the stude&s to use during their projects

Table 2. Laboratory Experiments

Required 1. Introduction to the AIM 65

Monitor Functions Very Short Programs

2. Editor and Assembler Use Documentation

3. Part I. Use of Subroutines Part Ii. Use of the 6522 Timer

4. Use of 110 Ports 5. BASIC Interfacing, Digital to Analog Conversion 6. Assembler Language Level Interfacing Analog to Digital Conversion

Optional 1. Place an 110 Device (6522) on the System Bus 2. Real Time Signal Averaging

The first two educational goals of the course are usually reached by the end of the first project. This project requires that students give the class their recommendations for the purchase of a computer system hased on the specifications ~rovided by the instructor. A written report is also required and is made available to any interested persons. The entire class is given the same specifications.

Students are allowed and encouraged to work in small groups, thereby creating a rather interactive and competitive situation. Reports must discuss all of the following:

1. Cost, hoLh initial and operational, including local quotes. 2. Software purchased wi th the initial system. 3. Software availability. 4. Hardware expansion capability and choice of bus. 5. Local support for both hardware and software. 6. Local suppliers.

The first project brings tremendous life into the class when the verhal presentations are made. Lively debates result and comprehension errors are quickly brought to light and cor- rected. Students auicklv learn that computer sales personnel can have large vocabularies but be quite limited in knowledge. For many this is their first purchasine exercise as professionals and is aUvery valuable eiperience hnder conti&ed condi- tions.

The second project is designed to take education to the point of technical competence and should satisfy the final goal "f the course. ~xper i ince indicates that the lecture and lab- oratory exposure provides the students with the education but not the confidence or experience to begin automation of their own research. For this reason the second project requires that the student desien and imulement both the software and "

hardware for a small laboratory experimental interface. A written and verbal D ~ O D U S ~ ~ are required and a written and . . verbal final report must he presented. The student must demonstrate that the interface works and provide extensive documentation including a copy of the program on cassettte taue. If the student cannot find a suitable automation ex- periment in his laboratory, the instructor will assign a gen- erally useful project which may be used throughout the de-

. . own resources. These are the skills that one wishes to develop in eraduate students.

A warning is in order. Students who have a research project requiring automation will be eager to hegin immediately. I t is very important that the instructor set very limited, attain- able goals for the student for the time period involved. Con- siderable frustration can result as a student becomes inund- ated with the reality of a complex experiment before he or she has developed the capacity to estimate properly the work in- volved.

Equipment To meet the eoals of the course. certain equipment is re-

quired. The compute~ selected should havean editor, as- sembler, and a high level language capability. In addition to the conventional input and output devices for the operator, the computer must he able to interface to external devices without major modification.

Given that Lhe above criteria can be met, the major factors will he cost, complexity, durability, and applicability. Each of these deserves discussion.

Inordinate operational complexity of a classroom computer will lead to initial frustration on the part of the students and an unnecessarilv lone induction ueriod before renerallv useful "

material is learned. While all computers work in approxi- matelv the same way, the implementations differ vastly from system to system and the most straightforward system that

54 Journal of Chemical Education

Page 3: Computer interfacing for chemists

can fulfill the experimental requirements of the course should he obtained. This is not to say that consideration should not be given to a system that can expand with future needs, but simply that students should be presented with the least complex system for their introduction to computer inter- facing.

It would seem apparent that a system should be durable; and, in this respect, one must not underestimate the de- structive capacity of students. This is particularly important when the student is allowed to move the computer to an ex- periment which may be in a remote laboratory. Since the course is oriented toward interfacing, movement of the com-

actudly he applied to a real experiment. For this reason one should select a computer that is generally applicable to modest interfacing projects. I t is most efficient if this is a computer that can be expanded to satisfy moderate acquisition needs. In this case, research directors will often find it convenient to purchase a system of the same or similar type to use on the student's research. This would lead one to acquire a system with a relatively common processor such as the 8080-280 family or the 6502 or 6800 series. A large body of public do- main or low cost software exists for these processors as well as a tremendous variety of systems, components, and pe- ripherals.

We have selected the Rockwell AIM-65 single board com- puter for use in this course and several others in the Chemistry Department. Tahles 3 and 4 list the major hardware and softwarb features of this computer. The cost of the system is so low that it is possible to acquire all the equipment required for our experiments for approximately $1000 per station. This would include all of the equipment listed in Table 5 except a strip chart recorder. Strip chart recorders are common labo- ratory tools and can usually be borrowed for the duration of the single exueriment which reauires their use. The urimarv " . limitation for some users will be the lack of immediate erauhics cauabilitv such as that found on the Commodore PET. ~ f t e i a n evaluation of the inputloutput capabilities, documentation, and printer of the AIM-65, it was felt to he superior for the purposes of this course. The BASIC language capabilities are quite similar to those of the PET, and the 4096 Bytes memory size has not been a handicap for the size of program or data sets that students have required. A brief comment on some of the features may be helpful.

The 6522 VIA (Versatile Interface Adapter) is an extremely oowerful I n ~ u t / O u t ~ ~ t device with a comoarable comulexitv. . . . I t can be used quite simplistically in a manner similar to the 6520 or the 6820. In this mode it has 16 bidirectional data lines and 4 handshake lines. These lines are bidirectional and can be individnallv configured to he either input or outuut thus yielding maximum flexibility. The 6522-also has an input which will allow it to he used as a serial port. For data acqui- sition, it is often convenient to have onboard timers so that acquisition intervals or events can he accurately timed. The 6522 can provide two lfi-hit timers or one timer and one counter. The counter is particularly useful when measuring frequencies such as those from a voltage to frequency con- verter.

The AIM-65 printer is a 20 column dot matrix thermal printer. While paper is relatively expensive, the computer can often be run quite conveniently using only the 20 character display. A full standard size keyboard provides all the char-

dent programming. The cassette interfaces allow the &dents to store programs and data on tape. The software and hard- ware nrovide the canacitv for comouter controlled (remote) . . starting and stopping of the cassette recorder, thereby al- lowine the acauisition and storage of information without the - presence of the operator.

Table 3. Aim 65 Hardware

110 6522 16 110 lines TimerslCounler 4 Handshake Lines Serial Port

Printer Keyboard Display 4 KByie R W Memory (RAM) 20 kbtye ROM 2 Cassene Interfaces Teletype Interface (20ma)

Table 4. AIM 65 ROM Software

8 KByte Monitor-Editor 8 KByte BASIC 4KB Assembler

Table 5. Laboratory Equipment

Approx. T v ~ e Manufacturer Model Cost

Computer Rockwell International AIM 65 $700 P.O. Box 3669 Anaheim CA 92803

Breadboard A.P. Products Inc. Powerace $120 Station 1359 West Jackson St!, 103

Painesville. OH 44077 Multimeter John Fluke Mfg. Co. Inc. 8022A $150

P.O. Box 43210 S. Mountlake Terrace, WA 96043

Strip Chari Sargent-Welch Scientific Co. XKR $500 Recorder 7300 N. Linder Avenue

Skokie, IL 60076

Table 4 lists the software that was available from Rockwell

has since been developed for the AIM-65; however, we have found the software in Table 4 to be quite adequate for teaching purposes a t this level. The BASIC provides the normal mathematical and trigonometric functions as well as the control can be easily transferred to a machine language pro- gram:The monitor is quite extensive and provides control over all the peripherals. ~ k c a u s e it is very well documented, it is quite useful, and an experiment has been developed that uses <he monitor subroutines. The editor and assemhler are quite adequate for this machine, but do not provide some of the more powerful editing and assemhly features that one finds on disk-based computers.

The equipment requirements will depend heavily on the scheduling situation. If placed in a suitable case, the AIM-65 cannot be easily damaged except hy exposure to liquids. Since the device is not dangerous to students and vice versa, stu- dents can he allowed to use the AIM-65 unattended, just as they are allowed to use computer terminals unattended. The course is targeted a t graduate caliher students, and thus we have found it unnecessary to provide constant assistance. Graduate students are generally quite able to seek assistance from either the instructor or fellow students and have the additional advantage of schedules that are usually much more flexihle than those of undergraduates. Students are warned of the perverse feature of the computer (i.e., that is does ex- actly what is has heen told to do) and to except that apparent - -

equipment failures are usually operator failures. As a cadre of experienced students is developed, the assistance time re- quired directly from the instructor will fall off suhstantially. While it is quite possihle to operate the course withvery few stations, it is advisahle to have a t least two complete stations

Volume 59 Number 1 January 1982 55

Page 4: Computer interfacing for chemists

in the event of a breakdown which can result in a termination of all laboratory progress until repairs are completed.

Since the time required for a given experiment varies drasticallv with each student. we have found it best to divide the day into three hlucks: morning, afternoon and evening. This nrovides more than adeauate time for the extended ve- riods that may be required for unassisted laboratory work. This allows one computer to be used by up to 15 students during a normal work week. During the second term it be- comes necessary to provide each student with longer access and a breadboard on which he may leave his interface undis- turbed. The actual time required varies with both the student and the project; however, five students per computer is arel- atively safe ratio. The sharp change in ratios may not cause a nroblem as some students mav be satisfied with the exoe- rience and knowledge obtained in the first term.

Conclusion

I t is possible to develop in graduate caliber students the necessary knowledge for survival in the highly computerized environment found in many modern research laboratories. Proper selection of equipmknt and providing liberal access to the equipment will allow the course to be initiated a t min-

imal expense. The personnel requirements can he minimized by writing well-documented experiments and encouraging students to develop and use their problem-solving skills before seeking staff assistance. Graduates of the course will have acquired skills directly applicable to modern research as well as having developed a certain degree of confidence in their ability to handle new prohlems.

Acknowledgment

Some material presented in class lectures was prepared in part or whole hy Drs. G. Horlick; University of Alberta, E. G. Codding University of Calgary, and M. W. Blades; University of British Columbia, for use in a short course entitled, "Mi- croprocessors for Scientists" that has been presented several times in the United States and Canada.

Literature Cited

(1) Hughes. P.. Eiec t ion~m, l2fi, June 22 (19781. (2) Elrctronirr, 142. May8 (19781. IS) Krouse,T , E l m Drsifln, 19.82 l19781. (d) Dessy, R. E. andstarling, M. K.. Ampi Lohoiotory, 12.21 February (19801. (5) Malmsiadt, H. V., Enke, C. C., Crouch, S.R.. and Horlick. C.. OpdmirofionofElrctronic

Mrosuiemimis. W . A. Benjamin, Inc.. Menlo Park, 1974, PP. 79-88. (61 Reference (6). pp. 89-143.

56 Journal of Chemical Education