LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Script connect existing loose wires to case tunnels

Solved!
Go to solution

I'm exploring a scripting tool to clone case structure cases from one case structure to another. It's part of a bigger vision, and for this requirement I've made good progress but right now I'm stuck on one final step - how to connect loose wires to case tunnels using scripting?

 

In the below example, the left hand "Source" VI has a case structure identical to that in the right hand "Dest" VI, except the source case structure has an additional case called "Receive_Number". I can create a new case in the Dest Case Structure, name it and then copy the contents of the Source case into the Dest case, resulting in the snapshot below. What I can't figure out is how to wire those existing loose wires to the tunnel terminals?

 

I can replace them easily enough and then LabVIEW chooses it's own routings, but I need them to be exactly the same so I wish to keep them and connect their ends to the tunnels. I can't find a way to use the method "Connect Wire" on those wires, only on nodes and terminals.

 

Has anyone worked with the scripting of existing wires?

 

 

Thoric_0-1638529181201.png

 

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 1 of 9
(2,735 Views)

What happens when you just wire the existing connected terminal of the wire to the tunnel?

(Is auto routing turned off?)

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 2 of 9
(2,695 Views)
Solution
Accepted by Thoric

You can read the Joints[] property of the broken wire to get the coordinates of all the bends, then you can delete the broken wire, and re-create it with those same bend coordinates with the Create Described Wire method.

 

I don't know of any other way to do what you're asking.

Message 3 of 9
(2,687 Views)

Thank you Darren, I hadn't yet discovered the Create Described Wire method. That sounds perfect! I'll report back when I've tried this on Monday 😀


 

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 4 of 9
(2,681 Views)

Hi Paul,

My question is a scripting question, I can't 'just join the wires'. I'm looking to do this programmatically. Thanks for pitching in though 😀

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 5 of 9
(2,679 Views)

@Thoric wrote:

Hi Paul,

My question is a scripting question, I can't 'just join the wires'. I'm looking to do this programmatically. Thanks for pitching in though 😀


Yes, I realized it was a scripting question.  I'll reword my response:

What happens when you just script connecting the wire's existing connected terminal of the tunnel?

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 6 of 9
(2,661 Views)

@paul_cardinale wrote:

@Thoric wrote:

Hi Paul,

My question is a scripting question, I can't 'just join the wires'. I'm looking to do this programmatically. Thanks for pitching in though 😀


Yes, I realized it was a scripting question.  I'll reword my response:

What happens when you just script connecting the wire's existing connected terminal of the tunnel?


You get an error:

Thoric_0-1638659149975.png

 

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 7 of 9
(2,583 Views)

@Darren wrote:

You can read the Joints[] property of the broken wire to get the coordinates of all the bends, then you can delete the broken wire, and re-create it with those same bend coordinates with the Create Described Wire method.

 

I don't know of any other way to do what you're asking.


Thanks Darren, works perfectly.

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 8 of 9
(2,582 Views)

@Thoric wrote:

@paul_cardinale wrote:

@Thoric wrote:

Hi Paul,

My question is a scripting question, I can't 'just join the wires'. I'm looking to do this programmatically. Thanks for pitching in though 😀


Yes, I realized it was a scripting question.  I'll reword my response:

What happens when you just script connecting the wire's existing connected terminal of the tunnel?


You get an error:

Thoric_0-1638659149975.png

 


OK, let me try again.

What happens when you just script connecting the wire's existing connected terminal of the appropriate terminal of the tunnel?

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 9 of 9
(2,460 Views)