Jump to content
Sign in to follow this  
David Boyd

A Utility I Wrote Last Summer...

Recommended Posts

OK, since it seems someone's taken the lid off the undocumented stuff (at least partially), I'll share a little utility I wrote last summer.

Have you ever added another shift register to the while loop of your state machine, then cursed while adding default thru-wires across sixteeen of the seventeen cases? This has happened to me a few more times than I care to admit, so I wrote the attached little gem. I called it 'Tunnel Wiring Wizard' for lack of a better name. It's a floating tool that will autowire all the unwired cases after you highlight the left and right case tunnels and push the button.

I recommend that you drop it into your 'Projects' folder so it'll show up on your 'Tools' menu.

I'd be curious to know if anyone finds this useful.... I'm leaving the diagram locked for now, sorry.

Dave

Download File:post-29-1080058291.vi

Share this post


Link to post
Share on other sites

David,

Nice :thumbup:

It would also be nice if this supported the case "Selector Terminal" in addition to "regular" tunnel sources.

Cheers,

-Jim

Share this post


Link to post
Share on other sites
David,

Nice  :thumbup:

It would also be nice if this supported the case "Selector Terminal" in addition to "regular" tunnel sources.

Cheers,

-Jim

Jim,

Just did a quick test and it does support the case selector terminal on my LV7.0 installation. What does the status box say when you select the case selector and an output terminal?

:unsure: Dave

Share this post


Link to post
Share on other sites
Just did a quick test and it does support the case selector terminal on my LV7.0 installation.  What does the status box say when you select the case selector and an output terminal?

OK, it does work. In my test the output tunnel's type was not defined -- it didn't have a source, from at least one frame of the case structure.

Share this post


Link to post
Share on other sites

Hi everyone,this gives me a deep insight with labview.I really want to know how to get the object and vi's refnums that with foucs as the vi above did,so i can write a vi to operate with the block diagram.(Sorry for my bad english,and best regards to everyone!)

Share this post


Link to post
Share on other sites
Hi everyone,this gives me a deep insight with labview.I really want to know how to get the object and vi's refnums that with foucs as the vi above did,so i can write a vi to operate with the block diagram.(Sorry for my bad english,and best regards to everyone!)

1256[/snapback]

Take a look at this posting.

Share this post


Link to post
Share on other sites
Take a look at this posting.

1263[/snapback]

I have see this post before,but what puzzles me most is how to get the refnum specified to a certain object.For example,the nodes you selected in a block diagram or the vi's block diagram of which you are editing,how to get their refnums in another vi dynamicly.Only with this i can write a tool-vi to help programming when i am "drawing" with lv block diagram. :lightbulb:

Share this post


Link to post
Share on other sites

Awesome! Works great!

With LV 7E I normally wire up a few that I use and set the rest of the outputs to return a default value. But this guy will DEFINITELY come in handy.

I'm so glad I found this board. :D

Share this post


Link to post
Share on other sites
I have see this post before,but what puzzles me most is how to get the refnum specified to a certain object.For example,the nodes you selected in a block diagram or the vi's block diagram of which you are editing,how to get their refnums in another vi dynamicly.Only with this i can write a tool-vi to help programming when i am "drawing" with lv block diagram. :lightbulb:

1267[/snapback]

Nil

Look at the attached image.

PJM

Note: NI "fixed" [read: re-password protect] most of the exposed VI in LV7.1. So you might have to download one of the example post on this board (if you are using LV7.1) to get at some of the scripting function

post-121-1091199500.png?width=400

Share this post


Link to post
Share on other sites

Hi,PJM_labview

Thank for your help.It solved some of my problems,but how to get those refnums in another vi as Tunnel_Wiring_Wizard.vi does?Just to run Tunnel_Wiring_Wizard.vi ,select tunnels in another vi,then your can operate on its block diagram(need not to specific the target vi by its path or name manually)

Hope i don not waste your too much time.Regards

Share this post


Link to post
Share on other sites
I recommend that you drop it into your 'Projects' folder so it'll show up on your 'Tools' menu.

573[/snapback]

Since I don't have a 'Projects' folder ('project' ?) and the 'Tools' menu is very unlike the VI palettes that can have icons added to them, what exactly is this in reference to?

Share this post


Link to post
Share on other sites
Since I don't have a 'Projects' folder ('project' ?) and the 'Tools' menu is very unlike the VI palettes that can have icons added to them, what exactly is this in reference to?

2339[/snapback]

What it mean is that if you copy the utility in LVROOT\Project\Tunnel_Wiring_Wizard.vi ; next time you restart labview it will shows up in under your tool menu (note: LVROOT is most of the time on windows machine C:\Program Files\National Instruments\LabVIEW x.x\)

PJM

Share this post


Link to post
Share on other sites
Since I don't have a 'Projects' folder ('project' ?) and the 'Tools' menu is very unlike the VI palettes that can have icons added to them, what exactly is this in reference to?

2339[/snapback]

This is in reference to this folder:

C:\Program Files\National Instruments\LabVIEW 7.1\project

