Lake Shore Model 321 Autotuning Temperature Controller User’s Manual
Remote Operation
4-21
4.3 USER CURVE 11 LOADING PROGRAM
To simplify the loading of User Curve 11, the following curve loading program is provided. The program
is written in QuickBASIC V4.0. The user should create an ASCII file with the curve data in the same
format as used in the CURV11 command. Immediately following the program are two sample user
curve files. Then launch the Curve Loading Program where you will be prompted for a file name. The
program will then open the ASCII file and download the data.
'**********************************************************************
'* 321 CURVE LOADING PROGRAM. NOTE: SPACING OF THE DATA STRING IS *
'* VERY CRITICAL, SEE THE ATTACHED SAMPLE CURVE. The curve data *
'* must be in an ASCII file using the same format as the example. *
'**********************************************************************
CLS 'Clear
Screen
M$ = CHR$(13) + CHR$(10)
'Define M$ as <cr><lf> terminator
CHECKER$ = SPACE$(3000)
'Preset variable lengths
C$ = SPACE$(2000)
'Get the file name to load
INPUT "TYPE IN DRIVE NAME AND SERIAL NUMBER OF SENSOR AND PRESS ENTER";
A$ B$ = A$
OPEN B$ FOR INPUT AS #1
'Open ASCII disk file
LINE INPUT #1, C$
'Read disk file into string C$
STRIP$ = MID$(C$, 9)
'Strip off the DRC series file header
LOADER$ = "CURV11," + STRIP$
'Add the 300 series curve header
PRINT LOADER$
'Screen prints to show what is sent
PRINT
PRINT "COMMANDS SENT TO 321"
PRINT
'Close disk file
CLOSE #1
OPEN "COM1:300,O,7,1,RS" FOR RANDOM AS #2 'Open com port for I/O
LOADTRIM$ = LEFT$(LOADER$, 50)
'Pick out first 50 chars for first cmd
LOADTRIM$ = LOADTRIM$ + M$
PRINT LOADTRIM$;
'Show command string on screen
PRINT #2, LOADTRIM$;
'Send curve create cmd to 321
FOR Z = 1 TO 2000: NEXT Z
'**********************************************************************
'*** BEGINNING OF THE EDIT LOOP, WHICH ADDS ONE DATA POINT TO ***
'*** THE CURVE AT A TIME USING THE ECUR COMMAND ***
'**********************************************************************
EDITLOOP:
PREEDIT$ = MID$(LOADER$, 51)
'String clean-up
EDITLOOP1:
LENGTH = LEN(PREEDIT$)
'Check for end of string
IF LENGTH < 14 THEN GOTO EDITEND
EDITPIECE$ = LEFT$(PREEDIT$, 14)
'Pull data point from the
PREEDIT$ = MID$(PREEDIT$, 15)
'string and send it to the 321
EDITOUT$ = "ECUR11" + EDITPIECE$ + M$