Producer Consumer Subpanels, User events and DAQ

Hello All,
I am working on a Producer Consumer application and have beed looking at subpanels for user navigation. The application needs to be capable of responding to user generated events but also manage data received from attached data acquisition and control hardware. This is a 2 part question.
I need to implement about 15 screens in this application and have started integrating subpanels. I need to be able to navigate from one subpanel vi to another using subvi buttons but dont understand how to build this functionality. Can I build functionlaity so that when I click on a subpanel loaded vi's button it will load the vi referenced by that button and the original dissappears.
I have a 3 loop producer event template consisting of (1)data acquisition producer, (2) user event producer and (3) consumer loop but theres not much detail, are there any reasonable templates out there? I have seen the data- consumer and user-consumer but no mix of all 3.
Advice appreciated
Chris

I use subpanels to host my display vi's and control them dynamically.  I would have a loop or vi process that manages your subpanel.  You could use user events, queues or notifiers to send messages to this subpanel manager to perform the basic functions such as loading a vi into a subpanel, removing a vi from subpanel (you can remove and stop the vi or keep the vi running in the background or even make it a floating vi.)  A subpanel button can create a local event which in turn could trigger a user event or message to the subpanel manager.  I have attached my subpanel manager to give you some ideas...
Attachments:
Subpanel Manager.vi ‏39 KB

