Quick viewing(Text Mode)

Topcount Tandem Processing Using Automated Spreadsheets

Topcount Tandem Processing Using Automated Spreadsheets

TCA-006

TopCount Tandem Processing Using Automated

Abstract Both Lotus 1-2-3 and Quattro Pro provide a record mode for easy writing of macros. In this An example of automating the use of Lotus® 1-2- mode, each key stroke is recorded and saved to 3 and Quattro Pro® spreadsheets with the Top- create the macro. The user should refer to the Count® Microplate Scintillation Counter is pre- appropriate software reference manual for greater sented. A simple batch file is used to control the detail. overall execution of the process. It copies the data file to the appropriate directory, archives the data, The following paragraphs contain examples of calls the program, and returns control two auto-executing macros (a macro that runs to the TopCount system. The spreadsheet con- automatically when the spreadsheet is called) and tains an auto-executing macro which imports the the batch files required to run Lotus 1-2-3 and data, performs the calculations, and prints the Quattro Pro as on-line application programs with spreadsheet. There are many applications, in- TopCount. The macros presented here function cluding the use of worklists, for this automated identically, and serve as examples of how to method. By automating the data reduction pro- automate two popular spreadsheet programs. cess, considerable time can be saved to calculate Although these examples are simple, more so- final answers, and data handling errors are elimi- phisticated data management and calculation rou- nated. tines are possible using the batch files and macros given here, and modifying them as desired. As Introduction presented, the macro copies the data into the appropriate cells of the spreadsheet, and prints the The tandem processing feature of TopCount spreadsheet which contains a simple worklist. provides a path to DOS and allows for unat- tended data management and storage. The data Program and System Description can then be automatically processed with addi- tional application software to final answers. With The Lotus 1-2-3 spreadsheet macro. tandem processing, popular spreadsheet programs The following macro was written starting like Lotus 1-2-3 or Quattro Pro can be used to in cell A1 of a new spreadsheet. The spreadsheet automatically process stored data by importing was then named TCMAC.WK1 (see Figure 1). the data into a spreadsheet that contains a macro. A macro is a sequence of recorded keystrokes or The macro is named \Ø. It will execute automati- commands that the spreadsheet program executes cally when TCMAC.WK1 is called. Lines 4-9 of automatically. When a macro is executed, the the macro can be changed according to need. sequence of instructions will be performed. A Rep1, rep2, and rep3, referred to in the macro, are macro can be thought of as a program that can be names given to a range of cells. The names are run within the spreadsheet. Through the use of used as cell addresses to receive the data. auto-executing macros, the user can automate the TCMAC.WK1 is stored in the LOTUS spreadsheet to perform specific data processing subdirectory. Besides the macro, it contains a routines whenever a spreadsheet is loaded. The template (cells defined with labels and formulas only requirement is that the user is familiar with to receive the data manipulated by the macro). In the spreadsheet program and writing macros. this case, the template is a simple worklist; see

PAN0008 11/91 Printed in U.S.A. © 1991 Packard Instrument CompanyPackard Instrument Company One State Street, Meriden, CT 06450 Tel. 1-800-323-1891 203-238-2351 TX: 643251 FAX: 203-235-1347 Explanation and line are NOT part of macro. 1. {home} ...move the cursor to home position 2. {r}{r}{r}{r} ...move 4 places right 3. /finappl.dat~ ...import data file appl.dat 4. goto}f1~ ...go to cell f1 5. /cf25..f36~rep1~ ...copy from cells f25 to f36 to cell 6. /cf49..f60~rep2~ named rep1;repeat copy for cells 7. /cf73..f84~rep3~ to rep2 and 3. 8. {goto}g1~ ...go to cell g1 9. /pprg1..p16~ ...print cells g1 to p16 10. agpg ...align the paper and print 11. /qyy ...quit the spreadsheet Figure 1. Macro, named \Ø, contained in TCMAC.WK1.

