Event structure doesn't register local vars

I have a gif of a basic FPGA topology that I want to show some loopbacks in.  As the user clicks on the booleans, vertical lines should appear, then disappear as they click them again, showing the current loopback topology.
To conserve resources, I opted to use an event structure.  So far I have set it up for the RX_FAC and RX_TERMXCO4AU loopbacks that you see in the upper left of the picture.
Only one RX loopback and one TX loopback can be on at a time, so one of the first things that happens when the user clicks the boolean is that it sets the values of all the other booleans in that row to false, via the use of local variables.
The problem is - the event structure only executes when the user actually clicks the boolean true or false, but not if the boolean is set false via the use of a local var.  In other words, let's say I have RX_TERMXCO4AU true, and RX_FAC false.  If I click RX_FAC to set it true, then you'll notice RX_TERMXCO4AU goes dark/false, and RX_FAC lights up.  So the value of RX_TERMXCO4AU changed, but the event structure associated with RX_TERMXCO4AU did not execute (which is why the vertical line between RX_TERMXCO4AU and TX_FACXCO4AU stays there).
This will make a lot more sense if you run the attached simple VI.  Right now, events only exist for RX_FAC and RX_TERMXCO4AU, but it's sufficient to explain the problem I think.
Any help is appreciated.
Solved!
Go to Solution.
Attachments:
loopbacks.vi ‏55 KB

bmishoe wrote:
I learned something new today...
One more thing you can learn, When you are passing an array input to a For loop with 'Auto indexing' enabled, you need not wire anything to For loop's 'N' terminal.
In other words:
If you enable auto-indexing on an array wired to a For Loop, LabVIEW sets the count terminal so you do not need to wire the count terminal. 
In your code, you can remove the 'Array Size' nodes.
I am not allergic to Kudos, in fact I love Kudos.
 Make your LabVIEW experience more CONVENIENT.

