NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the names of sequence parameters with TestStand API?

Hi,

I want to generate a list with all my sequence files, the names of all sequences inside and all the specified parameters of each sequence. I already managed to get all the sequence names using the 'name' and the 'numsequences' properties of sequencefile object. Using the 'parameters' property of the the sequence object returns a 'propertyobject' and i don't know how to
use for extracting name, comment and type of each parameter.
I use the TestStand API with VB6!

I there anyone who could give me a hint?

Regards,
Sunny
0 Kudos
Message 1 of 4
(5,192 Views)
Using the property object you can use GetValNumber, GetValString ect. You use the named property and it returns what you're looking for. Attached is the sequence context ".bmp" showing the named property location of the information you're looking for. In order to get a picture I had to use "NextStep" while you're running the sequence you can get the information directly from "Step".

GetValString Method

Syntax

PropertyObject.GetValString( lookupString, options)

Return Type

String

Purpose

Returns the string value of the property specified by the lookupString parameter.

Remarks

For numeric properties, calling this method with the PropOption_CoerceFromNumber option does not localize the resulting string. Use GetFormattedValue to get
a localized string for a number.

Return Value

String value of the property.

Parameter Type Description
lookupString String Pass an empty string to denote the PropertyObject to which the method applies, or pass the name of a subproperty within the PropertyObject. See lookupString for more details.
options Long Pass 0 to specify the default behavior, or pass one or more PropertyOptions constants. Use the bitwise-OR operator to specify multiple options.
Example

LabWindows/CVI:

char *stringVal = NULL;

TS_PropertyGetValString(propObj, &errorInfo, "Step.Limits.String",
0, &stringVal);
...
CA_FreeMemory(stringVal);

Visual Basic (function call):
Dim stringVal As String

stringVal = propObj.GetValString("Step.Limits.String", 0)

Visual Basic (inline):
Dim stringVal As String

stringVal = propObj.Step.Limits.String
0 Kudos
Message 2 of 4
(5,192 Views)
Hi Sunny,

I'm attaching an example that get the names of the parameters for a sequence. It makes calls to the TestStand API from the sequence. If you want to do this in VB you can call the same methods.

First I get a reference to the sequence object from the sequence context. Next, I get a reference to the parameters in the sequence by getting the Parameters property of the Sequence object. Then I get the number of subproperties that the parameters properties have and I use the GetNthSubpropertyName method to get the names of each of of the parameters. I get the types of parameter in the same way by calling the GetTypeDisplayString.
Finally I call the GetPropertyObject method to get a reference to each one of the parameters and get the comme
nts property of the object.

You should be able to translate the example to VB is you need to.

I hope this helps,

Marcela.
Message 3 of 4
(5,192 Views)
Hi Marcela,

Great, that's exactly what i was looking for!

Thanks for your help,
Sunny
0 Kudos
Message 4 of 4
(5,192 Views)