NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

SQL database reports and batch testing

Solved!
Go to solution

I am trying to run a batch test with Test Stand 2019 but I cannot get four separate reports for each of my UUTs.  The model Plugin that I am using works for a single UUT but not for multiple.  The section that is failing is Model Plugin-Batch Start.

Ken188_0-1729883838280.png

I am getting this error:

Ken188_1-1729883916300.png

I do not know what array it is referring to.  It might be RunState.TestSockets.MyIndex but I do not know.  I do not know how to convert this to a batch test. 

 

0 Kudos
Message 1 of 6
(228 Views)

The callback "Model Plugin - Batch Start" is called from the Batch model once from the batch controlling execution, and not from the individual batch test socket executions, so the value of "RunState.TestSockets.MyIndex" is -1 as the error suggests and the "Parameters.ModelPlugin.PluginSpecific.RuntimeVariables.PerSocket" array size starts at 0 and is TestSockets-1. If your code needs to setup a separate database per socket, you will need to loop on the said step equal to the number in RunState.TestSockets.Count.

 

 

Scott Richardson
https://testeract.com
Message 2 of 6
(207 Views)

Thank you for the reply.  I am relatively new to test stand. 

So, I would need to create a for loop in the Setup to run the function "Setup SQLite Database FileName" the same number of times that is equal to the number of sockets that I have which is 4?

 

Would I need to change any of my expression:

Locals.SQLitePath = "[" + #NoValidation(Mid(Parameters.ProcessModelClientPath, Find(Parameters.ProcessModelClientPath, "\\", 0, False, True) + 1)) +"][" + Date() + "][" + Time() + "]["
+ Parameters.UUT.SerialNumber + "]["
+ RunState.Sequence.Parameters.UUT.BatchSerialNumber + "].db",
Locals.SQLitePath = SearchAndReplace(Locals.SQLitePath,"/", " "),
Locals.SQLitePath = SearchAndReplace(Locals.SQLitePath,":", " "),
Locals.SQLitePath = Parameters.ModelPlugin.PluginSpecific.Options.SQLite_ResultsDirectory + Locals.SQLitePath,
Parameters.ModelPlugin.PluginSpecific.RuntimeVariables.PerSocket[RunState.TestSockets.MyIndex].SQLite_ReportPath = Locals.SQLitePath

0 Kudos
Message 3 of 6
(171 Views)

I added the for loop to the setup to run as many as RunState.TestSockets.Count however it is still failing for the same reason.

Ken188_0-1730124249829.png

Would I need to put a lock/unlock on the "main" due to it being a batch test to make sure one runs at a time?

0 Kudos
Message 4 of 6
(164 Views)
Solution
Accepted by Ken188

I think I got it to work.  I had to change "RunState.TestSockets.MyIndex to "Parameters.UUT.TestSocketIndex" and put a for loop around my setup and my main.

Ken188_0-1730130438717.png

 

0 Kudos
Message 5 of 6
(149 Views)

@Ken188 wrote:

I added the for loop to the setup to run as many as RunState.TestSockets.Count however it is still failing for the same reason.

 


You have the exact same error message?  If you have the same error message, please note that you cannot use RunState.TestSockets.MyIndex during Model Plugins - Batch Start. If your error is different, then please post the new error details.

 

Edit:  Looks like you corrected your issue before I had finished my post.

0 Kudos
Message 6 of 6
(143 Views)