qbasic serial communications in 98/xp
Results 1 to 6 of 6

Thread: qbasic serial communications in 98/xp

  1. #1
    Registered User drivers's Avatar
    Join Date
    Mar 2003
    Posts
    55

    qbasic serial communications in 98/xp

    I hava a qbasic program that works on win95, but cannot communicate with the serial port when running Win98SE or XP.
    If I run the Win98 machine in dos mode it works, so there are no hardware problems. How do I make it work on Win98SE, and hopefully XP? It is a plot program for surveying, and reads data from an old handheld Sanyo.

  2. #2
    Intel Mod Platypus's Avatar
    Join Date
    Jan 2001
    Location
    Australia
    Posts
    5,783
    I guess it should be able to work OK, for example here:

    http://www.techlib.com/electronics/serialport.htm

    qbasic is said to do a similar thing OK under 98 and XP.

    Maybe the difference is between the systems rather than the Windows versions? eg if the Win95 system it works on still has an ISA bus with the I/O on it, but the 98/XP systems are pure PCI, you may need to reserve the required Serial Port address and/or IRQ for Legacy in the BIOS setup.

  3. #3
    Registered User
    Join Date
    Sep 2000
    Posts
    218
    How are you accessing the COM port?

    Are you doing using OPEN "COM1:" FOR INPUT AS #1
    or are you uisng INP(&H3FC) or similar direct addressing?

    Does the program need to Read and Write data to the device, or is it a read-only dump?

    Assume for a minute that it will not work under advanced OSes - have you considered a third-party com port read/write utility? The 3rd party utility could read the data coming from the device over the COM port and read it to a file, and you should be able to adjust the program to use a dump from another file.

    http://www.handyarchive.com/Utilitie...t-Toolkit.html

    Or perhaps even rewriting the code in another language - I recentlly needed to talk to a serial device, I used Python (a free interpretive programming language, www.python.org) and the Python Serial library (also free) - serial port is treated just like a file, I was able to get data to my program after only a few minutes of playing with the code.

  4. #4
    Registered User drivers's Avatar
    Join Date
    Mar 2003
    Posts
    55
    Quote Originally Posted by Platypus
    I guess it should be able to work OK, for example here:

    http://www.techlib.com/electronics/serialport.htm

    qbasic is said to do a similar thing OK under 98 and XP.

    Maybe the difference is between the systems rather than the Windows versions? eg if the Win95 system it works on still has an ISA bus with the I/O on it, but the 98/XP systems are pure PCI, you may need to reserve the required Serial Port address and/or IRQ for Legacy in the BIOS setup.

    I tried setting IRQ4 to "reserved" or "legacy" - did not solve the problem.

  5. #5
    Registered User drivers's Avatar
    Join Date
    Mar 2003
    Posts
    55
    [QUOTE=ShadowWynd]How are you accessing the COM port?

    Are you doing using OPEN "COM1:" FOR INPUT AS #1
    or are you uisng INP(&H3FC) or similar direct addressing?

    It is using the OPEN "COM1": FOR INPUT AS #1 syntax.

    Does the program need to Read and Write data to the device, or is it a read-only dump?

    It is set up to recieve data from a handheld computor or to upload data to the handheld.

  6. #6
    Registered User drivers's Avatar
    Join Date
    Mar 2003
    Posts
    55
    [QUOTE=drivers]
    Quote Originally Posted by ShadowWynd
    How are you accessing the COM port?

    Are you doing using OPEN "COM1:" FOR INPUT AS #1
    or are you uisng INP(&H3FC) or similar direct addressing?

    It is using the OPEN "COM1": FOR INPUT AS #1 syntax.

    Does the program need to Read and Write data to the device, or is it a read-only dump?

    It is set up to recieve data from a handheld computor or to upload data to the handheld.

    Here is a snippet of the code:

    IF B$ = "500" THEN PRINT "select file: field.35/field.65 "; : GOSUB 7: OPEN "COM1:9600,N,8,1" FOR RANDOM AS #1: RETURN
    GOTO 7910

    9010 SCREEN 0: COLOR 15, 12: IF ERR = 58 THEN PRINT "file exists! overwrite? (y)/n:"; : GOSUB 7: IF B$ = "n" THEN RESUME 4000 ELSE RESUME NEXT
    IF ERL = 10132 OR ERL = 2222 THEN RESUME NEXT
    IF ERR = 53 THEN PRINT "file not found"; : P2 = 7: RESUME 10190
    IF ERR = 24 OR ERL = 2275 THEN PRINT "device cannot communicate"; : RESUME 4000
    IF ERR = 25 THEN PR$ = "n": RESUME 4000
    IF ERL = 0 THEN PRINT "impossible"; : RESUME 4000
    IF ERR = 13 AND ERL = 10251 THEN PRINT P; : INPUT #2, Q$: RESUME NEXT
    IF ERR = 9 THEN PRINT " exceeds 150 lots or 7999 points!"; : RESUME 4000
    IF ERL = 1076 OR ERL = 1071 THEN COLOR 7, 0: RESUME NEXT
    PRINT "error "; ERR; " line "; ERL; : COLOR 7, 0: RESUME 4000

    9990 PRINT " 1 receive co-ords from PC-1460(500); 2 store co-ords to disk; (6 append)"
    PRINT " 3 read co-ords from disk; (5 string) 4 send co-ords to PC-1460(500)"
    PRINT " 7 search for co-ord file; 8 delete co-ord file; "
    PRINT "1,2,3,4,5,6,7,8 ?: "; : GOSUB 7: P2 = VAL(B$): P1 = 0
    ON P2 GOTO 10000, 10100, 10200, 10300, 10200, 9996, 10190, 10099
    GOTO 4000
    9996 COLOR 15, 1: PRINT "append points; "; : GOSUB 1060: GOTO 10110

Similar Threads

  1. Serial ATA Driver Issues!
    By Da-Rock in forum BIOS/Motherboard Drivers
    Replies: 2
    Last Post: February 13th, 2004, 03:32 PM
  2. serial to parallel adaptor
    By cabal in forum Tech-To-Tech
    Replies: 3
    Last Post: January 5th, 2004, 02:49 PM
  3. Burning a serial number into the CMOS..
    By Wildman6971 in forum BIOS/Motherboard Drivers
    Replies: 5
    Last Post: July 25th, 2001, 10:58 PM
  4. [RESOLVED] PCI Universal Serial Port
    By CompDoc in forum BIOS/Motherboard Drivers
    Replies: 1
    Last Post: November 14th, 2000, 05:17 PM
  5. [RESOLVED] pci serial controller
    By davet in forum BIOS/Motherboard Drivers
    Replies: 2
    Last Post: October 22nd, 2000, 05:13 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •