Using parallel port to output to a connected circuit in VB6

This is a group to discuss all details on home automation, home security technology and related technologies.

Using parallel port to output to a connected circuit in VB6

Postby mayan on Wed Aug 03, 2005 10:18 am

hi!hope somebody can help me..
im currently involved in a project that uses VB6 in Windows XP to lock/unlock the door. There is a barcode reader connected to the serial port which accepts/scan the barcode number and verifies if it is valid and is in the database.by the way,the door can be locked/unlocked only by authorized persons.So if the barcode is correct, the circuit connected in the parallel port will activate or lock/unlock the door..since i am a beginner in vb6 interfacing,i downloaded a simple program which lights up a LED connected to the port.but the problem is,an error message of 'Sub or Function not defined' appears when i run the program..i dont know whaT caused this or how to solve it since i already copied the inpout32.dll into the /systems32/drivers of my pc and declared the necessary declarations (which is also in the downloaded program) in a module..please,somebody help me... :cry: thanks!
mayan
 

Postby flyingman on Fri Aug 05, 2005 2:15 am

I use VB6 with IO.dll to write to EPROM by LPT port.
I have a problem with reading data from EPROM. Can anyone help me? Thanks
flyingman
 
Posts: 2
Joined: Fri Aug 05, 2005 2:07 am

Re: Using parallel port to output to a connected circuit in

Postby lionking on Mon Aug 08, 2005 7:50 am

[quote="an error message of 'Sub or Function not defined' appears when i run the program..i dont know whaT caused this or how to solve it since i already copied the inpout32.dll into the /systems32/drivers of my pc and declared the necessary declarations (which is also in the downloaded program) in a module..please,somebody help me... :cry: thanks![/quote]

may I know what error message did you got ? thanks.

dan
lionking
 
Posts: 4
Joined: Mon Aug 08, 2005 7:14 am
Location: UK

Postby matthew on Wed Aug 24, 2005 7:05 pm

inpout32.bas

Add a new module to your project and call it inpout32.bas (or just download it from www.lvr.com - it comes as part of the Parallel Port Complete disk/book - The book is really really useful, I've got 2 of Jan's books and I'm about to order a third).

In the module you need to put the following code:


'Inp and Out declarations for port I/O using inpout32.dll.

Public Declare Function Inp Lib "inpout32.dll" Alias "Inp32" _
(ByVal PortAddress As Integer) _
As Integer

Public Declare Sub Out Lib "inpout32.dll" Alias "Out32" _
(ByVal PortAddress As Integer, _
ByVal Value As Integer)

This declares the functions in the dll, you will need to do this for all your projects. I suggest you keep a copy of inpout32.dll in c:\windows\system\ or just the windows dir. (It might work from the drivers folder but I'm not sure).

Hope this helps.

Matthew
matthew
 


Return to Home Automation

Who is online

Users browsing this forum: No registered users and 18 guests

cron