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 post
Share on other sites

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 post
Share on other sites
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 post
Share on other sites

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 post
Share on other sites

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 post
Share on other sites
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 post
Share on other sites

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 post
Share on other sites

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 bbean
      I put together a simple xnode to relabel event registration reference wires that feed into dynamic events of event structures.  With the increasing use of event based messaging systems, I found myself manually changing the name of event registration references to clarify the event name when multiple event registration references were used in an object. I did this by manually creating a cluster constant on the build cluster before the dynamic registration terminal on the event structure and renaming each registration reference.  Being a lazy programmer, this seemed tedious after a few times so I decided to attempt to create an Xnode to accomplish the same thing faster.   This video shows the "problem" and the potential solution using the xnode: 
      Re-Label Xnode - Event Registration
      Here's another example showing another use case with ShaunR's VIM HAL Demo code:
      Re-Label Use Case ShaunR HAL Demo
      This may have been done before or there may be an easier way to do this, but I wanted to throw it out here to see if there's any interest and to see if people will try it out and give feedback.  I've found it works best using quick drop for initial use (highlight wire, CTRL-Space,type re-label, CTRL-I, type new name in dialog) and for replacing or renaming an existing instance on the diagram (highlight existing xnode, CTRL-Space, type re-label, CTRL-P, type revised name in dialog).  You can also use directly from the palette, but I found much faster from quick drop and also seen a couple crashes replacing through the pallete.  
      The Double Click ability is also a work in progress.  Its purpose is to allow you to quickly rename the relabel with the same dialog box, but when it executes it breaks the wire on the output connection.  You can still re-wire it to the event structure, but you will have to open the Event Structure Edit Events menu to get the event to "Re-link".  Something I'm trying to avoid.
      The Xnode generated code is simply a pass through wire with the output terminal renamed to the label of your choice.  This seems to update attached event structures.

      - B
      sobosoft_llc_lib_diagram_tools-1.0.4.1.vip
    • By Tripmeister
      Hey guys,
       
      I'm trying to do some scripting on a Realtime-VI wich uses the FPGA Interface "Read/Write Control". I open a Reference to a VI containing a Read/Write Control, and when scrolling through the BD-Objects I find it with the class-name "nirviReadWriteControl".
      I used the "to more specific class"-VI to check wich class i can cast it to, and i tracked it down to be child of the GObject->Node Class. But i can't cast it to any of the childs offered in the class specifier constant.
      I also found out, that the "nirviReadWriteControl" is a xnode.
      I have never worked with those, is there a way to access theyr methods (I think they're called "abilities" for xnodes)?
       
      The goal of the application is to make the Read/Write Control display all available FPGA FP-Elements, and connect Controls/Indicators to them.
       
      There is the same Problem with the "Open FPGA Reference"-Node (Classname "nirviOpenFPGA").
       
      I really hope somebody dealed with the xnodes a bit and can help me programmatically controlling them!
       
      Best,
      Trip
    • By bbean
      After reading this LabVIEW Idea exchange request:
      http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Provide-a-better-way-to-implement-a-polymorphic-VI/idi-p/920487
       
      I was inspired to create VI macro(s) to attempt to address the problem mentioned in the request.  Attached is my first attempt and I'm looking for feedback since I know people here have strong opinions.   The benefit of this method is that a single vim (or 2 could replace a polymorphic VI with over 48 separate VIs....unless I'm missing something.  I know that VI macros are not officially supported by NI, but that hasn't stopped us from using unsupported features before.  Some people have probably already done something like this, but I couldn't find an example.
       
      To use the files, unzip them and copy them all to your \LabVIEW (version)\user.lib\macros\ directory.  
      Create the directory if it does not exist.  For example: C:\Program Files (x86)\National Instruments\LabVIEW 2014\user.lib\macros\   And as described in the wait-ms-with pass through post below, modify your LabVIEW.ini file to have the following     ExternalNodesEnabled=True and Optionally     XNodeWizardMode=True   http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Wait-ms-with-error-pass-through/idc-p/3178218#M31820
       
      Open the Example Changed.vi and review.
      Changed Example.zip
    • By pylb
      Hi,
      i am trying to automate building a code, deploying it on an RT target and rebooting the target. I've got everything working but I do have a dialog box saying that the connection to the target was lost popping up.
      I would like to disable this notification during my process and re-enable it after.
      Anyone has an idea how to do this?
       
      I tried the "suppress Project Dlgs" invoke node of the target but it does not work.
      I changed the target Tags to prevent the "periodic check of the responsiveness of teh RT protocol" but that did not work either.
       
      I found this invoke node for the project that us called SuppressChangeNotification. I am not sure if that would do it since it could just be change of the content of the project not changes in the state of a target in the project. But the problem is, since it is part of the SuperSecretPrivateSpecialStuff the inputs are not documented and it needs ItemIDs of the notification that will be suppressed.
       
      Anyone know what those IDs are? or has a better way to suppress that diakog box?
      thanks,
      Pierre-Yves
    • By Abhinav Kothari
      Hey Guys,
       
      I am a student of Masters in Mechatronics and have a project relative to creating ExNodes in Labview to recreate the PID Controller. I come from a Mechanical background and have very minimal knowledge with LabVIEW.
       
      I tried learning how to script (as I read that it is important to know how to script to learn to create ExNodes) but am finding difficulty in that as well. I wanted to know if someone could take time and explain me step by step on how to script on LabVIEW and also create ExNodes so that I can learn to create the PID Controller algorithm on LabVIEW.
       
      If you guys could also help me with author names to books which help me learn LabVIEW from the start to end, it would be great. Hoping to read positive responses soon. 
       
      Regards
       
      Abhinav
×
×
  • Create New...

Important Information

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