11-21-2011 08:10 PM
Hello
I am making an alarm system, a simple one. And I have labview all set up, but I have some issues aquiring data from the circuit.
The buzzer works just fine, but the buttons and the switches/magnets do not.
I set it up as 5V--->switch--->earth and mydaq.
The MyDaq is as aquire digital signal. And it is on 1 sample mode.
I made a small circuit, with the buzzer and the switch, just to test if the switch/magnets work. When the magnet comes near the switch it closes the circuit, allowing current through. In a digital meaning I would believe that the current means a 1, thus the light for its respective door/window should turn on, meaning that that area is secured.
I attach a picture of the circuit with myDaq along with the latest .VI I have made.
I would really, really, really appreaciate any help as soon as possible
If you want to contact me more directly my email is eugenio.motanum91 [at] gmail.com
11-22-2011 08:20 AM
Anyone? Please, this is for a final proyect at my uni and I really need some guidance here.
11-22-2011 08:36 AM
I haven't seen hardly any control inside the while loop and it is not good to use that many local variables. You may end up with race conditions.
See this discussion
http://forums.ni.com/t5/BreakPoint/Why-some-people-say-Local-Variables-are-bad/td-p/711239
It is hard for me to see your program because I hate and afraid of local variables. You may wait for some more time to get help by others.
11-22-2011 08:43 AM - edited 11-22-2011 08:46 AM
what are race conditions?
Edit.- The thread you linked to is not very clear to me, sorry
11-22-2011 08:51 AM
See this one and also just make a search on forum "Race conditions".
11-23-2011 04:47 PM
Hi,
I have already reviewed your VI, here are my suggestions:
Hope this info helps.
Anuar Rojas