469,936 Members | 2,444 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,936 developers. It's quick & easy.

C# I\O Port Control using Parallel Port from PC

Dear All,

I am trying to interface the above application with a reference of CodeProject: I/O Ports Uncensored - 1 - Controlling LEDs (Light Emiting Diodes) with Parallel Port. Free source code and programming help. The coding wise is ok no error but I don't know too much about the voltage of interfacing of LPT. After I connect the cable from LPT to bread board(project borad), all LED turn on without any debugging from this example. Now, I am searching a way how to overcome this issue in a hurry mode. So pls advise me some one in here and looking forward to hearing from anyone.

Jan 16 '09 #1
6 15801
229 Expert 100+
This doesn't have much to do with programming, but:

If you are driving your LEDs directly from the port as drawn here (which doesn't seem like the best idea because you can easily burn your port):

they should be lit when your outputs are set to '1' (check the output using a voltmeter).

If they are grounded, and your LEDs are lit, then you probably connected them over a transistor or some optocoupled circuit (which is the right way to go), and you might just have reversed the logic ("1" is off, "0" is on).
Jan 16 '09 #2

Thanks for your reply and help. I follow your comments and did the [COLOR=#105cb6]CodeProject: I/O Ports Uncensored - 1 - Controlling LEDs (Light Emiting Diodes) with Parallel Port.[/COLOR] but couldn't managed to control even in one pin for input and output. I suspect the vista even i made the correct wiring and no issue for building and debugging so pls advice ne asap coz I am in a hurry mode.

Best regards
Jan 19 '09 #3


I don't know why this inpout32.dll can't add in the reference and show error "it is a valid assembly or component". So far, I knew it was built and compiled in VC++. Is there any difference to load dll of VC++ and C#?
I am looking forward to hearing from you.

Thanks and best regards
Jan 19 '09 #4
229 Expert 100+
You cannot reference a Win32 dll in C#, you can only use P/Invoke to call individual functions.

Basically, if you have a C++ header file, you will have to add extern methods with a DllImport attribute for all functions that you want to access.

Check this link: How to interface and access parallel ports(printer port) in C# (CSharp) programming using inpout32.dll
Jan 19 '09 #5

Thanks for ur prompt reply but still no data output from parallel port from pc to my bread board althuogh I am using same as ur comments.
I suspect Windows Vista coz Inpout32.dll can use upto WinXP and Vista had lots of secutiry right to block output and so far I found mostly used this kind of interfacing in XP.
In this link show, registry denied OASIS - SCParallelPortLibraryForNet.zip
pls advice me for that.

Best regards
Jan 19 '09 #6
229 Expert 100+
Please be a bit clearer, what do you mean be 'registry denied'?

I entered Inpout32.dll in Google and found a couple of links stating that it is compatible with Vista, are you sure that it doesn't work? You will probably have to install a driver of some sort in any case.
Jan 20 '09 #7

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by David Wigg | last post: by
9 posts views Thread by MNQ | last post: by
reply views Thread by navalha | last post: by
3 posts views Thread by thye | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.