Building array within 2 nested fors and 2 nested cases

Hi all,
I can't seem to figure out why one of my arrays keeps getting reset.  What I need to do is disassemble my clusters one at a time check for an node address then packet and decode the hex data.  Data decodes will be different for every node.  When a node is decoded, I need to add that data to an array dedicated to that node.  When the entire cluster array is processed, the data will be dumped to different Excel sheets.  One sheet for each node on the system. This is a simplified version of a much larger program that will handle many nodes and lots of data.  Any help would be appreciated.
--Mark
Attachments:
Building an Array 2 fors 2 case.vi ‏19 KB

Your tunnels on the inner loop need to be shift registers as well.

Similar Messages

  • Need a array within an arraycollection for the arraycollection to run the filterfunction properly?

    Do you need to have an array within an arraycollection for
    the arraycollection to run the filterfunction properly?
    <mx:ArrayCollection id="arrColl">
    <mx:source>
    <mx:Array>
    <mx:Object name="ColdFusion" value="0.00" />
    <mx:Object name="Dreamweaver" value="0.12" />
    <mx:Object name="Fireworks" value="1.01" />
    <mx:Object name="Flash" value="0" />
    <mx:Object name="Flash Player" value="-0.00" />
    <mx:Object name="Flex" value="0.00" />
    <mx:Object name="Illustrator" value="2.92" />
    <mx:Object name="Lightroom" value="0.32" />
    <mx:Object name="Photoshop" value="0.06" />
    </mx:Array>
    </mx:source>
    </mx:ArrayCollection>

    "nikos101" <[email protected]> wrote in
    message
    news:gb07gv$9v8$[email protected]..
    > Do you need to have an array within an arraycollection
    for the
    > arraycollection
    > to run the filterfunction properly?
    >
    > <mx:ArrayCollection id="arrColl">
    > <mx:source>
    > <mx:Array>
    > <mx:Object name="ColdFusion" value="0.00" />
    > <mx:Object name="Dreamweaver" value="0.12" />
    > <mx:Object name="Fireworks" value="1.01" />
    > <mx:Object name="Flash" value="0" />
    > <mx:Object name="Flash Player" value="-0.00" />
    > <mx:Object name="Flex" value="0.00" />
    > <mx:Object name="Illustrator" value="2.92" />
    > <mx:Object name="Lightroom" value="0.32" />
    > <mx:Object name="Photoshop" value="0.06" />
    > </mx:Array>
    > </mx:source>
    > </mx:ArrayCollection>
    You have to have an Array within the ArrayCollection for it
    to do anything,
    since ArrayCollection is just a wrapper for Array...

  • How to avoid Build Array function inside a For (while) Loop?

    Hi there,
    I have a simple question about how to avoid using Build Array function inside the loop. Now I want to remove the Build Array funtion inside the loop to improve the performance (To get better memory management). Any idea how to do that?
    Thanks a lot!
    Warmest regards,
    Chong

    It's been my experience that using the auto-indexing to build an array
    on a For loop is just as good as initializing and replacing elements.
    The For loop knows before it runs how many iterations it has to run and
    can allocate the array ahead of time.
    You're better off initializing and replacing when using a While loop
    because it does not know how many iterations it will run and can't
    pre-allocate the array ahead of time.
    Ed
    Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
    Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.

  • Build array within scriptblock and use outside the block

    Hi,
    I am using scriptblock to run several commands in parallel. The code working fine. BUT I am trying to build an array of object within the scriptblock. My aim is to have all execution results in one array and after exiting the script block to print the results
    from all run. I notice that what i build within script block getting destroyed and in the end the $result variable is null. Is there any way that I can build and accumulate the results in a variable and use that outside scriptblock?
    code:
    $result= @()
    ForEach ($Command in $Commands)
        While (@(Get-Job -state running).count -ge $MaxThreads){      
        Start-Sleep -Milliseconds $SleepTimer
        Start-Job -scriptblock {
    $n = $Command
    $result += New-Object Psobject -property @{DATE = (Get-Date -format "MMddyy"); RESULT = $n}
        } -ArgumentList $Command -Name "$($Command)job" | Out-Null
    While (@(Get-Job -State Running).count -gt 0)
        Start-Sleep -Milliseconds $SleepTimer
    ForEach($Job in Get-Job)
        Receive-Job -Job $Job
        Remove-job -Force $Job
    $result

    Yep, but my real problem is that every now and again I just can't help myself and end up feeding the troll.
    I've had plenty of fun recently watching it twist in the wind and blather on about absolutely nothing of any substance. I'm assuming we'll get another missive across these threads later (dance puppet, DANCE)...
    The real shame though is when it ends up attacking the poor random OPs for asking a question. We're used to dealing with it so I can laugh at the situation, but it does bother me that the people who are just out looking for help end up getting lambasted
    by some complete jerk.
    I'm going to keep on ignoring it, hopefully if we all just stop playing along it'll get tired and go be useless somewhere else.
    Don't retire TechNet! -
    (Don't give up yet - 12,950+ strong and growing)
    Offensive as he (?) can often be, it is difficult to take his attacks personally, because he obviously has no clue what (or who) he is talking about.
    What bothers me more about this phenomenon is:
    the disrespect shown to people just looking for help;
    the impact on the effectiveness of the forum with all the time and space wasted for no purpose;
    the troll himself, who seems to either be suffering some kind of emotional or personality disorder, or is playing some kind of game without concern for its effect.
    He doesn't get much positive feedback here, so perhaps he just feels that being able to write the way he does in a public forum, and get some response, is enough to prove his worth to his ego. Unfortunately, we will probably never find out more about him
    than is evident from his posts.
    Al Dunbar -- remember to 'mark or propose as answer' or 'vote as helpful' as appropriate.
    Seems to be a "tagger" mentality.  Marking territory with acts of vandalism.
    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "

  • How to go about building a app that searches for and displays pages from Google.

    I was wondering how i would go about building an app that takes a users input such as a sentence (not a URL) and then searches  for their input on Google. This app would then have to display a selected page automatically on the UIWebView.
    My existing code in my viewcontroller.m is as follows:
    - (void)viewDidLoad
    [super viewDidLoad]; [webView loadRequest: [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.google.com"]]];
    I now want my app to use a users input (a word or a sentence) and search Google with that input but do it in the background then display the first search result in the UIWebView, what code would i need?
    Thanks

    Sorry, I cant view the App Store Review Guidelines
    https://developer.apple.com/appstore/resources/approval/guidelines.htmllink, maybe its because i dont have a developers account yet i will be getting one when i am ready to launch my app on the app store.

  • Build Array forces Concatenat​e Inputs

    I have a VI attached that I'm having problems with the Build Array function. With a certain 1D extended array called Frequency (Hz), when I wire it to a Build Array with another 1D extended array, it puts out a 2D array. However, when I divide that second 1D extended array by a single extended constant (20), and try to wire it to the Build Array, the Build Array changes to "Concatenate Inputs" and will not allow me to change it back. These are two 1D arrays, I should be able to make a 2D array out of them.
    What am I missing here? I know this sounds like an elementary problem (hopefully it is), but I couldn't figure it out. Please see the VI and follow the statement on the Block Diagram. Could it be something with the inheritance properties?
    Michael
    Attachments:
    SavePassFailCriteriaSUB_test.vi ‏51 KB

    Probably related to the bug discussed recently here:
    http://forums.ni.com/ni/board/message?board.id=170​&message.id=294807
    LabVIEW Champion . Do more with less code and in less time .

  • Truncating an array within a for loop

    I'm currently working with a program that builds an array of 3000*N real numbers, where N is a control that I specify. I want to pass this array into a for loop that runs N times, each time splitting the first 3000 numbers of the array. So, in other words I want the for loop to execute enough times such that the initial array will be completely divided into groups of 3000 when I'm finished. Later I'll be finding the maximum value of all of these subarrays and taking the average of those. What I tried first is to pass the array into the for loop, then truncate it at index = 3000, but the problem is that I can't hard code the loop to do this N times. Any advice or other methods you'd recommend for doing this?
    Thanks.
    Message Edited by Robtn on 03-05-2010 03:17 PM

    Mark--I don't think I can use that approach. Let me be more specific on what the problem is:
    Our "big program" is a giant while loop that constantly reads in voltage values from a DAQ assistant.
    It has two modes, the first of which I'm having a lot of trouble with. This mode uses a for loop (N = 3000) nested within the giant while loop.
    When the for loop activates, the DAQ assistant takes reads 300 samples for every iteration and takes the maximum of those 300 values. It then builds an array composed of all the maxima. After the for loop has executed 3000 times, a case structure activates, which then finds the maximum of the array of maxima.
    I want this (N=3000) for loop to execute an arbitrary number of times, a number that I will specify. Each of those times it should generate a completely seperate array of maxima. So, if I want the for loop to run 5 times, I want 5 different arrays.
    My approach for doing this was to change N=3000 to say N = 15000, then split up the resulting array 5 times. So, I need an entirely separate for loop that reads in this array of 15000 maxima on its own and splits it 5 ways. I think what you're suggesting is to use a for loop outside of the N=3000 loop, which is a good idea in theory, but experience has shown that this will not generate 5 separate arrays. It will actually concatenate each array into one, hence the problem we currently have.
    Yik--I won't have access to Labview over the weekend. Is it possible to take a screenshot and post it, or maybe a short description?
    Thank you for the responses.

  • How to build a multiselect with (nested) and and or conditions

    Hi,
    I have to tables: persons and categories. I would like to build functionality to enter values for categories, with a combination of and- and or- conditions (nested) to select persons.
    Has anyone an example how to do this ?
    Any reaction will be appreciated.
    Leo

    Reporting is not limitted in the MP you can perform in the same way as you do reporting on the single IC or DSO.
    No its not like that like you can only select common fileds in both the info providers. you can also identify the fileds that are not common to both the info providers.
    For example, the report need both customer's accounting number and sales order number. But accounting number only in accounting cube while sales order number only in sales order cube. Then how can I meet the requirement?
    We have a constant selection option in the query designer while reporting on this fileds we will use this function.
    inorder to meet the above requirement please check the below link which gives you detailed information regarding your requirement.
    for more details chk the below link
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/70dcd7b5-6a3d-2d10-c984-e835e37071a2?quicklink=index&overridelayout=true
    Regards
    KP

  • Arrays within custom Classes - same array for different instances?

    Hello all,
    I have made a very simple custom class for keeping track of groups of offices for a company.  The class has a Number variable to tell it how many different offices there are, and an Array to store the individual offices by name.  It looks like this.
    class officeCluster
        static var _className:String = "officeCluster";
        // variables
        var numOffices:Number;
        var locationArray:Array = new Array();
        // functions
        function officeCluster()
            trace("officeCluster constructor");
    Very simple!
    Now, it is my understand that when I create different instances of the class, they will each have their own version of "numOffices" and their own version of "locationArray".
    When I run traces of "numOffices", this seems to be true.  For example,
    trace(manufacturingOfficeCluster.numOffices);
    trace(servicesOfficeCluster.numOffices);
    yields
    5
    4
    In the output panel, which is correct.  However, there is trouble with the locationArray.  It seems that as I assign different values to it, regardless of what instance I specify, there is only ONE array- NOT one for each instance.
    In other words,
    trace(manufacturingOfficeCluster.locationArray[1].theLocation);   // theLocation is a String.  The locationArray itself holds Objects.
    trace(servicesOfficeCluster.locationArray[1].theLocation);
    yields
    New Haven, CT
    New Haven, CT
    even though I have defined elsewhere that they are different!
    Is anyone aware of any issues partaining to using Arrays within Class instances?  Any help would be appreciated!
    note:  I've been able to work around this by creating multiple arrays within the class and using a different one for each instance, but this seems very sloppy.

    Unfortunately, the code segment you attached results in:
    12
    12
    in the output panel.   So the problem must lie elsewhere!  Let me give some more detail...
    There are several files involved. The "officeCluster" class file looks like this:
    class officeCluster
         static var _className:String = "officeCluster";
         // variables
         var numOffices:Number;
         var locationArray:Array = new Array();
         // functions
         function officeCluster()
            trace("officeCluster constructor");
    I have two actionscript files which contain object data for the individual offices.  They look like this...
    var servicesOfficeCluster = new officeCluster();
    servicesOfficeCluster.numOffices = 4;
    var newHope:Object = new Object();
    newHope.locationName = "New Hope Office";
    newHope.theLocation = "New Hope, NJ";
    //more data
    servicesOfficeCluster.locationArray[0] = newHope; //array index is incremented with each entry
    //more Objects...
    and like this...
    var manufacturingOfficeCluster = new officeCluster();
    manufacturingOfficeCluster.numOffices = 5;
    var hartford:Object = new Object();
    hartford.locationName = "Hartford Office";
    hartford.theLocation = "Hartford, CT";
    //more data
    manufacturingOfficeCluster.locationArray[0] = hartford; //array index is incremented with each entry
    //more Objects...
    As you can see, the only difference is the name of the officeCluster instance, and of course the Object data itself.  Finally, these are all used by the main file, which looks like this- I have commented out all the code except for our little test -
    import officeCluster;
    #include "manufacturingList.as"
    #include "servicesList.as"
    /*lots of commented code*/
    manufacturingOfficeCluster.locationArray[1].theLocation = "l1";
    servicesOfficeCluster.locationArray[1].theLocation = "l2";
    trace(manufacturingOfficeCluster.locationArray[1].theLocation);
    trace(servicesOfficeCluster.locationArray[1].theLocation);
    Which, unfortunately, still yields
    12
    12
    as output :\  Any ideas?  Is there something wrong with the way I have set up the class file?  Something wrong in the two AS files?  I'm really starting to bang my head against the wall with this one.
    Thanks

  • Incorporate: For, and while loop,a nested pair for both,and to add graphics

    // I have done the class but
    need help one adding one while loop, one for loop, and a nested pair loops using for and while, and if posbile to add on a dynamite graphics. // i am doing this for a brithday present for my brother who is a java programer
    and would be happy to see his little brother make a java programe for him
    //class file
    import java.awt.*;
    public class ZZZCalculator
            private double amount;
            public ZZZCalculator (double x)
                    amount= x;
            public void addAmt (double inputNumber)
                    amount= amount +inputNumber;
            public void divideAmt (double inputNumber)
                    amount=amount/inputNumber;
            public void subtractAmt (double inputNumber)
                    amount=amount-inputNumber;
            public void multiplyAmt (double inputNumber)
                    amount=amount*inputNumber;
            public void display (Graphics g)
                    g.drawString (""+ amount, 150,100);
            public void setAmt(double x)
                    amount= x;
      // Pgm file
    import java.awt.*;
    import java.applet.Applet;
    import java.awt.event.*;
    public class ZZZCalc extends Applet implements ActionListener {
            ZZZCalculator henrietta;
            TextField amtPlace;
            Button adder;
            Button divide;
            Button subtract;
            Button multiply;            
            public void init()
                    henrietta=new ZZZCalculator(0.0);
                    amtPlace=new TextField(10);
                    amtPlace.addActionListener(this);
                    add(amtPlace);
                    adder=new Button ("+");
                    adder.addActionListener(this);
                    add(adder);
                    divide=new Button ("/");
                    divide.addActionListener(this);
                    add(divide);
                    subtract=new Button ("-");
                    subtract.addActionListener(this);
                    add(subtract);
                    multiply=new Button ("*");
                    multiply.addActionListener(this);
                    add(multiply);
            public void paint (Graphics g)
                    g.drawString("amount:", 100,100);
                    henrietta.display(g);
            public void actionPerformed(ActionEvent e)
                    if (e. getSource()==amtPlace)
                    double amt= Double.parseDouble (amtPlace.getText());
                    henrietta.setAmt(amt);
                    repaint();
                    if(e.getSource()==adder)
                    double amt= Double.parseDouble (amtPlace.getText());
                    henrietta.addAmt(amt);
                    repaint();
                    if(e.getSource()==divide)
                    double amt= Double.parseDouble (amtPlace.getText());
                    henrietta.divideAmt(amt);
                    repaint();
                    if(e.getSource()==subtract)
                    double amt= Double.parseDouble (amtPlace.getText());
                    henrietta.subtractAmt(amt);
                    repaint();
                    if(e.getSource()==multiply)
                    double amt= Double.parseDouble (amtPlace.getText());
                    henrietta. multiplyAmt(amt);
                   repaint();
    //thank you for the help
    i have just started working on java and this is my frist program i am working on and any help i can get would inprove my understanding of java.
    Thank you very much for you help

    hey there... this is Rebecca
    try this somewhere in the prog.
    n = Math.pow(x,y)
    where n is an int you declare...
    and x and y are the numbers... as in
    n = 10^3
    where 10 = x and 3 = y

  • We are currently looking for a way to link images to a design file within programs like InDesign and Illustrator using an HTML link instead of a local file.  We are hosting our images in SharePoint and need the design file to retain it's links, no matter

    We are currently looking for a way to link images to a design file within programs like InDesign and Illustrator using an HTML link instead of a local file.  We are hosting our images in SharePoint and need the design file to retain it's links, no matter who on our network opens the design file.

    The Cloud forum is not about using individual programs
    The Cloud forum is about the Cloud as a delivery & install process
    If you will start at the Forums Index https://forums.adobe.com/welcome
    You will be able to select a forum for the specific Adobe product(s) you use
    Click the "down arrow" symbol on the right (where it says All communities) to open the drop down list and scroll

  • Anyone help? I click on buttons within websites and my mac opens new webpages advertising, mac keeper pro or some foreign exchange trading platform. Did i pick something hop in a download? how do i search for and get rid of this annoying infiltration?

    Anyone help? I click on buttons within websites and my mac opens new webpages advertising, mac keeper pro or some foreign exchange trading platform. Did i pick something hop in a download? how do i search for and get rid of this annoying infiltration?

    You've installed some form of adware. Take a look here:  http://www.thesafemac.com/arg/

  • Using an array within an array, and exporting to CSV

    I am gathering data about an AD user, including group membership and I want to output that to a CSV. Easy enough right? Not so much :) I am successfully generating 2 arrays, one has user data and the 2nd has group membership, but it's not exporting properly
    to CSV. I've tried the -notypeinformation but it's still showing up.
    My code is below, followed by contents of CSV file in text format.
    cls
    #declare array to use
    $user_main = @()
    $arrGroups = @()
    $user = Get-ADUser -Filter {samaccountname -eq "MyUserName"} -Properties *
    $temp_user.Name = $user.Name
    $temp_user.SAMname = $user.SamAccountName
    $temp_user.lastpwchange = $user.PasswordLastSet
    $temp_user.lastlogon = $user.LastLogonDate
    #get group membership
    $groups = $user.memberof
    foreach ($group in $groups)
    $temp1 = $group.Split(",")
    $group_name = $temp1[0].Substring(3, $temp1[0].Length -3)
    #$arrGroups += New-Object -TypeName psobject -Property $temp
    $arrGroups += $group_name
    $user_main += New-Object -TypeName psobject -Property $temp_user
    #$user_main | select * | Format-Table
    #$arrGroups
    $new = $user_main + $arrGroups
    Export-Csv -InputObject $new -Path c:\test\test.txt -NoTypeInformation -Encoding "utf8"
    Write-Host ""
    Write-Host "Done"
    The resulting text file contains:
    "Count","Length","LongLength","Rank","SyncRoot","IsReadOnly","IsFixedSize","IsSynchronized"
    "45","45","45","1","System.Object[]","False","True","False"
    So I have 2 issues. One is the "export-csv -notype" isn't working quite right, not sure why. And secondly, you can see the System.Object[] entry, which I believe is my array of groups. I need that to display the names of the groups the user belongs
    to.
    Any help is greatly appreciated!

    Hi Robert,
    I’m writing to just check in to see if the suggestions were helpful. If you need further help,
    please feel free to reply this post directly so we will be notified to follow it up.
    If you have any feedback on our support, please click here.
    Best Regards
    Anna
    TechNet Community Support

  • Build Array keeps name of the last element but not the others. Workaround?

    Hi there,
    Sorry if this has been posted before, I did the search first but did not find anything.
    Problem is that I have two setups that are identical and need to be controlled from a single vi. Since they are the same they are configured with the same sets of parameters so I decided to create a cluster of these and then build an array of the clusters. This way I need to only use one wire and if I need a given parameter I can easily get it from there (or so I thought) and also since I need to see if anything changes I can compare one wire instead of each one of the parameters.
    The gui has the list of parameters then in the block diagram I bundle them appropiately, using "Bundle by Name" and then each bundle into an array using "Build Array". Problem arises when I index the array for the first setup and the use that to unbundle the parameters I need, using "Unbundle by Name" (though if I use "Unbundle" the same happens)and lo and behol, the ouput names are from the second setup, not the first.
    Here is the curious thing though, even though the names are all wrong the values are correct. I could live with this but it is annoying plus it will make another user very hard to understand the diagram plus this is just a proof of principle to test with two, eventually there will be eight or even more and that is going to get really confusing.
    Is there a way around this? Even if it is to change the names after unbundled.
    Check the attached vi to see what I mean.
    Solved!
    Go to Solution.
    Attachments:
    Test Build Array Names.vi ‏11 KB

    I think you are forgetting an important point about arrays.  The only thing that can be different between each element of an array is its value.  The array elements must all share the same properties.  So that would include the names of the individual elements that make up the cluster that is an array element.
    It appears that the last cluster that gets built into the array is the one that defines the names of the elements that are within the cluster element.  You either need to give all elements of the array the same names within the cluster.  Or use a cluster of clusters instead of an array of cluster to build your data structure.

  • Error in file export when order of elements in build array changes

    Hi everyone,
    A while ago I wrote a vi file which does the following:
    At first it initializes a camera and chooses a region of interest (ROI). Data out of the ROI will be discarded.
    Then it raster scans a motor stage in x and y direction, in bidirectional mode (meaning that x alternates between scanning from left to right and right to left as y is inreased).
    For each point of the scan, the spectrum is collected, which is then integrated in lambda to give an idea of the total intensity.
    Then the intensity is plotted, along with the spectrum at each point.
    The final results are exported in a text file.
    The problem:
    If I flip the order of the wires in the "build array" before the file export, placing the Total Count (intensity) wire in place of the Spectrum wire, the file export fails. What I mean by "fails" is that the .txt file contains characters that look like chinese!
    Why is that?
    I attach my .vi as well as two screenshots which demostrate the problem.
    Solved!
    Go to Solution.
    Attachments:
    correct.png ‏182 KB
    Wrong.png ‏180 KB
    1.7z ‏119 KB

    mikeporter wrote:
    Hey Jeff... The changes you recommend are all good (and necessary) but the thing I'm stuck on is that regardless of what happens to the floating point data, there's that built-in VI that changes it to string representations of the numbers. And as I understand it, that is where the problem is.
    Mike...
    PS: Coming to NI Week?
    Not this year
    What scared me was the sgls on a SLs with no wire branch to force a data copy which, would force LabVIEW to preserve the sgls since the SL might need to be used again then, they get all mixed up building arrary out of mixed coerced sgls and dbls.  With the potential of a miss-reussed buffer (not uncommon in 2011) confusing the string operations in the write to spreadsheet.   The problem of course, must exist outside of write to spreadsheet file since it only exhibits with a build array element order change.  Or, we all are halucinating (Possible alternate theory)  
    Jeff

Maybe you are looking for