All About Circuits Forum  

Go Back   All About Circuits Forum > Software, Microcomputing, and Communications Forums > Programmer's Corner

Notices

Programmer's Corner Discussion forum for all aspects of programming and software engineering. Any software programming language welcome: C, C++, C#, Fortran, Java, Matlab, etc.

Reply   Post New Thread
 
Thread Tools Display Modes
  #1  
Old 03-17-2010, 02:19 PM
lkwah86 lkwah86 is offline
Junior Member
 
Join Date: Mar 2007
Posts: 22
Default Visual Basic 2008 Express - Parallel Port programming

I'm just a beginner in VB.

I need to know how to control the parallel port through the USB to parallel converter. Anyone able to advise me?

OS - Windows 7
VB - Visual Basic 2008 Express

In my device manager, it show the converter as 'USB printing support'. Is it the driver problem?
I have downloaded DllPort.dll and placed it in 'System32' folder.

Module Module1
Public Declare Sub Out Lib "DllPort.dll" Alias "Out32" (ByVal PortAddress As Integer, ByVal Value As Integer)
End Module

Public Class Form1

Dim PortData
Const AddressLPT1 = &H378

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Call Out(AddressLPT1, &H0)
End Sub
End Class

Last edited by lkwah86; 03-17-2010 at 03:23 PM. Reason: Test Result
Reply With Quote
  #2  
Old 03-17-2010, 03:28 PM
lkwah86 lkwah86 is offline
Junior Member
 
Join Date: Mar 2007
Posts: 22
Default

I test the coding. No error. but still can't output the data.

The parallel port's pin1-13 have voltage around 4.7V and pin 14-25 are 0V.
Reply With Quote
  #3  
Old 03-17-2010, 04:08 PM
blueroomelectronics's Avatar
blueroomelectronics blueroomelectronics is offline
Senior Member
 
Join Date: Jul 2007
Location: Toronto, Canada
Posts: 718
Default

Does Windows 7 support direct control of I/O ports? I think that DLL is for an older operating system like XP. A VB programmers forum might offer more insight. Legacy ports are disappearing fast from computers.
Reply With Quote
  #4  
Old 03-17-2010, 04:41 PM
CVMichael's Avatar
CVMichael CVMichael is offline
Senior Member
 
Join Date: Aug 2007
Location: Canada, Toronto
Posts: 272
Default

I agree, why don't you post on http://www.vbforums.com/ ? it's the most popular programming forum I know...
Reply With Quote
  #5  
Old 03-18-2010, 02:49 AM
lkwah86 lkwah86 is offline
Junior Member
 
Join Date: Mar 2007
Posts: 22
Default

Thanks for helping... I had tried on XP too... but seem like doesn't work also... = =
I think is the USB to parallel converter problem, it can't access by the laptop
Reply With Quote
  #6  
Old 03-18-2010, 03:28 PM
lkwah86 lkwah86 is offline
Junior Member
 
Join Date: Mar 2007
Posts: 22
Default

Is the USB to parallel adapter just an assumed parallel port?
If need to interface between the computer and hardware, it should use a real parallel port?
Reply With Quote
  #7  
Old 03-18-2010, 03:56 PM
retched's Avatar
retched retched is offline
Senior Member
 
Join Date: Dec 2009
Location: Baltimore, MD
Posts: 3,619
Blog Entries: 14
Default

Yes, you should use a real parallel port. The parallel port can source less current than a usb port. so if you build something to use a parallel port, and someone uses it on a REAL parallel port, you can break their PC. (At least the port)

The usb can source 500mA where a parallel port can usually source/sink about 9-20mA

[ed]
Here is some useful info on the subject:
http://www.beyondlogic.org/spp/parallel.htm
[/ed]
__________________
-rm-

Last edited by retched; 03-18-2010 at 03:57 PM. Reason: ed
Reply With Quote
  #8  
Old 07-09-2010, 12:09 AM
Harrington Harrington is offline
Banned
 
Join Date: Dec 2009
Location: London
Posts: 86
Default

Ive had problems with this as well using the parallel port with the dll as specified on xp what i found is that the port is constantly interrogated by the OS which gives you false results I don't really know what Microsoft have done here but I can only get this to work in a fashion without having to write parallel port drivers for the hardware My guess is they have done this deliberately, which ,well sounds like typical Bill Gates this ruined peoples ordinary fun The way round this is to dual boot either into dos in which case you can use ordinary C or else its back to Linux

I don't know what other people have found but they were my findings Not very nice still there you go typical this
Reply With Quote
Reply   Post New Thread

Bookmarks

Tags
, , , , , ,

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
General Electricity Questions and Controlling LEDs with Parallel Port kaashif The Projects Forum 3 09-19-2009 07:46 PM
Parallel port programming parjanyaroy Programmer's Corner 7 08-16-2009 02:33 PM
Using visual basic to connect with the serial port of 232M1A0CT weiix05 Programmer's Corner 2 04-02-2009 07:47 AM
Help! Visual Basic 2005 Express Edition Keyboard event ashura517 Programmer's Corner 2 06-04-2008 07:09 AM
Sending Data Through Serial Port (Visual Basic) - Need Help bearboss_85 Programmer's Corner 0 09-15-2007 07:05 AM


All times are GMT. The time now is 10:39 PM.


User-posted content, unless source quoted, is licensed under a Creative Commons Public Domain License. Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.