LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data not being aquired

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

Download All
0 Kudos
Message 1 of 6
(2,437 Views)

Anyone? Please, this is for a final proyect at my uni and I really need some guidance here.

0 Kudos
Message 2 of 6
(2,409 Views)

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.

 

 

 

0 Kudos
Message 3 of 6
(2,404 Views)

what are race conditions?

 

Edit.- The thread you linked to is not very clear to me, sorry

0 Kudos
Message 4 of 6
(2,400 Views)

See this one and also just make a search on forum "Race conditions".

http://zone.ni.com/devzone/cda/tut/p/id/7585

0 Kudos
Message 5 of 6
(2,389 Views)

Hi,

 

I have already reviewed your VI, here are my suggestions:

 

  • You should place the boolean controls (Door, Window B, Window A, etc) inside de while loop.  Otherwise, LabVIEW only reads the control status when you run it the first time, it does not update.  Maybe this is why your application its not working the way you expect.
  • Due to your application architecture, you may experience some race conditions.  This can affect the sequence of your application. 
  • Since you are constantly acquiring digital data, I think it is better if you choose Continuous samples as the Acquisition Mode for all 3 DAQ Assistants.   

 

Hope this info helps.

 

Anuar Rojas 

Anuar R.
National Instruments México y Latinoamérica
Ingeniería de Aplicaciones
www.ni.com/soporte
0 Kudos
Message 6 of 6
(2,363 Views)