From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

what style for tunnel object class?

I amusing LabView scripting to create and populate a case structure.  It is nearly done.  Each case is populated with the code I want.  My final step is to make a tunnel on the case structure.

 

I go to create a new VI object and select the Tunnel object class.  However, I have no idea what 'style' to select from the long list of objects (no, tunnel is not one of the options).  Any help?

0 Kudos
Message 1 of 11
(2,805 Views)

You do not need to create the tunnel, you simply connect the wires.  You can use the Connect Wires method of the case structure to do what you want.  I assume you want a tunnel which stubs on the case structure, otherwise simply connect the wire directly from the source to the destination, LV will handle creating all of the needed tunnels if the objects are on different diagrams.

0 Kudos
Message 2 of 11
(2,800 Views)

I don't think that applies here...I don't have 2 things (yet) to connect together.

 

I'm looking to programmatically create a case structure with an input tunnel.  I will connect logic inside the case structure to the tunnel using connect wires method...but there's no tunnel until I create one.  Does that make sense?

0 Kudos
Message 3 of 11
(2,795 Views)

In other words, if you are recommending the connect wires method, as you know it expects two arguments...the parent reference and the wire source.  In my case, one of them would be the terminal of the logic inside the case structure that I want to connect to...what would the other be?

0 Kudos
Message 4 of 11
(2,792 Views)

The Connect Wires method accepts one argument (the parent is implied by the object you are invoking the method on).  That is why I mentioned that you can use the Connect Wires method of the case structure.  The wire source is whatever terminal you want to connect to the outside of the Case Structure. 

 

This is tricky, the tunnel location can be a bit odd.  You then have to find the created tunnel and move it somewhere else.

 

When I run into problems like this I usually ask myself if I can start from a template VI and then use scripting to modify a few elements.  Often the answer is yes.

0 Kudos
Message 5 of 11
(2,769 Views)

I see...in my case though, there is no terminal outside of the case structure.  The end result of this VI will be to produce a case structure that I can then cut and paste into another VI, where I will then connect up the outside of the tunnel.  So I was looking for a way to create the tunnel and wire the inside of the tunnel to the logic inside the case statement.

 

Maybe I could simply create an external object and follow your method, then when I cut and paste, simply exclude that object.

0 Kudos
Message 6 of 11
(2,766 Views)

I must not be making myself clear.  If you take your reference to the Case Structure, invoke the Connect Wires method on it, and supply the terminal you want to have connected inside (or outside) you will create a tunnel and it will be connected.  It will also be broken if it is an input.

0 Kudos
Message 7 of 11
(2,762 Views)

Post an example of what you want the end result to be and I'll try to show you what to do.

0 Kudos
Message 8 of 11
(2,742 Views)

ok thank you...I've attached a pic that shows what I'm looking for...note that:

- there is only 1 tunnel on each case

- each case has the same subVI

- the input of the subVI always connects to that same tunnel - I've only shown one case in the pic, but they all look the same

 

I have attached 2 pics, one showing what I want, the other showing the relevant section of the code.

 

By the way I am still curious, if you happen to know, what style is compatible with the Tunnel VI oject class.

 

Thanks

Download All
0 Kudos
Message 9 of 11
(2,738 Views)

Just to be clear...I started this code by modifying this example that creates case structs from an array:

https://decibel.ni.com/content/docs/DOC-22703

 

So in the pictures that I posted, where I wrote the comment 'VI panel reference...', that wire is connected to the output of the Case Structure New VI Object function in the picture at the link above.

0 Kudos
Message 10 of 11
(2,729 Views)