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.

Tags: NI Software

Similar Questions

  • 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.

  • What is the difference between primary key and unique indexes with forced not null?

    Primary key is = unique index + not null?

    The short answer is Yes.

    However, even if the primary key, applying both uniquness and not null, there is a notion of "special".

    You can only have one primary key in tables, but you can have multiple unique indexes and constraints not null.

    See: https://asktom.oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:8743855576462

  • 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.

  • 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...

  • Structure of the event with gray and disabled controls

    I'm working on a data acquisition program that uses the structure of the event to manage the graphic user interface.  I have a 'start logging' button that raises an event when the value changes and starts to collect data.  While collecting data, the program disables and gray on all controls on the front panel except the button "stop logging" that ends a while loop with in the event of data logging.  If this event is active only when you press "stop recording."  There are other events that are triggered by a mouse up/down, action others controls disabled on the front panel.  The problem is that, while the program collect data if you click on one controls disabled and gray that has a mouse up/down, event, the program seems to hang and will not push the button ' stop logging.  I don't know if his attempts to run another event, but he continues to logging data, I just can't stop it.  I have to use the Cancel button to stop the program.

    The real problem is that a control, even when disabled and grayed out, can still trigger a mouse to the high-low event - controlled, it true?  Also, what happens if an event is raised during execution, another event my understanding was that a single event can run at a time.

    Thank you

    Doug

    Doug,

    By reading between the lines, here a bit...  Looks like you have your data collection and logging code in the box to Start Logging event.  If so, this is part of the problem.  No other case of event cannot run until this one is over.  Move data collection and the registration code to a parallel loop.  Have this loop to sit in an inactive state until you press the Start Logging button.  Then, in case for the button change send a command via a queue to the loop of logging and out the case of the event.  The event loop is then immediately ready to respond to the next event.

    Generally the code within a case of event should run quickly, no more than 10s of milliseconds for maybe 100 ms to avoid slow response to another event.

    Look at the producer/consumer (events) design pattern which comes with LV for an example.

    Lynn

  • create subroutines for several structures of the event and common stop button

    Hi guys,.

    I wonder if there is a better way to design algorithm below scenerio that similar technical rehearsal for each structure of the event.

    Please find in annex vi where I designed the code to a boolean (D). I want to design a similar code for all other bolleans. (In the present design code, photo is displayed when the mouse is flown over D). I obviously have other pictures for the other,(A,B,C,E,F) booleans. Can we have a kind of subroutines for other Boolean types and a single stop for all the application button.

    Thank you very much in advance for your support.

    Sorry (I forgot to add vi) Please find attached.

  • Can I detect and handle an event already within a structure of the event?

    I have a VI that would do what I want, if I could detect and handle an event of second mouse click while I'm already handling a previous event (selection from popup menu).

    I hope that the picture is clear, but in words what I want is the following: I have first right-click on a chart and select a context menu item, which specifies a graphic manipulation of properties.  Often, this manipulation requires clicking on a second graph to get a reference (for example if I want to copy some of the properties of the first chart on the chart of the target).  It is, it means I'm trying to detect a second event already within a structure of the event.

    I think I could do with a state machine and some registers at offset, and if it's the easiest way, I'll do it.  I would be interested to know whether, if there is a way to detect and manage events 'nested' as I suggested.

    Thank you!

    Your code is not really that complicated.

    Yet, the problem is that confuse you it upward with the main state machine. I would use it in a small parallel loop that only manages events associated with the menu shortcuts. All this should be able to run in parallel in any event, even if the main loop updates the data in the chart at the same time, for example.

    I don't like the dialog box, it hampers the flow of work, but if you use it, use two button dialog so that the user can also cancel if necessary. Instead of the dialog box, you should just temporarily move the cursor on. I also do little to check before operating on the second graph of reason and give a time limit for the second operation.

    Here is a quick project to a more atomic shortcuts Manager. Modify if needed. There are probably bugs.

  • How to import in the video editor of first elements 13 clips with the tag structure or the person, location and the structure of the event organizer?

    How to import in the video editor of first elements 13 clips with the tag structure or the person, location and the structure of the event organizer?

    senior50

    On what computer operating system is your first items 13 running? And you have updated 13 to 13.1 still using Help Menu/implementation of an open project? If this isn't the case, please consider this.

    Now to your question immediately.

    I would consider placing your files for organizing items (person, place or event) in albums that you create in the organizer of items for each. Then,

    (a) the content of the album of the opening of the first elements add multimedia/Organizer.

    or

    (b) by selecting your album in the elements Organizer, select the photos in the album you want, then right click anywhere in a selection and Edit with Premiere elements editor selection?

    Have you been there and done that yet?

    Please examine, consider, give more details, and we can then decide what.

    Thank you.

    RTA

Maybe you are looking for

  • Thunderbird will post an attachment twice

    I use Gmail (but I do not exclude a migration option to another e-mail service in the future). If I send a large (for example 10MB) attachment, the attachment is downloaded twice - once when sending, once when copying to sent. Can this be avoided, th

  • FireTray does not work

    Hello! I use the module FireTray have icon with my numbers emails in the system tray. Now disappeared and I couldn't come back. The add-on settings are the same as always. Mozilla Thunderbird: 24.6.0FireTray: 0.4.8 When I close the window of Thunderb

  • How to ensure that the binary file is stored in the location specified for my DLL files?

    I'm new to computers and has a Dell Inspiron 1545 laptop with a program in Windows Vista Home Premium on a 64-bit platform. I have a thread in my sidebar gadget new MSNBC and the dates for the stories are frozen in December of last year and does not

  • Broadband BEFSR41 and wrt54g routers a create a vpn or a tunnel to an IP phone.

    Hello where is the VPN feature / passthru for a vpn connection? I don't use a lot of routers, and it must be called something else. any help much appreciated. Bob

  • BlackBerry, Blackberry Classic beds - it works overseas

    I have an older Blackberry Curve with Verizon and it works very well overseas. Before buyingit, I just wanted to be sure that the classic also work abroad. I noticed that a Verizon technical support doesn't have a lot of grumpy who are warned - Black