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.
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.
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
How and why our assumptions work
A more complex/powerful example
In the above videos, you'll see the Scripting Springboard (Attachmentcripting.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
I can see an obvious convergence between LVSpeak and these simple scripting snippets...
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.
I prefer to make all things SmashySmashy... is that a technical term? because I love it and am going to start using it.
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.
"Do right - because you should always do right"
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.
Very straight forward, practical examples. Thanks!
(Big Brother hasn't blocked screencast.com yet, so I can actually see them)
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.
(I would appreciate it if you used this to make the springboard and BDMinion available to LV 8.2 and 8.5)
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 ;-)
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.
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!
*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
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.