NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Batchmodel: How to use different switch-positions for DUTs?

Solved!
Go to solution

Hello,

i am using the NI Batchmodel for three DUTs. The current DUT-number can be read out from RunState.TestSockets.MyIndex.

May batch has three duts. What is the NI-way to use different switchings (NI-SwitchExec) for each dut?

Testplan is for example

Configure DMM

Set Switch

Measure

Clear Switch.

 

The Switching is of course different for each DUT.

Do i really have do add a if-statement around each switching (=endless work) or is there a easy way that i currently dont see?

 

if (RunState.TestSockets.MyIndex == 0)

Set Switch for DUT1

else if (RunState.TestSockets.MyIndex == 1)

Set Switch for DUT2

else if (RunState.TestSockets.MyIndex == 2)

Set Switch for DUT3

else

end

 

Thanks for tips

 

best regards

OO

0 Kudos
Message 1 of 8
(4,069 Views)
How many different switch positions do you have? You could create arrays for each and use the MyIndex to get the correct one for each test in a thread. If you increase the number of UUTs, you don't need to modify any if statements, just change the arrays that are initialized at the beginning.
Message 2 of 8
(4,064 Views)

Hi Dennis,

this is also a good idea. I only have three DUTs. You mean i put the three switchings in an array and then use the array in the "Routes to connect"-expression -> SwitchArray001[MyIndex].

The only problem is then that i have somewhere (FileGlobals) >100 arrays with switch-positions what makes the testplan not very readable.

Instead of the if/then/else i can also use three nonadapter-actions with preconditons for each DUT. Then it can be direct seen what is switched.

 

0 Kudos
Message 3 of 8
(4,061 Views)
I know you have three DUTs. You already said that. What you ave not said is how many different switch positions you have for each DUT. That is what I asked. For an example, Test1 array with 3 elements, Test2 array with 3 elements, etc.

Preconditions will work too. Same as if/then statements.

I've done it both ways. The readability of either can be solved with property documentation.
0 Kudos
Message 4 of 8
(4,055 Views)
Solution
Accepted by topic author OnlyOne

I wouldn't use either of the precondition or If stuff.... It's too much work and I'm lazy.

 

I would simply use the built in step switching:

http://zone.ni.com/reference/en-XX/help/370404G-01/nise/teststand/

 

Name your routegroups in Switch Executive to match your socket numbers.

 

For instance in Route(s) to Connect: box you can have the following expression:

"SigGenToUUT" + Str(RunState.TestSocket.MyIndex)

 

And have a route that goes from the signal generator to the UUT named SigGenToUUT0.  It would be for the UUT in socket 0.

 

Just a thought!

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 5 of 8
(4,053 Views)
That's even better. I've seldom had switches that I could use with switch exec and I was not aware of the route naming feature. Very cool.
Message 6 of 8
(4,045 Views)

HI ~jiggawax~,

great idea. Thanks.

 

 

0 Kudos
Message 7 of 8
(4,025 Views)
I do exactly what jiggawax said...and it works great
CLAD, CTD
Message 8 of 8
(4,010 Views)