Setup ForEach Loop with 2D Array

Hello All,
  Would like to know how (if possible) to configure the "ForEach Loop" step in TestStand for an empty 2D Array.  What I have is a 2D array of character strings that represent sets of configuration parameters (i.e. each row contains several columns of parameters, and there are an undetermined amount of rows).  With the ForEach Loop, I would want it to loop once for each parameter row (not for each column of each row).  Right now it looks like it runs once for every column.  Please advise.  Thanks much.
Regards,
GSinMN     

Hi GSinMN    
There’s a TestStand known issue of transposing an incoming array from LabVIEW, if you are importing and array from LabVIEW you can transpose that array prior to pass it to TestStand. Because seems that the behavior you are seeing is due to a transposed array.
Here are some links with more information
http://www.ni.com/white-paper/8681/en/#161523_by_Category
http://forums.ni.com/t5/NI-TestStand/TestStand-Foreach-tutorial-or-example/td-p/1125230
regards
Chris S.

Similar Messages

  • Using a For Loop with an array

    Ok, the issue is with the enabling of the buttons on my
    stage. I run a loop to deactivate them all when one is clicked,
    then I want to turn them back on, EXCEPT the one which was clicked.
    I thought I could start off with an array of MC names and simply
    delete them from the array. But I can't get my head around exactly
    how to read in the array contents as MC names...
    Any help would be greatly appreciated.
    Mike

    Try something like this:

  • Urgent---- Usinging t-sql in Foreach loop with recordset

    Hi All,
           I am new to SSIS 2012.  I am trying to create a package that will loop through a control table and perform a series of task per record.  To be more clear this is what i am trying to do.
        *   Read a control plan table into recordset objPlan with 10 columns.  ( this seems to be working fine )  
        *   Do a Foreach loop that will run a
    t-sql task to delete all records from an output table then load new data.  (not working)
             @[User::var_Plan_dim] ( is one of the columns on the record set) this is indexed as 1
             I have tried to do a t-sql command
                         delete from table where plan = @[User::var_Plan_dim] ( this does not work )
                         ** I have ResultsSetType set to ResultSetType_None any other options causes error????
            Could you send me a link or show me an example of what the configuration should be for the
    Foreach and T-SQL should be? 
    Thank you in Advance!!!!
    I have working on this for days without any luck and I could really use your help...
    DH
    DHowe

    Hi hsbal,
            I have worked my way through that with your help Thank You...  
            But i am having another issue now, in the foreach loop i have 12 variable
          variable                                 index
           User::objplan                       0                        
    object
           User::var_Plan _ dim            1   etc....             string
           User::var_provider_status     11                      string
           when i run the process i get this error:
    Error: The enumerator failed to retrieve element at index "11".
    Error: ForEach Variable Mapping number 11 to variable "User::var_provider_status" cannot be applied.
    Error: The enumerator failed to retrieve element at index "11".
    Error: ForEach Variable Mapping number 11 to variable "User::var_provider_status" cannot be applied.
            So should the object variable be indexed 0?  I tried taking the objplan off the list of variable and renumber 0-10 and the program didn't like index "1" with the same error, do I don't think
    it is really column/field related.
    Thanks,
    Dawn
    DHowe

  • For each loop with multidimensional arrays?

    Hi.I have a problem with for each and multidimensional combination.
    public class TestCards
    static int[][] dizi={{1,2},{3,4}};
    static int t ;
    public static void main(String[]args)
         for (int[] i : dizi)
         System.out.println(i);
    The result of the codes above is like this
    [I@9304b1
    [I@190d11
    In other words the result is now integer.It has some strange chars which i dont know
    Pls help me !

    You're printing an array. Arrays don't override toString.
    - You could iterate over both dimensions and print each value yourself.
    - You could iterate over one dimension and call java.util.Arrays.toString to print a row at a time.*
    - You could call java.util.Arrays.deepToString to print the entire thing in one shot.
    *The second option is closest to what you're doing now.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How can you see the progress when using a ForEach loop?

    Hi,
    I have an array with about 100 containers in it. My main thread uses a ForEach loop with an inner case structure with six possibilities. My previous program had all the steps in a very long list, executing them one by one. I find this new approach is much nicer to look at, and easier to change, but there isn't really any way of telling how far along the test is (unless you know it by heart). In the long list approach, you could see all the Done/Passed outcomes and how many remained, now there is no way of telling.
    Any tips on making some kind of progress indication? 
    Solved!
    Go to Solution.

    As ObjectReference parameter, you should use 'Nothing'. The last parameter (synchronuous?) you can choose true or false. Please refer to the documentation of PostUIMessageEx for further information.
    The numeric parameter should range between 0-100. Since it is "Progress Percent", this makes sense, does it?
    The status bar has several panes, one e.g. displaying the logged in user or the used process model. The pane on the right most side will display the Progress Percent if used in your sequence.
    The default reporting, as already stated, includes this feature. So if you have a sequence with e.g. 500 steps, the reporting "will have a visible progress" in that pane (with less than 100 steps, it is most often too fast to see). Remember that NI Sequence Editor and the Full Featured User Interfaces do have this feature, the Simple UI does not have it.
    Norbert
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • Trouble with nested foreach loop

    I got 3 nested foreach loop but the 2nd and the third one outputs no data.
    $vss = "vSwitch3"
    $vmhost_array = @("host1,host2,host3")
    $vss_vlan_array = @("vlan50")
    $dvs_vlan_array = @("n1kv_vms_vlan50")
    foreach ($vmhost in $vmhost_array) {
    foreach ($vss_vlan in $vss_vlan_array) {
    foreach ($dvs_vlan in $dvs_vlan_array) {
    Get-VMHost $vmhost | Get-VirtualSwitch -Name $vss | Get-VirtualPortGroup -Name $vss_vlan | Get-VM | Get-NetworkAdapter | Set-NetworkAdapter -Portgroup $dvs_vlan -Confirm:$false
    I get runtime error at Get-VirtualSwitch -Name $vss 
    $vss says vlan50 not found. but its there. anything wrong with this nested foreach?

    hi
    I am actually getting an error on 
    Get-VirtualPortGroup -Name $($vss_vlan_array[$i])
    Its trying to give me the whole array instead of the 1st item in the array. so get-virtualportgroup will fail.
    I checked it with $vss_vlan_array[0] and gives me 
    "vlan50","vlan49"
    how do one item at a time instead of the whole array?

  • Strange issue with rights of account, used by SSIS (Foreach Loop Container does not return file names without Admin rights on server)

    Hello everyone.
    Faced very strange issue with account, which is used to run SSIS package.
    The specific package uses Foreach Loop Container to retrieve file names within the specified folder, and put them into Import file task.
    The package is set up to run under specific service account. This service account is given all permissions (Full control) to the folder where source files reside.
    So the issue is: SSIS package fails to execute this task (Foreach Loop Container and then Import), and shows that no files are found in the directory (although files ARE there).
    Once we're adding the service account into local Administrators group on the SQL Server, it works! Removing - does not work again. We cannot leave the service account as SQL server's admin as it's prohibited by our IT policies, and is just a bad practice.
    Any ideas, please? 
    MCP

    Here's the real log output:
    Date 16.04.2014 12:47:09
    Log Job History (RU-BW: Update)
    Step ID 1
    Server Server
    Job Name RU-BW: Update
    Step Name bw_import_cust_master_data
    Duration 00:00:02
    Sql Severity 0
    Sql Message ID 0
    Operator Emailed
    Operator Net sent
    Operator Paged
    Retries Attempted 0
    Message
    Executed as user: service_account Microsoft (R) SQL Server Execute Package Utility  Version 10.50.4286.0 for 64-bit  Copyright (C) Microsoft Corporation 2010. All rights reserved.    Started:  12:47:09  Error: 2014-04-16 12:47:11.45
        Code: 0xC0202070     Source: bw_import_cust_master_data Connection manager "Input"     Description: The file name property is not valid. The file name is a device or contains invalid characters.  End Error  Error:
    2014-04-16 12:47:11.47     Code: 0xC0202070     Source: bw_import_cust_master_data Connection manager "Input"     Description: The file name property is not valid. The file name is a device or contains invalid characters.  End
    Error  Error: 2014-04-16 12:47:11.48     Code: 0xC0202070     Source: bw_import_cust_master_data Connection manager "Input"     Description: The file name property is not valid. The file name is a device or contains invalid
    characters.  End Error  Error: 2014-04-16 12:47:11.48     Code: 0xC020207E     Source: Import file Flat File Source [1]     Description: The file name is not valid. The file name is a device or contains invalid characters.
     End Error  Error: 2014-04-16 12:47:11.48     Code: 0xC004701A     Source: Import file SSIS.Pipeline     Description: component "Flat File Source" (1) failed the pre-execute phase and returned error code 0xC020207E.
     End Error  DTExec: The package execution returned DTSER_FAILURE (1).  Started:  12:47:09  Finished: 12:47:11  Elapsed:  2.324 seconds.  The package execution failed.  The step failed.
    MCP

  • I'm in iphoto loop with Facebook that says there's a problem with IPhoto uploader. Try again later"  It's an eternal loop and no matter what it puts me back to Setup to publish IPHOTO every time and then will not publish.

    I'm in an Iphoto loop with iPhoto uploader error and Facebook.  I cannot post to Facebook as it sends me back to setup again and then says there is an error with iPhoto uploader.  "Try again later"  This has been going on since I joined Facebook.  Cannot figure out what to do

    have you tried posting this question in the iPhoto forum? https://discussions.apple.com/community/ilife/iphoto

  • Please help with the FOR loop and the array..

    I was trying to place some words in the Movie Clip
    "TextPanel" and set a
    random position to each of them.
    But it's not working.
    1) I created a Movie Clip "word" and inside that MC I created
    a text field
    and gave it an identifier "textFiled".
    2) The linkage name for Movie Clip "word" I set to "word".
    3) In the actionscript I created an Array called "aWords".
    4) Then I created a FOR loop that should
    place (attach) Movie Clips "word0", "word1", "word2" and
    "word3" to the
    movie clip TextPanel, and set the textField text for each of
    them to the
    text from the Array.
    But the script attaches 4 Movie Clips with a name
    "Undefined", instead of 4
    different names (from the Array).
    What is wrong with this script?
    var aWords:Array = [apple,banana,orange,mango];
    for(i=0;i<aWords.length;i++){
    var v = TextPanel.attachMovie("word","word"+i,i);
    v.textFiled.text = aWords
    v._x = randomNumber(0,Stage.width);
    v._y = randomNumber(0,Stage.height);
    Thanks in advance

    But in my Post I already wrote v.textFiled.text = aWords
    so I don't understand what were you correcting..
    And one more:
    I have tested it by changing the
    v.textFiled.text = aWords; to v.textFiled.text = "some
    word";
    and it's working fine.
    So there is something wrong with the Array element, and I
    don't know why..
    "aniebel" <[email protected]> wrote in
    message
    news:ft2d5k$lld$[email protected]..
    > Change:
    > v.textFiled.text = aWords;
    >
    > to:
    > v.textFiled.text = aWords
    >
    > It needs to know which element inside the array you want
    to place in the
    > textfield (or textfiled) :)
    >
    > If that doesn't work, double check that your instance
    name is correct
    > inside
    > of "word".
    >

  • There should be a way to index an array with an array of indexes or booleans (without a loop)

    Hi, often I would love to index an array with an array of indexes or an array of booleans without having to loop it.  I.e: let the IndexArray function accept an array of indexes instead of discrete indexes.  The output should then be an array of indexes values.  
    Another use case is to index with an array of booleans, so each TRUE element would index the input array and FALSE elements are not indexed.
    arrResult = arrInput[ arrIndexes ];  or
    arrResult = arrInput[ arrVal > 20 ];
    Would this be useful? Possibly it could be implemented in future versions?

    You forgot the link.

  • Bug in conditional for loop with an empty array

    There appears to be a bug in the for loop with a conditional terminal.
    If an empty array is wired to an auto-indexed array input tunnel, an output array tunnel has one element instead of zero.
    The array constant on the left is empty.
    Top loop without the conditional terminal produces an empty array.
    The bottom loop with a never true conditional terminal produces an array with one element
    Using LabVIEW version 8.5
    Message Edited by TrevMrgn on 05-05-2009 02:01 PM
    Solved!
    Go to Solution.
    Attachments:
    For loop bug.png ‏3 KB

    Creating the example from scratch, I do not see the error.
    Neither do I.
    If I add one or more elements to the array (constant or control), then delete them all (using 'Delete Element') the bottom array has one element.
    Nup. Still empty.
    If I empty the array (using 'Empty Array') both are empty.
    Yep.
    Also if I create an empty array using 'initialise array' with zero elements, I get one element.
    Nup. Still empty.
    'Show constant folding' does not appear to change the behaviour, but including a random operation in the loop does.
    Agreed that constant folding doesn't cause any odd behaviour. Introducing a random operation (adding two constants) in the loop doesn't either.
    I've tried all your methods here Trevor, but I can't replicate this behaviour in 8.5.1 under WinXP SP3. Sorry!
     Maybe somebody else will be able to help, or find a useable workaround.
    Thoric (CLA, CLED, CTD and LabVIEW Champion)

  • Foreach Loop Container with a Data Flow Task looking for file from Connection Manager

    So I have a Data Flow Task within a Foreach Loop Container. The Foreach Loop Container has a Variable Mapping of User:FileName to pass to the Data Flow Task.
    The Data Flow Task has a Flat File Source since we're looking to process .csv Files. And the Flat File Source has a Flat File Connection Manager where I specified the File name when I created it. I thought you needed to do this even though it won't really
    use it since it should be getting its File name from the Foreach Loop Container. But when attempting to execute, it is blowing up because it seems to be looking for my test file name that I indicated in the Flat File Connection Manager rather than the file
    it should be trying to process in User:FileName from the Foreach Loop Container.
    What am I doing wrong here??? I thought you needed to indicate a File name within the Flat File Connection Manager even though it really won't be using it.
    Thanks for your review...I hope I've been clear...and am hopeful for a reply.
    PSULionRP

    The Flat File Connection manager's Connection String needs to be set to reference the variable used in the ForEach Loop:
    Arthur My Blog

  • Help with forEach loop

    I have a JSTL forEach loop similar to below:
    <c:forEach var="product" items="${sessionScope.products}">
         <tr><td>${product.description}</td></tr>
    </c:forEach>I would like to use a static class to format the description. Something like below, but I know I cannot do it this way. How can I accomplish this?
    <tr><td>${ProductFormatter.getHtmlDescription(product)}</td></tr>thanks

    The least change approach. If you have already have a static function to do this, then a function tag would be appropriate.
    The function tag basically lets you call a static function from EL.
    custom.tld
    <?xml version="1.0" encoding="UTF-8" ?>
    <taglib xsi:schemaLocation="http://java.sun.com/xml/ns/javaee web-
            jsptaglibrary_2_1.xsd" xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.1"
    >
         <tlib-version>1.0</tlib-version>
         <short-name>my</short-name>
         <uri>http://www.mytags.com/</uri>
         <function>
              <name>productFormatter</name>
              <function-class>com.mypackage.ProductFormatter</function-class>
              <function-signature>java.lang.String getHtmlDescription(com.mypackage.Product)</function-signature>
         </function>     
    </taglib>If you include that tld in your WEB-INF directory, then the following in a JSP should work:
    <%@ taglib uri="http://www.mytags.com/" prefix="my"%>
    <c:forEach var="product" items="${sessionScope.products}">
         <tr><td>${my:productFormatter(product)}</td></tr>
    </c:forEach>Rather than putting the code in a static function, you might be better off encoding the logic into a custom tag. It depends on what your formatting function is like.
    cheers,
    evnafets

  • Power-shell distribution list update Managedby with foreach loop

    The script function is to find a user that is listed a a manager/owner on a distribution list and then replace that manager. The issue is I'm unable to replace the manager when they are a owner/manager of multiple distribution list. The script is successful
    if I remove the foreach loop and just run the script on one distribution list. Please see error message below. Any help is appreciated. 
    $user = "eharris"
    #$DLSimilarmgr = "harris, aaron m"
    $username = (get-aduser $user).name
    $listDLgroup = get-distributiongroup -resultsize unlimited | where {$_.managedby -like "*$username*"} |fl name
    $Foreach ($GrpDL in $listDLgroup) {
       $listDLManager = $GrpDL.ManagedBy 
       $NewDLManager = get-user -id "aharris"  
       $listDLManager+= $NewDlManager 
       set-distributiongroup $GrpDL -managedby $listDLManager -BypassSecurityGroupManagerCheck
    Aaron Harris ExchangeSharePointGuy

    Having issue combing the two scripts. The first scripts gets the DL managers. The second script will update the managed by field of the users and the previous managers of the DL. However, I don't know how to update a multiple DL when the user is listed as
    a manager of more than 1 DL at a time. In script 2 I would like to update the multiple return value for script 1. Any help would be appreciated. 
    #script 1 list the dl's the users is a manager of 
    $user = "eharris"
    $username = (get-aduser $user).name
    $listDLgroup = get-distributiongroup -resultsize unlimited | where {$_.managedby -like "*$username*"} |fl name
    #Script 2 working gets the dl and adds the new member and the previous members of that DL
    $GrpDL = Get-DistributionGroup -id "#365DLTest"
    $listDLManager = $GrpDL.ManagedBy $NewDLManager = get-user -id "eharris" 
    $listDLManager+= $NewDlManager set-distributiongroup "#365DLTest" -managedby $listDLManager -BypassSecurityGroupManagerCheck
    Aaron Harris ExchangeSharePointGuy

  • Using foreach loop container with file system task to rename and move files

    the foreach loop container will not rename and move files for me
    sukai

    duplicate of
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/8f2899f1-43b0-47e0-8bd0-e082989cdcb8/file-system-task-and-foreach-loop-container?forum=sqlintegrationservices
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

Maybe you are looking for

  • Disappointed in Verizon, Itself!

    I am so sick of Verizon. I'm not complaining about their customer service, which I have had a few horrible reps. But I'm beyond annoyed with Verizon. I upgraded to HTC Trophy phone, by the way, is the worse phone ever. When I tried to return it, the

  • How do I get the full path and filename of the current document?

    I'm writing a format plug-in. How do I obtain the full path and filename of the current image (document) from within my plug-in? Any help would be greatly appreciated!

  • I need to take a video off my iPod nano.

    I think it's a 4th generation one. I don't have iTunes on my current laptop and have no idea how to do this. Can someone help please? Thanks

  • Odd problems with Spry features

    I have finished a site at http://www.magnoliaparkburbank.org that uses many Spry features such as autosuggest, master-detail regions and css classes built into the xml files. The site has been developed on a Mac but I have a BrowserCam account with r

  • For all those with no sound with ITunes 7.0

    I'm just going to post what happened to me. After installing iTunes 7, I could not play any music...the progress bar would sit there, and eventually I would hear a weird sound coming from the speakers. I opened up the QuickTime control panel, and wen