NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How can Teststand have Switch Executive dynamically change a route.

I have created routes in Switch Executive and when I try to connect these routes thru Teststand via Action Properties under the Switching Tab.  I get an error saying:
 
Details:A reserved for routing channel required for connecting this route is already in use by another route.(Error = -29031) [Error Code: -17500, Operation Failed.]
 
I am trying to connect two different routes by the following syntax in the "Routes to Connect"  section:
 
"Route1 & Route2"
 
It seems that in Switch Executive Route1 and Route2 are both using the same reserved for routing paths.  For example:
 
Route1:      [C0->MatrixA/r1->C2]
Route2:      [C1->MatrixA/r1->C5]
 
So my question is then...How can Teststand make Switch Executive change the route path?  I have r0, r1, r2, and r3 set as reserved for routing.  Thanks for your help.
 
 
0 Kudos
Message 1 of 4
(3,078 Views)

Hello Guy04,

I think what you want to do in this case is add a step to check the availability of a route before choosing the route. This can be done with a switch command such as niSwitch_CanConnect. Then based on what this function returns, you could select a route in switch executive. So it would be analogous to a case structure in LabVIEW (if you're a LabVIEW programmer). I hope this helps you out. Have a good one!

Tyler S

0 Kudos
Message 2 of 4
(3,061 Views)
I think that there are a couple of approaches to this problem besides the one that Tyler mentioned above that might work better for your situation.
 
1.  Instead of using a route name, you can let NI Switch Executive (NISE) find the route dynamically by specifying the endpoints.  The syntax for this is "channelA->channelB" (notice the lack of square brackets).  This tells NISE to find a route between channelA and channelB and connect them if there's a route available.
 
2.  As an extension of #1, you can also use teststand expressions in that field.  You might be able to leverage some local variables, some setup params, or the socket index to help build up this string dynamically.
 
0 Kudos
Message 3 of 4
(3,053 Views)
Thanks for your help.
 
For situation 1: 
When I use this method Switch Executive dynamically chooses a route but its always the same route.   What I need to do is have a set of pins that use only one route and another set of pins that uses a different set of routes.  You can think of it as c1 is one lead of a multimeter and c2 is the other lead.  I need to be able to connect c1 on any other column besides c2 and also c2 to be able to connect to any other pin besides c1.  Since in Teststand I need to connect c1 and c2 simultaneously as a step I get an error because both are trying to use the same route.
 
Also when I change the route from: 
                                                          channelA->matrix/r0->channelB
                                                     to: channelA->matrix/r1->channelB,
then when I save and close Switch Executive and I reopen it the channels automatically routes itself back to channelA->matrix/r0->channelB.
 
Is there any way that I can save these routes to my configured route?
 
0 Kudos
Message 4 of 4
(3,037 Views)