LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Continously update and hold last peak value ?

When monitoring the pressure in a hydraulic cylinder I want to register the last peak/max value to an indicator that continously updates this value even if the new peak value is below the previous.

What I want to achieve is that Whenever there is a pressure decrease followed by a pressure increase the new peak should be registered and held until a new peak value occurs regardless if the value is higher or lower than the last peak.
0 Kudos
Message 1 of 8
(3,418 Views)
Without seeing your code the general answer would be to use a shift register if you have some sort of loop setup. The shift register would hold the peak value.

For example:

Message Edited by smercurio_fc on 05-18-2007 10:04 AM

Message 2 of 8
(3,411 Views)
Sorry for not attaching a code, but that's because I just haven't figured it out yet 😄 But I've been playing with different solutions, and they are all very similar to the one you attached, only your random number generator would be replaced with a simulated sinus signal that only gives positive values (rise/fall i pressure without going below zero).It will be a parallel while loop in a main VI.

The problem with my solution, and yours, is that it only changes max if the following max is higher, it doesn't update the indicatgor if the next rise-in-pressure-max is lower than the previous.

That's the problem, I want to update and hold every max value that follows a new increase in pressure regardless if it's lower or higher than the previous.

I somehow have to check if there has been a drop in pressure followed by an increase and then update the indicator with whatever max value of the increase that is.
0 Kudos
Message 3 of 8
(3,400 Views)
You have two conflicting requirements. The first is that you "want to update and hold every max value that follows a new increase in pressure regardless if it's lower or higher than the previous". The other is that you want to "check if there has been a drop in pressure followed by an increase and then update the indicator with whatever max value of the increase that is". Does this mean you're only interested in an increase in pressure if there was a previous drop? What if the pressure didn't change for two readings, and then went up? Based on your first requirement it should be recorded. Based on the second requirement it should not.

Assuming you want to use the first requirement, you can do this with a second shift register, like so:

0 Kudos
Message 4 of 8
(3,395 Views)
Sorry if I haven't managed to make myself clear, having a hard time describing any further, but I'll give it a try 🙂

My second statement "check if there has been a drop in pressure followed by an increase and then update the indicator with whatever max value of the increase that is" was more me thinking how this might be solved, that you somehow need to check if there really has been a pressure drop, and then if the pressure rise again it would indicate that peak value, regardless if it's lower, the same, or higher than the previous peak. It's not smoething I need implemented if it can be solved otherwise.

Basically, I want to hold the last peak value of every RISE in pressure.

A sequence example:

1.Rise in pressure to 220bar
2.Read and hold peak value of 220bar
3.The presssure falls (still holding the last peak value)
4.The pressure rise again (still holding the last peak value)to 180bar
5.Then read and hold peak value of 180bar
6. and so on.....

I'll check out your example a little later on and see if it works for me.

Many thanks for the feedback so far.

Message Edited by hibux on 05-18-2007 01:13 PM

Message Edited by hibux on 05-18-2007 01:15 PM

0 Kudos
Message 5 of 8
(3,390 Views)
I understood what you were saying - you were just saying two different things. The second example I showed you records every rise in pressure. I attached the code for you (LabVIEW 8.20) so you don't have to recreate it.
Message 6 of 8
(3,377 Views)
If you are primarily concerned with displaying the pressure, the Slider control is very effective.

You add slides to a single control, then use Bundle to place the contents of the current measurement and the various shift registers. Right click on the slider indicator and selelect add slider. You can also right click and select Visible Items > Digital display and show all of the values at once. (see picture)

If your system is noisy and changes at a high rate, you may need to add logic to provide some hysteresis.

Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
If you don't hate time zones, you're not a real programmer.

"You are what you don't automate"
Inplaceness is synonymous with insidiousness

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

Exactly what I needed smercurio… , thank you so very much, you just made my day 😄

Thanks to Phillip also, I'll check out your solution too.

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