Calling an event structure via a LED?

Can I call a case in an eventstructure via the value change of a LED?
The reason for this is the following:
In my VI is a xy graph and the update of the dispaly and the x-scale takes a lot of time, so I would like to do the update outside of my main-loop to avoid that other processes get delayed. The attached VI is just an example.
(In my real VI, I have a consumer and producer loop and lots of data processing, so in that case the disply update should not interrupt the data processing.)
I tried to put the x-scale update in the event structure and call the event structure via the change of a boolean value, but that does not work. The event is not recognised and the x-scale does not change.
Johannes
LabVIEW 7.1
Message Edited by johanneshoer on 11-11-2009 08:20 AM
Greetings Johannes
Using LabVIEW 7.1 and 2009 recently
Attachments:
Chart Test 16.vi ‏146 KB

johanneshoer wrote:
I don't understand. What do you mean by "resize index array"?
Here's one example. Your code is on the left and uses two "index array" nodes. All you need is one, configured for two outputs.
Also, of you want consecutive indices, starting at zero, you don't need to wire the index inputs.
An alternative is shown on the right.
Message Edited by altenbach on 11-11-2009 12:06 PM
LabVIEW Champion . Do more with less code and in less time .
Attachments:
resizeindex.png ‏7 KB

Similar Messages

  • Event Structure - Lock Event: Does it Queue ?

    I had couple of question related to this post in other posts but I thought I'd use a new one since it might be more relevant (others were related to local variables, and VI file sizes)
    I have this event structure running about 10 different tasks. For some I would like to lock the panel when it runs. I used "Lock panel ..." but during the run, if you click on any boolean and menu ... for some reason it queues the task and performs it after the event is complete ... is there any way I can lock the event and not have any event queued ? Thnks !
    Kudos always welcome for helpful posts

    If you were to change the value of the Block Panel Event boolean using a local variable it wouldn't fire an event so I'm not sure that would be the way to go.  I had intended that just to be an example control.
    I have further modified the example to show how a custom user event can be programatically fired to signal that the front panel should be "unlocked" and that new events should be added to the event queue.  In the new example you will see that while the LED is flashing no events are queued.  Once the LED is done flashing it communicates to the event structure via a user event.
    It may also be possible to change the value of the "locked?" boolean without requiring an event to do so.  I didn't explore this option but it may be a valid approach.
    Also please remember that any example I have posted here is not meant to be incorporated into an application - I am merely attempting to demonstrate ideas and concepts.  It will be more beneficial for you to examine and understand how I programmed a certain behavior and then use those concepts to create your own application than to try to make my code fit into your application.
    Regards,
    ~ Simon
    Attachments:
    lock event 2-1.vi ‏75 KB

  • Slow execution of a event structure(​Calling VI)

    The VI i created is gettin slow after execution of a particular set of event in an event structure(Calling VI).Is it because of improper use of shift register?
    I have attatched the VIs...Please run GUIdev and suggest solutions.Its really gettin on my nerves.
    Attachments:
    GUIFDR.zip ‏88 KB

    Hi altenbach
    Thanks for finding ways to optimize the code...but i have a few doubts.
    CPU burner:I took care of the cpu burner condition.I jst called those for trying out t main VI.I will be replacing those VI with developed ones.
        * Why are you bundling and then immediately unbundling all these pictures?
         Ans:chgd it
        * You have many overlapping objects on the front panel. Not good for performance.
         Ans:I am making a GUI so i thk i have no other choice but to overlap them.Also is there ny way to remove the frame from the picture box.I have just minimized and kept it.
        * Use an array of paths and index the desired element instead of reading via value property nodes.
         Ans: Can u site an eg for it..i dnt hav tht level of experience
        * There is no event for the stop button.
           Ans:Is it necessary?I will be modifying it in the future.
        * You don't need the timeout event.
           Ans: Modified it
        * Lots of near duplicate event cases. Once instance of each is enough, simply use control references.
           Ans:Each event case is either for moving out,moving in or clicking of the sliding button.How do i use a control referece for it?
        * Lots of duplicate code for the pictures and paths. Use an array of names, autoindex it on a FOR loop, and use only one copy of the code fragment.
          Anslease site an example so i can follow suite.
        * You seem to insert a VI at every iteration of the loop. Is this really necessary?
         Ans:Actually i wanted to insert a Vi only on the mouse down event, and continue running the same VI even if other mouse events take place.But i cant thk of a logic to avoid thm.But i really need a solution for tht.
    Can you explain in a bit more detail what you are actually trying to achieve with all this? Thanks! :
    My Vi as u can see is a GUI for downloading data from a hard disk and viewing and modifying the video and audio data.I will be interfacing the video and audio part later on as it is still being developed by my frnds.
    Also the problem of inserting a VI at every iteration is goig to pose a problem in the future as i want  to load each VI only for mouse clicks and let it run for all other instances.
    Please help me out
    regards
    Sankar

  • Calling a VI in a subpanel with parameters inside an event structure and using an abort button

    Hi all,
    I have a control panel with a tab control and two tabs have a sub panel in them.  At runtime I load the VIs I want in to the sub panels.  In the control panel event structure I want to start each of the VIs and monitor the execution state so I can abort the VI while it is running.  One method I use can run the VI and the abort event will work (see example).  The second method I use does not and this is what I want to do!  I have many inputs to the VI I want to pass so placing the VI in the event blocks everything else and it has to wait until the VI has completed, so I cannot monitor the execution state.
    I have attached an example of what I want to do.
    Any help appreciated.
    Martin
    Solved!
    Go to Solution.
    Attachments:
    SubPanel.lvlib ‏2 KB

    Hello,
    You can do this with queues. 
    The main vi and subpanel vi's should be based on the producer/consumer (events) and you handle the front panel events accordingly in the respective vi's. 
    Name the queues in obtain queue , for example the Main being MainQ, subpanels SubPanel1Q, SubPanel2Q. When you start the application, initialise the main vi and also run both of the subpanels (just to make sure that the queues are first obtained by themselves). Then you can use obtain queues to do inter vi communication.
    For example if you need to send data from main to subpanel1, use obtain queue and use the name SubPanel1Q, pass the required data & command and voila. Subpanel1 vi will receive your message. You can do this anyway you want. Hope this helps.
    Beginner? Try LabVIEW Basics
    Sharing bits of code? Try Snippets or LAVA Code Capture Tool
    Have you tried Quick Drop?, Visit QD Community.

  • Calling Previous Event(s) in the Event Structure

    I have a an event structure with 5 events doing different function. I want to create another event which would run 3 of the previous events with one click. Can anyone help me do that?

    If you did go the route of a parallel State Machine to the Event Structure (loop), then you should consider using an Action Engine that keeps track of the current state and the past history.  The Action Engine may have enough intelligence to determine if it is appropriate to roll back and how far..
    As Andre mentionned, you do have to make sure the software is well designed in order to avoid any deadlock conditions.
    RayR

  • How to implement boolean comparison and event structure?

    Hello all,
    I'm currently developing an undergraduate lab in which a laptop sends out a voltage via USB-6008 to a circuit board with an op-amp, the voltage is amplified, and then sent back into the laptop. The student is going to have to determine an "unknown" voltage which will run in the background (they can do this by a step test, graph V_in vs V_out and extrapolate to the x-axis).
    Currently, I have two loops that are independent in my VI. The first loop is used to "Set the zero." When 0 voltage (V_in) is sent out of the laptop it returns a value around -1.40V (V_out) typically. Thus, I created the first loop to average this value. The second loop, averages the V_out values that come into the laptop as the V_in numeric control changes. Then I take the "set zero" value from the first loop and subtract it from the second loop average to get as close to 0V for V_out when V_in is 0V.
    The problem I'm facing is, the event structure waits for the V_in numeric control value change, but after "SET ZERO" is pressed, if there is an unknown value, it will not be added to the average for V_out until V_in is changed by the user. So, I tried implementing a comparison algorithm in the "[0] Timeout Case." This algorithm works for step tests with positive values for V_in, but there are two problems.
    1) Negative values cannot be used for V_in
    2) If a user uses increasing positive values for V_in there is no trouble, but if they try to go back to 0, the value change event has been called and it is added to V_out as well as the timeout case.
    Sorry for the extremely long post, but I've been banging my head over this and can't figure out how to properly implement this. I'm using LabVIEW 8.0.
    Attachments:
    Average Reset Test.vi ‏371 KB

    OK you have bigger problems than Raven's Fan is pointing out.
    When the first event loop stops ( after pressing "") (the boolean text is "Set Zero")  The second loop may start- (AND PROCESSES all of the events it was registered to process before the loop started!)  that would enclude the value change event from "" (The boolean text is Stop) Being pressed bebore the loop started.  Of course, since the labels of "Set Zero" and Stop are identical nulls....................................................BOTH event trigger at the same time and are processed as soon as the event loop they are registerd to is available.
    Get it ... The two buttons labeled "" both queue Value change events to both loops registered to act on the value change of the control labled ""!
    Both loops will do what you programmed in the case of "" Value Change!  This can, (as you have observered) lead to confusing code actions.
    Do avoid controls with duplicate labels (There is a VI Analizer test for that!)  Do avoid multiple event structures in the same hierarchy. 
    DO NOT bring this to your studients to help you learn LabVIEW!  We get enough studii asking embarassing questions
    VI Analizer will help you provide sound templates.  If you need help with that hit my sig line- e-mail me and I'll always be willing to help.
    Jeff

  • How to trigger value change in event structure

    Hii everyone, as the title, how should I trigger the value change event to pop up a message.. below is my connection..
    I want to trigger the event structure to pop up the sub-vi, when the flame and led are TRUE state... I using property node but still the event structure not able to execute.. How should I connect? Thank you very much...
    Solved!
    Go to Solution.

    There are several ways you can do it. First you have to configure your sub-vi so that it does whatever you want when it runs  (in the vi properties, top most window for example) and to make sure that it closes completely when finished (when clicking the "OK" button for example).
    You than need to make an asynchronous call to the sub-vi. There are several ways to do it. My favorite one is shown below. You go in the "Application control" sub-palette and select Static VI reference. I like this approach because it keeps track of the sub-vi path for you, as long as the sub-vi is in the same project. You then drag the sub-vi onto the empty square that will changes to your sub-vi icon. You then connect to an invoke node from the same sub-palette and select run VI. Set "Wait Until Done" to false and the main VI will keep running after starting the Sub vi. Set "Auto Dispose Ref" is the easiest way to go. Otherwise you have to keep track of the sub-vi reference and close it yourself when you're done.
    Marc Dubois
    HaroTek LLC
    www.harotek.com

  • Daqmx "Done" event not triggering event structure

    I would like the user to be able to abort my daqmx task by pressing a button.
    I am attempting to use the method in this VI:
    https://decibel.ni.com/content/docs/DOC-15815
    It utilizes an event structure with the daqmx Control Task VI to abort.
    The example VI above works for me, on my system with my USB-6356 device, as expected.
    When I attempt to incorporate the same method into my VI it does not--despite having an identical arrangement, so far as I can tell.
    I believe that my problem lies with the event structure, and the dynamic registration.  I am unfamiliar with this and must be using it incorrectly.
    I have attached my VI, though it is cumbersome.  The code which I am struggling with is in the "Acquire" case.  As far as I can tell, I am doing exactly the same this in this particular case as in the example mentioned.  Yet in the example, the event structure completes, or aborts, whatever you want to call it, right after the "Wait Until Done" VI executes.  In my own VI, the "Wait Until Done" and "Clear Task" VIs execute, but the event structure does not register it.
    Here are my specific questions: is there anything extra or special that one must do in order for the Task to properly trigger a "Done" event and pass through the event structure?  At what point is the daqmx task "Done"? 
    thanks,
    Matt
    Attachments:
    BoomTubeMain.vi ‏175 KB

    natasftw,
    My event structure is identical to theirs; what you are seeing are the two different cases that exist in the event structure.  In both the example and the VI, there is a <task out>: Done and a "Dynamic Event": Value Change.  In the dynamic event case, I have my abort button and relevant code--this I believe is the code you were referring to, which you thought I was missing...  Regarding my multiple event structures, they should operate completely independently as they respond to different events.

  • Event structure in Sub VI

    Hello ,
     I have a developed a program which captures video and user can save images out of it. I have used .NET reference to handle the video part, and the VI is attached in this post. Now i have to make this VI as a sub VI and running this from Main VI. I tried creating event structure in Main VI which i used in sub VI , still i could not suceed. Kindly assist me in this regard
    Solved!
    Go to Solution.
    Attachments:
    Webcam-Control-Projekt-mit-Reference-Design-2013_original.zip ‏286 KB

    Hello Michael,
     I have attached a model in which Main VI calls the Sub VI using Event Structure. Two events can occur in Main VI and their corresponding event Structure is called in Sub VI using Register events. When i run this VI the out put is fine some times but other times i need to trigger event many times before i can see its effect in Sub VI, my doubt is that Register events are reliable, whenever (during the execution of LV) if event occurs will surely its code in the sub Vi gets executed?
    also I have put a indictor(numeric) in the SUb VI which i connect back to Main VI, when i run, i can see the result only in the sub VI not in the main VI.how to see in Main VI?
    I have used the this model (which is attached ) to implement my project(which i already mentioned) . one switch for starting the video and other for recording the image. The video is getting started with out any trouble, but imgae is recorded only few times when i press the button which is for image recording, most of the time second event fails to get executed. Also there are difference in output when i run with and without "Highlight execution", why this happens, is this because of Reg events?
     any more info if required let me know, i will provide.
    Attachments:
    Main_sub_VI.zip ‏18 KB

  • How can i use the same front panel graph in more than one events in an event structure?

    i want to display the signals from my sensorDAQ in a graph.but i have more than one event in the event structure to acquire the signal and display it in the graph.the first event is to acquire the threshold signals and its displayed in the graph as a feedback.after the first event is executed, i will call the second event,where the further signals are acuired and compared with the threshold signals from the event 1.my question is how can i use the same front panel control in more than two events in the event structure?please answer me i'm stuck.
    Solved!
    Go to Solution.

    Hi,
    I have attached here an example of doing the same using shift registers and local variables. Take a look. Shift register is always a better option than local variables.
    Regards,
    Nitzz
    (Give kudos to good answers, Mark it as a solution if your problem is Solved) 
    Attachments:
    Graph and shift registers.vi ‏12 KB
    graph and local variables.vi ‏12 KB

  • How to use a event structure with a state machine

    First, I would like to inform you that I only work on LabView part time, and have much to learn.  Anything I do learn, I usually forget until I need it again, because I only work on it part time.
    Using your StopWhileLoopMOD[1].vi, I am trying to put a state machine inside the event structure.  
    Related link: http://forums.ni.com/t5/LabVIEW/How-to-stop-while-loop-in-Event-case/td-p/465564/page/2
    Here is my application:  on the front panel, the user can select any combination of 7 different tests.  I have created cases to perform each step of each test in the correct order, but if the user presses stop, the tests won't stop because some of the cases have a while loop inside the event structure (like you mentioned is a bad idea).  The user should be able to stop the test, reselect tests to perform, and re-start the tests. 
    When the start button is pressed for the event structure, I need all the cases to run in the proper order, unless stop is pressed.
    In the past I have indexed an array and used that to run the state machine, but it won't stop immediately.  
    I have sub VIs that are built in while loops because the outputs of the product needs time to stabilize.  The state machine stops and waits up to a certain number of iterations.  If it passes the test, the while loop stops and the next state starts.  If it takes too long, it exits and reports an error.  Maybe I need to just use the state machine and not an event structure?
    Is there a good example of an event structure?
    metzler CLAD
    Solved!
    Go to Solution.

    I'm not sure exactly what you are asking, but it sounds like you want to script a bunch of tests and if the user says stop, to immediately stop the current test and abandon the others?  I'm going to assume that you know how to clear the array so that it will abandon the others, so I'm guessing that you are having trouble abandoning the current test?  If this is indeed the case, then the problem is that you are not able to propagate the message from the main VI FP which is the GUI to the sub vi which is the test, where the test may or may not have a GUI (FP visible) of it's own.  Threading was the first thing to come to mind, but this may not be necessary using events.
    You can do this by passing a refnum of the stop button to the subVI, where you can then add that wait to the event case structure.
    I've attached 2 VIs, mainvi.vi which is just a loop displays the count*2 (number of seconds passed since running) that will call subvi.vi and then check to see if the stop button is pressed.  mainvi.vi is by no means a state engine, it is just a simple loop for demonstration purposes.  subvi.vi just waits 2 seconds and leaves, it is a better structured state engine with an init state to start a poll case to wait for events and an exit state to clean up.  You can modify this any way you wish to get it to do what you want.  You will note that even if subvi.vi is being executed, it will terminate immediately when the stop button is pressed.
    Hope this helps.
    A
    Attachments:
    mainvi.vi ‏17 KB
    subvi.vi ‏33 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

  • Can I get the event structure to NOT queue events?

    I was wondering if it is possible to have the event structure not queue events that happen while the vi is executing code associated with another event. Basically, I have a toggle switch that, when "on", captures a live feed from a camera and displays it to the screen. This is done in a while loop that executes until the toggle switch is turned off. At this point, that event is done and the vi returns to the uppermost level of the event structure and resumes looking for events. The trouble is that the whole while the video capture was happening, the event structure was queueing events that were occuring during that time when the user was hitting other front panel buttons that had their own event associated with th
    em and would not execute at that time. When the video capture toggle is turned off the event structure then executes any other events that were queued during that time and I don't want it to. I can't lock the front panel while the video capture is happening so the user can't push buttons because they have to be able to push the button to turn the video capture off. Any suggestions? Thanks in advance.

    > I was wondering if it is possible to have the event structure not
    > queue events that happen while the vi is executing code associated
    > with another event. Basically, I have a toggle switch that, when
    > "on", captures a live feed from a camera and displays it to the
    > screen.
    I think there are lots of other articles about this on devzone.
    To summarize them, the key is that the event structure intentionally
    synchronizes events with diagram execution. The typical way to do what
    you want is to have the event start up another loop or subVI running
    asynchronously.
    Usually there ends up being one loop with an event structure in it.
    Another loop that executes a statemachine, possibly as simple as just
    two states of acquiring and not. Use the events to pr
    od the other loop
    between states via locals, globals, occurrences, etc.
    Greg McKaskle

  • How do I access indicators in other windows of an event structure?

    Let's say I have an indicator in 'case 1' called ON/OFF.   How do I get the status or value of ON/OFF if I'm in case 2?
    or - if this seems like a ridiculous question, am I missing some sort of important concept about how event structures work?
    thanks
    -z

    Local variables are certainly an option.  Property nodes are another, but both of which are probably the least recommended around here.
    You can use shift registers, but then you have to be careful about where you update your indicator.  Unless you've got a ton of these that need updating, that's the way I'd go.
    Place your indicators outside the event structure and then just make sure you wire everything through every case (otherwise you'll end up with the default value of your indicator's type).  See the image...  I think it's more clear than my words can be.
    Message Edited by Will.D on 10-31-2006 04:16 PM
    Attachments:
    Update.jpg ‏18 KB

  • Load defaults from file with event structure in vi

    Hi All,
    I've been trying to figure out how to do this but have not quite got there. Taken a look at lots of posts but can't quite find the answer to the question that i've got.
    I've got a vi for controling 4 PCI cards making calls to some DLL's. I've got quite a number of controls on the FP and i use an event structure to update the values on calls to the DLL. On startup, one of the first calls that i make is initalise and that sets the cards up. I then want to load my own set of default values from a file to initalise the cards to my particular set up. While the software is running the user may change the values and wish to save a file with the new default values, or he may wish to load a different file of default values (depending on the test that he is running). I've got the Control Values:Get All [variant] and the Control Valueset [Variant] working to save all the controls values to a file and read that file in and set all the controls values. So far so good. Problem is i'm using an Event Stucture and it doesn't register that the values have changed. I could complish this by using Value(signaling) but the data from the Control Values:Get All is variant data and the Value(signaling) needs the same data type as the control. What do i do?
    One thing i have thought about is to write all the values from the file to all the conrols and then have a read Value and a write Value (signaling) to trigger the events. Problem is i don't want to set this up for every control (it'll take me ages). Can i do it programitically? Is there a better way to do it?
    Thanks,
    Phil

    You could create a boolean control/indicator and signal that value when you've updated the values on the FP.
    Name it something like "update FP". The event case for that boolean will have the code to update the necessary parts of the FP.
    André
    Regards,
    André
    Using whatever version of LV the customer requires. (LV5.1-LV2012) (www.carya.nl)

