LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

dynamically evolving plot

I'm working to create something to simulate a bemchmark for a microcontroller. In the interface i need to place a plot with a time intervall of 300 secs updated every 40 secs that will show the changes of a set of knob in the front panel. I think to use events to monitor changes in the value of each knob so i can know the time of the event and new value of the control; but how can i use this info to plot such changes? If a value doesn't change the plot must show an orizzontal line with the old value of the control.
Sorry for my bad english, thanks a lot and best regards.
Max
0 Kudos
Message 1 of 3
(2,562 Views)
MAXm

wouldn't just linking the knob to a chart indicator work for you?
Front Panel: Knob control and Chart indicator
Block Diagram: While loop with knob wired to the chart.
Make sure you insert a Wait Until Next Multiple ms with a time constant of 250 so that you can see the actual changes of the knob value reflected on the chart.
If this does not answer your question, just be more specific on what your needings are.

Regards,
AlessioD
National Instruments
0 Kudos
Message 2 of 3
(2,562 Views)
You don't need to monitor the changes with an event, since you want to take readings no matter if the value has changed or not. In your particular case a simple FOR loop is sufficient because you know the number of readings in advance. One problem I see is the fact that 300 is not divisible by 40, so one of the numbers need to be tweaked. (Could ot be you actually want to measure every 40ms for 300s for a total of 7500 readings? This seems more reasonable!)

The simplest code would be a FOR loop containing the terminal of your knob wired to a waveform chart and a diagram constant with the desired loop rate in ms wired to a "wait next ms" node. The "loop count" should receive 8 or 7500 or whatever number of points you desire. This provides
basic functionality (see attached image).

Add some trimmings as needed: Clear the chart before entering the loop, use a WHILE loop instead of a FOR loop and add some controls to prematurely interrupt the process, etc..
0 Kudos
Message 3 of 3
(2,562 Views)