Jump to content

Get VI ref from subpanel


Recommended Posts

I still think it is justified to wait for SPs and do tests before switching, however the last two releases were focused on fixing bugs and improving stability (2014 + 2015 afaik), with less "big" features like the Actor Framework in 2013. Compared to 2011, 2015 seems to be much more stable at least on my machine (working with a classes is no longer a reason to perform suicide, even with properties :blink:).
 
Being in the club 2011 too, we'll finally move to 2015 by the end of this year (and upgrade to SP1 once it is available). The performance improvement and, as Yair pointed out, the new edit-time features are worth it.

Link to comment

 I've had the impression that people wait for the SP1

 

Some people wait for the SP releases. It's certainly less likely to have new bugs, as they rarely have new features, but .0 releases are not exactly hotbeds of crashes automatically. I know I used 7.0 for years and was perfectly happy with it. I suppose depends on how sensitive you are to perceived potential bugs, but I don't have any actual data about the stability of .0 and .1 releases. I actually generally try to avoid upgrading if possible, because it's a hassle and can make project management a pain.

Link to comment

Its worth pointing out that the property you're referring to seems to return a single VI reference for any subpanel (at least in 2013). That is, if you read it you'll always see 0x00111111 even if you just passed in 0x00222222 or changed it to 0x00333333. This is fine-- you can still figure out which VI was inserted, but don't close that reference.

Link to comment

Its worth pointing out that the property you're referring to seems to return a single VI reference for any subpanel (at least in 2013). That is, if you read it you'll always see 0x00111111 even if you just passed in 0x00222222 or changed it to 0x00333333. This is fine-- you can still figure out which VI was inserted, but don't close that reference.

Honestly I think I'd prefer the function work in this manner rather than opening a new reference to the VI that I then need to close each time.  I wouldn't expect a function like this to open a new reference, but rather just return the reference it already has, similar to other property nodes that return a reference to something already open.

Link to comment

its kind of hard to describe so I'm posting a picture:

post-52313-0-06321800-1441729604.png

 

So the refnums are in fact different for all of the wires, but if you close the reference you get out of the inserted VI property, bad things happen. In this case, for example, the first VI never shows up past the first run and if you try to open that VI's front panel it points you at the subpanel, even when the main VI is stopped. Weird stuff.

Link to comment

Thanks for the tip, I really appreciate it. For some reasons, since my early days as a LV developer I've had the impression that people wait for the SP1 because of potential bugs when a new version is released. But maybe that is not justified anymore?

 

