bulk creation of controls and indicators.pdf

Upload: texasranger770

Post on 03-Jun-2018

214 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/12/2019 Bulk Creation of Controls and Indicators.pdf

    1/3

    My experiences coding with National Instruments' LabVIEW programming language

    Posted by Darren Nattingerat 12:54 AM

    Bulk Creation of Controls and Indicators

    In my previous blog post, Jason commentedthat it would be nice to have a utility that will create

    controls and indicators on diagram objects in bulk. I thought that was a good idea, and I decided to

    write a VI that gets us pretty darn close...it's not quite a right-click option, but it's as close as I can get

    without getting a C-monkey to modify the LabVIEW source code for me, and without having plug-in

    VIsyet.

    So put this VIin[LabVIEW 8.6]\projectand restart LabVIEW. You'll now have a Tools > Create

    Controls and Indicatorsmenu option. Select a few block diagram objects, then choose this menu

    option. It will create controls and indicators for any terminals of the selected object(s) that aren't

    already wired to something. This transaction is undoable/redoable as well.

    I hope this VI is useful to people. I also had another motive for writing it, but you'll have to wait until

    my next blog post to find out what that was.

    10 comments:

    antoine.chalons March 5, 2009 at 3:20 AM

    nice !

    do you really have to hide the block diagram ? :(

    Reply

    antoine.chalons March 5, 2009 at 3:27 AM

    and could you make a version that only creates the "required" inputs.

    and as a continuation, add the possibility to set an output terminal as "required" (to enforce

    error handling that would be cool), this was dicussed some time ago on LAVA :-o

    Reply

    Anonymous March 5, 2009 at 10:02 AM

    NICE WORK DARREN!!! *tear*

    -Jason

    Reply

    Anonymous March 5, 2009 at 11:32 AM

    Very cool.

    Could you create a LV 8.5 version???

    Jaegen

    Reply

    Phil March 5, 2009 at 12:19 PM

    I haven't tried the code, but isn't what you're decribing already coded into LabVIEW as

    IEW Artisan: Bulk Creation of Controls and Indicators http://labviewartisan.blogspot.in/2009/03/bulk-creation-of-controls

    12-Dec-13

  • 8/12/2019 Bulk Creation of Controls and Indicators.pdf

    2/3

    "Create SubVI"?

    Reply

    Darren Nattinger March 5, 2009 at 12:33 PM

    Antoine: Sorry, any VIs I post with scripting must be password-protected, since the feature is

    still considered internal. We're investigating ways to make it more accessible.

    Jaegen: I posted a version saved in 8.0 on the NI Forums: http://forums.ni.com/ni/board

    /message?board.id=170&view=by_date_ascending&message.id=392086#M392086

    Phil: This utility helps when you have one or more objects on the diagram with multiple

    unwired terminals, and you want to create controls and indicators for those terminals. It's

    mainly useful for debugging, like passing values into a function/subVI and examining the

    outputs. Create SubVI is mainly useful when you have a bunch of stuff already wired up and

    you want to turn it into a subVI.

    Reply

    Anonymous March 5, 2009 at 4:10 PM

    D-

    Speaking of Create SubVI... Is there an INI token to have the default pattern set to 12

    terminals? You mentioned a token for setting the default pattern for new VIs for folks using

    older versions of LabVIEW.

    (It would be great if Create SubVI would also wire the error clusters in the bottom terminals

    and auto run "Cleanup" -- I'll file suggestions for those.)

    Aside: You mentioned LabVIEW Scripting. What exactly is this? Do you use G or ...

    -Jason

    Reply

    Darren Nattinger March 5, 2009 at 4:16 PM

    Jason: There is currently no way to assign a default connector pane pattern to VIs created

    with Create SubVI...I've certainly requested that feature be added a number of times, though!

    LabVIEW Scripting is an internal feature that gives you a G interface to interrogating,

    creating, and modifying VIs. Some enterprising users on lavag.org have discovered some of

    its secrets...you can learn more there for the time being.

    Reply

    Anonymous March 12, 2009 at 7:59 AM

    D-

    Thanks for the explanations.

    I've added my voice to yours with the following product suggestion (posting it here in case

    there folks who want to join us):

    Create SubVI: I almost never use this function... but it could be so nice!

    Imagine being able to develop code on the mainVI diagram, check functionality in line, and

    quickly generate a subVI. We're so close with "Create SubVI", but in 7 years, I've never really

    used it. May I suggest a few tweaks?

    1) Use default connector pane (12 terminals)

    2) If there are error clusters, wire them to the bottom terminals.

    3) If there are error clusters, auto create a case structure and put the code in the No Error

    case. Wire the error cluster through the Error case.

    4) If there are in and out references (e.g. File In, File Out), wire these to the top terminals.

    5) Run Clean Up Diagram.

    IEW Artisan: Bulk Creation of Controls and Indicators http://labviewartisan.blogspot.in/2009/03/bulk-creation-of-controls

    12-Dec-13

  • 8/12/2019 Bulk Creation of Controls and Indicators.pdf

    3/3

    Subscribe to: Post Comments (Atom)

    IEW Artisan: Bulk Creation of Controls and Indicators http://labviewartisan.blogspot.in/2009/03/bulk-creation-of-controls

    12-Dec-13