Hi @adorno, your diagram appears to be readily supported by OpenTAP; open resources once, execute as many plan runs as needed, then finally close resources. Maybe I’m missing something, what makes you say this doesn’t fit into the OpenTAP flow?
Oh, I think I see it. You want to Open the DUT every plan run, but only open Instruments once at the beginning. Am I understanding correctly?
In my own OpenTAP implementation, I don’t do any physical operations on the DUT while resources are opening. All DUT powering up/down etc happens in the test plan via test steps.
What if you did something like this?
Move most/all the code currently in your DUT.Open and DUT.Close functions to new functions DUT.Init and DUT.DeInit.
Make a test step that calls DUT.Init, put it at the beginning of your test plan.
Make a test step that calls DUT.DeInit, put it at the end of your test plan.
So now the DUT will be initialized whenever a plan run starts, instead of when resources open.
This is just my 2 cents, I’m sure there are multiple ways to accomplish this. I’d love to hear others weigh in on how they’d approach it.
Thank you for your answer, let me quickly explain it a litte bit more:
I have some instruments like flash adapter, printers, switches, dmms, etc. and some of them are sensitive.
For example the flash adapter USB init should be done only once and then flash as many products as possible. If I would init the USB Adapter and deinit it, every product I would flash, It is time consuming and somtimes the USB interface would hang up.
I aggree with you, too. I could move the DUT init/deinit to tests. But can I disable the Instuments opening, during a testplan run and tell him manually to open and close or how could I put this to practice?
In my C# program (Operator Interface) where I want to use the tesplans in the production floor.
Somehow like this:
Testplan.Load
Testplan Init Instruments
->–Execute Testplan in a loop (~120x) --------------------------|
|--------------------------<---------------------------------------<-----|
Deinit Instruments
You can use the TestPlan.Open/TestPlan.Close feature.
When you “open” the test plan it will connect all the needed resources. And then by the end you can close them again.
This feature enables you to run the test plan multiple times without waiting for resources in between.
Of course, in your case this requires the DUT to be hot-swappable, but you can move the logic from Dut.Open/Dut.Close to the test plan as @david-wsd suggests.
I’m debugging at the moment the packages and the testplans in the TUI. Is there a way in TUI to enable or disable the intrument opening/closing - like Pathwave?
Maybe you have only been calling TestPlan.Run, in which case resources will automatically Open, the TestPlan will run, and then resources will automatically Close. But this isn’t the behavior you want.
Instead, you can first call TestPlan.Open (as @rolf_madsen said). That will allow you to call TestPlan.Run as many times as you want, and there will be no automatic calls to Open or Close. The resources will stay open until you call TestPlan.Close (presumably after you’ve tested all your DUTs).