Similar Messages

  • Detect user event and session expiration

    Hi,
    Can we monitor the time gap between user events in a flash
    movie. This is to detect when the user doesn't do anything, or
    leave, and his/her logged profile is still open in the flash movie
    on the browser. So to avoid to have inappropriate use of the logged
    profile by a third party, then the flash movie could detect if
    there is no activity for 5 min. then redirect to the login screen.
    Does a case like that need an actionscript timer ? Have you
    seen any examples of that?
    Thanks,
    Marty

    You don't.
    You might be able to use the session for this. You could have an Object that gets notified when the user session is unbound. This would atleast close your stuff after the session times out if the user closes the browser.
    Take a look at http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/http/HttpSessionBindingListener.html

  • HCM P&Forms:How to create a user event and scenario step mapping

    Hi Friends
    I have a problem with Form Scenarios --> Other Attributes -->User Events:
    At present the values are: Operation :- the_operation_name
                                               Field Groups :- Field Group assigned
                                               Usable from scenario step :- Emp_Req_scenarion_stepname1
    I need to enter a new mapping here so that the operation is available in another scenario step as well.
    But in the edit I can enter only the operation name, not able to enter the scenario step.
    Can someone please suggest a solution or work around. Your inputs are appreciated.
    Thanks!
    Sajimol.
    Edited by: Sajimol Unni on Mar 2, 2010 11:54 PM

    Not quite true. A "user event" looks at what fields you selected for your "field group" for the event. Then ANY operation that has that field associated with it will get called (unless a "rule" stops it). User Events in HCM P&F are REALLY BAD in my opinion (I have ranted on them in many threads, blogs etc.). There are ways to deal with them and also ways around using them (see my blogs). I think this is one area in HCM P&F that needs a major overhaul/re-thinking.

  • Starting a job with 2 conditions (User Event and end of job)

    Hello ,
    I'd like to make a process SAP which start a job depending
    on 2 conditions :
    Condition 1 : raise an event
    and
    Condition 2 : end of another job
    I know that it 's possible for each conditions but is it possible for both conditions ?
    Thank you

    hi again,
    Ok, i'm sorry, my english is not yet fluent.
    I'm searching a solution for an SAP administrator.
    Here is his problem :
    He must launch an Abap program with a job1.
    The abap programm  :
    1>generates a spool in which you can find status code like OK or NOK and
    2>raises an event (EVT_CONTINUE) only if the spool contains OK code.
    Afterwards, The administrator wants to launch job2 if
    2 conditions are OK :
    Condition 1 : EVT_CONTINUE is raised
    Condition 2 : job 1 is terminated
    My question is : is-it possible with a transaction like sm36 or another to do that. (my objective is to avoid
    writing an abap program)
    thanks

  • Producer consumer vs state machine

    Hi there,
    I have been on and around for quite a while to understand how can I re-design an application, which was originally built using a mix of sequence structure, while loops and event structures. And now I am making a newer version of the same application, for research purposes, while learning the LabVIEW techniques. Earlier I used LabVIEW versions 5 and 6 to make simple programs for fuzzy logic and neural networks. And that's not a good reference.
    Ok, after learning that Producer Consumer (PC) and Standard State Machines (SSM or SM) are two new approaches for a better (scalable, flexible and efficient) coding as suggest by veterans, in one thread where I asked about another issue, I have started digging into this topic and now I am on a point where I have to implement it finally (spent pretty much time in the learning phase).
    I have several questions.
    To start the discussion, I would give a brief description of my application.
    It's a networked application, where the network communication happens using DataSocket (one reason to use LabVIEW as the environment).
    We are talking about the client application, which communicates with other applications on remote computer, via Internet.
    User interface involves a tab control, with several pages-
    On startup, the controls/indicators (now onwards referred as controls only), are initialized, datasocket connection is checked (rather internet is checked, and a connection established with the remote datasocket server) (page 1)
    If connected to the datasocket server, the user selects Login/Registration (page 2)
    Login and/or Registration happen on page 3/4
    Then the user sees a table of remote users to connect to (page 5)
    Upon selection of a remote user, and after clicking on "connect", the user will see a video indicator, with a lot of other controls. (page 6)
    On this page with video indicator and controls, the user has a lot of activities, in which many messages are sent and received to/from the remote machine.
    the user may disconnect and go back to page 5, and log out and go back to page 2 and so on.
    I hope this is clear.
    I have thought about two different ways to do this application. Using PS or by SSM.
    In the attachments, I have given a diagram (with errors, of course, because of unlinked controls), for each of the approach, plus the original application's diagram.
    I hope this is sufficient for anybody to understand my case and give suggestions.
    I am looking for suggestions about which is a better model for my type of case. I have been to discussions like this one and saw that there are many issues regarding dequeue in PC model. So I am curious to know if SSM is a better and latest model or it's more primitive? Which looks better for my application's performance?
    Thanks ahead!
    Vaibhav
    Attachments:
    OldDesign.vi ‏41 KB
    PCDesign.vi ‏42 KB
    SSMDesign.vi ‏46 KB

    Vaibhav wrote:
    @ Harold
    Thanks. Any suggestion how can I start and stop that loop in parallel with other loops? Like, if some event occurs, the loop should start execution, and keep on moving, while other events are being traced and executed.
    In those examples where you had a while loop inside a case structure, that bit of code will only execute one time.  It will immediately read the boolean at the start of the program, if the value was true before the porgram started, then the while loop will run.  Once that while loop stops, the case structure will end.  It will never execute again unless you completely stop and restart your program.  If the boolean is false before the program starts, the false case will execute immediately.  Nothing happens since it is empty and it is done, never to run again (unless you stop and restart your VI)  You should turn the structure around.  Put the case structure in the while loop.  Make sure you put a small wait statement in the loop so that it doesn't run full speed eating up CPU cycles just polling the status of the boolean.
    @ Ravens
    Thanks for the detailed comment.
    One thing I would clarify. The user will not be able to switch between the pages using the tab control. The program will direct appropriate page to the user. I kept the tabs visible just for your idea of the pages. Sorry, I didn't mention that.
    Do you think it's still a bad design?
    If the tabs will be hidden or disabled, you will probably be okay.  I wouldn't call it a bad design.  I wouldn't do it that way.  But as long as you understand the possibility of problems and prevent that.  Especially some time down the road when you modify the program in some other way that could lead to a problem because you forgot about the dependencies of the event structures on the state of the state machine. 
    Yes, I agree about only one event structure to handle all the events. But since the user will not be able to click somewhere else, other than those possible controls, I thought to keep it like this.
    I thought the events are captured only if we are in that case. I think I am wrong, right? Events are captured at any time, even if the case has never executed before, or will never execute.  Ok, The events will be captured, but will not be executed until in that case.
    And that's the reason why I have two separate event structures, in two separate phases of the program.
    Because, prior to page 6, the events will occur sequencially. The user will click somewhere, then some message will be transmitted over DataSocket, then some message may come , then again some user action and so on. But, when the user starts using page 6, there will be parallel process of user controls events and actions, and incoming messages and corresponding actions. For this, in the page 6, I need a different kind of execution. So I separated the two event structures.
    At first I thought to have SSM, and then I thought to PC, just because I can have two separate parallel processes - one for user events, and another for messages (because that way I can take maximum advantage of message tracking). But looking at other complexities, I find SSM more appropriate. Can you please tell me how can I have my message loop and events loop parallel to each other and just one event structure?
    You can have a dequeue function in your state machine loop and have it be a consumer loop.  Use a timeout on the Dequeue.  If there is a timeout, have the statemachine execute normally after that perhaps just passing the enum wire straight into the case structure of the state machine.  If it doesn't timeout meaning you got a message, then look at the message that is dequeued and act on it.  Perhaps it means ignoring the enum coming in from the shift register and changing the enum to something else to feed into the case structure of the state machine.  Attached is an example
    Attachments:
    PCDesign[1]_BD.png ‏6 KB

  • Producer Consumer Parallelism Failing!

    I'm controlling multiple automation stations with a single cRIO 9074 -- the multiple stations are all following the same logic but should be independently controlled. I'd like to accept all digital inputs (from all stations) in a producer loop, queue them up, and then consume the data in 3 consumer loops which actually perform the logic (take a digital input and then decide what to output at each station).
    The actual logic is functional, but the three consumer loops are outputting the data with a time delay.
    So, for example, if I want my first step to be "Event 1", once I start the program the state machines decide that:
    Station 1: Event 1
    Station 2: Event 1
    Station 3: Event 1
    And when a decision is made to switch to Event 2, the 3 stations take turns switching (the action is not simultaneous), so you may get:
    Station 1: Event 2
    Station 2: Event 1
    Station 3: Event 1
    and momentarily after,
    Station 1: Event 2
    Station 2: Event 2
    Station 3: Event 1
    etc...
    Attachments:
    cRIO_fake.vi ‏27 KB

    RavensFan wrote:
    Queues are meant for a one to one, or many to one relationship.  Here you have a one to many which is wrong.  When something is sent, only one of the three loops will get the message depending on which is ready to grab the message first.
    You should have a different queue for each consumer loop.
    Or a User Event, and have all the consumer loops register for the single event so they can all act on it when one event is generated.
    Attatched is a quick example of what I was thinking.  You can make this more complicated, and wrap some functionality into SubVIs to help scale it for larger applications.  User Events do work in LabVIEW Real-Time but I believe you would need some kind of FIFO to User Event to go from a host PC to the RT to have work be done.
    Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
    If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.
    Attachments:
    User Event Request Example.vi ‏17 KB

  • AE user event error

    Have an AE which has errors:
    Init - registers dynamic user events and Runs VI.
    Write - Attempts to generate user event to write data to VI which is running (Error 1)
    Close - Attempts to retrieve control value (safety cluster_out) from running VI and then close (abort).
    The VI gets to run but the generate user event produces an error.  I can't figure out why and I doubt this is the proper way to be doing this.

    Hi Battler,
    I see that you've created the user events, but registering them involes the Register for Events VI, which is located in the same palette. It looks like a property node but has a satellite icon in the heading. It's very possible I'm missing something. Could you post your main and subVIs so I can take a look at them?
    Pardon the messy snippet.
    I have another question, too. It looks like you're closing the reference to your subVI in the init frame. Is there a reason this needs to be done?
    Verne D. // LabVIEW & SignalExpress Product Support Engineer // National Instruments

  • Producer consumer "clean up diagram" puts consumer on top of producer

    I do File > New... > VI > From Template > Frameworks > Design Patterns > Producer/Consumer Design Pattern (Events)
    Then without doing anything to the block diagram or front panel, I click on the "clean up diagram" which does the auto block diagram cleanup.  Bam! Consumer loop is put on top of Producer. 
    I tried a bunch of combinations of the Block Diagram options settings (wire spacing, move controls left, etc.) , but the "clean up diagram" always wants to put consumer loop on top of the producer loop.  How can I get labview to maintain the original loop positions?

    There is a reason a lot of use do not like to use the Block Diagram Cleanup.  It generally works for simple VIs.  But I would not use it on my top level architecture.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Dynamic user event

    Hello, I am a newbie regarding dynamic user events.
    Basically, I want to create a user event that triggers  an event structure in a subvi.
    To do this, I wire up a "create new user event" and then pass the refnum to my subvi "more info" as seen below.  But this piece of code get's stuck in the sub-vi and never leaves :[
    here is my subvi below:
    I'd greatly appreciate any help :]

    To stop your main vi you will need to provide a mechanism to stop your sub vi.
    I would use an additional boolean User Event to do this.
    (This could be shared among other subvis).
    When the (let's call it) Shutdown event is received, set your subvi while loop control terminal true.
    Note: When using this scheme in an exe file, if the subvi front panel is open and you shutdown the main vi, the subvi can remain open. This happened to me using LabVIEW 2010. I had to use a Front Panel Close Method to avoid this issue.
    When using the Front Panel Close Method you should first check if the front panel is open or not to avoid an error.
    Help the forum when you get help. Click the "Solution?" icon on the reply that answers your
    question. Give "Kudos" to replies that help.

  • Force a user event

    Hi,
    In a point of my vi I want to force a user event in order to enter in
    an event case in run time. I want to simulate an event over a
    multicolumn listbox, for example, Double Click.
    How can I do it? Some example?
    I am working with Create user event, generate user event and destroy user event but I don't know how it works.
    Thanks very much,
    ToNi.

    tonitpp wrote:
    Sorry, the object over I want to force an event is a button and not a multicolumn listbox. It works but.... when I force a Double Click event over that button the user can see how the button is pressed automatically and I don't want the user see it, I would like to do it transparent to the user. I use a value (signaling) property node and I associate to it a true value. Another way to do it?
    The event also gets triggered if you wire a FALSE to the Signaling property. It does not matter if the value actually changes, only that the signaling property is written to trigger the event. Try it!
    LabVIEW Champion . Do more with less code and in less time .

  • User Event

    The Help surrounding User Event seems circuitous to me.  I can find out how to name an event, register an event, send a event, and act when an event occurs.  What I can't figure out is: what is the actual event in the examples shown? In the Programmatically Fire Events.vi example, I see a cluster of two integers attached to the Create User Event.  What "event" is represented by this?  A change in one integer, both?  How is this a "User" event?  What I need is a simple TEXT explanation that builds up a User Event step by step with numbered steps, starting with an explanation of what kinds of events can be used as User Events and building from there through the creation and registration of events to their actual use.  This is a fundamental tool for modern instrumentation programming and I don't feel I'm getting the help I need.

    I'm looking at Programmatically Fire Events.vi
    I see that the Create User Event has some constants attached which apparently "type" the event.
    I see the Register User Event  which I suppose adds to a database of accessible events.
    Inside an event called "Slider", I see a Generate User Event.
    I am confused because the Event used in the Event Structure Case 0 is "Slider" Value Change.  I can understand an event in that context:  the slider moves, values change.
    But then inside that event, a refnum connects to the Generate User Event this serves as a "name" but it is only code-readable so at this point, I have no idea what the name of the event within the event is.  
    Connected to Generate User Event is a bundle of "something" called NewVal and a 0.  I suspect this means the User Event is "generated" when position has a new value (presumably the value resulting from the slider value change) and delay is 0.
    The event is "generated" but I STILL don't know what that means.
    In Event Structure Case 1, triggered by event Repeat switch Value change, a Generate Event with the same refnum "name" as before occurs when some calculated values are reached.
    After the loop finishes, the refnum goes out and generates a new User Event with the same "name"
    when position is -1 and delay is 0.  
    I am primarily interested in events as triggers for Cases in Event Structures.  I thought User Event meant some kind of user-defined event that I could use for such a trigger.  Instead, I see in this example that some other event triggers the Event Structure Case in which the User Event is "generated" and I have NO idea what happens that "event".
    So, either the term "event" is used in some wildly differently context or I need more help.  I have now seen the same refnum generate an "event" based on three different inputs.  How is that not too confusing for a Help example?
    How can I tell what help I need?  This is the most confusing example I have encountered in my long history as an engineer.
    Where does the generated event go?  How do I use THAT event?
    I just can't tell from what is provided and I can't find a tutorial or a book that describes it.

  • User events vs notify event

    I've read a number of whitepapers on User Events and Notify/Wait on Notification.  They seem quite similar to me, and I'm not sure which to use.  I have (well, when I write it) a transmit/receive VI that I think will be running in a separate thread.  It's supposed to listen for TCP/IP (rx) messages and "notify" (I use that generically here) a test that's waiting for this message.  That test would access some Shared Variable, or user-defined data to extract/process the message.  I will (possibly) then build a message (in another shared variable) response, and "notify" the tx routine that it has something to send.  I (obviously) don't have all of this worked out, but I'm assuming right now that I need to open and keep open the TCP/IP socket because it' going to be a secure (https/ssl) channel.  That's why I thought I would make this a separate thread.  With this in mind, is User Event or notifier more suitable or even the right approach?

    Based on your description I would recommend that you use queues to pass your messages through the system. Queues are similar to notifies with one major difference. With queues you can stack up multiple messages to be processed. With a notifier you only get a single message. The event structure works best for UI types events. Though you can define your own events I don't think the event structure would be the best option for your situation. However you could still use an event structure for processing your UI events.
    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

  • User event notificati​on

    How can I know when an event has occured. Like a boolean or event status that can be compared so that only if it is true I can execute another set of code ?
    Abhilash S Nair
    Research Assistant @ Photonic Devices and Systems lab
    [ LabView professional Development System - Version 11.0 - 32-bit ]
    LabView Gear:
    1. NI PXI-7951R & NI 5761
    2. The Imaging Source USB 3.0 monochrome camera with trigger : DMK 23UM021
    OPERATING SYSTEM - [ MS windows 7 Home Premium 64-bit SP-1 ]
    CPU - [Intel Core i7-2600 CPU @ 3.40Ghz ]
    MEMORY - [ 16.0 GB RAM ]
    GPU - [ NVIDIA GeForce GT 530 ]

    in that case, I have an event that tells me if an image is available from the camera. and only when an event occurs, that is if an image is available I get to save it. But when I do 2x2 scan and have to capture 3 images for each pixel, I see that it misses certain images. This doesnt happen in any particular order.
    Is it nevessary to add unregister user events and destroy event after the event structure for every single pixel ? 
    Abhilash S Nair
    Research Assistant @ Photonic Devices and Systems lab
    [ LabView professional Development System - Version 11.0 - 32-bit ]
    LabView Gear:
    1. NI PXI-7951R & NI 5761
    2. The Imaging Source USB 3.0 monochrome camera with trigger : DMK 23UM021
    OPERATING SYSTEM - [ MS windows 7 Home Premium 64-bit SP-1 ]
    CPU - [Intel Core i7-2600 CPU @ 3.40Ghz ]
    MEMORY - [ 16.0 GB RAM ]
    GPU - [ NVIDIA GeForce GT 530 ]

  • Making an array of different user events refnums?

    Hello all,
    I have a question about dynamic user events. I have 6 different users events which I create, and would like to put into an array. (Such that I can use them in a For loop laters, taking off one event per loop and assigning it to a control of a vi) So far I haven't found a way of doing that since if I just wire the user events refnums to an array I get broken wires. (Similarly if I wire them to a build cluster structure.)
    I think that you'll understand what I am trying to do if you look at my labview code in the attached vi.
    In the vi I create some user events, and then wire them to the control of two vi's which will communicate to each other using these events. In the code you will see 6 Invoke Node structures where I use the "Ctrl Val.set" to pass the events to the two vi's. Obviously this is the wrong why of doing things. Since if instead of having 6 events I had 100, then I would need to put 100 Invoke Node structures on the block diagram (making it very large compared to the size of my computer screen!). 
    So what I would like to do, is put the user events refnums into a array, then put the one Invoke node structure into a For loop, and index the array to assign the events to the vi's programmatically. 
    Is there anyway of doing this? Or is there an alternative (/ better way) to what I have done?
    (Baisically I have 2 vi's that run in parallel and communicate to each other using user events. I need to pass the events to both vi's, how do I do it in the minimum of mouse clicks, and minimum of screen space.)
    Thank you!
    Paul.
    Solved!
    Go to Solution.
    Attachments:
    CameraTempControllerRunner.vi ‏49 KB

    I haven't created any new messages since the forum changed over, so I'm not sure.  But check on the menu under Options on the upper right.  I think there is a way to undo your choice and put it on another.
    Kudo's have replaced the stars.  Anything that was 4 or 5 stars is now equivalent to a Kudo.  But with the old system, anything less than 5 stars was essentially a negative opinion in the ratings.  So to simplify the multiple shades of gray (1 through 4 stars essentially being some degree of a negative) and to just eliminate the negative aspect altogether, the Kudo system was born.
    I don't know if the "Accepted Solution" designation does anything to help the person whose solution was accepted, but having that designation helps people searching the forum because they have the same problem find the answer quicker.
    Message Edited by Ravens Fan on 10-06-2008 10:15 AM

  • Are user events valid before the event structure executes?

    If I create and register for a user event and immediately generate that event before my event structure has seen the registration refnum, is the event still guaranteed to be seen by the structure? That is, are events queued up? It works but I am wondering if I can rely on it. I am very sure that I can but I am creating some production code and want to be assured that I am not just taking advantage of a bug.
    A picture is worth a thousand words.
    =====================
    LabVIEW 2012
    Solved!
    Go to Solution.

    Generally, Felix's explanation is correct and the queue exists from the moment the register node executes, so the answer is that you can rely on this.
    You should, however, be aware that when playing with dynamic registration you can experience some unexpected side effects, as you can see, for example, in this LAVA thread - http://lavag.org/topic/13607-dynamic-event-reregistration/
    Another example would be this - http://lavag.org/topic/13970-unexpected-event-structure-non-timeout-behavior/page__view__findpost__p...
    Or what happens if you split the registration refnum to more than one event structure (hint - NEVER do that).
    Try to take over the world!

Maybe you are looking for

  • Unable to allow inbound ICMPv6 on ASA version 9.0(1)

    I have upgraded an ASA 5505 to 9.0(1) as I would like to use ipv6 version of dhcprelay. That said, I am unable to obtain a global unicast address but the link-local address is able to communication with the ISP's gateway/DHCP provider which I hope wi

  • [Solved] errors on boot

    when i do    journalctl -b this is what i geti just came from mint 64,i tried to install arch with the new installation proces and i was unable to do it,i followed the instruction on a youtube video but i get this errors,can you tell me what this is

  • Sapapo/sdp94 - GR/GI issue problem

    Dear Experts, After doing a deployment run by sapapo/sdp94, it is creating a process goods issue record. Actually it shouldn’t create as per standard. Because in /sapapo/mat1 GI processing time filed is blank. When it has value it should show the pro

  • Note file recovery

    Some of my note files are missing, does anyone know how to restore or find them??  Are they backed up somewhere?

  • Query for reading data in buffer

    *Which FM is use to read values from buffer, CRMORDER_READ or CRM_ORDER_READ_OW?*_