Jump to content

Auto wire FP to Connector Pane Tool and more


Recommended Posts

The original topic on creating a tool to automatically wire a FP to the Connector pane was started here. My thanks to JDave for starting it.

I started a new topic to track the progress of the SubVI Fixer.

Here is Version 3 using the VI Activation Event that PJM showed me.

msg-2399-0-00715900-1351198367.png

Version 3 works the same as Version 2 but is much more stable. the Video is located Here

QUOTE(PJM_labview @ Oct 17 2007, 06:46 PM)

The next thing I want to do with this tools is implement PJM's suggentions.

In the Settings_Change.vi I added a array of Clusters. The Clusters have two items a match pair type and an array of wirring priorities.

post-584-1193202996.png?width=400

post-584-1193203003.png?width=400

My current plan this

post-584-1193203013.png?width=400

The next thing I need to figure out is how do I determine what controls match from their references.

I could do it by label name only and I probably will to start with but I would like to do it by type.

Does anyone have an Idea how to uniquely identify a FP item via reference. The goal is to differentiate (cluster of different components from each other, References of different types and objects of different classes).

Link to comment

QUOTE(mballa @ Oct 23 2007, 10:50 PM)

If references are present (like ref in, ref out), connect them on the upper left and upper right respectively.

LabVIEW classes should generally get the same treatment. When there are multiple classes on the same conpane, each with an "in" and an "out" terminal, the preference should be if the VI is owned by a given class then that class gets preferential treatment for being in the upper left and upper right. Otherwise, mimic the panel layout.

Link to comment

QUOTE(mballa @ Oct 24 2007, 05:50 AM)

This is a really nice tool!

Thank you very much for all the time you put into this! :worship:

The tool works very nice, as long as the name of the main VI starts with an underscore.

I copied it into my projects directory and removed that underscore to get a Tools menu item for this.

Now I get a funny problem: every time the tool changes the window focus to itself, it seems to detect the VI Activation event and sets "Target VI" to itself, which makes it impossible to use the tool anymore.

The straight-forward solution to this seems to work fine here:

post-7932-1193219933.png?width=400

I didn't upload the complete VI, since it's a really small change, and I suspect, you already have made much bigger changes in your own version.

Link to comment

QUOTE(silmaril @ Oct 24 2007, 05:01 AM)

Thankyou for the feedback and trying out the tool. I hope it saves you some time.

QUOTE(silmaril @ Oct 24 2007, 05:01 AM)

The tool works very nice, as long as the name of the main VI starts with an underscore.

I copied it into my projects directory and removed that underscore to get a Tools menu item for this.

Now I get a funny problem: every time the tool changes the window focus to itself, it seems to detect the VI Activation event and sets "Target VI" to itself, which makes it impossible to use the tool anymore.

Well it looks like I continue to be one of the most file upload challenged members in LAVA. I see I have yet again forgot to include a file. :oops:

The file that is missing is called “FIX SUBVI.vi” and is the one that is you are suppose to see in the tools menu. It's main function is to remove the toolbars and scroll bars from the Main vi as well as call it.

I have seen the problem where the main keeps bringing focus to itself. I put a quick and dirty fix in the “Active VI_Get Active VI From Global.vi”.

post-584-1193293428.png?width=400

By renaming the Main you disabled my fix and the problem returned.

Here is my new and improved fix.

post-584-1193293457.png?width=400

Here is Version 4 it has the fixes above plus some icon cleanup.

post-18176-0-02849000-1351286878_thumb.p

post-18176-0-73588200-1351287213.png

Link to comment

QUOTE(mballa @ Oct 25 2007, 08:32 AM)

I'm shure it will! :yes:

QUOTE(mballa @ Oct 25 2007, 08:32 AM)

By renaming the Main you disabled my fix and the problem returned.

:headbang: Oh yeah! I like this kind of problems :)

QUOTE(mballa @ Oct 25 2007, 08:32 AM)

