Link to home
Start Free TrialLog in
Avatar of jamal99
jamal99

asked on

dll to read from lpt or serial

we have a device with a switch, this device will be connected to a PC from lpt or Com port. when the switch on it sends an electrical signal indicating that, and when it is off it will send a signals indecating that too,
i need to read these signals in vb.net programe,do i need special dll files, and if so where can find them,and how can i use them in vb.net .
any help please
Avatar of softplus
softplus

If you're using the serial port (COM), you can just use the vb6 MsComm32.ocx.
Otherwise, take a look at the following links:
Serial: http://www.codeworks.it/net/VBNetRs232.htm
Parallel: https://www.experts-exchange.com/questions/20818873/VB-Net-Reading-Parallel-Port-Under-Windows-XP-2000.html
Avatar of jamal99

ASKER

thanx softplus , but i dint know how  to do it yet,
i did download the inpout32.dll.i dont know if it is useful.

but i need hel on how to include it in my application and how to let it read bytes from the port(com or lpt).


in fact i am a web developer, i dont know much about windows applications and api.
How far have you gotten? Which port are you trying to use first? What kind of data are you expecting from the port? :)
Avatar of jamal99

ASKER

not so far
i still cant include the dll in the project
please give me simple steps
just to include it and read when i want
ASKER CERTIFIED SOLUTION
Avatar of softplus
softplus

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jamal99

ASKER

i will try ,and thanx alot but do i need to add a reference to the dll file?
no, you don't need to add a reference, as the functions are specifically declared for the DLL. The DLL needs to be in the path, possibly in the same directory as the exe-file. :)
Avatar of jamal99

ASKER

hello softplus , just on e more question.
how could i know the lpt port number, i maybe put a lpt switch so i can use the printer. so i dont know if this will causes a problem.???
Avatar of jamal99

ASKER

dear softplus ,
at last, the application works fine after doing some electical circuits , but the problem is that it works fine on some computers and only the (PortOut) on other computers,
do i need to do some configurations on the LPT port, or do i need to change som BIOS configurations, please advice so i let it work on these compters