By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,960 Members | 987 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,960 IT Pros & Developers. It's quick & easy.

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

P: 30
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.


Thanks
Jan 16 '09 #1
Share this Question
Share on Google+
6 Replies


vekipeki
Expert 100+
P: 229
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

P: 30
Hi,


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

P: 30
@vekipeki

Hi,

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

vekipeki
Expert 100+
P: 229
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

P: 30
Hi,


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

vekipeki
Expert 100+
P: 229
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.