How to disable an element of array?

Hi,
Here i have written VI that will make an array of meaningfull data, for example: data pattern 23 16 16 24 
So whenever two consecutive 16 occurs, VI will delete one 16 from data pattern. But in my case wht problem i am facing is: 
Whenever it deletes 16 from data pattern, it will show 0 in place of 16 but  i need that cell fully disabled unless this 0 will count into mu data pattern. 
So i am trying to use disable property node for greying that particular cell or can any tell me why 0 is coming into array when it deletes 16 from it.
 Puneet
CLA 2014
CCVID 2014
Solved!
Go to Solution.
Attachments:
recieve.vi ‏65 KB

Hi Puneet,
from what I see in your screenshot the described behaviour is resulting from an unhealthy combination of using (hell a lot of) locals in combination with "use default if unwired" case structure output tunnels
Remove locals (you already have a shift register, so use a wire instead!), use more descriptive names than "array", wire all output tunnels to avoid unwanted behaviour of your vi...
Why do you compare with an array (in your for loop) when you only need the result for the first element? Compare with scalar instead...
Why is "DLE Check" of type DBL? You only seem to use it as integer...
Why do you write to terminal "Array" and a local "Array" after the FOR loop? (Here is probably the root of the problem!) Only one of the write operations will be effective and you don't know which one...(possible explanation: the local array gets an array formed by autoindexing. So this array contains data for each iteration including an zero [because use of "default if unwired"] when you initially wanted to delete that very element!)
Aditional note:
Next time you attach a screenshot please use a picture format like PNG (as long as you don't use BMP)!
Message Edited by GerdW on 05-17-2009 11:03 AM
Message Edited by GerdW on 05-17-2009 11:05 AM
Best regards,
GerdW
CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
Kudos are welcome

Similar Messages

  • How to disable individual elements in array

    How do I disable individual elements in an array at runtime.

    I assume you are referring to the control property "disabled".
    If so there is no way to disable a single element of an array. By definition an array is a collection of data, it is not a collection of controls. A fine line but an important one. So you can configure the single control that makes up the array and defines its type. For example, if you have an array of Booleans, you can change the color of the Boolean. However this will change the color of all the Booleans in the array. It is 1 control, with a lot of values.
    Part of the reason for this is memory. Imagine an array of 1 million elements. If you could set the properties of each element, then to store that array would be incredibly large. It would be 1 million U8s for example, but then all the properties for each 1 million elements would also need to be saved. Therefore your 1 million element array of bytes could easily represent 100 million bytes in memory.
    Let me know if this explanation makes no sense, I usually explain it better, but I think I need more coffee.
    The way around this is clusters. You can change each element in a cluster, so if your array is of a manageable size, change your array control into a cluster of n elements. You can then use the cluster to array function to convert the data to the array of data you need. Unfortunately this method means that before runtime you must know the maximum number of elements you will need. You can always hide the extras, but you can not create more during execution.

  • How to disable UI element during runtime

    Hi!
    Can someone show me how to access the properties of ui elements during runtime?
    eg. in the method  WDDOINIT i want to enable/disable the GroupBox "Group"
    how to?
    thanks

    >
    Abhimanyu Lagishetti wrote:
    > ideal way is the one i specified,
    >
    > other way is you have to change it in WDDOMODIFYVIEW
    >
    > to get any UI element this is the code
    >
    > view->get_element( '<ID of the UI element>' ). which return the corresponding UI element reference
    >
    > the UI element classes start with CL_WD_*.
    >
    > for example: inputfield CL_WD_INPUT_FIELD
    > data: lr_input type ref to cl_wd_input_field.
    > lr_input ?= view->get_element( '<ID of the UI element>' ).
    > lr_input->set_enable( abap_true ).
    >
    > Abhi
    I would like to stress that this NOT the SAP recommended way of controlling the properties on UI elements - the first solution you were give would be the recommended approach.  The direct UI coding access should be used as a last resort when working with dynamically generated UI elements.  Otherwise you should always try and set the UI element properties via context binding. This makes your application more accessible to customizing/personalization, makes it easier to maintain over time and provides the best performance.

  • How to add all element of array?

    1-D array has N number of element .i want to sum all the element ,and the result is a number.
    can you give me some example?
    thanks.

    Just use the "Add Array Elements"-function located in the Numeric palette.
    Message Edited by becktho on 02-21-2006 12:58 PM
    Using LV8.0
    Don't be afraid to rate a good answer...
    Attachments:
    AddArrayElements.PNG ‏14 KB

  • How to disable PS Elements 10 splash screen?

    I'm frustrated that I get this Welcome screen everytime I start Photoshop.  How do I turn it off?
    I just want to start editing, like in the full version. 
    I FOUND IT.   For anyone wanting to do the same thing:
    1. Do NOT go to the Edit/Preferences menu in Photoshop. Not there.
    2. At the Welcome screen, click on the "settings" in the upper right corner.
    3. Choose "Always Launch Photoshop Elements Editor only."
    4. You are done. 

    Welcome to the forums, Tom.
    Well, actually, that's one way, but the thing is that the welcome screen still runs background processes when you turn it off that way. Better to go into the program files and make desktop shortcuts to the editor and/or organizer in windows or make dock icons for OS X.

  • How to disable Photoshop Elements 4.0 from opening up.

    Hi all, just wanted to thank all of you for answering my two other questions I had. My question now is when I start up Photoshop Elements 4.0 up it goes through alot of info before it actually opens up to view my pic's. Is there a way to just open my pic's up without it going through Photoshop's window first? Can I disable that start up feature?
    One more quick question. When opening up any pic's it automatically open up in Photoshop. I don't want it to do this I want to open pic wherever I want. Thanks again all for you great help.
    [email protected]

    While in windows, right click on an image file, go to "open with" and choose the program you prefer--it was probably "windows picture and fax viewer"(or something like that) before you installed PSE--and check the box "always use this program".
    You need to do this for all of the image types you want to open with the alternate program: jpg, gif, etc.

  • How to disable one single element in a 2D array?

    Hello,
    I would like to disable one element in a 2D array. its size is constant at least.
    I can change its value by using a 1D array of cluster, but I can't use the property mode easily to disable an element.
    If you have any idea, it will be great.
    Thank you for your help.
    Lolopuf

    Right click on the particular control you want to disable and change the properties on that.  To do it programmatically, create a reference for that specific control and set the Disabled property for that.
    Attachments:
    Example_VI.png ‏15 KB

  • How to delete an  element in an array...(simple way)

    hi,
    Newbie here... please help how to delete an element in an array list?
    there are alot of codes but they're complicated for a newbie like me..
    (simple codes would be better ..:) thank you...

    makk_88 wrote:
    since u want the simple method.....
    just overrite the position of the element that need to be deleted with the next element in the array..
    by doing this, element need to be deleted will not be accessibe..
    i think u got..what i'm saying.
    thnx..Mak,
    Say we wish to delete the second element of an array a[1]. Do you really believe that a[1] = a[2] somehow magically deletes a[1]? I really don't think so Tim.
    Two eggs, minus 1, equals two eggs? Interesting theory, but I think you're probably wrong.
    *@OP:* My advise is just use an ArrayList.
    Cheers. Keith.

  • How to Disable/End Date an Element Link/Element in HR 11.5.7(Fam.Pack G)

    We want to disable some element links that are no longer valid. These element links are assigned (element entries) to certain employees based on the eligibility criteria set (e.g. Organization/Job/Grade/etc). However we want to disable these elements from a specific date onward as they are no longer valid. I tried to end date either the element entry or the element link but I got the message "Field is protected against update".
    From help the only thing I found regarding deleting an element is to delete all element entries linked to that element link and then delete all element links linked to that element to be able to delete or end date the element.
    But what we need to do is only to disable the element links and not to delete them all together and lose any historical records related to these element entries.
    If anyone has any idea on how to deal with this issue will be highly appreciated.
    Thanking you in advance.
    Elena

    Hi again,
    I made a search regarding elements/links and managed to find an old document (2002) regarding links and following the suggestion there I managed to end date the element links in request.
    In order to end date the Element Link since it does not allow
    you to make any updates you have to try to DELETE it and then select END DATE instead of PURGE.
    Thank you!
    Best regards,
    Elena

  • How to obtain Hashtable element (array) base type?

    Hi,
         I have read the thread
              http://forum.java.sun.com/thread.jspa?forumID=52&threadID=531561
         on determining the base type of an object array.
         I tried applying the technique to my Hashtable where the element are arrays, this is how I am setting up my Hashtable to pass on to my native method
    Hashtable ht = new Hashtable();
    Float Kd[] = new Float[1];
    Kd[0] = 0.1f;
    Float from[] = new Float[3];
    from[0] = -4.0f;
    from[1] = 2.0f;
    from[2] = 1.0f;
    Integer indices[] = new Integer[4];
    indices[0] = 217;
    indices[1] = 17;
    indices[2] = 769;
    indices[3] = 23;
         myNativeMethod("dbname",ht);
         In my native method, I have the following which is able to determine the array size so I think it is kind of working/correct but when I tried to determine the base type of the array, I keep getting Bus error.
         Here is my native code (as part of my SWIG code)
         Should I be handling arrays obtained from Hashtable differently, can someone point out to me what the correct approach is?
    Regards
    8<------8<------8<------8<------8<------8<------8<------8<------
    if ($input != 0) {
    std::cout << "SWIG ...parameterlist..." << std::endl;
    // Generated typemap code
    const jclass hashtable = jenv->FindClass("java/util/Hashtable");
    if (hashtable != 0) {
    const jclass enumeration = jenv->FindClass("java/util/Enumeration");
    const jmethodID keys =
         jenv->GetMethodID(hashtable, "keys",
                   "()Ljava/util/Enumeration;");
    const jmethodID get =
         jenv->GetMethodID(hashtable, "get",
                   "(Ljava/lang/Object;)Ljava/lang/Object;");
    if (enumeration != 0) {
         const jmethodID hasMoreElements =
         jenv->GetMethodID(enumeration,
                   "hasMoreElements", "()Z");
         const jmethodID nextElement =
         jenv->GetMethodID(enumeration,
                   "nextElement", "()Ljava/lang/Object;");
         for (jobject keyset = jenv->CallObjectMethod($input, keys);
         jenv->CallBooleanMethod(keyset, hasMoreElements) == JNI_TRUE;) {
         jstring key = (jstring)jenv->CallObjectMethod(keyset, nextElement);
         jarray value = (jarray)jenv->CallObjectMethod($input, get, key);
         jclass valueClass = jenv->GetObjectClass(value);
         jclass valueClassClass = jenv->GetObjectClass(valueClass);
         const jmethodID getName =
         jenv->GetMethodID(valueClass,
                   "getName", "()Ljava/lang/String;");
         jstring valueClassClassName =
         (jstring)jenv->CallObjectMethod(value, getName);
         const char *vccptr = jenv->GetStringUTFChars(valueClassClassName,
                                  0);
         std::cout << "vccptr is " << vccptr << std::endl;
         jenv->ReleaseStringUTFChars(valueClassClassName, vccptr);
         const char *keyptr = jenv->GetStringUTFChars(key, 0);
         std::cout << "key is " << keyptr << std::endl;
         int numElements = jenv->GetArrayLength(value);
         std::cout << "value array size is " << numElements << std::endl;
         // const char *valptr = jenv->GetStringUTFChars(value, 0);
         // $1 = CSLAddNameValue($1, keyptr, valptr);
         jenv->ReleaseStringUTFChars(key, keyptr);
         // jenv->ReleaseStringUTFChars(value, valptr);
    8<------8<------8<------8<------8<------8<------8<------8<------
    Regards
    Message was edited by:
    nicholas_yue

    You've asked the same thing before. Assuming that you've defined the function prototype correctly when you built the DLL from the VI, you should be able to call it and get the results from it. You do not need to change the return type when you build the DLL. Read the information at http://zone.ni.com/devzone/conceptd.nsf/webmain/7D6A20FE02EDBF318625690700704CF3. Even though it was written for LabVIEW 6, the section on Accessing LabVIEW 6x Arrays from Microsoft Visual C++ is still valid.

  • How to show the elements of an array?

    How to show the elements of an array, when the array size changes every loop?
    It's possible to use node property?
    thanks
    Vicens
    Win XP/ LV7.1
    Attachments:
    show elements.PNG ‏184 KB

    Basically it is (at least in LV8.0). There is a property "Number of Rows" which sets the number of visible rows. If your 1D array is placed horizontally, use "Number of Columns".
    Using LV8.0
    Don't be afraid to rate a good answer...

  • How can i retrieve missing element in array

    how can i retrieve missing element in arrays if array length is exceeded

    Not sure about what the question means, but could it be that OP is not aware that the first element in an array is at index 0 (not 1) ?
    <a href="http://java.sun.com/docs/books/tutorial/java/nutsandbolts/arrays.html" style="background:url(http://java.sun.com/docs/books/tutorial/figures/java/objects-tenElementArray.gif) no-repeat; width:400; height:145;"></a>

  • Using Scrollbars and also to disable individual element.

    I need to display two dimensional array of checkboxes using Labview 7.1. The two dimensional array should have  row headers and column headers.
    Also the row headers and column headers are to be scrollable. I was able to make separate scrollable row and column header array.
    But this the scrolling cannot be apllied on the two dimensional array of checkboxes. I tried but was able to make it one way only, that is scolling the row header array also scrolls the checkbox array row-wise but not column-wise.
    There is another problem with the two D array of checkboxes. My application needs some of the checkboxes to be disabled and others enabled. Since array does not allow individual elements to be disabled , i cannot use array .
    So please suggest how to go about this. I have attached a sample VI to explain .
    Attachments:
    Sample.vi ‏21 KB

    Hi Hema,
    Would it be acceptable for your application to use only one table, as shown in the attached idea.vi ?
    Instead of booleans, you have can compute 0/1 value, no ?
    Otherwise I don't know how to do...
    When my feet touch the ground each morning the devil thinks "bloody hell... He's up again!"
    Attachments:
    idea.vi ‏10 KB

  • How to disable certain columns of a Table?

    hi all,
    I wish to fill a pattern of 8 digital signals (only 1's & 0's) in a Table.
    Is there any way to restrict the user from typing char or num other than a 1 or a 0?
    Since the table is a string, I'm having confusion how to do this.
    Secondly, the table would have by default 12 columns visible on the Front Panel, excluding both the headers.
    But the No. of Columns is based on a parameter called Duration that ranges between 4 & 256.
    What I want the user to do is to key in 1's & 0's for the Duration chosen.
    Since it'll be tedious to key in for large values of Duration, I've given the option of Set Row(s) & Reset Row(s),
    that will fill with either 1 or 0 respectively for the chosen Row Value.
    Is there any way to disable the remaining columns of the Table, ie, those unfilled columns,
    when the user scrolls horizontally? I don't know how to achieve this.
    I went thro' the Properties of the Table, I don't understand some of their functionalities,
    like SelStart, SelSize etc.
    I wonder why a Property like Disable Array Elements for Arrays is not provided for a Table
    to Disable the columns we want to do so, or is it my gross ignorance, I don't know.
    Experts pls clarify me & help me out.
    Regards,
    Partha.
    - Partha
    LabVIEW - Wires that catch bugs!
    Attachments:
    Set Eventframe1.vi ‏409 KB

    Another option is to do this:
    Slightly more elegant, but also more potential for bugs (e.g. the users can tab into the column).
    craigdobis wrote:
    You can lower your overhead by using these "professional" looking indicators and controls. They are limited in functions and properties, thereby causing a smaller VI in file size.
    Nice. I didn't think about that. Looks like a VI with a single system boolean takes ~20% less space than one with a standard boolean.
    P.S. In general, I would say there are considerably better arguments for using system controls than memory issues.
    Try to take over the world!
    Attachments:
    Disabled Column.png ‏5 KB

  • How to disable multiple items in menu ring?

    Hi I have a difficulty understanding on how to disable the items in the menu ring control. I need to know so that I will enable some items for the future products for testing. And why is the first item disabled? How can I disable the right items?
    Attachments:
    disabled_items.vi ‏23 KB

    Your vi works perfectly :
    you are disabling the menu items wich correspond to the elements of the 1D array :
    -if the array is empty, no element is disabled;
    -if the array contains 1 element, for instance = 3, the forth (3+1) menu item will be disabled. If the array element equal zero, then the first menu item will be disabled;
    - if the array contains 2 elements, then two corresponding menu items will be disabled, and so on...
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        

Maybe you are looking for

  • Transaction in TaskFlow and locking

    Hello I'm using JDeveloper 11g 11.1.2.1.0 I came across strange (in my opinion) behaviour of the transaction option inside taskFlow: if taskFlow's transaction option set as something other than "<No Controller Transaction>" (for example, "Use Existin

  • Do I need to take a form of purchase when I see a 'genius'?

    I'm going to see a genius tomorrow about my iPhone 4, and am wondering whether I need to take a form of purchase for it? I cannot vividly remember it coming with a receipt, seeing as it was just the box it came in... I ordered it directly from Apple.

  • Call of Duty

    Will my MacBook Pro be able to play the original Call of Duty? I am not looking to play Call of Duty 2.

  • Related To Metalink...

    Hi All, Actually I want to make Oracle media request.Every time when I click on Service Request and create Sr after then I can fill three fields like Contact me Via Metalink,Phone Number,and I will enter the text of this SR in english but in 4th fiel

  • While import data through ff_5 i am getting error

    hello while import data through ff_5 i am getting error  as below message error fv150 and fv151 'Termination in statement no. 00009 of acct 1101200570116; closing record 62F missing' so please give solution thank inadvance SIRI