Jump to content

Subpanel for a Call by Reference VI


Recommended Posts

I'm trying to run a VI using the Call by Reference function, then embedded it into a subpanel in my Main.VI. Once the VI is embedded, I can't use it in the subpanel. It's like everything is blocked and it won't let me interact with any of it. If I use an invoke node and call the Run VI method, this isn't an issue. Unfortunately, this is part of a much bigger application that use Call by Reference functions, so I can't replace those calls.

 

I have attach image snippets showing my code. Does anyone have any suggestions why this might be happening or a work-around to fix it? Thank you in advance!

Call by Reference.JPG

Open VI in Subpanel.JPG

Link to comment

Certainly what you are trying to do is possible, however SubPanels can sometimes be a bit tricky to get working nicely. Now I have all my SubPanel code abstracted away using some nice classes, but in the beginning when I was trying to get it to work properly I found it very useful to try and create as simple an example as possible. Trying to debug these kinds of things while running your whole application can be very tricky. If you create some simple examples of how your code does not work out we can probably help you figure our what is going on much quicker.

Are you sure your "Update Run Ticket.vi" is actually runnable (i.e. not broken for some reason) when you insert it into the SubPanel?

One thing to note, be careful when comparing references if you are dealing with clones. Two clones will return exactly the same reference even though they are running totally independently! In my current framework I pass the SubPanel reference into my VI when I am "initialising" it before running it dynamically, and then I have a method to allow a VI to insert itself into the SubPanel, this allows me to deal with clones as you need the actual reference of the running instance.

Also note that with SubPanels I don't think you need to worry about closing FPs before inserting them. As I said in the first paragraph try and create the most simple example you can (just two VIs!). 

Link to comment
10 hours ago, AInvisibleNinja said:

 

Open VI in Subpanel.JPG

I'd suggest:

  • Trying it with a VI that just runs a loop with the i terminal going to an indicator
    • OR: Set the subpanel instance to allow you to open the block diagram (right click option) and then open the VI at runtime, verifying that its actually executing correctly -- maybe it got stuck and thats why everything is unresponsive
  • Checking to see if the variant to data function is producing an error or warning. I seem to recall labview not liking to convert strict VIs into generic VIs
    • It looks like you are closing the VI front panel? Sometimes that can cause a VI to stop as well
Link to comment

Okay, so I tried the test case that you mentioned and it seems like once the VI shows up inside of the subpanel, it stops running. I also already tried opening the block diagram of the VI running in the subpanel but it won't actually let me open it despite have the option selected.

 

I also know that there is no error being produced by the variant to data function. Closing the front panel could be the issue though. I'll look for where it's being opened and seeing if I can stop it there and see if it helps. Thanks!

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
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.