NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Access the Parameters of a SequenceCall via API

I would like to access several characteristics, like name and value, of the parameter(s) of a SequenceCall via the TestStand API,
but it didn't work.
First I get the object reference of the Class SequenceCallParameters via Class SequenceCallModule.Parameters. Now I
can determine the correct number of parameters via SequenceCallParameters.Count. Cause that works, I think I am on
the right way. To access the property object of a specific parameter, I get the object reference via SequenceCallParameter.Item and
the Method AsPropertyObject of the Class SequenceCallParameter.
I thougth with this reference I could access the properties of the parameter via the PropertyObjectClass, but I didn't get the correct information resp. I didn't know at which property the objectReference really points to.
I add an example sequence. I would get the information from the Sequencecall via the PreStepCallback.
I hope someone has an idea. Thank you in advance.

Regards Carsten
0 Kudos
Message 1 of 5
(4,444 Views)
Carsten,

i am not sure what you want to do with the parameters, but you can find the info on the parameters in the "RunState.Sequence.Main["<StepName>"].TS.SData.ActualArgs" where <StepName> is the name of your Sequence-Call-Step. Attached you can find a screenshot where to search (in the runtimeproperties). Please note that you have to check the box "Show Hidden Properties" in the Station Options >> Preferences to display the SData-"Folder".

Regards,
Norbert B.
NI Germany
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 5
(4,438 Views)

CKone,

You can use the API to access the parameter properties.
Once you get the parameter item you can treat that object as a SequenceCallParamer object.
The SequenceCallParameter object contains several of the properties you were  trying to access:

SequenceCallParameter

Use objects from the SequenceCallParameter class to configure and obtain SequenceCallParameter-specific information for an item in the SequenceCallParameters collection class.

Properties

Name (Read Only)
PassByReference (Read Only)
Type (Read Only)
UseDefaultValue
UserData (Read Only)
ValidEvaluationTypes (Read Only)

ValueExpr

I modified your sequence file to use this object.

Hope it helps.

Antonio Lie

 

0 Kudos
Message 3 of 5
(4,424 Views)
@Norbert B:
That is the way I do it know. But I thought the way via the API should work too. I kept in mind that NI recommend that we should not use the step properties from the TS container, because of future changes.

@Antonio Lie
I can't run your modified sequence on my TS3.5 (TestStandEngine 3.5.0.725) system. At the step 'Get PropertyName' the error message "The member 'name' is not exposed by the class specified in this step" occured. It seems that these properties of the SequenceCallParameter class are not supported from the engine running on my system. Do you have a newer version of the engine? Anyway if these properties will exist now, it will be very useful for me for the future, because I use mainly the TS3.1 API at the moment.

Nevertheless it will be interesting for me to know if the way via the PropertyObject class is wrong, and if it is right why it didn't work, resp. what is my fault.
Thank you for your replies.

Regards Carsten
0 Kudos
Message 4 of 5
(4,404 Views)
CKone,
 
I am sorry about the confusion. I am using a newer version of the Engine that is why I had access to the new properties.
Those properties will be exposed in a future version of TestStand.
The SequenceCallParameter objects you get from the collection does not correspond to the properties under TS.SData.ActualArgs.
You are getting the erros while using the PropertyObject class methods because the properties you are trying to access do not exist.
I would recommend to access the properties directly for the moment (you are already doing it).
Hope it helps.
 
Antonio Lie.
 
 
0 Kudos
Message 5 of 5
(4,387 Views)