LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SubVI control with control references

Dear all,

it would be very nice if somebody could help me with the following problem:

I am calling at a certain point in my Main program a SubVI, which includes my data-acquisition procedure (i.e. in the SubVI the data is acquired as waveform type and displayed in a waveform graph.). During data acquisition the waveform graph in the SubVI is updated and working fine.

Now I want to see the acquired waveforms also on an waveform graph in the MainVI. Additionally, I want to control the scale properties of the waveform graphs in the SubVI and MainVI's via controls placed in the MainVI.

I know that for this situation I need to use Control References but I am not sure how to implement this for my situation.

I got an example (see attachment), but it has the signal waveform acquisition in the MainVI and not in the SubVI. Additionally, I am not sure how to create a WFGraphRefnum from a waveform graph without deleting the waveform graph from the front panel and destroying the wire connection which existed originally to the waveform graph.

It would be very nice if sombody could help me with this problem.

Kind regards,

beam
0 Kudos
Message 1 of 5
(3,041 Views)
Hi

Here is a simple example how you could do it. You have to take care about the data-types of your graphs - they must be the same.

Hope this helps.

Thomas
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
Message 2 of 5
(3,006 Views)
Check out Becktho's example. It should work.

Technique I use:

It can be complicated or confusing to try to create or define the proper type of control reference for a LV object.

The strict types will carry more of the specific of the original control with them. The short cut I use to by pass all of that non-sense is:

1) Pop-up on the object you want to manipulate in the sub-VI and chosse "create >>> reference".

2) Wire the reference to a new sequence frame.

3) Create a sub-VI from the seq frame.

4) Open the new sub-VI and grab the control that LV created when the sub-VI was created. This control will be an exact match for the original control. Use this control when you want to pass the reference to another VI. (Note:you can toss the created sub-VI)

Comment:
When your control reference control exactly matches the type of the original, all of the properties are defined and available in the sub-VI. No need to convert to variants etc.

End of technique.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 3 of 5
(3,001 Views)
That's definitely the way to go.
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
Message 4 of 5
(2,986 Views)
An alternative approach that would simply make the control problem go away is to put all the controls on the subvi where they belong and put the subvi's frontpanel on the main VI's front panel using a subpanel...

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 5 of 5
(2,970 Views)