NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to typecast property object to step type?

Hello!

 

We are doing to tool in Labview which analyses our defined custom step types. For this, we want to query the step type object from the TestStand engine.

Unfortunatly, the IEngine.GetTypeDefinition() method returns a property object. There is an old entry in the forums with the same problem. There was stated just to typecast the object, but it was an VB example. How can this type cast be done in LabView? Using the "To More specific class" node results in broken fires because this polymorphic vi does not support the data type TS.PropertyObject or TS.StepType. So how to aquire a reference to TS.StepType from the return value of IEngine.GetTypeDefinition()?

 

Best regards,

 

Helge

0 Kudos
Message 1 of 5
(5,344 Views)

Hi, you need to go to the connectivity palette and then to the activex palette. On there is a "to datatype". The top terminal requires the data type you want to convert to - you can use a reference constant and then point it at the appropriate type (right click it and go to select activex class). Here's snippet to work from

see attached jpg

 

 

 

Hope that helps

Thanks

Sacha Emery

Systems Engineer (NIUK)

Message Edited by SachaE on 04-23-2009 01:13 PM
// it takes almost no time to rate an answer Smiley Wink
Download All
Message 2 of 5
(5,323 Views)
I was sure that it would be easy.... Thanks for your hint. I was searching exactly for something like that, but did not expect to have to use the "Variant to data" node for typecasting. We will try that out. Helge
0 Kudos
Message 3 of 5
(5,320 Views)
Does anybody know how to do this type casting within TestStand, using ActiveX adapter steps?
Christopher Farmer

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

0 Kudos
Message 4 of 5
(5,105 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 5 of 5
(5,103 Views)