If you put a VI on that folder, the next time LV launches, it will load it in your Tools menu in your LV development environment. It will show up as an item in that menu for easy access.

Share this post


Link to post
Share on other sites
This is in reference to this folder:

C:\Program Files\National Instruments\LabVIEW 7.1\project

If you put a VI on that folder, the next time LV launches, it will load it in your Tools menu in your LV development environment. It will show up as an item in that menu for easy access.

2342[/snapback]

I thought I tried this as one of several things and couldn't get it working, but it works now... thanks.

I was also wondering if it might be helpful to have a list of directory functionality for LabVIEW in the FAQ (since I was looking for something of the sort and couldn't find it). Like put a VI here, it shows up on the Tools menu, put a VI here, it shows up on the FP palette, BD palette, etc.

Share this post


Link to post
Share on other sites

Thanks David Boyd,

very usefull nice tool. :thumbup:

I can't count how often i missed them...

Could you compile it in LV6.1? :unsure:

Beause a lot of projects are still running in 6.1?

Thanks

Oliver

Share this post


Link to post
Share on other sites
Yes I second that, please post LabView 6.1 version.

4593[/snapback]

This won't work. Some of the functionality needed for this is not available in LabVIEW 6.1. More correctly it is there but returns an "unimplemented" error code.

Rolf Kalbermatter

Share this post


Link to post
Share on other sites

I noticed that this utility doesn't work with LV 8.0. Most likely, NI changed the scripting behavior.

David, any chance that you can investigate??

Share this post


Link to post
Share on other sites
I noticed that this utility doesn't work with LV 8.0. Most likely, NI changed the scripting behavior.

David, any chance that you can investigate??

my guess is: he can not, because ne needs the "BlockDiagram" refrence, which throws an exception in LV 8 :throwpc:

Share this post


Link to post
Share on other sites
my guess is: he can not, because ne needs the "BlockDiagram" refrence, which throws an exception in LV 8 :throwpc:

Actually, it can be done!

I really love this utility. It's very useful while working with any state machine code, including LabHSM, my toolkit for

advanced event-driven programming in LabVIEW with hierarchical state machines and active objects.

Well, I guess, the author, David Boyd is just too busy to update it, and I needed it for LabVIEW 8 ASAP.

Initially it was password-protected, but last October David posted an unlocked version:

http://forums.lavausergroup.org/index.php?...findpost&p=6736

So, I had a chance to update it myself (I hope David won't mind).

I am actually surprised that nobody has done it yet. It turned out to be not that much of incompatibility:

NI has changed the class ID number for the tunnels, plus, with multiple application instances in LV 8 now,

you gotta make sure you use the correct one, especially when running this utility from Tools menu

(place it into the "<LabVIEW>\project").

It's still made in LV 7.0 for the largest compatibility but works in all LV versions released after 7.0, including 8.0.

So, keep enjoying it, folks, now in LabVIEW 8 too (in case you haven't modified it yourself yet, of course)!

I hope this post will save the hour or two for the other people who use this utility.

Thanks to Paul Sullivan (SULLutions.com) for correcting the path definition in the code to make it platform independent and to Lars Mellberg for pointing out a situation in which the initial version of this update didn't work.

You can also download it directly from the LabHSM site:

http://labhsm.com/Tunnel_Wiring_Wizard_LV8OK.vi

With Best Regards,

Stanislav Rumega

H View Labs

http://labhsm.com

Download File:post-1166-1139410933.vi

Share this post


Link to post
Share on other sites

I posted this to Info-LabVIEW, but for the sake of reaching the widest audience:

A very big THANK YOU (SPASIBO BALSHOYE!) to Stan for putting the effort into making this work under LV8. (And my apologies for not doing it myself - I had a beta copy of 8 ages ago, and never tried the TWW under it, what was I thinking??)

And while we're talking about classIDs changing, here's one for the wishlist: it would be very handy if it were possible to wire a class specifier constant (the little green/yellow tag) to a property node and have it give you the classID value. Currently, the property node returns an error 1055, Object reference is invalid (of course) and default data (zero) for the classID. This would have saved me from having to use numeric constants for the class testing. Of course, I could have tried to test-cast the generic refnum to each class of interest, and handle the error case - but I chose not to do that. (Who knew that classID values were going to change with a new release? I assumed, incorrectly, that they would just be adding new values for new classes).

Thanks again to Stan and Paul Sullivan! :worship:

Dave

Share this post


Link to post
Share on other sites
...

It's still made in LV 7.0 for the largest compatibility but works in all LV versions released after 7.0, including 8.0.

So, keep enjoying it, folks, now in LabVIEW 8 too (in case you haven't modified it yourself yet, of course)!

I hope this post will save the hour or two for the other people who use this utility.

...With Best Regards,

Stanislav Rumega

H View Labs

http://labhsm.com

I hate to be the bearer of bad news, but I can't open the previous unlocked vi as I'm told that it's saved in LV7.1 and I have LV7.0

Sorry,

Chris

Share this post


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.

Sign in to follow this  

×
×
  • Create New...

Important Information

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