Event structure to detect value change of a control within a cluster in an array

I have 1D array that contains a cluster. The cluster contains a numeric and a boolean control.
If the user starts to edit the numeric control value i would like to call one subVI, and if the boolean control value is changed, call a different subVI.
The array control on the front panel allows the user to edit a number of the array elements. 
I would like to use an event structure to detect a value change in the cluster. When editing the Events, in the Event Sources panel i get the option to select only the array, not the cluster within the array or the controls within the cluster. Can the Event structure be opened up to show controls within clusters and arrays?
The solution i am using is to detect a mouse up event on the array and then use property nodes to  determine if the key focus is on the numeric, and  a case structure to determine which subVI to call. This works, but is there a better (simpler) way?
Thanks, Blue.

Thanks for the responses guys.
The tricky bit was that i wanted the numeric control values to flag they were going to be edited, so i could call a subVI, before their values were changed by the user. This is done by using the key focus property node, - i need to detect changes on the fly rather than post the event.  Probably didn't make this clear enough in my original post. 
The array is of variable size depending on if the user decides to insert or delete elements. The user also has the option to click and edit the array without having to do to much scrolling through the array index, as the FP shows several elements at a time. The Event Structure does a good job of automatically determining which element in the array is being edited, and returning those values to the property nodes. Turned out simpler than i thought it might be at one point!
Cheers, Blue. 
Message Edited by BlueTwo on 01-15-2009 06:52 AM
Attachments:
evstrct1.jpg ‏63 KB

