How to decide when an a "wait for event action" is activated

Hi,
In the attched example file (which is a part of my program)I have 3 basic stages, enclosed in a sequence structure:
1) I initialize the GUI buttons
2) I check the instruments in my system are opened and ready to run ("VSWR initialize vi")and issue a true/false result.
3) A case structure for normal run or abort operation (if the instruments do not
respond correctly).
4) If everything is ok the user has to scan a S/N using a bar code scanner.
The problem is that when I run the program the EVENT STRUCTURE in the FALSE part of the case is automatically activated, before the VSWR initialize vi is started! 
This causes that when the user tries to scan the serial number on the GUI he can only type one character and then the screen is stuck.
If I disable the result from the VSWR initialize vi (as shown on the example) and connect a TRUE constant to the case structure, the event structure is not activated but then of course I can not use the "VSWR initialize vi".
How can I make sure the event structure is activated only after the two first parts are done? That is, in normal order - only after the "VSWR initialize vi" returns a false result.
Note, there's no need to understand each component in the attached file. The question is rather a general one about the right way to synchronize my program.
Can anyone help ?
Thank you in advance.
Attachments:
example.vi ‏34 KB

Saverio already mentione most critical points. here are a few more:
A very ugly quick fix (duct tape repair) is to configure the events to NOT lock the FP until the event completes. I recommend against this.
All your buttons should be latch action. Now you don't need to reset them at the beginning.
Set the "Board SN" string control to "limit to single line" and you don't need to remove the linefeed later. You should handle it with a "value changed event" anyway.
You have way too many sequence structures. Many times execution order is not that inportant.
Event structures need to be on a toplevel diagram loop, always ready to fire. Don't hide them inside case structures or inner loops.
Lot's of unecessary code. Let's look for example at the code in the big FALSE structure:
You have a reference and write to a value property of the message box while the message box terminal is disconnected elsewhere on the diagram. Remove all that extra baggage and place the terminal right there and wire to it.
You have a while loop containing a sequence, containing another while loop. The sequence and outer while loop have no purpose.
The while loop spins millions of times per second, just burning CPU. How fast can you possibly type??? Place a 100ms wait.
Rewritten as event structure, it could looks as follows (buttons set to latch action, string set to "limit to single line" and NOT "update while typing"). (see iamge below).
Of course the entire code should be rewritten in a similar fashion and around this single event structure. A second event case could deal with the error condition. Simplify!!!!
Message Edited by altenbach on 06-14-2009 11:49 AM
LabVIEW Champion . Do more with less code and in less time .
Attachments:
GetSN.png ‏46 KB

