NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Get StepType reference

Hello,

I want to change a steptype with the Teststand API in LabView by using the method ChangeStepType. The input parameter is a stepTypePtr as StepType. But how can I acquire a StepType reference as a parameter.


Thanks for help!!!

Regards

Matthias

0 Kudos
Message 1 of 9
(4,212 Views)

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

Regards
Ray Farmer
Download All
0 Kudos
Message 2 of 9
(4,200 Views)

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

0 Kudos
Message 3 of 9
(4,191 Views)

Hi,

I think you can pass the reference return back from the GetTypeDefinition, as the parameter to the Step.ChangeStepType method.

Regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 4 of 9
(4,151 Views)

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

 

0 Kudos
Message 5 of 9
(3,971 Views)

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

0 Kudos
Message 6 of 9
(3,967 Views)

How does one actually typecast in TestStand?

 

Thanks.

Christopher Farmer

Certified LabVIEW Architect and LabVIEW Champion
DQMH Trusted Advisor
https://wiredinsoftware.com.au

0 Kudos
Message 7 of 9
(3,435 Views)
OK - I just figured it out!  Use the AsPropertyObject method. ie. Using the ActiveX adapter, set Object Class to StepType, and Call Method AsPropertyObject.  The object reference passed out will be of type StepType. Then pass this StepType into the next ActiveX step. ie ObjectClass: Step, CallMethod ChangeStepType..
Christopher Farmer

Certified LabVIEW Architect and LabVIEW Champion
DQMH Trusted Advisor
https://wiredinsoftware.com.au

0 Kudos
Message 8 of 9
(3,433 Views)

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.

Manooch H.
National Instruments
0 Kudos
Message 9 of 9
(3,367 Views)