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

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
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
Attachments:
cast propertyobject to steptype.JPG ‏18 KB
example cast.vi ‏5 KB

Similar Messages

  • How to use property object with dequeue

    I tried to do following steps in Labview7.1 and Teststand3.1:
    - Create a named Queue in Teststand
    - Get the named Queue reference in Labview (GetQueue)
    - Enqueue an property of type NI_BatchControllerRequest into the Queue in Teststand
    - Dequeue the element in Labview by using a Fileglobal of type NI_BatchControllerRequest as destination property object
    At the first Enqueue, the object is correctly dequeued and stored in the Fileglobal. But at the next enqueue, I get the error -17300 (Exception occured in TSSync, Unable to set a top-level property object to another object) at the dequeue operation.
    When I use flat datatypes like string or bool, there are no errors, also at multiple enqueue operations.
    Can anyone help?

    LVFan -
    I did not realize that you are using the SyncManager low level API. The low-level API has a few restrictions that the step type does more work to hide from the user.
    If you look at the dequeue API function it takes an input parameter which is the destination object. Internally the dequeue operation uses the SetPropertyObject method to do the assignment. This method requires that the object that you assign a value to has a parent so that the engine can go to the parent, delete the child, and add the new child in its place. Even if the destination property object that you supplied had a parent, your reference to the "destination" would not be the new object because your reference is pointing to the old property a
    nd not the new one. You would be required to go to the parent and ask for the child again.
    A simple change to make this work for you is to use a reference object as the destination and then use GetValInterface on it to get the element from the queue. I have updated your VI to illustrate this.
    Scott Richardson (NI)
    Scott Richardson
    National Instruments
    Attachments:
    Queue.vi ‏93 KB

  • How do I configure my custom step type to call its Express VI configuration dialog box each time I double click the step?

    By double clicking on a step in the TestStand Sequence Editor the Properties dialog box pops up.
    How to change this behaviour?
    I would like to configure my step type so that each time I double click the step, the Express VI configuration dialog box pops up, instead of the properties.
    One Idea is to use custom activeX substeps, for example, Antonio Lie mentioned the substep "OnNewStep" in my last post. Is there also a "OnDoubleClick"?
    Does anyone know a list of activeX substep that can be used? Or are there other ideas?
    Thanks a lot!!!
    - Caribe -

    Caribe,
     1. Currently it is not possible to change the behavior for double clicking on a step. It is a good idea though, and we will be consider to add it to the next versions of TestStand.
     2. "OnNewStep" is the only "special" substep. It was implemented for internal use and it is not documented yet.
     3. If you want to know more about substeps you can red the Reference Manual, Chapter 13 is a good place to start.
     4. I want to make clear that "OnNewStep" is called every time you insert a new step. The sequnce editor gets the substeps list and if it finds the "OnNewStep" substep in the   list It calls it using the API. The substep can use any adapter type, It does not have to be the ActiveX adapter.
    Hope it helps.

  • How to typecast an object, if the target class name is stored in a str var

    Hi,
    I have a method, in which i will receive an object as an attribute. I need to typecast it to another class, and that class name is stored in a string variable.
    public void printContent(Object obj)
    /* Here i have a variable strClassName - in which a class name is stored.
    I need to create a variable for that class and type cast the object obj into that class. */
    Please kindly help me to find out a way to do this.
    Thanks in advance

    Typecasting does one thing: it enables you to store an object in a reference variable of the target type (if it is of a type which is allowed to be in that variable). It doesn't alter the object in any way.
    Therefore it simply isn't meaningful to talk about typecasting to a type name known only at run time. The whole point of typecasting is to tell the compiler to treat a reference as being of a specified type.
    I don't know what you're trying to do but I think you should probably be looking at the reflection api, getting field an method information from the object's Class object.

  • How to handle plsql Object and Table type inside BPEL

    Hi All,
    I have a procedure with 5 IN and 4 OUT parameters. Out of 4, One is Object type and remaining 3 are Table type. Now in my bpel, i am calling this proc from DB Adapter. The DB Adapter wizard created XSD with proper structure. But when i am testing this i am not getting these out parameters values in the payload of Invoke DBAdapter activity. I am neither getting errors nor output.
    What could be the issue.?
    Thanks in advance,
    Sudheer

    Arik,
    JDev is not creating any wrapper packages as such. It simply created a XSD with same as my procedure name.
    My XSD looks like this...
    <element name="OutputParameters">
    <complexType>
    <sequence>
    <element name="P_OBJ_H_INFO_O" type="db:APPS.H_OBJ_TYPE" db:index="6" db:type="Struct" minOccurs="0" nillable="true"/>
    <element name="P_TAB_L_INFO_O" type="db:APPS.L_TAB_TYPE" db:index="7" db:type="Array" minOccurs="0" nillable="true"/>
    <element name="P_TAB_M_INFO_O" type="db:APPS.M_TAB_TYPE" db:index="8" db:type="Array" minOccurs="0" nillable="true"/>
    <element name="P_TAB_A_INFO_O" type="db:APPS.A_TAB_TYPE" db:index="9" db:type="Array" minOccurs="0" nillable="true"/>
    </sequence>
    </complexType>
    </element>
    And again the 3 table types internally referring object types.
    Thanks for reply. Awaiting response...
    Sudheer

  • How do I modify custom step type that is part of a sequence?

    I have an example sequence that has a custom step type called "LabView Reentrant Action". My interest is to modify this step type to my needs. Because this custom step type is part of the sequence there is no definition in global type palette. I was told that I could copy this step into global type palette. But, I don't think I could.
    I can copy the step from the sequence space but I do not have an option to paste it in the palette.
    In sequence space I have options to choose LabView Reentrant Dialog Steps under Insert Step pull-down menu. When I open Step Type Menu Editor in the palette space, all types are listed except LabView Reentrant Dialog Steps. I think these are not showing in the palette because they are custom types built into the sequence.
    How can I extract the custom step type into global palette so that I could modify to my needs?

    Hello,
    If you already have the customer step type "LabView Reentrant Action" then to modify it all you need is to go in "Type Palette" (Ctrl-T) and make modifications in the step type.
    In case you are not able to see the step type in type palette then you need to add the step type in a custom ini file. You can add that ini file by clicking on customize in "Palettes" drop down menu. The you can copy paste a step in the step type and make modifications to the step.
    I would recommend going through Tutorial: How Do I Make a Custom Step Type? for more reference.
    I hope it helps..
    Rajiv

  • Step Type Menu Distribution. How to?

    Hi,
    I created at one of my develpopment station with TestStand the custom: Step Type Menu.
    How i can to distribute that - Step Type Menu to others stations (e.g. which file concludes it)?
    Thank you & Best Regards
    *I use LabVIEW 8.X & TestStand 3.5/4.0.1 versions only

    If you have created your own Type Palette. The file will be stored in TestStand 3.5\Components\User\Type Palettes, the name of the file will be the name of your Type Palette, e.g. MyTypes.ini
    Regards
    Steve
    There are 10 types of people in the world that understand binary, those that do and those that don't.

  • How can I create a custom step that does nothing but make calls to a dll

    What I'd like to end up with is a Custom step that
    1. Takes several string parameters
    2. Makes several calls to functions in a DLL
    3. Returns and stores error codes returned from the function
    I've been through the KB article "How Do I Make a Custom Step Type".
    This got me about halfway there; while helpful, it didn't provide a
    reference for some of the questions I had, specifically:
    1. What sort of sequence action type should I start with (to use as a template)?
    2. If I start with a "Call Executable", do I need to specify the module when I incorporate the step into the sequence?
    3. How does one pass parameters in and out of a custom step type?
    4. How does the step type report progress/errors to the report?
    Thanks in advance.
    Mike

    Hi,
    To interface to a DLL you will need to use either the DLL Adapter or the CVI Adapter, not the Call Executable adapter.
    Have you been through the Using LabWindowsCVI with TestStand manual. This should answer all your questions, all the chapters are relevant.
    Regards
    Ray Farmer
    Regards
    Ray Farmer

  • Authorization object  on Promotion Type  ( WAK1)

    Dear Gurus,
    This my first question.
    I want to know, How to put AUTHORIZATION OBJECT on Promotion type in t code WAK1. 
    I want , a user  let say would not create Promotion order other then ( RC10). How can i do it.
    Please help.
    Best Regards
    sachin chauhan

    Hi,
    Are you telling me that you have a z auth, object built with SU21? If it's true, you can insert in SE38 with the push 'Pattern' and option AUTHORITY CHECK. The system insert it. After, set the parameters as variables and if the return code isn't zero (you don't have auth) you must set an error message, for instance in LIPW4F58:
    *... Auth check movemnt. plant
      authority-check object 'M_MSEG_WWA'
               id 'ACTVT' field '01'
               id 'WERKS' field mseg-werks.
      if sy-subrc eq 4.
        message e199 with mseg-werks.
      endif.
    Remember set the object in PFCG, and check that in case of rejection of auth. the tcode SU53 works right.
    I hope this helps you
    Eduardo

  • Assign Object to Class Type 026

    Dear Gurus,
    How can I assign objects to 026 type class ? because I tried CL2* transactions and all disallow me from accessing this 026 type class.
    Thank you.
    Best Regards,
    Kent.S

    Hi Kent,
    Class 026 is a reserved class for goods group ... look at Transaction WG21-Environment for hierarchy (we have a german system, so i don't know the correct items in the english menue).
    Best regards,
    Volker

  • How to create programmat​ically a new step type in TestStand (to myTypes.in​i)

    I need to create a new step type to myTypes.ini file programmatically. I have tried to do it with following steps:
    - Get reference to engine
    - Load type palette files
    - creating new step type (engine.NewSteptype() )
    - Inserting new type using TypeUsageList.InsertType method. Problem with this is the first parameter. It excpects it to be in a form of PropertyObject, but engine.NewStepType returns it as a StepType object. If I try to use StepType.AsPropertyObject it returns an error.
    How to convert StepType object to a PropertyObject?

    And here it is in C++:
    TS::IEnginePtr mEngine;
    SAFEARRAY * typeList;
    TS::TypeUsageListPtr typeUseage;
    TS:tepTypePtr stepObj;
    mEngine = engine;
    mEngine->LoadTypePaletteFiles();
    typeList=mEngine->GetTypePaletteFileList();
    TS:ropertyObjectFilePtr *rgelems;
    SafeArrayAccessData(typeList,(void**)&rgelems);
    typeUseage = rgelems[0]->TypeUsageList;
    stepObj=mEngine->NewStepType();
    TS:ropertyObject *property = stepObj->AsPropertyObject();
    property->PutName("TestMe");
    typeUseage->InsertType(property, 0, TS::TypeCategory_StepTypes);
    rgelems[0]->IncChangeCount();
    rgelems[0]->SaveFileIfModified(true);
    SafeArrayUnaccessData(typeList);

  • Getting Sequence object from pre-step substep of Sequence Call based step type

    How to obtain reference to Sequence object from within pre-step substep of Sequence Call based custom step type?
    Given: new custom step type which based on NI Sequence Call step type. There is Pre-Step substep exist for this step type.
    How to get reference to Sequence object representing Sequence which will run?
    Although there is possible to examine SequenceAdapter and SequenceCallModule properties, it seems redundant since module (Sequence) is already loaded by TestStand ("NI TestStand Reference Manual. Table 3-4. Order of Actions that a Step Performs"   Action #6, while my code is running as Action #13).
    Thanks.
    Misha

    Could you explain what you want to do ?
    Why do you want to get the sequence object within a pre-step substep ?
    I give you some informations but I don't know if it's the better way to do what you want (because I don't know what you want to do with the sequence object).
    If the substep uses the ActiveX adapter :
    You can get the sequence object but you should save the object reference in a StationGlobals variable.
    And you should release the object reference within your sequence when you don't need it any more.
    If the substep uses another module adapter: 
    Get the step module, then the sequence name (module property).
    Then get the sequence object by the sequence name from the sequence file.
    Here are the paths to use for both methods :
    Sequence Name property path : Step.Module.SeqName
    Sequence Object path : RunState.SequenceFile.GetSequenceByName (seqname)

  • How to insert a new step type into a submenu?

    Hi!
    I'm inserting a step type into the MyTypes.ini file with c++.
    With the code below I managed to put it into a menu (in the step type menu editor it is called "Group").
    But I want a sub menu.
    How can I put it into a sub menu (in c++)?
    Who can help me? Thanks in advance!!!
    Here is the code:
    property->PutName("StepTypeName");
    typeUseage->InsertType(property, 0, TS::TypeCategory_StepTypes);
    stepObj->PutMenuGroupName("StepTypeMenuGroup");

    TSNewbie,
    There is no API method to edit those groups. I can only suggest to use the Step Type Menu Editor to create the group you want and make it a submenu. Then when you call stepObj->PutMenuGroupName("SubMenuGroup") the step type will be in that submenu.
    I apologize if this isn't the answer you are looking for.
    Ronald Byrd (NI)

  • How to typecast Object Class object dynamically

    Hai every one
    i have a object of any particular class , but i don't know the variables in that class object. But i have string variable contains value of variables in that class object.
    So i use following method for get value of variables in that class object.
    class ObjectCLass
         Sub s=new Sub();
         public static void main(String[] args)
              ObjectCLass a=new ObjectCLass();
              try
                   System.out.println(*a.getClass().getDeclaredField("s").get(a)*);
              catch(Exception e)
                   System.out.println("Exception");
    class Sub
         int i=5;
         public void print()
              System.out.println("Hello World!");
    }Here the bolder line give Object class object. By using this Object class object i need access the variable i and method print(). So i need to cast Object class object into sub class
    so how can i typecast it
    i try with following methods , but i cant succeed
    1.(  *(a.getClass().getDeclaredField("s").get(a).getClass)*   a.getClass().getDeclaredField("s").get(a)   ).print() ;
    2.(  (Class.forName(�Sub�) ) a.getClass().getDeclaredField("s").get(a) ).print();Please any one one help me how to typecast it dynamically
    By
    Thiagu

    If you know you're going to invoke the "print" method on an object, then you also need to know the type of the class, or interface, which has that method.
    It seems what you are looking for is a tutorial on interfaces.
    http://java.sun.com/docs/books/tutorial/java/IandI/index.html
    In a nutshell, you can set up an interface which defines a "print" method, and create class(es) which implement that interface. Then as long as you have an object which implements that interface, but do not know the exact type of that object, you can simply cast it to the interface type and invoke the method.

  • How to strongly protect the step types from being modified by others?

    how to strongly protect the step types from being modified by others?

    Hi Jacky,
    You can make a property of a step uneditable by changing the property
    flags for the step.  First, you want to be able to view the hidden
    properties so that you can change the flags for these properties as
    well.  You do this by going to Configure>>Station Options
    and selecting the Preferences tab.  Check the box for Show Hidden
    Properties.  Once you have done this you can select the step type
    from the types palette.  In the window to the left, you can expand
    the tree for the type to see all the properties of that step. 
    Right click on the property that you do not want users to be able to
    edit, select Properties.  Then click the Advanced button. 
    Here you will see a list of the setable flags.  Check the box for
    PropFlag_NonEditable.  You can then do this for all the properties
    of the step that you do not want users to edit.
    Thanks,
    Caroline Tipton
    Data Management Product Manager
    National Instruments

Maybe you are looking for