LabVIEW APIs Blog

Community Browser
cancel
Showing results for 
Search instead for 
Did you mean: 

Re: Automating LabVIEW Development with the Scripting Springboard

NJKirchner
Active Participant

One of the great things about scripting is how darn easy it is to automate some tedious tasks in the process of developing code.

Typically the tasks we want to accomplish deal with multiple objects.

  • Creating references to multiple selected controls
  • Turning the text on multiple controls to bold
  • Getting the description of multiple selected subVIs

But where do you start?

The Fewest Possible Assumptions.

It's the case of Ockham's razor.

You make a few simple, but broad sweeping, assumptions that allow you to, very quickly, make very functional scripting code.

Example:

You want to change the text style of a bunch of string controls to bold.

Assumption, only string controls are selected on the front panel

Getting started with the Scripting Springboard

VIDEO: http://screencast.com/t/0EeTrMCHA


How and why our assumptions work

VIDEO: http://screencast.com/t/uUdxLrqj

A more complex/powerful example

VIDEO: http://screencast.com/t/TPhnxfIy5

In the above videos, you'll see the Scripting Springboard (Attachment:Scripting.vit) and how easy it is to create an extension to your LV development that utilizes scripting.


Where to go from here?

Download the Scripting.vit and keep it in a handy place.

When you're in LabVIEW and you run into an action that is taking you too long to do and you'll need to do over and over again, use the springboard and get over that wall quickly.

BDMinion in action

VIDEO: http://screencast.com/t/EwrLYzeFEsJ

Download All
Comments
francois-normandin
Member

I can see an obvious convergence between LVSpeak and these simple scripting snippets...

GCentral ChampionCLA
NJKirchner
Active Participant

Exactly.

It is true that you can make an entire ADE assistant that is simply an entire palette of floater helper commands, but over time that window of buttons would grow large and unmanageable.

But even if you were to make hot-keys to each of those commands that you came up with, it would still be a difficult thing to remember 26+ hot key combinations (let alone fit them on the keyboard)

Also the JKI Right-Click-Framework might be able to tackle some of these things as well, but is limited to having some context to right click on.

The minute that you allow speech into the fold to execute a command, you gain all the power of something like the JKI RCF, or Quick Drop et al, and very few of the drawbacks that happen when the list of commands gets very lengthy.

eek
NI Employee (retired)

I prefer to make all things SmashySmashy... is that a technical term? because I love it and am going to start using it.

BuddyHaun
Member

Added one more case to BDMinion.vi. Set "IconView?" to false on the CtrlTerm property to easily rid my block diagrams of all those pesky terminals set to "View as Icon" that I keep receiving from other programmers in my group. Next on the agenda is a stealth program to add FancyFPTerms=False to all their LabVIEW.ini files.

Buddy Haun
Certified Trainer, Former Alliance Member, LabVIEW Champion
crelf
Trusted Enthusiast

"Do right - because you should always do right"





Copyright © 2004-2023 Christopher G. Relf. Some Rights Reserved. This posting is licensed under a Creative Commons Attribution 2.5 License.
NJKirchner
Active Participant

I was wondering if anyone was going to catch that.

At least I know now that y'all watched the videos.

and heck, if that's the only comment from the man CRelf himslef, then I suppose there were no blaring ommisions.

~,~

seeker169
Member

Very straight forward, practical examples.  Thanks!

(Big Brother hasn't blocked screencast.com yet, so I can actually see them)

Cat

Kamocat
Member

Awesome!

Now all I need is a script to back-save them to 8.5.

EDIT: I didn't realize that this feature was available through property nodes before scripting was released.  Anyways, here 'tis.

http://kamocat.com/archived/backsave.vi.zip

(I would appreciate it if you used this to make the springboard and BDMinion available to LV 8.2 and 8.5)

Marshal Horn
JoeC
Member

Great job on the scripting tools.  This will come in handy for adding comments to items that don't have comments...  Not that I would do such a thing  😉

crelf
Trusted Enthusiast

There's an excellent selection of scripting modules on the LAVA Code Respository here.  I'd suggest anyone just getting started have a look at that, as it shows how to use some of the less intuative scripting methods.





Copyright © 2004-2023 Christopher G. Relf. Some Rights Reserved. This posting is licensed under a Creative Commons Attribution 2.5 License.
Scott.Menjoulet
Member

I see you've polished off SpeakInG ( ) quite a bit.  I guess Crelf will need update his lyrics.  Does that drive your co-workers crazy?

"Smashy Smashy" - Love it!

crelf
Trusted Enthusiast

*sigh* actually, it's something that my coworkers like to use to drive me crazy - occassionally it'll be played during a meeting, launched by a reuse library component, play as a rigtone - it's our version of being rickrolled





Copyright © 2004-2023 Christopher G. Relf. Some Rights Reserved. This posting is licensed under a Creative Commons Attribution 2.5 License.
NJKirchner
Active Participant

Smashy smashy is just the start.

I'm trying to figure out the command that will invoke the process of taking a sub-vi and sucking it in-line with a set of API calls with the error and reference wires .....hmmmm.... what could I call it.... think .... think.

Donald.Troendle@kodak.com
Member

Hi All,

I have just viewed “Getting started with the scripting springboard” video.

During the video the demonstrator seems to pull the “String Refnum, To More Specific Class, & Property Node” out of thin air. Is there a short cut for pulling in this code that I am not aware of? It took me some time to recreate the demo. Re-doing all of my vi's with  "Smashy Smashy" very Cool.