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.
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.
02-14-2013 11:45 AM
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?
02-14-2013 11:56 AM
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.
02-14-2013 11:59 AM
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?
02-14-2013 12:01 PM
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?
02-14-2013 12:22 PM
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.
02-14-2013 12:28 PM
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.
02-14-2013 12:39 PM
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.
02-14-2013 01:53 PM
Post an example of what you want the end result to be and I'll try to show you what to do.
02-14-2013 02:09 PM
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
02-14-2013 02:27 PM
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.