Initial Event Case

I am using an event structure to handle all my front panel controls.  I would like to have an INIT event case which will initialize all the front panel controls to a specific state.  I can't find an event to trigger on.  There are events for close, but I am surprised to not see a "start event".  Any suggestions on how to create a "start event".  Thanks in advance.
Jim@BMC

The best solution depends a little bit od the details if your program.
If the initialization should set the controls to a defined state only at the start of the program, the initialization does not belong inside the loop, but should happen before the loop.
If initial calculations should run so the indicators are also updated from calculations with the new control values, you could use the timeout case solution mentioned above. It is somewhat limited, because the timeout case might be needed for other stuff and you might actually want to fire other cases (see below).
Sometimes you actually want to run a specific, non-timeout case. In this case you could fire some events via a signaling value property, you could even line up several of those to execute several event cases in a specific order at first run. (see e.g. the image below). You can the use the same event to reinitialze things at any later time if needed.
Message Edited by altenbach on 04-20-2008 11:37 PM
LabVIEW Champion . Do more with less code and in less time .
Attachments:
startupevent.png ‏14 KB

Similar Messages

  • Value Signalling Event Case

    Hi Guys,
    I am trying to trigger an event using "Value Signalling" and i hit a little bit of snag.
    I am reading logic inputs continuously and i wanted to trigger an event if there is a change on logic signals.
    What i did is i read the logic signals initially so to get the default state and re-read again the logic signals inside the timed loop in the event case waiting for the signals to change. 
    However, the event keep triggering even there is no change in signal.
    Any advice?
    Regards
    Ray
    Solved!
    Go to Solution.
    Attachments:
    untitled.PNG ‏85 KB

    Of course you did not show any actual code (just an image) so we can only guess the overall program architecture and what's in the other cases and events.
    Still, you might be over-thinking all this. Since the loop is already spinning it seems overkill to trigger things using signaling events. All you probably need is a small case structure that executes additional code whenever things change. Events are primarily used to handle user interaction from the front panel. You just need to branch depending on the "changed/not_changed" case, which is trivial.
    LabVIEW Champion . Do more with less code and in less time .

  • How can I use the same event case for different controls dynamically

    OS: Linux 2.6.24-1-686 #1 SMP Sat Apr 19 00:37:55 UTC 2008 i686 GNU/Linux
    LabVIEW: Version 8.2
    I have a lot of (about 50) controls (numeric, boolean) on my front panel. If a "Value Change" event will be fired by any of them the same event case shall be executed. As I do not want to add all 50 controls to the same event case manually I am looking for a way to do it at run time. Additionally the VI is still under contruction, i.e. controls will be added and removed.
    Thanks for any help here.
    Regards,
    Johannes
    Solved!
    Go to Solution.

    Hi Johannes,
    collect all your control references (you can use the FP property for it) and create a user event. Connect this user event to your event structure. Now you have one event case for all your controls. See the attached picture.
    Mike
    Attachments:
    Unbenannt1.PNG ‏11 KB

  • Can I have multiple event structures with the same event cases?

    Hello, 
    I'm doing an application that reproduces the front panel of the HP6675A power supply. To achieve this, I have done a state machine with different states
    (initialize, measures, voltage, current, ocp, ov, store, recall, etc). In each state, should have an event structure that catches the events of the buttons, like for example: if the current state is the Voltage mode and the user press the current button the next state will be the Current mode. For this in each state of the state machine should be the same event structure with the same events.
    My problem is that the Vi doesn't work properly when I have multiple event structures with the same event cases. There are some possibily to do this, and how? Or is impossible to have multiple events? I have been reading some posts, but I don't find solutions. 
    Any help is appreciated.
    Thank you very much.
    Solved!
    Go to Solution.

    natasftw wrote:
    Or as others mentioned, make two parallel loops.  In one loop, have your state machine.  In the other, have just the Event Handler.  Pass the events from the handler to the state machine by way of queues.
    A proper state machine will not need the second loop.  The "Wait For Event" or "Idle" state (whatever you want to call it) is all you really need in order to catch the user button presses.  The setup is almost there.  Maybe add a shift register to keep track of which state to go to in the case of a timeout on the Event Structure.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How to use only one event case at a time??

    Using LabVIEW, using the event structure is it possible to have only one event case execute at a time. For example, having event case controlled by keyboard, and the other event case controlled by mouse (clicking buttons) and only one being able to execute, not simultaneously. I was considering using a switch of some sort, but each case does not have a "stop if true/false" so I am open to a new method or work around. I attached code. I do not want output to be able to be sent from the keyboard case and mouse case at the same time.
    Thanks,
    Andrew
    Attachments:
    WiFi Motor Control & Cam Stripped.vi ‏29 KB

    Ah, OK. all you need is to keep state in a shift register that ensures that all "key down/mouse down" events are discarded after each key down/mounse down event until a key up or mouse up (resp.) has occured.
    Overall, you code is still way to complicated for this simple task. For example, you could eliminate all these "select" primitives and place the approriate diagram constant inside the respective case. On the other hand it is too simplistic, because you would think that certain key combinations should be allowed concurrently (e.g. up and left).
    What does the receiver actually do with the codes? Do you have any documentation for this device?
    LabVIEW Champion . Do more with less code and in less time .

  • How can I 'click' on a "latch" mechanical boolean in an event case?

    Since I can't set true of false to the local variable of latch mechanical boolean, how can I click the boolean in an event case?

    LUX_ wrote:
    1. I can't make the value change event work (the second option of the solution posted by smercurio...)
    2. The occurrence does not work as I thought it would be. I need to stop the timer if user change to other mode within that 7 minutes period (my test.vi set to 10 seconds).
    The value change using a signaling property only works if you actually have an event assigned to that value change. You currently don't!
    I am not sure why you complicate things with the occurrence. You don't need it. (the wait for occurence prevents the the loop from e.g. checking the elapsed time). THe code is way too convoluted.
    I think all you need is one loop utilizing the timeout of the event as wait timer (and one to randomly cause faults). See attached for a rough draft. modify as needed. As you can see, you don't need all these locals and hidden controls.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    testMOD.vi ‏18 KB

  • How can I reduce the number of event cases in the main VI?

    I would like to reduce the number of event case of the event structure in my main VI. E.g. I would like to have pop up window with a table when the user double click a table row. Nothing more simple than this: add a case to the event structure trigger by double clicking the table, read the table row ... But in my main VI I would have lots of them and the event structure gets crowded with minor tasks. One solution is using XControls. But is there any other recomended way to handle selected events separatly from the event structure in the main VI?
    to clarify: I don't want to distribute the whole event structure. (In this case the code would not be maintainable) But I would like to handle certain context specific events in a differnt place. If I have them all in the main VI the drop down list of the events in the event structure exceeds the windows size and the program becomes difficult to maintain because one looses the overview.

    "Strictly forbidden" is not true. But highly not recommended. The reason is simple:
    1. Code can react unpredictable. Dennis already stated some things about that in your linked thread. 
    2. Code is not readable and therefore not maintainable. Each event source should have only one event structure for its events. Since the UI is a single source, events from there should be captured in a single event structure. It is recommended to use this event structure as producer in a producer/consumer design pattern in order not to block the events.
    3. You will most propably need timeouts in your event structure which completly negates the advantage of event driven programming. Either use event driven programming or stay at polling. Do not mix (most of all because of maintenance).
    Regarding your "advantages" you listed:
    - Clustering  reduces readability in therefore should never be done. Additionally, it requires timeout cases in most places which is not recommended.
    - If you have such many events and interactions in your "sequence", it is a clear indication that you chose the wrong architecture for your application.
    Please see attached example. Since i am not used to program with more than one event structure (except if i have different dedicated event sources), the example is "constructed" and therefore may lack of "realism". Nevertheless, it shows some issues which might occur:
    - Blocking calls within the events lead to the fact that the UI is not responsive for the event time (FuncA). Nevertheless, interaction is still enqueued and if the blocking call is over, all those interaction are executed. In the example, please press FuncA and then press FuncC immediatly. You will see that nothing happens and after the 5s blocking call, the FuncC dialog appears. You also can switch tabs, but the visual display will update only after the 5s blocking call.
    - In order to keep the UI responsive, FuncB is configured not to block the UI. But this is no solution: Press FuncB (on page 2) and the change to page 1 and press FuncA. Additionally, press FuncC. What happens? Just to mess things up, press Stop as well......do this combination several times. It is possible that only the lower loop is finished and the VI is still running even if Stop has been pressed.
    Please note everyone that the attached example shoudl strictly be seen as "NEVER DO IT LIKE THIS". This is a negative example and shows the approach which is not recommended by any means!
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.
    Attachments:
    Never EVER86.vi ‏10 KB

  • Are you ever required to wire the dynamic event terminals through an event case?

    I remember some time ago, I ran into an issue while using an event case where my program was not functioning properly until, on a whim, I wired the dynamic event through that event case... now the reason I'm asking this in a general sense is because I don't remember what particular code I had this issue with and I could have been failing to update a shift register or something.
    In code I'm currently writing, I'm simply passing the dynamic event wire in a shift reg.  I was just wondering if there's any difference between wiring it through the event cases or simply passing it to the output shift register (without passing through the event cases)...
    any info appreciated!
    Thx
    -pat

    You do not have to wire it through. You don't need a shift register for references since the value will be the same for each iteration. In fact using a shift register is probably what caused issues. You probably updated it with the default value somewhere.
    =====================
    LabVIEW 2012

  • Add event cases to an event structure using scripting

    Hello,
    Iam trying to (using scripting) update an event structure (add event cases) on a vi that is not on memory.
    i get error 1054 The specified object was not found.
    here is a picture of it.
    any help in this will be greatly apreaciated.
    Solved!
    Go to Solution.

    Another suggestion, the following VI is a wrapper for Traverse for GObjects VI and allows you to specify the name of the object you want. I always use this VI, I never use the Open VI Object Reference function, for the reasons tst mentioned:
    vi.lib\Utility\traverseref.llb\TRef Find Object By Label.vi
    Darren Nattinger, CLA
    LabVIEW Artisan and Nugget Penman

  • Can you use event case with labview real time?

    I have a real time application I am putting together and until recentally have concentrated on getting the data acquisition working as expected.
    I am using a PXI-8183 in a 1031 chassis.
    I am now trying to add the functionality for setting up the system in the form of a GUI remote front panel that I connect to with a host laptop.  I am connecting with the host as expected and it seems to be working well in that respect.
    My problem is with event cases, operating in a while loop on the target.  They just dont seem to want to trigger when i click on a button I have set an event for.
    I have looked through the documentation and cant see any reference to issues with event cases on rt, but I feel I am missing something fundamental.  Can anyone help?
    Regards,
    Barry

    look here maybe:
    http://digital.ni.com/public.nsf/allkb/42B70D2D0C4B568586256E2F0051441D
    Harold Timmis
    [email protected]
    Orlando,Fl
    *Kudos always welcome

  • Lock front panel until the event case for this event completes

    A Dynamic Event is a filtered event? Is this why "Lock front panel until the event case for this event completes" is not shown on Edit Event window dialog? I use Dynamic Event so I can subvi the event structure.
    I need stop my app from locking the FP whenever the user double clicks on the numerical array value (<-- the FP freezes the mouse and renders it useless) and stops the value from ever being changed. This event is registered for Value Change (not mouse up or down) and I get a locked mouse. As yet in the UI, no value changed occurs but I get a locked mouse. A LV bug?
    Trying to KISS, I can see this fixing this by moving ONLY the value change event to the top level VI instead of a dynamic registered event in a subVI. This will give me the option to NOT "Lock front panel until the event case for this event completes" .
    Solved!
    Go to Solution.

    richjoh wrote:
    Thx, Ben that fixed the problem when I unchecked "Lock panel...".
    So it appears LV locks the panel during runtime once the Dynamic Reg Events is on BD and it doesn't matter if your case to handle the Reg Events is created or NOT... interesting. That's why my mouse persisted to "freeze up" although I deleted the case for my FP array.
    Its situation like what you described that has given me many insights into how LV actually works. In one of my bbuggy VI's I found that a class wire can run a million miles through multiple sub-VI queues etc but the data itself is only touched when it has to be touched. in my case it was a crash while trying to write bogus class dat to a TDMS file.
    I am glad you are back on course.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • State machine with using event case

    Hallo everyone,
    i have a question about how to realize the "Timeout". In the flow diagram below we can see 2 different situation:
    1. in the 1st Situation i have used the state machine, it begins at state 1, which contains a event case. In there it will be at first determined, if the input value has changed within 10 second,  if it didn't, the state machine will go to state 2, if it 's  changed, will be furthermore determined, whether the input value equal to 3, if yes, the state mashine will jump to state 3, if no, jump back to state 1. (this VI i have done before, you can take a look at the Attachment).
    2. my question is in the 2nd situation. It begins also at state 1. In there the input value can also be changed (once or many times) or not. If the value has not been changed within 10 s, or even though it's been changed many times within 10s, but  it's never been equal to 3, the state machine will go to state 2; only when the input value within 10s equal to 3, it can jump to state 3.
    This problem i have no idea how to solve, does anybody have  idea or better methods?
    thanks a lot!!
    Solved!
    Go to Solution.
    Attachments:
    situation 1.vi ‏12 KB

    The statement in the OP is not covering all cases.
    mexaviesta wrote:
    2. my question is in the 2nd situation. It begins also at state 1. In there the input value can also be changed (once or many times) or not. If the value has not been changed within 10 s, or even though it's been changed many times within 10s, but  it's never been equal to 3, the state machine will go to state 2; only when the input value within 10s equal to 3, it can jump to state 3.
    This problem i have no idea how to solve, does anybody have  idea or better methods?
    thanks a lot!!
    Just check my implementation for Situation 2 and let us know, if it works for you.
    I am not allergic to Kudos, in fact I love Kudos.
     Make your LabVIEW experience more CONVENIENT.
    Attachments:
    Situation 2.llb ‏40 KB

  • User Event Case getting tied up for long duration in LV 2009 (with SP1)?

    Quick question here...is there any decent reason the user event case is getting tied up for long durations in LV 2009.SP1?  In 8.5 I never had an issue with my code doing this, though when converting to 2009.SP1 I am running into huge lock-up issues with the user event case.

    I have not seen aby issues...
    You are saying that the code from LV8.5 (unmodified) behaves differently in LV2009 SP1?
    Can you post your code?

  • Creating an Event Case on a Right-Click

    Hello All,
    Is it possible to set up an event case to occur on a right-click down when the cursor is over an image?  If so, please post details.
    Thanks!

    Yes, I think the event case for Mouse Down has a property (I think it is actually called the data node, but it is the drop down that appears on the left side of the event case) called Button which tells you which button was pressed.  Also, you can get the mouse coordinates from the event case data node and calculate whether or not the mouse was within the picture frame.  Hope this helps.  I don't have Labview, right now, so I can't create an example.

  • Getting Error : Exception sending context initialized event to listener

    I am using JWSDP1.2 and tomcat that's bundled with it.
    I am trying out a simple jsf appln very similar to the "Usernamebean" example.Each time i deploy my war file and try to access my webapp, i get the following error in tomcat's log. Driving me nuts !
    Jun 12, 2003 12:23:04 AM org.apache.catalina.core.StandardHostDeployer install
    INFO: Installing web application at context path /finaljsf from URL jar:file:/C:/jwsdp-1.2/webapps/finaljsf.war!/
    Jun 12, 2003 12:23:05 AM org.apache.catalina.core.StandardContext listenerStart
    SEVERE: Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigListener
    javax.faces.FacesException: javax.faces.application.ApplicationFactory
         at javax.faces.FactoryFinder.getImplementationName(FactoryFinder.java:400)
         at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:203)
         at com.sun.faces.config.ConfigParser.parseConfig(ConfigParser.java:91)
         at com.sun.faces.config.ConfigListener.contextInitialized(ConfigListener.java:127)
         at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3670)
         at org.apache.catalina.core.StandardContext.start(StandardContext.java:4106)
         at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:843)
         at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:827)
         at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:623)
         at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:315)
         at org.apache.catalina.core.StandardHost.install(StandardHost.java:837)
         at org.apache.catalina.manager.ManagerServlet.install(ManagerServlet.java:712)
         at org.apache.catalina.manager.HTMLManagerServlet.install(HTMLManagerServlet.java:306

    I was using an older version of tiles.jar. Hence the error. Started working after I moved to the latest version of struts.jar

Maybe you are looking for

  • S_ALR_87012078 - Due Date Analysis for Open Items display changers

    Hi I need to change this reports( S_ALR_87012078 - Due Date Analysis for Open Items ) display type to column display. How can I do that. I thought of uesing GoTO> Colum display but it is inposible 'cos always they are in inactive mode even in the cha

  • Acrobat 8 standard version --- help please

    I have a full version of Acrobat 8 standard.  It was working properly.  I had to uninstall it and reinstall it and now it will not convert a web page or a word doc or any document to a pdf file.  It will let me view a document in adobe and separate i

  • How to maintain change history for a custom field

    Hi All, I have added a new custom field in standard table FKKVKP by appending a new structure to FKKVKP. Now this custom field will appear in transaction CAA2. My requirement is I have to maintain change history for my custom field. In transaction SC

  • Can't get optical input to w

    I have my XBox hooked up through my Audigy 2 Platinum Pro, and I was wanting to route the sound signal to my speaker system. I have the optical cord plugged into the Xbox output and into the Platinum Pro input, I have set the XBox up through the bios

  • Diagram in a file?

    Hi, please tell me, is there any way to save or read created diagram in JDeveloper without cut and paste method? (screenshots) I want to put some of these in - for example - MS Word, or open such a diagram without using JDeveloper (for example on oth