Do you have a question? Post it now! No Registration Necessary
Subject
- Posted on
April 17, 2005, 6:39 am

Hi, I'm trying to send 8 bits to the lpt port.
I'd like to use VB 6.0. Can this be done?
VB can send data to a printer, but can it
go as low as actually sending bits? I think
VB can only send bytes. If VB can only send
bytes. Can the bits in the bytes be specific?
Can I send , 1 0 1 0 0 0 1 , out the 8 pins
of the printer port?
thanks
Ed

Re: Can VB 6.0 control 8 data bit pins of LPT port?

It is basic stuff to you. But I'm learning VB6.0. and I'm seeing how to
control a printer, but not to send exact bits. I'm going to send 8bit
control words to an 8255. I don't see how to do this with VB 6.0
Ther are 16 control words that the 8255 can use.
I did find Jan Axelson wrote inpout32_source_and_bins.zip and that
might help me.
oh well, I'll keep looking for info.

Re: Can VB 6.0 control 8 data bit pins of LPT port?

You have to send bytes direct to the printer data port in the hardware,
usually at 0x278 (888 decimal), but VB might not have the instruction
you need - something like 'outp value' or 'oport value'. But our friend
Bill Gates has decreed that XP and W2000 will prevent such shenanigans
by users who dare to think that it's their machine. W98/95 are OK,
though. And you will probably have to use port 889 or 890 to toggle a
load-bit after setting up your data.
Try using DEBUG in DOS to get the hang of it.
--
Joe Soap.
JUNK is stuff that you keep for 20 years,
Joe Soap.
JUNK is stuff that you keep for 20 years,
We've slightly trimmed the long signature. Click to see the full one.

Re: Can VB 6.0 control 8 data bit pins of LPT port?

Yes. Sending bytes to your lpt isnīt basic stuff. But there are several
examples on the net. Maybe you need an extra dll doing this. Some
electronics magazines (german ones do) offer these. Transforming 8bits
into one byte is easy.
mfg Tobias
--
Alle eMails an die genannte Adresse landen in /dev/null
Kontaktinfos auf www.schrelb.de
Alle eMails an die genannte Adresse landen in /dev/null
Kontaktinfos auf www.schrelb.de

Re: Can VB 6.0 control 8 data bit pins of LPT port?

... snip ...

I did look for some printer port led projects. I have to d/l IO.DLL,
which does not come w/ VB 6.0. Seems like other programmers
want to control the printer port. It's going to take some time.
I have to find out how to write a byte.
The 8255 wants binary, converted to hex.
To wite hex w/ VB 6.0 is CommandWord = CByte(&H80)
I keep doing this for hex 90, 81, 82,83,84,89, 8A,8B,90,91,92,93,98,99,9A &
9B.
No, not easy.

Re: Can VB 6.0 control 8 data bit pins of LPT port?

Not that this has anything to do with teh question, but you might
consider moving to VB.net since you aer just learning. Microsoft is
about to pull support for VB6, and since you are just learning might as
well start with what will be supported for a while.. ( or switch to a
non microsoft language like python or gambas )
But yes, it is pretty basic stuff sending a word to a port...

Re: Can VB 6.0 control 8 data bit pins of LPT port?

On a side note...for anyone wanting full control of a serial port and
associated control lines with VB...avoid .NET like the plague.
MS still has not provided the functionality that VB6 offers. There is
no MSComm object in .NET. I hear that it's been promised, but don't
hold your breath waiting for it's release.
Your only option in .NET is to make direct calls to the kernal which
really blows...and pretty much kills the whole purpose of the .NET style
architecture.
(*>
Site Timeline
- » Looking for Battery life information
- — Next thread in » Microcontroller Discussions
-
- » PIC 18Fxx2 RS232
- — Previous thread in » Microcontroller Discussions
-
- » New(ish) assembler for PIC16 microcontrollers (asm1825)
- — Newest thread in » Microcontroller Discussions
-
- » kostenlos abzugeben
- — The site's Newest Thread. Posted in » Electronics (German)
-
- » Wide frequency range, arbitrary waveform DDS
- — The site's Last Updated Thread. Posted in » Embedded Programming
-