IOS Inc.

The Brewer experts

MAIN.BAS: Summary of V3.75f Brewer software changes by IOS.

Summary of V3.75f Brewer software changes by IOS.
Last updated April 5, 2004.

IOS has made a number of software improvements to V375e software for Brewers. The main reason for this work was to incorporate the 1997 software developments from Julian Groebner and allow IOS microboard to be used with standard programs. During the process some bugs were fixed as well.

V3.75f Improvements Summary List:

  • reset messages for AZ/ZE now saved in proper B file and into D-file;
  • D-file opened with PD command whenever program is run;
  • Julian's Cosmac code (the "X" and the "E" commands) now used by old electronics and new IOS board (9600 baud uart);
  • IOS board option now in standard control software - in Main and RE programs;
  • internal clock on/off now only set by IC command.


Below are the lines in main program which have been changed. The lines without any content is code that was removed mainly to reduce program size due to memory limit in GWBASIC.

On April 4, 2004 IOS corrected line 280 in the MAIN program. There, Q14% was mistakenly used to check for the presence of the new IOS micro-board while it should be Q16%. This error could affect the communication between the computer and the Brewer with the original micro-board. The version of the MAIN that is available for download on this site has now been corrected for this mistake.

The bug with reset messages not going to proper B-file at startup with a Brewer reset was fixed with gosub 6200 in line 185. These messages were going to the strange file - B.###. Note also in line 185 the "pd" command is run which turns on D-file recording at startup, which was desired to record reset events which were nearly impossible to catch before especially since printers have been discarded. The IOS board is set to 9600 baud during RE sequence like the original Cosmac board changes from 300 to 1200 baud. Therefore changes were needed in the RE routine as well. The variables set in line 190 for communications were created to save code space in lines 9082-9280. The change in line 280 is necessary for IOS board and does not affect old boards or new electronics.

The changes in lines 310-400 and 3900-3910 are to correct bug of today.tmp file resetting to zero contents whenever program was run.

Lines 1220-1262 is for detection and setting of new Q16% variable for IOS uart board (=1 if in use). Volodya figured out a way to not have to change the format of op_st file by having the value of Q16% be stored together with Q11% (second polarizer). This is even set automatically if this board is detected at startup by checking baud rate and characters U+A from IOS uart board. The changes at lines 5262-5275 are to read and change if necessary the op_st.### contents. There is a separate program (OP_ST.EXE) available for editing op_st file contents before startup. The instrument configuration (IC) routine was changed for this new option - IOS uart board. In the reset routine the removal of gosub 7950 in line 18030, fixed up the screen messages during RE/FR sequence.

An important fix has been introduced at line 5815. This eliminates a 'mysterious' double GMT day advancement that happened from time to time at some sites. The problem was identified as an incorrect T0 (GMT time) variable's value inside the 5800 subroutine after a command requiring a lamp warm-up (SL,SR, etc) was executed at such time that the warm-up period ends before the GMT midnight but the test itself ends after the GMT midnight. Please note: not every Brewer command that is scheduled after SL or SR in this situation led to the error. We decided it is better to eliminate this error at its root rather than to sort out which commands generate it.

Other main program changes were the removal of clock messages in lines 7309,7309 which have been confusing to some users, especially those who operate with time controlled from computer. The turn on of clock board must now be done with IC command. The removal of line 5710 stops the Brewer software from changing the computer date. The computer must be on GMT time except with Windows NT and is assumed to have suitable battery to maintain the proper date settings. The removal of lines 2785, 2915, 2916 and 4900-4999 were to remove use of un-needed DDP, DD and SLEEP commands. The changes at 2715, 3437 and 3555 allow proper use of IOS QL routine for UV calibrations. The change at line 9890 is for version change to 3.75f.

NEW: Line 185 amended on July 3, 2003.

