LAVA Forums Buy cool LAVA gear Forums RSS Feed

Welcome Guest ( Log In | Register )

Tags
(This content has not been tagged yet)
4 Pages V   1 2 3 > »   
Reply to this topic Start new topic
> A LabVIEW tool suggestion, or: why you should have stayed till the end of NIWeek
Yair
post Sep 1 2007, 08:25 PM
Post #1


Extwemely Active
*****

Premium Member
Posts: 1621
Joined: 23-January 05
From: Here
Member No.: 1431
Using LabVIEW Since:2003
LV:8.6 ,7.0 ,.
Israel Nothing Selected Nothing Selected


Staying until the end of NIWeek has its advantages: At the end of the very last session in the last day, frequent LAVA poster Darren showed a demo of a potential time saving tool he was thinking about for a future LabVIEW version.

The tool allows you to use a simple key combo which will cause a small pop up to appear. You type the name (or keyword) of the function you want it use, it uses autocomplete and when you click enter you can immediately drop it in your code. This will allow you to drop any VI from the palettes in your code in a few key clicks without having to dig it out from the palette.

The problem is that I was impatient, so I wanted this now. So, while waiting for my flight the next day, I coded up a quick example (7.0) to see how it would work, and it is a very simple example - type the name of a function\VI in the string and press Enter. It will allow you to drop that function\control in the BD\FP of any VI.

There are some issues with it, however, and I want opinions.
  1. Dropping the function is easy. There is a method for doing that from the palettes.
  2. The hardest part is probably parsing the potential names. Different LabVIEW versions with different toolkits and modules installed will have different VIs. Also, the user.lib VIs are also part of this list.
    The most promising solution looks like the palette API, but it remains to be seen whether this can be backsaved to 7.x (which is what I want). Another problem is that parsing this will probably take time. I think that this will need to be a step which the users perform manually when they want to update the list by calling a specific VI which will do this.
  3. Another problem is monitoring this. This can't be done using LabVIEW events. I was thinking of using polling and trying to load the tool at LabVIEW startup and having it run in the background all the time. I believe this is relatively simple using some callbacks which LabVIEW has, but I need to check if they work with 8.x. This could obviously interfere with what users do, but I think it's the only viable way.
  4. The method used to do this ignores whether or not the VI with focus is in edit mode. It basically allows to drop in any VI which is in edit mode.
  5. A nice addition would probably be using autocomplete in the middle of a word and using keywords to stand for VIs, but that would require a more complicated algorithm than this quick example.
  6. At the moment, this is relatively similar to the search window. What would be its advantages over it?
What do people think about all this? Are there alternative suggestions?

The most up to date version (DropIt.zip) is also attached to this post.
Attached File(s)
Attached File  Drop_function_by_name.vi ( 83.35K ) Number of downloads: 214
Attached File  DropIt.zip ( 632.94K ) Number of downloads: 31
 

--------------------
More than meets the eye...


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Ad
post Sep 1 2007, 08:25 PM
Post #















Tags
(This content has not been tagged yet)
Go to the top of the page
Quote Post
Ton
post Sep 1 2007, 09:05 PM
Post #2


CCT It
*****

Premium Member
Posts: 1331
Joined: 13-June 05
From: Woerden, Netherlands
Member No.: 2399
Using LabVIEW Since:2001
LV:8.5.1 ,6.1 ,8.2.1
Netherlands hol_utrecht Nothing Selected My Blog My Gallery


QUOTE (yen @ Sep 1 2007, 10:25 PM) *
The tool allows you to use a simple key combo which will cause a small pop up to appear. You type the name (or keyword) of the function you want it use, it uses autocomplete and when you click enter you can immediately drop it in your code. This will allow you to drop any VI from the palettes in your code in a few key clicks without having to dig it out from the palette.
....
3. Another problem is monitoring this. This can't be done using LabVIEW events. I was thinking of using polling and trying to load the tool at LabVIEW startup and having it run in the background all the time. I believe this is relatively simple using some callbacks which LabVIEW has, but I need to check if they work with 8.x. This could obviously interfere with what users do, but I think it's the only viable way.
...
6. At the moment, this is relatively similar to the search window. What would be its advantages over it?What do people think about all this? Are there alternative suggestions?

Yen you limit yourself way too much

What about the current discussions on using custom shortcuts for tools options.
What about a 'Update SCC'/Check out/Run VI analyzer
A lot of things come to mind.

A probable event driven approach to 'key down' is added.

