Update step limit name at run-time

I need to run through some test steps in a TestStand sequence multiple times.  This wouldn't be a loop on a single step or group of steps but probably a goto a label "for" loop in TestStand.  BTW, TestStand 2.0.1 calling code from a LabWindows/CVI DLL via the standard prototype adapter.  Each iteration I need to have the test step limit names be updated with a different suffix.  So step1 might have results0 and results1 and on the 2nd run results0 would be renamed to results0b.  How do I update the limit names, at run-time, from a LabWindows/CVI function?  I.e. the first test in the sequence's Main would update the steps below it to update the suffix.  I started down the path of using TS_SeqContextGetProperty to get the sequence handle
TS_SeqContextGetProperty( testData->seqContextCVI, &errorInfo, TS_SeqContextSequence, CAVT_OBJHANDLE, &seq_hndl );
then using TS_SequenceGetNumSteps( seq_hndl, &errorInfo, TS_StepGroup_Main, &num_steps ) to determine the number of steps in the Main tab.  
Enter a for loop:
TS_PropertyGetValString( testData->seqContextCVI, &errorInfo, buf, TS_PropOption_NoOptions, ( char ** )&rslt_name ) with buf as "Sequence.Main[0].Result.Measurement[0]" errors out with an invalid name message.  The idea is to get this value, update it based on the iteration in TestStand ( this is already acquired and working ), and then set the value back.  Then, move on to the next step and so forth.
Any suggestions?
Thanks.
-G-
Solved!
Go to Solution.

So, I tried the example and it works but only for a single step.  I've tried two options:  1. having a single step that programmatically changes all the result names in all the other steps in the sequence. 2. having each step update the result names itself.  For thought 1 the loop would run and the changes would occur but when the function was exited I'd get an exception from TestStand.  No real information in the details as it looked like a memory corruption error.  I then examined the details of what occurred and tried more experiments.  If I had the loop have more than 1 iteration this behavior occurred.  If I comment out the set function it still occurs.  Then, for thought 2, it works like a champ on all the steps until I loop back to the top of the sequence.  Then, on the first step ( 2nd time through ) it bombs out.
Attached is the code for the 2nd possible solution.
Does anyone know what the problem is or if there's a way to do this?
-G-
Attachments:
Change Step Name.txt ‏7 KB

