Compare elements of two or more clusters

Hello,
I am very new to labview and was hoping someone could help me with this. I am taking user input (motor #, size of steps, number of steps and sequence #) and storing all the data (for each motor) in a cluster.
(Now this is where I need help..)
I want to take the 4th element of each cluster (the sequence #) and sort it in order (1,2,3,4...). Based on the sequence number I want to use a flat sequence structure to send the commands to my motor controller in the right order.
Any help in solving this problem would be appreciated,
Regards,
Mridu

The reason Crossrulz said to put the Sequence # first in your Cluster is because sorting starts with the first element, then the second, etc.  If, however, you require that the Sequence number be, say, the third element, you can still sort it by using a trick (only do this if the array of clusters isn't huge) -- create a temporary cluster whose first element is the Sequence # and whose remaining element is the entire cluster.  An array of these things will sort on the first element.  Once sorted, take the Cluster apart and return only the second element, your original Cluster, now sorted.  [I hope that was clear ...]
Bob Schor

Similar Messages

  • How to insert or update comparing values  with two or more table

    Hai All
    I have three or four table in my database.
    Table 1 Dailattend is the main table here i need to insert or update my data and the fieds are
    Emplcode number,attdate date, intime date,intrin date ,introut date, outtime date are the fields
    Table 2 acclempbarcode the fields are
    emplcode number ,barcode number ....etc
    so now my data is in text format and i have broke the date like this
    0011221100112200100320100815
    First 16 is barcode and next 8 is date and 4 is time and i have created a temp table and store the date and move to main table
    My problem is the main table dailattend has no barcode so when i am going to insert or update i need to check whether the barcode is match with the emplcode in the main table
    How can i write insert or update statement
    The data is like this
    00110022 is barcode,10-03-2010 is my date and 0815 is time so i need to insert into dailattend table so now i have emplcode in dailattend table so i need to compare the barcode belong the emplcode in the another table and i need to insert in the dailattend table
    Pls give me some solution with example
    Regards
    Srikkanth.M

    try somthing like this
    create table t1
    as
    select '0011221100112200' barcode,to_date('100320100815','ddmmyyyyhh24mi') dt
    from dual
      create table barcodetbl
      emplcode varchar2(2000)
      barcode varchar2(2000)
      datetime date
    merge into barcodetbl bc
    using( select  * from  t1) x
    on
    (bc.barcode = x.barcode)
    when matched
    then update
    set datetime = x.dt
    when not matched
    then
    insert (emplcode,barcode,datetime)
    values(1,x.barcode,x.dt)
    /didn't realize that barcode is not in the main table.
    something along the lines
    Table 1 Dailattend is the main table here i need to insert or update my data and the fieds are
    Emplcode number,attdate date, intime date,intrin date ,introut date, outtime date are the fields
    Table 2 acclempbarcode the fields are
    emplcode number ,barcode number ....etc
    merge into dailattend bc
    using( select  * from  t1, acclempbarcode ac where t1.barcode = ac.barcode) x
    on
    (bc.emplcode = x.emplcode)
    when matched
    then update
    set datetime = x.dt
    when not matched
    then
    insert (emplcode,datetime)
    values(1,x.dt)
    /Alvinder
    Edited by: alvinder on Mar 23, 2010 3:50 PM

  • Comparison of Elements of Two 2D Arrays

    Hello!
    I am trying to compare elements of two 2D Arrays and find at least one pair of elements that are identical. Browsing the forum I found one method suggested by Altenbach (http://forums.ni.com/t5/LabVIEW/Compare-elements-in-an-array/m-p/458622). However, it works well with 1D Arrays. That is why I rearranged the original code for my case, but unfortunately the attempt was unsuccessful. Could anyone please have a look at my VI and suggest any solution? 
    Thank you.
    Solved!
    Go to Solution.
    Attachments:
    Search and Compare Indices.vi ‏16 KB

    Thanks, paul_cardinale !
    It works.. Now I see the principle. 
    Sometimes, the algorithm works perfectly, but sometimes it detects only one common index.
    For example, 
    3 5   and  5 5 6
    1 0            0 1 7
    In this case (5,0) is common for both arrays. But the algorithm shows that only "5" is common. Why do u think it is happening? 
    I have attached VI. 
    Attachments:
    Search and Compare Indices.vi ‏19 KB

  • ERROR: MyService.jws:715:There are two or more operations with the same schema-element 'ns0:MyNameSpace' on the input message in a web service file or callback interface.

    I have two web service operations that have the same complex type as their input
    parameter. I want to map this type to an existing schema. I can successfully
    do this with the first operation using XQuery but when I attempt to do this with
    the second operation I get the following error:
    ERROR: MyService.jws:715:There are two or more operations with the same schema-element
    'ns0:MyNamespace' on the input message in a web service file or callback interface.
    ERROR:      SUGGESTION: Use different schema-element values for each of those operations.
    How can I use different schema-element values? The input parameters are to be
    mapped to the same schema and same element since they are the same for both operations....

    I am having the same problem. How did you resolve this..?? could you please tell me the solution??
    Thanks
    Shari

  • How to compare the query definiation of two or more queries?

    HI Folks.
    I am attempting to determine if there is a method by which I can compare query definination of two or more queries or shows me the differences between queries. 
    Transaction RSRTQ only give the query details of single query at a time and doesnot do a comparison.
    Please let me know a method to undertake this?
    Thanks
    Uday

    There is no straight way of doing this:
    I normally open the definitions in 2 sessions and compare them manually.
    Hope this helps

  • How to show two or more PDF in one PDF-Reader / Concatenate PDF-Files

    Hi,
    I want to show two or more PDF files in one PDF reader window or to concatenate two or mor PDF files to one file.
    We use WD4A and ADS.
    Have someone an idea to solve this without an external program?
    Thx in advance
    Jürgen

    We have done this successfully a few times using WDA - it wasn't easy - it took us 2 full weeks to figure it out, so i need to get full points for this one!
    It's going to much easier to do this if you start a brand new WDA. If not, you'll have to re-do all your Context Node navigations within your methods.
    The first thing you need to do is to define your Context properly:
    You need a top level Node defined as 1:1 cardinality (as with all PDF development)
    Next, you need another Container Node 1:n cardinality (this holds the collection of content nodes)
    Finally, you have your PDF Content Node 1:n cardinality - This holds each instance of your PDF form
    In our scenario, we are passed in a list of Project Numbers. We need to generate a PDF sheet for each project in the same PDF session.
    pseudo code - i'm leaving out some of the unnessary details
    Loop through the project number table.
    ADD 1 TO v_cnt.
    * navigate from <TOP> to <PDF_CONTAINER> via lead selection
        lo_nd_pdf_container = lo_nd_top->get_child_node( name = wd_this->wdctx_pdf_container ).
    * This is the Important Part - we check to see if there is an element where index = v_cnt
    * If not, we create one where we can store the new set of data
    * get element via lead selection
        lo_el_pdf_container = lo_nd_pdf_container->get_element( index = v_cnt ).
        IF lo_el_pdf_container IS INITIAL.
          lo_el_pdf_container  = lo_nd_pdf_container->create_element( ).
          lo_nd_pdf_container->bind_element( new_item = lo_el_pdf_container
                                               set_initial_elements = ' '   ).
        ENDIF.
        lo_nd_ideasheet_data =  lo_el_pdf_container->get_child_node( 'IDEASHEET_DATA' ).
        lo_el_ideasheet_data = lo_nd_ideasheet_data->get_element( index = 1 ).
    * fill all the data then bind the structure
    Select * from XXX into lt_XXX
      where project_number = lt_project-project_number.
    * Move Data to appropriate fields/tables
    * Bind the info back to the element
        lo_el_ideasheet_data->set_static_attributes( static_attributes =
                                                  ls_ideasheet_data ).
    Endloop.

  • How do I combine two or more pictures into one?

    How do I combine two or more pictures into one?

    I found out how to do what I wanted and I'm giving my steps in hopes that it might help someone else.  I wanted to put several photos from a file onto a new blank image.  This is what I did.
    1.  Create a blank page.    File/New/ Blank File.   Put in the size.  I used 8x10.
    2.  Bring the photo  you want to use into Elements as you always do. It will list along the top next to the blank sheet.
    3.  Choose SELECT (top of screen)/ Select All.
    4.  Choose Edit/Copy   or Command "C"
    5.  Click on the Blank File.   Chose Edit/Paste  or Command "V"
    6.  Click on Image/ Transform or Command "T".  There should be a dotted line around your pasted image.  You can then move and adjust the image to how you want it.  When finished, press the check-mark on lower right of photo.
    7.   Repeat this with all the photos you want on the new blank file.
    8.  You will see on lower right of Elements,  the background layer and as many layers as you have photos.  These layers need to be permanently placed on the background layer. Go to Layers and press Merge Visible.  This will merge all layers to the background.
    9.  Save as and you are done.

  • Can you load photoshop elements, disc version, on more than one computer?

    Can you load photoshop elements, disc version, on more than one computer?

      It‘s been part of recent versions, perhaps from PSE8 onward; I‘m not exactly sure. The software activates automatically upon installation. If you ever change computers and already have two activations simply open the Editor on the old machine and on the top menu click help à deactivate
     

  • Comparing elements inside a vector

    Hello,
    I am having a hard time understanding how to compare elements inside a vector. I have a vector of six strings and I want to compare the first element at index 0 with all other elements at positions 1-5. After that, compare the element at position 1 with elements at positions 2-5 and so on until all elements have been compared against each other.
    Can some one please advise me on how to achieve this?
    Thank you.

    joor_empire wrote:
    Thanks for replying. I tried using nested loops, but I keep getting array index out of bound error.Hmmm, then you're doing it wrong.
    For more information, you'll have to give us more info, such as your code (please use code tags when posting it though).

  • Need script for Marginal Elements consists two tags

    Hi Everyone,
    I need a script for the Marginal Elements having two Paragraph tags. Object Styles, Library items are all availale for this job. My requirement is cut the two paragraph tags and put it in library items and also using object styles as well. Is it possible? Can you help for this. For more clarification i have attached that file also.
    Waiting for your reply....

    Hi Try This code.....
    main();
    function main(){
        if (app.documents.length!=0){
            if(app.libraries.length!=0){
            myStyleDialog();
            else {
                alert ("Please open the Library.");
        else {
            alert ("Please open a document and try again.");
            exit(0);
    function myStyleDialog(){
    var myLabelWidth = 120;
    var myParaStyleNames = myGetParagraphStyleNames();
    //var myObjStyleNames = myGetObjectStyleNames();
    var myDialog = app.dialogs.add({name:"Choose Styles to Place Anchor"});
    with(myDialog.dialogColumns.add()){
        with(borderPanels.add()){
            with(dialogColumns.add()){
                with(dialogRows.add()){
                    with(dialogColumns.add()){
                        staticTexts.add({staticLabel:"Choose Paragraph Style1:", minWidth:myLabelWidth});
                    with(dialogColumns.add()){
                        myParaStyleDropdown1 = dropdowns.add({stringList:myParaStyleNames, selectedIndex:0});
                  with(dialogRows.add()){
                        with(dialogColumns.add()){
                            staticTexts.add({staticLabel:"Choose Paragraph Style2:", minWidth:myLabelWidth});
                        with(dialogColumns.add()){
                            myParaStyleDropdown2 = dropdowns.add({stringList:myParaStyleNames, selectedIndex:0});
    //~                     with(dialogRows.add()){
    //~                         with(dialogColumns.add()){
    //~                             staticTexts.add({staticLabel:"Object Styles:", minWidth:myLabelWidth});
    //~                             }
    //~                         with(dialogColumns.add()){
    //~                             myObjectStyleDropdown = dropdowns.add({stringList:myObjStyleNames, selectedIndex:0});
    //~                     }
    //~         }
        myReturn = myDialog.show();
        if(myReturn == true){
             myParagraphStyle1 = myParaStyleNames[myParaStyleDropdown1.selectedIndex];
            myParagraphStyle2 = myParaStyleNames[myParaStyleDropdown2.selectedIndex];
            // myObjectStyle = myObjStyleNames[myObjectStyleDropdown.selectedIndex];
             myDialog.destroy();
          else {
          myDialog.destroy();
    function myGetParagraphStyleNames(){
        var myStyleNames = app.documents.item(0).paragraphStyles.everyItem().name;
        return myStyleNames;
    //~ function myGetObjectStyleNames(){
    //~     var myObjStyleNames = app.documents.item(0).objectStyles.everyItem().name;
    //~     return myObjStyleNames;
    //~ }
    var myDoc = app.activeDocument;
    var myStory = myDoc.stories;
    var myParas, myCount = 0;
    var myLib = app.libraries[0];
    var AnchorItemName = prompt("Enter the Library Item Name Exactly","","Anchor Item");
    for(i=0; i<myStory.length; i++)
        myParas = myStory[i].paragraphs;
        if (myParas.length>3)
            for(j=0; j<myParas.length-1; j++)
                var firstPara = myParas[j];
                var nextPara = myParas[j+1];
                var firstParaStyle = firstPara.appliedParagraphStyle.name;
                var nextParaStyle = nextPara.appliedParagraphStyle.name;
                if ((nextParaStyle == myParagraphStyle2)&&(firstParaStyle == myParagraphStyle1))
                    myText = myLib.assets.item (AnchorItemName).placeAsset (firstPara.insertionPoints[0])[0];
                    firstPara.move(LocationOptions.after, myText.insertionPoints[0]);
                    nextPara.move(LocationOptions.after, myText.insertionPoints[-1]);
                    myText.fit(FitOptions.frameToContent);
                    myCount++;
                    }//End if
            }//End of Para iteration
        }//End of If paralength>2
        }//End of story iteration
    alert(myCount + " Ocurrences Found and Processed");
    Green4ever

  • Combining two or more Macs to share resources

    Hi,
    I was wondering if there is a way to join two or more Macs together and make them share their resources, like CPU, RAM or GPU (but I focus mainly on CPU). Is it possible?
    I have already searched for information on the Internet but what I could find was information from 2+ years ago which featured older version of OS X, so I think I better start a new thread.
    Thanks

    Apple had a technology called xGrid, but it was dropped after 10.7. You should search for "clusters" or "clustering"
    Here is some info on the drop of xgrid, and some names of other technology:
    http://forums.macrumors.com/showthread.php?t=1412900

  • Is it possible to query an Item with two or more conditions in OOB Update List Item WF Step

    In SharePoint Designer 2010, in Workflows, is it possible to give more then one condition when querying items? Let me explain, it is fairly easy to drop Update item in this list step, and say, for example, Update item with ID X. However, if is it possible
    to do something along this lines with OOB steps, Update an item in this list where Title is Equal to "abc" and Modify date no older then 3 days.
    Update: Workflow is started when the item is added to the list. What I would like is to update some fields on this item depending on information in this item and in external list. For example
    Current Item Field 1 has value "abc"
    Current Item Field 2 has value "123"
    Current Item Field 3 has value "456"
    External List has Item with value in Field 1 "123"
    External List has Item with value in Field 2 "abc"
    External List has Item with value in Field 3 "xyz"
    Update Current Item Field 3 with value "xyz"
    In short I would need following query - Update Current_Item_Field_3 with value from External_List_Field_3 where Field 1 is equal to Current_Item_Field_2 and Field 2 is equal to Current_Item_Field_1

    Hi,
    From your description, I understand you want to update list item with workflow based on two or more conditions.
    To resolve your issue, you need to use “If current item field equals value” condition. Use this condition to compare a field in the current item that the list or reusable list workflow is currently running on to a value. Values can be static text, dynamic
    strings, and lookups to variables, context information, or other SharePoint fields. And you can learn more about each condition by referring to the article:
    https://support.office.com/en-in/article/Workflow-conditions-in-SharePoint-Designer-2010-A-quick-reference-guide-d8e33ac7-9336-487f-a60b-388c4ea497ff?ui=en-US&rs=en-IN&ad=IN
    I assume your External List is called “ListB”, and Current List is called “ListA”, You can follow the steps below:
    1. Add “If current item field equals value" for condition that ListB Field2 equals to ListA Field1, then set the second condition “ListB Field1 equal to ListA Field2” as the “Find the List Item” in the “Lookup for Single line of text”
    as the screenshot below:
    2. Add “Update List Item” as the screenshot below for updating Current_Item_Field_3 with value from External_List_Field_3. In addition, you should set “Find the List Item” in “Lookup for Single line of text” same to the “Find the List Item” in step 1:
    In addition, if you have more conditions, you could add “If current item field equals value” condition, and you should set each “Find the List Item” in “Lookup for Single line of text” same to the “Find the List Item” in step 1.
    Regards,
    Rebecca Tu
    TechNet Community Support

  • Billing Comparison on quantities when two or more time slice in bill doc.

    I our project for commercial customer consumption history of past six years is normalized to create a monthly consumption base line (calendar months) this base line is maintained as installation fact and while billing execution this is used to calculate billing  base line
    E.g
    Jan consumption base line u2013 100000 KWH
    Feb Consumption base line u2013 90000 KWH
    Billing period is 15 Jan u2013 15 Feb
    Billing base line is calculated by prorating Jan and Feb consumption base line
    ((100000/31) X 17 ) + (( 90000/28) X 15) = 103053
    Periodic consumption is compared with billing base line and if
    A. Consumption is more than billing base line
          Excess consumption is billed to produce debit $ amount in bill doc
    E.g Billing base line 103053,     Periodic consumption 110000
    Excess consumption = 110000 u2013 103053 = 6947 KWH
    6947 X price = Debit $ amount
    B. Consumption is less than billing base line
    Difference between billing base line and consumption is billed to produce credit $ amount in bill doc
    E.g Billing base line 103053,     Periodic consumption 90000
    Difference = 103053 - 90000 = 13053 KWH  
    13053 X ( -Price) = Credit $ amount
    Comparison between Billing base line and Consumption is done using standard variant IF01
    The problem occurs when bill document has two or more time slice due to price change or change in facts like factor at rate category facts. If  for one time slice consumption is more than billing base line and for other time slice consumption is less than billing base line.
    Variant IF01 does not take into account time slice but it compares quantities considering whole billing period.
    E.G Billing period is 25 Jan u2013 25 Feb
    Price changes on 20 Feb
    Billing base line 25 Jan to 19 Feb u2013 50000
                                20 Feb to 25 Feb u2013 20000
    Billing base line for complete billing period 50000 + 20000 = 70000
    Consumption  (prorated by SAP)     25 Jan to 19 Feb u2013 56000
                                                              20 Feb to 25 Feb u2013 18000
    Total consumption for billing period 56000 + 18000 = 74000
    Consumption is more than billing base line for 25 Jan to 19 Feb time period and consumption is less than billing base line for 20 Feb to 25 Feb time period  but since for complete billing period consumption (74000)is more than billing base line (70000) and this comparison is done by IF01. Control in schema flows to rate which calculate the Debit $ amount for both the time slice which results incorrect calculation of bill amount
    Has anybody encountered similar scenario before. Is there a way out so that individual comparison is carried out for each time slice to pass control to correct rate in schema.
    Thanks
    Amit

    Hi,
    You can use variant quanti02 to determine the difference between the periodic consumption and base consuption.
    first, you calculate the positive difference only ( periodic consumption - base period) by selecting variant control  2  - Negative differences are not updated. You store this into a new QUANT operand called QPLUSDIFF
    then you do the same quanti02 to determine the negative difference, but first you detemine it as positive difference between base consumption and periodic consumption) and multiply the result with factor -1 with quanti09 and store it into a new QUANT operand called QNEGDIFF
    Then you have your negative and positive differences and you can bill them with the corresponding prices in subsequent steps.
    Hope this helps,
    Daniel Toba
    http://www.sap-isu.net

  • Did you know how to link the text in two or more text boxes?

    Did anyone know how to link the text in two or more text boxes in Pages 5.0? Thanks for your answer.
    Qualcuno sa come collegare il testo in due o più caselle di testo nella versione 5.0 di Pages. Grazie per le vostre risposte.

    It's just one of the many, many features that have been eliminated or changed. Leave feedback for the Pages team using the link in the Pages menu and review & rate the new versions in the Mac App Store.
    If you previously had iWork '09, those apps are still in your Applications folder in a folder named iWork '09. You can continue to use them to get things done.

  • Can I use two or more seperate Apple ID accounts on Apple TV? Everyone in my family has a different account.

    Can I use two or more Apple ID accounts on the new Apple TV? Everyone in my family has a seperate account.

    Of my 7 Apple TV's only one is connected by ethernet, they all work as expected, more often than not at the same time (I probaly haven't had 7 running at the same time, it depends on who's using what))

Maybe you are looking for