Jump to content

Strange "VI is External Editor" option in palette context menu


Recommended Posts

When I'm editing a palette and I right-click a subVI on the palette, I get a context menu option called "VI is External Editor", one of the ones that you can select to check and uncheck it. When I turn it on for a subVI, it makes it so placing that subVI from the palette instead behaves as if I'm creating a structure, changing the cursor and allowing me to mark a rectangular area. But then nothing happens when I do; it doesn't place anything. One noteworthy thing I notice is that if I have the panel open for the subVI in question, I see the grid on the panel disappear for a split second, as if the VI is being locked for editing briefly (though this does not happen if I "create the structure" on that same VI.) In addition, the following text is appended to the gDPrintf log;

Added MstrWiz

gUnattended will cause VIs leaving memory during GetInstHandle to get saved automatically. This is dangerous.
### DoTransaction is aborting last transaction ###

(In case anyone is curious where I see this text, I have a VI in my Tools menu that turns on the "gDPrintf mirror" using the "Call Internal Command" private method, and displays the logged text in a window. If anyone wants it, let me know and I'll attach it.)

The "MstrWiz" part is interesting, because it brings to mind the fantastic-sounding "Master Wizard" class that shows up when you enable scripting, as well as some other stuff I've seen. Most relevant is the "External Editor Wizard" private method on block diagram refnums, and the scripting class of the same name, neither of which I've been able to figure out how to do anything with. (Though one of the properties on that class refers to a "master container structure", which is interesting because of the structure-like behavior.) It also reminds me of the mysterious Open Editor Wizard menu item string I found in the resource files. By the way, since a lot of this stuff is just scripting and not private, I figure someone will know something about it.

What I find most strange however is the fact that I haven't seen any information about the "VI is External Editor" menu item. At first I assumed it was an NI-internal feature enabled by one of the various options I have turned on in LabVIEW.ini, but the option remained there even after temporarily renaming my LabVIEW.ini file to restore the default options. I even disabled a certain XNode development-related file I have installed (I'm sure some of you can guess) in case that was also enabling it but nope, still there. Does everyone else have this option? If not, does anyone know why I do? What is the option for?

My guess (though it's just a guess) is that if the VI has the correct connector pane, I can drag that "structure" box around some stuff, and then it will run that VI to perform some scripting action on the selected objects.

Link to comment
 

When I turn it on for a subVI, it makes it so placing that subVI from the palette instead behaves as if I'm creating a structure, changing the cursor and allowing me to mark a rectangular area.

When you edit a palette set, there is an option of "Place VI Contents" when right clicking on a VI, which will drop the code contained in the VI rather than the VI itself (like a template). Maybe it has something to do with that.

Link to comment
 

When you edit a palette set, there is an option of "Place VI Contents" when right clicking on a VI, which will drop the code contained in the VI rather than the VI itself (like a template). Maybe it has something to do with that.

Yeah I know about that; I actually noticed it as I was turning that option on for something. I just tried it with both options enabled and it just places it with the contents, and nothing interesting is logged. I don't think it's related.

Do you have the "VI is External Editor" option?

Link to comment

OK, just discovered something big! (Well, big as far as this mystery is concerned anyway.) I did a "dir /s *wiz*" in my LabVIEW directory, and found a folder called "ExternalEditors" in "resource\plugins". I put "<LabVIEW>\resource\plugins\ExternalEditors\StateDiagramEditor\StateDiagram.vi" in my palette and turned on that option, and yep, it worked.

It's actually pretty interesting; it's a little graph editor thing that generates a state machine loop structure. And the structures have a little icon on them too showing they're still linked to the editor so you can open it again for further editing.

And how do you open it again?

ss_P81RMW.png.e8199725e726119ce52bdb534dabe60e.png

So there's another mystery solved.

This seems like it could be a real neat framework for creating custom stuff, as long as it doesn't end up crashing LabVIEW a bunch as unsupported features tend to do. I'll put something together to let you experiment with this in a bit, since I still have yet to figure out why I have that "external editor" option. (My LabVIEW installation that has this option happens to be in a VM though, so that might make it easier to figure it out.) I'll let you know when I figure out how to enable it. (Figuring out how to enable NI-internal features is nothing new for me, but it's strange actually having the feature enabled already while I try to figure it out!)

EDIT: Okay, this is weird. That editor uses malleable VI's in its code, making me think this is pretty recent. But then, look what pops up in the generated code if you have more than one non-default state transition:

ss_UGaoSz.png.d708cf6f71580b4784a72500d44a7908.png

Yeah...if this was recent then I can't imagine they'd be using one of those. That's an External Node, for those who aren't familiar. That's what the ";D" prefix on the VI name means. No, really. External Nodes were NI's first attempt at creating, well, externally-coded block diagram nodes. The more modern, less buggy (but still unsupported) implementation of that, of course, is the XNode. (The link I posted before refers to XNodes, but I think that's what External Nodes were called before the new XNodes were a thing.)

Now yes, VIM's existed in a semi-official capacity in earlier versions of LabVIEW as well. But they were implemented using XNodes, so I don't think they existed back when NI was still using External Nodes.

This is really weird.

Edited by flarn2006
Link to comment

Okay so I don't fully know if this is what you are dealing with but I think this has to do with the State Diagram Editor.  NI had a toolkit called the State Diagram Editor back in the 7.x era.  It was a toolkit which had a graphical UI for making states and defining what made states go where.  It had a single ExternalNode for assisting in the code which determined what state it should go to.  It wasn't completely required but did make life easier for the most part.  NI later saw the value in this type of editor and made a new toolkit the State Chart Module which had some similar functionality but wasn't quite the same.

Well after years of complaining (from Ben primarily) NI decided to release the State Diagram Editor.  I thought they replaced the ExternalNode with a VIM but now that I look at it that doesn't seem to be the case.  You can find the State Diagram Editor on the Tools Network installed through VIPM.  Then you can drop down a new state machine and edit it either in the image control (and the code will be updated) of you can edit the code and the image will be updated.  Still there are a few things I don't like about it like type defing those enums causes problems and I think crashing.  

Link to comment

Well yeah, the State Diagram Editor is what I was talking about before; that's the example I found in vi.lib. Though naturally I'm more concerned with figuring out how to make my own, and how to enable that option in the palette editor (even though somehow I already have it enabled.)

Also there are in fact some VIM's there; that external node isn't one of them though of course. (And it really couldn't be; it grows to arbitrary size, has a dynamic number of terminals, and displays variable text on it. The only other thing they could use, barring adding a new primitive, is an XNode.)

Edited by flarn2006
Link to comment
 

@ShaunR, I just realized it says you're using LabVIEW 2009. Is this the version you checked for that menu item in? Maybe it wasn't added until a later version.

I was actually working in 2013 at the time but have just checked 2018 and it is indeed in there. So it was obviously added after 2013.

Link to comment
 

I was actually working in 2013 at the time but have just checked 2018 and it is indeed in there. So it was obviously added after 2013.

OK, thanks; I guess there probably isn't anything special that needs to be done then in order to enable it. Or is there some kind of special configuration you've done that might have enabled it?

Weird how no one else seems to have noticed it, and also interesting that they'd add it now. Unless they didn't mean to put it in the released version :p

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.