NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Set StepProperties from ActiveX Call

Solved!
Go to solution

Hello,

I am trying to programmatically set the StepProperties limits of steps in my sequence, from within a VI operating on the TestStand ActiveX API.

 

I realize that I am reproducing functionality included in the Property Loader steps, this is intentional. Suffice to say the Property loader does not quite work for what I am reading in.

 

I can set or create locals (replicating the in TestStand "ThisContext.RunState.Sequence.Locals.SetValString("foo")")

 

with the following code: Set Locals.png

 

But, what I am trying to replicate is setting a StepProperty : "RunState.Sequence.Main['StepName'].Result.Measurement["Measurement 0"].Limits

 

Can I perform this via ActiveX Call, as above? I can't seem to find the right path of properties and methods to access it, as Sequence>>Main does not then contain Results or a SelectStep method. I am unsure as to the correponding item to insert the ["StepName"] as above as well.

 

Thanks,

Mello


Data Science Automation

CTA, CLA, CLED
SHAZAM!
0 Kudos
Message 1 of 5
(3,203 Views)
Solution
Accepted by Mellobuck

After installing TestStand, you should have "TestStand" palette of VIs in LabVIEW which include Get Property Value, Set Property Value, and a number of other handy API wrappers. I would recommend using those - use something like "Locals.VariableName" as the lookup string.

 

Are you working with a custom step type? That lookup string won't work on any NI step type that I know of. In any case, you can use the Set Property Value with a lookup string and TestStand does all the heavy lifting for you, e.g. RunState.Sequence.Main["Numeric Limit Test"].Limits.Low or RunState.Sequence.Main["Numeric Limit Test"].Limits.High for any normal numeric limit test.

Message 2 of 5
(3,198 Views)

Just in case you are curious, it can be done.    One engineer we have here does not like to use the Property Loader, so I went through the process of making a VI act like the property loader.  Although, I don't use these as I think the Property loader is much easier.

 

Here is an example of setting the limits for a Numeric Limit Test, where the Limit Data is passed in as an input.  The lower part of the attached picture is the SubVI labeled Write Limits.    The key is apparently to get the StepName and then the PropertyObject of the step.

 

Thanks,


PH

Message 3 of 5
(3,192 Views)

RE: asbo, the step I was setting was the Multiple Numeric Limit Test, which keeps its limits in a different location than several other steps. I think I was over-thinking the ActiveX calls and looking right past the Get and Set Property functions on the TestStand Palette.

 

Re: Teds, that was exactly what I was looking for, it is about 50/50 which of the two methods I use. I think yours fits in my mind better. My motivation is to expand beyond the file types the property loader inherently uses.

 

Thank you both, I give Kudos with great appreciation.


Data Science Automation

CTA, CLA, CLED
SHAZAM!
0 Kudos
Message 4 of 5
(3,189 Views)

 


@Mellobuck wrote:

RE: asbo, the step I was setting was the Multiple Numeric Limit Test, which keeps its limits in a different location than several other steps. I think I was over-thinking the ActiveX calls and looking right past the Get and Set Property functions on the TestStand Palette.


 

Ahh, guess I've never dug through the properties for MNLTs. To be honest, I started out over-thinking it too, and then I realized the error of my ways 🙂

 

Thanks for the snippet, Teds, that's going in the stash 😉

0 Kudos
Message 5 of 5
(3,184 Views)