When to use events

Hi, I have been trying to teach myself LabVIEW for a few months now.
I have learned a lot, most of which I learn as I need it.
I have seen a lot of people mention "events", so I have been trying to learn about those.
It appears to me that events are chunks of code that run when a user does something (ie clicks a mouse or presses the keyboard).
What I don't understand is, why is this different than wiring a button on the front panel to control some loop (while loop, for loop, etc)?
When would you use one instead of the other?
Cory K

In this nugget I describe the differences between the two modes
Polling (like you do) uses a lot of CPU cycles, if you have a lot of buttons you have to check a lot of things
Event driven uses less CPU cycles, code only executes when it is needed.
Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas
LabVIEW, programming like it should be!

Similar Messages

  • I am looking for a specific photo in my event folder, it does not show up, yet when I use the search feature, the photo is there.  Why doesn't it show up in the folder?

    I am looking for a specific photo in my event folder, it does not show up, yet when I use the search feature the picture is there.  Why doesn't it show up in the folder?

    What system and iPhoto version are you running?
    If your're using iPhoto 9 or later  Command (right) - click on the photo in the search window and select Show Event in the Contextual menu. 
    That will take you to the event where the photo is.
    OT

  • When to use Custom Adapter, Event Beans and Spring beans

    Hi,
    I have basic question on when or on what basis/scenario the Custom Adapter, Event Beans or Spring beans should be used.
    All three has same implementation methods.
    Please help me in understanding when to use Custom Adapters, Event Beans or Spring beans.
    Thanks,
    Sri
    Edited by: 897694 on Mar 7, 2012 8:12 AM

    custom adapters:
    you have to use a custom adapter when you don't find any adapter in ocep which will serve your purpose.
    Most of the times you use an adapter to connect the application with external things like http server, etc It can be both to listen the events or to send the events outside.
    Event Beans:
    This type of beans does most of the work that an adapter code does but in convention beans are not used to connect the application with external stuff
    You can use Beans as event sink etc In this case using an using an adapter is not suggestable.
    If you implement Interfaces like Initializing Bean for an adapter code it won't work properly, you have to use an event Bean in that case.
    Spring beans:
    Spring beans are used when the bean code doesn't implement EventSink or EventSender.
    These beans are used to enable something (eg: make ${wlevs_dev_home}/abc/a/b.java this path is not understandable by java code unless you override the path using a spring bean)
    Most of the things which doesn't need a connection between components in the application (eg cache loader: you can do this using spring beans and event beans both but spring beans doesn't need a connection with cache)
    Hope this small writeup helps you :)
    Edited by: Patha on Mar 8, 2012 9:10 AM

  • Where is the setting for indicating which calendar i want to use when creating an event?

    When I use iCal on my iPhone, I use the + sign and then get a screen that gives me Title, Location, Starts, Ends, Time Zone, Repeat, Alert, URL and Notes. I used to get the option to choose which calendar (personal, work family, etc) that I want to use. That Calendar bar is no longer there. Why not?

    When I use the iPhone's Calendar app, I have the following avaialble when creating a new Event.
    Title
    Location
    Starts/Ends
    Repeat
    Invitees
    Alert
    Second Alert
    Calendar
    Availability
    URL
    Notes

  • APPS Adapter / Business Events not visible when BPEL uses non-apps user

    We have BPEL connection using custom oracle user, xx_b2b and when we use APPS adapter in BPEL, I can not see and use any business event.
    If anybody across same requirement, please share your experience.
    Appreciate help on this.
    Thanks,
    Sonartori

    Hi,
    I'm facing the same issue. Were you able to resolve it. Appreciate if you can let me know.
    Thanks
    -Prapoorna

  • When we are using Event pooling tables explicitly we have insert data into

    hi all
    i have read about event pooling table,
    if we implement event pooling tables then explicitly we have insert table information (like product_dim) in event pooling table explicitly
    suppose i have updated more then 5 tables in my database that time i have to enter(insert) 5 table information in event pooling table(Tables_nq_emt) in the back end
    if so then what is the use of event pooling table???
    this is event pooling table i have crated in back end
    CREATE TABLE S_NQ_EPT (
    UPDATE_TYPE DECIMAL(10,0) DEFAULT 1 NOT NULL,
    UPDATE_TS DATE DEFAULT SYSDATE NOT NULL,
    DATABASE_NAME VARCHAR2(120) NULL,
    CATALOG_NAME VARCHAR2(120) NULL,
    SCHEMA_NAME VARCHAR2(120) NULL,
    TABLE_NAME VARCHAR2(120) NOT NULL,
    OTHER_RESERVED VARCHAR2(120) DEFAULT NULL NULL
    Thanks

    Hi,
    IF you are using event pooling then you should make use of triggres in database.Create a trigger 'after insert' on some major table which you think is gonna update after every etl load.As soon as some data is inserted into this table trigger will automatically insert a record in event pooling table and cache will be purged.I am not sure about the syntax of triggers.Please google it around.
    If you are trying to purge cache through oDBC procdure then you need to create a shell script and based on whether ETL load has completed ,you need to execute this script.
    regards,
    Sandeep

  • How do I use event.target.name in AS2?

    Thanks to kglad I was able to see how event.target.name in AS3 could make a button load a movieclip with the same namesake.
    I'm doing the same thing now in AS2 but don't know what to write instead of event.target.name.
    And so at the moment each button pushes info into an array and then a function uses that to decide which movieclip to attach to a holder after it has faded out once, and then fades in again...
    // ***** IMAGE GALLERY START ***** //
    // Add image to holder
    imgholder.attachMovie("img0", "image0_0", 1)
    // Array
    var nextLoad = ["img0"];
    // Btn listeners
    img5.onRelease = function() { trace (nextLoad); nextLoad.pop(); nextLoad.push("img5"); btnClick() } // Written on 1 line
    img4.onRelease = function() { trace (nextLoad); nextLoad.pop(); nextLoad.push("img4"); btnClick() }
    img3.onRelease = function() { trace (nextLoad); nextLoad.pop(); nextLoad.push("img3"); btnClick() }
    img2.onRelease = function() { trace (nextLoad); nextLoad.pop(); nextLoad.push("img2"); btnClick() }
    img1.onRelease = function() {
    nextLoad.pop();
    nextLoad.push("img1");
    btnClick()
    img0.onRelease = function() {
    nextLoad.pop();
    nextLoad.push("img0");
    btnClick()
    // The btn function
    function btnClick() {
    trace ("click");
    var myImgTween:Object = new Tween(imgholder, "_alpha", Strong.easeOut, 100, 0, 1, true);
    myImgTween.onMotionFinished = function() {
    fadeOutImg();
    // The btn function part II
    function fadeOutImg() {
    trace ("fadeOutImg");
    imgholder.attachMovie(nextLoad, "image1_1", 1);
    var myImgTween:Object = new Tween(imgholder, "_alpha", Strong.easeOut, 0, 100, 1, true);
    I know I should be able to push the button name into the array, but am having to use a string... I'm sure my code is cumbersome!! But it works. I've tried pushing the button name but it end up including the full stage reference.
    Is there a cleaner way of doing this using event.target.name?
    Thanks for looking!

    There is no event.target in AS2. However since AS2 has no way of remembering the scope object where the target object resides, you can use this to your advantage to retrieve the name of the target by using the "this" command in the function whenever you use the above format "mc.onPress = myfunc". FYI, the popular workaround Delegate, made it possible that when you called "this" in the function, you could retrieve the scope object where the target instance resides. So without its use, "this" will return the name of the target object. Anyway this is the code you can use:
    imgholder.attachMovie("img0","image0_0",1);
    var nextLoad = ["img0"];
    img5.onRelease = onImgRelease;
    img4.onRelease = onImgRelease;
    img3.onRelease = onImgRelease;
    img2.onRelease = onImgRelease;
    img1.onRelease = onImgRelease;
    img0.onRelease = onImgRelease;
    function onImgRelease():Void {
       nextLoad.pop();
       nextLoad.push(this._name);
       btnClick();
    // The btn function
    function btnClick() {
       trace("click");
       var myImgTween:Object = new Tween(imgholder, "_alpha", Strong.easeOut, 100, 0, 1, true);
       myImgTween.onMotionFinished = function() {
          fadeOutImg();
    // The btn function part II
    function fadeOutImg() {
       trace("fadeOutImg");
       imgholder.attachMovie(nextLoad,"image1_1",1);
       var myImgTween:Object = new Tween(imgholder, "_alpha", Strong.easeOut, 0, 100, 1, true);

  • I am trying to connect a Macbook Pro to a projector for a Powerpoint presentation. When I use a VGA cable, the color of the projected images are not good. When I use a USB cable, the projected image includes the presenter notes on my computer screen?

    I am trying to connect a Macbook Pro to a projector for a Powerpoint presentation. When I use a VGA cable, the color of the projected images are not good. When I use a USB cable, the projected image includes the presenter notes on my computer screen?

    To move an iPhoto Library to a new machine:
    Link the two Macs together: there are several ways to do this: Wireless Network,Firewire Target Disk Mode, Ethernet, or even just copy the Library to an external HD and then on to the new machine...
    But however you do choose to link the two machines...
    Simply copy the iPhoto Library from the Pictures Folder on the old Machine to the Pictures Folder on the new Machine.
    Then hold down the option (or alt) key key and launch iPhoto. From the resulting menu select 'Choose Library'
    and select the Library that you moved.  That's it.
    This moves photos, events, albums, books, keywords, slideshows and everything else.
    Your first option didn't work because you imported one Library to another. Every version and thumbnail is imported like a distinct photo, you lose all your Albums, Keywords etc., the link between Original and Previews is destroyed, the non-destructive editing feature is ruined and so on. In summary: it's mess.
    Your second option didn't work because you simply referenced her library on the old machine.
    Regards
    TD

  • How can I view my photos in "Events" like in iPhoto? How can I create events?  I have 55,000 photos and 1700 events so the only way I can possibly manage my photos is using events that are one slide in size.

    I have 55,000 images organized into about 1700 events. The only reasonable way to view my library is using events in iPhoto where each event has one image That still leaves 1700 images to sort through but that is a lot easier than 55,000 images.  In the side bar is a folder with "iPhoto Events" but those views still show all of the slides.  How can I create events and view my photos as events as in iPhoto?  Events are critical for large libraries and has been my primary way to sort images.
    Thanks!

    I had a problem a couple of months ago when iPhotos suddenly rearranged the order of my Events (Why won't iPhoto let me arrange my photos?) .  I was told "Use albums not events - events are not a good way to organize - albums and folder are designed for organisation and are very flexible".
    Haha!  I should have paid attention and read between the lines!  My iPhotos were highly organised groupings - not according to date but the way I wanted them - and it was so easy to do!  I see now that if I had them all in albums, as per the Apple Apologist suggestion, I wouldn't have this unholy mess I have been left with just to make iPhone & iCloud users happy.  I am now going through Photos and making Albums (of what used to be in my Events)  ... maybe I'll get this finished before they do another non user friendly update!

  • How do I set a default calendar when adding new events on iCal?

    When I add events from either my macbook pro or my iphone using ical there seems to be no rhyme or reason as to whether these events are added to either my "work" or "home" calendar. I would like to have all events added by default to one or the other calendar. Anyone know how to set a specific calendar as the default regardless of through which device I add events?

    webco,
    Welcome to Apple Discussions.
    The iCal desktop calendar has no such preference. Default entry is dependent upon first selecting the appropriate calendar in the "CALENDARS" pane.
    The iPhone default calendar is available by selecting Settings>Mail, Contacts, Calendars>Calendars>Default Calendar.
    ;~)

  • Calendar adds an extra day when creating an event in ios 8.1.3. Is this a known bug?

    When i add an event using the calendar app in ios 8.1.3, it adds an extra day to the event when using a range of dates. I am able to recreate the problem. when entering the event i select a range of dates and confirm that it is what i want. after submitting, i verify and it has added an extra day at the end. Is this a known bug or am i on my own? Help please. this is annoying having to check each event after entering it.

    Ive reset, restored and this is the second phone. Thought it maybe a wonky screen that would shift it while setting dates. THe only thing I can think of is that I am syncing with google calendar, but it only happens when setting events in ios not if i do it from google website on desktop PC.

  • Add fields to maintenance view and update then using events

    Hi experts:
      I've created a table with 4 fields, one of them is userid. Also, there is a maintenance view to add new entries.
      I want to display user name when typing userid using events (1 or 21). I know how to do it if username is one of the fields of the table, but there is a requirement to not store username in the table, just userid.
    My question is: is possible to add a field into the maintenance view and update it using events but not store the value in DB?.
    Thanks in advance for your help.
    Regards,
    Carlos.

    In the save event just clear the entries of the field(user name) in the internal table.

  • Triggering An NMcap Capture When A Certain Event ID Repeats

    Lately we have been having an issue in our Active Directory environment where a subset of users will all be locked out. This happens at random, unpredictable
    times. Sometimes weeks or months apart, sometimes twice in a few days. After talking to Microsoft Support and using various tools and investigating Event IDs, we are getting no leads of what may be causing it. All events have no source IP address, but the
    source computer name is seemingly random and does not exist in our Active Directory, nor does it resolve via DNS. It is usually the same users, but every once in a while there will be some additional users affected. We have also triaed using NetWrix Account
    Lockout Examiner with no luck.
    Our Microsoft tech told us that we could set up an NMcap session to trigger when accounts start to get locked out, to see where the NTLM traffic
    is coming from.
    Here is what he told us:
    "You could also leverage NMCap by tying it to an event trigger.  For example, a 4625 or 4740 event on the local
    resource server could be set to trigger a batch file that kicks off the capture for a specific period of time:
    NMCap /network * /capture /file test.cap /stopwhen /timeafter 20min "
    It would be ideal, in theory, to set up some sort of logic, for example:
    if three accounts are locked out within 20 seconds,
    then start the capture, 
    and append the file name with the date / time.
    I am unsure of how to go about this. I have looked at the task scheduler, but there doesn't seem to be much logic available. We can get it to trigger
    on a specific event ID, but it's not ideal for the capture to start every time a user is locked out, as that is a part of day-to-day business. I also don't see a way for this NTLM command to append the file name, it seems like it would use the same filename
    and possible overwrite itself.
    Any help is much appreciated.  Thanks everyone!

    Hi,
    Based on my research, we can use a schedule task to trigger Network Monitor to capture network traffic when a specific event is logged, although to achieve you goal which has complex conditions, it may require a script.
    Here are some related examples for you:
    Fire & Forget – How to Stop a Network Trace Programmatically using Network Monitor
    http://blogs.technet.com/b/askpfeplat/archive/2013/05/20/fire-amp-forget-how-to-stop-a-network-trace-programmatically-using-network-monitor.aspx
    Forum FAQ: How to configure a schedule task which is triggered by an event?
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/fac16f3c-d088-4d66-83d8-7139261dea83/forum-faq-how-to-configure-a-schedule-task-which-is-triggered-by-an-event
    EventMon: Stopping a Capture Based on an EventLog Event
    http://blogs.technet.com/b/netmon/archive/2007/02/22/eventmon-stopping-a-capture-based-on-an-eventlog-event.aspx
    You can also refer to The Official Scripting Guys Forum to get professional support in regard to scripting:
    The Official Scripting Guys Forum
    http://social.technet.microsoft.com/Forums/scriptcenter/en-US/home?forum=ITCG
    Best Regards,
    Amy

  • How do you date and time stamp iCal entries?  We share an event calendar and need to know when a new event was entered into iCal.

    How do you date and time stamp iCal entries?  We share an event calendar and need to know when a new event was entered into iCal.

    BKBK,
    Thank you for your response. That does adequately cover the
    client-originated sessions, but still leaves the ability I am
    looking for unavailable.
    It did serve to definitively answer my most pressing
    question, however, with this statement:
    Note: ColdFusion cannot create a session if an initiator
    application uses a SendGatewayMessage method to start an
    interaction with a client, such as an SMS user. In this case, the
    sending code must keep track (for example, in a database) of the
    messages it sends and their destinations. When a response event
    arrives, it can look up the origniatorID to determine whether it
    was in response to an outgoing message.
    I will play around with the Application scope to see if there
    might be a workable solution there.
    RLS

  • How to Update multiple items in other list using event handler?

    Hi All,
    If i update a item in a list, then i should update multiple items in another list need to be update. How to achive using event receivers?

    Hi Sam,
    According to your description, my understanding is that you want to update multiple items in another list when updated a list item.
    In the event receiver, you can update the multiple item using Client Object Model.
    Here is a code snippet for your reference:
    public override void ItemUpdated(SPItemEventProperties properties)
    string siteUrl = "http://sp2013sps/sites/test/";
    ClientContext clientContext = new ClientContext(siteUrl);
    List oList = clientContext.Web.Lists.GetByTitle("another list name");
    ListItem oListItem = oList.GetItemById(1);
    oListItem["Title"] = "Hello World Updated!";
    oListItem.Update();
    clientContext.ExecuteQuery();
    Best regards,<o:p></o:p>
    Zhengyu Guo
    Zhengyu Guo
    TechNet Community Support

Maybe you are looking for