Qbasic & 1620 temp
RickM
Posts: 10
this program takes input from a BS2 BOE w/ a DS1620 connected.
It works, but it will crash w/ an I/O error at the following line
Input #1,DSdata$
any thoughts
rick
****************************
CLS
COLOR 14
OPEN "COM1:9600,N,8" FOR INPUT AS #1
'COM(1) ON
OPEN "TempDATA.txt" FOR APPEND AS #2
PRINT #2, "Program start Time = "; TIME$, DATE$ CLOSE #2
x = 1
WHILE x = 1
min$ = MID$(TIME$, 4, 2)
sec$ = MID$(TIME$, 7, 2)
everymin$ = MID$(TIME$, 5, 1)
LOCATE 20, 25: PRINT "Records temp at 29 min and 59 min past the hour Tempdat.txt"
INPUT #1, DSdata$ <
crashes here
conv1$ = DSdata$
INPUT #1, DSdata$
conv2$ = DSdata$
IF (min$ = "29" AND sec$ = "00") THEN
OPEN "TempDATA.txt" FOR APPEND AS #2
PRINT #2, " "; DATE$, TIME$, conv1$, conv2$
CLOSE #2
END IF
IF sec$ = "00" THEN
'IF (min$ = "00" AND sec$ = "00") THEN
OPEN "TempDATA.txt" FOR APPEND AS #2
PRINT #2, " "; DATE$, TIME$, conv1$, conv2$
CLOSE #2
END IF
LOCATE 14, 10: PRINT " ";
LOCATE 2, 50: PRINT ; DATE$
LOCATE 12, 10: PRINT "The Temp in ricks room = "; conv1$
LOCATE 13, 10: PRINT "The Temp in ricks room = "; conv2$
LOCATE 10, 10: PRINT "Current Time = "
LOCATE 10, 25: PRINT ""; TIME$
WEND
It works, but it will crash w/ an I/O error at the following line
Input #1,DSdata$
any thoughts
rick
****************************
CLS
COLOR 14
OPEN "COM1:9600,N,8" FOR INPUT AS #1
'COM(1) ON
OPEN "TempDATA.txt" FOR APPEND AS #2
PRINT #2, "Program start Time = "; TIME$, DATE$ CLOSE #2
x = 1
WHILE x = 1
min$ = MID$(TIME$, 4, 2)
sec$ = MID$(TIME$, 7, 2)
everymin$ = MID$(TIME$, 5, 1)
LOCATE 20, 25: PRINT "Records temp at 29 min and 59 min past the hour Tempdat.txt"
INPUT #1, DSdata$ <
crashes here
conv1$ = DSdata$
INPUT #1, DSdata$
conv2$ = DSdata$
IF (min$ = "29" AND sec$ = "00") THEN
OPEN "TempDATA.txt" FOR APPEND AS #2
PRINT #2, " "; DATE$, TIME$, conv1$, conv2$
CLOSE #2
END IF
IF sec$ = "00" THEN
'IF (min$ = "00" AND sec$ = "00") THEN
OPEN "TempDATA.txt" FOR APPEND AS #2
PRINT #2, " "; DATE$, TIME$, conv1$, conv2$
CLOSE #2
END IF
LOCATE 14, 10: PRINT " ";
LOCATE 2, 50: PRINT ; DATE$
LOCATE 12, 10: PRINT "The Temp in ricks room = "; conv1$
LOCATE 13, 10: PRINT "The Temp in ricks room = "; conv2$
LOCATE 10, 10: PRINT "Current Time = "
LOCATE 10, 25: PRINT ""; TIME$
WEND
Comments
I thought "INPUT" and "INPUT#" were different keywords in QBasic.
Edit: Nope, the above is not a problem.· The QBasic 'help' says:
OPEN "COM1:300,N,8,1,CD0,CS0,DS0,OP0,RS,TB2048,RB2048" for RANDOM as #1
This disables 'hardware handshaking' which you don't want, and enlarges the buffers, which you do want.
Probably, this lets you 'INPUT' and 'PRINT' to #1 and have it work, too.
Post Edited (allanlane5) : 2/16/2007 8:04:09 PM GMT