LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to change tunnel mode using vi scripting

Solved!
Go to solution

Hi guys,i use vi script to create new objects ,when connect wire from for loop inside to outside ,the default tunnel mode is indexing,if right click on tunnel and you can change it to last value or concatenating,but how to change it use method node or property node,i use New VI Objects  get for loop reference,use property node Tunnels[],after index tunnels[] ,use property node or method node,not find how to change tunnel mode,is anyone know which is the right way?

0 Kudos
Message 1 of 7
(3,642 Views)

Looks like you need a "Loop Tunnel", not just a "Tunnel".

If you're sure what you have is a reference to a Loop Tunnel, you can probably use To More Specific Class to get a Loop Tunnel reference.

Example with Loop TunnelExample with Loop Tunnel

Here you can see I can change the IndexMode of a Loop Tunnel. The same is not available with a Property Node for a generic Tunnel.


GCentral
0 Kudos
Message 2 of 7
(3,613 Views)
Hi cbutcher, thanks for your suggest,i can change tunnel mode by script,but when use New Vi Object to create a new tunnel ,what is the Style terminal value?
0 Kudos
Message 3 of 7
(3,569 Views)

So I tried your VI and I think there is a problem where you select "Other" as the target.

Change Target to "BD"Change Target to "BD"

Is this what you meant?


GCentral
0 Kudos
Message 4 of 7
(3,556 Views)

no,this is not my mean,i want use New Vi Object function,but  don't know Style value when Class is LoopTunnel.

look at style value.png ,run this vi will generate a error,because Style value is not match Class specifier constant。

0 Kudos
Message 5 of 7
(3,539 Views)
Solution
Accepted by topic author gsm174

I tried for a while but I can't work out how to do this.

The LoopTunnel class is not a "Node" or "Control", so perhaps it doesn't have a "style". In that case, I imagine it might not be possible to create using the "New VI Object" function.

You might have better luck trying to wire through the loop and then getting a reference to the created tunnel, but I am also not sure how you'd do that...

 

Sorry I couldn't be more helpful.


GCentral
0 Kudos
Message 6 of 7
(3,501 Views)

" The LoopTunnel class is not a "Node" or "Control", so perhaps it doesn't have a "style" " you are right, only GObject:Node ,GObject:Scale,have property Style,GObject:Control have property Style ID.

    according to your advice,i use another way to complete.

  all option use New Vi Object,Property Node and Method Node

1. create ForLoop ,connect Loop Count N;

2. create Build Array ;

3. create Constant;

4. move Build Array and Constant to ForLoop,connect Constant and Build Array;

5. create Array Controls on FP;

6. connect Array Controls and Build Array on BD, this will generate a tunnel on forloop ,the default indexmode value is 1;

7. ***use Open Vi Object Reference and Traverse for Gobjects to get LoopTunnel reference ,use To More Specific Class get LoopTunnel reference;***

8. use property change IndexMode .

class have style.png

Message 7 of 7
(3,479 Views)