10-26-2006 09:27 AM
10-26-2006 03:36 PM
Hi,
Look at the example supplied, this gets the StepType Ref so as to get the Name of the StepType to do a comparison with the required StepType (see the Locals variable) to change some the the steps properties.
It should help.
Regards
Ray Farmer
10-27-2006 01:28 AM
Hi Ray,
thanks for your answer.
Yes, it would worked with your first example, but I want get the reference by the way described in the Teststand API Reference Help. There ist written for the method ChangeStepType:
ChangeStepType Method
Syntax
Step.ChangeStepType ( stepTypePtr)
Purpose
Changes a step's step type.
Remarks
Returns an error if the step does not allow changing its step type. To avoid this error, only call ChangeStepType if CanChangeStepType returns True.
To acquire a step type to pass as a parameter, call Engine.GetTypeDefinition and pass the name of the desired step type, then query the returned PropertyObject for its StepType interface.
Parameters
stepTypePtr As StepType
[In] The step type to which you want to convert the step.
My problem is to convert the reference, which get by the call Engine.GetTypeDefinition into a StepType reference.
Do you have an idea?
Thanks for help!!!
Kind regards
Matthias
10-31-2006 04:31 AM
Hi,
I think you can pass the reference return back from the GetTypeDefinition, as the parameter to the Step.ChangeStepType method.
Regards
Ray Farmer
05-11-2007 08:30 AM
Hi,
I have right now stumbled upon the same problem. You cannot pass the reference received from the "IEngine.GetTypeDefinition" method to the "Step.ChangeStepType" method, as it has the wrong type (TS.PropertyObject as opposed to TS.StepType).
What must I do to get the StepType reference needed by th ChangeStepType method? The Help says that "... call Engine.GetTypeDefinition and pass the name of the desired step type, then query the returned PropertyObject for its StepType interface."
What exactly does "query" mean, besides StepType "interface"?
Regards,
Martin
05-11-2007 09:03 AM
All right, it's sufficient just to typecast the PropertyObject reference to the desired StepType type. It's always easy, when you know how to do it ... :-0
Regards,
Martin
12-21-2009 08:36 PM
How does one actually typecast in TestStand?
Thanks.
12-21-2009 09:14 PM
12-25-2009 10:56 AM
In LabVIEW, the Variant to Data function is generally used to typecast TestStand references, i.e. Module reference to LabVIEWModule reference or PropertyObject reference to StepType reference.
Hope this helps.