Similar Messages

  • Detect value change in a wire

    Hi, this seems pretty trivial, but I cannot find a clean way to do it, and i couldn't find anything in the forums. I want to detect a change in the value in a wire coming out of a "Get timestring VI", from iteration to iteration, and I dont think event structures quite help, because they detect changes only in front panel controls. I prefer not to use shift registers because they bring in unnecessary clutter. Is there a cleaner way to do this?
    Thanks!

    A feedback node is a little less clutter because it is more localized.
    Here's the code to detect a change in a numeric, but it works with any datatype. Modify as needed.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    Changed.png ‏3 KB

  • How can I fire an event case on the value change of an indicator, or a network variable?

    Hi!  I have an event structure setup to look for a value change of an indicator on the front panel.  The indicator is updated by the value of a boolean network-published shared variable through a seperate parallel loop that is polling all of the network-published shared variables.  The event, however, does not fire when the indicator changes value.  I have switched the indicator to a control and tested it with user interaction and that works just fine.
    I want to use the event structure space for my code exectution because it seems logical that that is where it would go, and it will help keep my block diagram tity.  The code is also something I would like executed with the front pannel temperarily disabled.  I would rather not have the code in my network-variable polling loop because again the tity issue.   I would also rather not use a notification VI wired to an independent loop for this particular code.
    Is there a way to have an event structure fire an event with the value change of an indicator, or a network variable directly?
    Thanks for your input.
    LV 8.5
    -Nic

    Thanks for the reply.
    I went about things a little differently, but got them to work so..... .  It really was not my desire to have a boolean indicator on the front panel.  As previously stated, my ultimate goal was to have an event fire on the change of a network variable, which I had to poll for anyway but that is tucked away in a section where I am handling all my network variables.  I ended up using that Create User Event, Register User Event, and Generate User Event SubVIs to handle the task.
    I've read the help for all of those SubVI's and it is not entirely clear to me if the event fires every time the "Generate User Event" receives some inputs, or if it only fires when the value changes.  I could do a test to find out.  It wouldn't be too difficult to add a shift register or a feedback node and place the Generate User Event in a case structure so that it is only fired when the input changes state.

  • Is it possible to generate a user event when shared variable value change on RT target?

    Hi,
        I wonder if it is possible to generate a user event when a network published shared variable value change?
        Thanks a lot!
        Regards,
        Tom

    Tom,
    I understand not wanting to waster resources on polling but I am not aware that LabVIEW can automatically generate an event on a SV change.
    Maybe a better solution...
    You could implement lower level TCP communication (i.e. have a look at STM - simple messaging protocol) for passing data betweeen RT and PC (instead of using a SV).  You could send a generic command (boolean trigger maybe?) from your RT system when the value of whatever it is the SV is storing has changed.  You can avoid polling on the non-RT system this way.
    Dan

  • Event structure to detect the element operated in a cluster

    Hi,
    i have a cluster with #60 booleans in it with all different labels (1...60).
    i have created a event (for whole cluster, not added individual 60 elements) in event structure to find the label of the element.
    when i try to fetch the label.text, i am able to get only the cluster label not the element.
    please give suggestions,, so that i wil be able to extract the individual label in a cluster.
    Thanks in advance
    phani
    phani srikanth

    ... and if you don't want to deal with all these references and prperety nodes inside the event structure, you could do as follows. same difference.
    ...and if the cluster is of mixed datatype, wire the output of search array to a case structure and act according to the changed element.
    Personally, you might want to use an array of boolean instead, simplifying the code even more.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    BooleanInCluster.png ‏11 KB

  • Using an Event Structure to sense selection of a ring control

    LabVIEW version 6.1. Windows 2000. I am trying to develop a robust approach to sensing when the operator presses the lighted boolean push button to initialize a VI procedure. Presently I am using an User Event Structure. I have tried triggering on a 'value change', and 'mouse up'. Either one works properly the first time, then hangs on the second invocation of the button, with the push button LED light on - with no action - the event fails to trigger?

    In article <[email protected]>,
    new_user wrote:
    > Hi,
    >
    > Yes I will gladly post my VI.There are (2) block diagrams. The
    > 'setpoint' ring controls should invoke the upper block diagram in the
    > event of a selection.
    > The lower block diagram should be invoked when the 'Initialize
    > Displays' push button is pressed. It is turned off upon successful VI
    > execution.
    > Both are exhibiting the same symptom - only first time execution?
    Well they aren't in a loop so they are both wating for an event. Each
    one will fire once and then exit. There should be only one event
    structure and it should be inside a while loop. The loop should
    terminate when the stop button is pushed
    and fires the stop button value
    changed event.
    So, make the bottom event one of the events in the top structure and put
    the whole thing in a while loop. Make a stop button and make another
    event case for the stop button value change, wire the new value property
    to the loop stop terminal.
    Also you are using the value of the INIT button before it changes (ie
    the old value). That value is read before the value change and passed
    into the event loop. Move the init button to inside the event structure
    value change for the init button.
    Get rid of the local variable in the lower sequence structure in the
    init event case. There is no need for it. In fact get rid of the
    sequence structure entirely it is not necessary to force a sequence on
    those actions which should be optimized by the compiler.
    -Scott

  • Problem updating a control on one panel based on a value change in another control on a different panel

    Hi,
    I am trying to update the value of a control on one panel when the value of another control on a different panel is changed.  The two panels are saved in two different .uir files, so there are two associated .h files generated by CVI.  The problem is that, inside the callback function for the control that is being modified (Ctrl_Id_A on Panel_A), when I call SetCtrlVal(Panel_B, Ctrl_Id_B, Value); 'Panel_B' and 'Ctrl_Id_B' (which have the same numeric values as Panel_A = 1 and Ctrl_Id_A = 2 in their respective .h files) are being interpreted as Panel_A and Ctrl_Id_A.  I never understood how CVI makes this distinction, eg. knowing which of PANEL_A = 1 and PANEL_B = 1 is being referred to, but didn't worry about it since I never needed cross-communication between panels until now.  Any help on how to implement this would be greatly appreciated.  Thanks!
    Solved!
    Go to Solution.

    This is a basic issue on which you can find tons of forum posts
    The online help for the function recitates:
    int SetCtrlVal (int panelHandle, int controlID, ...);
    Parameters
    Input
    Name
    Type
    Description
    panelHandle
    int
    Specifier for a particular panel that is currently in memory. You obtain this
    handle from LoadPanel, NewPanel, or DuplicatePanel.
    controlID
    int
    The defined constant, located in the .uir header file, that you assigned to the control in the User Interface Editor, or the ID returned by NewCtrl or DuplicateCtrl.
    value
    New value of the control. The data type of value must match the data type of the control.
    That is, you must not use the panel constant name in the first parameter of SetCtrlVal, use the panel handle instead. The system guarantees that all panel handles are unique throughout the whole application whichever is the number of panels used in every moment.
    int SetCtrlVal (int panelHandle, int controlID, ...);
    Purpose
    Sets the value of a control to a value you specify.
    When you call SetCtrlVal on a list box or a ring control, SetCtrlVal
    sets the current list item to the first item that has the value you
    specify. To set the current list item through a zero-based index, use SetCtrlIndex.
    When you call SetCtrlVal on a text box, SetCtrlVal appends value to the contents of the text box and scrolls the text box to display value. Use ResetTextBox to replace the contents of the text box with value.
    Note   This function updates the displayed value immediately. Use SetCtrlAttribute with ATTR_CTRL_VAL to set the control value without immediately updating the displayed value. For this reason, SetCtrlAttribute with ATTR_CTRL_VAL is generally faster than SetCtrlVal. However, if the control in which you are setting the value is the active control in the panel, SetCtrlAttribute with ATTR_CTRL_VAL displays the value immediately.
    Note   This function is not valid for graph and strip chart controls.
    Parameters
    Input
    Name
    Type
    Description
    panelHandle
    int
    Specifier for a particular panel that is currently in memory. You obtain this
    handle from LoadPanel, NewPanel, or DuplicatePanel.
    controlID
    int
    The defined constant, located in the .uir header file, that you assigned to the control in the User Interface Editor, or the ID returned by NewCtrl or DuplicateCtrl.
    value
    New value of the control. The data type of value must match the data type of the control.
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • Tracking value change in Label control

    Hi,
    Is there any way to determine the bindable value change in a
    Label control automatically and fire any function upon that?
    Thanks!
    ASB.

    Don't know if this is what you are looking for, but it might
    be useful:

  • How to change property of control inside a cluster?

    Hello,
    1)
    I have cluster with dozen controls (booleans and slides).
    I want to change the slides control scale property in runtime.
    Im doing UnbundleByName to the cluster to pick the right slide, but how i continue from here? how i access to that slide property?
    2)
    The main problem is that i have vi with lot of controls, and i want to find a way to save the control values to file, so i decide to insert all those controls to cluster, and to use datalog...Is there any other elegant way?
    Tnx,
    HaD
    Message Edited by HaD on 08-06-2007 03:43 AM

    Hi HaD,
    controls usually have properties for Caption and Label. You can check one or both for the name of your control...
    The array of control references should contain the references in the tabbing order, but it's always a good idea to cross-check that you use thoe correct reference
    Message Edited by GerdW on 08-06-2007 11:21 AM
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • How to detect value change of item?

    Hi all,
    We want to list all goods that customer chooses, so TileList is used to display all goods information and a custom component MyItem is used as ItemRenderer. Meanwhile a Label is used to display the sum of all the goods. The hierarchy is simply like this:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"  layout="absolute" >
    <mx:TileList id="tl" dataProvider="{acGoods}" ItemRenderer="MyItem"/>
    <mx:Label id="labelSum"/>
    </mx:Application>
    Here, acGoods is an ArrayCollection which I believe is bindable.
    User may change price inside MyItem directly, so the text of the Label need to update as well. I find that acGoods contains latest price. Now the problem is Label text stays the same. I have tried to call calculating function in set acGoods() but it doesn't work.
    Please don't sugguest dispatch event because this is only a simplified scenario. If anybody tell me how to implement this by binding mechaism, that'll be very helpful.
    Best wishes,

    protected function get totalLabelText():string {
        // for each var i:* in acGoods and so on
        return 'Calculated label here';
    <mx:Label id="labelSum" text="{totalLabelText}"/>
    Inside MyItem:
    once you changed something invoke:
    Application.application.executeBindings(true);
    Hope this will work for you

  • Will "Value change" events fire when changed via ActiveX?

    I have a VI with an Event Structure defining several Value Changed events. These events are associated with various buttons on the control panel. When I work through the panel and press the buttons, the events fire correctly. However, if I connect via the COM/ActiveX control and change the control values, the button indicator light changes, but the Value Change event does not fire. Can we trigger value changed events remotely or must they be triggered via a mouse-click on the button?

    Hi Cyle,
    Please take a look at the document below. It explains why the events are not being fired.
    Event Structure Does Not Capture the Value Changed Event for Indicator Wired to Iteration Terminal
    I hope this helps.
    Sincerely,
    Feroz
    National Instruments

  • Intensive slider control use may lead to LabVIEW hang and system instability when coupled to event loop "Value Change"

     Occasionally, over the past year or two, I have noticed on different machines and versions of LabVIEW (8.0 and 8.5) that intensive operation of the LabVIEW slider control (holding down the left mouse button and shaking the mouse quickly back and forth to move the slider for several seconds) may cause LabVIEW to hang with high CPU usage (50% on my current test machine, which has a Pentium IV "hyperthreaded" processor, so 50% is the max that a single thread can take up). In some instances, after the LabVIEW process is forced to quit, the system itself becomes unstable (more high CPU usage) or hangs, up to and including the need for a hard restart. I have seen this behavior both when handling slider change events the "old fashioned" way with a while loop and a case structure; and also when using a while loop with an event structure handling the "Value Change" event for the slider. 
    Attached is an .rtf file dump of the front panel and block diagram of a simple test VI that replicates this problem in my hands (using an event structure). The loop count runs to at least several hundred iterations before the crash occurs.
    At least for the "old fashioned" loop handling method, adding a forced wait of a few dozen msec per loop didn't seem to be a workaround. I haven't tried this idea with the event structure, but don't expect joy to follow. The possibility of a system hang discourages aggressive experimentation. 
    Is this a known issue? Can anyone else replicate it (carefully)? In any case, I'd welcome other suggestions for workarounds.
    Thanks,
    Darin Nelson
    Attachments:
    Hang Slider.rtf ‏683 KB

    Thanks for all your responses, and especially to those who are waggling their mice around trying to reproduce this. I'll respond to (most aspects of) the last several posts in one message.
    LabViewGuruWannabe:
      I'll see if I can get the original code to post in a separate message, I posted the .rtf originally because I thought there might be filtering on forum posts (I'm sort of new here). But I doubt you re-created it wrong.
      The "more modern" test hardware was an Intel Core2 , 2.4 GHz, 2Gb RAM, on an Intel 965 family motherboard. As I said, it took me two tries to trigger the error on this hardware; in the case where it triggered, I was at almost 12000 iterations before things went south. 10000 iterations, therefore, might not be enough--or you might never get it, for all I know. My Pentium 4 Hyperthreaded machine (3.2 GHz, 2 Gb RAM) triggers the hang much more easily (always within 2500 iterations, usually within 1000), so there seems to be some hardware dependence here. Maybe the workaround is just to use hardware recent enough that no one not under the influence of strange compulsions will accidentally trigger the hang.
    TonP:
      After reading your suggestion, I tried something even more radical  -- getting rid of the handling code altogether. I took the slider node out of the while loop, and removed all code inside the "Slide" case of the event structure.
     On my Pentium 4 machine, the hang triggered after 677 iterations.
    Brian Beal:
    <!--
    /* Style Definitions */
    p.MsoNormal, li.MsoNormal, div.MsoNormal
    {mso-style-parent:"";
    margin:0in;
    margin-bottom:.0001pt;
    mso-pagination:widow-orphan;
    font-size:12.0pt;
    font-family:"Times New Roman";
    mso-fareast-font-family:"Times New Roman";}
    span.EmailStyle15
    {mso-style-typeersonal;
    mso-style-noshow:yes;
    mso-ansi-font-size:10.0pt;
    mso-bidi-font-size:10.0pt;
    font-family:"Courier New";
    mso-ascii-font-family:"Courier New";
    mso-hansi-font-family:"Courier New";
    mso-bidi-font-family:"Courier New";
    color:windowtext;
    mso-text-animation:none;
    font-weight:normal;
    font-style:normal;
    text-decoration:none;
    text-underline:none;
    text-decoration:none;
    text-line-through:none;}
    @page Section1
    {size:8.5in 11.0in;
    margin:1.0in 1.25in 1.0in 1.25in;
    mso-header-margin:.5in;
    mso-footer-margin:.5in;
    mso-paper-source:0;}
    div.Section1
    {pageection1;}
    -->
     Huh, I never even noticed that checkbox existed. Anyway, yes, I
    kept the default to lock out the front panel while the event process. If I
    disable it… I still get the hang.
    Message Edited by dman on 02-04-2008 06:36 AM

  • Event structure buffering?

    Hi all,
    A quick question, if i have an event structure with lots of value change events for booleans, if 2 or 3 change at the same time or within a few milliseconds of each other does it buffer this event so that when it comes out of the event structure it knows another one has happened since it last went in? i.e. it could get a trigger for one, enter the event structure pass over a couple of ones that didnt trigger then get a trigger for them whilst its in it, but gone past them, then deal with the one that did trigger it and exit. Or perhaps i am not understanding how event structures process the value change triggers.
    I hope i have explained myself well enough
    Cheers
    Mike

    Pnt wrote:
    Yes. As far as i know, events are buffering and it is NOT possible to miss one.
    I agree here. You cannot "lose" any events. Sometimes this is a problem as demonstrated (and solved) in this old discussion:
    http://forums.ni.com/ni/board/message?board.id=170&view=by_date_ascending&message.id=207811#M207811
    Pnt wrote:
    I agree that you should not have the same event in two different event cases (in parallel), but i disagree that there is possibility to miss an event.
    LabVIEW will not allow you to place the same event in multiple event cases anyway, so there is no problem. However there is also no problem having two different event structures listening to the same event.
    LabVIEW Champion . Do more with less code and in less time .

  • Event Structure's value change, not detecting changes when tabbing thru array of clusters

    Hi!  I have an array of clusters (int, int, string, int) control, and want to detecting changes made to the it.  I used the Event Structure's value change case on the array, it works excellent except that it'll only detect the changes when you click out of the element or press the enter key (the one by the numbers, not carriage return).  I want it to detect the changes when I tab thru the cluster or array too, but I can't figure it out... Does anyone have any ideas?
    Thanks!

    mfitzsimons wrote:
    altenbach
    Tried Value Change with my example done in 7.1 and it doesn't trgger an event.  That is why I suggested Mouse Down.
    Curious. I did a few minor edits in 8.0 before saving as 7.1, but the simple value change event got triggered just fine when the value vas terminated with a tab in 7.1. Every time.  Strange....
    Are you on 7.1 or 7.1.1? Maybe there's a difference (I am using 7.1.1).
    LabVIEW Champion . Do more with less code and in less time .

  • How to tackle the dataflow problem when Value Change event always triggers after another GUI event

    We know that Value change event always triggers after another GUI event. Eg, the user modifies string control, the user clicks on a boolean control. Then event boolean clicked is triggered before event string control value change.
    Now suppose somehow the GUI event that must happen to subsequently trigger the Value change event can potentially affect the data that Value change event is supposed to work on. How can we tackle this problem ?
    For example, in a mockup application that the grand purpose is to have user entered values in a textbox logged to a file (no missing information is accepted, and there is a boolean to determine how the information is logged).
    There are 2 controls, boolean A when clicked (mouse down) will load random number in text box B. Text box B is designed with event structure VALUE change which saves whatever values user enters into text box B to a log file.
    There are 3 problems when instead of clicking anywhere on the front panel after modifying text box B, the user ends up clicking on boolean control A.
    1. Event mouse down on Boolean control A will execute first, modifying text box B content before the user entered values in B get saved.
    2. The value of boolean A can potentially affect how textbox B is loggged.
    3. The value of boolean A affects how the file is logged and this is indeterminate. Somehow when running this VI with no Highlighting, the textbox B Value change event executes -before- boolean A value is updated (F to T). When running this VI with Highlighting, the boolean A value is updated (F to T) (because we click on it) -before- textbox B value change event occurs. Why is it like this ?
    Now the situation I made up seems non-sense, but I believe it resembles one way or another a problem that you might run into. How would you solve this problem elegantly ?
     

    You can set the string control to "update while typing".
    Are you sure appending the log to itself is reasonable? Wouldn't it grow without bounds if the users keeps entering strings or pressing the ingore button?
    Why isn't the "constant" a diagram constant instead of a control. Is the user allowed to change it?
    To reset just write empty strings or a false to local variables of the controls (renit to defaults" seems a bit heavy handed).
    All you probably need is a single event case for "ignore:value change" and "String" value changed", no need for the local variable..
    Also add a stop button and an event for it.
    You don't need the timeout event.
     

Maybe you are looking for

  • Help new itunes upgrade won't open even when ipod is plugged in

    Ok so evey time I click on the itunes icon in my start menu or plug in my ipod my computer makes that thinking noise they usually make when opening something and then nothing happens. I've also tried going into the itunes folder and clicking on files

  • Max. no. of failed attempts reached: Request I for PHIO HR_DOC(E-Recrument)

    Hi, We are facing problem in SKPR07 as   doc are not getting indexed , we checked all related Docs (Trex and SAP) and everything seems correct , error we are receiving in SLG1 after click on trigger procees(SKPR07) is Max. no. of failed attempts reac

  • Resumable space allocation limitations

    If a DDL operation such as CREATE TABLE or CREATE INDEX is executed with an explicit MAXEXTENTS setting (or uses the MAXEXTENTS setting from the tablespace DEFAULT STORAGE clause) which causes an out of space error during its execution, the operation

  • Calls from Lumia 610 doesn't transfer to MW600

    Hi, I'm using a Nokia Lumia 610 running Windows Phone 7.5 Mango, using the MW600 with the phone's music works fine. But when a call comes up or I made an outgoing call, no audio from earphones and microphones of MW600. Call audio remains on the hands

  • Microsoft works will not work on fire fox why

    when i want to cut and paste a article from the web page to microsoft works word processor the firefox stops working how can i fix this == This happened == Every time Firefox opened == after i downloaded firefox