LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

problems with the threshold detector.vi

I am trying to set an upper thresthold of 2.75 on the y-axis. what is wrong that the chart wont display it. It is problem a problem in my code so I have attached it

 

Thank youthreshold detector.JPG

0 Kudos
Message 1 of 8
(3,657 Views)

Well, what is wrong is that you did not use the output of the Threshold Detector in any way to affect the chart.

 

It is not clear what you mean by "set a threshold... on the y-axis."  Do you want to make a mark on the chart at the threshold level? Do you want to limit the array values so that they cannot exceed the threshold?  What do you want to do with elements which are above the threshold?

 

Lynn

0 Kudos
Message 2 of 8
(3,656 Views)

Sorry i'm new to LabVIEW so I'm abit rought!! What i am trying to do is set a threshold at 2.75 when the waveform goes above that threshold the user will be notified and the graph will count the amount of times the graph went into therhreshold zone.when it stays below the 2.75 everything is ok.

 

Maybe the threshold detector isnt the best thing to use. what do you think?

 

Ails

0 Kudos
Message 3 of 8
(3,653 Views)

Ails,

 

I am still not sure exactly what you want to do.  Depending on how clean your signal is you may be able to use the Threshold Detector.vi to determine the number of places the signal is above the threshold.

 

To determine which data points are above the threshold is somewhat different.  Simply testing each point to see if it is greater than the threshold may be enough.

 

Look at this VI to see if it gives you any useful ideas.

 

Lynn

0 Kudos
Message 4 of 8
(3,639 Views)
Lynn

The signal is coming from a pressure sensor so when full strength is applied onto the sensor the sensor goes to 5V. For this project applying pressure above 2.75V is bad. I want the user to stay below the 2.75V limit an if the cross the limit I want to switch on a light and count how many times the limit was crossed by the pressure sensor over a period of time. I hope that help in making it a bit clearer.

Is the threshold.vi what I should be looking for??

Ails
0 Kudos
Message 5 of 8
(3,635 Views)

Ails,

 

The Threshold Detector.vi will count the number of times the signal exceeded the threshold.  If you signal is noisy and near the threshold you could get a very high count.

 

For the Overpressure indicator just wire an LED to the output of a >? comparision.  Connect the data to one input and the threshold to the other.

 

Lynn

0 Kudos
Message 6 of 8
(3,631 Views)

Lynn

 

the light part works now I just need the threshold line at 2.75

 

Your threshold.vi is similar to what I am looking but I just looking for it to say that the threshold was passed 3 times instead of count all the points like the threshold.vi does. Also once its below the threshold I dont really care about the signal. do you think the threshold vi is the right thing to use?

 

Ails

0 Kudos
Message 7 of 8
(3,624 Views)

Count seems to count the number of times the signal crosses the threshold in the positive going direction.  Is that not what you want?  In my VI the sine signal has three peaks above threshold with about 12 data points in each peak.  The count output shows 3.  If your signal has a lot of noise near the threshold, you may see extra counts.

 

To draw a line at the threshold jsut create an array with the same number of elements as your data and make all the elements = threshold.  Initialize array will do this for you in one step.  Use Build Array to make a 2D array with the data in one row and the threshold array in the other.

 

Lynn

0 Kudos
Message 8 of 8
(3,604 Views)