Maybe you are looking for

  • Mac Pro 2009 Click noise

    Hello, I recently purchased a 2009 Mac Pro (refurbished) 8-core machine And I have noticed a clicking noise (only one click) when I start up, shut down, sleep and wake the computer At first I thought it may have been the hard drive (knowing it was th

  • How do you know what type of file is included in the 'Other' section?

    This is in regards to the capacity section in the summary tab of my ipod info. I have reached full capacity and cannot add any more songs to my ipod so would like to delete any unnecessary files. I have deleted all photos, most movies and TV shows. O

  • No optical audio out

    I have looked at almost all of the discussions and have tried almost everything to get audio out from 3g ATV. I tried 3 different cables. Upgraded to 6 and restored on itTunes. Turned off Dolby. I am using a digital converter (not a decoder). It work

  • Illegal start of expression error

    Hi, I keep getting an illegal start of expression error at the first parentheses of the main method, and I can't find the reason why. Any hints? import java.util.*; import java.io.*; import java.text.*; public class driver     public static void main

  • BI  with HANA

    Hi , We are planning to upgrade BI 7.0 to 7.3 and implement SAP HANA database for BI systyem . Could you please let me know the step by step procedure of below tasks. 1. BI upgrade 7.0 to 7.3 2. what is the prerequisite for SAP HANA implementation fo