Re: Parallel port and Visual Basic?
- From: "Chris" <cfoley1064@xxxxxxxxx>
- Date: 9 Apr 2005 12:36:34 -0700
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
.
- References:
- Parallel port and Visual Basic?
- From: Zucker
- Re: Parallel port and Visual Basic?
- From: John Larkin
- Parallel port and Visual Basic?
- Prev by Date: Re: Parallel port and Visual Basic?
- Next by Date: Re: Scope question
- Previous by thread: Re: Parallel port and Visual Basic?
- Next by thread: Re: Parallel port and Visual Basic?
- Index(es):
Relevant Pages
|