LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Real time data display

Solved!
Go to solution

Hai guyz/galz. Im just a newbie starting out in the labview field. I have just started designing a temperature measuring VI and Im having a problem right now which is I cant seem to quit when I press the QUIT button the VI if it is running unless I prss the STOP button. Apart from that whenever I press STOP the VI and wish to START again, I can't seem too resume. I apologise for this trivial question of mine. Any pointers wil be much appreciated.

 

 

Download All
0 Kudos
Message 1 of 6
(2,940 Views)
Solution
Accepted by topic author Newbie92

You have a fundamental misunderstanding here. Learn the basics of LabVIEW, and what data flow means (LINK). Your outer while loop is polling your CPU during it is waiting for the user to click the start button. Put some timing here. In the block diagram I do not see the physical channel info for setting up the DAQmx. When your inner while loop finishes execution, all you can do is to quit. So this is not a proper way to do what you want. You also does not close your DAQmx task, you neither have any error check.

Beside, why you want to sample your temperature sensor with 1kHz rate? I work a lot with temperature sensors, and it does not seem to make any sense to me. What kind of sensor do you use? In most applications, 1 or max 10 Hz is totally satisfactory (usually temperature sensors are SLOW).

edit: of course, the story is different, if you have a noisy sensor, and you want to sample at higher freq. so you can make some kind of noise reduction...?

 

Try something like this:

 

simple_daqmx_1_BD.png

 

 

 

 

 

 

Message 2 of 6
(2,916 Views)

I see. Thanks for the pointers. Really appreciate it. Ill try it out tomorrow and see what happens. Thanks again mate. Smiley LOL

0 Kudos
Message 3 of 6
(2,874 Views)
Solution
Accepted by topic author Newbie92

One more thing. The structure Blokk showed you will work well as long as the delay between measurements is short. To see why, imagine a 1 minute delay between reads, and let's say that you click the Stop button a few seconds into a delay.

What happens is that LabVIEW doesn't immediately see the click because due to the way dataflow works, the button state has already been read for that iteration. In fact, reading that button will be one of the first things LabVIEW will do with each iteration.

So LabVIEW will see the click at the beginning of the next iteration and will know that the loop needs to stop, However, before it can stop it has to execute everything inside the loop again -- including another 1 minute delay...(Which will likely never get the chance to complete because you will have decided that the program has locked up and hit the Abort.)

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 4 of 6
(2,863 Views)

I'll definitely keep that in mind Mike. Thanks for the info. Smiley Happy

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

Your advice was super helpful Blokk and Mike. Really appreciate it. My VI can now run. Smiley Very Happy

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