Yes, this one works nicely, but I'm sorry to say that I found two more little things that should be fixed.

In _FIXER Subvis Main.vi there should be a "This VI" reference at the beginning. Without this, I always get error 1026.

http://lavag.org/old_files/monthly_10_2007/post-7932-1193296538.png' target="_blank">post-7932-1193296538.png?width=400

The OpenG SubVI was designed very carefully. If you don't wire a reference to it's input, it opens it's own reference and makes shure it is closed again at the end of the VI.

Also there is still a breakpoint in the engine, that gets hit everytime I use the "Set as Required" button.

Looking at your code, one question comes to my mind: What exactly does the method "FP.Set Close If Lonely" do?

Link to comment

QUOTE(silmaril @ Oct 25 2007, 02:25 AM)

Yes, this one works nicely, but I'm sorry to say that I found two more little things that should be fixed.

In _FIXER Subvis Main.vi there should be a "This VI" reference at the beginning. Without this, I always get error 1026.

post-7932-1193296538.png?width=400

The OpenG SubVI was designed very carefully. If you don't wire a reference to it's input, it opens it's own reference and makes shure it is closed again at the end of the VI.

Ok I fixed this problem by sequencing the FP State Property before the OpenG vi.

QUOTE(silmaril @ Oct 25 2007, 02:25 AM)

fixed for the next rev

QUOTE(silmaril @ Oct 25 2007, 02:25 AM)

Looking at your code, one question comes to my mind: What exactly does the method "FP.Set Close If Lonely" do?

This is a scripting node that will setup the vi to close if it is the only vi opened.

I now relalize that it is not doing what was indended. Because the FIX SUBVI.vi and the _FIXER Subvis Main.vi are setup to both be opened and running I always have at least two vis opened.

I will add this to the fixit list.

Thanks a lot for the feedback and keep it comming.

LAVA ROCKS

Mark

Link to comment

QUOTE(Aristos Queue @ Oct 23 2007, 11:36 PM)

LabVIEW classes should generally get the same treatment. When there are multiple classes on the same conpane, each with an "in" and an "out" terminal, the preference should be if the VI is owned by a given class then that class gets preferential treatment for being in the upper left and upper right. Otherwise, mimic the panel layout.

If I have a reference to a class control what is the best method to determine what it's class name is? The property and invoke nodes don't seem to have any way to extract class information.

Link to comment
QUOTE(mballa @ Oct 27 2007, 09:19 PM)
I posted VIs to do exactly this just a couple weeks ago. See the thread in the GOOP forum.QUOTE(mballa @ Oct 25 2007, 11:17 AM)

This is a scripting node that will setup the vi to close if it is the only vi opened.I now relalize that it is not doing what was indended. Because the FIX SUBVI.vi and the _FIXER Subvis Main.vi are setup to both be opened and running I always have at least two vis opened.

"Close If Lonely" checks for VIs that are not "Close If Lonely". If the only VIs that are open are all marked as Close If Lonely, then all those VIs will close. It requires a sociable VI to keep the lonely VIs company.I can't check the code right at the moment, but I recall that an open project window will serve to keep a lonely VI company, too.

Link to comment

QUOTE(Aristos Queue @ Oct 28 2007, 09:48 AM)

The "Is This Control Of This LabVIEW Class" would be useful If I had a way to take a reference to a LabVIEW Object control and extract the LVClass Refnum out of it Any recommendations on how best to do this?

F.Y.I. In 8.5 I have tried several ways to create a LabVIEWClassControl Ref Control and every method seems to crash LabVIEW. I also tried them in 8.2 and they work fine.

Create control,

post-584-1193636799.png?width=400

Create SubVI,

post-584-1193636818.png?width=400

Select Class

post-584-1193636850.png?width=400

I briefly checked the LAVA bug list and 8.5 known issues list and didn't see this problem.

I will file a bug report this week when I get time.

