Event structures used to monitor indicator change

I am new to the event structure.
Is it possible to monitor an indicator for a value change?  I know this works with controls, but I'm not sure you can monitor and indicator in this way.
Thanks,
-Nathan

Yes, it's possible. However, in order to change the value so that an event will fire, you'll have to use the value(signalling) property of the indicator. It won't work if you simply wire a value to it.

Similar Messages

  • Add event cases to an event structure using scripting

    Hello,
    Iam trying to (using scripting) update an event structure (add event cases) on a vi that is not on memory.
    i get error 1054 The specified object was not found.
    here is a picture of it.
    any help in this will be greatly apreaciated.
    Solved!
    Go to Solution.

    Another suggestion, the following VI is a wrapper for Traverse for GObjects VI and allows you to specify the name of the object you want. I always use this VI, I never use the Open VI Object Reference function, for the reasons tst mentioned:
    vi.lib\Utility\traverseref.llb\TRef Find Object By Label.vi
    Darren Nattinger, CLA
    LabVIEW Artisan and Nugget Penman

  • Using an event structure to reset a boolean control with ring menu value change

    I am trying to get two boolean buttons to reset when the value of a ring menu changes.  For this I am using an event structure set to execute with a ring value change.  However I have other code that needs to be executing while the event structure waits for the value change.  I place my event structure inside the while loop the buttons reset as expected but my other code does not run (except at the moment of value change). If I place it outside the loop the rest of the code functions as expected but the buttons do not reset.  Any help you can offer is much appreciated.
    Solved!
    Go to Solution.
    Attachments:
    event structure reset.vi ‏11 KB

    try this
    Attachments:
    event structure reset_edit.vi ‏14 KB

  • I using an event structure for an input box and also for hardware input

    Hi there!
    I have many input boxes and display boxes on my user interface and i have a case for it in the event structure. If the user changes the values of the input boxes, the particular event case writes this new value to the hardware. However, in the timeout section of the event structure, we read the inputs from the hardware and we set the value for its related display object.  Within the timeout section i set the value for the related user interface display component, by making use of the property node value.
    Furthermore, for most of the display components, i have a event case for a value change associated with it. In that event case, i check for range errors and so forth.
    My assumption was that when i read the value in from the hardware and set the property node value, the user interface component's value will change and it would then trigger the event of the value changed for that component. 
    My assumption worked to the point of updating the component's value, however, it did not trigger the event  for the value changed for this component.
    Please advise me on how to achieve what i wish to.
    Thanks.
    Regards,

    Local variables are actually much more efficient than property nodes as far as execution speed goes. Take that same VI and delete the property node and instead write to a local variable inside the loop. You'll see the speed nearly identical to writing directly to the indicator. But note that variables also cause a copy of the data to be created. So if you're just using the "Value" property, you're much better off using a local variable. But don't use both at the same time. If you are reading/writing other properties when you update/read the value, you might as well use the value property.
    Sometimes you can't get around using either variables or property nodes. Initializing controls to saved values from an ini file is one example. But in this case, they are only written to once as the application starts so the performance hit is negligible.
    One thing you can do is store values in a shift register as they are read and pass this through your application so the last value read can be accessed from anywhere. You can even create a cluster that runs through the shift register to hold several values in a single register. This can be expanded a bit farther to create what's called a Functional Global. This basically a subVI with a While loop that only runs once on each call. It has a shift register to store data and a Case structure to Read or Write data into the register. There's a pretty good example that ships with LabVIEW showing how these work. Open the Example finder and search for "Functional Global Communication". This example shows how to use them to pass data between two independent loops, but they work just as well in a single loop application.
    One of the big advantages of these Functional Globals over the standard LabVIEW Globals and local variables is that you can add cases to manipulate the data in addition to just storing it. Also, since it's a subVI, access to the data is protected to one caller at a time whereas variables can have multiple reads and/or writes at the same time. This can cause race conditions.
    Hope that helps a bit.
    Ed
    Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
    Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.

  • 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

  • How to use a event structure in a subVI

    I am trying to use an event structure inside a subVI.  The subVI has an array builder that builds arrays, and the event structure is used so that when the program is running, it allows you to change the elements of the array.  It works, but when I implement it inside a subVI, it does not work properly.  This is going into a subVI, because it will be a part of a much larger progrram, so it needs to be modular.

    If you're using an event structure, it's not a subVI.  if you're worried about modularity, you shouldn't be using the event structure.
    You seem to have a fundamental misunderstanding of modularity.  An event structure should be placed within a while loop.  If you have a while loop within a subVI, you've handed over control of your program to the subVI.  You're not modular at this point.  Your top level GUI has no control.  You'd have to create some asinine system of variables to pass data down to that loop to stop the loop and return to your main VI.  That's not a good design decision.
    Instead of looking for a way to do something broken, you should spend effort trying to understand what you actually want to accomplish.  You should also spend some time learning how event structures work.
    This application is small right now and it's already on the path to unreadable.  That's a terrible thing to do to yourself.  Break these habits now.  se variables only when absolutely necessary.  Use subVIs to accomplish individual tasks, not run the entire application.  With event structures, use a stop button value change event to not be held hostage by the timeout.  If your variable has "2" in it, you're doing something wrong.  There has to be something different between the setpoints, put that in the name.  If you want to make subVIs, create an icon.
    But first and foremost, invest time in understanding dataflow

  • Want to "ignore previous" ActiveX Event using callback vi/dynamic events in event structure (LV 7.0)

    hi there
    LV 7.0: i'm using a callback vi with an registered ActiveX event (MSComCtl ToolBar/ButtonClick). i wait for the event with an event structure using dynamic events. how can i wait "ignore previous"? (like i did in LV 6.1 with the "Wait On ActiveX Event.vi").
    thx in advance
    chris
    Best regards
    chris
    CL(A)Dly bending G-Force with LabVIEW
    famous last words: "oh my god, it is full of stars!"

    hi sebastian,
    here's my code. it uses the ToolBar Control from the MsComCTL. in case you don't have a development license i put an executable to the zip.
    i want the event structure to ignore any pending events
    (like the old style solution with "Ignore previous" = TRUE).
    best regards
    chris
    Best regards
    chris
    CL(A)Dly bending G-Force with LabVIEW
    famous last words: "oh my god, it is full of stars!"
    Attachments:
    ActiveX_Events_LV_7.0_(using_MsComCTL-ToolBar).zip ‏234 KB

  • Simulate event structure in LabVIEW base?

    I have a LabVIEW base version (v8.6) which does not have the event structure. I found it was quite inconvenient to monitor the status of several controls (the action after click a control depends on the status of other control(s)). Especially if I want to add another function (control), the effort increase exponentially with the existing number of controls
    I got an idea of simulate the event structure using 'Shift Register'. First, I will bundle all the values of controls into a cluster. Then I will put the cluster in a while loop, and compare the value of the cluster with its previous value (xor the shift register). If the compare result is false (none of the control is changed), the program goes to next iteration. If the XOR result is true (one of the control was changed), then the program goes into event handling code (it will pass which control has changed, and the whole cluster). So for each control change, we can write a independent code to process the event. After processed the event, the event was cleared.
    The following is a section of my ugly code currently used to monitor several controls. And I am thinking of rewrite it using above idea so that there will be less likely a hiden bug.
    Any comments of suggestions?
    Message Edited by RyanWu on 10-23-2009 10:16 AM
    Solved!
    Go to Solution.
    Attachments:
    UglyLabVIEWCode.png ‏18 KB

    Ben wrote:
    Altough this is an interseting academic question, we really can't duplicate the efficiency of the Event structure so springing for an upgrade is highly recomeneded.
    But I am not here to sell LV but rather help LV developers so...
    Start by developing an Action Engine with the following actions.
    1) Init -caches control ref for all controls and indicators for which you need an event. Optionally rest them and cache their state.
    2) Check - Will compare the current state with the prvious state and any changes get pushed onto a stack in the AE and if there are elements in the stack (due a change detected now or one left over form the last check) and returns a type-def'd enum describing what changed. Multiple changes should be on the stack for next time.
    3) Get New - will return the new value of the value requested via an Enum.
    In you top level VI use the AE to Init before you run and then use an "Check" method to se if anything changed. If it flags a change (boolean output of AE) then the Enum is used to select the proper case of a case structure. Inside the psuedo-Event case, you can use teh AE with the "Get New" action and pass the enum to choose which value to get.
    It is hardly an Event Structure but it should come close.
    Ben
    But after looking at Knickerbocker's* post we can go farther.
    Put the above code in a sub-VI that feeds a queue. Then you can monitor the queue for updates just like in an event structure AN you can queue up all of the changes at once and can ingore my mention of caching the change methods in the AE. Just let the queue handle the stack.
    Ben
    *Kudos for inspiration!
    Message Edited by Ben on 10-23-2009 10:54 AM
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • 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 .

  • Please help me fix this event structure

    Hi there. I have this VI that has an event structure in it, I was changing some aspects of the vi, broke the wire to the stop event, and "poof" the VI is broken and I do not have the ability to fix this with my BASE package of labview.
    Can someone fix this issue with the event structure for me? It is broken in  "FC80-Serial-Event-80KW Blower.vi"
    The VI "FC80-Serial-Event-19.vi" is an example of the event structure when It is working properly.
    I have attached both.
    Thank you for your time and efforts.
    Attachments:
    FC80-Serial-Event-191.vi ‏289 KB
    FC80-Serial-Event-80KW Blower.vi ‏237 KB

    Try this.
    Attachments:
    FC80-Serial-Event-80KW%20Blower[1].vi ‏249 KB

  • Using a Global as a value change in an Event Structure

    I have many events I want to react to based on Global buttons.  How do I get the Event Structure to recognize a global button value change?  This screen shot is one of my many attempts.  So far my events only change with a real button on the FP.
    Thanks in advance,
    Doug
    Attachments:
    Event Structure.JPG ‏147 KB

    nonecure wrote:
    Jim,
    The Value (Signaling) does not work either.
    I would rather not use a notifier, so maybe I need to get away from using an event structure.
    Thanks
    It should work if your code was executing correctly. The image you posted...
    may be the reason.
    If you watch the code in execution highlighting it may help you figure what is happening.
    1) There is no guarentee that "initialize" will be written to the local "State" before the loop starts running. Use a shift register to track your state from iteration to iteration.
    Do you get any errors?
    Ben 
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Imitate boolean switch behavior using an event structure on a front panel indicator

    Hi,
    I am looking for a possibility to imitate the bevhavior of a boolean switch with an event structure. To be more precise, I want a boolean value to change each time I click on the front panel indicator and then remain constant until I click again. I have not worked with shift registers in a while loop yet, but could this be a way to find a solution?

    LordSnow wrote:
    Okay, I figured it out, BUT I still have a problem. Before I first trigger a mouse event on the front panel indicator, I already need the case structure to be executed once. Therefore I assume that I need some kind of default value, but since the event structure does not create any output at first, I have no idea how to do that.
    Are you talking about the shift register you just created?  You can while in a default value on the left shift register ndoe.  It is wired outside of the loop.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Can I use Event structures in a subVI?

    Hi,
    I have a subVI (ProvaEv1.vi) that use an event structure inside. But when I use it in a VI (ProvaVI.vi) the event structure in the subVI doesn't catch the events.
    I tried to insert the event structure in a while loop but it doesn't work too.
    Could you help me?
    Thanks Ius
    Attachments:
    ProvaVI.vi ‏11 KB
    ProvaEv1.vi ‏15 KB

    "iusn" <[email protected]> wrote in message news:[email protected]...
    Thanks to all for your answers!
    Wiebe! I tried to do as you suggested but I am not able to link the Event Reference Number inside te SubVI with the Event Register Number of the Register for Event in Main VI. There is e class conflict. Another question: how the SubVI can know the structure of the Register event outside?My aim was to create a modular structure but it seems very difficult, wath do you think about these problems?
    The broken wire is related to your question. The event structure inside the sub vi knows about the events you register in the main, because the reference wire/control has a "strong" type. It contains information about the registered events. That is also why the wire is broken. You have to register all events, then create an indicator/control of the output. Use that control in the subvi. You have to do this every time the events change (you might use a type def if you use the control a lot).
    Usually, the events that you would want to put inside subvi's are those related to user interface objects. I've had this a lot. You make a nice interface, but it's not reuseable, because the events are mixed with all the other events. Only solotion is to manually add the needed event cases in your program, and copy the code.
    Even if you can put the events in a sub vi, I'd expect hanging vi's when more subvi's are registered for the same event. It's hard to tell without trying. So it's not a real solution either.
    Like Chrisger suggested, the event callback might help a little, but they are tricky, and actually ment for this (they are intended for activex callbacks).
    Perhaps you should look at XControls (if you use 8.2). It would be more work to replace your code to XControls, but once you're done, you have reusable code.. Haven't worked with them jet, but they are invented for this problem...
    Regards,
    Wiebe.
    I have already create my application using event structure just in Main VI but it seems very complicate to read and keep update, I would have wanted to give modularity to my application.
    Thanks Ius
    SubVIEventMain.vi:
    http://forums.ni.com/attachments/ni/170/203225/1/SubVIEventMain.vi
    SubVIEvent.vi:
    http://forums.ni.com/attachments/ni/170/203225/2/SubVIEvent.vi

  • Problems with event source using event structure

    Hello!
    I'm using an event structure block. It works correctly when the event source is a control and the event is change value. But i want to use an indicator like event structure or a variable (like a matrix or a vector). I want that when the value changes, an event occurs, but it doen't work, I dont' know why?. What i have to do to work with indicators or variables in a event structure block?
    Thank you in advance
    Larson

    of course!
    regards timo
    Attachments:
    change_detection.vi ‏20 KB

  • Firing events from a Menu using Event Structure - all in the same Event Window?

    I have an ap where I have three menus, and several selections from
    those three menus. I'm trying to keep everything within the Event
    Structure, but it seems that ALL of the events fired from the Menu must
    be contained within one "frame" of the Event Structure, that being the
    Menu Selection (user) Event. In other words, if I have 16 events that
    can be fired from the menu, do I have to put them ALL in this one event
    frame?
    I can't seem to use a T/F indicator within the Menu Selection (user)
    Event to access another Event. For example, within the Menu Selection
    (user) Event, I placed a boolean named X and can turn it on with a menu
    selection. Now, make a new Event Structure to look for X Value Change -
    doesn't work.
    Message Edited by Broken Arrow on 11-30-2005 10:24 AM
    Richard

    I use one event, Menu Selection (user). to trap all of my menu events.  Use Item Path and / or Item Tag to figure out what menu item was selected then branch code based on selection.  Wtih Booleans and menus you need to update the state of the boolean on the menu by setting it True or False.  It doesn't automatically toggle like you would expect.
    Matt
    Matthew Fitzsimons
    Certified LabVIEW Architect
    LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison
    Attachments:
    menuSelect.JPG ‏45 KB

