Sparkette Posted September 7, 2014 Report Share Posted September 7, 2014 Disclaimer: This technique makes use of multiple private properties/methods (one of which is optional), as well as some private menu options accessible through the INI key "enableSecretPopups=True". I believe this use of them is safe (in fact I'm pretty sure RestrictLRGrowMove is being used for its specific intended purpose!) but as I don't work for NI, I can't make any guarantees. I know that many of LabVIEW's dialogs are implemented as VI's, and I was curious if the statechart module's state configuration dialog was implemented in this way as well. Sure enough, it was, which meant it was possible to create an editable block diagram as part of a VI's front panel. It didn't take long to figure out that the input/output nodes on the left and right were really unbundle/bundle by name nodes, as it was literally as easy as putting the mouse over one and looking at the context menu! I didn't at first know how it prevented them from moving left and right or being copied to another VI, however. I realized it had something to do with the object's flags through experimenting in Heap Peek. Then I found the private property called "RestrictLRGrowMove", which had this exact effect. So yeah, this is basically just a VI I created as a demonstration of this technique. It's possible to put a block diagram in a subpanel through a scripting method, and it's also possible to enable editing in that subpanel through a private property or hidden menu item. Of course, the latter means this isn't officially supported by NI, but it's still an interesting technique. Perhaps someday it will have official support. And if you're wondering why the unbundle/bundle nodes only show the text, it's actually very simple: there is no way to scroll in the subpanel unless scroll bars are enabled, and the rest of it is simply out of the viewable portion! The subVI that generates the embedded VI is kind of messy, but I put a step-by-step explanation of how it's generated on its block diagram as well for that reason. Subpanel Diagram Example.zip Quote Link to comment
hooovahh Posted September 8, 2014 Report Share Posted September 8, 2014 This is pretty neat. One thing I noticed right away is that Auto-Tool has to be on. If you try tabbing through the tools your tab is intercepted by the front panel and your cursor moves from control to control. This also affects things like QuickDrop and the Clean-up shortcuts. Quote Link to comment
lordexod Posted September 8, 2014 Report Share Posted September 8, 2014 subpanel.vi Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.