Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Talking to parellel port

Status
Not open for further replies.

shaminda

Programmer
Jun 9, 2000
170
US
I have program in QBasic that sends bits to turn on LED's through parellel port. The program is as follows,<br><br>10 Cls<br><br>20 OUT &H303, 144<br>21 OUT &H307, 144<br>22 OUT &H30B, 144<br>23 OUT &H30F, 144<br><br>30 OUT &H305, 0<br><br>50 x = INP(&H304)<br>60 OUT &H305, x<br>70 Print x<br>80 GoTo 50<br><br>I need to do this in VB. in other words I need to send bits through the parellel port so I can turn on LED's(8 of them). There are ways to send bits through the serial port but not through the parellel port. Is there a way of doing it.<br><br>
 
See my reply to Jim Cowan in the &quot;Peek & Poke&quot; thread.<br><br>Chip H.<br>
 
You have to make a dll or find some on internet. I got one 1 mounth ago and it's work very fine. The only thing with that dll It's you have to put you 8 bit status in byte.<br>So you can't change 1 bit like QB. But with a tiny code, you can do and undo the number between 0-255 in 8 bit string.<br><br>If you want the dll send my a mail and I will give you all of documentation of that.<br>see ya
 
Shaminda,<br><br>I found chip's post by searching for &quot;Peek&quot; - I've reproduced his reply below.<br><br>=======================================<br><font color=blue><br>Take a look at MSDN knowledgebase article Q154819.<br><br>And, you should get a copy of Desaware Spyworks.&nbsp;&nbsp;They have functions named:<br><br>&nbsp;&nbsp;&nbsp;&nbsp;dwInp%(ByVal portid%)<br>&nbsp;&nbsp;&nbsp;&nbsp;dwInpw%(ByVal portid%)<br>&nbsp;&nbsp;&nbsp;&nbsp;dwOutp(ByVal portid%, ByVal outval%)<br>&nbsp;&nbsp;&nbsp;&nbsp;dwOutpw(ByVal portid%, ByVal outval%)<br><br><br>All you have to do is supply a port number.<br><br>If you don't have a specific port number (I haven't done UART programming in 10 years, so my memory is fuzzy), you might try doing a CopyMemory call.&nbsp;&nbsp;That stands a fair chance of working on Win9x, and no chance at all under NT/2000.&nbsp;&nbsp;You'd have to write a device driver for NT, in that case.<br></font> <p>Mike<br><a href=mailto:michael.j.lacey@ntlworld.com>michael.j.lacey@ntlworld.com</a><br><a href= Cargill's Corporate Web Site</a><br>
 
Thanks for reposting that, Mike.<br><br>Chip H.<br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top