NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

change step parameters in teststand edit mode

Hello,

 

I would like to know if it's possible to change the parameters in a step in edit mode of teststand.

I have attached a sequence with one step, in this step I want to select DMMx.

After the selection I want to teststand to fill in the parameters in the step so I can the choose which type of measurement and such.

 

If this is not possible how could I make something like this possible.

 

As you may see this will be a HAL, and the only option I can see which would do this is bij a string array but I don't want to type in the commands in string.

Download All
0 Kudos
Message 1 of 6
(5,058 Views)

Hi Darkxceed

 

My recommendation for doing a HAL i TestStand would be to use an object oriented approach. 

 

Create a class hirachy of your instruments like the following inside of LabVIEW:

HAL.PNG

 

 

 

Then use Dynamic Dispatch to make TestStand choose the instrument of interest. There is an example of using Dynamic Dispatching in TestStand here:

 

TestStand Using LabVIEW OOP Truck Example

https://decibel.ni.com/content/docs/DOC-24098

 

 

This solution will offcourse require you to read up on creating applications using object oriented programming in LabVIEW. We at NI have a course that walks you through both the theory and practical implementation. It is called Object Oriented Programming in LabVIEW. If you have a SSP agreement, you should be able to find it as Self Paced Online Training as a part of your contract.

 

There is also a good introduction to OOP in LabVIEW and HAL here:

https://decibel.ni.com/content/docs/DOC-32506

(There is a video embedded in the PDF)

 

 

Best Regards

Anders Rohde | CLD | Platinum Applications Engineer | National Instruments Denmark

0 Kudos
Message 2 of 6
(5,028 Views)

Hi Rohde,

 

Thank you very much for the links, my question still remains, but I don't think it's possible.

 

We have already ordered the LVOOP course we have also SSP.

 

What would be best to do, make the HAL in labview, Teststand will then call one main HAL VI, this VI will be class build in OO.

Or let teststand run the classes, I don't have any experience in the use classes in teststand, maybe you could advise me so I can focus on that.

 

And thanks again for the links they really helped me.

 

 

0 Kudos
Message 3 of 6
(5,014 Views)

I would personally use the Factory Pattern design pattern in LabVIEW to control which classes to load and then have it linked up to an enum in TestStand like you have. Difference is that we only would need 1 enum to initialize the class and then dynamic dispatching would give us the rest.I think that gives you a more native interface even though the opposit solution of initializing the class from TestStand like they do in my linked example is also possible. 

 

In regards to your original question I don't think it will be possible to change them. I know that you can access them and read them out but before being able to do this, even if you are accessing them from a seperate sequence file or labview vi it will still require you to load in the TestStand step and LabVIEW module into the memory by using the Step.Module.LoadPrototype() function, and if you do that accessing the Parameter information using LabVIEWModule.Parameters will be read only. So I believe you can only read their values and not write to them.

 

Best Regards

Anders Rohde 

 

 

0 Kudos
Message 4 of 6
(4,986 Views)

Hello Anders,

 

Factory pattern design is new for me, I saw that it was very advanced to learn, do you know a good starting point? 

https://decibel.ni.com/content/docs/DOC-13724 is what I'm look at now to understand it.

 

I have made a project where some classes are made, the wrapper.vi will build an array with the class links.

This way I can build a set of instruments which are connected to the PC.

 

When I want to set the DMM I can search which DMM to use, if there a more then 1 DMM's connected, en use config and measure classes to make measurements with that DMM.

 

gr,

0 Kudos
Message 5 of 6
(4,960 Views)

Looks good.

 

You already implemented the Factory Pattern in the code you send me:

 

Factory Pattern.PNG

 

So basically the factory pattern describes "loading in" different classes with the same ancestor on a wire. That is what you are doing here. 

 

Some people extend the factory pattern a bit and then instead of loading in a class from memory (as you do in the case structure) they also load in classes from a path on the drive. 

 

Factory_Pattern.png

 

The value coming out of the To More Specirfic Class in this case is then just the same as what is coming out of your case structure, and could I.e. be used on the commond DMM class with the Measure function.

 

 

Best Regards

Anders Rohde | CLD | Platinum Applications Engineer | National Instruments Denmark

0 Kudos
Message 6 of 6
(4,928 Views)