QUOTE(Aristos Queue @ Oct 28 2007, 09:48 AM)

"Close If Lonely" checks for VIs that are not "Close If Lonely". If the only VIs that are open are all marked as Close If Lonely, then all those VIs will close. It requires a sociable VI to keep the lonely VIs company.I can't check the code right at the moment, but I recall that an open project window will serve to keep a lonely VI company, too.

Thanks for the clarification, I added the "Close if lonely" node in the Caller and they both shut down when no other "sociable" vis are present.

Link to comment

QUOTE(mballa @ Oct 29 2007, 12:59 AM)

The "Is This Control Of This LabVIEW Class" would be useful If I had a way to take a reference to a LabVIEW Object control and extract the LVClass Refnum out of it Any recommendations on how best to do this?

Post the conpane of a VI that has the inputs/outputs that would be most useful to you and I'll see if I can put something together.

Link to comment
Link to comment

I haven't been following all the posts so forgive me if this has been mentioned already. One use-case I have is when using the "create sub-VI" function. I don't know about y'all but this feature sucks b***s. Issues:

  • LabVIEW gives you a con-pane that matches exactly the number of inputs and outputs you have. For example, if you have 2 inputs and 2 outputs it gives you a con-pane with 4 terminals. I would like to see a standard con-pane and it use only some of the inputs and outputs.
  • If you have an error in and an error out I would like it to position the error in and error out in the right place AND name the error in to "Error IN" NOT something stupid like error out.

So perhaps this cleanup tool in progress can run automatically after a "create sub-VI" action or something? Like a "disconnect all and reconnect correctly" function.

Link to comment

QUOTE(Michael_Aivaliotis @ Oct 30 2007, 10:35 PM)

I totally agree and this is one the top reasons why I started this tool.

QUOTE(Michael_Aivaliotis @ Oct 30 2007, 10:35 PM)

If you have an error in and an error out I would like it to position the error in and error out in the right place

I'm currently working on a function that searches selected FP items for matching pairs and applies wiring rules to them.

QUOTE(Michael_Aivaliotis @ Oct 30 2007, 10:35 PM)

In the settings of the fixer you can apply prefixes and suffixes to controls or indicators. It's an all or nothing setting though so if you set indicators to use a prefix of "Out" then all indicators will be set that way.

QUOTE(Michael_Aivaliotis @ Oct 30 2007, 10:35 PM)

So perhaps this cleanup tool in progress can run automatically after a "create sub-VI" action or something? Like a "disconnect all and reconnect correctly" function.

I like it.

Any Idea how to detect when the "create sub-VI" function has been called?

Link to comment

I've made enough improvements to make it worth posting the latest version 5.

Here is the list of improvements from version 4

  • Change FP Layout
  • Fixed the close if lonely problem. The fixer should now close if it is the only vi running.
  • Improved the Active VI detection. In ver 4 you had to click on a vi while the fixer FP was opened for it to find it. Now its keeps track in the background.
  • Added a recommended button. Since you can now set LabVIEW to make all input required by default this function is needed.
  • The hot keys to popup the Main FP can now be set in the settings window. Default is still Ctrl-Shift-Spacebar.

LV 8.5

LV8.2

Thanks again for all the feedback and ideas.

Link to comment

QUOTE(mballa @ Oct 29 2007, 09:02 AM)

the "Qualified Name Out" indicator is the one that I Need the most.

I posted new versions of the tools on the ni.com page. Download the new VIs and see if the pieces you need are now available. I redid the block diagrams so that more was un-password proteced.

I don't think there's any way to get an LVClass Refnum in LabVIEW other than the app methods Open or Create, but perhaps what I've exposed for you will get you enough from the class names.

Link to comment

QUOTE(Robbie Gehbauer @ Nov 5 2007, 03:04 PM)

Actually, that VI is in the palettes. It's in the Cluster, Class, & Variant palette.

