LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I put upper limit and lower limit on graph inside a while loop?

Solved!
Go to solution

Hi HanKiat, 

 

You need to put the code in a While loop to acquire data continuously. Also, can you let us know whether you are acquiring 1 sample at a time, or N samples at a time? 

 

Below is a snipet of the VI, I believe you can build it yourself according to the simple logics. This VI will display upper limit if any point in the data acquired exceeds the upper limit, or lower limit if lower limit is exceeded, or both. 

 

UL and LL Selection.png

D.S Yiauw
National Instruments | ELP Engineer
CLAD
Message 21 of 37
(2,449 Views)

Cool, looks good. But your version is 2015 and mine is 2011,its provided by the school therefore I cant open the solution you provided sadly. Anything you can do about it? Or maybe you can guide me on how you make that diagram out? since I am not too sure what some of those icons are? Thanks

Ohh and one more thing, I found online and tried it out,this thing seems to work too but I dont understand why the time doesnt move? Heres the screenshot

0 Kudos
Message 22 of 37
(2,424 Views)

Ohh and I think for me 1 sample or n sample seems good, is there a big difference to the diagram if I pick one or the other?

0 Kudos
Message 23 of 37
(2,418 Views)

Hi HanKiat, 

 

In the VI you showed us, the time is moving (1 second difference between two ticks). 

 

I've attached the VI saved for LabVIEW 2011, let me know if it is not working. If you choose to use 1 sample on demand the VI will not work, as only one point is acquired each cycle, nothing will be displayed on the graph. I would suggest you to take N samples per acquisition. 

 

Cheers, 

DS Yiauw

 

 

 

 

D.S Yiauw
National Instruments | ELP Engineer
CLAD
Message 24 of 37
(2,399 Views)

Ohh thanks for helping to convert! And although the time looks like it did move, it isnt, and in case you didnt notice, the year is not the same too. Thanks for the info on n sample and 1 sample.

0 Kudos
Message 25 of 37
(2,384 Views)

Hi HanKiat, 

 

You're welcome. If you mean the date is not set to the current date and time, please refer to this article: 

http://digital.ni.com/public.nsf/allkb/163EE33AFCD1D94E86256DB80074EBEA

 

Cheers, 

DS Yiauw

D.S Yiauw
National Instruments | ELP Engineer
CLAD
0 Kudos
Message 26 of 37
(2,381 Views)

One more thing, ermm may I know why you added the [Act plot, Plot.Visible?] thingy to the diagram you gave me? What purpose does it serve? cause when I connect my NI myDAQ and got the results, the plot 1 and 2 cant be visible, after i delete that thingy, it then appeared.

0 Kudos
Message 27 of 37
(2,361 Views)

Hi HanKiat, 

 

That is called a Property node. To create a Property node of a waveform graph you can right click on the graph, select Create, then Property nodes. The Property nodes I used are to set the visibility of Plot 1 and Plot 2, depending on whether the data measured exceeds the upper or lower limit or both. If your data can't be displayed you might want to change the integer value linked to the Act Plot. A value of 1 linked to the Act Plot properties with Plot Visibility property under it means we are setting the visibility of Plot 1 programmatically. 

 

By the way, if you are measuring more than one signals and you want to plot multiple plots on a single graph, then you should change the integers linked to the Act Plot properties to the plots associated with the upper and lower limit. 

 

Cheers, 

DS Yiauw

D.S Yiauw
National Instruments | ELP Engineer
CLAD
0 Kudos
Message 28 of 37
(2,353 Views)

Just curious, the diagram you provided me, is it possible to change the time to real time? cause I tried changing it but the time is like the previous one i showed you, stuck at 8+ and year 1904

0 Kudos
Message 29 of 37
(2,337 Views)

Hi HanKiat, 

 

I can show you how, but I think it is better for me to teach you how to fish instead of giving you fish. What you want to do can be done if you follow the guides here: 

http://digital.ni.com/public.nsf/allkb/EE0668C8F6CE617686256C920065EC52

 

Do let me know if you face any difficulties in following the guides. 

 

Cheers, 

DS Yiauw

D.S Yiauw
National Instruments | ELP Engineer
CLAD
Message 30 of 37
(2,322 Views)