Using the Teststand API to create a .tpj file

Hello,
I'm looking for an example on how to create a teststand project file with the API. I cannot find a methode or property to create it, and add the project file(s) to a workspace. I've tried with PropertyObjectFile (Classe) without success.
Let me know if you can help.
Thx
Martin.
Teststand 2010 SP1.
Solved!
Go to Solution.

Thx for your answer, i use Labview 8.6 to interact with the API, So i don't know if I interpreted rightly your code...
I've managed to create an empty project file (.tpj)  with "Engine.NewPropertyObjectFile (6)"
With the "rootworkspaceObject.NewFile(filePath),0" A pop-up appear to select the file (so it must be created before like above).
What i've done is:
- Creating the file as a project file  "Engine.NewPropertyObjectFile (6),(Path)."
- I write the new file to disk "PropertyObjectFile.WriteFile(format)" and "PropertyObjectFile.SaveIfModified"
- Then i try to associate The existing .TPJ file to the RootWorkspaceObject "WorkspaceObject.NewFile(Path)" and "WorkspaceObject.InsertObject(Index)"
-At last I save modification of the association "WorkspaceFile.SaveWorkspaceAndProjectFiles(option)"
There is no error and when i open the workspace in teststand, there is no .pjt in the workspace tree...What i'm missing...
So this does not work for me..
Cheers
Martin

