10-07-2014 01:06 PM
Okay,
Here is the code. I know it is a mess.
10-07-2014 01:32 PM
SInce you have problems with the subVIs, you probably would need to attach these too. 😉
10-07-2014 01:37 PM
Okay. Thank you for your endless patience.
10-08-2014 11:12 AM
Hi there,
Have you tried highlight execution to see what's happening both in your program and subVI's? It looks like the data you want to graph is within two for loops for the chart and one for the graph. As the subVI doesn't return any data until it's finished running, it's not surprising you're not seeing anything output (except the last value of the chart and the last set of data for the graph after it's done running I'd imagine).
A very similar question is gone over here:
https://forums.ni.com/t5/LabVIEW/Pass-data-form-subVI-while-it-is-executing/td-p/1457434
10-08-2014 01:10 PM - edited 10-08-2014 01:36 PM
Hello John,
Thank you so much for your reply. I thought the same thing about the graphs. When I do the highlighted execution, I can see the graphs displayed in the subvi's, but nothing gets displayed in the main vi. Is there a way to extract the data from the sub vi's after each iteration ad have it displayed in the main vi? Perhaps via a shfit register?
Thanks,
Christian
10-08-2014 07:37 PM
A shift register would be useless to pass from the subVI to the main VI. To see this, run the VI I attached. Every 100ms, it adds 1 to the count. When it's running, you'll never see this. As soon as you hit stop, it updates the final value. Shift registers pass their value to the loop with each iteration. They will not update anything outside of the loop until the loop finishes.
Instead of asking how to perform this task, why not read the link John provided? The second post in that thread offers three possible solutions to your problem, none of which were a shift register.
10-08-2014 09:14 PM
Thank you. I did read the link and realized that a notifer or queue would be a better option. I just didn't notice it at first, that is why I asked that question.
Christian
10-14-2014 02:59 PM
I was able to get the data from the waveform chart in the sub vi to the main vi via a control refnum and a property node. However, when I try to do the same for the XY graph, it doesn't work. Is it because the type of data is different, or is it because it is not possible to use a control refnum with an XY graph?
Thanks,
Christian
10-14-2014 05:50 PM
For an XY graph, you have to supply the X array and the Y array. A waveform chart can just accept a waveform it is it happy.
10-14-2014 09:30 PM
Thanks. Does that means that I can have two separate property nodes, one for the X- and the other for the Y-axis and still use them in the same way I used them with the waveform chart?
Christian