LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

state machine

Solved!
Go to solution

Okay,

 

Here is the code. I know it is a mess.

0 Kudos
Message 11 of 27
(1,247 Views)

SInce you have problems with the subVIs, you probably would need to attach these too. 😉

Message 12 of 27
(1,237 Views)

Okay. Thank you for your endless patience.

Download All
0 Kudos
Message 13 of 27
(1,232 Views)

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

John M.
Message 14 of 27
(1,193 Views)

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

0 Kudos
Message 15 of 27
(1,186 Views)

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.

Message 16 of 27
(1,160 Views)

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

0 Kudos
Message 17 of 27
(1,149 Views)

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

0 Kudos
Message 18 of 27
(1,097 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 19 of 27
(1,078 Views)

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

0 Kudos
Message 20 of 27
(1,061 Views)