Use Event Structure to trigger a 1 off event

I am trying to use an event structure to trigger a 1 off event.  I thought that I could check for the condition that I want to trigger the event and wire this the Val(signaling) property of a Boolean.  I then created a Value Change event on this control expecting the event to trigger when the value changed from false to true.  what I find is that writing to the Val Signaling property triggers the event every time not just when the value changes.
The attachment is a simple vi to try and illustrate this point using the iteration counter to try and trigger a 1 off event on the 10th iteration.  The Boolean 'Once' changes from False to True on the 10th iteration but the event is triggered for every iteration.  Need to run in debug
Any Help much appreciated
Ken
Solved!
Go to Solution.
Attachments:
1 off event trigger.vi ‏12 KB

One thing that I should have pointed out. I don't know what you are
going to do in your "one off" event. If it is a time consuming operation
you should not use an event but send a message to another loop and have
that loop execute the code. Otherwise your event loop will be blocked.
You can send messages to other loops in a
number of ways. Variables, Queues, Notifiers, Action Engines, etc..
Attached
is your vi modified to use a notifier. I also modified your conditional
logic. You said you wanted to have something happen only once but you
were using a less than comparison. I changed that to an equals comparison so that when i = 9 a notification is sent to a slave loop.
A message box will be displayed on the tenth iteration of the master
loop. Notice how your numeric indicator continues to increment even with
the dialog box displayed. That would not happen if the dialog box were to be displayed in the master loop.
=====================
LabVIEW 2012
Attachments:
1 off event trigger.vi ‏15 KB