Similar Messages

  • Do You Use the TestStand API Reference Poster?

    The TestStand R&D Team would like to know how you use the TestStand API Reference Poster that ships with TestStand.  How often do you use it?  Is it hanging up near your computer?  What tasks do you use it for?
    Allen P.
    NI

    Hi,
    I dont use the hard copy. I unfolded the it the first time it appeared in version 3.0. Refolded it, put it back in the box and have never bothered with it since.
    I have used the electronic version now again, when I haven't got access to the programmer help doc which you find in the teststand\bin folder.
    I find its use limited, as it only really gives you the relationship between classes and a list of the properties and methods. This you can obtain for the help document.
    Regards
    Ray Farmer
    Regards
    Ray Farmer

  • How to use the RequestService API to create request in OIM 11g

    Hi Guys,
    We are trying to build a custom ADF app (Request Forms) to allow users to request access to resources. We want to use the OIM RequestService APIs (oracle.iam.request.api.RequestService).
    We can't seem to find a proper guide to use this service.
    Is there anyone who has done this or know how we can achieve this in OIM 11g?
    Thanks in advance
    Tav

    Try here
    http://java.net/projects/openptk/sources/svn/show/branches/Oracle/OIM11g/examples/java?rev=1313
    Fred

  • Set the descriptio​n value for a step by using the TestStand API

    Hi,
    to read the description of a step there is provided a method:
    Step.GetDescriptionEx
    What about setting this value via API?
    I didn't found any method like 'SetDescriptionEx' !
    Regards,
    Sunny

    There is no set method because the description is dynamically computed by evaluating the DescriptionExpr property of the step's steptype.
    If you want to make a custom step type with a settable description, add a step type subproperty of type string named MyDescription. Then set the step type's Step Description Expression to Step.MyDescription.
    Now, for any instance of your step type, you can set the Step.MyDescription property to change the description.

  • What is the teststand api call to execute sequence file after it is opened-C#?

    I am programming in C#. I want to make a call to execute a sequence file after I call OpenSequenceFile. I want to do this outside of the GUI. I know that the GUI has a Single Pass button that executes the sequence, I want to know how can I just make the execution call myself?

    Hi IM,
    I think this thread will answer your task
    http://forums.ni.com/ni/board/message?board.id=330&message.id=19658&query.id=461003
    Regards
    juergen 
    =s=i=g=n=a=t=u=r=e= Click on the Star and see what happens :-) =s=i=g=n=a=t=u=r=e=

  • How to build a TestStand 2012 workspace ( insert a project / insert a folder) programmat​ically using LabVIEW 2012 and the TestStand API.

    Hi everybody!
    I am just trying to find out how to create a TestStand workspace … in LabVIEW using the TestStand API.
    To create a new workspace was quite easy. Unfortunately I am not successful to insert a new or existing project to the workspace.
    Furthermore I have to insert a folder from disk to the new or existing project in the way that I can use an absolute path for the directory …  
    Maybe someone had already solved this problem, in any case  I am thankful for any hint.
    Greetings from Germany,
    Norbert

    Have you find out how to add a folder to a project? I'm looking for this to... I tried WorkspaceObject.NewFolder[Name]whitout success...
    For creating Workspace and project see the newer resolved thread I created.
    Martin

  • How to create a campaign based on a template using the REST API

    Hi CodeIt-ers,
    I'm using the REST API to create campaigns in Eloqua 10, all works well except for 1 thing: I can't seem to create a campaign based on an existing Campaign template.
    Based on the documentation on REST API - Accessing Campaigns I've tried using "sourceTemplateId" (code snippet below) but that did not do the trick.
    Does that functionality simply not work or am I missing something?
    Thanks!
    Ferry
    $campaign_data = new Campaign(); 
    $campaign_data->sourceTemplateId='442';
    $campaign_data->folderId='1137';
    $campaign_data->currentStatus='draft';

    Hi Richard,
    Unfortunately no. I reached out to support, they informed me "sourceTemplateId" could not be used to create new campaigns based on a template, instead they advised to use the "Elements " property as shown in this example: Eloqua REST API - Create a Campaign with a Segment and Email
    Thanks
    Ferry

  • How do I create a user, in my context in OID using the Java API

    How do I create a user, with subschema, in my context in OID using the JAVA API
    I need to be able to create new users in my OID, I was doing it in our old iPlant Directory, but I don't seem to see the same methods in the Oracle LDAP API. I figured out how to get and modify the attributes of a user, but I can't seem to figure out how to add a new one.

    Try this code , modify it accordingly
    ------- cut here -------
    import oracle.ldap.util.*;
    import oracle.ldap.util.jndi.*;
    import javax.naming.NamingException;
    import javax.naming.directory.*;
    import java.io.*;
    import java.util.*;
    public class NewUser
    final static String ldapServerName = "yourLdapServer";
    final static String ldapServerPort = "4032";
    final static String rootdn = "cn=orcladmin";
    final static String rootpass = "welcome1";
    public static void main(String argv[]) throws NamingException
    // Create the connection to the ldap server
    InitialDirContext ctx = ConnectionUtil.getDefaultDirCtx(ldapServerName,
    ldapServerPort,
    rootdn,
    rootpass);
    // Create the subscriber object using the default subscriber
    Subscriber mysub = null;
    String [] mystr = null;
    try {
    RootOracleContext roc = new RootOracleContext(ctx);
    mysub = roc.getSubscriber(ctx, Util.IDTYPE_DN, "o=dec", mystr);
    catch (UtilException e) {
    e.printStackTrace();
    // Create ModPropertySet with user information
    ModPropertySet mps = new ModPropertySet();
    mps.addProperty(LDIF.ATTRIBUTE_CHANGE_TYPE_ADD,"cn", "Steve.Harvey");
    mps.addProperty(LDIF.ATTRIBUTE_CHANGE_TYPE_ADD,"sn", "Harvey");
    mps.addProperty(LDIF.ATTRIBUTE_CHANGE_TYPE_ADD,"uid", "SHarvey");
    mps.addProperty(LDIF.ATTRIBUTE_CHANGE_TYPE_ADD,"givenname", "Steve");
    mps.addProperty(LDIF.ATTRIBUTE_CHANGE_TYPE_ADD,"mail", "[email protected]");
    mps.addProperty(LDIF.ATTRIBUTE_CHANGE_TYPE_ADD,"userpassword", "welcome1");
    // Create the user
    User newUser = null;
    try {
    newUser = mysub.createUser(ctx, mps, true);
    System.out.println("New User DN: " + newUser.getDN(ctx));
    catch (UtilException e) {
    e.printStacktrace();
    ------- end cut --------
    Enjoy.
    Suhail

  • Creating junit test cases using the reflection API

    In order to use the reflection API to get information about a *.java file's class name and methods, I need to compile the *.java file first, and then get info through the *.class file. Am I right?
    Eclipse, the Java IDE, can create junit test cases for java files the user selects right after the *.java files have been created, and even before the *.java files have been compiled by the user. I guess Eclipse internally compiles the java files before creating JUnit test cases for them. Does anyone know about it? Thanks.

    Let me explain my problem in more details.
    Given any java source tree, my program is supposed to create junit test cases for each class using java reflection. My approach is to scan through the source tree to keep the list of classes available, then compile all the java files in the given source tree, then do Class.forName() to load them to get their methods... Obviously I don't know what classes I will have at compilation time. I create a temp_classes directory as the output directory for the given source tree java files, and I add temp_classes to my classpath when I strart up my own program. However, that won't work..
    D:\eclipse\workspace\cmpe271_hw4\classes>java -classpath ..\classes;..\temp_classes Test
    javac -classpath .\temp_classes; -d .\temp_classes @temp_classes\javalist.txt
    java.lang.ClassNotFoundException: Factory
    java.lang.ClassNotFoundException: InvalidDateFormatException
    java.lang.ClassNotFoundException: MyUtility
    java.lang.ClassNotFoundException: Storage

  • Using Azure Python API to create VM without exception, but the VM is not launched....

    This is the scenarios:
    I have created a custom Linux VM image and I have successfully launch a VM using the Python API on region US-WESt.  
    My goal is to create a custom Linux VM on a VNET.
    This is what I have done:
    1. Knowing that using Python API to create Virtual Network (VNET) is not supported yet, I manually created a VNET using Console.
    2. Using Python API to create hosted service (cloud service) on the same location as the VNET I created.
    3. Using Python API to launch the VM on the VNET.
    4. without any exception nor error, the VM is just not created...
    The Python APIs I used:
    #create a VM
    name = 'myCloudN'
    location = 'West US'
    sms.create_hosted_service(service_name=name,
        label=name,
        location=location)
    image_name = 'cloudN-Azure-20150205-os-2015-02-05'
    media_link = 'https://xxxxxxxxxxxxxxxxxxxxxx.windows.net/vhds/cloudN-Azure-20150205-os-2015-02-05.vhd'
    linux_config = LinuxConfigurationSet('cloudN-1', 'ubuntu', 'ubuntu1!', True)
    os_hd = OSVirtualHardDisk(image_name, media_link)
    vnet_name = 'test1'
    sms.create_virtual_machine_deployment(
        service_name=name,
        deployment_name=name,
        deployment_slot='production',
        label=name,
        role_name=name,
        system_config=linux_config,
        os_virtual_hard_disk=os_hd,
        virtual_network_name=vnet_name,
        role_size='Small')
    <azure.servicemanagement.AsynchronousOperationResult object at 0x90669ec>   <=====I got this
    try:
       props = sms.get_deployment_by_name(name, name)
       print vars(props)
    except Exception as pe:
       print "Error on get_deployment: %s" %str(pe)
    Error on get_deployment: Not found (Not Found)  <======== Cannot find my VM
    Did I miss anything or the Python API is not ready for this yet....
    Please help.
    Big thanks in advance...

    I did create the cloud service.   In my original post, the first thing I do is to create the cloud service.
    The API I used to create cloud service was "create_hosted_service".
    #create a VM
    name = 'myCloudN'
    location = 'West US'
    sms.create_hosted_service(service_name=name,
        label=name,
        location=location)
    Please help.

  • Help/Example needed for creating JMSQueues/JMSTopics using the MBean API

    I am trying to create JMSQueues programmatically using the MBean API. When
    I use MBeanHome.createAdminMBean(), a queue appears in the root of the
    config file. This is progress, but the queue is in the wrong place! I need
    the queues to be part of my JMS server's "destinations" as seen on the
    console.
    So now I am trying to use createConfigurationMBean() instead, but I can't
    figure out what the "parent" parameter should be- no documentation! My
    first guess was that the parent might be the JMSServer, but that doesn't
    work.
    Anyone have example code to insert JMSQueues and JMSTopics into a specific
    JMS server's destinations?
    Here is the code I tried... All goes well until the final
    createConfigurationMBean call, where it throws a MBeanCreationException:
    // Get the MBeanHome bean
    Object obj = jndiContext.lookup("weblogic.management.adminhome");
    MBeanHome mbeanhome = (MBeanHome) javax.rmi.PortableRemoteObject.narrow
    (obj, MBeanHome.class);
    // Get the server MBean
    JMSServerMBean jmsServerMB =
    (JMSServerMBean)mbeanhome.getMBean("examplesJMSServer",
    JMSServerMBean.class);
    // Create the new Queue
    JMSQueueMBean jmsQMB = (JMSQueueMBean)mbeanhome.createConfigurationMBean
    ("weblogic.examples.jms.fooQueue", "JMSQueue", jmsServerMB);

    Ok, I still don't see how I can do it differently with the admin tool. If
    you want to see the commands I'm using, I can post them, but the basic one
    is shown below in the previous message. We're trying to set up a script so
    that developers can just run it and properly configure WebLogic with the
    right components.
    Thanks,
    Michelle
    "Michelle Baxter" <[email protected]> wrote in message
    news:[email protected]...
    I am using the weblogic.Admin tool, not doing this in code. I will attempt
    to translate your advice when I get time again.
    My commands look like this:
    java weblogic.Admin -url 127.0.0.1:7001 -username system -passwordweblogic
    CREATE -mbean "mydomain:Type=JMSQueue,Name=MyJMSQueue"
    I create this, I create the JMSServer MBean, then do and INVOKE (insteadof
    CREATE) and call the addDestination method, adding the JMS Queue MBeanthat
    I created previously, using the same naming scheme as in the above CREATE.
    "Viresh Garg" <[email protected]> wrote in message
    news:[email protected]...
    Daron Cole wrote:
    You can use createConfigurationMBean with JMSQueueConfig but in the
    end
    I used
    the code below to create a topic.The code that you posted is the right way to create queus/topics. alwayscreate admin mbeans to admin
    server and let admin server internally create config Mbeans on the
    managed
    server as per the
    location/targets that you set in admin Mbeans.
    Queue's are the same, just replace the word
    Topic with Queue and it should work. It should show up in the console
    app.
    MBeanHome home = (MBeanHome)ctx.lookup(MBeanHome.JNDI_NAME+".myserver");
    ServerMBean myserver =(ServerMBean)home.getMBean("myserver",ServerMBean.class);
    String topicName = "MyNewTopic";
    JMSServerMBean jmsServerMB =(JMSServerMBean)home.getMBean("JMSServer","JMSServer","mydomain");
    JMSTopicMBean jmsTopicMB =(JMSTopicMBean)home.createAdminMBean(topicName,"JMSTopic","mydomain");
    jmsTopicMB.setJNDIName(topicName);
    jmsServerMB.addDestination(jmsTopicMB);
    Viresh Garg
    Principal Developer Relations Engineer
    BEA Systems
    "Michelle Baxter" <[email protected]> wrote:
    There is no JMSQueueConfigMBean. What do you mean?
    "Daron Cole" <[email protected]> wrote in message
    news:[email protected]...
    Try JMSQueueConfig instead of JMSQueue.
    "Michelle Baxter" <[email protected]> wrote:
    Me too! I'm trying to use the weblogic.Admin class to set up
    queues
    and
    topics and the JMS server. The same results in the config file:
    the
    queues
    and topic were set up at the root, the JMS server was added, but
    no
    destinations, even though I invoked the addDestination method withthe
    created MBean queues and topic as arguments. No exceptions, just
    no
    destinations on the JMS server resulted. What's the right order ofexecution
    for this stuff??
    Thanks,
    Michelle
    "Jude DeMeis" <[email protected]> wrote in message
    news:[email protected]...
    I am trying to create JMSQueues programmatically using the MBean
    API.
    When
    I use MBeanHome.createAdminMBean(), a queue appears in the root
    of
    the
    config file. This is progress, but the queue is in the wrong
    place!
    I
    need
    the queues to be part of my JMS server's "destinations" as seen
    on
    the
    console.
    So now I am trying to use createConfigurationMBean() instead,
    but
    I
    can't
    figure out what the "parent" parameter should be- no
    documentation!
    My
    first guess was that the parent might be the JMSServer, but that
    doesn't
    work.
    Anyone have example code to insert JMSQueues and JMSTopics intoa
    specific
    JMS server's destinations?
    Here is the code I tried... All goes well until the final
    createConfigurationMBean call, where it throws aMBeanCreationException:
    // Get the MBeanHome bean
    Object obj =
    jndiContext.lookup("weblogic.management.adminhome");
    MBeanHome mbeanhome = (MBeanHome)javax.rmi.PortableRemoteObject.narrow
    (obj, MBeanHome.class);
    // Get the server MBean
    JMSServerMBean jmsServerMB =
    (JMSServerMBean)mbeanhome.getMBean("examplesJMSServer",
    JMSServerMBean.class);
    // Create the new Queue
    JMSQueueMBean jmsQMB =(JMSQueueMBean)mbeanhome.createConfigurationMBean
    ("weblogic.examples.jms.fooQueue", "JMSQueue", jmsServerMB);

  • How to count number of lines inside methods() using the Doclet API

    Wrote a custom doclet using the [Doclet API|http://java.sun.com/j2se/1.3/docs/tooldocs/javadoc/doclet/index.html ] .
    The purpose for the doclet is to load Java source files and create stubs (which are identical Java source files but do not contain any method implementation details).
    Instead, the method implementation details need to be replaced with blank lines...
    public class MyDoclet {
         private static String TAB = "\t";
         public static boolean start(RootDoc root) {
              ClassDoc[] classes = root.classes();
              // Parse through class or interface
              for (ClassDoc clazz : classes) {
                   Type superClass = clazz.superclassType();     
                   // Print Methods
                   MethodDoc[] methods = clazz.methods();
                   for (MethodDoc method : methods) {
                        Parameter[] parameters = method.parameters();
                        println();
                        if (!method.isPrivate()) {
                             print(TAB + method.modifiers() + " "
                                                    + method.returnType().simpleTypeName() + " " + method.name());
                             print("(");
                             for (int i=0; i < parameters.length; i++) {
                                  Parameter parameter = (Parameter) parameters;
                                  print(parameter.type().simpleTypeName() + " " + parameter.name());
                                  if (i != parameters.length - 1) {
                                       print(", ");
                             print(")");
                             println(" {");
                             println("\n");
                             println(TAB + "}");
              return true;
    As one can see, I am just creating the method and placing the opening and closing curly braces (along with a new \n line escape sequence, in between).
    Am not really that familiar with the Doclet API...
    Question(s):
    (1) What is the best way to figure out how many lines of code are inside each method and then use a for loop to insert the exact same number of blank lines inside the methods?
    (2) Is there a way to do it using the com.sun.javadoc.SourcePosition.line() method?
    Would really appreciate it if someone could help me because this is an important requirement (hence the 10 Duke Stars).
    Happy coding to all,
    Mike                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    This is not possible using the Doclet API, because JavaDoc does not store any information regarding implementation detail. Although MethodDoc#position will give you the line where the method is declared, there is no way to determine where the method body starts and ends.
    If you need that much information, maybe you would be better of using a tool such as Eclipse's Abstract Syntax Tree parser. AST will provide you with line numbers for each code expression, hence it is relatively easy to compute the first and last line in a method body.

  • Error while using the UWL APIs?

    Hi All,
    I am using the UWL APIs for Task generation.
    Following line is giving error in my code :
    <b>IUWLService uwlService =
                             (IUWLService) PortalRuntime.getRuntimeResources().getService(
                                  IUWLService.ALIAS_KEY);
          UWLContext myContext = new UWLContext();
              try {
                  IUWLSession mySession = uwlService.getUwlSessionForWebDynproClient(myContext);
                catch (Exception e) {
                   response.write("Can not create session");
                                                 [</b>
    The error is " The method getUwlSessionForWebDynproClient is undefined for the type IUWLService
    Please help. I am using the right jar
    <b><property name="ServicesReference" value="SAPJ2EE::library:tckmcbc.uwl~api"/></b>
    Please help.
    Marks given for early and helpful replies.
    Sumit

    Hi All,
    This is just to share my experience.
    I haved solved the problem by adding the SAP:J2EE library reference to the above library in Deployment Descriptor.
    Sumit

  • "select into" query statements using the DI API

    I am trying to use the DI API (6.5) t create a temp table based on an existing table.  For example, here is a query string....
    select * into ORDR_TEMP from ORDR
    Code...
    oRecordSet := IRecordset(oCompany.GetBusinessObject(BoRecordset));
    oRecordset.DoQuery(sSql);
    Error I get...
    1). [Microsoft][ODBC SQL Server Driver][SQL Server]Cannot use SELECT INTO in browse mode. 2). [Microsoft][ODBC SQL Server Driver][SQL Server]Statement(s) could not be prepared
    For any other regular select statements the previous code works.  Does anyone know for sure if a "select into" statement is not possible using the DI API?

    Hi Bill,
    I´m not really sure if select into is avaiable. But here you´ve got a hint: You could use a user defined function to do it, and just call the function from your code.
    SELECT dbo.MyFunction()
    Having this function defined in your SQL Server:
    CREATE function MyFunction ()
    returns char(2)
    AS
    Begin
    select * into ORDR_TEMP from ORDR
    Return ('OK')
    End
    Hope this helps,
    Ibai Peñ

  • Why to use the Java API in MDM

    Hi Experts,
    I am new to the MDM.
    We are having the requirement of inetration between Portal and MDM.Can u please tell me when to use the following coponents like the scenorio's.
    Why to install the MDM Business packages in Portal?
    why to use the JAVA API.
    Please give me the complete information.
    Regards

    Hi Vijay,
    Standard Business Package is use to provide interaction between MDM Server and the Portal. It consists of MDM iViews like Item Detail iView (allows to create,edit and delete the records) , Resultset iView (Displays the records, allows to add the records in workflows etc), Search iViews (for searching)i.e. Data Manager functionality.
    Java API are used when you need some functionality that standard MDM iViews dont have.MDM Java API consists of set of classes and interfaces with the help of which customization can be done.
    Regards,
    Jitesh Talreja

Maybe you are looking for