Similar Messages

  • Wait for Event in Fork - How to terminate the wortkflow in leg 2

    Hi Experts,
    My scenario is that there is a fork with 2 branches. 1 has a change Doc method. In this I have raised an enent when a action is performed which in turn calls a wait for event in other leg. The problem is that the other loop is executing but the workflow is not coming out of leg 1. The work item remains in the agents workplace.
    How to correct this?
    Thanks,
    Dinesh

    in the FORK step you have an option of mentioning the "necessary steps".
    it defines the minimum number of legs of the FORK step that must be completed before proceeding to the next step in the WF.
    mention the necessary step as 1 for your case.

  • When i was waiting for an hour for itunes to grading my 2nd generation ipod touch to a 4.2.1 and it was about done, it suddenly said the network connection timed out and that made the upgrading a fail. Why does it do that? and what does it mean?

    When i was waiting for an hour for itunes to grading my 2nd generation ipod touch to a 4.2.1 and it was about done, it suddenly said the network connection timed out and that made the upgrading a fail. Why does it do that? and what does it mean?

    Error -3259 is a network timeout error, usually. This article might help:
    http://support.apple.com/kb/TS2799

  • How to pause while document printing and wait for user actions.

    How to pause while document printing and wait for user actions. (for sample: pressed button). Pause after each printed pages.

    Print page by page after considering the user actions!

  • So... how long do we have to wait for a RAW update for the Nikon D600 camera?

    So... how long do we have to wait for a RAW update for the Nikon D600 camera?

    Adobe releases Camera Raw every 3 or 4 months. The D600 itself was launched only about 1 week ago. I'm sure its not included in ACR 7.2 RC yet. Nikon J1 is included though. I guess you're gona have to wait for it. Maybe 7.2 final release will have it or 7.3 should. Adobe employees/ product team will not commit to a time for Camera Raw releases.
    However, you can use the software Nikon would've given you to convert your images as TIFF and import them into Lightroom/ Photoshop if you're in a hurry. It would be nice if your camera supports DNG conversion out of the box! This way, you wont need a Camera Raw from Adobe.
    Anyway, you could file a 'Feature Request' to Adobe here: https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform
    Good luck.

  • How LONG I'll need to wait for Apple GENIUS fix the incompatibility

    I need to work....How LONG I'll need to wait for Apple GENIUS fix the incompatibility # KEYNOTE and LION???
    What is the best thing I've to do???
    Downgrade the OS??? Change the Plataform????

    Each region has little differences that need to be changed and setup in order for it to work on your phone correctly. Just need to sit and wait...
    Nokia 5800 XpressMusic Red V52.0.007
    Hit the Kudos if I helped!

  • How to decide when to keep backing bean in request and session.Pros/cons

    How to decide when to keep backing bean in request and session.Pros/cons

    Depends on where the bean data must be available. Start with request scope. If you need the data in session scope, then think twice about impacts (memory usage, multiple browser tabs, etc) unless the data is obviously targeted on the session scope (loggedin user, user settings, dropdown data, etc).

  • When I am waiting for a txt message and i go to click my home screen then i will receieve my message its like my screen is not alerting me??? HELP

    when i am waiting for a message i am waiting for ever then i check to see if i have gotten it and i click the home button and then i recieve it  i dont have the moon on and i have even wiped my phone clean thinking its something wrong with my back up and it still continues to do it. also i have taken the phone back thinking it was smething with the phone and got a new one still did it  i made a new apple id and everything . please HELP

    I could be corrupted backup.
    You can check the notification settings for message.
    Settings>Notification Center>Messages>Alert Style
    It should be on Banners or Alerts.
    Settings>Messages> Turn on Imessage and send as SMS and below that "Blocked" to check if you have any numbers block might be blocking the message.
    You can also do a hard reset by holding power and home till it restarts and release after seeing the apple logo.
    Still doesn't work? Settings>General>Reset>Reset all settings

  • How to decide which access sequence goes for which partner function ?

    how to decide which access sequence goes for which partner function ?

    Hi Padmaja,
    If i understand your question correctly, below is my answer.
    Lets take a example : In your requirement ..while creating Sales / service order (for ex if you are creating from preceding document)
    you have to pick up the Contact person from preceding document & Employee responsible from responsible organization
    For this in partner function assign Access sequence as below.
    same way if the partner(here ex: Ship to party) has to be picked up from "Current partner" change the access sequence to "Current partner Sold to party"
    Hope this gives better understanding, still for better understanding check the below links
    http://www.guru99.com/partner-processing-in-sap-crm.html

  • How to use wait for event step

    Hi,
    I need to trigger wait for event step for my workflow but I am not able to trigger that .
    Can anyany one of you tell me in detail what are the necessary config.and bindings i need to do for that .
    Also i need to pass data from my report program(where i am triggering the event for the wait activity) to the workflow through event triggering for the wait step.
    Please tell me how can I do that .
    Thanks in advance.
    Anand

    Hi,
    I think you can use the function module "SAP_WAPI_CREATE_EVENT" to trigger an event. Make sure that the instance data is same in both ends. To send data from your report, you can populate the event container using the container related macros.
    Check this link for more information
    http://help.sap.com/saphelp_nw2004s/helpdata/en/c5/e4af4a453d11d189430000e829fbbd/frameset.htm
    Regards
    <i><b>Raja Sekhar</b></i>

  • Command how many mails when through the mailstore for a specific domain.

    I need to get info from the maillog to see how many mails when through the mailstore for a specific domain.
    For example all the mails send and received by example.com witch is hosted on that 2005q1 mailserver.
    Anyone know the commands to get it out.

    The data is certainly in the mail.log.
    You may want to start with the perl log parsing script, here:
    http://ims.balius.com/resources/downloads/files/imslog.pl

  • Workflow -  Wait for event

    I have a requirement like this:
    In the workflow, judge an object is released or not. If not release. the workflow will stop.
    Now we need to write a program to check the status of the object every 15 mins, if the object is released, then an event will be raised to allow the pending workflow to continue.
    How do I achieve this?

    No Problem Yu,
    See below. Rough steps but I think you can fill in the meat on bones.
    Creating event.
      Step 1. Execute SWO1  it is O not zero.
      Step 2. Create business object. If you do not have one already. I assume you do not have one. Make sure you define key fields which uniquely identifies your object.
      Step 3. Create one event under events node. Make sure key fields are part of event parameters. Save and activate object.
      Step 4. Now triggering the event. In your besopke program which will run as background job. Once you decide object is released. The call function module SWE_EVENT_CREATE to trigger workflow. example given below. Check where used list of this FM you will find many examples. Use any example where EVENT_CONTAINER parameter under tables is being used you'll need this to pass data to event parameters.
    CALL FUNCTION 'SWE_EVENT_CREATE'
      EXPORTING
        OBJTYPE                       =  T_OBJTYPE
        OBJKEY                        =  T_OBJKEY
        EVENT                         =  T_EVENT
            CREATOR                       = ' '
            TAKE_WORKITEM_REQUESTER       = ' '
            START_WITH_DELAY              = ' '
            START_RECFB_SYNCHRON          = ' '
            NO_COMMIT_FOR_QUEUE           = ' '
            DEBUG_FLAG                    = ' '
            NO_LOGGING                    = ' '
            IDENT                         =
    IMPORTING
       EVENT_ID                      = T_EVENT_ID
    TABLES
       EVENT_CONTAINER               = T_EVENT_CONTAINER
    EXCEPTIONS
       OBJTYPE_NOT_FOUND             = 1
       OTHERS                        = 2
    Creating wait step.
        When you insert a new step in workflow it will ask you the kind of step you want to insert. Choose wait for event and after that it is not very tough all you have to give is give business object and event name. Do binding, this is important as this will make sure your workflow is reacting to correct instance of object.
    Warm Regads,
    Anuj Nagpal.
    Edited by: Anuj Nagpal on Sep 17, 2009 5:32 PM
    Edited by: Anuj Nagpal on Sep 17, 2009 5:33 PM

  • Error in Workflow wait for event node

    Hello Experts,
    I am working on one QM notification. I shall explain the scenario first:
    1) User will take the usage decision on inspection lot in QA11. When user will take decision and save inspection lot BUS2045 event USAGEDECISIONMADE will be triggered and initiate my workflow here.
    2) After workflow initiation system will create notification and send to approver, but here i have wait step in my workflow for BUS2078 - Created (Notification).
    wait for Event step
    BO: BUS2078
    EV: CREATED
    I am posting error below:
    Error when starting work item 000000294361
    Error when processing node '0000000060' (ParForEach index 000000)
    Error when creating a component of type 'Wait Step'
    Error when creating an event item
    Error within method CL_SWF_RUN_WIM_EVENT->_CREATE_WORKITEM_CONTAINER
    Error within method CL_SWF_RUN_WIM_EVENT->_GET_INIT_WORKITEM_CONTAINER
    Workflow 000000294361 wait step 0000000060: No valid object ID in container element 'Notification
    Node 60 - wait for event step.
    Re.,
    Guri

    Hi,
    Based on your description what I felt is you are making use  of a wait step in which you have choose to wait till BUS2078 event CREATED is occured ... right.. Now can you please clear me that where and how this event will triggered.
    or is it some thign like you are making use of event creator step and in this case, When ever you are making use of the eventcreator  step and a BOR object inside it make sure that specific BOR object is already instatitaed in the workflow container , if it is instantiated then only it will try to identify the instance  or the BOR and it will try to rasie the event.
    Regards
    Pavan

  • Bpm:message being sent and wait for event

    Hi,gurus:
    My scenario is about BPM.In the integration process I used a loop and correlation.The scenario worked successfully yesterday,but after I changed some thing,it did not work.The outbound status of the message in sxi_monitor said "message being sent".And when I clicked PE to see the workflow log, it said " wait for event".
    Thanks in advance.

    Could you tell me how to reimport the integration progress in ID?
    reimport means...delete the already imported BPM from ID.....this would affect the corresponding ID objects....save and activate....and then again run the import Integration Process wizard....create the objects once again.....seems time consuming.....hence mentioned it as the last option in the list:(
    Also from SWWL delete only the instance with status as ERROR.
    Edited by: abhishek salvi on May 20, 2009 9:30 AM

  • NiDCPower Wait For Event

    Hello,
    I am using the PXIe-4139 SMU to source a current sequence that starts when a trigger is received and takes about 40 seconds to complete.
    After the niDCPower Initiate VI I have inserted the niDCPower Wait For Event VI with a timeout set to 300 seconds to allow for enough time to receive the trigger and complete the sequence. This VI waits for the Sequence Engine Done Event.
    Now this works fine, however, when the user wishes to stop the programm for whatever reasons, they have to wait the full 300 seconds until the Wait For Event VI produces a timeout error and stops the programm. This is rather inconvenient. How can I change the programm so that the user can stop it even when the Wait For Event VI hasn't reached its timeout?
    I tried this:
    But this doesn't work. For some reason, I get a timeout error with code -200474 but the boolean operator returns FALSE.
    Any other ideas?

    If there an output on the wait for event VI that flags a timeout? If so, set the timeout short (like 100 msec) and wait for 3000 timeouts before continuing on.
    Oh, and use an event structure. Timeout event (timeout=0) checks the wait for event, value change event for button breaks out of loop.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

Maybe you are looking for

  • Personal Oracle8i Rel 2 Ver 8.16

    Does anyone know if Personal Oracle 8i Rel 2 Ver 8.16 works on Windows 98 Second Edition ? Thanks null

  • JSP Timeout in OBPM 10GR3

    Hi all, My JSP in OBPM 10GR3 is getting timed out quickly. How can I increase the timeout of my JSP? Because it shows on the UI workspace that "The task cannot be resumed". How can I increase the timeout of my JSP?

  • Synching Calendars on Notes and Outlook

    Hello, I have a two PCs (my business and client-imposed), where I run respectively Outlook, (by choice) and Lotus Notes (because I have to) and I wanted to know if it is possible to install PC Suite on both PC's and synchronise each calendar on my mo

  • External services in MM

    Hi All, Is there any standard content available for external services, I have checked out all the node there I could found only customer services. But here they want like external services i.e., like Tendering/purchasing details for painting a buildi

  • My iPhone suddenly has stopped ringing, unless I have the home page open

    I have an iPhone 4 with OS 7.1.2    It is about 3 years old and has been working well, until recently. Now it will not ring my Phone or my Messages or my Errands unless I have the home page open. This is bad, because I miss my calls, messages and app