Nah, go for it. Think of LV2015 as LabVIEW 8.6.1 SP13.

  • Like 2
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.

  • Similar Content

    • By AInvisibleNinja
      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!


    • By MikaelH
      I have an issue with a Sub Panel in a generic GUI VI we use as part of our company's OO based application framework.
      Most often the SubPanel behaves like it should.
      But sometimes after the application has stopped, the VI that was last inserted into the SubPanel, is still inserted according to LV.
      When this happens (and I start the application again) I can't insert that VI into the SubPanel again, I can insert other VIs, but if I try to insert the last Inserted VI, LV says:
      Error 1145: Cannot open VI because it is already in a subpanel control.
      If I try to open the VI's FP, LV opens the FP of the GUI VI that has the SubPanel (just like it should if it was inserted), but the SubPanel is Empty.
      And LV behaves the same, even after the SW stopped?!?!
      When LV stops all SubPanels should be emptied (i.e.all inserted VIs should be thrown out.)
       
      Has anybody else experienced this strange behavior?
      Our framework is doing something that LV doesn't like of, but I haven't figured it out yet.
      We do see one strange behavior as well.
      We start up the framework with a VI that kicks off some processes (just like you do in Actor Framework), and when the framework starts up and starts inserting stuff in the SubPanels, the Top VI becomes broken, but it's still running.
      Have you guys seen this as well?

       
       
    • By RnDMonkey
      I see a lot of knowledgeable minds around here, so here's my challenge. I have a test system that will have, at the user interface level per channel, 3 inputs and 2 outputs that together encompass a simple test scenario. I would like that scheme repeated up to 10 times in a single application so you could watch a bank of units under test, allowing both scripted or manual manipulation of inputs; plus viewing and logging of the outputs.
       
      Here is an example of what I think I want the user to interact with:

       
      I would like to associate each of these "subpanels" (not to be confused with actual subpanels - yet) with a LabVIEW class object that will handle the interface with hardware. All channels would be coordinated by a top-level VI (let's call it the Controller) that aggregates the channels and provides the ability to parse script files to press buttons and stuff. Here's where I'm having trouble, conceptually. One solution seems to be to spin off a new asynchronous call-and-collect VI (in the form of the pictured panel as a brat VI) that has the brat throw its control references into a queue for the Controller to catch and store for later access. The brat would receive stuff like a user stop event and the hardware session's class object when first called. I would then create an array a grid of 10 Sub Panel controls on the Controller's front panel and place each brat VI into its own Sub Panel like a facade.
       
      The core of the hardware IO would be built into the brat VI (operating on the class objects), with the Controller pulling the strings and catching outputs and user interaction through dynamically registered events and property nodes operating on the brat's references. This all seems like it should all be workable and isn't fundamentally new to me.
       
      Does this seem reasonable?
       
      Another - much less (in)formed - concept I had was to avoid the ACBR brat structure entirely and implement this "subpanel" as an XControl that I can treat like a regular control on my Controller's front panel. I think of XControls because I can't have a cluster with both inputs and ouputs (unless I access the indicators with property nodes and fake it, I think), though I am actually only assuming that XControls allow both at once, or the equivalent behavior. In this scenario, the controller would retain an array of my hardware session's class objects and index them associated with each control. This way, the controller would invoke a hardware IO operation in a for loop to iterate across all devices. Similarly, when one of the XControls had a button clicked, the controller would see the value change event, figure out which one fired it, and do some function for only that associated hardware.
       
      I've never implemented an XControl before - at all - so the first solution is going to be the easier one for me. Is there a good argument for going the XControl route over the asynchronous-brats-with-Sub-Panel route?
       
      Thank you for your inputs, and sorry for the wall of text!
    • By ensegre
      I ran into this; I wonder if I'm misunderstanding, or it's a bug.
       

       
      I have a FP, with buttons I want to toggle with keys, and I have string controls in a subpanel, like in the attached minimal example. I'd like to toggle the button while the focus remains in the subpanel string. While this is no problem for a control on the FP, pressing F1 while focus is in the subpanel string rises the focus to the whole subpanel container. What is wrong? If a bug, how to workaround? Setting KeyFocus to the sbubpanel string ref doesn't seem to help.
       
      Seen in 2014SP1 linux and 2014SP1f3 windows.
      main.vi
      subvi.vi
    • By stgranger
      Hello,
       
      I am working on a user interface for an 8 site test station.  I put a lot of thought into the design of the UI and when I started trying to implement, I ran into a major road block and was hoping I could get some advice here. Here is an overview of what I have:
       
      I have 1 view where I want to see an overview of all 8 sites and have basic control of each site.  Each site can test part A or B.  Each part has different information and therefore, I want the overview display to be different for each, depending on which part number is being tested.  
       
      So I made a "Part" Class and 2 child classes "A" and "B".  Each child class has an "overview" VI that has the information that I would like to display.  My plan was for each site to create an instance of the appropriate class ("A" or "B") and insert the "overview" VI into the subpanel corresponding to the appropriate site.  
       
      This is where I ran into a problem.  I load part A into site 1, and the subpanel loads the correct display.  Then I try to load a second part A in site 2, and I get an error saying I can't load that VI because it is already loaded in another subpanel.  I had assumed that if I had a reentrant VI and had created multiple instances of it, that I could insert each instance into a separate subpanel. 
       
      After searching on the NI website, I found an article saying that this is not possible.  I guess I made a bad assumption when I went down this path.  Does anybody have any recommendations for alternatives? Or any way around this?  Thanks! 
×
×
  • Create New...

Important Information

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