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.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use different switchpositions in batch-model

Solved!
Go to solution

Hello,

i have a batchmodel that executes a testplan with 4 batches.

How can i use different switch-positions (NI SwitchExec) for each batch?

Is there a variable that i can readout that returns the current batch-number so that i can use a simple "if"

 

if (x.batchnr ==1)

     locals.switch = "POS1"

else if (x.batchnr ==2)

     locals.switch = "POS2"

else if (x.batchnr ==3)

     locals.switch = "POS3"

else if (x.batchnr ==4)

    locals.switch = "POS4"

 

and then use locals.switch as exepression in "Routes to connect".

 

Or how is this typically done?

 

Thx & BR

TM

0 Kudos
Message 1 of 3
(3,474 Views)
Solution
Accepted by topic author OnlyOne

Solved:

Simply had to put everything in a subsequence and set StepProperty "Synchronisation" to Serial.

 

0 Kudos
Message 2 of 3
(3,468 Views)

The current Batchnumber is stored in: RunState.TestSockets.MyIndex

 

0 Kudos
Message 3 of 3
(3,458 Views)