Hi,
Slightly weird problem.
I have a Qbaisc program that simply sits and listens to a serial port which is hooked up at 9600/8/N/1 to a system, and simply records whatever it recived both on screen and in a text file.
This bit works great.
Every few days the system im listening to falls over and crashes. i need to be able to realise when it crashes (it send an "@" sign out only) and then send some commands back at it. the problem i have is i cant send it at 9600 back as the system only polls the port once every 10ms (its designed to have hyperterminal connected, therefor you type with keyboard not send strings)
It also echos back every character.
I need to be able to send short strings, followed by CHR(10) and CHR(13) and then log both the echoed letters, and its responce (the debug info)
Anyone have any ideas?
Below is the code im currently using to record the logs at present:
10 OPEN "wipcom.txt" FOR OUTPUT AS #3
20 COM(1) ON
30 OPEN "com1:9600,N,8,1,asc,cd0,cs0,ds0,op0,tb1024,rb1024" FOR INPUT AS #1
35 ON ERROR GOTO etrap
40 CLS
50 LOCATE 2, 15
60 PRINT "WIP CONSOLE LOGGER - V1.00 01/05/2008"
LOCATE 24, 20
PRINT "Press `CTRL + BREAK' to exit - Errors Logged in wipcom.txt"
70 VIEW PRINT 3 TO 22
80 DO WHILE NOT INKEY$ = CHR$(27)
90 LINE INPUT #1, Line$
100 TestTIME$ = TIME$
110 TestDATE$ = DATE$
120 PRINT Line$, TestTIME$, TestDATE$
130 PRINT #3, TestDATE$, TestTIME$, Line$
140 LOOP
150 CLOSE #1
160 CLOSE #3
170 SYSTEM
180 END
200 etrap:
205 PRINT TestDATE$, TestTIME$, "Software Link Fault - Error Logged"
210 PRINT #3, TestDATE$, TestTIME$, "SOFTWARE REPORT - The Error number is err #"; ERR
220 RESUME
Note - theres a weird thing happeneing when im connected and we switch off the other syste, i get an error and the software crashes, thus the etrap subrouten
Any help or suggestions/example code would be fantastic, iv been trying to get this dam thing working for a few weeks now and i cant find an awful lot online that iv been able to convert into working code.
Cheers
Slightly weird problem.
I have a Qbaisc program that simply sits and listens to a serial port which is hooked up at 9600/8/N/1 to a system, and simply records whatever it recived both on screen and in a text file.
This bit works great.
Every few days the system im listening to falls over and crashes. i need to be able to realise when it crashes (it send an "@" sign out only) and then send some commands back at it. the problem i have is i cant send it at 9600 back as the system only polls the port once every 10ms (its designed to have hyperterminal connected, therefor you type with keyboard not send strings)
It also echos back every character.
I need to be able to send short strings, followed by CHR(10) and CHR(13) and then log both the echoed letters, and its responce (the debug info)
Anyone have any ideas?
Below is the code im currently using to record the logs at present:
10 OPEN "wipcom.txt" FOR OUTPUT AS #3
20 COM(1) ON
30 OPEN "com1:9600,N,8,1,asc,cd0,cs0,ds0,op0,tb1024,rb1024" FOR INPUT AS #1
35 ON ERROR GOTO etrap
40 CLS
50 LOCATE 2, 15
60 PRINT "WIP CONSOLE LOGGER - V1.00 01/05/2008"
LOCATE 24, 20
PRINT "Press `CTRL + BREAK' to exit - Errors Logged in wipcom.txt"
70 VIEW PRINT 3 TO 22
80 DO WHILE NOT INKEY$ = CHR$(27)
90 LINE INPUT #1, Line$
100 TestTIME$ = TIME$
110 TestDATE$ = DATE$
120 PRINT Line$, TestTIME$, TestDATE$
130 PRINT #3, TestDATE$, TestTIME$, Line$
140 LOOP
150 CLOSE #1
160 CLOSE #3
170 SYSTEM
180 END
200 etrap:
205 PRINT TestDATE$, TestTIME$, "Software Link Fault - Error Logged"
210 PRINT #3, TestDATE$, TestTIME$, "SOFTWARE REPORT - The Error number is err #"; ERR
220 RESUME
Note - theres a weird thing happeneing when im connected and we switch off the other syste, i get an error and the software crashes, thus the etrap subrouten
Any help or suggestions/example code would be fantastic, iv been trying to get this dam thing working for a few weeks now and i cant find an awful lot online that iv been able to convert into working code.
Cheers