Create array varible in TestStand 4.0

Hi  gurus,
       I have a doubt that how can we create Array of string in TestStand 4.0 using C#.NET environment.
I used following method, but failed to create array:
objPropertyObj.SetValStringByOffset(10,PropertyOpt​ions.PropOption_InsertIfMissing,"SRU"); // exception here....
The other following method creates array with empty size:
objPropertyObj.NewSubProperty("SUBSTITUTE.SRU", PropertyValueTypes.PropValType_String, true, "Arrayw",10 );
Please let me know how to set the length of the array at second method.
Thank you,
regards
RKK

You should post to the TS board.
Try to take over the world!

Similar Messages

  • Java.lang.ClassCastException while creating array descriptor

    ( This post was moved from SQL / PLSQL forum to here )
    Hi everyone, i used to pass string array from java to plsql. I wrote a java source, then i load db with loadjava. And i wrote java spec. Then i run the function but i am getting this error :
    java.lang.ClassCastException
    at oracle.jdbc.driver.PhysicalConnection.putDescriptor(PhysicalConnection.java:4921)
    at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:208)
    at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:175)
    at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:158)
    at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:125)
    at SplitterOracle3.tokens2(SplitterOracle3.java:29)
    My Java Source is :
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.sql.DataSource;
    import oracle.sql.*;
    import oracle.jdbc.driver.OracleConnection;
    import oracle.jdbc.driver.OracleDriver;
    public class SplitterOracle3 {
    public static oracle.sql.ARRAY tokens2(String str,String delim)
    try
    //Class.forName("oracle.jdbc.driver.OracleDriver");
    //DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    //Connection conn = new OracleDriver().defaultConnection( );
    OracleDriver ora = new OracleDriver();
    OracleConnection conn = (OracleConnection) ora.defaultConnection();
    //ArrayDescriptor arrayDesc = ArrayDescriptor.createDescriptor("MY_ARRAY", ((conn).getRealConnection());
    //Connection conn = DriverManager.getConnection("jdbc:default:connection:");
    //Connection conn = ((DelegatingConnection) getDataSource().getConnection()).getInnermostDelegate();
    // get an initial context
    //OracleConnection oracleConnection = (OracleConnection)WSJdbcUtil.getNativeConnection((WSJdbcConnection) wsConn);
    ArrayDescriptor arraydesc =
    ArrayDescriptor.createDescriptor ("ARR_VARCHAR_100", conn);
    String strarr[] = new String[47];
    strarr[0]="ahmet";
    strarr[1]="mehmet";
    int curIndex = 0;
    int nextIndex = 0;
    boolean nextIsLastToken = false;
    int i=0;
    while (true)
    nextIndex = str.indexOf(delim, curIndex);
    if (nextIsLastToken)
    //return false;
    break;
    if (nextIndex == -1)
    nextIsLastToken=true;
    nextIndex = str.length();
    strarr[i] = str.substring(curIndex, nextIndex);
    curIndex = nextIndex + 1;
    i++;
    ARRAY dirArray = new ARRAY(arraydesc, conn, strarr);
    return dirArray;*/
    catch(Exception ex)
    System.err.println(ex.getMessage());
    ex.printStackTrace();
    return null;
    public static void main(String[] args)
    String str="2000,2,123553168,1,10,64895,65535,27662,64860,64895,65535,27662,64860,0,,,,,,0,0,2491039806,,,,,,,,,0,0,1,,2491039106,,,,,,,,,,,,";
    String strarr[] = new String[47];
    long l1,l2;
    int j=0;
    l1 = System.currentTimeMillis();
    for ( int i=0; i<20000000; i++)
    strarr = tokens2(str,",");
    l2 = System.currentTimeMillis();
    System.out.println("Fark :"+ (l2-l1));
    The line has "ArrayDescriptor.createDescriptor ("ARR_VARCHAR_100", conn);" causes this error.
    java.lang.ClassCastException
    at oracle.jdbc.driver.PhysicalConnection.putDescriptor(PhysicalConnection.java:4921)
    at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:208)
    at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:175)
    at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:158)
    at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:125)
    at SplitterOracle3.tokens2(SplitterOracle3.java:29)
    But i could not find the solution. Can you help me?
    Thanks for responses.

    Hi,
    Did you try my suggestion from Re: java.lang.ClassCastException while create array descriptor
    Try replacing
    oracle.jdbc.driver.OracleConnectionwith
    oracle.jdbc.OracleConnectionRegards
    Peter

  • Creating array of strings in Webi

    In Webi I need to create array of string in one formula and want to use that formula in another formula, Now my issue here is how can I create a array in webi.
    Please help me.
    Thanks
    Siva

    Hi,
    I didn't see any option for creating Array in WebI .
    You will have to do it in Backend .

  • Creating array descriptor

    I need to create an array descriptor for a type that is defined in a package (Oracle 8.1.6).
    If I define the type outside the package I can create the descriptor, otherwise I can't - even if I fully qualify the type with:
    USER.PACKAGE.CUSTOMTYPE
    or
    PACKAGE.CUSTOMTYPE
    The JDBC connection is created under the USER account.
    Any ideea if this is a bug in JDBC or am I doing something wrong ?
    Thanks,
    Calin
    null

    Hi,
    Did you try my suggestion from Re: java.lang.ClassCastException while create array descriptor
    Try replacing
    oracle.jdbc.driver.OracleConnectionwith
    oracle.jdbc.OracleConnectionRegards
    Peter

  • How do I dynamically name and create arrays?

    I need to create arrays dynamically based on user's input. For example, if user enters 5, I have to create 5 arrays. Can anyone please tell me how to name and create them?

    So, if you don't know how many arrays to create when you're writing the code, you wouldn't name them. You'd create an ArrayList (or some other collective data structure) and name that, and then put the 5 arrays into that structure.

  • How to create arrays

    Hello,
    I am quite new to Diadem and have some issues creating arrays. I am about setting up a pressure controle. Using starting pressure I determine a voltage between 0..10V to get this pressure. For instants: 50 bar correspond to a voltage of ca. 1.429 V. Due to the pressure I get a deformation of a piece, which needs to be linear, so I have to controle the pressure using the voltage. If the deformation runs to fast I obviously need to decrease the pressure, though the voltage. I used a formule Ds1+R1 wher Ds1 is the starting voltage and R1 the voltage which results from the difference of the real deformation and the wished deformation. For instance, the first step is the starting pressure plus lets say 0,5 V which gives 1,929V. This value I need to save to get the next pressure after. The way I chose always uses the starting pressure plus the voltage difference, which is wrong, so I thought to create arrays but I do not know how. Does anyone have clue? Hope to have explained the problem properly, otherwise just ask. I am using Diadem 8.0
    Thx
    d

    Hi dirkounet,
    Just to clarify, are you in fact asking for help in doing the above with a DIAdem-DAC block diagram?  Or are you perhaps asking about processing the data resulting from such an experiment?  The answers to these two questions are quite different, and I can unfortunately only help you with the latter, though others can help you with the former.
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments

  • Creating array reboots xserve raid?

    when using RAID admin to create an array, the application tells me it will reboot the xserve raid. Does it reboot the entire system or just the controller that has the newly created array?

    Just the controller containing the RAID set -- any arrays on the other "half" of the Xserve RAID will not be rebooted.
    Note it also only does this if you create the first array, or delete the last array, on a RAID controller. So for example, if you have 2 RAID sets on a RAID controller, and delete one, the controller won't reboot. Only if you delete both off them.
    If you only have one RAID set per side of the RAID, this of course isn't really applicable.

  • How do i create arrays more efficientl​y

    how do i create arrays more efficiently?... need to insert data into an array every loop iteration.  I am using the insert into array function and shift registers.  I have been told this is inefficient... and they are right because I can make the program stop and it gives me the error that labview does not have enough memory.  A coworker said to avoid shift registers and investigate property nodes... i am new at this and don't know what this is exactly.. is there a tutorial on efficent data handling.. or examples that would be usefull? 

    tbob wrote:
    Mark is absolutely correct.  Indexing will take a lot of memory and a lot of time when the array gets large.  Indexing is great for small arrays though. With indexing, the first loop iteration will create an array of size 1.  On the next loop, the array has to be copied, re-dimensionedcto size 2, old data copied to new array, and new data inserted at end.  You can see how this will become a monster with an array size of 10,000.  With pre-allocation, there is no re-dimensioning and no copying.  Array elements are simple replaced.  And yes you do have to know the upper limit to use pre-allocation.  Kudos to Mark for pointing out the facts.
    A bit of a clarification is needed. Folks from NI told me that LabVIEW tries to be smart when autoindexing. When they allocate the memory the initial chunk of memory it is larger than a single element. So you don't necessarily get a copy and allocation every iteration. They may have improved the optimization to preallocate the complete array if the size is already known (a constant wired to the loop count). However, they would have no way of doing this if the number of iterations is not known ahead of time.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • Dynamically create arrays

    I need to create arrays dynamically based on user input. I did try using ArrayList. For example if user enters 4 I did the following:
    ArrayList names=new ArrayList();
    for( i=0;i<4;i++)
       String str="array" + i;
       names.add(str);
    }The ArrayList will contain 4 names.......... but how do I create arrays with those names?
    String t = (String) names.get(i);
    String[] t = new String[10];I tried this code but it creates an array named t instead of whats stored in the ArrayList.
    Please help.........what should I do?

    Please help.........what should I do?You can use an associate data structure such as a HashMap. It stores pairs of values - key and item. The access on key is very fast and it will provide the corresponding item. In your case the key can be the array "name" in the form of a String, and the item can be the associated array.

  • Programati​cally create local variable in TestStand

    Can somebody please explain the process of creating a local variable programatically?  I have searched the forums but haven't found what I am looking for yet.
    I have an array of unknown size.  I use a foreach loop to step through the array and grab the data that I need.  I need to put that string in a Local String Variable that I can use later.
    Any help is much appreciated.
    Matt
    Solved!
    Go to Solution.

    That did exactly what I wanted it to do thank you.  Now I want to take it one step further...
    I have a local variable array called RI_Equipment that is of an unknown size.  The array contains a container data.  I want to create a variable of name ri_nameField+"_ID" and then set the value of that variable to what is contained in RI_Equipment[x].ri_IDField.  Hope that all makes sense.  Below is the statement I have in TestStand however TS tells me that this will cause a run-time error.  What am I doing wrong?
    Locals.NewSubProperty(Locals.RI_Equipment[Locals.l​oopcounter].ri_nameField+"_ID",PropValType_String,​False,"",0) = Locals.RI_Equipment[Locals.loopcounter].ri_IDField
    Matt

  • How to create array of indicators, with the indicators numeric text value changes as it falls above or below the limit

    Hi,
    I am a newbie here. Just started using Labview for my project. Currently having some difficulties over here. Hopefully someone could enlighten me. I wanted to create an array of 60 indicators, where the indicators value are measured from the PCI card. But now the problem is how to make my indicator values in the array change its numeric text color if it falls below or above the limit set. I've attached the vi together with this. Thanks.
    Regards,
    CH.Ong
    Attachments:
    testing.vi ‏15 KB
    try.vi ‏120 KB

    Maybe, you can try something like this...
    - Partha
    LabVIEW - Wires that catch bugs!
    Attachments:
    To change Boolean Text Color in Array of Clusters.vi ‏18 KB

  • How do you create array of enums for transitions in a state machine?

    Hello,
    I am trying to build a state machine, but, I am struggling with understanding the methods for determining which state to transition to next.  In other words, I have several states, but, I don't want to go in any particular sequence.  If I have states numbered 1 through 10, I want to be able to go 1-4-2-5-6-2-6-1-10 etc. in no particular order. I want the transition to the next state  (and actions) to be determined by the streaming data, which can be random and require access to any of my 10 states at any time and in any sequence.
    I saw this picture on the "Application Design Patterns: State Machines" white paper, but, it leaves out some important details.  How does one create the structure in BLUE shown in 3C?  When I try to create this array of enums, all of them are the same. I am not able to make a list of different enum values.  In other words, when I type in "2", then, all the values in the array display as "2."
    There is a nice, simple video example of a state machine for dispensing soda for $0.15, however, this state machine moves in a single sequence, from 5 cents, to 10 cents to dispense; it does NOT illustrate how to select a state "out of order."  I need to understand how a state machine can move from "5 cents" state to dispense directly, with the addition of 10 cents to the "5 cents" state.
    Can anyone suggest a really good tutorial on how to make the selector work in a state machine?  I have been reading some of the available material on ni.com, but, I can't find a good detailed explanation of how to do it.  I remain confused. 
    Or, can you just explain how they created the BLUE array in the attached picture?  Maybe I can figure it out from there.
    Thanks,
    Dave
    Solved!
    Go to Solution.
    Attachments:
    next state.jpg ‏75 KB

    Hi Kathryn,
    Yes, this is EXACTLY what I want to accomplish...
    So it would basically run:
    State 1
    Read input
    Determine next state (say 3)
    State 3
    Read input
    Determine next state
    State
    Read input
    Determine next state
    And so on...
    But, I am quite new to programming Labview state machines, and can't figure out how to even start when the sequence of states is random instead of fixed!!! I can do 1,2,3,4, like the vending machine VI example, but,  not 1,3,2,2,2,5,2,1 etc. based on external input.  Is there some simple example case I can study?  I can't believe I am inventing this for the first time.
    "select the state to run" 
    But, HOW do I do this???????   This is exactly the question I am asking...how is this done?  Please see the attached 3-state system....how do I hook this up????  I am totally lost here...can you help me understand how to wire this thing??  In this simpe RED/GREEN/BLUE case, my input is just the number a user would input on the front panel....  Apparently, there are two files necessary... a vi and .ctl???  What  is .ctl?
    Thanks,
    Dave
    Attachments:
    forum nov 12 red green blue.vi ‏7 KB
    forum nov 12 red green blue.ctl ‏5 KB

  • Applescript - ID - CS3 or CS4 - create array containing front/back order of objects?

    Hi all,
    I'm looking for ideas of how to do this: create a layer for each object in the document, then move each object onto it's own layer — and preserve front/back arrangment. In other words, 10 objects = 10 layers, without changing stacking order.
    So far I've got it creating unique layers and moving objects onto each. . .but i'm looking for the most efficient way to have it handle the original stacking order.
    I suppose i can start learning how to build an array, then re-order it by index (which i understand indicates front/back), and then create layers following that order? If that's the best way, I'd LOVE some direction on how to code that. Or, if there a more elegant solution?
    Thanks for any help!
    CS3 is ideal but can use CS4 if necessary (or CS5 if there's some killer function in there)

    It's a vertical imposition script. Items from the top half of each page are moved to a different page (using a temp page as a staging area), then pages are reshuffled. Here is the script:
    tell application "Adobe InDesign CS5"
    set myDocument to active document
    save myDocument
    set fp to file path of myDocument
    set DocName to name of myDocument
    if DocName ends with ".indd" then
    set DocName to characters 1 thru -6 of DocName as string
    end if
    set myFileName to fp & DocName & "-imposed.indd" as string
    tell myDocument
    repeat with i from 2 to 7
    set myPage1 to page i
    set myPage2 to page (16 - i)
    set myTempPage to page 15
    set myItems1 to (every item of all page items of myPage1 whose (class is in {rectangle, oval, polygon, graphic line, text frame}) and (parent's class is spread))
    set myItems2 to (every item of all page items of myPage2 whose (class is in {rectangle, oval, polygon, graphic line, text frame}) and (parent's class is spread))
    repeat with myPageItemCounter from (count myItems1) to 1 by -1
    set myitem to item myPageItemCounter of myItems1
    set locked of myitem to false
    set mybounds to geometric bounds of myitem
    if item 3 of mybounds < 52.5 then
    tell myitem to move to myTempPage
    tell myitem to move to {item 2 of mybounds, item 1 of mybounds}
    end if
    end repeat
    repeat with myPageItemCounter from (count myItems2) to 1 by -1
    set myitem to item myPageItemCounter of myItems2
    set locked of myitem to false
    set mybounds to geometric bounds of myitem
    if item 3 of geometric bounds of myitem < 52.5 then
    tell myitem to move to myPage1
    tell myitem to move to {item 2 of mybounds, item 1 of mybounds}
    end if
    end repeat
    set myTempItems to (every item of all page items of myTempPage whose (class is in {rectangle, oval, polygon, graphic line, text frame}) and (parent's class is spread))
    repeat with myPageItemCounter from (count myTempItems) to 1 by -1
    set myitem to item myPageItemCounter of myTempItems
    set mybounds to geometric bounds of myitem
    tell myitem to move to myPage2
    tell myitem to move to {item 2 of mybounds, item 1 of mybounds}
    end repeat
    end repeat
    delete page 15
    move last page to after page 1
    move last page to after page 3
    move last page to after page 5
    move last page to after page 7
    move last page to after page 9
    move last page to after page 11
    save myDocument to myFileName
    end tell
    end tell

  • Looking for way to replace " with \" inside of coldFusion created array for JSFL

    I am trying to figure out the best way to fix data coming from a database table through the use of ColdFusion, in which there are some quotation marks that JavaScript Flash doesn't want in the array before adding the text content to a quiz.
    At the moment, if there are any quotation marks in the elements of the array, even though each element is surrounded by quotation marks, I have to add a backslash to escape them.
    I was wondering what would be the regular expression to use to do this, not for the quotation marks surrounding each element, but for those used inside of them.
    For example,
    ["08 Working with Flash Forms_16",
    "The syntax for the submit button was .",
    "name="submit" type="submit"",
    "name="submit"action="submit"",
    "id="submit" type="submit"",
    "id="submit"action="submit"",
    "No, name="submit" type="submit" is correct.",
    "true",
    "false",
    "false",
    "false",
    "897"] ,
    is an example of an element created that has quotation marks inside of the quotation marks for each element.
    I am debating about handling this either with XML by writing code to do that with ColdFusion instead of using the code I generated with ColdFusion to create this.
    I am also debating about writing the regular expression in a way that I could use it from either ActionScript 2 or 3.0, going at it at the file level maybe.
    At the moment I am opening the file and experimenting with writing a Find expression that uses regular expression to select what I want to change before changing it.

    I figured this out already. You can use the either the ColdFusion function, Replace, or REReplace if you want to use regular expressions. But I just wrote an actionscript prototype function inside the superclass called replace to fix it using split and join array methods.

  • How to create Array type parameter of Oracle 10.2.0.1.0 in java

    I create a collection type with:
    CREATE OR REPLACE
    type TEST_User.T_ARRAY AS TABLE OF VARCHAR2(100);
    and in java code, I use following code to create a parameter of this type, and set it for a procdure
    String[] userMakeArray = new String[]{"V", "N", "A"};
    oracle.sql.ArrayDescriptor descriptor = oracle.sql.ArrayDescriptor.createDescriptor("TEST_User.T_ARRAY", cn); // cn is connection instance to database
    oracle.sql.ARRAY array = new oracle.sql.ARRAY(descriptor, cn, userMakeArray);
    ((oracle.jdbc.OracleCallableStatement)call).setArray(8, array);
    when i use this to call procedure in Oracle 10.1, it work well.
    In Oracle 10.2, it does not work well.
    For test, I can execute procedure well in sql plus, but in java client, I found that array contains three items "Null", while array is correct when conect to 10.1 enviroment.
    does anybody know what's the reason for this.
    thanks a lot.

    Hi,
    Too long to copy/paste here but i have a simpler working example of Nested Table of VARCHAR2 type against 10.2.0.x, in chapter 3 and 8 of my book:
    create or replace type NTab_Vc2 as TABLE of varchar2(30)
    create table NSTableTab (id int, numnt NTab_Num, vc2nt NTab_Vc2, datnt
    NTab_Dat)
    nested table numnt store as NSTabNum,
    nested table vc2nt store as NSTabVc2,
    nested table datnt store as NSTabDat;
    insert into NSTableTab values (1,
    NTab_Num(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
    NTab_Vc2 ('One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Ten'),NTab_Dat('01-JAN-2003', '02-JAN-2003', '03-JAN-2003', '04-JAN-2003',
    '05-JAN-2003', '06-JAN-2003', '07-JAN-2003', '08-JAN-2003',
    '09-JAN-2003', '10-JAN-2003')
    // The following code snippet retrieves and returns a
    // NTab_Vc2 as a java.sql.Array
    OraclePreparedStatement ps = (OraclePreparedStatement)
    conn.prepareStatement ("SELECT VC2NT FROM NSTableTab
    WHERE ID = ?");
    ps.setNUMBER (1, id[0]);
    OracleResultSet rs = (OracleResultSet) ps.executeQuery();
    Array a = null;
    while (rs.next())
    a = (Array) rs.getObject(1);
    ps.close();
    return a;
    Kuassi, http://db360.blogspot.com/2006/08/oracle-database-programming-using-java_01.html

Maybe you are looking for