Similar Messages

  • Find Control in Event Structure doesn't show the object when it is not in the frontmost Tab page [Bug Report, LabVIEW 2012]

    When you are looking for the control/indicator handled by a case in the Event structure, you can use the contextual menu item "Find Control" (doesn't distinguish between control and indicator, BTW).
    The result is that the control/indicator is highlighted on the FP. The problem is, if that control is in a Tab and specifically in a page of that Tab that happens to not be the frontmost, the only thing you'll see is marching ants, but no control:
    <=========== the wrong TAB page was shown. LV did not bother to switch to the relevant one....
    In other words, "Find Control" in the Event Structure doesn't switch the tab to the owning page. This is contrary to what happens if you right-click, say, the terminal of this control: the FP will switch to the owning Tab page.
    I'd call this a bug and this is definitely an annoyance (which most likely has been around since the creation of the Event Structure).

    I did not. Is there any better chance for it to be caught there by a NI eye than it is in the LV forum? I though these threads were deemed to gather bugs/features that had been already acknowledged by NI with a CAR number.
    I (and others!) wished there was something like this: http://bugs.sun.com/ or http://bugs.python.org/ for LabVIEW...
    I am just coming back from a short conference of scientists who quite uninamously ended up with the conclusion that LabVIEW was to be disregarded as a lab development environment because of maintenance problems (which could have been argued for any language in my opinion, although I think they meant spaghetti diagrams are the natural tendency of students who could not care less as they are not going graduate because of their LV skills or lack thereof), but I guess I could have added my grain of salt and added the complete opacity on bug and feature handling by NI.

  • Event structure doesn't handle all events from external DLL source

    Hi!
    I use a DLL, wich handles an USB CAN transceiver device, and generates LabVIEW user events with extcode.h and PostLVUserEvent() function.
    In my vi I use an event case structure to handle theese external events. The problem is, that if the events come too frequently, then it cannot handle all events.
    The vi contains a couple of parallel while loops which process the incoming data from the external event.
    In another application I use the same architecture, and that works fine. This one is more complex.
    Do you think I have reached the limits of the program? Or what else can be the problem?
    I have tried to use a queue in the  event structure, it helped a little, but yet, not all the events are handled. My external DLL sends all event, so the problem is not there.
    Thanks in advance!

    Hi Wasz,
    Thanks for the post and I hope your well.
    It is not possible for the event structure to miss events - it simply queues them up. To keep the event structure 'in time' with the code you must ensure the code to execute in each event is minimal to allow the event structure to handle the next event. 
    Please see this two links:
    event structure buffering: leading to,
    How to avoid built-up for "cursor move" events? : where somone is trying to avoid handling all events.
    What sort of events are not being handled? Could it be an issue your events are not configured correctly? Maybe if you could produce a small example in LabVIEW code, so we can just test the event structure configuration... someone working around the external dll call - which you seem sure is working correctly.  
    In terms of queuing to process the events in other loops is certainly an option to speed up the event structure. To do this, use a produce/consumer design pattern.
    hope this helps,
    Kind Regards
    James Hillman
    Applications Engineer 2008 to 2009 National Instruments UK & Ireland
    Loughborough University UK - 2006 to 2011
    Remember Kudos those who help!

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

    Hello all,
    Im using the following code trying to obtain voltages and then use the peak voltage to trigger an event. My event structure doesn't seem to be working properly and I'm not sure what I need to do.
    Take a look, and any help would be great!
    Attachments:
    Untitled 5.vi ‏43 KB

    hey,
    there are a couple of things wrong with your layout, other than the Event Structure isn't being called. What you have here doesn't do a lot and that is the beauty of LabVIEW: you can do the same thing in many different ways.
    Following the Event Structure design you are intending to go with I have attached a redesign of your code, including comments. I believe this should work for you now. I have followed the common State Machine approach, which quite nicely, uses the Event Structure - when in a 'stable' or non-working state.
    The main aspect you need to consider is how the Event Structure is called. It needs an interrupt in order to identify a state that it needs to address. In this case here, to increment a counter each time the peak voltage is detected.
    The Enumerated data type (the value that holds the state of the State Diagram) can be added to or changed. Normally you should 'Customize...' the data type (right click) and create a Type Def variable (ensures all changes are provided throughout the code, where it is used).
    There is more you can do with this structure, it is quite useful and powerful. There are quite a few examples online or within the LabVIEW help function to give you more. In regards to the DAQmx, there is a State Machine project already set up for you - with all type-defs and some events already created for you. After you've mastered this you should go along and check that out more.
    All the best. David.
    Attachments:
    Untitled 5.vi ‏25 KB

  • Multiple Event Structures - LV8.0

    So why does this program hang?  I know that it is best to use one event structre but why?  It seems for a simple application that this should work.
    Matt
    Matthew Fitzsimons
    Certified LabVIEW Architect
    LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison
    Attachments:
    multipleEventDiagams.vi ‏15 KB

    That certainly explains the hanging you saw. Remember that Event Structures by default will lock the front panel until the event case for a given event occurs. So in your VI, if you press Button 2 once, then you terminate the bottom loop. But the event structure is STILL registered for the Button 2 event. So when you press Button 2 again, the front panel gets locked, because the bottom event structure will never get to execute again (its loop has been terminated).
    You could have fixed this (I realize it all boiled down to a mis-wired connection) by unchecking the check box in the Edit Events dialog for your Button 2 Value Change event case that says "Lock Front panel until...".
    Hope this explains this, even though you've solved it!
    Jarrod S.
    National Instruments

  • Event structure does not capture mouse click event on toolbar activeX control

    Hi
    We have a toolbar activeX control on FP.  It works perfectly on my computer, but on my coworkers deskyop,  somehow the event structure doesn't capture mouse click event.
    Any idea?  Thanks a lot for any help.
    Anne

    It's a standard activeX control.  I attach a simple vi .
    thanks  for any help.
    Attachments:
    toolbar test.vi ‏41 KB

  • Event structure in RT project

    Hello.
    In my main VI i have an event structure for few buttons. When I run the VI itself it works perfect.
    When I open a new project, adding cRIO 9074 as a target, then adding the VI to the project the buttons doesn't respond. The event structure doesn't work.
    Why? Is there any problem using event structure with RT targets?
    Thanks 

    Tacchi,
    Front panel events do not work on RT targets.  Only dynamic events are allowed on RT.  The reason for this is that when a VI is running on RT, its front panel doesn't actually exist.  See this KnowledgeBase for more info:
    http://digital.ni.com/public.nsf/allkb/42B70D2D0C4B568586256E2F0051441D
    Chris M 

  • Simulate event structure in LabVIEW base?

    I have a LabVIEW base version (v8.6) which does not have the event structure. I found it was quite inconvenient to monitor the status of several controls (the action after click a control depends on the status of other control(s)). Especially if I want to add another function (control), the effort increase exponentially with the existing number of controls
    I got an idea of simulate the event structure using 'Shift Register'. First, I will bundle all the values of controls into a cluster. Then I will put the cluster in a while loop, and compare the value of the cluster with its previous value (xor the shift register). If the compare result is false (none of the control is changed), the program goes to next iteration. If the XOR result is true (one of the control was changed), then the program goes into event handling code (it will pass which control has changed, and the whole cluster). So for each control change, we can write a independent code to process the event. After processed the event, the event was cleared.
    The following is a section of my ugly code currently used to monitor several controls. And I am thinking of rewrite it using above idea so that there will be less likely a hiden bug.
    Any comments of suggestions?
    Message Edited by RyanWu on 10-23-2009 10:16 AM
    Solved!
    Go to Solution.
    Attachments:
    UglyLabVIEWCode.png ‏18 KB

    Ben wrote:
    Altough this is an interseting academic question, we really can't duplicate the efficiency of the Event structure so springing for an upgrade is highly recomeneded.
    But I am not here to sell LV but rather help LV developers so...
    Start by developing an Action Engine with the following actions.
    1) Init -caches control ref for all controls and indicators for which you need an event. Optionally rest them and cache their state.
    2) Check - Will compare the current state with the prvious state and any changes get pushed onto a stack in the AE and if there are elements in the stack (due a change detected now or one left over form the last check) and returns a type-def'd enum describing what changed. Multiple changes should be on the stack for next time.
    3) Get New - will return the new value of the value requested via an Enum.
    In you top level VI use the AE to Init before you run and then use an "Check" method to se if anything changed. If it flags a change (boolean output of AE) then the Enum is used to select the proper case of a case structure. Inside the psuedo-Event case, you can use teh AE with the "Get New" action and pass the enum to choose which value to get.
    It is hardly an Event Structure but it should come close.
    Ben
    But after looking at Knickerbocker's* post we can go farther.
    Put the above code in a sub-VI that feeds a queue. Then you can monitor the queue for updates just like in an event structure AN you can queue up all of the changes at once and can ingore my mention of caching the change methods in the AE. Just let the queue handle the stack.
    Ben
    *Kudos for inspiration!
    Message Edited by Ben on 10-23-2009 10:54 AM
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Local variable event structure

    Hi,
    I am using an array control and event structure for detecting changes in the array value.
    At first,I have performed changes in the array(during runtime) and the event structure detected it.
    The next step was adding a parallel while loop in which I am writing to the control array(using local variable).
    During the runtime the layout of the array indeed changed,but the event structure didn't detect it.
    I have attached 2 figures :1)The loop of the event structure 2)the parallel loop.
    Is it possible working in such way?
    How can I make the event structure detect changes the software performed in the control array?
    Thanks,
    Leonid
    Solved!
    Go to Solution.
    Attachments:
    event.PNG ‏43 KB
    update.PNG ‏34 KB

    This is a long discussion about "red flags"
    Norbert
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • Using an event structure to register many actions

    Hi there,
    I'm making a simple game;
    4 player game.
    Each player gets a led that flashes at random and a button to hit when the LED is on. But it is only on for 500 milliseconds.
    I’m having troubles with it. i think i need a case structure in the 3rd case of the main case structure?
    at the moment points are awarded if the button matches the LED. i.e. both on or both off.
    Any help is appreciated
    Attachments:
    buttonbash v1.vi ‏17 KB

    First, let's clean up some of the Rube Goldberg code.
    (You don't need a case structure to output a True or False boolean.  Just use the condition.)
    As for your code, I don't know where to help.  You talk about an event structure, but there aren't any in your code.
    Attachments:
    buttonbashV1.vi ‏12 KB

  • How to register an event for LV event structure from WinApi "PostMessage"?

    Hello experts,
    I'm using a standard cardreader (RS232/USB) which I access via the manufacturer's API, this works fine so far. However I don't want to poll the status of the reader all the time. The cardreader sends windows messages using the WIN API "PostMessage" as soon as there is a status change (insert card into reader, reader disconnect etc.)
    Now how can I use this fact to get an event for my event structure? Any ideas?
    Thank you
    Melanie

    hello Melanie,
    This may be tricky but you could use the Windows Message Queue Library example to get the messages from the USB drivers;
    http://sine.ni.com/apps/we/niepd_web_display.DISPLAY_EPD4?p_guid=B45EACE3E7AC56A4E034080020E74861&p_node=DZ52071&p_submitted=N&p_rank=&p_answer=&p_source=External
    And from then create a custom user event based on the POSTMESSAGES received;
    http://sine.ni.com/apps/we/niepd_web_display.DISPLAY_EPD4?p_guid=B45EACE3E7AC56A4E034080020E74861&p_node=DZ52071&p_submitted=N&p_rank=&p_answer=&p_source=External
    Hope this helps,
    Cyril Bouton
    Active LabVIEW Developper

  • Trigger Event Structure in SubVI

    Here's my goal.  I have a VI that sets two analog outputs which in turn control a power supply.  One output controls voltage while the other controls Current Limit.  I created a VI which uses an event structure so that when the voltage or current limit is changed, the analog outputs are adjusted accordingly. 
    Now, I'd like to turn that into a SubVI and have it running in the background while my main VI runs.  I'd like to be able to go into the subVI and change those values at certain locations within the main VI.  I tried just using the subVI with register events, but it hangs because it is waiting for the subVI to finish before continuing.  I tried using the Run VI methond with "wait until done" set to false, but then I don't see how to trigger my events because I can't link my mainVI to the events that need to be triggered.  I can set the control using Control Value Set, but that doesn't do anything for my event structure and thus stuck again. 
    Maybe the event structure isn't the best way to do what I'm seeking.  But I don't want to set all this up in my Main VI because it just adds too much complications and I already have the VI working by itself and just want to turn it into a subVI.
    Thanks.

    You could either get a reference to the SubVI and find the specific control like the attached picture, or you could pull the SubVI out of the main loop.  If the SubVI is necessary for data flow, you are almost certainly going to have a hang up if you don't call it by reference.
    edit - Another, probably less popular, option would be to have the subvi running in a parallel loop and have locals take data from the control loop and write to the command loop.  You'd have to be careful to only have one local writer, though.
    Message Edited by JeffOverton on 01-30-2008 02:39 PM
    =============
    XP SP2, LV 8.2
    CLAD

  • Can you share FP Controls between different Event Structures

    I'm creating a program that will either read real-time data from an VNA on the GPIB bus, or read a saved s2p (Agilent) file and analyze it. The FP consists of 5 graphs, and various controls which handle events like printing, changing filters, or exiting. on the BD I have a case structure controlled by an operator selection pop-up. I tried using the same FP controls in the event structures I have setup in each case, as only one event structure would ever be executing at any given time, but the program doesn't seem to like it ast run-time. I've worked around the issue by creating "duplicate" controls and using the property setting to make them visible/disabled, etc., but the is seriously congesting my BD.
    Anyone know a way to share controls with seperate event structures?

    It sounds like the root problem is the overall structure of your program. I highly recommend that you check out the Queued Message Handler project template in LabVIEW 2012, that will show you how to utilize a single event structure and pass events to a consumer loop. If you program is too large to consider an architecture change at this stage of the game, then there is a workaround for your problem.
    What is most likely happening is that you have the event structures all set to lock the front panel until the event completes. However the case structure that you have wrapped around these event structures is causing all but one of these event structures to be unreachable thus preventing you from handling the event. Again, as I stated above, the "RIGHT WAY" to fix this is to select a better program structure but the "kluge work-around" fix is this: Dynamically register for the value change event on all of the controls you are trying to trap events for. Dynamic events can be deregistered and re-registered at run time. This will allow only the event structure in the active owning case structure to be registered for the events, thus no other event structures will get in your way.
    Disclaimer: This advice is given based on very minimal information and a great deal of speculation and may not be correct. Please include your code if you need further assistance.
    Charles Chickering
    Architecture is art with rules.
    ...and the rules are more like guidelines

  • 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

Maybe you are looking for

  • Unique Problem: Returning SOAP+ Attachment using a class based webservice

    Hi everyone, Im trying to return a Soap+ attachment response back using the following: attachDoc(byte[] bdoc, String sTransactionNumber,                String sRequestedType) Where byte[] is the attachment and the 2 string parameters are soap message

  • ITunes Stops Responding When Trying To Play Video - Windows 7 64bit

    Ok, I've been getting my new Win7 box up and going. Everything is working great with the exception of iTunes. Setting up iTunes / Quicktime is quick and easy. After a single reboot then launching iTunes and trying to play any video results in "iTunes

  • Combined Upgrade and Unicode conversion of Sap 4.6C to ECC6.0

    Hello all, my project team intends to carry out a combined upgrade and unicode conversion of an SAP ERP 4.6C system with MDMP to ECC6.0 (no enhancement package). The system is running on Oracle 10.2. In preparation for this upgrade, I have gone throu

  • Urgent : double precision problem

    This problem is reported on the forum lots of times by lots of people. consider situation : if ((2.9 - 1.1) == 1.8) do something else do otherthings; Its expected to do something on evaluation of condition in if statement .. instead it enters else pa

  • TS50000058 and UWL

    When I execute the task TS50000058, (Process Change Request (R/3))- based on BUS7051.EDITASYNCHRONOUS, from the UWL, the transaction IQS22 is called.  The problem is that the "Action Box" doesn't show up when the notification is displayed??  Also, Is