I've looked at your code but haven't studied it... (sorry)

Ton
Attached File(s)
Attached File  EventDrivenKeyDown.vi ( 14.61K ) Number of downloads: 134
 

--------------------
Certified LabVIEW Developer
Shouldn't you be programming a Code Repository solution?


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
orko
post Sep 2 2007, 02:50 AM
Post #3


Extremely Active
****

Premium Member
Posts: 525
Joined: 18-October 05
From: Seattle, WA
Member No.: 3266
Using LabVIEW Since:2005
LV:8.5 ,8.2.1 ,7.1.1
United States us_washington Nothing Selected My Blog


It would seem that you could avoid a lot of initial drawbacks to this idea if you made it a VI you place on the pallete window vs. a shortcut key activated thingy. Sure, a key to bring this (and many other VI's I could think of) would be nice, but I have a feeling that in future releases of LabVIEW they will allow custom VI's to be associated with shortcut keys (NI correct me if I'm wrong...but why else would there be that hint of a "bug" in the File menu shortcuts...?).

I would suggest that getting the autocomplete while typing feature and the "refreshing" of the VI lists would make this tool very beneficial by itself. Then perhaps we can get some kind of workaround so all of our nifty tools can be popped up with a keystroke.

Just my 2 cents biggrin.gif

Great idea by the way!!!

--------------------


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
PJM_labview
post Sep 2 2007, 04:43 PM
Post #4


Extremely Active
****

JKI
Posts: 612
Joined: 19-June 03
From: Bay Area, CA (USA)
Member No.: 121
Using LabVIEW Since:1998
LV:8.5.1 ,8.6 ,8.2.1
United States France Nothing Selected My Blog


QUOTE (tcplomp @ Sep 1 2007, 02:05 PM) *
...A probable event driven approach to 'key down' is added...

Ton

You can not register event on VI which are not running (this is a pitty really). Therefore the portable event driven approach VI you attached will not help in this situation.

PJM

--------------------

Got VIPM?

JKI . VIPM . EasyXML . OpenG . LAVA . Builder . Blog



Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Yair
post Sep 2 2007, 06:16 PM
Post #5


Extwemely Active
*****

Premium Member
Posts: 1621
Joined: 23-January 05
From: Here
Member No.: 1431
Using LabVIEW Since:2003
LV:8.6 ,7.0 ,.
Israel Nothing Selected Nothing Selected


You should note that the key is here is not opening the VI. That's relatively simple. The key is getting the list of all the VIs and primitives (and controls?) in the palettes. At the moment, I used the list from the New VI Object primitive in LabVIEW 7.0, but that is not a solution.

To demonstrate this tool more efficiently, here is a better version. As you can see, the polling is not that bad.

Instructions:
  1. Run the VI. It should auto-hide.
  2. From the BD of any other VI, press Shift+Q. That should open it (although it would actually open regardless of where you are. That's one of the problems with this).
  3. Start typing the name of function until you get the one you want (e.g. TCP Close).
  4. Press Enter to drop the function.
  5. Repeat for as many functions as needed.
One issue is that when you first run it, it takes a few seconds before it allows you to drop the function, but I don't think that can be worked around.

As said, there are many improvements which could be made, but I don't want to do anything before I know I can enumerate the palettes. Can anyone with LabVIEW 8.0 try to backsave the palette API linked to in the first post?
Attached File(s)
Attached File  Drop_function_by_name.llb ( 104.06K ) Number of downloads: 126
 

--------------------
More than meets the eye...


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Yair
post Sep 3 2007, 06:57 PM
Post #6


Extwemely Active
*****

Premium Member
Posts: 1621
Joined: 23-January 05
From: Here
Member No.: 1431
Using LabVIEW Since:2003
LV:8.6 ,7.0 ,.
Israel Nothing Selected Nothing Selected


Two new (related?) important points I thought about -
  1. Will this work fine across 8.x application instances?
  2. If the VI is running in the background, it means that when you close all your other VIs, the getting started window will not appear because there is still a VI in memory, so LabVIEW would just seem to disappear.
    One way around this is to run this process as a separate executable, but that requires opening VI server access and would cause troubles with multiple concurrent LabVIEW versions.
    Another way is to open and close the VI each time, but since we can't create a permanent menu shortcut, I don't see how to do that other than attempting to include the VI in the top level of the palettes, which would require a few mouse clicks.

    Does anyone have other suggestions or ways to make these usable?

--------------------
More than meets the eye...


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
orko
post Sep 3 2007, 09:10 PM
Post #7


Extremely Active
****

Premium Member
Posts: 525
Joined: 18-October 05
From: Seattle, WA
Member No.: 3266
Using LabVIEW Since:2005
LV:8.5 ,8.2.1 ,7.1.1
United States us_washington Nothing Selected My Blog


QUOTE (yen @ Sep 3 2007, 11:57 AM) *
Another way is to open and close the VI each time, but since we can't create a permanent menu shortcut, I don't see how to do that other than attempting to include the VI in the top level of the palettes, which would require a few mouse clicks.


I personally wouldn't mind having it somewhere near the "Select a VI..." icon in the pallettes as opposed to making it a daemon. My mind would be in that zone anyway when I went to search for a VI ("I need a VI... click, okay, Find a VI...").

Just how my mind works. YMMV wink.gif

--------------------


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Darren
post Sep 4 2007, 02:19 AM
Post #8


Very Active
***

NI
Posts: 213
Joined: 14-March 06
From: Austin, TX
Member No.: 4441
Using LabVIEW Since:1999
LV:8.6 ,8.5 ,8.0
us_texas United States Nothing Selected


QUOTE (yen @ Sep 3 2007, 01:57 PM) *
Does anyone have other suggestions or ways to make these usable?

For my prototype at NI Week, I didn't need to do any polling. I'll give you a hint...I found a VI-based utility that you can launch from a keystroke in LabVIEW, and I hijacked it by putting my Quick Drop VI in place of the existing utility.

-D


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
JDave
post Sep 4 2007, 04:45 PM
Post #9


Extremely Active
****

Premium Member
Posts: 430
Joined: 2-February 05
From: Southern California
Member No.: 1519
Using LabVIEW Since:2004
LV:8.20 ,7.1.1 ,8.0.1
United States Peru us_california


QUOTE (Darren @ Sep 3 2007, 07:19 PM) *
For my prototype at NI Week, I didn't need to do any polling. I'll give you a hint...I found a VI-based utility that you can launch from a keystroke in LabVIEW, and I hijacked it by putting my Quick Drop VI in place of the existing utility.

-D

Ooohh, hijacking existing tools to use their hotkeys. ninja.gif Now that is a nice idea. Not for the mass markets, but if you just want your tool to have a hotkey...


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Michael_Aivaliot...
post Sep 4 2007, 06:00 PM
Post #10


Confucius say: Crowded elevator always smell different to midget
Group Icon
*****

Admin
Posts: 2363
Joined: 13-October 02
From: Planet Earth
Member No.: 2
Using LabVIEW Since:1994
LV:8.5 ,8.2.1 ,7.1.1
Greece Canada United States My Blog My Gallery


All of this is nice and fun but any solution proposed is still something that is a hack onto the LabVIEW IDE. It also will be a tool made by someone or some entity that thinks they know what I want. What I would really like to see is an API for the rest of us. Something that allows anyone to create extensions to the environment. Event driven, shortcut driven, context sensitive etc. Ya, I know, it takes time and costs money and NI has their priority list... I'm just saying.

Typing something into a textbox to get a function? Those icons on my pallete have names? Who would have thought. Now I just have to figure out what everything is called and I'm set. wink.gif

--------------------


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Phillip Brooks
post Sep 4 2007, 06:24 PM
Post #11


Extremely Active
****

Premium Member
Posts: 688
Joined: 3-November 04
From: Boston, MA
Member No.: 949
Using LabVIEW Since:1999
LV:7.0 ,8.20 ,8.0
us_massachusetts France Thailand My Gallery


What is it called?

Modulo? No. Quotient and Remainder.
Xor? No. Not Exclusive Or.

I'll stick with the icons... As long as we agree to leave the friggin' palettes alone!

--------------------



Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Michael_Aivaliot...
post Sep 4 2007, 07:38 PM
Post #12


Confucius say: Crowded elevator always smell different to midget
Group Icon
*****

Admin
Posts: 2363
Joined: 13-October 02
From: Planet Earth
Member No.: 2
Using LabVIEW Since:1994
LV:8.5 ,8.2.1 ,7.1.1
Greece Canada United States My Blog My Gallery


QUOTE (LV Punk @ Sep 4 2007, 11:24 AM) *
I'll stick with the icons... As long as we agree to leave the friggin' palettes alone!

First rule of all LabVIEW releases. Palettes will change.

--------------------


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post