Structure of the event: problem with data transfer

Hello everyone,

for three days I'm troubleshooting an issue in LabView with the event structures. I really hope someone can help here, because I can't find anything on the entire WEB.

I had six groups of equal to a VI entry, each containing five checks enum (among others) where the user can specify some configuration of measurement data. I want the program to do is: to recognize if a any of these enum values has been changed and if yes, then submit the values containing the cluster in a subvi then calculates the wiring and affect the material of the ports. In addition, i need to submit the number of the enum element that was changed, so the program is able to clear the user input in the case of a breach (e.g. If the user sets two entries of enum control 1 meter and 2 Group 1 and then tries to set a third counter of entry to port 3, the program displays a message and deletes third entry as the number of entries of counter is limited to 2 per cluster).

To resolve this problem, I used a structure of the event with 6 x 5 cases (change of enum value 1 Group 1 Group 1 enum value 2 change... and so on until the change in the value enum 5 Group 6).

The problem is that if the user changes a value, the event structure reacts and performs the proper case; However VALUES of the cluster, the user changed are not subject to the SECOND time that an event occurs. It is a kind of a situation, "n-1". For example, if all five controls Enum of Group 1 are 'disabled' first and the user sets enum 3 of 'Meter entry', the structure of the event runs but submits the values previous to the Subvi (all enums 'Disabled'). When the user makes the second change, say that enum SWITCH1 to "Analog Input", the structure of the event is running again and passes the values of the FIRST user to the Subvi editing, then the Subvi gets data "enum 3 meter inlet and all other disabled enumerations.

In easier words: if I have new values on my cluster "Kanal 1" (left side of the screenshot) and run the structure of the event, on the right side to "Kanal 1" indicator, I get the previous values (n-1).

The structure of my event is in a while loop. If I create a timeout every 10 ms, and a loop of 250 ms the waiting time, I got the 80% chance that the recent changes are transferred to the Subvi correctly, in other cases I have a delay of the 1 step as described above. It seems to be directly based on the time that I specify the while to wait - but I can't explain it and I cannot accept a less than 100% chance to transfer the correct data, nor can I accept delays of a few seconds for each loop run. If I indicate timeout (infinite) get delayed 1-1 step values in all cases.

When I specify cases of event to react on "all items value change" of the structure of the event behaves properly - but then I can't handle indicate which element has changed, as the CtlRef of output in case of a structure does not specify "enum 1, enum 2..." but only "Group 1".

Does anyone have a solution to this? It is certainly a problem with the structure of the event, but I can't understand what to change.

Thank you much in advance,

Mr. Boiger

This is because the terminal is read until the structure of the event runs.   Terminal is read, the event structure is waiting for an event.  The change in value.  Business events are running, but the value is the old value.

Put the terminal inside the event.

Or, you can display the connector called "New value" on the side left (stretching down from the border of the node 'CtrRef').  Use a wire one to come.

Tags: NI Software

