07-17-2012 06:44 AM
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).
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.
Solved! Go to Solution.
07-24-2012 04:13 AM
I happen to stumble on the document below which might be helpful.
07-24-2012 05:30 AM
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
07-24-2012 09:04 AM
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,
07-24-2012 09:51 AM
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?
07-24-2012 10:17 AM
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,
07-25-2012 03:21 AM
Nice one, found it.
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?
07-25-2012 09:36 AM
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,
07-26-2012 03:03 AM
Understood. Is that sort of thing defined somewhere, or is it a case of trawling the API?
07-26-2012 10:20 AM - edited 07-26-2012 10:20 AM
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.