Similar Messages

  • How can i update data in JTable at run time ?

    i am trying to build a client/server architecture for conducting quizzes & online tests.. My client will return a object to the server after the test is over, which contains details about the participant, his score and other details. i am putting the incoming object to an Vector. I'll create a new thread each time for the incoming connection and insert the object to the Vector.. Now, please tell me tat, how can i update my table automatically at run time so tat, my table is updated whenever a new object is entered into vector..
    here is my code for the table..
    public class MyTableModel extends AbstractTableModel {
        String columNames[] = { "ID", "NAME", "COLLEGE", "SCORE", "CELL" };
        /** Creates a new instance of MyTableModel */
        public MyTableModel() {
            Main.List = new Vector();
            SetDefaultData();
        public int getRowCount() {
            return Main.List == null ? 0 : Main.List.size();
        public int getColumnCount() {
            return columNames.length;
        public String getColumnName(int column) {
            return columNames[column];
        public boolean isCellEditable(int row,int col) {
            return false;
        public Object getValueAt(int rowindex, int columnindex) {
            if(rowindex < 0 || rowindex >= getRowCount())
                return "";
            Student row = (Student)Main.List.elementAt(rowindex);
            switch (columnindex)
                case 0 : return row.id;
                case 1 : return row.name;
                case 2 : return row.college;
                case 3 : return row.score;
                case 4 : return row.cell;
            return "";
        public String getTitle() {
            return "Student Table";
        private void SetDefaultData() {
            Main.List.removeAllElements();
            Main.List.addElement(new Student("CS041","Keerthivasan M","MNM",95,"9884326321"));
            Main.List.addElement(new Student("CS012","Arun M","MNM",90,"9884825780"));
            Main.List.addElement(new Student("CS019","Balaji S","MNM",79,"9841742068"));
            Main.List.addElement(new Student("CS005","Anand R","MNM",89,"9884130727"));
            Main.List.addElement(new Student("CS045","Manish J","MNM",55,"9841624625"));
            Main.List.addElement(new Student("CS013","Mangal S","MNM",5,"9841961742"));
    }

    In the future Swing related questions should be posted in the Swing forum.
    how can i update my table automatically at run time so tat, my table is
    updated whenever a new object is entered into vector..You don't update the Vector directly. You should be creating a method in your TableModel, called "addRow(...)". This method will do two things:
    a) add the Student object to the Vector
    b) invoke the fireTableRowsInserted(..) method of AbstractTableModel. This will cause the table to be repainted.

  • How to pass column name at run time in function.

    how to pass column name at run time in function as parameter.
    thank in advance
    pramod patel

    Hello,
    Using dynamic sql you can pass column name to function. well I am not getting what you really want to do ? Please write in more detail. By the way I am providing one example here. see it uses dynamic sql.
    Create or replace function fun_updtest (p_columnname_varchar2 in varchar2,
    p_value_number in number)
    return number is
    v_stmt varchar2(500);
    begin
    v_stmt := 'update emp
    set '||p_columnname_varchar2||' = '||to_char(p_value_number)||'
              where empno = 7369';
    execute immediate v_stmt;
    return 0;
    commit;
    end;
    call to this function can be like this..
    declare
    v_number               number;
    begin
    v_number := fun_updtest('SAL',5000);
    end;
    Adinath Kamode

  • Reading from a file. How to ask the user for file name at run time????

    I have the code to read from a file but my problem is how to prompt the user for the file name at run time.
    import java.io.File;
    import java.io.FileNotFoundException;
    import java.util.InputMismatchException;
    import java.util.Scanner;
    public class FileRead {
        public static void main(String args[]) {
            Scanner scan = null;
            File file = new File("Results.txt");
            String number;
            try {
                scan = new Scanner(file);
                while (scan.hasNext()){
                number = scan.next();
                System.out.println(number);}
            catch (FileNotFoundException ex1){
                System.out.println("No such file");
            catch (IllegalStateException ex2){
                System.out.println("Did you close the read by mistake");
            catch (InputMismatchException ex){
                System.out.println("File structure incorrect");
            finally{
                scan.close();}
    }Any hints would be greatly appreciated. Thank you in advance

    I have read through some of the tutorials that you have directed me too and they are very useful, thank you. however there are still a few things that i am not clear about. I am using net beans 5.0 I have placed a text file named Results.txt into the project at the root so the program can view it.
    When I use the code that you provided me with, does it matter where the file is, or will it look through everywhere on the hard drive to find a match?
    This code compiles but at run time it comes up with this error
    run-single:
    java.lang.NoClassDefFoundError: NamedFile
    Exception in thread "main"
    Java Result: 1
    BUILD SUCCESSFUL (total time: 3 seconds)
    import java.util.Scanner;
    import java.io.*;
    class NamedFileInput
      public static void main (String[] args) throws IOException
        int num, square;   
        // this Scanner is used to read what the user enters
        Scanner user = new Scanner( System.in );
        String  fileName;
        System.out.print("File Name: ");
        fileName = user.nextLine().trim();
        File file = new File( fileName );     // create a File object
        // this Scanner is used to read from the file
        Scanner scan = new Scanner( file );     
        while( scan.hasNextInt() )   // is there more data to process?
          num = scan.nextInt();
          square = num * num ;     
          System.out.println("The square of " + num + " is " + square);
    }his is the code that i used. It is the same as the code you posted for me (on chapter 23 I/O using Scanner and PrintStream) Sorry im just really stuck on this!!

  • How to get sequence name in run time.

    hi
    I have several sub sequence called in the main sequence in TestStand. Those sub sequences have different sequence names, which i wanted to display by string indicator on the Labview Operator Interface. Is there a simple way to show the current calling sub sequence name during run time(run main).
    thanks.
    Message Edited by Appledoll on 07-12-2007 10:12 AM

    Hi,
    The easiest way is to use the NameOf() function. In this case where you wish to get the name of the current sequence the syntax NameOf(RunState.Sequence) yields the name. I attach a very simple example also.
    Getting the Name of Any TestStand Property Programmatically in TestStand
    Hope this helps
    Pelle S
    District Sales Manager
    National Instruments Sweden
    Attachments:
    Get sequence name.vi ‏15 KB

  • After updating my itunes per the update notice I received a run-time error R6034 message. Now I am unable to use iTunes. What can I do to repair this error?

    After updating my iTunes per the update notice I received a run-time error R6034. Now I am unable to access iTunes at all.
    Can someone tell me how to correct this problem?

    Uninstall your existing copy of iTunes. Delete any copies of the iTunesSetup.exe (or iTunes64Setup.exe) installer files from your downloads areas for your web browsers and download a fresh copy of the iTunes installer from the Apple website:
    http://www.apple.com/itunes/download/
    (The current build of the 11.1.4.62 installer was changed a few days ago, which fixed the bulk of the reports of MSVCR80.dll/R6034/APSDaemon.exe/Error-7/AMDS-could-not-start trouble ... but the build number on the installer was not changed. So we're trying to make sure you do the reinstall using a "new good" 11.1.4.62 installer instead of an "old bad".)
    Does the install with the new copy of the installer go through properly? If so, does that clear up the error message?
    If you still have the same error messages cropping up, then try the procedures from the following user tip:
    Troubleshooting issues with iTunes for Windows updates

  • How to change Crystal Reports XI database name at run time from ASP code using ADO

    Dear All,
    I need advises regarding to my problem below
    I have two database in same SQL 2005 SERVER for TEST01 and LIVE01 Environtment, and I've created more than 100 reports with Crystal Reports 11 and call it from ASP classic page.
    The problem is how can I change a database from TEST01 to LIVE01 at the run time from ASP code as I already using TEST01 database on Crystal Reports and I do not want to set a new database location inside crystal for each reports
    Thanks and wait for your reply soon.
    Below is my code, which has no effect to crystal reports although I've change the database from TEST01 to LIVE01:
    <%
    Dim oADOConnection, oRptTable, oADORecordset, sql
    Dim struser, strpwd, strdriver, dblocation, dbname, strConnect
    struser = "sa"
    strpwd = ""     
    strdriver = "{SQL SERVER}" 
    dblocation = "SQL200501"     
    dbname = "LIVE01"    ' Changed from TEST01 to LIVE01
    strConnect = "User Id=" & strUser & ";"
    strConnect = strConnect & "PWD=" & strPwd & ";"
    strConnect = strConnect & "DRIVER=" & StrDriver & ";"
    strConnect = strConnect & "SERVER=" & DBLocation & ";"
    strConnect = strConnect & "DATABASE=" & dbName
    sql="Select * from Employee"
    Set session("oApp") = Server.CreateObject("CrystalRuntime.Application.11")
    Set session("oRpt") = session("oApp").OpenReport("C:\REPORTS\RPT01.RPT", 1) 'USING TEST01 DATABASE
    session("oRpt").MorePrintEngineErrorMessages = False
    session("oRpt").EnableParameterPrompting = False
    session("oRpt").DiscardSavedData
    Set oADOConnection = Server.CreateObject("ADODB.Connection")
    oADOConnection.Open (strConnect)
    Set oADORecordset = Server.CreateObject("ADODB.Recordset")
    Set oRptTable = session("oRpt").Database.Tables.Item(1)
    oRptTable.SetDataSource oADORecordset, 3
    session("oRpt").SQLQueryString = CStr(sql)
    session("oRpt").ReadRecords
    %>

    Did you ever find a solution to this problem?  I have the same problem when moving reports from development to Test to Production environments.  If the DBName is not the same the report ignores the name provided at runtime.

  • Appending in file and supplying file name at run time using File Adapter

    Hi,
    Can we use File Adapter to write in a file in append mode. i.e. a BPEL process opening a file appending some text and closing the file each time it called.
    Another query is can we create the file at run time with the supplied file name?

    In order to append to a file, we can use Append="true" in the interaction spec for the File/Ftp adapter.
    <jca:operation
    FileType="ascii"
    PhysicalDirectory="/home/adapter/output"
    FileNamingConvention="OutputFile.txt"
    NumberMessages="1"
    Append="true"
    >
    Filename we can specify in wsdl...

  • Printer Name in Run Time

    Hello,
    Is there any standard API to get the name of the Printer from the program run time? Please let me know if anyone knows.
    Thanks,
    Genoo

    Please see if (FND_PRINTER_PKG) helps.
    FND_PRINTER_PKG -- 11i
    http://etrm.oracle.com/pls/trm11510/etrm_pnav.show_object?c_name=FND_PRINTER_PKG&c_owner=APPS&c_type=PACKAGE
    PACKAGE: APPS.FND_PRINTER_PKG - R12
    http://etrm.oracle.com/pls/et1211d9/etrm_pnav.show_object?c_name=FND_PRINTER_PKG&c_owner=APPS&c_type=PACKAGE
    Thanks,
    Hussein

  • User defined spoolfile name at run time.

    Hi all,
    What I want to run in SQLPlus is
    PROMPT Enter a spoolfile name
    SPOOL &SpFile
    SELECT * FROM Scott.emp
    SPOOL OFF
    When I run this as a script - i.e. @foo.sql, it works fine - i.e. it prompts the
    user for a name for the SpFile. However, when I copy and paste the text into
    SQLPlus and try and run it, it fails - it runs through the PROMPT/SPOOL bit
    of the script with the message
    apps@WHITE> SPOOL &SpFile;
    Enter value for spfile:
    not spooling currently
    apps@WHITE>
    and produces no output. If I put SPOOL '&SpFile'; it produces a file
    called ''.lst - yes two single quotes.lst.
    Can anyone explain what is going on and how I can get the
    behaviours to match in the interactive and batch modes?
    TIA.
    Paul...

    SQL> spool off
    SQL> spool &a
    Enter value for a: c:\abc.txt
    SQL> select count(*) from user_objects where
    rownum<=1;Thanks for your interest, but you have slightly misunderstood me.
    It will work fine if I have the spool &xyz in my_script.sql and then do
    SQL> @my_script
    but it does not* work if I copy and paste the contents of my_script.sql
    at the SQL> prompt - i.e. all in one go.
    This puzzles me, because it works fine if I copy and paste a multiline sql
    statement which has an & in the SELECT part of the statement. I think it's
    related to an issue I noticed recently whereby if you copy and paste an
    SQL script into the buffer which contains non-SQL (i.e. column blah format a30),
    for example, SQLPlus throws an error when you try to run what's in the
    edit buffer by typing / and return.
    This is why I started copying and pasting at the prompt in the first place,
    but this is the first time I've tried to input a "non-SQL" variable name in
    this fashion.
    This is where I'm having the issue. Hope this is clearer now.
    Paul...

  • How can i assign view page name at run time in task flow

    Hi,
    jdev 11.1.2.3.0
    I have a requirement to get view page (jsff page) dynamically.
    Ex: I have TF in that i have two views i.e view1 and view2. in view1  there is one inputtext and button in inputtext i will give the name of the page, In view2 that particular page should be displayed.
    Input Text                 View2
    Employee                Employee Page
    Department              Department Page
    How can i implement this ?
    Thanks,
    Nitesh

    Use a router in your task flow and point to the page you want to display according to the value entered in the input text.
    A sample on how to use this technique can be found here http://tompeez.wordpress.com/2011/11/27/jdev-11-1-2-1-0-using-router-to-conditionally-set-navigation-target/
    Timo

  • How to Use Table name at run time

    Hi All
    I have created a function that accepts a table name as a parameter and returns the maximam sequence number, but in my function body i can not write the parameter name as a table i.e.
    CREATE OR REPLACE FUNCTION MAX_ID(TAB_NAME Varchar)
    RETURN Number IS
    max_id Number;
    CURSOR curSalPoint IS
         SELECT MAX(EMP_NUMBER)
         FROM TAB_NAME ;
    BEGIN
    max_id:=0;
    OPEN curSalPoint ;
         FETCH curSalPoint INTO max_id;
         CLOSE curSalPoint;
    RETURN max_id
    END
    But it will give an error saying
    (1):PL/SQL: ORA-00942: table or view does not exist
    for "TAB_NAME"
    Any help would be appreciate ........

    Yes, as i contcatinated table name with the original statement, so you can also continate fields' names with your statment and execute immediate the statement.
    Sorry i forgot this statement in my function, to execute the statement you need to include following statement
    CREATE OR REPLACE FUNCTION MAX_ID(TAB_NAME Varchar)
    RETURN Number IS
    max_id Number;
    query varchar2(200);
    BEGIN
    max_id:=0;
    query:=null;
    query := query || 'select max(empno) into max_id from'|| tab_name;
    EXECUTE IMMEDIATE query;
    RETURN max_id;
    END;
    Message was edited by:
    Salman Qureshi

  • Table name at run time in Stored procedure

    I have a SQl statement within my stored procedure as :
    SELECT LastModifiedDate INTO v_Date FROM TABLE1 WHERE ID = v_ID;
    Can I use a variable vTableName instead of directly putting the
    value "TABLE1" (that is actual name of the table ).
    Please excuse me if the question sounds trivial.
    Cheers!!

    You need to use Dynamic Sql. In your procedure
    DECLARE
    v_sql_stmt varchar2(2000);
    v_Date       DATE ;
    begin
    v_sql_stmt :=  'SELECT LastModifiedDate FROM TABLE1 WHERE ID = :1 ' ;
    execute immediate v_sql_stmt into v_Date  using v_ID ;
    end;

  • Structure field names at run time.

    Hi Experts ,
    i am not sure whether this is right question or not. i have on structure say X with fields name and age. is there any way to represent this field with the help of another variable at runtime.
    ex : Can i represent X-name as X-i where 'I' is s a string and will hold 'NAME' as a value.
    can this be achievable. kindly give reply.
    Thanks in advance.

    types:begin of ty_x,
          name type c,
          end of ty_x.
    data:wa type ty_x.
    data:v type string.
    field-symbols:<fs> type any.
    data:field(4) type c.
    start-of-selection.
    field = 'NAME'.
    concatenate 'WA-' field into v.
    assign (v) to <fs>.
    <fs> = 'A'.
    write wa-name.

  • Automatic Retry run-time error step in TestStand

    Hi, I am using an instrument at many places in my sequence (let's say 5 times). I am using the Labview instrument driver. Sometimes (every 50 calls), the instrument driver call gives me a run-time error because the instrument is somehow busy. But usually by doing a retry on the step that caused the run-time error, it works. However, in few cases, the instrument is really defective. In order to make my sequence more robust, I want all that handled in TestStand (I want the operator to stay away from the big grey popup. Many of them freaks out when they see this…). I was thinking adding 2 callbacks to my sequence: 1)        Post run-time error: a.        If local “index” == 1, run cleanupb.        If “index” == 0, retry the current step (by manipulating the current step id)c.        Incrementing “index” to 12)        Post step:a.        If step.Result.Status != “Èrror”, ”index” = 0 Index is a local variable in my sequence This algo might work, but is there another way of doing this? You can loop on the failures, but not on the errors.    
    Thanks
    Alexandre

    Alexandre,
    there are many ways to accomplish your task.
    Here's a small list:
    - Disable default error handling and "do error handling in your sequence" (using gotos with precondition) 
    - Use the SequenceFilePostStepRuntimeError Callback
    - Handle the retry-functionality within your codemodule
    I'd suggest you to choose either the second or third option. As Juergen already stated, you can alter the behaviour of TS in regard to runtime errors. The default behaviour displays a dialog asking the operator on how to react. On automated systems, this setting is nonsense, therefore it is suggested to switch to "Run Cleanup". I wouldn't choose any other setting here.
    Using the Callback Sequence is nice since it can be used in a very general way and you can call certain alternativ test strategies if the instrument fails to work.
    Implementing the error handling within the codemodule nevertheless optimizes execution times and could be better in other aspects as well. But on the other side, you have to deside what should happen if the error cannot be solved by the module itself.....
    hope this helps,
    Norbert 
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

Maybe you are looking for

  • Udf Data is not being displayed in the report

    Hi all, i have designed one report in which i am displaying some udf fields along with other system fields. i have not used any selection criteria. when i run report it doesn't display udf data of some random rows in the report even if data is perese

  • Findind my backed up files after a complete restore

    I just had to do a complete restore on my laptop and i really need help finding all of my files i had backed up i cannot find them and there were pics and imprtant legal documents on there please some one help me.....

  • CSA issue with firewall rule

    I created a rule in CSA 6.0 that, by default, blocks any application on any machine being connected as a server.  On a DC we made an exception for the server to be connected on UDP 53 for DNS.  However, we are seeing the following messages below.  Th

  • Arch Linux and Splashy, a big update

    edit 2: If you don't want to build from sources have a look at this post: http://bbs.archlinux.org/viewtopic.php? … 03#p371403 edit: UPDATED LINK: http://slexiw.netsons.org/files/splashy-stuff7.tar.gz About me: I'm a professional developer (mainly c/

  • Scheduler demo application

    I tried the following demo application. http://www.oracle.com/technology/tech/java/oc4j/1013/how_to/how-to-scheduler-jms/doc/readme.html I got the message "OC4JScheduler: DEMO COMPLETE" on the webpage. However, There is following error message in the