Jump to content

Adding plugin in "VI toolbar"


Recommended Posts

Hi everybody,

While I was having some time to develop new scripting stuff i wondered "would it be possible to add somme scripting stuff in the VI toolbar ? " (the one with run, run-continuously, abort, police stuff and so on). My point is to add kind of a combobox that populate with every events in the current vi for a control when clicking on it. And of course show the effective event and make it blink when selecting it in the combobox.

The scripting part is almost done but i now come to the real problem : 

"How can I add this piece of code in the VI toolbar ?"

I know i can create either a Quidrop Plugin or a shortcut menu plugin but they don't fit the way i wan't to use this plugin.

I asked some NI guy that told me the only options where the one above but I can't imagine that LabVIEW is not in some way developed around a "plugin architecture" so if any of you as plunge deep into LabVIEW's files and know where and how to achieve this goal it would be really nice :)

Thank's everybody and I hope my question was clear.

Edited by bI0ndin
Link to comment

Based on how seldom the toolbar has changed over the years, I suspect it is not a plugin based design.  The buttons you see are the same buttons that have been there (with a few exceptions like cleanup) since 2004 or earlier.  If it changes that little, I doubt NI made it a plugin design.

You can put things in various menu bar items, like Tools, and File which can be useful for calling VIs to perform actions on the open VI.

And there is the Project Provider Framework, which has the ability to add items to the project toolbar, but not many people do this because it can be a pain to work with, and is somewhat incomplete. 

That being said this is probably a good idea for the Idea Exchange.

Link to comment
3 hours ago, hooovahh said:

You can put things in various menu bar items, like Tools, and File which can be useful for calling VIs to perform actions on the open VI.

I'm interested! Where can I find info on how to do this?

 

3 hours ago, hooovahh said:

And there is the Project Provider Framework, which has the ability to add items to the project toolbar, but not many people do this because it can be a pain to work with, and is somewhat incomplete.

The application form sounds like this is meant for companies with a serious product. Do you know if NI accepts applications for hobby projects (or projects not ready for prime time yet)?

Edited by JKSH
typo
Link to comment

While NI takes applications into the project provider, there are some unofficial ways to use it.

Of course this comes with no real documentation.  It's a bit of a mess really, NI seemingly didn't put in the effort to make this a polished API likely due to the fact that few people would want to do this.

Adding items to the menus are a much easier process and in most cases just take putting a VI in the right folder, and then setting it to run when opened.

http://digital.ni.com/public.nsf/allkb/2ED4443B186788E18625714000757C03

Oh and while QuickDrop can make the editor a bit easier to use with scripting functions, there are only so may keys you can use, and then there is the fact that you need two shortcut keys to invoke your function.  A better idea might be to put something in the tools menu, then invoke it through a single shortcut command.  This can't happen today, but there is already an idea exchange item for it.

  • Like 1
Link to comment

Like Hooovahh, I'm fairly certain there's no plugin options for the toolbar. This is most likely implemented in the C code, and while it may be theoretically possible to hack it, I doubt it's worth the effort.

One option which might be more relevant for you is having a separate floating VI as your toolbar and using the VI Activation event to interact with the relevant VI. This will do what you want, but it has the disadvantage of being a separate window that you have to open when you want this functionality. You can see an example of how this can work here - https://decibel.ni.com/content/groups/labview-apis/blog/2009/06/15/automating-labview-development-with-the-scripting-springboard

Edit - I suppose you could also poll the window position of the active VI and use that to position the floating VI over the toolbar, but that's hacky and won't work well with all window sizes.

Edited by Yair
Link to comment
On 19/5/2016 at 10:03 AM, Yair said:

One option which might be more relevant for you is having a separate floating VI as your toolbar and using the VI Activation event to interact with the relevant VI

Yeah i was thinking of a kind of engine that would be launched with QD and then live it's life and giving me all the info i need while developing, i'll tell you if i find time to do it

 

On 19/5/2016 at 10:03 AM, Yair said:

Edit - I suppose you could also poll the window position of the active VI and use that to position the floating VI over the toolbar, but that's hacky and won't work well with all window sizes.

And of course i wanted to knew if there where a way to include it in the toolbar not to have to code some hacky hack :)

Link to comment

I have some minor comments on usability, from quick testing. I don't know if you're already interested in such detail.

  • TopLevelDialog/SelList[] loops erroring, if the VI examined is closed and thus the ref becomes invalid, and ShowEventsFromCtl becomes topmost (i.e. even if there are other opened VIs, but they are not topmost). That should be trapped.
  • TopLevelDialog/SelList[] list loops erroring, if the VI examined is password protected. Either that should be trapped and reported or the standard unlock dialog should be brought up.
  • Show Event blinks the right place in the BD, but that may not be visible if scrolled away. An improvement would be to center the window on it, like Stop on error does.

 

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.