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

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View


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?


Quoted text here. Click to load it

Yes! Maybe you'd like to send 1111 1111 youll have to write 0xFF to
your lpt. Thats basic stuff.... .

mfg Tobias

Quoted text here. Click to load it


--
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?



Quoted text here. Click to load it


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?



Quoted text here. Click to load it

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,
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?


Quoted text here. Click to load it

Yes. Sending bytes to your lpt isnt 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

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



Quoted text here. Click to load it
... snip ...

Quoted text here. Click to load it


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?


Quoted text here. Click to load it
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?



Quoted text here. Click to load it

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.


(*>

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



Quoted text here. Click to load it

'blows'? Is that a bit like 'sucks'?

--
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?


Quoted text here. Click to load it

Exactly...

(*>

Site Timeline