structure of the event to turn on and off a LED

Good afternoon

I would like to activate a part of my algorithm according to the value in another part. To make it easier, I symbolize the value by a button and tried a structure of user event to turn on or turn off an LED located in another while loop.

I can turn on the LED, but unfortunately I can't spend off of the LED thereafter.

It is possible to change the structure of the event and select the option "change value". However, I would like the fatest way to turn on and off using the structure of the event and the Bay. I mean I would like activate a part of the algorithm only if the button is enabled for not having a continuous audit of the value of the button by the structure of the event.

Please, if anyone has an idea to turn off the LED (after the switch on), add a comment without hesitation.

I will be happy to solve this simple problem.

Thanks in advance for your help.

Ragards

You have a race condition.

When you click stop, it's a race about whether if the event gets not saved and destroyed by the removal of the stem all loop against sending the same user in the lower loop.

Why it only seems to happen with the case of false must be a quirk of how the code is compiled and the order, it is run.

If you put a step between your Boolean switch and LED, for me anyway, the error is now generated on the true case of the structure of matter (always false for switch.).

If you put a constant error in the lower loop and wire while guaranteeing the Unregister event so that you now it does not run until the two while loops are arrested, then I don't see a mistake regardless of the value of the Boolean switch when you click stop.

Tags: NI Software

