Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Door access control with delphi

Status
Not open for further replies.

skota

Programmer
Aug 12, 2010
2
0
0
JM
Hello all,
In an upcoming project i need to be able to open magnetic door locks from my application, i understand this involves sending some sort of signal to interrupt the electricity and open the door, but am not sure how to do this..

This will be a genric magentic door lock, no rfid. Any advice please?

Are there any free or commercial delphi components that allow me to do this?

Thanks for your time
Skota
 
Since this is a hardware specific application of limited use, you probably won't find anything off-the-shelf for it. What you will likely have to do is find specs from the mag-lock dealer, and then adapt those to your needs within Delphi. If this is supposed to be computer-controlled, they likely have a number of examples already published in other languages and in that event it would just require translation. In fact, I would think this documentation would be in the manual for this product.



It is not possible for anyone to acknowledge truth when their salary depends on them not doing it.
 
first question is how are you interfacing the door lock to the pc. usb, rs232 ???

it can be as simple as toggling the dtr line on the rs232 port to trigger a relay.

Aaron
 
@Glenn9999: Thanks, i will research that option..

@tayloredwarez: Thanks. This will mostly be via usb or rs232. I will have to get the specs from the client. I should mention that this a request for 'nice to have ' feature and hence not crucial. I was just curious to learn more.

Are there any resources you can point me to that have some learning materials on delphi hardware programming.

have a good weekend.

Thanks
skota
 
If your OS is win95 or win98 then you can get away with reading/writing to the parallel and serial ports directly. In Delphi 1 (16bit) this was simplified by having a port array that you could read/write. Later (32bit) versions dropped this feature so you'd have to find your own way to the IO map.

If your OS is NT based (XP etc) then you will be blocked from accessing the IO map directly. Instead you have to use CreateFile to open a file handle for an IO device. Use SetCommState to configure the device. Then use WriteFile and ReadFile to send and receive data. You will probably only want to be sending one byte at timed intervals with selected bits on/off.

The parallel port is the simplest port to use for user add-on's. This will give you a nice simple 8 bits of output for switching on/off 8 devices. You can buy a simple parallel IO board with 8 relays for this purpose. These could in principle be used for switching upto 8 magnetic door locks simply. If you need more than that then you will need extra hardware connected to the port with an addressing scheme built in.

The manufacturer may supply a library and hardware for these purposes so you don't have to - or they may not...
 
You will be hard pushed to find a modern PC with a parallel port these days, and very few have serial (RS232) ports, you would be best to assume that the only external interface you will have is a USB port.

To get an idea about whats involved have a good look at this site


But we are not just talking about toggling a port line here.
FTDI supply a direct USB Driver file (a Delphi unit).

You can get Dongles that convert USB to a serial (RS2332) port, but users will need to install drivers for these as well, and if you go this route (less hardware involvement) you will need to create a virtual comport (the dongle driver should do this for you) and you will need a Delphi Comm port driver component.
I use this one but there are several.

Steve: N.M.N.F.
If something is popular, it must be wrong: Mark Twain
 
Do you really need a Delphi Comm port driver? Can't you use the Win32 API directly to access Comm ports?


To control an external digital device (drive/control a relay/contactor, etc...), here are a couple of options I have used:
Measurement Computing (Strictly USB)==>National Control Devices (Various Physical Interfaces)==>

Steve.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top