Change value if array data is repeated

Hello,
I am trying to write a tuning algorithm that changes the calculated tune value after the program sees the same calculated value as before.  My tuning algorithm gets hung up on the extremes (5000 and 10000) and just goes back and forth and does not get out of that mode.  I wanted to adjust the calculated tune value up or down (depending which limit is hit), so that the program can continue working and converge to the correct tuned value.
In the attached VI, the Calc Tune Value array simulates the calculated tune value from my program that is derived within a while loop. In each iteration of the while loop, a tune value is generated (the index array in the attached VI simulates the tune value generated on each iteration of my actual program).  As shown in the array, entry 3 is the same as entry 1.  How can I modify the program such that when entry 3 shows up again, I modify the value.  How can I keep a running check of the same value appearing again?   
Thanks,
hiNI.
Attachments:
tuning algorithm.vi ‏31 KB

You can use a shift register and build an array by using the Tune values you generate. Then you can compare the tune value generated out of index array primitive with the shift register array and check if it has be already generated (When you cmpare you will get array of boolean output, perform an Arrya OR operation and find if the value is already present). Then you can perform action depending on the status.
I have attached an example.
The best solution is the one you find it by yourself

Similar Messages

  • How do you change values after logging data to the citadel database (DSC)?

    How would one go about changing values that already exist in the citadel database.  So say I were logging a numeric value with a timestamp for 1 year and then wanted to change a few values for the month of June because my sensor wasn't working at that time.  How could I do this?  Is it possible without re-creating the whole database over?
    Thanks
    Matt

    mattyk wrote:
    Hey Ben,
    Thanks for the quick response.  I called NI and asked about this because this would be a big show stopper for me.  Their applications engineer said that the best way to change previous data would be to read in the trace that you want to change, modify it and save it as a new trace.  I am also looking into SQL querying.  I was able to connect to the citadel database by setting up a ODBC data source and using the database connectivity toolkit to query the database.  This worked.  Now I am trying to come up with a statement in SQL to change previously saved data.  I'll Keep you posted.
    Thanks
    Matt
    That reinforces my suspicions.
    I have an app running for about 8 years now that keeps a paper trail to enusr ethe cartdiges used in respirators (operated NIOSH National Institute of Occupational Safety and Health par teh CDC) that use DSC to enusre nobody can ever falsify those records. If they can be hacked I my customer and anyone using a respirator with a NIOSH sticker on the side of it, want to know.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Change Value While Uploading data From Excel File

    Dear Expert,
    Please guide me is it Possible?, if yes then How?
    We have one BDC Uploader there After uploading data from Excel File, i want to check one field like this....
    if it_f65data-newbs contains any Alphabet.
    then user Should be able to change value on the same time while executing Program in table.
    Please tell me how i can change value in running program
    Regards'
    Shelly Malik

    Hi,
    What you can probably do is, perform a consistency check on your data in the internal table and segregate all those rows that have inconsistent data (in your case, the field NEWBS containing albhabets) into another temporary internal table. Display the temporary internal table in an editable ALV grid saying that these data have not been inserted to the database, coz they have inconsistent data in the field NEWBS. Allow the user to edit and then save the data which will consequently refresh the internal table contents.

  • How to change value of array element using property node

    hello all : )
    im using an array of combo-box. the size of array is not fixed.
    i want to use the strings[ ] property of combo-box to enter selection texts but since i have placed it inside the array im unable to use this property.
    i used 'arrayelem' reference property and connected property node to it but didnt got strings [ ] in the selection.
    so is there any way i can use the strings [ ] property
    Solved!
    Go to Solution.

    the picture what I posted is a snippet. It is a png file which also contains a vi:
    http://www.ni.com/tutorial/9330/en/
    I have found this post. I am just reading it:
    http://forums.ni.com/t5/LabVIEW/combobox-in-array-why-does-it-work-this-way/m-p/2146916/highlight/tr...
    It might help...
    hmm, it is more complicated as I thought )
    edit: just to be CLEAR: so you want to create a new selection LIST for each of the array elements (comboboxes)) OR you just want to set all the comboboxes to a particular value which is ALREADY in the combobox list??

  • Data Model repeating same value?

    What I am trying to do is change the caption of a button to a value in my Data Connection (sample XML Data).  So I am using the Data Model from the DOM to change the caption and I am getting a value which is good to see.  The problem is its the same first value over and over as my subform repeats instead of moving to the value of the next record.  I don't believe its because of the event I'm running it under since I've changed that multiple times without any "new" results.
    Does anyone have any suggestions of what I am doing wrong?

    We did it. We chose another naming convention and only set up XI and MDM.
    I would do only DEV and QA.Then it depends on your goal. the only thing, Dont map the users credentials  to your other SAP BI structure. 
    In a perfect world, i would have doubled the logical database instance but i m not sure about your objectives.

  • How to change value date from posting date to net due date

    Hi Gurus,
    My client wants to change value date from posting date to net due date. currently posting date is considered as value date but in future client wants to change value date to net due date of documents.
    1. what configurations need to be maintained to change value date from posting date to net due date.
    2. Will these changes effect automatic payment run.
    Thanks and Regards,
    Suresh

    Hi Suresh,
    In Future
    While posting the documents you can mention the value date as due date of the documents.
    For already posted documents
    You can change the value date to net due date.
    If the value date is display mode i.e. if you are not able to change the value date in FB02 (Document Change Mode), use OB32 transaction and make value date field as eidtable (BSEG-VALUT).
    In OB32 transaction enter all the required fields like Account type, transaction type, company code and finally activate the Field can be changed check box.
    But not sure, whether we can change the value date to previous date or not?
    This would help you..
    Regards,
    Praisty
    Edited by: Praisty on Jul 28, 2009 9:56 AM

  • How to change the schedule line date in SO with reference to value contract

    Hi SD Guru's,
    I need to change the schedule line date in the sales order with reference to the value contract by using some algorithm that i will write. The problem that i can't find the suitable place to add the algorithm. I can't add it to the Copy control because there is no schedule lines in value contract and copy control for schedule lines does no exist.
    I can not add to user exit MV45AFZZ  , because order that was created with reference to the value contract, does not go through this user exit.
    Do you have some ideas where i can add it?
    Thanks and Regards
    Viky
    Edited by: Viky Sloutsky on Oct 20, 2010 12:43 PM

    Hello Viky
    How about using program MV45AFZB- USEREXIT_CHECK_VBEP or USEREXIT_MOVE_FIELD_TO_VBEPKOM
    or program FV45EFZ1- USEREXIT_CHANGE_SALES_ORDER
    Does the program go through these exits when an order is created with ref to a value contract??
    Also I am wondering why you need to change a Schedule line determined by Availability check and/or delivery scheduling?

  • How to change the value of project data in the BPM instance?

    Hi Everybody,
    I have a situation that after the bpm instance was created. We found that one of the project data/variable contains the incorrection information. Is it a way we can change the value of that project data/variable? I checked the BPM workspace, as administrator, there are not function for it and we can't stop/withdraw the instance. Can we change the MDS database for it? Please advise. It is so important for us that will stop us to move on of our project.
    Thanks

    As per my knowledge we can not change the value of BPM project variables from outside BPM. If you look at PAPI API also you will find methods to get values from BPM but not to set to BPM.
    If this is daily issue for your application then change your design to add a Edit Data Activity (Screen) and then use Grab functionality to get the control to this Edit Data Activity to change the required data.
    Else if it is an issue with the only one instance then it is better to Abort this instance and re-create the instance with correct data. Changing value in the MDS database is not encouraged.
    Hope this helps.

  • Change date format in EP when introduce values with "/" as date separator

    Hi experts,
    We have ECC 6 EHP3 with Enterprise Portal 7 SP 18. We instal BP_ERP5ESS
    1.31 SP 4.0, BP_ERP5COM 1.31 SP 4.0, BP_ERP5MSS 1.31 SP 4.0, SAP_ESS
    603 SP 4.12 and SAPPCUI_GP 603 SP 4.1
    We activate the Travel Management (FIN_TRAVEL_1) business function, so
    we use WD ABAP for travel expenses.
    The issue is when in the Portal, go to Travel and Expenses and create a
    new travel request or a new expense report and introduce the values of
    the date with "/" as separator. The system changes the date format, and
    change the days for months and months for days, DD/MM/YYYY change to
    MM/DD/YYYY. For example if we introduce 31/12/2009, the system change
    to 12/31/2009 and gives an error.
    If we introduce with "." as separator, 31.12.2009, it works fine, don´t change days for months, so it seems that is not a problem of language settings.
    Any idea?
    Thanks in advance,
    Manuel

    Hi,
    You can check the date formate in the portal.........
    log in by the Super Super give the user name ...........and check the details..........
    in there in the 1st ..view you can set the date formate..............

  • How can we change value of a field in the Repeating Table using SharePoint Workflow 2013.

    Hi
    I have an InfoPath form published on a SharePoint Library. The form contains a Repeating table and after submit a workflow runs. In this workflow I want to change some values of the fields within Repeating table.
    How can I do this?
    Thanks.

    Hi,
    I found a similar thread posted by you here:
    http://social.technet.microsoft.com/Forums/en-US/e1fa36c1-cb5c-456d-ba40-2f26301913d2/how-to-loop-through-each-row-in-a-repeating-table-using-sharepoint-workflows?forum=sharepointgeneralprevious
    I suppose both the threads are reuqesting the method to get values from repeating table via workflow, so we can focus on the issue on the other case. If there is more requestment here, let me know.
    Regards,
    Rebecca Tu
    TechNet Community Support

  • How to change value date field

    HI,
    After posting the transaction data into the document , is it possible to change the 'value date' . if it is possible pl.give me guidelines . As i know it is possible to change "Assignmentand Text filed"
    This is my user Requirement to change " Value date field".
    Regards,
    Prabhakar

    Hi,
    Check in document change FB02.
      It may allow you to change the value date. If it is not allow to change the filed then create value date in
      Document Change Rules, Document Header.
    Regards,
    Sankar

  • Changing MAXSIZE value for a data file.

    Hello, I was wondering if it is possible to change the MAXSIZE value for a data file from UNLIMITED to a specified value, like 4M.
    Thank you,
    David

    This is trhe command that actually did what I wanted:
    ALTER DATABASE DATAFILE 'D:\DBDATA\TESTPTIX02.ORA' AUTOEXTEND ON MAXSIZE 3840M;
    Thank you all for tour time and help. Have a safe and happ Christmas and new years.
    David

  • Which index values can be sent to "Insert Into Array" without changing the present array ? E.g. index -1 ?

    Which index values can be sent to "Insert Into Array" without changing the present array ? E.g. index -1 ?
    Could not find this info via the "Context Help" window.

    If you have to handle situations where you do not want to insert something in an array, then you can either use a negative index value as you suggested, or put the insert node in a case structure, with the "do not insert" case empty (almost...just crossed by the array wire!..)
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        

  • Object Array Data Provider Refresh Possible bug

    Hello
    I am having a problem with Object Array Data Provider in terms that the table's data is not changed corectly after a request as expected, but after two requests.
    Steps to reproduce the bug:
    0. Create a new Visual Web project, call it 'test'.
    Set 'Bundled Tomcat ' or 'Sun 9' as deploy target server.
    Edit 'Page1' of the project.
    1. Create an Entity class, simple class that has only getters and setters with a few fields (lets say 'id' and 'name').
    2. In the SessionBean1 that is generated by the framework create an array of Entity class named 'entityArr', and getters and setters for this field.
    3. Add a new Array Object Data Provider on the page and set in its properties as array the array created in the previous step 'entityArr (SessionBean1)'.
    4. Add a new table component, and set as data provider the provider created in step 3.
    In the Table's Layout map the fields from the Entity class, and set whatever compnents you desire for each component's type or leave the default ones (Static Text).
    5. Add a 'property change trigger component' on the page. I called it like this because I tried the following :
    5.1 A text field and a button to submit the text value
    5.2 A Calendar component with autosubmit
    5.3 A DropDown with autosubmit.
    6. On the property change trigger component created at step 5 set a value_changed method that changes the the array that should be displayed by the table.
    For Example, for a DropDown component, you will have a method like this :
    public void dropDown1_processValueChange(ValueChangeEvent event) {
    String idStr = (String) event.getNewValue();
    System.out.println("Entity id :"+idStr);
    if(idStr .equals("item1")) {
    fillSessionBean1(true);
    else {
    fillSessionBean1(false);
    getSessionBean1().setItemName(idStr);
    private void fillSessionBean1(boolean fillValues) {
    Entity[] values ;
    if(fillValues) {
    values = new Entity[4];
    for ( int i=0;i<values.length; i++) {
    Entity entity = new Entity();
    entity.setDescription("Description "+i);
    entity.setName("Name "+i);
    entity.setId(i) ;
    values[i] = entity;
    else {
    //values = new Entity[0];
    values = null;
    getSessionBean1().setEntityArr(values);
    7. When running the program, if the selected is Item1, the table does not show the array set if on this branch.
    I am using :
    Netbeans 5.5 build 20061017100,
    Visual Web Pack 070104_2,
    Ent.Pack 20061212
    jdk 1.6.0
    Operating Systems : Both Linux Suse10 and Windows.
    If anyone has a solution for this please let me know.

    OK
    While no one responded, I had to think for myself.
    There is a bug in the code generated by netbeans or there is nowhere specified that if you attach an array to a data provider you will have to notify by hand the data provider that the array has changed.
    You will have to put this line that is generated in init function in your valuechanged functions :
    objectArrayDataProvider1.setArray((java.lang.Object[])getValue("#{SessionBean1.entityArr}"));
    I think this aproach is a little bit wrong, even it works.
    I believe the data provider should be notified the array has been changed.
    There could be a much more simple aproaches :
    1. In the code generated by netbeans, if you attach an array to a data provider the data provider will be notified after any set(Object[])
    2. The data provider could have a function so you will ne anle to attach to the data provider an Object (the session bean, in my case) and the name of the function that retrieves the array (in my case, 'getEntityArr') .
    The code generated by netbeans could add this function easily.
    Maybe there are any other better aproaches, and I might be wrong.
    It's good that it works.

  • Assigning data from Repeatable Segments to target

    Hello team,
    I am naive to Adobe live cycle designer, apologies if it is a a very basic question.
    A segment in my invoice XML keeps repeating, but the identifier and the amount keep changing for every occurence of taxsummary. Example as below the target fields in my adobe form have to populated based on the <Ident> field, if it GST put <TaxableAmount> to TAX_GST, if it PST put <TaxableAmount> to TAX_PST.
    <TaxSummary>
         <Tax>
             <TaxTypeCodedOther>
                 <Identifier>
                     <Agency>
                         <AgencyCoded>Other</AgencyCoded>
                             <AgencyCodedOther>GST</AgencyCodedOther>
                             </Agency>
                                 <Ident>GST</Ident>
                             </Identifier>
                         <TaxableAmount>52500.00</TaxableAmount>
             </TaxTypeCodedOther>
         </Tax>
    </TaxSummary>
    <TaxSummary>
         <Tax>
             <TaxTypeCodedOther>
                 <Identifier>
                     <Agency>
                         <AgencyCoded>Other</AgencyCoded>
                             <AgencyCodedOther>GST</AgencyCodedOther>
                             </Agency>
                                 <Ident>PST</Ident>
                             </Identifier>
                         <TaxableAmount>9500.00</TaxableAmount>
             </TaxTypeCodedOther>
         </Tax>
    </TaxSummary>
    <TaxSummary>
         <Tax>
             <TaxTypeCodedOther>
                 <Identifier>
                     <Agency>
                         <AgencyCoded>Other</AgencyCoded>
                             <AgencyCodedOther>GST</AgencyCodedOther>
                             </Agency>
                                 <Ident>HST</Ident>
                             </Identifier>
                         <TaxableAmount>1500.00</TaxableAmount>
             </TaxTypeCodedOther>
         </Tax>
    </TaxSummary>
    I  managed to write something like this on the calculate event:
    if (xfa.datasets.data.Invoice.InvoiceSummary.ListOfTaxSummary.TaxSummary[0].Tax.TaxTypeCoded Other.Identifier.Ident == "HST")
    then
    this.rawValue = xfa.datasets.data.Invoice.InvoiceSummary.ListOfTaxSummary.TaxSummary[0].Tax.TaxAmount
    elseif (xfa.datasets.data.Invoice.InvoiceSummary.ListOfTaxSummary.TaxSummary[1].Tax.TaxTypeCoded Other.Identifier.Ident == "HST")
    then
    this.rawValue = xfa.datasets.data.Invoice.InvoiceSummary.ListOfTaxSummary.TaxSummary[1].Tax.TaxAmount
    elseif (xfa.datasets.data.Invoice.InvoiceSummary.ListOfTaxSummary.TaxSummary[2].Tax.TaxTypeCoded Other.Identifier.Ident == "HST")
    then
    this.rawValue = xfa.datasets.data.Invoice.InvoiceSummary.ListOfTaxSummary.TaxSummary[2].Tax.TaxAmount
    elseif (xfa.datasets.data.Invoice.InvoiceSummary.ListOfTaxSummary.TaxSummary[3].Tax.TaxTypeCoded Other.Identifier.Ident == "HST")
    then
    this.rawValue = xfa.datasets.data.Invoice.InvoiceSummary.ListOfTaxSummary.TaxSummary[3].Tax.TaxAmount
    endif
    trying to get this working with a foreach statement but does not seem to work, can anyone please suggest the solution using the foreach statement or something is JavaScript is also helpful..
    Thanks,
    harry..

    May be the syntax is wrong. Instead of xfa.data.record...
    can you try on this similar lines:
    xfa.datasets.data.purchaseOrder.general.poNum.value
    my xml data structure is something similar to this:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <purchaseOrder>
    - <general>
    <poNum>8745236985</poNum>
    <poDate>2004-02-08</poDate>
    </general>
    - <order>
    <companyName>Any Company Name</companyName>
    <address>555, Any Blvd.</address>
    <city>Any City</city>
    <stateProv>ST</stateProv>
    <zipCode>12345</zipCode>
    <country>Any Country</country>
    <phone>(123) 456-7890</phone>
    <fax>(123) 456-7899</fax>
    <contactName>Contact Name</contactName>
    </order>
    Try to parse your data structure in the similar way. Hope this helps.
    Chaitanya

Maybe you are looking for

  • Help needed in adding effects of certain HTML tags in Flex spark Richtext

    I want to apply the effects of the following HTML tags/ attributes, in my HTML text rendered in Flex Spark Richtext Component. Superscript - <sup> Subscript - <sub> Blockquotes - <blockquotes> Ordered Lists - <ol><li> Unordered List - <ul><li> Horizo

  • Question about how Cisco Unity Connections v 9.1.1 uses transfer rules

    I'm trying to understand how Unity hanldes calls using the transfer rules and greetings. I've got a subscriber whose standard greeting is set to send them to a call handler. Since the call is being transferred from the subscriber would it use the tra

  • ABAP program flow.

    Hi, whenever i write abap program, i usually maintain following program flow.  is it right from performance tuning point of view? 1) include statements 2) DATABASE TABLES 3)  VARIABLE DECLARATIONS 4) SELECTION-SCREEN 5) FIELD SYMBOLS 6) INITIALIZATIO

  • Sennheiser PC 136 USB headset in MAC OS 10.8

    Dear Apple support, I'm having troubles with my old headset which just appeared after my 10.7 -> 10.8 MAC OS upgrade few weeks ago. http://www.sennheisercommunications.com/ Problem description: The system somehow doesn't recognize and switch by defau

  • Battery life seems diminished after 10.6.3 update

    My battery power seems to be diminished quite a bit since the 10.6.3 update. I used to get between 3 and 4 hours when just web surfing and email (nothing else active) and the screen brightness turned down to about 60%. Since the update I'm getting cl