Swap the key focus at Array element

Hello,
          Would you help me about the title query ? the details is in attachment. thanks @! LV7.1 version.
Attachments:
help.vi ‏40 KB

Attached is a quick example showing the basic method needed for a table.
An array is more complex, because to refer to a specific array element, you first have to resize the number of visible elements to 1, then use the Array Element>Reference and cast that reference to a cluster, and set the key focus to the right element of the cluster and then resize the array back to its display size. To avoid having the user see this, you need to use the Defer Panel Updates property, and this might cause the control to lose the focus, I'm not sure.
A side note is that using Value property nodes is not a good way of doing things. A local is usually better and using real data flow is even better.
Try to take over the world!
Attachments:
help mod 71.vi ‏63 KB

Similar Messages

  • How to set the value of an array element (not the complete array) by using a reference?

    My situation is that I have an array of clusters on the front panel. Each element is used for a particular test setup, so if the array size is three, it means we have three identical test setups that can be used. The cluster contains two string controls and a button: 'device ID' string, 'start' button and 'status' string.
    In order to keep the diagrams simple, I would like to use a reference to the array as input into a subvi. This subvi will then modify a particular element in the array (i.e. set the 'status' string).
    The first problem I encounter is that I can not select an array element to write to by using the reference. I have tried setting the 'Selection s
    tart[]' and 'Selection size[]' properties and then querying the 'Array element' to get the proper element.
    If I do this, the VI always seems to write to the element which the user has selected (i.e. the element that contains the cursor) instead of the one I am trying to select. I also have not found any other possible use for the 'Selection' properties, so I wonder if I am doing something wrong.
    Of course I can use the 'value' property to get all elements, and then use the replace array element with an index value, but this defeats the purpose of leaving all other elements untouched.
    I had hoped to use this method specifically to avoid overwriting other array elements (such as happens with the replace array element) because the user might be modifying the second array element while I want to modify the first.
    My current solution is to split the array into two arrays: one control and one indicator (I guess that's really how it should be done ;-) but I'd still like to know ho
    w to change a single element in an array without affecting the others by using a reference in case I can use it elsewhere.

    > My situation is that I have an array of clusters on the front panel.
    > Each element is used for a particular test setup, so if the array size
    > is three, it means we have three identical test setups that can be
    > used. The cluster contains two string controls and a button: 'device
    > ID' string, 'start' button and 'status' string.
    >
    > In order to keep the diagrams simple, I would like to use a reference
    > to the array as input into a subvi. This subvi will then modify a
    > particular element in the array (i.e. set the 'status' string).
    >
    It isn't possible to get a reference to a particular element within an
    array. There is only one reference to the one control that represents
    all elements in the array.
    While it may seem better to use references to update
    an element within
    an array, it shouldn't really be necessary, and it can also lead to
    race conditions. If you write to an element that has the
    possibility of the user changing, whether you write with a local, a
    reference, or any other means, there is a race condition between the
    diagram and the user. LV will help with this to a certain extent,
    especially for controls that take awhile to edit like ones that use
    the keyboard. In these cases, if the user has already started entering
    text, it will not be overwritten by the new value unless the key focus
    is taken away from the control first. It is similar when moving a slider
    or other value changes using the mouse. LV will write to the other values,
    but will not rip the slider out of the user's hand.
    To completely avoid race conditions, you can split the array into user
    fields and indicators that are located underneath them. Or, if some
    controls act as both, you can do like Excel. You don't directly type
    into the cell. You choose w
    hich cell to edit, but you modify another
    location. When the edit is completed, it is incorporated into the
    display so that it is never lost.
    Greg McKaskle

  • MSI Wind U110 - Reverse/swap the keys functions of the "Fn" key with "Left Ctrl"

    Hi guys,
    is there a bios-fix to reverse/swap the keys functions of the "Fn" key with "Left Ctrl" for the MSI Wind U110. I don't know why this keyboard is still that disfunctional. I think this is a well known issue, people complaining about for a long time. I am really hoping that you can help me.
    Thank you, CyberKlabauter.

    Quote from: Henry on 08-December-09, 10:47:03
    Have you tried using the 'Search' function up there.
    I did. But maybe I'm to stupid to do it right. I found this thread http://forum.msi.com.tw/index.php?topic=121066.0 but there is nothing about the U110. If I'm searching for U110 I get only three topics (one is this one). I guess I shouldn't use any bios hack from a other model.
    May you're willing to help me a little bit more. Thank you.

  • How to change the color of Numeric array elements (seperatel​y) programmat​ically using property node??

    For example, i have 3 numeric controls, controlling 3 numeric array elements (Numeric control is connected directly to indicator). Then if i change value in numeric control 1, then the array element No.1 of numeric array should turn red when value exceeds 5. Similarly when i change num control 2 then element 2 of array should turns red when value in num control 1 exceeds 10. Similarly for 3rd element. In other words, i want to control the property of array elements individually through seperate numeric control.
    I have done it for single numeric indicator.i.e. when i change numeric control's values then a single numeric indicator changes values and color (Numeric text BG property) but with array, the color of whole array changes but i want to change color of singles element of array.
    Please help thanks.  
    Solved!
    Go to Solution.

    ...or replace the numerics with clusters that have a numeric and a color box. make the background of the nmeric transparent and slide the color box behind the numeric. Use the color box to control the background color.
    Other alternatives would use a cluster instead of the array or if your req's are really weird "roll-your-own" with a Picture control.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • How to add a character at the end of an array element that meets certain criteria.

    Hi. I am using CF 9.2.1. I started learning CF yesterday, and I am trying to figure out a way to add a special character (like "?", "!"," & ") to an array row if the first row element (say, element [1][1]) has a specific letter like " t" in the word it is holding. In this case the special character will be added at the end of the last row element (element [1][3]).
    Example: The take columns are: "Firstname", "Lastname", "Age".  If Firstname contains an "s" or "S" (in any order) then add "!" at the end of the row so that :
    Sam, Rubins, 26 !
    Nick, Palo, 32
    Robert, Williams, 28
    Oscar, Ramirez, 23 !
    I tried using the ReReplace, Refind and the #findoneof functions. I could probably loop through the array and return a value and store, while storing the value in a separate variable and using an if/Boolean function to compare that value and so on.... But I am sure there's an easier and more efficient way. Thanks in advance.
    <!--- #1 I will create a three column query named CityInfo--->
    <cfset CityInfo = QueryNew("City, State, LCode","VarChar, VarChar, Integer")>
    <cfset newRow = QueryAddRow(CityInfo, 2)>
    <cfset newRow = QueryAddRow(CityInfo, 3)>
    <cfset newRow = QueryAddRow(CityInfo, 4)>
    <cfset newRow = QueryAddRow(CityInfo, 5)>
    <cfset newRow = QueryAddRow(CityInfo, 6)>
    <!---Using the column names City, Sate and LCode I will now enter the information--->
    <cfset temp = QuerySetCell(CityInfo, "City", "Dallas", 1)>
    <cfset temp = QuerySetCell(CityInfo, "State", "TX", 1)>
    <cfset temp = QuerySetCell(CityInfo, "LCode", "214", 1)>
    <cfset temp = QuerySetCell(CityInfo, "City", "Fort Worth", 2)>
    <cfset temp = QuerySetCell(CityInfo, "State", "TX", 2)>
    <cfset temp = QuerySetCell(CityInfo, "LCode", "817", 2)>
    <cfset temp = QuerySetCell(CityInfo, "City", "San Antonio", 3)>
    <cfset temp = QuerySetCell(CityInfo, "State", "TX", 3)>
    <cfset temp = QuerySetCell(CityInfo, "LCode", "210", 3)>
    <cfset temp = QuerySetCell(CityInfo, "City", "L.A.", 4)>
    <cfset temp = QuerySetCell(CityInfo, "State", "CA", 4)>
    <cfset temp = QuerySetCell(CityInfo, "LCode", "213", 4)>
    <cfset temp = QuerySetCell(CityInfo, "City", "Austin", 5)>
    <cfset temp = QuerySetCell(CityInfo, "State", "TX", 5)>
    <cfset temp = QuerySetCell(CityInfo, "LCode", "512", 5)>
    <h4> Number1. City info TABLE contents:</h4>
    <cfoutput query = "CityInfo">
    #City# #State# #LCode#<br>
    </cfoutput> 
    <!--- #2 Now I focus on the array. I declare it first --->
    <cfset cityarray=arraynew(2)>
    <!--- Then I retrieve the data and populate the array --->
    <cfloop query="CityInfo">
    <cfset cityarray[CurrentRow][1]=City>
    <cfset cityarray[CurrentRow][2]=State>
    <cfset cityarray[CurrentRow][3]=LCode>
    </cfloop>
    <h4>Number2. City info ARRAY contents before appending:</h4>
    <cfloop index="Counter" from=1 to=5>
    <cfoutput>
    City: #cityarray[Counter][1]#,
    Estate: #cityarray[Counter][2]#,
    Code: #cityarray[Counter][3]#<br>
    </cfoutput>
    </cfloop>
    <!--- #3 I now add/append Irving to the array and change L.A. --->
    <cfset cityarray[6][1] = "Irving" />
    <cfset cityarray[6][2] = "Texas" />
    <cfset cityarray[6][3] = "972" />
    <cfset cityarray[4][1] = "Los Angeles" />
    <h4>Number3. City info Array contents after adding Irving, TX and updating L.A.:</h4>
    <cfloop index="Counter" from=1 to=6>
    <cfoutput>
    City: #cityarray[Counter][1]#,
    Estate: #cityarray[Counter][2]#,
    Code: #cityarray[Counter][3]#<br>
    </cfoutput>
    </cfloop>
    <br>
    <!--- #4 now I look for the 's' in order to add a '!' THIS IS WHERE MY PROBLEM BEGINS --->
    <h4>Number4. City info after searching for "s"</h4>
    <cfloop index="Counter" from=1 to=6>
    <cfoutput>
    City: #cityarray[Counter][1]#,
    Estate: #cityarray[Counter][2]#,
    Code: #cityarray[Counter][3]#,
    <!--- I know the findoneof function is not going to help me, but I hope it helps to give you an idea of what I am trying to do--->
    #findoneof("sS",cityarray[Counter][1])#
    <br>
    </cfoutput>
    </cfloop>

    It is much simpler than you think. Additions and modifications are in italics. Good luck!
    <h4>Number2. City info ARRAY contents before appending:</h4>
    <cfloop index="Counter" from="1" to="#CityInfo.recordcount#">
    <cfoutput>
    City: #cityarray[Counter][1]#,
    State: #cityarray[Counter][2]#,
    Code: #cityarray[Counter][3]#<br>
    </cfoutput>
    </cfloop>
    <!--- #3 I now add/append Irving to the array and change L.A. --->
    <cfset cityarray[6][1] = "Irving" />
    <cfset cityarray[6][2] = "Texas" />
    <cfset cityarray[6][3] = "972" />
    <cfset cityarray[4][1] = "Los Angeles" />
    <h4>Number3. City info Array contents after adding Irving, TX and updating L.A.:</h4>
    <cfloop  index="Counter" from="1" to="#arrayLen(cityarray)#">
    <cfoutput>
    City: #cityarray[Counter][1]#,
    State: #cityarray[Counter][2]#,
    Code: #cityarray[Counter][3]#<br>
    </cfoutput>
    </cfloop>
    <br>
    <!--- #4 now I look for the 's' in order to add a '!' THIS IS WHERE MY PROBLEM BEGINS --->
    <h4>Number4. City info after searching for "s"</h4>
    <cfloop index="Counter"  from="1" to="#arrayLen(cityarray)#">
        <cfset sPosition=findNoCase("s",cityarray[Counter][1])>
        <cfoutput>
        City: #cityarray[Counter][1]#,
      State: #cityarray[Counter][2]#,
        Code: #cityarray[Counter][3]#
        </cfoutput>
       <cfif sPosition GT 0><!--- Just display the exclamation mark--->
        <cfelse> <!--- Add whatever you like, or nothing, here--->
        (no 's')
        </cfif>
        <br>   
    </cfloop>

  • X301 - is it possible to swap the Fn and Ctrl keys?

    I've seen an option in the bios on other Lenovo models, but cannot find a way to swap the keys on the x301.
    I love this notebook, but this is terrible design. Every other keyboard in the world places the Cttrl key in the bottom left hand corner.Ugh...

    Welcome to the forum!
    You might have seen the "BIOS switch" option on some other brands, but no Lenovo notebook offers it.
    Cheers,
    George
    In daily use: R60F, R500F, T61, T410
    Collecting dust: T60
    Enjoying retirement: A31p, T42p,
    Non-ThinkPads: Panasonic CF-31 & CF-52, HP 8760W
    Starting Thursday, 08/14/2014 I'll be away from the forums until further notice. Please do NOT send private messages since I won't be able to read them. Thank you.

  • Key focus is not visible for all objects when tabbing

    I'm using LabView 5.1.
    The key focus is not visible for all objects when tabbing through a "disabled and grayed-out" object.
    For example, let's say I create a panel with 3 buttons. If I create a "disabled" attribute for button 2 and assign the value "2" (disabled and grayed-out) to it. When I will run this VI, the key navigation will go through button 1 and button 3 (skipping button 2 as expected) but the key focus on button 3 will not be visible.
    Is this a bug with LabView or am I doing something wrong ?

    Hi Ben,
    Don't worry, time is not an issue... I'm posting an example of a VI with the problem I described. I noticed that the problem occurs only with "dialog buttons".
    When you have time, let me know if you see the same behavior. If you do, I will report the problem to National Instrument.
    Thanks for your time !
    BigBen
    Attachments:
    3buttons.vi ‏22 KB

  • Type defined array of clusters for holding configuration data - setting default values for each array element

    Hi,
    I was wondering if I could get some information and opinions about using a type defined array of clusters to hold configuration data.  I am creating a program to test multiple DUTs and wanted to have a type defined control for each DUT containing the information needed to create the DAQmx tasks for all of the signals for that DUT.  I am wanting to do this so that the data is hard-coded and not in a file that the user could mess up.
    The type def controls are then put in a subVI that chooses the appropriate one based on the DUT Type enumeration wired to a case structure.  
    I am having problems with the type defined control.  I am seeing issues when attempting to save a unique configuration to each array element in the array of clusters.  Somehow it worked to begin with, but now clicking "Data Operations --> Make Current value default" on individual elements of the cluster or the entire cluster (array element) is not saving the data when I re-open the type def control.  What am I doing wrong?  Am I trying to do something with arrays of clusters that I should not be doing?
    I have attached one of the type defined controls for reference.  I tried changing it to Strict to see if that helped, but no luck.
    To reproduce, change the resource string for array element 0 and make the new value the default value.  Then close the type def, and re-open it.  The old value is still present in that element.  The VI is saved in LabVIEW 2012.
    Solved!
    Go to Solution.
    Attachments:
    CM_AnalogInputs.ctl ‏11 KB

    Values of a typedef are not proprigated to instances of the control. THey will pick it up if created AFTER the data values have been changed. THey will not get updated with future changes. You should either create a VI specifically for hardcoding your values or implement a file based initialization. The file based would be much better and more flexible. If you don't want users to modify the data simply encrypt it. There is a noce blowfish library you can download.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • Chart array elements separately

    Labview forum,
    I have a for loop which produces an array of 2 elements.
    This is contained within an outer loop.  Inside the outer loop, I have connected the array to a chart function.  For each outer loop iteration, the the chart plots both array elements as sequential elements in the same plot.  This was not the behaviour I wanted.
    Instead, with each outer loop increment, I would like each array element to be added to a separate curve on the same chart axes.  Thus, in this case, two curves would be plotted simultaneously.
    How can I achieve this?
    Attached is a simple example of my current situation.
    Regards,
    Jamie
    Message Edited by Jamieg on 09-17-2007 06:45 AM
    Using Labview version 8.0
    Attachments:
    sample chart loop.vi ‏14 KB
    sample chart loop1.vi ‏14 KB

    An alternative solution uses the "array to cluster" function. (Don't forget to set the cluster size!)
    Message Edited by altenbach on 09-17-2007 07:50 AM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    sample_chart_loop1MOD.vi ‏15 KB
    multichart.png ‏2 KB

  • Key focus problem

    Hi,
    I have a small subvi that simply has a string control which the user enters a string value.
    I am using the key focus property node to put the cursor in the string control.
    The subvi works very well alone, however when I call it from my main vi, the cursor is not in the string control.
    It seems the key focus is not working.  Any suggestions?

    OK, I agree there is still something broken in that subVI, because it does not work with a TRUE setting either.
    I was able to fix it by simply going to the windows properties of the subVI in question and setting its mode to "Dialog", then saving it again. (Make sure to close the FP before running the main VI) This seem to clear the corruption and the keyfocus now works. See if this works for you too. Good luck!
    LabVIEW Champion . Do more with less code and in less time .

  • Testing array elements

    Hello,
    This might be a very stupid question, but I did do quite a bit of searching and haven't found the answer. I'm trying to test the value of an array element and not sure how to do this. Here's the code:
    public static void Fibbonacci(int end){
         Integer[] f = new Integer[end];
         f[0] = 0;
         f[1] = 1; //2
         int i = 2;
         while(f[i] <= end){
         f[i] = f[i-1] + f[i-2];
         print(f);
         i++;
         print(Array.getInt(f, i));
    My understanding is that, as in C, the array elements are pointers (or reference) to the actual values. Is there a way to dereference? How would I assign an element of an array to a single variable to of the same type as the array elements?
    Thank you very much for your time!
    Edited by: DaneWKim on May 10, 2010 8:59 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Hmmmm... it seems I'm missing something. In my previous code,
    while(f[i] <= end){doesn't seem to evaluate. also, when I do
    j = f;
    print(j);
    I get 0 even if the element indexed has a non-zero value.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Key Focus when Adding Tags

    When I click the "Add Tag" button at the bottom of a post, the text entry field does not automatically receive key focus, meaning I must click on the field before I begin to type or CTRL+V a tag from the clipboard. I would like to see this text entry box automatically receive keyboard focus after clicking "Add Tag".
    a.lia-user-name-link[href="/t5/user/viewprofilepage/user-id/88938"] {color: black;} a.lia-user-name-link[href="/t5/user/viewprofilepage/user-id/88938"]:after {content: '';} .jrd-sig {height: 80px; overflow: visible;} .jrd-sig-deploy {float:left; opacity:0.2;} .jrd-sig-img {float:right; opacity:0.2;} .jrd-sig-img:hover {opacity:0.8;} .jrd-sig-deploy:hover {opacity:0.8;}
    Solved!
    Go to Solution.

    Good news this time... the key focus for adding tags works in the upgraded version which you will be hearing more about soon!
    Thanks,
    Laura

  • Remove "Highlight" of Key Focus

    Is there a way to remove the "highlight" that setting the key focus on a control brings about?
    I want the key focus to be on a button, but I have edited the control,
    and now the black box that gets around it is ungainly, and was
    wondering if there was a way to remove it?

    Hi Novatron,
    I'm not aware of any setting that will remove the visible border around
    the object that's in focus. The only thing you can do is make sure that
    the object will never get in focus by right-clicking the control and then choose "Advanced » Key navigation » Skip this control when tabbing".
    Has anyone else created a programmable workaround for a similar issue?
    - Philip Courtois, Thinkbot Solutions

  • Barcode scanner key focus

    Hi All
    I have doubt in setting the key focus to the string.
    Once i started the program, message pops up to the user.once the user clicked OK button the cursor have to come to string. I have attached my VI.pls give me some guidance
    Thanks
    Attachments:
    Barcode_ex1.vi ‏19 KB

    Hi Veeru,
    do you really need the PopUp every loop iteration? I made some changes in your vi, maybe it helps.
    You should define an  event case for every Control you want to work with.
    Mike
    Attachments:
    Barcode_LV80.vi ‏20 KB

  • Boolean key focus

    I have an event case that executes when a boolean is pressed by the user.   In the event I set the property 'key focus' to TRUE for an string control where the user needs to enter information.   The first time the event executes key focus for the string control is not set.  The second time onward, the key focus gets set.  How come it does not get set the first time the event occurs?

    Yup, I've done that many times myself. Can you post an example showing the effect?
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

Maybe you are looking for