Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - RespTest

Pages: [1]
1
QB64 Discussion / Unhandled Error #62
« on: August 26, 2020, 09:52:34 am »
Hello Everyone,

I'm curious if someone might be able to help me with my issue.
I should preface with I have very little programming experience, especially in BASIC and that I did not write the program.

We're using a small BASIC program to read data from a Serial RS232 port and output it into a notepad file.
The program in question works fine in QB45, but does not in QB64.
We're dependant on QB64 now since upgrading one of our computers to windows 10.

In QB45 it runs fine, but in QB64 we've run into "Unhandled Error#62 Line:29 (in main module) Input past end of file Continue?."
Attempting to continue runs the error in a loop and selecting "no" closes it out.
I have noticed that if the serial port is outputting a constant stream of data and then the program is run it can collect the data, but it will not sit and wait for data to be streamed to it (this is what we need and this is how it works in QB45).

Thank you in advance for any and all suggestions and assistance.
If you need any other information regarding the problem please don't hesitate to ask.
In the effort of transparency this is in regards to a commercial endeavor so if this is unacceptable based on forum guidelines I apologize and I'll gladly delete the posting.
Thanks again.

Code: QB64: [Select]
  1. REM Serial Program
  2.  
  3.  
  4. OUT 1021, 96
  5. Y$ = ""
  6.  
  7. OPEN "COM3:9600,O,7,1,RS0,DS0,BIN,CD0,CS0" FOR INPUT AS #1
  8.  
  9. PRINT " Welcome To Primative Programming Solutions"
  10. PRINT " Where The Soft-Ware Past Comes Alive In ALL Its Splendor"
  11. PRINT "The data will be saved in a text file in the C:\TSIDATA\ folder. "
  12. PRINT "Type in the file name to which you wish the data saved "
  13. INPUT "and press <ENTER> (maximum of eight characters).    ", filename$
  14. PRINT "The data will be stored in:  C:\Users\Labuser\Desktop\TSI QuickBasic\TSIDATA\"; filename$; ".txt"
  15. OPEN "C:\Users\Labuser\Desktop\TSI QuickBasic\TSIDATA\" + filename$ + ".txt" FOR OUTPUT AS #4
  16. PRINT "To Stop Aquiring Data Press:  <SHIFT><Q> "
  17. PRINT "Data has begun to be acquired."
  18.  
  19.  
  20. WHILE Y$ <> "Q"
  21.  
  22.     INPUT #1, A$
  23.  
  24.     PRINT A$
  25.  
  26.     PRINT #4, A$
  27.  
  28.     Y$ = INKEY$
  29.  
  30.  
  31. PRINT " The program has stopped collecting data."
  32.  
  33.  

Pages: [1]