LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

making a real-time graph from 1 DBL value at a time using a for loop

Solved!
Go to solution

I have a somewhat interesting programming task where I have the following situation: (I've attached a mac version of Labview 2013 vi)

 

- Using a patented (pre-made and non-modifiable) sub-vi that receives either 0 or 1 as an input and reads off a single measurement every time it receives 1 while the 0 is required to "reset" the vi to repeat a new measurement.

- I would like to repeatedly run this sub-vi in a For Loop and every "measurement" value is sent to a waveform graph to give a live (real-time) value for the graph to show.

- As it stands, I've got a vi file that simulates the measurements in a for loop but builds the values into an exuent 1-D array to get sent to a waveform graph.  

- I don't know how to make a real-time graph which receives 1 DBL value at a time.

- Furthermore, I only want every 2nd value sent from the for loop, but I've already got several ideas of how to do that.  I'm first concerned about the real-time goal.

 

Kyle Shiells

0 Kudos
Message 1 of 5
(2,984 Views)
Solution
Accepted by topic author kshiellsnucphys007
You use a chart, not a graph, to update one point at a time. It would be inside the for loop. You could use a select statement or case structure to update the chart or not.

These are pretty basic functions in LabVIEW. Please check out the free tutorials.
0 Kudos
Message 2 of 5
(2,981 Views)

Hi Dennis,

 

I placed a waveform chart into my loop and it does what I need it to.  I also turned it into a while loop that stops when I tell it to stop AND the total number of iterations is even (something I require also).  See the revised vi if you like.  I wasn't quite sure how to "discard" every second DBL value (which is infinity) as it must "go somewhere", so I made it re-send the previous value to the chart on those iterations which would sort of have the net effect of doubling the time spent per measurement data point which I could easily get back by halving the loop time.  I would say you definitely answered my original question.  If you can think of a better way of dealing with my infinity values I'm all ears.

 

thanks,

Kyle

 

 

0 Kudos
Message 3 of 5
(2,970 Views)
I can't look at the VI but as I said, one way is with a case statement. The chart would be placed inside the case statement. The value does not have to go somewhere.
0 Kudos
Message 4 of 5
(2,965 Views)

Ah, I see: on a TRUE iteration, the DBL goes into the chart in the case structure, else The FALSE has no chart. 

 

cheers,

Kyle

0 Kudos
Message 5 of 5
(2,960 Views)