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?

Tags: NI Software

Similar Questions

  • 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

  • Can I activate a structure of the event with an another VI control

    I need activate an event structure in a VI with a change of value with an another VI control event. The code is included in the pictures, you can see in this post, and the variable stop is the control that should activate the structure of the event since another VI.

    .

    The code is on other forums of discurssion and is made by Randall Pursley (rpursley8).

    See the link: http://forums.ni.com/ni/board/message?board.id=250&thread.id=43960

    kiftren wrote:

    Hi to determine,

    Sorry, I can´t to open your archives because I use LabVIEW 8.2 and LabVIEW 8.5. Can you give me the image of the code in your screen in one archive .jpeg?

    Thank your for your help to determine.

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

  • 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

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

  • Can I use Ctlref in a structure of the event with a mouse to an event?

    I have a large number of controls on a front panel. I use a structure of the event that triggers the movement of a given motor when you press the corresponding button. However, I would like to avoid creating events for identical most of N, so I relied on the use of a mouse down on the front panel event, then retrieve the reference command using the Ctlref node (with gives 'Reference to the control on which the event occurred', according to manual labview) and analyze an array of references to know which engine is supposed to move. However, it seems that this node is not (contrary to what the manual said).

    I found other ways to do what I need (I thought using a table containing details of my controls and the coords in the structure of the event node), but I wanted to know why I can't find this node (that is displayed for the event "value change" for example). I'm using Labview 2013.

    No luck for you. Mouse down on the Panel does not have the refnum control because it does not work on a control. Mouse down on a control has it, and since you can configure the mouse down events on multiple controls in the same case of event, it also provides a refnum of control so that you can still use the order in question.

    This is probably also the question that Jeff might have seen. When you set up multiple events for the same frame that LabVIEW displays only the terminal event that are present in all of these events. Terminals that do not exist in at least a specific event of the multiple events for this image are more selectable.

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

  • 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

  • Structure of the event with sub-panels

    Hi, I tried to find a simple example with a structure of the event and only two sub-panels.

    I found the 'new Event Handler.vi' and I'm doing something with two sub - vi I did 'Add.vi' and 'Mul.vi '.

    To be able to switch between the two sub-panels used in 'New Event Handler.vi', the programmer used a "time surge" which I can't locate

    anywhere, so I just copied 'new Event Handler.vi '.

    I can't get this to work.

    Take a peek inside the world

    Sincere greetings,

    Lasse

    Hi Lasse,

    Yes, there is. If you open the properties of the subVIs Add.vi and Mul.vi (Ctrl + I), you can change in the tab 'appearance of the window' to that custom... There is an option display front panel, when it is called and the close later while initially closed just sellect them. Then, you will have the effect of 'pop up' :-)

    I slightly changed the example, so that can see them in the form of pop-up windows.

    See you soon

    Angel

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

  • Programmatically trigger a structure of the event with the value (signaling) is not responding

    Hey, in my attached program I check if the two steps of translation are in a specific position. If Yes, I want my code to execute a sequence of movements. If this isn't the case, I'm asking the user if he wants contributed from this position anyway. It has three options: Yes, go to load (the specific position) and cancel. If he hits Yes, I am using a property of signal value which should update the controls Boolean true, allowing the sequence. Cancellation and work "to load" perfectly fine, but 'Yes' does not work. I think I need a structure of the event to ahndle the value of the Boolean control 'x' change event, however, the addition of this structure of the event for some reason any even do not allow me to click on the Start button of the procedure.
    Thanks for any help in advance.
    Doug

    Really, you should look into using a State Machine.  You should have really not what happens inside a structure of the event.

    In addition, I would like to use a shift register to store this value instead of a front panel control.

  • How to use a structure of the event with a state machine


    I don't know exactly what you're asking, but it sounds as if you want a bunch of script tests and if the user says stop, to immediately stop the current test and abandon others?  I'll assume you know how to clear the table so that it will not abandon the others, so I guess that you have wrong to abandon the current test?  If it is indeed the case, the problem is that you are not able to spread the message of the VI FP main which is the GUI for the sub vi which is the test where the test may or not have a GUI (FP visible) of its own.  Threading is the first thing to come to mind, but it will be may not need the use of events.

    You can do this by passing a refnum of the stop button to the Subvi, where you can then add to wait to the structure of business event.

    I have attached 2 screws, mainvi.vi which is just a loop displays the number * 2 (number of seconds since the race) to be called subvi.vi and then check to see if the button is pressed.  mainvi.VI is in no way a state engine, it's just a simple loop for demonstration purposes.  subvi.VI just waits 2 seconds and leaves, this is a better engine State structured with an init State to start a case of survey to wait events and an exit status to clean.  You can change everything as you wish so that he can do what you want.  You will notice that even if subvi.vi is running, it will automatically end when you press the stop button.

    I hope this helps.

    A

  • Structure of the event with times

    What happens in my code, if I deleted the Time out business in the case of structure and run the code.

    If you do not have anything that is connected to the blue connector "Event Timeout" at the top left of the structure, the default value is '-1'. '. This means that the timeout event is never executed.

    In this case, you can remove Saveli affair.

    Norbert

Maybe you are looking for

  • Can I put a Satellite A300-15 b Vista 64-bit?

    Hello I think to buy a satellite A300-15B, which sounds like a great machine for the price, but when I asked at the store if I can run Vista 64-bit, they told me that I can't do. What is the point of having 4 GB RAM (8 GB disposable?) then? Please ca

  • Re: Completely blank screen on Satellite L500D - 16 M

    Recently replaced screen on Satellite L500D - 16 M and worked perfectly. Closed the lid but has not closed laptop. Next day, totally blank screen. Removed the battery, power off and all used to self-help, all to nothing does not. Have you tried the l

  • I don't have access to the internet

    Separated from this thread. I don't have access to the internet. How can I get it back

  • What is the price of MSN Premium?

    I used to get MSN Premium free with my Verizon account.  Verizon has sent a notice that it would be more free, but I don't know what is the price?

  • Games for Windows - LIVE on Windows 7 Ultimate 64 bit

    Gurus, I can't 'Games for Windows - LIVE"running in my Windows 7 Ultimate 64-bit.  Starts the splash screen and nothing.  I downloaded all of the extras, updates, etc., what do I do?  Oh yes, I've already tried "Run as Administrator", as well as all