Similar Questions

  • Structure of the event in primary vi and sub - VI with queues

    Hi all

    I have an application that uses the architecture of producer-consumer in which a queue transmits messages of a main VI by a Subvi, in response to the events of the user in the front panel. Inside the Sub VI, the queue is removed and treaty based on the corresponding message, and the result is displayed on the façade the sub of VI. User events are captured in the main VI using a Structure of the event. This works as expected.

    However, I also the controls on the Panel before the sub - VI to change the queue. My approach is to have another structure of the event in the VI sub for this. However, while the events in the main work of fine VI, events of sub - VI never treated.

    A simplified sandbox VI of what I'm trying to do is attached. As you can see, the main VI events are triggered as expected, but events in the sub VI are never triggered.

    I watched this white paper: detect an event in a Subvi from a high level VI , but it's not exactly what I'm trying to do. Instead, I'm just trying to detect an event generated within the Subvi. I searched this forum and found some research related, but none of them seemed to answer what I'm trying to do.

    Thank you

    Matt

    Your major issue here is the loop location.  While the structure should be inside the Subvi to make a message in the appropriate queue manager.  In fact, you should have 2 loops within your Subvi: 1) the QMH and (2) of the event loop.  You must use a user event to congratulate the event loop in the Subvi to stop.  You should NOT use the time-out of the Structure of the event unless you absolutely must.  And since everything in the Subvi is the message function, you do not have expectations.  They will be inactive (no CPU using) when there are no items to process from the queue or queue.

  • How can I get the keyboard to turn on and off my TravelMate s 645?

    Sometimes when I turn on my computer, the keyboard light is on, and I need it to be.  Other times, the light turns off and it would be really useful to have on.  I was not able to understand how to enable or disable the light on the keyboard. Please help if you can. Thank you!

    Hello

    You can activate the backlit keyboard power on and off by pressing [Fn] + [F9]:

  • at the start, computer turn on and off several times before finally starting

    Product: Hp Pavilion M9177C-B

    OS: Vista Edition Home Premium

    Approximately 2 weeks, when you start the computer by pressing the Start button, blue starting light turns on, then turns off maybe 6 + times before it turns finally for good and then I can hear the hard drives being accuated.  I fear that one of those moments that she not turn for good. So, I took the computer on at all times and just close the devices.

    Hello slodave,

    As you hear hard drives or anything on the spot for a while, it seems that the problem may be due to your diet.

    You can look at the power Panel there should be a light on the subject. See if it shows that it begins well before the computer actually turns on (so it comes at the time 6 + it is turn on/off).

    If the food will then replace just to continue normal operation.

  • point of the check box turn on and off

    Hello
    How do I enable and disable two item check box.


    : p1_checkbox1 and: p1_checkbox2

    If I choose: p1_checkbox1 then: must clear the p1_checkbox2 box and point to: p1_checkbox1 should show ways: p1_item1 and: p1_item2 is conditionally display when I choose: p1_checkbox1 and


    If I remove the check of: is expected to p1_checkbox1 then the two point check box.


    If I check: point then p1_checkbox2: p1_checkbox1 need to disable and point to: p1_checkbox2 should show: p1_item3 and: p1_item4

    How can I do this



    Thanks and greetings
    CORINE

    Hi Maxence,

    Looks like you may be using IE? I forgot there was a problem with IE and change handlers on radios and checkboxes, (easy to forget when jQuery normalizes all these types of browser issues)! You can try changing the "onchange =" inline 'onclick =' event handlers in your attributes checkbox and see if that solves the first problem?

    I forgot about the label, (also) it was the case in point 3.2, which we improved to 4.0 to also show / hide the point label. Can you try to change the calls $x_Show and $x_Hide to use $x_ShowItemRow and $x_HideItemRow respectively? This will hide the label also. Keep in mind however that this will also hide and show anything else on the same line on your page, which may or may not be a problem for you.

    Let me know if this fixes things for you.

    Kind regards
    Anthony.

    PS: Please always consider also the #5! :-)

    Published by: Anthony Rayner, November 15, 2011 11:16

  • Structure of the event can be triggered a 1 event

    I am using a structure of the event to trigger a 1 off the coast of the event.  I thought that I could check the State I want to trigger the event and this thread the Val (signaling) a Boolean property.  Then I created an event to change the value on this command expects the event fires when the value from false to true.  I think it is this writing in Val Signaling property raises the event each time not only when the value changes.

    The attachment is a simple vi to try to illustrate this point by using the iteration count to try to trigger a 1 off the coast of the event on the 10th iteration.  The Boolean 'once' varies from iteration from False to True on the 10th, but the event is fired for each iteration.  Need to run in debugging

    Any help much appreciated

    Ken

    I've seen this confusion on the value of property front of signage. You expect it would only trigger an event, if you write a different value than the control or the indicator has been set to. This is not the case. She fires whenever you write to it.

    Your simplified example wrote to the property value of signage in the while loop for each iteration. That triggers the event value changed whenever you write to it. Notice that the property is 'signs of value' and not 'value has changed the signs '.

    Some of the examples were complex with the authors of notifications and user events. But the easiest way is just to put the property within a business structure node while it is written only when you want that one off the coast of the event. It does not matter what you write to the node if you send all the data for the case of the event.

    If there is a reason you must write to the Boolean value of traffic property on each iteration of the loop you can use the value written in sub condition to run code in the event. But notifiers, queues and the user just looks complicated events.

  • How to stop a while loop structure in the event of a main vi

    Hello;

    Sorry for my English

    I have to stop to a Subvi my main VI, the Subvi contains a while loop and an event structure, so I need to stop this loop while I tried directly from my main vi, global variable, but it did not work

    any help please or example!

    How about something like this (solution see attachment) using a user event.

    Explore the User Interface--> range of events and dialogue. To display the dynamic event of the terminals in the structure of the event just right click and select 'display the dynamic event posts '.

  • VI, Structure of the event - script user events

    Hello

    I'm writing a VI script, which will focus on a structure of the event in another VI and fill the event with registered user events connected to the dynamic Terminal structure.

    I use the 'SetHandledEvents' invoke the node and the wiring to the terminal of dynamic events.

    In my example VI, I created 3 num event user, Boolean, and string. I can right click and add the event very well to the structure of the event. Now, if I remove any of the event and run my script I can add a dynamic user events. If I change the number of gegistration event from 1 to 2. I get error 1. The case of the event is created, but it is not configured for any event.

    Any help would be greatly appreciated.

    My test images vi showing events three user sign-up.

    Attached is the VI containing my script.

    Thanks in advance

    KeV

    The user 1 problem script error event should be fixed in LabVIEW 2016. DQMH did a lot of event scripts, but it cannot automatically configure event framework names... the user must do this manually for now.

  • Structure of the event: problem with data transfer

    Hello everyone,

    for three days I'm troubleshooting an issue in LabView with the event structures. I really hope someone can help here, because I can't find anything on the entire WEB.

    I had six groups of equal to a VI entry, each containing five checks enum (among others) where the user can specify some configuration of measurement data. I want the program to do is: to recognize if a any of these enum values has been changed and if yes, then submit the values containing the cluster in a subvi then calculates the wiring and affect the material of the ports. In addition, i need to submit the number of the enum element that was changed, so the program is able to clear the user input in the case of a breach (e.g. If the user sets two entries of enum control 1 meter and 2 Group 1 and then tries to set a third counter of entry to port 3, the program displays a message and deletes third entry as the number of entries of counter is limited to 2 per cluster).

    To resolve this problem, I used a structure of the event with 6 x 5 cases (change of enum value 1 Group 1 Group 1 enum value 2 change... and so on until the change in the value enum 5 Group 6).

    The problem is that if the user changes a value, the event structure reacts and performs the proper case; However VALUES of the cluster, the user changed are not subject to the SECOND time that an event occurs. It is a kind of a situation, "n-1". For example, if all five controls Enum of Group 1 are 'disabled' first and the user sets enum 3 of 'Meter entry', the structure of the event runs but submits the values previous to the Subvi (all enums 'Disabled'). When the user makes the second change, say that enum SWITCH1 to "Analog Input", the structure of the event is running again and passes the values of the FIRST user to the Subvi editing, then the Subvi gets data "enum 3 meter inlet and all other disabled enumerations.

    In easier words: if I have new values on my cluster "Kanal 1" (left side of the screenshot) and run the structure of the event, on the right side to "Kanal 1" indicator, I get the previous values (n-1).

    The structure of my event is in a while loop. If I create a timeout every 10 ms, and a loop of 250 ms the waiting time, I got the 80% chance that the recent changes are transferred to the Subvi correctly, in other cases I have a delay of the 1 step as described above. It seems to be directly based on the time that I specify the while to wait - but I can't explain it and I cannot accept a less than 100% chance to transfer the correct data, nor can I accept delays of a few seconds for each loop run. If I indicate timeout (infinite) get delayed 1-1 step values in all cases.

    When I specify cases of event to react on "all items value change" of the structure of the event behaves properly - but then I can't handle indicate which element has changed, as the CtlRef of output in case of a structure does not specify "enum 1, enum 2..." but only "Group 1".

    Does anyone have a solution to this? It is certainly a problem with the structure of the event, but I can't understand what to change.

    Thank you much in advance,

    Mr. Boiger

    This is because the terminal is read until the structure of the event runs.   Terminal is read, the event structure is waiting for an event.  The change in value.  Business events are running, but the value is the old value.

    Put the terminal inside the event.

    Or, you can display the connector called "New value" on the side left (stretching down from the border of the node 'CtrRef').  Use a wire one to come.

  • a few seconds "turn on", how can make I make in the structure of the event

    Hi, friends of LabVIEW

    I want to leave user click and hold down a button for a few seconds to turn on a device. Using registry item and history of shift I can make it work. I wonder how to implement it with case and structured event. Which case should I choose? mouse up?

    I have attached the test code as well.

    Thank you.

    I'm sure there are a lot of possible solutions, but here's a way to do it with a structure of the event. Mechanical action of the button is "Switch release." Pressing the button disables the output and sets the timeout of the event at certain time structure. The timeout event switches the output to true. Any other event resets the timeout to-1 value. Unfortunately, it seems that the tool gets messed up the image, so the VI is thus established.

  • controls and structure of the event

    I currently have a while loop that works in data flow.
    I'm hoping to change this work like a while loop and inside the while loop. It will have a structure of the event.
    Currently, if the ONLY STEP is set to TRUE.
    Then, he will enter a mode of manual programming.
    If I press CONTINUE. He will return to the automatic mode
    If I press ADV. He'll jump the current position.
    If I press stop. It stops at the current position
    If I press ADV & STOP. It will stop the program
    If I press ADV & STOP & DELETE. It will stop and remove the current log file.
    I don't know if anyone can point me in the right direction.
    It seems that its impossible?


  • How to control a VI (with a while loop and a structure of the event) from an another VI

    Hello

    I have the main VI which I want to be driven from an another VI. But I can't do that and I don't know what is happening.

    For example: VI main, I have a while loop with a structure of the event, there is a Boolean controller controlling a Boolean LED, which is inside the structure of the event. And the other VI, there is just a Boolean controller and functions of applications to open the main VI.

    How can I control the Boolean LED in VI main, changing the State of the Boolean controller in an another VI?

    Thank you.

    There are different options, but depending on what you want to do. For this example I can't give you a specific solution.

    I do not understand why you do what you do. Why do you call your 'principle VI' dynamically? What is the advantage to do? There are also other ways to call a VI dynamically, based on real cases (for example the method "call and forget", etc...).

    In you principle VI, control you Boolean ("THATCHER") is not the case of corresponding event. This is not usually a good practice, keep it inside.

    Also, why you try to communicate with the caller and callee VI through such a way to twist? There are better ways to do it.

    In one of my projects, I use the user event to launch orders in case of case of appellant VI.

    some Associates more readings for you:

    http://www.notatamelion.com/2015/03/23/how-to-make-dynamic-subvis/

    http://forums.NI.com/T5/LabVIEW/Dr-Damien-s-development-event-structures-III-communicating-with/m-p/...

  • logical AND with the structure of the event

    Hello world

    The structure of the event can manage several events at once to do the same thing: looks like an OR logical operator. But I have not found a way to sequence events to approach a logic and example: you must click on a button to draw, then enter the image would change the mouse cursor. With a structure of the event, I can handle these 2 events separately or together (i.e. change the cursor), but I can't do a sequence of events.

    Is this possible to do with a structure of the event?

    I hope that I am clear (sorry for English btw). And thanks in advance.

    Christophe

    I don't think this is possible directly. You will need to add status information to your event loop that could enforce the order of events and the rules of logic you want. Where transformation you would have to check whether the required event has occurred before this event. If that were the case, perform your treatment. If this isn't the case, ignore the event. Your first event would need set this status information. You can also include some kind of time-out for the second event were to occur within a specific period.

    This type of logic may be better treated with the help of producer/consumer architecture and a state machine in the task of the consumer.

  • Loops Parallels and Structure of the event

    Hello

    Is attached a valid way to the use of the structure of the event?  I keep hearing that the case of the event should include control of the event.  Can the control be placed elsewhere?  For example, if I have 2 loops, I placed a structure of the event in the 1st loop and control associated with the event in the 2nd loop, is there a potential problem?  It is true that no matter where a Boolean with a value change is read, the Ministry of value in the event structure will be fired?  See attachment.

    This screenshot you posted should work for you fine.

    The main reason that you hear the case of the event should contain the control for the event is so that the control is read and for locking of Boolean values, gets reset when the case of events runs.

    Here since the first parallel loop runs (assuming nothing else in the loop causes the loop to get blocked), the stop button will read and reset.  The value change event will always be raised in the upper structure of event loop.

  • Structure of the matter and structure of the event with a condition of the indicator (boolean)

    Hello

    I read a lot of posts but I can't solve my problem. I would like to set up a business structure and the structure of the event, and the condition to run the code inside is a Boolean indicator, in this case called Wahnelt (screenshot). I know I should use signal value, but I don't know how to implement. Here is the program:

    Any help will be more thankful

    a state machine with timer elapsed...

Maybe you are looking for

  • Printer ran out of black ink. Changed ink and now won't print

    Son was printing. Printer stopped. Say the need for black ink. Installation of HP black ink cartridges. Now do not print. Have cleaned print heads. Still no change. It is the second printer to do this.

  • Function calls multithreaded suddenly causing blockages

    I'm having a problem with function calls from multiple threads. There are two threads that everyone calls a function called save_program, including a DDCChannelHandleGroup and and a certain structure "show pulse" moved. The problem I have is that aft

  • I can't get the update Itunes 10.5 on my PC running windows home edition 2002 SP3

    I can't get the update Itunes 10.5 on my PC running windows home edition 2002 SP3. Error there is a problem with this windows package install,. a program run as part of the Setup did not finish as expected, contact your provider support or packaging.

  • Power supply for WAP4410N

    Hello Nice day. I would like to request the number of the network adapter on WAP4410N? Thank you

  • HP 8760w validity scanner does not work

    Hello, I have recently received a HP EliteBook 8760w from my college and cannot get the validity sensor (biometric scanner) to work.         I have Windows 7 Pro 64-bit, Intel core i5 2450 m CPU, 8 GB of RAM. I tried to install the drivers on HP webs