Jump to content

Multi-graph indicator in a subpanel


Recommended Posts

Dear all,

I've been building a multi-graph indicator that processes and displays the same data in different ways depending on which graph type is selected (e.g., as a time series vs. as a power spectrum vs. as an autocorrelation). At first this seemed like a good use for XControls, but each graph has different options that the user can change at runtime, and handling all the control options for all the graphs in a single VI seems unwieldy. Also, with an XControl, it seems like I need to perform the FFT on every data update even if I'm just displaying raw time series data, which is not so clean.

Now I'm using subpanels for the same purpose, and this is very easy and clean up to a point. I have a single event handler VI that loads a different subVI into a subpanel depending on a user-selected enum, and when new data is received, passes it through to the active subpanel. This event handler works great and does everything I want.

Now comes the hard part. My multi-graph needs to live inside a larger VI. Ideally I would like to encapsulate the event handler for the multi-graph in its own VI, and have it load the different graph types into a subpanel on the shell VI. But then I would need to give the event handler a reference to the subpanel that lives in the shell, and have the event handler invoke the "Insert VI" method using the _subpanel reference_.

So I have two questions: 1) How do I get a reference to the subpanel in the shell VI? and 2) Can I wire the subpanel reference to a regular Invoke node in the event handler to insert the appropriate graph type?

And maybe a third question: 3) Am I using the right approach to this problem?

Thanks,

Dave

Link to comment

I'm not sure if I clearly get what you are asking, but I believe an answer to your question 1 would be to pass the reference from to the shell by using an invoke node with the shell vi's reference calling the Set Control Value [Variant] function and pass the name of the sub-panel reference on the shell and the sub-panel reference. Like I said, i'm not sure if I'm completely clear on your application so I hope this helps.

Good luck,

Matt

QUOTE(DaveKielpinski @ Oct 21 2007, 04:18 AM)

Dear all,

I've been building a multi-graph indicator that processes and displays the same data in different ways depending on which graph type is selected (e.g., as a time series vs. as a power spectrum vs. as an autocorrelation). At first this seemed like a good use for XControls, but each graph has different options that the user can change at runtime, and handling all the control options for all the graphs in a single VI seems unwieldy. Also, with an XControl, it seems like I need to perform the FFT on every data update even if I'm just displaying raw time series data, which is not so clean.

Now I'm using subpanels for the same purpose, and this is very easy and clean up to a point. I have a single event handler VI that loads a different subVI into a subpanel depending on a user-selected enum, and when new data is received, passes it through to the active subpanel. This event handler works great and does everything I want.

Now comes the hard part. My multi-graph needs to live inside a larger VI. Ideally I would like to encapsulate the event handler for the multi-graph in its own VI, and have it load the different graph types into a subpanel on the shell VI. But then I would need to give the event handler a reference to the subpanel that lives in the shell, and have the event handler invoke the "Insert VI" method using the _subpanel reference_.

So I have two questions: 1) How do I get a reference to the subpanel in the shell VI? and 2) Can I wire the subpanel reference to a regular Invoke node in the event handler to insert the appropriate graph type?

And maybe a third question: 3) Am I using the right approach to this problem?

Thanks,

Dave

Link to comment

QUOTE(Chim026 @ Oct 22 2007, 05:24 AM)

I'm not sure if I clearly get what you are asking, but I believe an answer to your question 1 would be to pass the reference from to the shell by using an invoke node with the shell vi's reference calling the Set Control Value [Variant] function and pass the name of the sub-panel reference on the shell and the sub-panel reference. Like I said, i'm not sure if I'm completely clear on your application so I hope this helps.

Good luck,

Matt

Hi Matt,

I'm not really clear on what you're saying... some words seem to be missing in your post. Could you please rephrase?

Thanks,

Dave

Link to comment

Let me try again. Try passing the reference from the shell vi to the event handler by using an invoke node and calling the Set Control Value [Variant] function. Pass the name of the sub-panel reference on the shell and the sub-panel reference as the variant.

Good luck,

Matt

QUOTE(DaveKielpinski @ Oct 22 2007, 01:00 AM)

Hi Matt,

I'm not really clear on what you're saying... some words seem to be missing in your post. Could you please rephrase?

Thanks,

Dave

Link to comment

QUOTE(Chim026 @ Oct 22 2007, 10:56 PM)

Let me try again. Try passing the reference from the shell vi to the event handler by using an invoke node and calling the Set Control Value [Variant] function. Pass the name of the sub-panel reference on the shell and the sub-panel reference as the variant.

Good luck,

Matt

Now I get it! That's a nifty way to do it. I had just passed the reference in as data and registered it as an event, which was an ok workaround, but I think your way is better.

Thanks,

Dave

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.