Is it ok to trigger 2 event loops off the same control?

I have two event loops which need to trigger when the Exit button is clicked on. Is it ok to trigger both loops off the same control? It has been working great, but I'm not sure if there could be an issue. Please see below. Thank You!
Solved!
Go to Solution.

sfrosty wrote:
Another point may be that I have  50 ms wired to the timer in the MENU event structure and don't want any delay in the MAIN Event structure. Not sure if this is a valid point.
Why?  Are you doing something else in that loop?
I would recommend moving your menue stuff into your main event loop.  You will thank yourself later.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines

Similar Messages

  • How to I trigger an event based on the status of a pushbutton​?

    I am trying to trigger an event based on the ON/OFF status of a pushbutton.  When I click the pushbutton to the ON position, I want the event structure in a loop to trigger on each iteration until the pushbutton goes back to the OFF position, either manually or programatically.  Is there an easy way to accomplish this?
    Many thanks.
    Solved!
    Go to Solution.

    Well, lets read the original question:
    diarmaede wrote:
    I am trying to trigger an event based on the ON/OFF status of a pushbutton.  When I click the pushbutton to the ON position, I want the event structure in a loop to trigger on each iteration until the pushbutton goes back to the OFF position, either manually or programatically.
    I cannot see anything about "switch until released", only "click to ON" and "OFF manually or programmatically". That seems to be a plain switch action.
    JHourigan wrote:
    If I want to simply detect a button push event. I set the mechanical action of the boolean button to switch-until-released. Then I use the mouse down event structure on that button to detect the event.  It avoids having to include a case structure logic to address the state of the boolean in an Value Change event structure. The button immediately returns to the false condition after release.
    So far you are not dealing with the OFF handling at all, which seems to be a requirement. There must be more to it that you mention to get this working as intended. The value of the boolean needs to be constantly monitored anyway, so it might be difficult to do things without a case structure. I am still confused about the logic of it all ....
    You should really include a small working example VI so we can see what you are talking about. Thanks!
    LabVIEW Champion . Do more with less code and in less time .

  • Can I have multiple event structures with the same event cases?

    Hello, 
    I'm doing an application that reproduces the front panel of the HP6675A power supply. To achieve this, I have done a state machine with different states
    (initialize, measures, voltage, current, ocp, ov, store, recall, etc). In each state, should have an event structure that catches the events of the buttons, like for example: if the current state is the Voltage mode and the user press the current button the next state will be the Current mode. For this in each state of the state machine should be the same event structure with the same events.
    My problem is that the Vi doesn't work properly when I have multiple event structures with the same event cases. There are some possibily to do this, and how? Or is impossible to have multiple events? I have been reading some posts, but I don't find solutions. 
    Any help is appreciated.
    Thank you very much.
    Solved!
    Go to Solution.

    natasftw wrote:
    Or as others mentioned, make two parallel loops.  In one loop, have your state machine.  In the other, have just the Event Handler.  Pass the events from the handler to the state machine by way of queues.
    A proper state machine will not need the second loop.  The "Wait For Event" or "Idle" state (whatever you want to call it) is all you really need in order to catch the user button presses.  The setup is almost there.  Maybe add a shift register to keep track of which state to go to in the case of a timeout on the Event Structure.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Within the last hour, I noticed that my older MacBook Pro, while I was playing it in iTunes, lost contrast on the screen.  I am sorry, but I did not take exact notes on this event.  Around the same time, I did do a back up, uploaded software, etc.

    Within the last hour, I noticed that my older MacBook Pro, while I was using iTunes, lost contrast on the screen.  I am sorry, but I did not take exact notes on this event.  Around the same time, I did do a back up, uploaded Apple software, etc.
    I'm using two MacPros simultaniously, the old one for iTunes, and the new one for the other things.  My new one has no problems, so am wondering if there is an easy way to correct the older MacPro's contrast problems.  The computer is over three years old, and I'm wondering also if this failure is an aging sign.  (I also have other problems, such as a noisy DVD drive, which is part of the reason I bought a new MacBook Pro.)

    Is the older MBP a pre-Unibody model from early 2008? If so, it could be having this problem:
    http://support.apple.com/kb/ts2377
    If so, you would be entitled to a free repair.
    The lost contrast could be considered distorted video.
    Do you have an external monitor? If the external shows the same lost contrast, the graphics chip is likely the culprit. If the external is OK, then you probably have an issue with the built in display or possibly with its connections.
    You may also want to check in Universal Access to see if the contrast bar is set in its normal position (all the way to the left).
    Apple has a special test they can run to diagnose the NVIDIA issue, so if you have access to an Apple Store, make an appointment at the genius bar to have it run.
    Good luck!

  • Stopping producer consumer loop at the same time

    In my application I am using producer consumer architecture. In the producer loop, I am acquiring data, processing and outputting the result (feedback control system). Also in the same producer loop I am inputting all the data to a queue and then in the consumer loop I am writing data to a file. I have a stop control on the front panel and error from the queue and  error from the data acquisition all wired to OR gate to stop the while loop. ( I attached the picture of the code). Whenever I press stop form the front panel program wont completely stop. I think it is because consumer loop still running. Is there way to stop  the both loops at the same time. I tried creating local variable but it slows the program. Front panel stop control mechanical action is set to switch when released.
    Attachments:
    app.PNG ‏262 KB

    In the consumer loop you should check the error after the Read Queue function.
    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!

  • My thumbnails have all disappeared.  If I view events there is the same one for all 270 events and if I open an event I have clack thumbnails. I can only see the photo if I open it individually.

    If I view events there is the same thumbnail for all 270 events and if I open an event I have black thumbnails. I can only see the photo if I open it individually.The only way I can then see the thumbnail is by editing each photo. Then to even further complicate matters the last editted phot is replaces as the thumbnail on all events foders!...grrr. This is what I awoke to two mornings ago after inly backing up my machine which I do every night.

    No.  Quitefrankly I didn't know I could even use iPhoto on iPad, I just have the photos app that came on it.  This is on my laptop.  I don't particularly like iPhoto I use it essentially to take photos off my camera and store all the originals.  I use Photoshop. To work on them and store them in Dropbox (don't get me started on iCloud!). As I said this is a problem that seemed to crop up overnight after backing up to my external HD. 

  • Time Division Multiplexing and Processing Different Loops at the same time

            Hi, I am new in Labview so you may find my questions too silly, sorry about that
    I want to design an interface to control the test&measurement devices remotely. I have two desks and there are several devices on these desks. The real problem is to use two different devices at the same time. To do this I heard that I can use time division multiplexing. But I couldn't find enough information about it in Labview. Another advice I heard was to use a matrice and hold the on/off state of the devices in this matrice. 
    Where should I start the design to create such a system? Do you have any advices? Thank you in advance.
    My basic GUI is attached.
    Attachments:
    InterfaceAli.zip ‏42 KB

    As Mike pointed out you cannot communicate in parallel on the GPIB bus - unless you have separate buses for each instrument - and that defeats the purpose of a bus. I am not sure about LXI.
    With regard to your VI:
    1. Do not use global variables to pass your data around.
    2. You should use the Array data type, not the Matrix data type. The Matrix data type in LabVIEW should only be used for matrix mathematical operations (linear algebra) which cannot be easily performed on the array data type. You have many more tools in LV to work with arrays.
    3. The Event structure needs to be in a parallel loop. This is basic data flow. If you do not understand this concept, get some training, either though the online tutorials or through a class.
    4. Use Value Changed events and place the button terminals inside the event case for that control.
    5. The parallel loops need to have a Wait or some other function which causes a delay. Otherwise, the first one to start executing could consume all available processor resources. These are called "greedy loops." 
    6. Use integer data types for case structure selector inputs. Floating point values are coerced to integers at the inputs. If the values resulted from calculations, unexpected rounding effects may occur, resulting in the wrong case being selected. In some cases using type defed enums may be even better. The underlying data is integer and the enum item names show up in the case selector labels, helping to document what the case does or why it was selected.
    7. Remove the timeout case from the event structure since it never executes. Also avoid Use Default if Unwired on the terminal with your matrix (array) data. You never have a situation where an empty array is appropriate.
    Before going any further with the program questions, you need to carefully define your requirements.  How many instruments will you have? How many can be active at one time? What kinds of communication between the program and the instruments is required? This includes commands to the instrument, data returned from the instrument, error handling, and timing requirements. What will be done with the data? Display, save to file, use to automatically control another device? What safety requirements or constraints need to be met? Once you have a good requirements document, then you can begin to determine what kind of program architecture is best suited to meet the needs.
    I suspect that you may be making some things much more complicated than they need to be while ignoring other important issues.
    Lynn

  • How to stop execution in while loop without stopping execution of other loops in the same vi

    HI
    I am quite a novice in Labview.
    I have a problem in my project. I used a while loop inside my vi to build an array of ten values along with other loops. Then I used a stop button to stop manually the while loop. But it seems like the loop doesn't stop in the middle of the array building and so other loops in the vi doesn't work until the while loop finishes building the array and as soon as while loop execution is over, the complete vi stops. But all that I wanted was to build the array using the shift register along with the control to stop building array anytime. And not to stop execution of other structures when the while loop finishes.
    Can anyone help me?
    Rahul

    Hi Rahul,
    Modified ur Vi to work with single button.
    But the subtract case is not in any loop.
    So, once both the loops stop, the subtract case will execute only once. Depending on state of subtaract boolean at that time, corresponding case will be executed and the Vi will stop.
    so think of a logic where u can put this also in a new loop.
    Or you can also incorporate it in one of the two loops and pass the other loop's data to it.
    Let us know how you will proceed in this regard
    I am posting your VI as well a VI with my modifications VI in Labview 7.0 so that Thomas can give his suggestions too
    Plus, always keep a time delay in your while loops.
    Oh sorry, the "arrayinouttestnewfinal.vi" is the modified vi
    Regards
    Dev
    Message Edited by devchander on 01-10-2006 06:15 AM
    Message Edited by devchander on 01-10-2006 06:19 AM
    Attachments:
    arrayinouttestnewfinalnew4.vi ‏59 KB
    arrayinouttestnewfinal.vi ‏63 KB

  • CLR trigger - handling multiple inserts at the same time

    Hi
    I've developed a CLR trigger which operates on inserts performed on a staging table. The trigger implements some business logic and then inserts or updates a record in a target table. Whether an insert or update is performed depends on whether
    a record with the same ID already exists in the target (i.e. a select * from target where ID = 123).
    This works fine in most scenarios, but occasionally I am getting duplicates in the target table and have noticed that this seems to occur when inserts on the staging table happen at exactly the same time (i.e. multiple inserts for the same ID at
    the same time). In this situation duplicates are created in the target table because at the time of the inserts, no record with that ID exists in the target table (i.e. the select returns no records), therefore a new record is created for each.
    Is there a known way to deal with this scenario? For example, would locking the target table on insert result in the subsequent selects against the target table waiting until the target table had been updated, therefore the select would return a record
    for the given ID.
    I didn't really want to lock the whole target table on insert, because there are potentially other users reading that table (selects) and these would also have to wait for the insert to complete.
    I'd appreciate any thoughts on how to deal with this and avoid duplicates in the target table. I'm unable to change the way the data is coming in to the staging table, so my trigger code must deal with the above scenario.
    Thanks in advance.
    John

    First if you do not want any duplicate values in a column (or combination of columns) you should add a constraint to ensure this is never possible. A
    unique index
    like this should do this trick.
    CREATE UNIQUE NONCLUSTERED INDEX [IX_yourIndexName] ON [dbo].[YourTableName]
    [yourColumn1] ASC,
    -- add more columns that make the unique combination that you don't want repeated
    You can then add a try/catch block in your trigger code, if you get an exception based on this index then the record was created by another executing instance of this trigger and in that case you should do an update (or not, not sure what the rest of your
    logic is) in your catch block. This is the easiest solution and does not involve table locks. The only drawback is the first one to commit the insert will win and you have no guarantee which process or data set that will be. Also i have no idea how big the
    table is, how frequently changes are made, and what the data type is so you should
    keep this in mind when creating your index so you don't run into unexpected high index fragmentation which can lead to performance problems when executing updates and inserts.
    You could also create a
    named transaction with scope serializable around your insert/update block and execute your reads using a
    NOLOCK hint
    which should allow them to retrieve uncommitted writes and not create a long wait. The downside is is that the data might not be 100% accurate depending on if a transaction fails or not if there happens to be an update at the same time as a select but maybe
    this is not a big deal to the calling code.
    -Igor

  • What is the best way to stop parallel loops at the same time, from any loop?

    If there is a vi with two or more parallel while loops, what would be a good method to simultaneously stop parallel loop execution, from any of the parallel loops? My intent was to try and do this without local variables, so I used notifiers. This seems like an ok method for two loops, but how about for n loops?
    In addition, my code has a flaw. I use an OR block to compare the stop status of each of the loops. This works fine most of the time, but if both loops are triggered to stop at the same time,the boolean result will be false, causing the loops to never stop. How can this be avoided?
    Thanks,
    Curt
    Attachments:
    parallel_loop_w-stop.vi ‏54 KB

    I think you have the right idea, notifiers are one of the better ways to stop parallel loops. You can simplify things by using 1 notifier for everything. I modified your VI to use 1 notifier, it will set the notifier to True ONLY if the loop is stopping, then it stops. The other loop will read the notifier status, and stop based on it the next time it executes.
    I also changed the second loop to stop and notify if it has an error (that is usually a good idea, especally if you have I/O or other things that can cause problems)
    I also changed the switch mechanical action, that will eliminate the problems for your second question.
    The VI's attached are written in Labview 7.0
    P.S. If you have 7.1, the Queues are polymorphic, meaning that the typecast operat
    ions are NOT needed!
    Attachments:
    parallel_loop_w-stop7_0.vi ‏45 KB

  • Trigger problem -- can't insert the same data into audit table

    Sir/Madam,
    I'm trying to use insert trigger with a 'long raw' datatype data for my audit purpose. Each time, the data of original table can be inserted correctly. While the trigger for audit table in which it contains almost the same data as original would failed. The error messages are some thing like following:
    java.sql.SQLException: ORA-01461: can bind a LONG value only for insert into a LONG column
    ORA-06512: at "CORPSEC.TI_ARCHIVE_PDF", line 9
    ORA-04088: error during execution of trigger 'CORPSEC.TI_ARCHIVE_PDF'
    If the column with 'long raw' datatype is taken out, then there is no error at all. I'm using Oracle 8i 8.1.6 for Windows NT and suspect there is bug in PL/SQL execution.
    The following are SQL text for the trigger:
    CREATE OR REPLACE TRIGGER "CORPSEC"."TI_ARCHIVE_PDF" AFTER INSERT ON "ARCHIVE_PDF" FOR EACH ROW DECLARE
    LOG_SEQ_NO NUMBER;
    BEGIN
    SELECT AUDIT_SEQ.NEXTVAL INTO LOG_SEQ_NO FROM DUAL
    insert into ad_archive_pdf (DOC_TITLE,PDF_FILENAME,CONTENT,DOC_DESC,AUDIT_REF_NO,AUDIT_DATE,AUDIT_MODE,AUDIT_BY)
    values (:new.DOC_TITLE,:new.PDF_FILENAME,:new.CONTENT,:new.DOC_DESC,LOG_SEQ_NO,sysdate,'I',:new.created_by);
    END;
    Any help on this. Thank in advance.
    Best regards,
    Ruijie

    See here for a discussion of how to incorporate LONG datatypes into triggers:
    http://asktom.oracle.com/pls/ask/f?p=4950:8:635439::NO::F4950_P8_DISPLAYID

  • Firefox mouse event not behaving the same on PC and Mac computers

    I use the FCKEditor and having a very strange problem. When I click on the FCKEditor's editing area, the keyboard gets disabled untill I click the mouse somewhere outside of the editing window. The problem only happen on Firefox (3.6.10) on Mac computer (Snowleopard 10.6.4). Doing exactly the same steps on PC works without any problem.
    What I want to know:
    - Is it possible that the Firefox on Mac is different than the PC in handling mouse events? Or some other areas?

    Sounds more that Firefox is treating that editor area as read-only.
    Start Firefox in [[Safe Mode]] to check if one of your add-ons is causing your problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    See [[Troubleshooting extensions and themes]] and [[Troubleshooting plugins]]

  • Several nested loop at the same level in an execution plan

    Hi, I am using 11gR2, and I've seen a execution plan in the trace of my SQL query (also shown in pl/sql explain plan) with 4 nested loops all at the same level, what does this mean?
    i.e.
    - SELECT STATEMENT, GOAL = FIRST_ROWS
    + NESTED LOOPS
    + NESTED LOOPS
    + NESTED LOOPS
    + NESTED LOOPS
    each NESTED LOOP can be expanded to 2 further actions, which make sense to me. e.g.
    + NESTED LOOPS
    + TABLE ACCESS BY INDEX ROWID
    + TABLE ACCESS BY INDEX ROWID
    THANKS
    Ye

    >
    why there are 4 Nested Loops
    what is the final result set for the SELECT statement come from (any one of the 4)
    the query run so slow in 11R2
    >
    So far you are the only one who knows what the query and execution plan are because you haven't posted them
    >
    Then you need to post the query, tell us what indexes are on the join columns and post the complete plan.
    >
    We can't even begin to explain why Oracle might have chosen the plan it did if we can't see the query and plan you want explained.
    And if we only see the plan we might be able to tell you what Oracle is doing but without knowing what indexes might be on the join columns and the filter criteria columns we can't tell you why Oracle chose the plan it chose.
    And the excerpt of the plan you did provide is incomplete. You removed the indenting possibly because you did not enclose it in 'code' tags (see the FAQ).
    >
    - SELECT STATEMENT, GOAL = FIRST_ROWS
    + NESTED LOOPS
    + NESTED LOOPS
    + NESTED LOOPS
    + NESTED LOOPS
    >
    There can't be four nested loops like that at the top level since the top level will be combining the result sets from it's children. A nested loop will have two children; like the last part you showed:
    >
    + NESTED LOOPS
    + TABLE ACCESS BY INDEX ROWID
    + TABLE ACCESS BY INDEX ROWID
    >
    The two 'TABLE ACCESS ...' will be indented on a normal plan.
    Without the query and plan there isn't much we can tell you.

  • Iphoto events all showing the same picture

    All my events in iphoto are showing the same picture and I have to click on each one to see what is behind it so furstrating can anyone help me

    This is a software issue. There's no wear and tear involved here, so the age of the computer doesn't come into it.
    Most Simple Back Up
    Drag the iPhoto Library from your Pictures Folder to another Disk. This will make a copy on that disk.
    Slightly more complex:
    Use an app that will do incremental back ups. This is a very good way to work. The first time you run the back up the app will make a complete copy of the Library. Thereafter it will update the back up with the changes you have made. That makes subsequent back ups much faster. Many of these apps also have scheduling capabilities: So set it up and it will do the back up automatically. Examples of such apps: Chronosync or DejaVu . But are many others. Search on MacUpdate
    Regards
    TD

  • CAML query return Two Events that are the same

    Hi,
    when I run a CAML query for a recurring event in a calendar I get the same event returned twice
    steps to reproduce
    create an event in the calendar view as a recurring event
    set the series of event to all day events
    set the occurrence to daily 
    run the below code
    query.Query = "<Where>" +
    "<DateRangesOverlap>" +
    "<FieldRef Name=\"EventDate\" />" +
    "<FieldRef Name=\"EndDate\" />" +
    "<FieldRef Name=\"RecurrenceID\" />" +
    "<Value Type=\"DateTime\">" +
    "<Today />" +
    "</Value>" +
    "</DateRangesOverlap>" +
    "</Where>" +
    "<OrderBy>" +
    "<FieldRef Name='RecurrenceID' />" +
    "</OrderBy>";
    can any one tell me why I'm getting this unexpected result

    The valid values for DateRangesOverlap is Year, Month and Now. Did you try using Now instead of Today?
    Similar Thread:
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/daa06f95-9952-4990-835b-57702acafa11/how-to-get-recurrence-yearly-item-in-list-calendar
    This post is my own opinion and does not necessarily reflect the opinion or view of Slalom.

Maybe you are looking for

  • Why does the counter work in MAX, but not Labview?

    Please help, I have been away from Labview for over 3 months, and I am quite rusty.... Last year, I successfully configured NI9401 to measure period (seconds) by counting the rising edges of my sensor signal.  Since then, I have aquired a new PC, and

  • Itunes 10.5 won't load vista

    after update itunes won't load says error 2

  • Problem synchronizing the illustrations.

    With the new iTunes, I can't synchronize the albums illustrations on my iPod touch. Do you have the same problem?

  • Need Solution for this Intersting scenario

    Hi All,     Our Client is having Office in X - country & Y- Country In Y country there is two division. Import Div & Local Divison. Two book of account have to be maintained. for this. Good is being purchase from X for - $100 by Y Import Div Stock is

  • Delivery Address..in smart form

    Hi , I need Delivery address to be printed with logic  If adrnr is maintained for any 1 line item for the given ebeln then use that adrnr to fetch the address from adrc table else get the plant address To get the plant address L_EKKO-RESWK = P_WERKS.