From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

build graph or chart



muganga wrote:

I have two sensors, temperature and pressure. After press a button in a specific VI, both sensores start working and start registering the temperature and pressure. Independent of time. I mean, just if pressure or temperature change I will have another point plotted in the graph.


Well, you would use my last code, but place the built array nodes and the graph terminal inside a case structure. In the other case, you just wire the arrays across.
 
Use two more shift registers where you keep the last data point and, at each interation, you check if the current value is "significantly different" from the previous value. Only if this is true, you would append the history and update the graph. This defeinitely needs to be tuned, because DBL values are often slightly different due to noise, so you want to ignore small differences.
 
See how far you get. 🙂
0 Kudos
Message 11 of 12
(367 Views)

Using an Event Structure and a state machine in a producer / consumer loop arrangement comes to mind.

Look at the template under File > New >VI from Template>  look for Event Structure with Data (I think... no LV here.. so I'm guessing at the title)

It will have two loops with a Queue.  Notifiers would be fine in this case.  The idea is that you'd want the Event Structure to handle operator interface events (pressing buttons) and the state machine to take care of acquisition and updating display..  Make sure you have a small pause state to give time to the CPU to handle OS tasks.

You could do it in a single loop, but it would be easier for me to do an example than to explain the concept. 😉 

RayR

0 Kudos
Message 12 of 12
(364 Views)