LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Scripting: Set connector pane – error 1 if source terminals are connected

Solved!
Go to solution

This is probably a simple question but...

 

I try to set connector pane to newly created VI using existing VI as template (source). If terminals of the source are not connected, no problem occurs. If any terminal of the source is connected to any control or indicator, error 1 is launched.

 

The error cluster contains string:

"Property Node (arg 1) in Script_NewVI_example.vi

<APPEND>

Property Name: <b>Connector Pane:Set</b>"

 

While Explain Error windows says more usual:

"Error 1 occurred at Property Node (arg 1) in Script_NewVI_example.vi

Possible reason(s):

LabVIEW:  An input parameter is invalid. For example if the input is a path, the path might contain a character not allowed by the OS such as ? or @.

Property Name: Connector Pane:Set"

 

170907.gif

 

What do I do wrong?

How can I copy terminal pattern from source VI with terminals connected?

 

Thank you

_____________________________________
www.azinterface.net - Interface-based multiple inheritance for LabVIEW OOP
0 Kudos
Message 1 of 5
(3,486 Views)

I'm not sure how that property would work. Settings the connector pane seems to be not very useful, as there is no way to tell LabVIEW which controls\indicators should be connected to the CP. And in this case there are none. How can LV set a Boolean on the CP if there is no Boolean on the FP?

 

My guess is this property only can be set if the CP itself stays the same, and only some attributes of the CP have changed (like Wiring rules). Maybe it will also work when you change CP from let's say 4X4X4 to 5X6X5 connectors. This will also be unambiguous and therefor it seems to work (in your case the 4X4X4 CP is changed to a CP you don't really want to use).

 

I think it might be a bit more difficult that you think.

 

You need to get the VI's CP reference. Set the correct pattern. From the reference you can get an array of control refs, and an array of Wiring rules. The refs and rules will be all invalid. These you can get, modify and set to your desire. This isn't that hard, but it's usually a bit of pure LV administration.

0 Kudos
Message 2 of 5
(3,458 Views)
Solution
Accepted by topic author _Y_

Thank you, wiebe@CARYA!

 

Unfortunately, I do not understand how SetConPane works but your hints provide great help to create functional code. This is the solution:

 

170907solution.gif

_____________________________________
www.azinterface.net - Interface-based multiple inheritance for LabVIEW OOP
0 Kudos
Message 3 of 5
(3,440 Views)

I was slightly off here. Glad it helped anyway.

 

The Controls[] property is read only. But I don't know where you get SetConPane from.

 

You already have a reference to the CP (ConPane.Ref).

 

To wire a control to the CP, can use the method "Assign Control To Terminal" It takes a control reference, and a terminal ID. The terminal ID's are a bit weird (starting from right bottom to top left). If you turn on the scripting help options, you'll see the terminal ID's in the help (for connected terminals).

 

Then you can use the Wiring Rules property so make inputs required\optional\dynamic dispatch.

Message 4 of 5
(3,429 Views)

Thank you wiebe@CARYA,

 

SetConPane is available when property is selected for VI Property Node:

Connector Pane > Set

 

I do not know how should it be used correctly. It is interesting but not in my high priority list (thanks to your hints Smiley Happy)

_____________________________________
www.azinterface.net - Interface-based multiple inheritance for LabVIEW OOP
0 Kudos
Message 5 of 5
(3,411 Views)