09-15-2019 10:03 AM
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?
Solved! Go to Solution.
09-15-2019 11:23 AM
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 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.
09-15-2019 10:08 PM
09-15-2019 11:15 PM
09-16-2019 01:11 AM
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。
09-16-2019 05:59 AM
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.
09-16-2019 08:35 AM
" 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 .