3 B$=" *                                              *"
13 LOCATE ,12:PRINT" *                   MSC/K&Z/IOS                *
14 LOCATE ,12:PRINT" *           ALL Brewers Operating Program      *
15 LOCATE ,12:PRINT" *         Version 3.75f - Full Release         *
16 LOCATE ,12:PRINT" *                Mar 18, 2003                  *
19 LOCATE ,12:PRINT" *      Originally written by  Dr. JB Kerr      *
20 LOCATE ,12:PRINT" *  Adapted for the IBM PC by  Dr. CT McElroy   *
185 PZ$=L3$: LA=VAL(L1$):LO=VAL(L2$):PZ%=VAL(L3$):LC$=LO$:GOSUB 6200:C$="pd":GOSUB 2900	
186 PRINT#4," PROGRAM start :  ";MP$;DB$;YE$
190 COMSET$=",n,8,1,rs,ds,cs,cd":COMBR$=":1200":COMBR0$=":300":IF Q16%=1 THEN COMBR$=":9600":COMBR0$=":1200"	
280 LF$=CHR$(10):CR$=CHR$(13):R$=CR$+LF$:HD$="B":IF Q14%=0 THEN EL$="-> " ELSE EL$=CHR$(0)+"-> "
310 A$=INKEY$:ZS=-200
390 CLOSE 1:JDAY$="000":GOSUB 3900: GOTO 350
400 RESUME 390
1220 O1$="F,0,2:V,120,1":IF Q16%=1 THEN O1$="F,0,2:L,16820,141"
1225 GOSUB 9400:TD=120:GOSUB 7000
1261 O1$="D,2955,2956":GOSUB 9450:UARTB=0:IF INSTR(I1$,"85")<>0 AND INSTR(I1$,"65")<>0 THEN UARTB=1: ' Check if uart board is there
1262 IF UARTB=1 AND Q16%=0 THEN Q16%=1:GOSUB 5200:PRINT#4, "Q16% now set for IOS board, fixing, restarting..":CLOSE 4:RUN
1350 :
2715 IF C$="ul" OR C$="qs" OR C$="xl" OR C$="ql" THEN GOSUB 3700
3437 IF (C$="ul" OR C$="qs" OR C$="xl" OR C$="ql") AND (SK$<>"") THEN 3460
3555 IF G$(I)="ul" OR G$(I)="qs" OR G$(I)="xl" OR G$(I)="ql" THEN FG=1
3910 IF JD$<>JDAY$ AND JDAY$<>"" THEN GOSUB 6050
5262 PRINT#8,Q10%;R$;Q11%+2*Q16%;R$;0;R$;Q13%;R$;Q14%;R$;Q15%;R$;
5370 INPUT#8,Q11%,I,Q13%,Q14%,Q15%,DI$,MDD$,SK$:Q16%=0:IF Q11%>1 THEN Q16%=1:REM IOS uart board
5375 Q11%=Q11%-2*Q16%:N9$="6":SE$=":":IF TYP$="mkiii" AND Q14%=1 THEN N9$="9":SE$="&"
5710 '
5815 T0 = timer/60: rem ensure the time is ok
9082 IF A$<>"p" THEN OPEN "com"+CP$+COMBR$+COMSET$ AS 7
9255 COM(CP%) OFF:O1$="F,0,2;V,30,1":IF Q16%=1 THEN O1$="F,0,2:L,16820,165"
9256 GOSUB 9450
9260 CLOSE 7:OPEN "com"+CP$+COMBR0$+COMSET$ AS 7
9275 COM(CP%) OFF: IF Q16%=0 THEN O1$="F,0,2;V,120,1":GOSUB 9450
9276 IF Q16%=1 THEN O1$="F,0,2:L,16820,141"+CR$:PRINT#7,O1$
9277 TA=2*60:GOSUB 7120
9890 LOCATE 1,50:PRINT " C.U.T. ";CT$(Q6%);TIME$;" 3.75f":RETURN