The inverse of that VI is in the palettes -- the one that goes from path to class. The one that goes from class to path is not in the palettes.

[One of the dangers of working with unreleased versions of LV; can anyone guess what will be in the palettes in the next release? :-) ]

Link to comment

QUOTE(Aristos Queue @ Nov 5 2007, 02:58 PM)

Thanks for finding this for me.

I've been playing with the "GetLVClassInfo.vi" and there is an indicator I need clarified.

What is the "Fully Qualified LV Class Name" represent and why is it an array. eveything I've tried so far will only output one item in the array which is the class name. In what circumstances will I see more than on item?

Link to comment

QUOTE(mballa @ Nov 6 2007, 09:36 AM)

What is the "Fully Qualified LV Class Name" represent and why is it an array. eveything I've tried so far will only output one item in the array which is the class name. In what circumstances will I see more than on item?

That's explained in the description of the VI that converts from array to flat string.

Link to comment
  • 2 months later...

QUOTE(PJM_labview @ Oct 17 2007, 05:46 PM)

1) I hardly ever have controls on my FP that I do not want to connect to the connector pane.

2) Best attempt at connection will do the following (in order of priority):

3) If there are controls/indicators I don't want to connect, I am not sure what the best approach is. Maybe if the controls/indicators are not in the visible window frame, it should not be connected (yes I think I like this).

PJM

OK PJM this one is for you.

I've implemented a pairs matching and wiring program. Using Aristos' program

I was able to create a program to categorize controls and indicators so they could be compared to each other.

If two items match and one is a control and the other an indicator they are paired up and placed in a pairs array.

All items that do not match up are placed in a controls or indicator array.

Starting with the pairs array the program gets the highest item in a priority and tries to find it the array.

When the array item is found it is wired to the connector pain according to a wiring list.

When all the pairs are wired, the program moves on to the single controls array and then to the single indicators.

So for most FP arrangements it's down to three button presses. "Select All", "By Pairs" , "Arrange and Cleanup"

You will only have to move the controls or indicators that are in the wrong place.

After starting the Fixer and creating a subvi do the following.

1: Select a control or indicator on the FP of the vi to fix

2: Bring up the SubVI fixer. Ctrl-Shift-Space (default)

3: Press the "Select All Controls" button to select all controls on the FP

4: Press the "By Pairs" button to automatically wire the FP items.

5: If the connection to the connector pain are not to your liking move the out or place ones to the correct location and press the "By Arangement" button

6: When all connection are good press the "Arrange & Cleanup" button to finish.

Here are a couple of videos to demonstrate.

Download File:post-584-1199684719.swf

I would like to have people test this and see if it is stable and works for most programmers. The priority list may not be what every one likes. So if you open the

_Subvis for FIXER\Pairs\Pairs_Catagory Priority Array.vi you will see instructions on how to change the wiring priority.

post-584-1199684903.png?width=400

Other added features

Have FP center in monitor 1 on startup

Added Max FP size setting in the Settings panel.

Last folder selected to save in is remembered and is used

next time. (Needs Testing)

Here is the newest version. Just as a reminder to place the 3 items in your National Instruments\LabVIEW 8.5\project\ folder. Open LabVIEW and call the "FIX SUBVI" item from the tools menu. Press Ctrl-Shift-SpaceBar to have the fixer popup.

Download File:post-584-1199685943.zip Download File:post-584-1199686110.zip

QUOTE(Aristos Queue @ Oct 23 2007, 10:36 PM)

QUOTE(Michael_Aivaliotis @ Oct 30 2007, 10:35 PM)

So perhaps this cleanup tool in progress can run automatically after a "create sub-VI" action or something? Like a "disconnect all and reconnect correctly" function.

I'll work on these next.

Thanks again everyone for your Ideas, Code and Inspiration.

Please keep your Comments, Suggestions, and Critiques coming.

Mark.

Link to comment
  • 10 months later...

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.