LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Update at wavechart from inside at subvi

Solved!
Go to solution

I want to update at waveform chart from inside a subvi

I found this post

http://forums.ni.com/t5/LabVIEW/Update-waveform-outside-Sub-VI/m-p/2330960/highlight/true#M730536

which seems to be the solution to my problem.

It seems simple but I'm new.

Could somebody please finish the subvi attached ?

 

 

 

 

 

 

Download All
0 Kudos
Message 1 of 15
(4,594 Views)

If it seems simple, you should take time to understand it.  Nobody is here to do your homework for you.

 

We are more than willing to offer advice and help.  But, you shouldn't ask people to write your code for you.

0 Kudos
Message 2 of 15
(4,588 Views)
Solution
Accepted by topic author Michael.Koppelgaard

You are actually sort of close. You need to use a front panel reference control on the subVI instead of the chart control. Then you can wire the reference from your main VI to it. In the subVI you can wire the random dice to a value property node from the reference.

0 Kudos
Message 3 of 15
(4,582 Views)

Natasftw what about the advice you are so willing to give ??

 

OIigarlicky thank you for your kind answer which help me a lotSmiley Happy

Forgive for being stupid – I was born that way, but could I have bit more help.

 

In the subVi I did like this:

  • In the block diagram I right clicked on the waveform chart and created reference.
  • I created at value property by right clicking on the reference made in 1
  • I created a refnum by dragged the reference from 1 to the front panel.
  • I made the connection as shown in the jpg.

But I get an error running this vi: “Object reference is invalid”

What have I done wrong?

0 Kudos
Message 4 of 15
(4,545 Views)

forgot the attachment

 

0 Kudos
Message 5 of 15
(4,544 Views)
Solution
Accepted by topic author Michael.Koppelgaard

You need to make the reference on the top level VI and pass that into a control reference on the front panel of the subVI.



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
0 Kudos
Message 6 of 15
(4,529 Views)

Great !

It worked!

Thank you to OIigarlicky and Crossrulz for they help

0 Kudos
Message 7 of 15
(4,515 Views)

The same example with cluster as input does not seem to work.

Why is that?

How can you make it work using clusters?

 

0 Kudos
Message 8 of 15
(4,506 Views)

Because a chart does not accept a cluster of scalers.  If you are trying to write to a cluster on the front panel, then your reference type needs to be of a cluster of the type you want to write.  I highly recommend making a type def control if you really want to do this.

 

Though, I'm sitting here wondering what exactly you are trying to do.  In my experience, passing around references to front panel controls to subVIs just to update the value is not a good idea.  The property nodes are SLOW and you are generally making race conditions and making debug a major pain in the %$$@#%.



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
0 Kudos
Message 9 of 15
(4,498 Views)

I have at subvi controlling mass flow controllers and reading pressure transducers

I want to see what's happening inside the subvi.

Therefore I want plot of flow and output from pressure transducers.

0 Kudos
Message 10 of 15
(4,487 Views)