LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

alarm system

hey, my alarm system is working 80% as i want it to do, it measures the amount of gas found in the lab, but im having some problems in the time settings, Where t is the real time in milliseconds, measured from the moment you start the program.

For workers working 8 hour shifts, the safety limit for these two gases is 45ppm for CO and 25ppm for NH3.

here is my program file attached. 

thanks

0 Kudos
Message 1 of 5
(2,616 Views)

Using i (number of iterations) as a proxy for t (seconds) is not a good idea.  Without knowing exactly how fast your loop runs, there is no way to make sure i and t are the same thing.

 

Also, you're multiplying i by 1000 when I think you want to divide by 1000.

 

Here's my fix.  It uses real time (tick counter) for t.

 

 

 

0 Kudos
Message 2 of 5
(2,601 Views)

Also, I'm not sure why you're checking the values five times in each loop.  You're going to get exactly the same anwer every time.  Just check it once and be done with it.

0 Kudos
Message 3 of 5
(2,599 Views)

the output isnt like what is recomended for the graph and for the 5 leds, the values calculated are wrong because the unit should be parts per million and the graph is too slow.

0 Kudos
Message 4 of 5
(2,594 Views)

Hi Abook7,

if you wait five time 300ms in your main loop, your graph will be updated every 1.5 second.

Here is your friend struggling with the same homework, you might get some ideas from there:

http://forums.ni.com/t5/LabVIEW/Display-on-Waveform-amp-Problem-in-the-Data-Flow/td-p/1785388

 

BR,

0 Kudos
Message 5 of 5
(2,561 Views)