Structure of the event to local variable

Hello

I use a control structure and the table event to detect changes in the value of table.

At the beginning, I have made changes in the table (for execution) and structure of the detected event.

The next step was adding a parallel while loop in which I write for the control array (using the local variable).

During execution the layout of the table changed indeed, but the structure of the event is a not detect it.

I have attached 2 digits: 1) loop of the structure of the event 2) the parallel loop.

It is possible works in such a way?

How can I make the structure of the event to detect changes in the software in the control array?

Thank you

Leonid

Changes made via a local variable are not the user events, so the structure of the event will not detect by definition. You must write to the command by using the property node "Value (follow the signs).

That said, your small watch of your code starts to raise red flags in my mind with the use of variable and global variable local. While it's not bad, their abuse can lead to the poor programming architecture and race conditions. Perhaps you should consider downloading your VI any kind can someone take a look and offer suggestions on improving it.

Tags: NI Software

Similar Questions

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

  • Copy a structure of event containing local variables

    Hello

    I am a state machine design in Labview and next state transition logic to wait be clicked a few buttons on the Panel.

    If I press a Boolean button from 1 to 9, next State should be X, otherwise condition (10 to 16 tags) should be there.

    I thought that the right approach, because it would be a structure of the event, where I added two cases: case 1 (button 1: mouse to the bottom button 2 down,..., 9 of the mouse down) and box 2 (10 mouse buttons down,...). For each of these cases, I'm reading & writing the local variable of some double digital.

    When I copy the structure of the event in another case of structure of outer case, I note the following: all cases in the event loop is missing, and the local variable renamed automatically and a new created indicator digital.

    • How to make an exact copy of the structure of the event, without the problems described above?
    • Could you suggest a different approach more effective than mine?

    Thanks for any response.

    Start by reading the guard and recommendations for using events in LabVIEW - LabVIEW 2011 help

    The fact that you try to copy and structure of the event to another, and that a structure of the event will be buried in a case initially tells me you are already heading on the wrong track and yourself in creating a world of problems.  Your architecture will never seem to work for you.

    The event structures are always active and capture events.  Even when the structure of the event is not in the path of execution, it's queue of events to which he attributed to him.  If you have events that are set to lock the façade until full, then you're really screwed because the event structure will capture the event, locking of the front panel and the execution path of your code with the state machine may never come to the specific case that has captured the event to support then release the façade.

    In general, you should have the structure of a single event in a VI, and should not be buried in a case structure where he can never carry.  You also shouldn't have several event facilities manage the same events.   These are not hard and fast rules, but until you are quite familiar with how the event structures work and completely understand the architecture of your code, you should not violate or you will just ask trouble.

    Similarly with the help of local variables.  The fact that you say that you have local variables and you try to copy tells me that you already have too many.  There is certainly a better way to build your VI, which does not require local variables with the exception of a few cases and certainly won't need several structures event buried in the structures of the case.

    You should probably have a producer/consumer architecture that handles the events.  Have a simple loop with a structure of the event which captures all user interactions.  Pass events to a loop of consumer who is also your computer through a queue of State.  (Also known as a computer state in queue or the BAU).  Let the state machine to determine how to manage the events, he received based on what is the current state of the VI.

  • structure of the event does not record local vars

    I have a gif of a FPGA based topology I want to show some telesignalisations in.  As the user clicks on the Boolean, vertical lines appear and disappear as they click on it again, showing the current topology of closure.

    To save resources, I opted to use a structure of the event.  So far I put it for internal RX_FAC and RX_TERMXCO4AU you see at the top left of the image.

    A single loop of RX and one TX closure may be on at the time, so one of the first things that happens when the user clicks on the Boolean value is that it defines the values of all other Boolean in the same row of fake, thanks to the use of local variables.

    The problem is - the structure of the event runs only when the user actually clicks the Boolean true or false value, but not if the boolean is false through the use of a local var.  In other words, let's say I RX_TERMXCO4AU true and false RX_FAC.  If I click on RX_FAC to set it's true, then you will notice RX_TERMXCO4AU goes dark/false and RX_FAC lights.  So the value of RX_TERMXCO4AU has changed, but associated with the structure of the event RX_TERMXCO4AU does not run (that's why the vertical line between RX_TERMXCO4AU and TX_FACXCO4AU remains).

    This will make a lot more sense if you run the attached simple VI.  Right now, events exist for RX_FAC and RX_TERMXCO4AU, but it is sufficient to explain the problem I think.

    Any help is appreciated.

    The structure of the event is for events generated by users.  Writing to a local variable is a programmatic change.

    You want to do is write your value to the Value property (Signalling) of the Boolean that will change the value and raise the value change event.

  • Can I record a value Object Variable Global change in a structure of the event?

    I have revealed a global variable to the user via a panel of sup, so that the user directly changes a global variable Panel.  This works very well for this application.

    However, I would like to respond to that in a structure of the event.

    I tried to register for the GV-> [command] Panel.  It seems to work, but the changes do not generate an event.

    I then tried to save the commands individually.  Also hosted in the code, it did not work at run time.

    Is this possible?  Any ideas on how to make it work?


  • Cannot use Global Variable in the Structure of the event

    I'm using LabVIEW 2009.

    In my LabView project, I have a global Boolean variable called EStop. I can read and write the global variable. If I double click on the global variable, it takes me to EStop.vi which includes a text button. EStop.vi is part of my project.

    In one of my report, I have a Structure of the event. If I go to one of the event handlers in this case Structure and right click and select Add event, I get a list of possible events. But this list does not EStop or an EStop events.

    I would like to add an event to EStop case: changed value.

    Why I can not add to a case of events events that include events on Global Variables as value changed?

    How can I add EStop: event changed my structure of the event value.


  • Structure of the event - controlled motor not variable

    I have a state machine that includes certain structures of the event. These event structures are used to control stepper motors using an Arduino Mega microcontroller. I'm using labview in 2012.

    The entrance to one of the events is the variable "pour the entry. I want to use it to control the motor speed and direction.

    If I control the motor as shown in the attached image Working.jpg, then the motor functions correctly. If I fix the motor to the steps variable # then the engine moves at the speed set in the right direction depending on whether the entry "pour" is positive or negative.

    However, I want to control the speed of the engine, not the number of steps, with the variable "pay Input". I checked that the values read by the indicator image INPUT_VALUE works do not are of the same order as the specified values, working, by using the "Set Speed". When I connect the value of the entry to the spindle speed of the motors of the Arduino (not_working.jpg) icon, the engine is running, apparently indefinitely at maximum speed. I don't understand why there is a difference in motor behavior between the value provided by these two methods at the entrance to the speed of the motor. I am confused by the present and don't know where to go from here.

    The structure of the event somehow behaves differently when taking a value from outside the structure to this data inside? or y at - it something to do with the opening of the structure on its first loop?

    I have also attached my vi together, even though she may not be the easiest to follow and requires an arduino Mega to run.

    Carlr wrote:

    I have a state machine that includes certain structures of the event. These event structures are used to control stepper motors using an Arduino Mega microcontroller. I'm using labview in 2012.

    The entrance to one of the events is the variable "pour the entry. I want to use it to control the motor speed and direction.

    If I control the motor as shown in the attached image Working.jpg, then the motor functions correctly. If I fix the motor to the steps variable # then the engine moves at the speed set in the right direction depending on whether the entry "pour" is positive or negative.

    However, I want to control the speed of the engine, not the number of steps, with the variable "pay Input". I checked that the values read by the indicator image INPUT_VALUE works do not are of the same order as the specified values, working, by using the "Set Speed". When I connect the value of the entry to the spindle speed of the motors of the Arduino (not_working.jpg) icon, the engine is running, apparently indefinitely at maximum speed. I don't understand why there is a difference in motor behavior between the value provided by these two methods at the entrance to the speed of the motor. I am confused by the present and don't know where to go from here.

    The structure of the event somehow behaves differently when taking a value from outside the structure to this data inside? or y at - it something to do with the opening of the structure on its first loop?

    I have also attached my vi together, even though she may not be the easiest to follow and requires an arduino Mega to run.

    You have a very inappropriate design of "state machine" - even if you do not have same event in more than one of your structures of the event (in addition to time-out), looks that get some of your treatment to go forward until you get something very specific (and in which none of your other user events are being processed).

    I strongly suggest that first set you design of State machine - perhaps follow producer/consumer Design Pattern (events) rather than having everything in a loop, the way you have.  If you keep everything in a loop, you should consider redesign so that you at least allow events to deal with rather than stay in a loop for an indefinite period!

    In any case, in the case where work, you send variable "Set Speed (steps per second)" for engines step by step write vi.  But otherwise, you're feeding 'Entry for' value - are they the same? And to let you know, you send only command "write" step by step when the input value to be paid.

    It's a big mess!  For starters, look at the attached picture, get rid of your structure of the event that has "for the entry" and replace it with what I showed in the picture. (In fact, all your event structures can / must be replaced with a similar logic.) Does not need the event structure in all this, you're just more complicated it must be!

    -DP

  • manipulation of refreshment of the variables within a structure of the event?

    Hi all

    Here I have my problem: I implemented in a data visualization tool, a button to get the updated file.

    But as the mail application provides new files every 2-5 seconds, I wanted to also apply a function to auto-refresh, so that the file is retrieved every XX seconds.

    I've tried several, solution workaround naïve perhaps, but the problem is that when I start the "auto-refresh", I can't handle anything else in the Control Panel, and I can't change the value of the "automatic update control ' because no doubt... He's waiting. Please find attached the photo.

    What Miss me?

    Thanks in advance,

    Edo

    Hey Edo,

    You can use the event to wait for it. Do not use a wait within a structure of the event function.

    Mike

  • Front panel locked, but not due to the structure of the event

    Hi it LV community.

    I did a staemachine program that executes an oscilloscope (screenshot of a provided below... the State of the problem). I ran my program yesterday and it worked very well. Then, like a model, a dialog box opens and I just clicked on it in a hurry. now my front hangs as soon as I move the above-mentioned State "the Oscilloscope settings.

    As indicated, I have go a repeat loop that collects successive impulses of my oscilloscope and displays on the front panel (it works fine). In parallel, I have a structure of the event that makes the tail for the real-time feedback of changes to parameters that I placed on the façade (exodus of state change).

    Here's the problem: as soon as I State 'Oscilloscope Settings' using a Boolean button on the front panel for get me there, the front hangs... No event triggered by this point, and even if it did, I already deselected the "Lock panel until the end of the matter for this event" checkbox in the case where the structure menu.

    So WHY is my front lock now? Thoughts anyone?

    Read the detailed help for event structures.

    He urged that a single event structure serve in a VI. There are moments where more can be used effectively, but caution and a thorough understanding of the structure are needed.

    The problem is that you have several structures of the event in the various cases of the state machine and they are set to respond to the same events.

    When the button Set Oscilloscope, the structures of the event in the purchase Menu and home screen States receive the event. The two lock the screen, but only one of these cases may work. It can transfer control to the State of the Oscilloscope settings, but the other event responding to this same event structure maintains the locked Panel.

    The solution is not not to release any of the event. The default value is usually the best setting. The best solution is to spend on an architecture of producer/consumer (events). Who uses two parallel loops. The producer has the one and the only structure of the event and passes orders to consumer loop through a queue.

    Probalby want as the mechanical action on the buttons to lock when you press. Put kiosks inside the respective case of event changed value and local variables becomes unnecessary.

    Lynn

  • leads the value change in the structure of the event

    Hello

    Please the the VI attached.

    I would like to know what event triggers when the value true or false of the changes led?

    In the case of structure above the structure of the event, the values of true or false of the led are changed.

    From the change, the analog output for Acquisition Card changes. However, the change event of the value in the structure of the event never fires, I know that I run the Vi with the selected highlight enforcement tool.

    Thank you

    Venkat Rao

    Changing the value in an event structure occurs only if one of the two following situations occurs.

    1. the user who modifies the control on front panel.  That may not happen since these LEDs are indicators and does not control.

    2. the program writes a value of property of the Value indicator/control (signalling) node.  Writing to the terminal of the indicator, or the local control variable / indicator not fire the event.  Given that you do not use value property (signalling) nodes in your program from this moment, won't happen either.

    Note that the value change event is a bit misnamed.  The change event is triggered, even if you do not actually change the data.  So if your LED is currently worth, and you write a True Boolean value for the Value property node (signalling), the event always fires even if you're not technically change the data.

  • 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 recorded does not change value

    I have a VI that communicates with an FPGA via a telnet interface.  I have several Boolean controls on the front panel.  When you click a control, it sends a write command on the face i in telnet to the FPGA.  Similarly, if a process in the FPGA himself wrote the same registry (that control written when I clicked on it), an order is generated in the FPGA and returned to the VI and the control (via a local variable) lights or unlights accordingly (based on value).  In other words, these controls are read-write...

    It's all workers, except for one important thing.  I have the code that runs through a structure of event whenever the value of the control changes.  I can see that this code executes in fact when I click on the control via the front panel.  HOWEVER - when something is generated in the FPGA finally changes the value of the control, the structure of the event does not, even if I see the value of the change of control on my front.

    A specific example, I have a control named CLIENT_LB.  When I click on CLIENT_LB, I see it lights up, and I see the event structure code run.  Now, if I have the FPGA process to set CLIENT_LB to 0, I see unlight on my front, but does not run the code structure of the event.  I have probes in place who have checked the associated local variable CLIENT_LB evolving impact of values.  The structure of the event reads: 'CLIENT_LB': value change.

    Shouldn't an event structure "value change" run when the value changes, regardless of whether if it happened manually (i.e. me by clicking on the control) or automatically (i.e. the FPGA written in VI and changes the value of the control)?

    The VI is great, and you would not be able to test it in any case unrelated to the material, to remedy that I've attached 2 screenshots, I have described below.

    1. This is where the string from the FPGA analysis occurs.  The chain between the sub - VI, and then the data chain part is hidden to determine if the Boolean value of the control is true or false.  I put a probe on CLIENT_LB, and I see that as the FPGA changes the value of the register, CLIENT_LB passes from false to true as a result.  I checked this several times.

    2. it is the structure of the event.  This code runs when I click on CLIENT_LB on my face, but does not run when the peak CLIENT_LB #1 local variable is changed.

    Writing to variables never fires events to "change the value. If writing should raise this event, use the property "Value (follow the signs).

    Norbert

  • Sub - Entered VI buttons activation do not Structure of the event

    Hey everybody,

    I have anissue with a Subvi, which takes a user file, play with the type of path of file data until it is in the form of a string, and then puts it in an array of strings in a list box. The issue I'm having is that I created the entries and exits to the buttons in the image, but the case event structures they control are not running when I press the buttons that are connected to the terminals of the Sub VI (the buttons move up one level in the image below).  They DO not work when I use the Panel front of the Subvi rather than on the front of the VI Panel that comes up to the next level.

    So far I have tried:

    -Move the buttons in the while loop

    -Move the buttons in the structure of the event

    -Case change event handling to run on a mouse click of the button from a change in value

    Thanks in advance for any help anyone is able to give me!

    Yes, writing a value to a Terminal never causes a value change event.  Think of it as an event "user has changed the value.  To trigger an event value programmatically, you must write to the Value property (Signaling) of the command or the change indicator.

    Values Boolean locking belong in cases that handles the VC event.

    You could read the terminal (use a local variable) before the time compare loop to the last value (use a feedback node) and use a case structure to determine if you want the event to VC based on the value passed in the appellant.

  • When to use the structures of the event

    I wrote several applications using the state machine architecture.  Generally, these applications have two buttons (I created), a race and give up.  The abort button interrupts the guide and goes to a State of inactivity which loops until the run button is selected.  One thing that I don't like, my programs ending up with one or more local variable for the Cancel button.

    (1) should I use structures event for these types of programs?

    (2) is a program of event also structure a state machine?

    Why would you need local varables for the button abandon? Do simply lock action so it resets automatically.

    If your loop by turning in any case (e.g. for updating views) migh ask both controls. Any necessary event structure.

    ggress1 wrote:

    (1) should I use structures event for these types of programs?

    (2) is a program of event also structure a state machine?

    The event structures are mainly for the manipulation of interaction of the user on the front panel. I encourage you to learn more about the structures of the event so you can make an informed choice on the best architecture of code for a particular programming problem. Maybe you should show us some of your code so that we can decide by using the event structures should improve things.

    A program with event structures is generally much less forgiving of the rookie mistakes. Used properly, they can easily lock your program.

  • How can I use the same graph of façade in several events in a structure of the event?

    I want to display my sensorDAQ signals in a graph.but I have more than one event in the case where the structure to acquire the signal and display it in the first round of graph.the is to acquire signals from threshold and its shown in the graphic as a feedback.after the first event is executed, I'll call the second event, where the other signals are acuired and compared with signals from threshold of event 1 my question is how can I use the same control on front panel in more than two events in the structure of the event? Please answer me I am stuck.

    Hello

    I have attached here an example of doing the same thing using local variables and shift registers. Take a peek inside. Shift register is always a better option than local variables.

    Kind regards

    Amine31

    (Bravo to give good answers, mark it as a solution if your problem is resolved)

Maybe you are looking for

  • Using iMac as a second screen for macbook pro running Windows 10

    I have a 27-inch iMac mid-2011 running El Capitan I want to use as a target for a 2015 start display 13 inch MacbookPro retina through 10 Windows bootcamp (it's Windows 10 education, for what it's worth). I have attached two machines via TB to TB. Th

  • Error 2203 when trying to install iTunes

    I try to install iTunes on my laptop, but an error 2203 which prevents the installation completed. Everyone has come across this before and if suggest a resolution. Thank you Moved from feedback Original title: error 2203

  • HP Envy 17 t-j000 Quad Edition.

    Hi all Recently bought above system with 16 GB RAM, who has left no option for installing a drive mSATA, given the options.  I am reasonably sure (based on other sites that speak of this laptop) that I can install a player mSATA.  However, I also wan

  • Only the groups showing them in App Contacts

    I have recentlly had to restore my phone to an earlier backup. However, now when I go to Contacts, I don't see that local groups. When I go on my account gmail on a desktop browser, I see all my contacts and my groups that I made. If the groups still

  • Windows 7 language from French to English

    Hi, I read the threads on the upgrade ultimate and enterprise for windows 7, but what about the upgrade to windows 8.                     .  Changing windows ill 8 allow french to English?