Serious Help needed

slim
12-19-2001, 07:17 PM
Here is my problem. I have had only one year of VB 6.0 programming. For a final project I decided to work with some electronic fellows. Here is the plan:
We wanted to develop a home security system using VB and some electronic sensors. The sensors would be connected to the computer through a RS232 connection. They would be hooked up in series, and if one of the sensors were to be broken, the VB program would recognize this and spew out a .wav file. Now my problem is (besides the fact I bit off more than I can chew) I have no idea how to make such a program. My instructor advised me that I would have to read the pins on the serial port somehow (0V 5V) etc. to see if everything was connected properly. This of course would be done in a loop and checked every second or so. The program can be shut off by some kind of password (like a user who has the correct passcode). Would this be done by manipulation the com port in some way (i.e. turning it on and off)? Can anyone HELP!! I will pay a reasonable fee to those who can help out.

Kyle

Thinker
12-19-2001, 07:55 PM
RS232 is a combination of (one each) send and receive data lines
and 5-6 control signal lines. You can't use the send and receive
for a series contact type system, but some of the control lines
should work. These lines are input or output depending on
whether you are DCE or DTE. DCE (data communications equiq.)
would be like a modem, and DTE (data terminal equip.) is like the
serial ports on a PC. I can't remember which signal lines are
input for DTE, but you should be able to find a great deal of info on
RS232. The main control signal lines are RTS, CTS, DSR, and DTR.
The work in pairs, so two of them are input and two output. The
ones that are input for DCE are output for DTE.

Good luck.

divil
12-20-2001, 04:29 AM
I'd use the parallel port for this type of application... in fact, I have done before. All you need is a DLL that lets you access the parallel port directly.

slim
12-20-2001, 11:44 PM
Thanks for all of your replies.

Divil, if you have done it before using the parallel port, what device did you use to attach the sensors to the computers parallel port. Using the serial port I use a MAX232/RS232 device. And how does VB know if the sensors were tripped or not? Does the PIC send a signal to the computer (i.e. some sort of on/off signal to signal the integrity of the circuit), or does the computer check the PIC somehow? And can VB read each pin individually? Can you show me a small example of the code you used for that program?
Again, Thank you all for your help thus far. You are saving a drowning man.

Kyle

slim
12-20-2001, 11:50 PM
Oh, and where would you find the DLL to control the parallel port?

Thanks again,
Kyle

divil
12-21-2001, 08:12 AM
Just do a search for parallel port and VB, you will find some DLLs. In Windows NT you will need to install your own parallel port driver that allows direct access to it though, although those are findable too.

Basically it allows you to read the state of most of the pins on the parallel port, and write to it too. So you'd read a character, split it in to its eight bits, then the bits would reflect the on/off state of the pins on the parallel port.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum