NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Equivalent to Step.Limits.Low.NumericFormat in TestStand 3.1?

Solved!
Go to solution

I am looking to set the Limit Numeric Format property (for individual steps) programmatically through the TestStand API.  The link below seems to be talking about the property I need to set (Step.Limits.Low.NumericFormat). 

 

http://forums.ni.com/t5/NI-TestStand/How-can-I-tell-that-a-default-numeric-format-has-been-applied-t...

 

Unfortunately on my TestStand 3.1 system, the property doesn't exist (or doesn't work as Raj suggests in the post).  Everything is fine on my TS 4.2.1 system.

 

Does anyone know the name/location of the property in TS 3.1.  It must exist as it is possible to modify the display format of limits in TS 3.1.  I guess it may not be possible to interact with it through the API which would be a shame.

 

Regards

 

Steve

0 Kudos
Message 1 of 23
(5,305 Views)

Hi Steve,

 

I happen to stumble on the document below which might be helpful.

http://zone.ni.com/devzone/cda/epd/p/id/5967

 

Regards,

Shalini B
Applications Engineer
National Instruments UK & Ireland
0 Kudos
Message 2 of 23
(5,264 Views)

Hi Shalini

 

Thanks for your post.  It was helpful but I am not quite there.

 

If I export a single NumericLimitTest step Step.Limits into LimitLoader format, I get the following:

 

<Step Name> Limits
Numeric Limit Test <Prop Name='Limits' Type='Obj'><Prop Name='Low' Type='Number' NumFmt='%#x'><Value>9</Value></Prop><Prop Name='High' Type='Number' NumFmt='%#x'><Value>11</Value></Prop><Prop Name='LowExpr' Type='String' TypeName='Expression'><Value></Value></Prop><Prop Name='HighExpr' Type='String' TypeName='Expression'><Value></Value></Prop><Prop Name='UseLowExpr' Type='Boolean'><Value>False</Value></Prop><Prop Name='UseHighExpr' Type='Boolean'><Value>False</Value></Prop></Prop>

<Locals> Variable Value

<FileGlobals> Variable Value

<StationGlobals> Variable Value

 

So it is the value of 'NumFmt' that I need to set, and the value I need to set it to is '%#x'.......but I am not sure what 'NumFmt' is; it is not a property, it is associated with Limits.Low (and Limits.High), but it isn't a sub property of Limits.Low as Limits.Low is defined as a Number.

 

I can successfully import the NumFmt of Limits.Low (using the LimitLoader) in TS 3.1,  but I am missing one last clue defining how it is done in the API

 

Regards

 

Steve.

0 Kudos
Message 3 of 23
(5,258 Views)

TestStand 3.1 does not support API calls in expressions (I think that feature was added in TestStand 4.0). You need to use an ActiveX step instead. You can use an ActiveX step configured to call into PropertyObject.NumericLimit and call it on Limits.Low of the step you wish to set the property on.

 

Hope this helps,

-Doug

0 Kudos
Message 4 of 23
(5,255 Views)

Hi Doug

 

Thanks for your response.

 

I should clarify, I am running a LabVIEW App, which generates TestStand Test Sequences.  I am making calls to the TestStand API through LabVIEW only (see attached), no TestStand is running.

 

Sorry but I have been attempting to decipher your post 'PropertyObject.NumericLimit and call it on Limits.Low of the step you wish to set the property on' and I can't work it out.  Any chance of a picture/example?

 

Regards

 

Steve

 

 

 

 

0 Kudos
Message 5 of 23
(5,251 Views)
Solution
Accepted by topic author SercoSteveB

What exactly are you doing in TestStand 4.2.1 that is not working in 3.1? I think the API for setting the NumericFormat has been there for a very long time and should exist in 3.1.

 

Call GetPropertyObject on the step.aspropertyobject reference and from the result of that use a propertyinvoke node to set the numericformat property.

 

Hope this helps,

-Doug

Message 6 of 23
(5,248 Views)

Hi Doug

 

Nice one, found it.

 

NumericFormat.JPG

 

As a little aside and because I am still feeling slightly behind the curve; can anyone explain why the above works but the following returns an error?

 

NumericFormat2.JPG

 

Many Thanks

 

Steve

0 Kudos
Message 7 of 23
(5,231 Views)

NumericFormat is not a PropertyObject, it's a setting on a PropertyObject. The lookupstring is for accessing subproperties, not settings of subproperties.

 

Hope this helps clarify things,

-Doug

0 Kudos
Message 8 of 23
(5,222 Views)

Understood.  Is that sort of thing defined somewhere, or is it a case of trawling the API?

0 Kudos
Message 9 of 23
(5,214 Views)

The subproperties of a step are defined by the step type which is something a user can customize and create so there are not a fixed set of these. You can see which ones exist in the variables view when selecting a step. For API properties you can check the help file. Look for the PropertyObject interface help and it will list all of the methods and properties of the interface. These methods and properties are not subproperties, they are APIs to a particular subproperty that the PropertyObject interface applies to.

 

-Doug

Message 10 of 23
(5,210 Views)