Figure 5. After proper placement of the template containing the macro and template to in the spreadsheet, the data will be placed in the AUTO123.WK1 (this file will automatically load correct locations by the macro. A word of caution when Lotus 1-2-3 is run). Line 11 executes Lotus is in order about positioning the template. In the 1-2-3. Line 12 renames the AUTO123 file to the event the data file is large, the template should be original spreadsheet name. Line 13 erases the adequately removed from the cells that will con- APPL.DAT file. tain the imported data to avoid overwriting the cells of the template. The batch file contains replaceable parameters indicated by the symbols, %1 and %2. When the A. The Batch File for Lotus 1-2-3. batch file is run, the %1 and %2 symbols will be Before writing the batch file, two subdirectories replaced by file names passed to the batch file by were created. TCMACRO off the root directory, TopCount. The filenames are entered in the c:\; and ARCHIVE off the LOTUS (c:\LOTUS) Command String line in the Select Application directory. window of TopCount. This will be explained in the following paragraphs. A batch file named AUTO123.BAT copies the appropriate data files, stores the data in the B. TopCount Setup for Lotus 1-2-3 macro. ARCHIVE directory, and calls the spreadsheet. It is placed in the TCMACRO subdirectory. It can be created with any ASCII editor like EZ or EDLIN1. Line numbers are NOT part of the batch file. 1. @echo off The batch file, AUTO123.BAT, consists of the 2. If not exist c:\LOTUS\*.* goto end statements in Figure 2. 3. If not exist c:\TCMACRO\%1 goto end 4. :start What does the batch file do? Lines 2 and 3 check 5. copy c:\TCMACRO\%1 c:\LOTUS>nul to see if the appropriate paths exist and if there are 6. erase c:\TCMACRO\%1 files in them. Line 5 copies the TopCount data file 7. cd\LOTUS to the LOTUS directory for processing. Line 6 erases the data file from the TCMACRO direc- 8. copy %1 c:\LOTUS\ARCHIVE tory. Line 7 changes to the LOTUS directory. 9. copy %1 APPL.DAT Line 8 copies the TopCount data file to the 10. rename %2 AUTO123.WK1 ARCHIVE subdirectory of LOTUS for perma- 11. 123 nent storage. Line 9 copies the data file to 12. rename AUTO123.WK1 %2 APPL.DAT - the file name indicated in the 13. erase APPL.DAT macro. Line 10 renames the spreadsheet file 14. :end Figure 2. 1 EZ Editor is supplied with the instrument software and is Statements for AUTO123.BAT Batch File. located in the TopCount subdirectory. 2 The following information was entered in the Disk File Output window: Line numbers are NOT part of the batch file. Question Answer 1. {home} Data File Name? 123lin.001 (in this example) 2. {right 4} Drive and Path? c:\TCMACRO 3. {/file;ImportNumbers} Count Data? (View/Edit used to define the 4. {clear} cells; in this example only sample 5. c:\qpro\appl.dat~ number and CPMA were 6. {meta 312} 7. {esc} chosen) 8. {goto}f1~ Data Line? Sample 9. {/block;copy}f25..f36~ Data Column Header? No 10. rep1~ TopCount can store the data in an importable file 11. {/block;copy}f49..f60~ format in either a linear (LIN123) or matrix 12. rep2~ (MAT123) array for importing into either Lotus 13. {/block;copy}f73..f84~ or Quattro spreadsheets. The LIN123 data array 14. rep3~ was chosen here. 15. {goto}h1~ 16. {/print;resetblock} The following information was entered in the 17. {/print;block}h1..r18~ Select Application window: 18. {/print;go} 19. {end} Question Answer 20. {system;exit}y Program Name? AUTO123.BAT Drive and Path? c:\TCMACRO Figure 3. Macro, named \Ø, contained in Command String? 123lin.001 TCMAC.WK1 TCMAC.WQ1. Run application? plate

The command string is used to pass the name of The setup for TopCount is the same as described the TopCount data file, and the spreadsheet to be above, except the batch file name is changed to called, to the AUTO123.BAT file. QAUTO.BAT and the spreadsheet is changed to TCMAC.WQ1: NOTE: The command string is limited to 20 characters. If more than one file name is entered, Question Answer the total numbers of characterscan not exceed 20. The Quattro Pro spreadsheet macro. The macro, named \Ø, was written in a spread- Line numbers are NOT part of the batch file. sheet named TCMAC.WQ1 and stored in the 1. @echo off QPRO subdirectory (see Figure 3). It performs the same tasks as the one for Lotus. 2. if not exist c:\QPRO*.* goto end 3. if not exist c:\TCMACRO\%1 goto end Lines 8-17 can be modified and additional 4. :start lines may be added, depending on the data 5. copy c:\TCMACRO\%1 c:\QPRO>nul and processing required. 6. erase c:\TCMACRO\%1 7. cd\QPRO A. The Batch File for Quattro Pro. 8. copy %1 c:\QPRO\ARCHIVE The batch file, named QAUTO.BAT, performs 9. copy %1 APPL.DAT the same functions as the one for Lotus. After 10. q %2 written, it is placed in the TCMACRO subdirectory 11. erase APPL.DAT (see Figure 4). 12. :end B. TopCount Setup for Quattro Pro Macro. Figure 4. Statements for QUATO.BAT Batch File.

