LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Script to Change All Input Terminals in a Project to Required

Solved!
Go to solution

Just wondering if someone has something like this in their arsenal already. My projects aren't huge at all, maybe 100 VIs in the bigger ones. So it wouldn't be toooooo terribly bad to go through each VI and do them one terminal at a time, but yeah. I want to make all the terminals required in a lot of VIs and figured I'd ask if someone had this.

 

And of course, a tool like this would ignore error terminals.

 

Side note: I was today years old when I learned that the option to make input terminals required by default, ignores error terminals. It's not anywhere in the help or documentation. 😭

Redhawk
Test Engineer at Moog Inc.

Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.

0 Kudos
Message 1 of 6
(1,365 Views)

This seems to work, at least on the one VI I tried it on. I left optional connectors alone as they have probably been set that way on purpose.

 

Set Conn Pane Recommended to Required.png

 

(LV 2017)

 

Message 2 of 6
(1,313 Views)

@StevenD wrote:

This seems to work, at least on the one VI I tried it on. I left optional connectors alone as they have probably been set that way on purpose.


Hey Steven,

 

I'm getting error 1055 at the first ConPane property node. I did do a bit of Googling to see what I could find but I'm stuck... And since I'm a noob at VI scripting and know almost nothing about it, I'm really stuck.

 

I modified the VI a bit to take a root path and take every VI in root path and perform the action on all of them. That is more what I wanted. Or take a path to a project file and perform the action on every VI in project, if my way won't work for some reason.

 

Any help is greatly appreciated.

Redhawk
Test Engineer at Moog Inc.

Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.

0 Kudos
Message 3 of 6
(1,291 Views)
Solution
Accepted by topic author FireFist-Redhawk

I admonish my cow-orkers for making their block diagrams unnecessarily complicated (and for their bad icons (worse than yours).  Here's how I would do it:

wr.png

"If you weren't supposed to push it, it wouldn't be a button."
Message 4 of 6
(1,280 Views)

@FireFist-Redhawk wrote:

@StevenD wrote:

This seems to work, at least on the one VI I tried it on. I left optional connectors alone as they have probably been set that way on purpose.


Hey Steven,

 

I'm getting error 1055 at the first ConPane property node. I did do a bit of Googling to see what I could find but I'm stuck... And since I'm a noob at VI scripting and know almost nothing about it, I'm really stuck.

 

I modified the VI a bit to take a root path and take every VI in root path and perform the action on all of them. That is more what I wanted. Or take a path to a project file and perform the action on every VI in project, if my way won't work for some reason.

 

Any help is greatly appreciated.


Use my code.  Steven's code closes the VI reference before he tries to use the ConPane reference.  But closing the VI ref also closes refs to all GObjects owned by the VI (such as the ConPane Ref); so it's invalid before he tries to use it.

"If you weren't supposed to push it, it wouldn't be a button."
Message 5 of 6
(1,277 Views)

@paul_cardinale wrote:

I admonish my cow-orkers for making their block diagrams unnecessarily complicated (and for their bad icons (worse than yours).  Here's how I would do it:

wr.png


Thanks a bunch Paul. I wrapped it in this and it does exactly what I wanted:

FireFist-Redhawk_0-1598623098775.png

 

Redhawk
Test Engineer at Moog Inc.

Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.

0 Kudos
Message 6 of 6
(1,269 Views)