Similar Messages

  • VI containing Event Structure will not receive front panel events in LabVIEW Real-Time.

    Hi again, I'm working in my first UI (attached VI).
    It works when running directly from PC. It doesn't when running from cRIO, there's the message "VI containing Event Structure will not receive front panel events in LabVIEW Real-Time". I've been reading and I found that "Event structures on RT targets do not support events associated with user interface objects, such as VI panels or controls. For example, associating the Value Change event with a control does not work. RT targets support only user events".
    Is that the problem? If it is, how can I create Mouse Up, Mouse Enter, Value Change (or other user interface events) user events?
    If I run my VI in FPGA mode should it run?
    Attachments:
    HMI.vi ‏33 KB

    Since it looks like you are new to the whole RT and machine control, I recommend giving this a good read: NI LabVIEW for CompactRIO Developer's Guide
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Event structure does not capture mouse click event on toolbar activeX control

    Hi
    We have a toolbar activeX control on FP.  It works perfectly on my computer, but on my coworkers deskyop,  somehow the event structure doesn't capture mouse click event.
    Any idea?  Thanks a lot for any help.
    Anne

    It's a standard activeX control.  I attach a simple vi .
    thanks  for any help.
    Attachments:
    toolbar test.vi ‏41 KB

  • How do i get a boolean indicator to trigger a event structure

    I have two parallel loops running, and i need to use a boolean value, one that comes out from an OR gate, to trigger an event in the parallel, event structure loop.  I've attached a simplified version of the loop.  Is there a way to get this done?  I've tried using local variables, value(signaling), etc. and they haven't worked
    Solved!
    Go to Solution.
    Attachments:
    Parallel Loop Trigger.vi ‏10 KB

    Here is a revised version of your VI. I modified the mechanical actino of the stop button so it kept it's value until it was read. In addition, I added a delay to your upper loop. Without a delay it was running too fast to actually see the button press. I modifed the event in the the event structure to trigger on a value change of Boolean.
    You don't really need the outer loop since it will only run a single time in all instances. On the first execution of that loop it will be sitting in the turn inner loops. Once you exit the two inner loops your outer loop will always exit. Therefore, it serves no purpose.
    Your OR in the upper loop is completely uses. It serves no purpose since the result will always be equal to the value of the Stop button.
    There are better ways of triggering events. a preferred method would be to use a user event and simply generate the event at the appropriate time. This has the advantage of not requiring additional controls/indicators simply to cause an event to occur.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot
    Attachments:
    Parallel Loop Trigger.vi ‏12 KB

  • How to Transition to a Specific Case from an Event Structure Trigger?

    Can someone help me troubleshoot my program. I've attached my VI so you can follow along with what I am describing. So here is the scenario:
    I have a program that consists of four test states, stop test, request test info, and end program (cluster of 7 booleans). Each test state sends a serial command to a DUT, receives ACK packet, opens relays which disconnects the serial connection and DUT will continuously test by itself. If the user wants the end the test early, they can hit the "Stop current test" which will close the relay reestablishing serial communication, wait 10 secs for device to enumerate on the PC, and then send the serial command to stop the test. From here, the user can request test information from the DUT by hitting the "Request info" button.
    So my dilemma is when I try to implement a time limit for cases 2 - 4. For case "M1-Idle", the program works flawlessly since there is no time limit. The program will send the serial command, transitions to "Open Relay" case and switch back to the "Idle" state to wait for the "Stop" command. The user has to hit stop whenever to close the relay, request info and/or continue testing.
    For case 2 through 4, there is max time limit of 3 hours. This is where I am having difficulty opening the relays and then entering the timer count down case structure to start the timer. Question is, if I am using the Event Structure to trigger on a user action event (i.e. user presses "Run M2-Normal" - Menu.M 2: Value Change) it sends the command and move on to "Open relay" to break the serial connection as intended. Since the next state of "open relay" is "Idle" how can I add case selector to select "M2 - Timer" instead of "Idle" given that it was based on user selection of "Run M2" event?
    Is that even possible? I tried using the feedback node on the state enum but its coming from the case state and not the event state so it doesn't enter properly into the timer state. Any help or ideas is greatly appreciated. Thanks in advanced.
    Main_Working_Copy.vi is the main portion of the program.
    Best regards,
    Henry
    Attachments:
    Main.zip ‏106 KB

    Hi Ofek_zeevi,
    Welcome to the Support Communities!
    The article below explains how to gift a song in the iTunes Store.
    Some songs are not available as an individual purchase.
    iTunes 11 for Mac: Give music and video
    http://support.apple.com/kb/PH12293
    I hope this information helps ....
    Have a great day!
    - Judy

  • DSC Event Structure Demo.lvproj

    Hi,
    Can I use the event structure, as described in the DSC Event Structure Demo.lvproj, to trigger an event on Hi-Hi alarm and not Hi alarm, although the two alarms are enable?
    Thanks
    Aviram

    Hi Aviram,
    You should be able to trigger off the events when both Hi Hi and Hi are enabled.  To do this you would have to monitor the alarm area or url of the Event to determine which alarm triggered the Event.  I have attached and example project that show a possible way to do this.  You will have to change the shared variables to your machine and the case structure inside the Event Structure but it should work for you as well.
    Looking to help,
    Steve B.
    Attachments:
    DSC Alarm Event.zip ‏27 KB

  • Extent of Coding inside Event Structure cases

    Hi all
    I am trying to understand the practices while using an Event Structure. I am used to developing most of my projects using an Event driven State Machine Architecture. Most times, I use Event driven-Queued State Machines. I have also used Producer Consumer Architecture with Event structure driving the producer.
    I have always believed that using lots of code, or lots of sub-vis inside one or more cases of an event structure is not a good practice. I reasoned that it will delay the capture of other events occuring while the current case is still executing. This was one of our points during design review, i.e., to reduce the code inside event strucutre cases to as minimal and necessary as possible. We used clusters/queues/LV2Gs inorder to pass on the required data, which will be processed in the other cases/loops.
    However, I happened to recently come across a couple of very old applications upgraded to LV2011. The applications used an event structure in one of the while loops, with one or more parallel while loops inside the Main VI. The event structure was the only code in this while loop, no case strucutres.
    These event structures had loads of code in each case, with sub-vis and nested sub-vis, even DLL function calls among them. Thats when I started to look for information on best practices using event structures and about any available details on the extent of coding allowed inside an event strucutre.
    One sub-vi which was called as a dialog box also had its own event structure (ending up as ensted event structures). I have read about nesting event structures and their disadvantages.
    Off course, the code is working and I am not sure if anyone had any execution problems with the applicaiton.
    However, I am wondering about the pros and cons of having the entire code inside event structure. I would have defined that code a nightmare. Its disturbing me to see that code and being unable to make it better.
    To my understanding, I wish to know if there is any definition or rule regarding the amount of code inside an event structure.
    Thank you

    The exception I use is User driven intefaces where every user action must get a response and each change must complete before the next. In those cases an event only implelmentation is generally fine.
    Now if that code does something that takes long enough for the user to question if the program is still alive should at least get a "Busy cursor" OR a progress bar OR an abortable progress bar where the user get s the option to abor out. THe last case may warrent a parallel process to crunch the numbers.
    But please keep in mind the above suggestions apply only to those User only" type things. Applcations that invlove the word "while" will generally get deamons and other common design patterns used to henld the implementation. But now I have drifted to design teory and away from the subject so ...
    Have fun!
    Ben
    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 .

  • Is it better to have one Event Structure with more (10 or 15) cases or several with fewer?

    I have several buttons and events on the GUI of my app to monitor. Would it be better to use one Event Structure with several cases (10 or 15) or have a couple and split the cases evenly? None of the cases have much processing to handle, so there is not a time lag issue. I am just worried about overloading the structure. One of the tech support guys mentioned that the event structures are not that hard to get confused.
    Has anyone had any problems with Event Structures?

    I use event structures very often in my code. I use them just to handle the interface and to run small code. I have had event structures that handled over 50 user interface events and never had a problem. In my personal opinion If there was any code to run I would let the event structure handle the the user interface event that fired a que in another while loop that handled the code.You can find examples on this, if not I will send you one. It is just good programming practice for beginners because it will alow you to build more robust VI's in the future.
    Hope this helps
    Joe
    Joe.
    "NOTHING IS EVER EASY"

  • Event structure tree menu?

    Hi all, looking for some help for my front panel.  I have a fp button(call it 0) that when activated will unhide another 5 buttons(call them 1-5).  These are sub tests if you like.
    I am wanting to know if its possible to use the event structure in a way that when the mouse hovers over button 0, the hidden buttons 1-5 appear and the user selects and the event structure would then run that particular event.  However, if the mouse leaves the button 0 without selecting, then the buttons 1-5 disappear.
    I suppose i am looking for something like the Start button of Windows when you can hover on a tilte and it opens up further branches and if you dont select, it disappears.
    Thanks,

    you should be able to use the mouse enter events in order to do this.
    Paul <--Always Learning!!!
    sense and simplicity.
    Browse my sample VIs?

  • FPGA event Structure

    Hi,
    Iam working on DC motor...... iam using NI 9505....... iam using example code of labview {(Position Control (closed loop)- under compact RIO}......
    every thing is fine............ now i want to add control LEDs which has to control the speed of the motor......every led represents some values......there are 66 leds.... i thought i can use event structure so that when ever an event(boolean led ) occurs that event will suplly the value of posotion setpoint to motor.........
    i have added event outsde, inside, with, without while loop...evry thing i tried.......but iam not getting......i wan to know where iam doing wrong..... to understand better  i have attached two images front panel and block diagram......
    please help me out of this problem...........
    Attachments:
    front panel.jpg ‏325 KB
    block diagram1.jpg ‏269 KB
    block diagram 2.jpg ‏233 KB

    HI,
    Here are the Complete Detials.........
    1> position setpoint is not an indicator........ its a control
    2>  for one rotation of motor is 360 degree---- now i want to rotate motor for 360 degree in 66 times...... and i want to indicate the value....... so i divided 360 by 66 which is 5.45......
     3>  Now i calculated the motor ratio........ digitaly to rotate motor, it requires 1230.5 which is position set point..........
              to rotate motor at 0 degree we need position set point at 0
              to rotate motor at 360 degree we need position set point at 1230.5
    4> i implemented this  logic outside using 4 LEDs and its values is given( please go through 360 degree implement.vi)
    5> i want to implement the same logic in this positon control (closed loop).vi
            but its not taking the event strucutre.......
    6> i have attached the vi....... there will broken wires since there is no fpga target..........
    7> i have attached compelte source code for position control project........ here in this project i want to add 66 leds which will control the motor for one rotation with respect               
               above steps
     Please let me know if u need any more info on this.......please go through above snap shots for inserting the LED structure....
    Thank you
    Attachments:
    360 degree implement.vi ‏26 KB
    Position Control.vi ‏205 KB
    Position Control.zip ‏517 KB

  • Event structure compactRIO

    Hello
    Can I use an event structure on a diagram running on the CompactRIO
    controller? I try to use a button in an event structure but the code
    inside the event "value changed" never runs.
    Thanks

    Hello David,
    A LabVIEW RT program should be programmed as if the front panel is not
    there.  In an embedded LabVIEW RT program, when you write to a local
    variable it does not update the front panel, since the front panel is
    not downloaded with the VI to the target. So it normal that events based on "value changed" doesn't work (Cf. this KnowledgeBase).
    Cordially,
    .mrLeft{float:left} .mrInfo{border-left:solid 1px #989898;font-size:x-small;color:#989898}
    Mathieu R.  
      CTD - Certified TestStand Developer / Développeur TestStand Certifié  
      CLAD - Certified LabVIEW Associate Developer  

  • Question regarding event structure

    I made a vi that controls a stepper motor with controls such as relative angle, maximum frequency, and acceleration. I use an event structure to update the values after new ones are entered by the user. However, recently I was given the task of integrating this with a larger vi that controlled other parts for an experiment (I will refer to this as the motor control vi). 
    Would event structures in both vi's be necessary? If I want to have the controls and update button in the motor control vi, does this mean that the event structure should be completely eliminated from the stepper motor vi? I was advised to use local variables to store the values for relative angle, max freq, and acceleration and then pass all of it when the update button is triggered and creates an event. I have found this to be faulty. Would it be possible to have event structures in both vi's then? 
    Basically, now everything will be updated and passed from the main vi to a stepper motor vi that originally depended on an event structure. Does this require the event structure to be present in only one or both vi's? Thanks.

    Hey, sorry for not including it before, I'll try my best to explain all the parts because I didn't want to overcomplicate things.
    For the Stepper Motor vi, I have none of the DAQ drivers on my laptop at home so I excluded it in the file attached and simply put a text box in there place. The program starts after the run button is pressed, and then the acceleration, f max, and relative angle is entered. Afterwards, pressing update displays the appropriate waveform graph. Pressing "next task" (depending on the state of the use task button) will allow the user to input other values. The use task button simply indicates whether anything will be passed to the drivers or not.
     The main Motor Control vi was done by another person. For my part (all on the right side), acceleration could be set to 3 different speeds and pressing the button triggers the event that sets a certain value to the local variable acceleration. When the update button is pressed on this vi, the new values for max speed, angle, and acceleration are sent to the Motor Client vi. The state of the run, stop, use task, and next task are also passed, and my current problem is how do I use the update button in this vi? Would passing its value create an event in the stepper motor vi? Or would it be much better to just send the controls without placing them in an event structure?
    Attachments:
    Motor Interface.vi ‏60 KB
    Stepper Motor.vi ‏33 KB

  • Logic AND with event structure

    hi everyone,
    The event structure can handle multiple events at a time to do the same thing : looks like a logical OR. But I haven't found a way to sequence events to approach a logic AND. Example: first click on a Draw button and then enter the image would make the mouse cursor change. With an event structure, I can handle these 2 events separetely or together (either one would change the cursor), but i cannot make a sequence of events.
    Is this possible to do that with an event structure?
    I hope I am clear (sorry for the english btw). And thanks in advance.
    Christophe
    Solved!
    Go to Solution.

    Mark Yedinak wrote:
     In the event processing you would have to check if the required event occurred before this event. If it did, do your processing. If not ignore the event.
    That's exactly what I am trying to do! I am already working with a producer/consumer architecture and with a state machine in the consumer loop. I tried to add state info as you suggested in the event loop. But i do not know if i am doing this well. I attach a very small example where I try to demonstrate what I am trying to do with 2 booleans to be pressed in order.
    Tell me what you think of the state info in the event loop.
    @Mike : same solution as Mark if I use a shift register and a case structure inside the event loop?
    Message Edited by superfunk on 03-03-2010 10:24 AM
    Attachments:
    event_test.vi ‏27 KB

  • Event structure problem in updating array

    Hi, i have a problem with my .vi...
    i have an array of 10 boolean i want to modify by pressing SET TRUE or SET FALSE buttons, after selecting (with the ring selector) which is the elemente that should be changed...
    there seems to be something strange in the behaviour... the array is not correctly updated... maybe there a big mistake i cannot find...
    i  hope you could help me
    tks
    Attachments:
    array_modify.vi ‏18 KB

    The problem is the the Ring control is read before the event structure, so it return "old" data when you click of either SET TRUE or SET FALSE.
    You need to move it so that it is read inside the event structure after you click on one of the "SET" buttons.
    Create a local of the Ring for one of the SET events and move the Ring terminal into the other.
    Or create a blank event for the Ring control so that it will update the input tunnel going into the event structure.
    Or create a single event to handle both SET TRUE and SET FALSE.
    Omar
    Attachments:
    array_modify.vi ‏9 KB

Maybe you are looking for

  • Can no longer print from iPad

    I have an HO Photosmart B210a wireless printer.  I can no longer print from my iPad like I used to do.

  • Is there is a way to export the themes from iDVD to DVD Studio Pro?

    OK...so here's what I'm trying to find out: is there is a way to export the themes from iDVD to DVD Studio Pro? Or can I build the project in DVDSTPRO and import it to iDVD to build and burn? I've read several threads here and haven't come across my

  • PO report by account assignment

    Hi! There is this report ME2K to display PO's by account assignment, but I cannot find to make it work without cost center. I would like to find PO lines by account assignment "E", but don't see this report suitable for that. ME2K is called "Purchasi

  • Conceal_data property

    Hi experts, Actualy there are 10 records in my data block and i want to conceal the data of two rows only. Is there any way to implement the conceal_data property of set_item_instance to set_item_instance_property. Please help. Regards Rajat

  • Access to BBM With Reset Password That did not Work

    I requested and got new password to access BB ID. But it did not work. I used up 10/10 attemps. I used a different or active cellphone number and didn't work. It will wipe out data or reset if I attempted again.i need to have access to my BB Bold 990