Maybe you are looking for

  • Problem update IBAN bank details with IDOCs segment E1KNBKM

    Hi all, i use Idoc DEBMAS07 in which i use the segment E1KNBKM to create IBAN in customer bank details. If bank details do not exist, the IDOC is integrated, IBAN is created. If i recreated the same Idoc, with same data (just change bank name) the Id

  • Very slight stuttering on video?

    Hi, Yesterday I finally went out and bought myself a Mini 1.83GHZ standard model with no RAM upgrades or the like. So I have connected it via a DVI-HDMI cable to my Samsung TV. Please bear in mind that I bought the Mini purely for my DVD collection.

  • "UnsatisfiedLinkError:  make_statement" when run in debugger

    I have a problem retrieving a ResultSet from a REF CURSOR -- apparently due to the JVM failing to locate requisite native code within Oracle. The problem is not in the code itself, but somewhere in the configuration / environment / debugger. I conclu

  • IPhone sending user information to...?

    Hello all, I love my iPhone, but lately I have been haunted by the static interferences with it and my table-top speakers. However, that isn't the primary concern for now - I am concerned as to why the iPhone seems to be sending my information (witho

  • Slow spatial index creation

    Hi, I am using v11.2.0.2 and it took 9.5 hours to create a spatial index for 88 million geodetic points. The table itself was created in 15 minutes (with a CTAS from another table with lat/lons) and only has two columns: ULL and GEOM. Does this seem