10-29-2012 02:41 PM
I am slowly building a vi that records and displays pressure from a pressure gage. Right now, it continuously reads pressure, then every minute it will write the pressure, time, and date to a text file. It also plots to a chart once a minute. I can post the vi later, but I can't access it from this computer.
What I need to do, is program it to calculate a running slope from the data points. I need some sort of cache that will hold the most recent 15 pressure readings, and use them to calculate the slope and display it. When a new reading is taken, I need the oldest pressure to be kicked out and the newest one added to be used in the calculation. Any ideas on where to start with this?
10-29-2012 03:02 PM
queue with 15 elements. 15 element strip chart. ... lots of ways
10-30-2012 08:02 AM
Here is the vi that I'm working with. I looked at the queue functions (LV 😎 and I'm not sure how to wire them up. I'm a beginner LabVIEWer and this is my first program to build.
10-30-2012 09:08 AM
A very simple solution uses a shift register, build array and array subset. as shown in this snippet.
11-27-2012 08:43 AM
Jeff,
I tried to duplicate the the block diagram you provided with one change. I moved the slope functions inside my case structure, so it would only calculate the slope off of written pressure values. I get no errors, but it produces a "NaN" (Not a Number) message in the slope and intercept displays. I feel like I'm missing something...
11-28-2012 05:30 PM
Have you tried running Jeff's example as is prior to making your modifications? It would be helpful to know whether this problem is directly tied to the changes you made, or if it's a lingering issue with the original code.
08-26-2013 02:56 PM - edited 08-26-2013 03:09 PM
I know this is an old thread, but my work took me away from this and has brought me back around. Never did get it figured out.
Tim, I did try it exactly as Jeff has it. Then I made modifications and it still didn't work. The slope desplay still shows NaN. Also, It only reads/logs pressure one time, then the rest it plots a 0 even though there is actually pressure on the system. I've attached the most current version I have that includes suggested changes.
08-27-2013 12:12 PM