NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

I'm worried about my way of doing things in Teststand [OOP] [Beginner]

Solved!
Go to solution

I'm a Teststand beginner and I'm evaluating the software. I would like to get some feedback on my approach and see if others have familiarity with this. 

 

Project: 

Test N UUTs in a climate chamber. 

 

Hardware: 

Power supply, relay matrix, network switches, etc. 

All parts use the Ethernet protocol for communication. 

 

Software: 

LabView, Powershell + Teststand

 

Question: 

I do prefer to make the program as simple as possible and similar to what is looks like in the real world. In labview I create a lib for each component of the test station. PSModelNumber.llb for powersupply, a llb for the climate chamber. etc. 

 

Inside the llb there is one class. 

PowerSupply.llb: 

---QXP2100.lvclass

----create.vi

----destory.vi

----method1.vi 

----....

 

In Teststand (Setup section), I call the PowerSupply.llb->QXP2100.lvclass->create.vi and save the object reference which is returned by create.vi as Locals.foo. 

Now I can call any method of the QXP2100 class (in the Main section) and set the Locals.foo as input argument of that method. 

At the Clean up section I can then destroy the instance. 

 

I have one object reference for each hardware of the test platform. I even create N instances of the UUT class for each UUT (Batch model). The UUT class contains functions which can be executed on the UUT. It works good for my simple tests! But I have to do more complicated procedures. 

 

What is your opinion?  Do other Teststand developers do it this way? 

 

 

0 Kudos
Message 1 of 2
(2,158 Views)
Solution
Accepted by topic author Heartbeat

Hi Aan,

 

Your approach sounds pretty solid. There is a lot more you can do on the OOP side of things (inheritance, hardware abstraction layers, etc), but I recon that you are aware of that.

A lot of it is personal taste anyway.

 

About TestStand:

If you create/destroy your object in the Setup/Cleanup of your main VI, it will execute those steps for every UUT you are testing.

Instruments you typically want to initialize only once per test cycle and keep the reference open while testing several UUTs (this is simply much faster).

I would add a ProcessSetup and ProcessCleanup callback to your sequence and move most of your setup/cleanup there. Then your objects are only created once for all tested UUTs. This means that you will also need to move your object reference variables out of Locals and for example in FileGlobals.

 

FYI: You can quite easily understand where those callbacks are executed if you open one of the ProcessModels (like sequential or batch) and have a look at the TestUUTs entry point.

Andreas
CLA, CTA
0 Kudos
Message 2 of 2
(2,105 Views)