Re: Parallel port and Visual Basic?




John Larkin wrote:
> On Sat, 09 Apr 2005 15:36:12 GMT, "Zucker" <zuckuss@xxxxxxxxxxx>
> wrote:
>
> >I am in the process of building a circuit that will monitor the
start and
> >finish times for pine box derby cars. I would like to be able to
catch these
> >events by feeding signals, through the parallel port, to a Visual
Basic
> >program. I was thinking of using the eight data pins from the
parallel port
> >to monitor eight lanes.
> >
> >The electronics are good to go. My problem is with Visual Basic.
> >
> >Does anyone know how to access and capture bit patterns from the
parallel
> >port using Visual Basic?
> >
> >Steve
> >
> >PS...I have asked this same question in several programming
newsgroups, but
> >I have not recieved any responses.
> >
>
> Run PowerBasic under DOS. No problems!
>
> John

I agree with Mr. Larkin. As a WAG, assume the Pinewood Derby cars are
going at least 10 mph at the end of the track. That means about 15
feet per second, which means 20 car lengths per second (8" car length).
Winning by 1/10th of a car length (you can easily see that yourself)
would mean you need much better than 5ms. latency. I would think
0.5ms. latency would be barely adequate for this job. Sorry, but that
isn't going to happen with VB. No way.

Power BASIC is ideal for this job.

If the OP wants to hijack the PC system timer for greater accuracy
instead of relying on a calibrated timing loop, here's a C program
listing that could easily be ported to Power BASIC:

http://www.edn.com/index.asp?layout=articlePrint&articleID=CA231577

For newbies or hobbyists using the parallel port for real-world I/O,
the ideal source is Jan Axelson's "Parallel Port Complete", which is
available from many sources, including the Lakeview Research website:

http://www.lvr.com/parport.htm

The links on this webpage alone should be enough for the OP to figure
out how to do parallel port hardware in Power BASIC, QB, C, or any DOS
language he knows already. But the book and CD are a great investment,
and will allow the OP to learn more and get up to speed quickly.

The book also has the drivers he would need to do this in VB, as well
as lots of sample code. However, it probably won't work well, because
no VB program will be able to devote exclusive attention to the port.
Windows just has so many other fascinating things to do that are _so_
important ;-) He'll probably only get ballpark 10 ms. or 20ms. latency
at best with VB, which isn't good enough.

Thanks,
Chris

.



Relevant Pages

  • Re: Parallel port and Visual Basic?
    ... >events by feeding signals, through the parallel port, to a Visual Basic ... Windows, using VB or almost any language: Use the sound card! ... If you get more than one car at a time, ...
    (sci.electronics.basics)
  • Newbie Visual basic programmer wants to do exact same in linux in c++ or c
    ... Hi i'm a total newb for both using linux and programming. ... Now what i have done is modified a Remote control cars controller ... using solid state relays so that i can control my car using the data ... toggling the data lines on the parallel port (D0 is forward D1 Reverse ...
    (comp.programming)
  • Re: Parallel port and Visual Basic?
    ... >finish times for pine box derby cars. ... >events by feeding signals, through the parallel port, to a Visual Basic ... >to monitor eight lanes. ...
    (sci.electronics.basics)
  • Parallel port and Visual Basic?
    ... finish times for pine box derby cars. ... events by feeding signals, through the parallel port, to a Visual Basic ... to monitor eight lanes. ... PS...I have asked this same question in several programming newsgroups, ...
    (sci.electronics.basics)
  • Re: Parallel port and Visual Basic?
    ... >events by feeding signals, through the parallel port, to a Visual Basic ... >to monitor eight lanes. ... to get direct hardware access to the ...
    (sci.electronics.basics)