3 Data File Name? 123lin.001 (in this example) tion calculations (RESULT). Drive and Path? c:\TCMACRO Count Data? (View/Edit used to define the Summary cells; in this example only sample number and CPMA were Overall, the steps for setting up this example are chosen) as follows: Data Line? Sample Data Column Header? No 1. Install Lotus 1-2-3 or Quattro Pro to the hard drive. TopCount can store the data in an importable file 2. Create two subdirectories on the hard drive; format in either a linear (LIN123) or matrix TCMACRO off the root directory and (MAT123) array for importing into either Lotus ARCHIVE off the LOTUS or QPRO di- or Quattro spreadsheets. The LIN123 data array rectory. was chosen here. The following information was 3. Define a TopCount protocol to store the data entered in the Select Application window: file (named 123lin.001 in this example) into the TCMACRO subdirectory (Disk File Question Answer Output window) and execute the applica- Program Name? QAUTO.BAT tion (Select Application window) as previ- Drive and Path? c:\TCMACRO ously described. Command String? 123lin.001 TCMAC.WQ1 4. Write the appropriate batch file Run application? plate (AUTO123.BAT or QAUTO.BAT) and place it in the TCMACRO subdirectory. The command string is used to pass the name of 5. Write the auto-executing macro and worklist the TopCount data file, and the spreadsheet to be template in the spreadsheet to be called. In called, to the QAUTO.BAT file. this example, the spreadsheets were named TCMAC.WK1 (Lotus) and TCMAC.WQ1 NOTE: The command string is limited to 20 (Quattro Pro). Place the spreadsheet in the characters. If more than one file name is entered, appropriate directory. the total numbers of characterscan not exceed 20. The macros and batch files provided can serve as Figure 5 shows a sample printer output of calcu- a guide to help create worklists and automate data lations performed by the spreadsheet. The output reduction. With a small amount of effort, the from the Lotus spreadsheet is the same. As can be macros and the batch files can be customized as seen, the data file contains data points in triplicate. desired to fit a specific application for walk away Formulas were entered in the spreadsheets on-line data reduction and reporting of results. TCMAC.WK1 (Lotus) or TCMAC.WQ1 (Quattro Pro) to do the mean (AVG.), standard deviation (S.D.), % C.V. , and factor multiplica-

SAMPLE WORKSHEET REPLICATE AVERAGING #1 #2 #3 AVG. S.D. %CV SAMPLE I.D. FACTOR RESULT 370 417 498 428.33 64.75 15.12% SPECIMEN 1 0.1 42.83 391 508 304 401.00 102.37 25.53% SPECIMEN 2 0.2 80.20 391 560 439 463.33 87.09 18.80% SPECIMEN 3 0.3 139.00 562 729 407 566.00 161.04 28.45% SPECIMEN 4 0.4 226.4 443 778 399 540.00 207.28 38.39% SPECIMEN 5 0.5 270.00 540 497 713 583.33 114.33 19.60% SPECIMEN 6 0.6 350.00 8295 4769 4565 5876.33 2097.11 35.69% SPECIMEN 7 0.7 4113.43 33229 36763 35997 35329.67 1859.11 5.26% SPECIMEN 8 0.8 28263.73 40413 39310 43835 41186.00 2359.46 5.73% SPECIMEN 9 0.9 37067.40 40193 36786 43067 40015.33 3144.27 7.86% SPECIMEN 10 1.0 40015.33 43560 37983 44452 41998.33 3505.87 8.35% SPECIMEN 11 1.1 46198.17 51118 46023 49154 48765.00 2569.68 5.27% SPECIMEN 12 1.2 58518.00

Figure 5. Sample Worklist - Replicate Averaging. 4