Similar Questions

  • problems with timing in a time loop in a structure of the event

    Hello

    I'm using labview to control three motors stepper, running the three stages of different translation in different axes (X, Y and Z). Please see the attached VI, focusing on the structure of the event on the RIGHT side.

    In the Z axis, I am trying to run the engine for 5 seconds, after clicking on a button. I have attampted to do by adding a sub of elapsed time VI within a while loop, located in the tab 'Mouse before Z down' the structure of the event. A similar "elapsed time while loop" is also included in tab 'Z reverse the mouse down' the structure of the event.

    Separately these "elapsed time loops" work very well, BUT when I run a Z direction after another, say 'Z Reverse' and then 'Before Z' then they annoyingly interact. The calendar is gone, with the moment where we add, rather than rebooting.

    No idea how I can reset the time elapsed while loops? Or is there another method better do?

    Thank you very much

    Charlie

    charlieryan wrote:

    I take a wire from the 'i' of the while loop at the entrance of the Sub autoreset - VI of tiem will blink?

    No, connect you to the "reset", not "autoreset".

  • problem with VI execution to the use of the structure of the event

    I close with this sub - VI, but it reacts as expected. My logic was 1 tables initialized with sequence, then the structure of the event in many different cases. The goal is to read a 2D .cal file 1 2 tables. Cells can be modified manually by typing in the text box, then clicking on the load button. Slider determines with cell in the index. Certain sequences of events work either

    (1) download the cal file

    (2) move the cursor

    Type 3) x input box

    (4) load x value

    Other sequences of events are the VI does not, i.e.

    (1) type x entry box

    (2) load x value

    Can some kind soul tell me the error of my ways?

    Walt Donovan

    First glance only:

    You need to connect the tables 1 d in any event, other that they clear.

  • How to manage the structure of the event with two loops

    I have a question about the structure of the user event with 2 buttons?

    key 1: START LOGGING DATA

    key 2: STOP LOGGING DATA

    How do I control my

    structure of the event so that it will work? because now that the loop is save data... I can't stop the loop, when I clicked on buttons.

    super_saiyans wrote:

    the problem with moving it is that I don't have control of the DATA RECORD STARTING?

    Of course, you do.  When you get your press conference button, you say your state machine to move to the State of logging.  You must also make sure that you return to visit the State to wait for the event to check out the events of the stop button.

  • structure of the event with a local variable

    Hello world... I tried to make a simple program with the structure of the event in Labview.
    I need to show a value in a table, when an external signal changes its value. (I read a lot of discussions and many documents and I don't understand the thing... Sorry)
    I want to say that I am getting a value of temperature of a sensor in a controller, it works in asynchronous mode sensor, so that the detector Gets a new value in different sampling rate.
    So the PLC program changes the State of a Boolean variable simple that in Labview, indicates that there is new data (newdatareceived---> 1,0,1,0,1,0...)
    I need this draw Labview (valuereceived) value in a chart when this variable (newdatarecived) changes.
    My problem is that the table always puts a value according to the cycle time in its loop and resumes the values... (I tried, with dynamic events and signage value... and I got the same result... It works fine).
    Thanks in advance.

    And the other way:

    Thanks for your time again.

    STPG wrote:

    I've been doing a little test with xygraph and the example works now (thanks!) but I have a doubt, is this the right way or is there a better way?

    No, this code is meaningless. You write new (mostly the same!) points to the graph xy with each iteration (actually at twice the speed at which data can actually happen: 100 ms vs 200ms!), tax system unecessarily and more internal data structures like crazy.

    All you need is a simple loop with a single structure of matter which is true if the Boolean value is different from the previous iteration. Currently, you must add a point (the time for X, the value in Y) to the xy graph. Here is a quick sketch. (You can either use the meter or the elapsed time for X, according to your needs, so change if necessary).

    Events are mainly for the interaction with the user in order to avoid the loop turn unless necessary. Here you are already running a loop to interrogate the instrument and you can easily have the graphic way the same loop. Right?

    You should also be aware that the execution order is determined by the flow of data and not in a horizontal position. If it's important that OCX nodes running first in an iteration, you create a dependency of data (for example with the wire of the error). Horizontal compensation has no effect. The structure of sequence on the left has also does no work, then why is it there?

  • Structure of the event with gray and disabled controls

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

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

    Thank you

    Doug

    Doug,

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

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

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

    Lynn

  • major error with the structure of the event

    IM under LABVIEW 13.0 PRO

    I don't know when this strarted bug happening, but now when I add a business to a structure of the event. Freezes in LabVIEW. I have to close labview with the Task Manager.

    It doesn't matter what code I'm working with, even a new VI, with nothing else than a structure of the event.

    I tried this on my desktop PC, my laptop and my CPU DAQ.

    The error occurs on my desktop and my laptop. But it does not occur on my CPU DAQ.

    Whenever I click on add event usually case, you get a popup to configure and add cases, but with the popup error never comes to the top and labview crashes.

    Theres no code to share the problem ocured when adding events to the event structure. It happened with any structure of the event, in any code, all the time.

    I spoke to an engineer of apllication of labview and suggested to delete the labview.ini file located in the installation of labview directory. I did this and the problem was solved.

    Still not sure what caused this to happen.

  • An interrogation continues with the Structure of the event, please help me understand

    Dear Forum,

    I'm 3 months in LabView. I created a front panel with what I consider a reasonable set of code below with a basic entry control power boulean a case controlled set of actions. I enclose a strongly striped version to the bottom of this structure with sections deleted button so that the executed code is removed to simplify just ask questions on this control structure. After the recent webinar, I understand this form of control to call a continuous structure of vote - and it makes perfect sense and seems natural for me to the point of programming of data flow.

    But according to the webinar it is preferable to use the structure of the event.

    However, the structure of the event seems really weird to me. My main question here is certainly the structure of the event MUST be voting each of the values itself anyway, otherwise how does he know that an event had occurred?

    So what is the difference between explicitly "polling" the buttons myself with a while loop and using a complex (for me) of the event with 'hidden' polling stations under?

    The vote of the 4 buttons in my example should be done at the same time if Labview is truly multithreaded/parallel? There should be no difference in the level of the computer between my code querying and the code 'hidden' the structure of the event making the mark.

    Thank you in advance for you help to clarify my confusion.

    Sincerely,

    Robert Gibbs

    rg8766 wrote:

    Surely the process:

    Check the OS press > OS encodes this trigger to send > OS sends a trigger that the button has been pressed > Labview checks if a trigger happened > Labview decodes what action has been coded in this trigger > Labview takes appropriate, based on relaxation measurements

    has more steps and is more intensive than processor

    LabVIEW checks the key > Labview performs the appropriate action when you press the button?

    BONE is already this process in any case.  If you are in fact doubly effort without worrying.  And the OS is much more efficient that your code will be.  So just let the OS do work heavy while your code sleeps.

    And think about the trigger more as an alarm clock.  You are asleep (do nothing, with no CPU) when your alarm goes off.  You wake up and perform the task that the alarm tells you to do.  Once done, you are waiting for another alarm, so you get to sleep.

  • Synchronization of 2 loops while one with a structure of the event.

    Hi fellow users of LabVIEW

    I try to incorporate a structure of the event in my current exisiting VI to Save certain values of control as shown in this post

    http://forums.NI.com/T5/LabVIEW/using-the-quot-make-current-values-default-quot-as-a-control-on/TD-p...

    It's the VI that I use as model with my exisiting VI.

    http://forums.NI.com/NI/attachments/NI/170/547715/1/defaults%20Demo.LLB

    In case the 'stop, change the value' I use in the main VI and a 'real' constant instead of Boolean control of wire structure. While the loops are not connected. The table that I use in my exisiting VI (another while loop) is indexed and unbundled to be used here.

    The work combined well screw and it gives me the results, my question is, in the long run it will give me issues. Do I still need to synchronize?

    Thanks for all the help.

    There's no problem because loop additional lower with the structure of the event.

    Personally, I worry about the top loop. Why so complicated? Why so much duplicate code? Why all these hidden indicators serve as local variables?

    Why don't simply place you the table in the entire cluster in a shift register and the index and ungroup by name wharever value, that you need to access. No hidden local variables or indicators.

  • Structure of the event with value changes

    Hello, I had a problem with the use of a structure of the event. I want the values to change the table itself when the user changes the units, such as the flow rate 4 l / min = 240 l / h... It should appear in the same table. I've already got a code here, but it's quite confusing and does not

    Could you please help?  Thank you

    So that it doesn't?

    How it did not work?

    What you want it to do?

    What did do?

    We cannot read your mind, you must explain in detail.

  • Structure of the matter and structure of the event with a condition of the indicator (boolean)

    Hello

    I read a lot of posts but I can't solve my problem. I would like to set up a business structure and the structure of the event, and the condition to run the code inside is a Boolean indicator, in this case called Wahnelt (screenshot). I know I should use signal value, but I don't know how to implement. Here is the program:

    Any help will be more thankful

    a state machine with timer elapsed...

  • How to use the structure of the event to sort the listbox data?

    I have a VI that contains two list boxes.  The two list boxes are selectable by the user.  This is how I want to interact.

    When the VI is initialized, the first list box will be filled with data.  If the user double clicks on a cell in the first list box, the second list box will be filled by a sorting of the information contained in the first list box a certain way.  I do not think that the details of how these data are sorted is pertainent here...  Then I want the user to be able to double-click on one of the lines in the second list box.  The double of the item clicked in the second list box will be used in an another VI which will then start.

    I have my VI of work such that the first list box will fill the second list box whenever the user double clicks on a cell in the first list box.  To do this I use a structure of the event.  Here is where the trouble begins.  I have a second structure of the event look for double clicks in the second list box, but when I do this, the program crashes.  In addition, I want only the user to be able to double-click on the second list box, if the first list box has already been double-clicked.

    Generally, my question really revolves around the use of the structures of the event in this application?  Can I use two structures of event at the same time?  Is there a better way to do it?

    No, you probably should not use two structures of different events. One, it should work fine.

    The Subvi immediately execute and return? If not and you have the front locked until the event finishes, which would explain what you see.

  • Control the Structure of the event with text file

    I'm new relativaly in LabVIEW (experience only about 2 weeks). I am currently control a stepper motor using a structure of the event. Similar to the sample code given by LIFA, I entered my settings how the engine not move away, then press a button on the windows before, and it works this way. I also have other equipment that works as well in LabVIEW, as a transnational step; all components operate individually.

    Now, I'm trying to make the more automated system and to ensure that all the different equipment work in the same code. So, I tried to implement a structure of the event using a text as an input file to try to control events. The text file has a table 1 d of numbers going down vertically (only the line numbers change). So, I used a table of index function to take the numbers one by one, use a loop (while loop in this example) to go to the bottom of the column of numbers. However, the event not register the change, even if the indicator shows the value is changing.

    Attached, it's my test code and the text file that I use to try to control the structure of the event. Please let me know what I am doing wrong. Thank you.

    Oh, now I understand what you tried to say. I'm using a loop and a case structure to activate different events with the entries in the table. I thought case structures and event were the same, but you taught me the event structures are used just for the façade stuff. Thank you all!

  • How to stop the While loop in the Structure of the event with the same button?

    Hello

    I have a problem. I want to use a single control to activate an event in a structure of the event and the same control to end a while loop in this case.

    It is possible to use 2 controls to do this, but I need to be alone.

    Thank you

    You should NEVER place while loops inside the case of the event, and it is never necessary to do. Think about it: all you have to do is spin the code. You can easily use the outside while loop for everything. Simply place the code of the loop internal (without the inner loop) inside the case of delay and manipulate the time-out period between a pending finished and the infinite (-1), depending on the State of the Boolean value.

    A very simple example (LV 8.0)

  • Instead of using the structure of the event with the producer consumer?

    I used the architecture of producer-consumer in the past to control a state machine with the structures of the event.  I'm working now with the basic version of LV that does not include the structure of the event.  Can anyone recommend alternatives to the use of the same architecture in this case?  Thank you, David

    Before the introduction of the structure of the event, the only option was the election.  Control terminals are in a time loop (the producer) with shift registers and a wait, usually about 100ms.  At each iteration of the loop, the control's current value is compared to the previous value.  If it has changed, and then take appropriate action.  Andrey suggested, queues are a good way to pass information between the loops.

    It works for the equivalent of the value change events.  Things like mouse to top or filter events were much more difficult or not possible.

    Lynn

Maybe you are looking for

  • HP Envy m6 1183 for example: stuttering mouse after upgrade to Windows 10

    After the upgrade of Windows 8.1 for Windows 10 my mouse is "stuttering". With stuttering I don't mean lag but changes of symbol like 3 times every second from the normal pointer to a pointer with the blue loading ring and back. If I want for example

  • Pilot for missing SM Bus controller after the clean install

    did a clean Windows 7 Home Premium installation and two USB ports does not work, went to the Manager of peripherals and other devices beside the SM Bus controller and controller Universal Serial Bus (USB), there are two exclamation points.  I tried l

  • Activation XP to replace the same brand and the motherboard model

    The PC in question had an OEM of XP without CD installation.  I have a good COA sticker. I've had damage to the motherboard as a result of a power of 250 BestTec supply failure. After a new PSU, I replaced the motherboard with exactly the same brand

  • HP Backllight keyboard

    Hello I have the HP DV6-6c50se model is it possible to replace the keyboard with backlight? Thank you

  • How to specify the JRE (component Pack)

    When I created my project, he asked me what JRE to use and I said 4.6.  Now, I want to change to 4.5 (and change to my taste and so forth).  When I go to "Windows-> preferences-> Java-> Installed JREs", I can see all the components, as I should, and