Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: QBASIC COM Questions  (Read 5359 times)

0 Members and 1 Guest are viewing this topic.

Zylstra

    Topic Starter
  • Moderator


  • Hacker

  • The Techinator!
  • Thanked: 45
    • Yes
    • Technology News and Information
  • Certifications: List
  • Computer: Specs
  • Experience: Guru
  • OS: Windows 7
QBASIC COM Questions
« on: November 06, 2007, 05:48:00 PM »
Okay,
Lets pretend that I had a COM port on my computer. Now lets pretend I have some sort of COM cable (who knows that kind exactly)
Is it possible that I could build a QBASIC program that will tell me when an electrical connection is made in a cable?
For example, if the COM cable I had an end that looked like a headphone plug with only two separate parts (wires) is it possible to make a program that will monitor the input, and tell me when something comes in through it? (If I took a piece of foil, and connected the two connections)

(A bit of a strange question)

I know that something similar can be accomplished, since my Uncle had a QBASIC program that would tell you how long it took a piece of wood to run through a saw. A start time was created, and once the log set the trigger and the time would stop.

ValerieMay



    Beginner

    Thanked: 5
    Re: QBASIC COM Questions
    « Reply #1 on: November 06, 2007, 06:12:55 PM »
    QBasic 4.5 will certainly do what you want but programming the ports in QB 4.5 is difficult in anything other than real Dos mode (not tried DOSBox). 

    VM.

    Zylstra

      Topic Starter
    • Moderator


    • Hacker

    • The Techinator!
    • Thanked: 45
      • Yes
      • Technology News and Information
    • Certifications: List
    • Computer: Specs
    • Experience: Guru
    • OS: Windows 7
    Re: QBASIC COM Questions
    « Reply #2 on: November 06, 2007, 06:29:26 PM »
    How does one start accomplishing such a program (using the OPEN COM statement)?

    ValerieMay



      Beginner

      Thanked: 5
      Re: QBASIC COM Questions
      « Reply #3 on: November 06, 2007, 07:19:33 PM »
      Yes, that's one of the commands which are used.   Then the port must be polled while waiting for input (INP) and when that input is detected some action is taken. 

      I suggest you find a tutorial which suits your purpose.  You may find a suitable one here or at one the many other QB tutorials on the WWW.  There are also dedicated QB forums.

      Good luck

      VM.

      ValerieMay



        Beginner

        Thanked: 5
        Re: QBASIC COM Questions
        « Reply #4 on: November 08, 2007, 12:54:15 AM »
        A port programming tutorial written in QB is here. Download Q-Basics.zip, chapter 11 contains the tut.

        If you want to try QB port programming in XP then the PortTalk driver mentioned in the above is here.

        VM.