timed event inside the event inside the loop structure

Hi all

I'm a bit new with labview. I have problems with nested loop structures and reading the messages that I've learned that it's wrong. What I'm trying to do, is turn on and off a led every second until another case is selected with a button. I have a business structure in a loop. thaks a lot.


Tags: NI Software

Similar Questions

  • How can I control the working time so that the loop structure in the cases where the structure?

    Hi all

    My job is: Loop While structure generates the signal for 4 seconds when you press the 'start build' button, after that data has been backed up. You press the button "generate the beginning' once again, and the loop runs one again.

    My problem is: the first pressing, the loop, exactly 4 s (3, 999 s), but him second, third pressing on... The time elapsed is not 4 seconds, always smaller (even ~ s 0.003). The loop works correctly after press the "Exit" button and launch the program again.

    How can I control exactly time loop work While Structure without the press "Exit".

    Thank you any help!

    P/S: I used the number of cycles (ms) just to look at a working time of the While loop.

    NMCuong

    This shows a quick solution

  • Structure of the event inside while loop

    I'm still fairly new to Labview and this may seem a simple question.  I'm doing a Subvi to display, edit, and create configuration files.  I use a ListBox to list all sections of a config file and structure of the event to update the values in each section, when they are clicked.  The problem is that the structure of the event seems to be a break the while loop so that the buttons do not work until the event has executed.  What I would like is the while loop to run continuously and the event to run only when I click in the listbox control.  I hope this makes sense.  There is a peak in the diagram below. Thank you

    There are a number of issues with your code that could cause problems:

    1. You must use the FP. Open method to open the front panel of a VI and of the public Service. Close method to close. I don't remember exactly the problem, but starting with the 7 worm nor indicated that these methods were the preferred way to perform these tasks.
    2. Based on what seems to be the code, the event for the control of Presets of wood should be a change the value - not a mouse down event. After changing the type of event, use the event data NewVal to drive the indexer table index entry.
    3. The buttons Ok and cancel them should be handled in their own events to change the value. The value change event Cancel would exit the loop, while passing the output error (which indicates that cancel was pressed) and default values for the other 4 outputs. The change of the value Ok event would leave the loop by passing the values that the operator had concluded the 4 controls on the front panel.
    4. An event of timeout with a very short time (1 msec) would stop loop if an error has occurred, or the output of the gate AND is set to true.
    5. The wait function is not necessary, as is the case outside the loop structure.

    Mike...

  • Event inside the loop 'for' confusion

    Hi all

    I have an event inside a N = 2 for the loop, which generates an array of 2 elements (auto-index mode). The first value is a first event, the second of the second round. The events are the mouse clicks on a front panel with many buttons control.

    Am I able to access the i counter inside the front loop of 2 elements output table? He does not appear.

    Maybe I want just 2 events in the order I should put two copies of this event in a sequence of 2 image... but it creates the need to set up the event twice... a concern, because it contains many possible sources.

    Ive tried everything in loops, by the way I like a local variable, tunnels, shift... registers but I don't seem to be able to access I have during the loop.

    Can anyone suggest a method or a better structure/approach for this issue.

    In any case, it seems that the program is blocked waiting for the second round, so I can't do anything with the value anyway?

    I want to take action after the first test and before that I'm waiting for the second event.

    Thank you

    Carloman

    OK, you're much too complicated things dong.

    • Use a unique event for all low Boolean mice, then use the ctrlref of output event to detect only one. For Boolean values, you can use an array of Boolean instead of all these individual buttons.
    • Don't do the "table of cluster... unbundle" songs and dances. It's just ridiculous! 'array Index' is sufficient.
    • You need an event for the stop button.
    • The structure of your outdoor sequence has no purpose.
    • The coloring is registered with VI, no need to recolor with each race.
    • Do not reproduce any of this code. Your internal matter differs only in a constant of the diagram, it's everything that belongs inside the case. The "subset of table to replace" belongs to the outside.
    • Now, simply do the processing in a new event and ignore if the State isn't fair. Modify if needed.
  • tasks timed inside the loop

    I have a program that has multiple tasks, and I want to work at different frequencies inside the loop.  I wonder what is the most effective way to do this?

    I read on several tasks running button push-based or events, but have not found much of the timed tasks.

    Is the loop timed the best way to go with this?  Have a loop timed for each required task?

    I have attached a vi corrupt that shows what I'm trying to do.

    I'm sure there is an easy solution, but want to find more effective this way.

    Thank you

    For a simple task like this, just turn the loop at the faster pace, you need and perform other tasks to integer multiple of it.

    Here's a simple project (LV 8.6)

    (Of course you have serious problems with stolen memory, as you grow berries of infinite sizes in the uninitialized shift registers. Which must be fixed too).

  • stop the loop inside while loop

    Hi all

    Is there a way to stop a loop within a while loop? Error-free program will stop running when you press the stop button, but I want to while loop continues to run in and only for the loop stops when the condition is met.

    Thank you!

    Hi TayAus 1.

    If you want to run the execution once? Maybe something like below? The code inside the structure of events can only run when the event source is triggered. For example, the code in the digital works only when it detects a change in the numerical value (just an example).

    When the button is selected, it should raise the event to stop as shown below:

    If you want to create the event source, create the structure of the event > right-click on the frame and select edit events dealing with this... > This should open Edit events.

    The example below is that I put the event source for the change in the value of x and x 2.

    So when x or x 2 value is changed, executes the code in the sous-schema event shown below.

    Warm greetings,

    Lennard.C

  • How to transmit frames CAN cyclically inside a loop obey the emission data informed BCD?

    Hi all!

    I don't know if I don't completely understand the behavior of the situation below. I use LabVIEW 2014 and PXI-8513 card under Windows.

    NOR-XNET help reading I understood:

    Cyclical data : the data frame transmitted cyclically (periodical). The period is defined in the "transmission data" field in the properties BOX of the framework in the DBC file.

    But how the transmission time can obey informed transmission data in DBC file if I call the XNET write VI in a loop with a waiting inside? I don't know if I fully understand how it works in a while loop.

    I watch the program below, how writing would behave?

    While the loop contains a "wait until the next multiple ms" 100 and the signal selected database (dbc) has a transmission time of 0.02 s (20ms), how many times would the framework passed in the first loop?

    If your answer is "Although the time of transmitting the frame is 0.02 s in this case writing is written only once", I have another question: How can I keep a loop writing frames obeying the time of transmission of the image of the CBD? Consider that I have signals selected different frameworks at different times to transmit.

    Thanks in advance!

    When you use the XNET write Point with Single mode, it updates the value that will be transmitted according to the schedule specified in the XNET (DBC file) database. If you call multiple entries before the frame was transmitted, only the last value written shuts down during the NPC.

    If you look in the help file XNET under the API OR-XNET for LabVIEW-> Sessions-> Modes of Session, you will find information, including an example of how it works.

    In your example - if you have a timing loop of 100ms, but your message cyclic time is 1s, then will send you only the last value of 'editorial' more message cycle time. If your timing loop is 100ms, but your message time is 10ms, so you pass the value even 10 times (about... windows calendar and all that).

    In essence, you CAN transmitting frame continues to run in the background according to the time where you specified in the DBC file, but you can then update the values which are transmitted asynchronously using the single-point VI write.

    If you want to check the values passed are updated every time - you must use the stream or queue mode and your frames to the output of the buffer. That, or you must use a RT target that can update the data in a deterministic way.

  • Cannot use Select inside the loop For inside the SCTL (FPGA) - Bug? An alternative?

    When I put a Select statement inside a loop in a loop of Timed Cycle in LabVIEW FPGA, I get the following error when I try to compile:

    "An internal software error occurred. Please contact National Instruments technical support on ni.com/support with the following information:

    Error-61003 occurred at

    Possible reasons:

    LabVIEW FPGA: you cannot include this function in a loop For when the loop is within a single cycle timed loop. »

    I didn't know that whatever it is documented that says that this is not allowed; is this a bug or am I missing some documents?

    The code that causes this error looks like this, inside a SCTL (ignore Boolean wire wandering behind the loop for)

    I came up with the code below instead, which compiles into one Cycle timed loop, but it is a bit ugly. Does anyone have a better suggestion?

    This issue is currently followed under the CAR # 592391. Please keep an eye on our patches and new versions as usual!

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

  • Control does not after the exit of the loop of event handler

    My application brings together several controls user input.  When the user presses the OK button, it exits the event handler and the treatment.  During the treatment, it is not able to read the new values of the controls.  And in fact is no longer meets the stop button.

    When executing the attached VI, you will find that you can press the button of the switch and the LED indicates the status of the switch (this is my input from the user).  Now, press the OK button.  If you press the switch button, you will see that it works only once.  In addition, the stop button unresponsive to user input.  If you do not press the button, the stop button will cause the 2nd loop exit.

    Why the 2nd loop is unresponsive to the switch?

    It is a simplified version of my application in which two loops are separate from the States of my state machine.  There are several other States as well.

    The case of the event of the "change value" event has the property set to lock the Panel before the VI when the event is raised until the case of the event is over.

    Because the left while the loop is running not but the structuer event is always active FP everything is locked.

    Uncheck this option in the "edit event".

    Tone

  • conditional of the loop will not control read in a business event

    I made a simple conditional to the loop, with a timer and a generator of random numbers in the loop as a stop button attached to the conditional stop Terminal.  Everything works well and stop the loop when I click on the stop button. But I then wrap the conditional for the loop with a structure event and create an event to run the conditional for the loop.

    To my surprise, when I run this updated VI I can never get the loop to stop via the wired button until the conditional terminal stop.  How is what happens? And how to do this?

    change the case of the event > UNCHECK block façade up to the case of finishes (or whatever this text indicates actually in the lower left corner of the pop - up of the event edit)

    (~ ~ ~ oh-Magic 8-ball ~ ~ ~)

  • Activation of the loops through the events

    Hey guys.

    Let me start of by saying that I am self taught in LabVIEW and just started. The problems I encounter are so simple.

    Let me describe what I do, and then the problem that I need help. I am trying to automate a research facility that uses a series of valves, a massspectrometer and a potentiostat. I want a VI where I can press a button that causes the valves to open and close, in a given order, after which the massspec should make an experience, the experience, the valves must open closes in a certain order and return to an "inactive" State In fact I want several of these buttons for a different experience.

    Now to my problem: I did a VI that does something in the sense of what I wanted using events and while loops. See attachment for a simplified version. It uses a structure of the event with two buttons which activate their own business structure. However, if I place the eventstructure outside the while loop, the event is still running. If I place the event indoors (as in the example) the while loop I have to press one for each stage of the structure of the case. Note that "business" in the structure of the case are identical in the example, but they will not be in my final version of the program. Finally, the LEDS indicate whether the valve is open or closed. The LED matrix, y at - it instead a DAQ assistant.

    I hope that people can help me, please tell me if it needs to be clarified.

    It looks like you want a State in queue Machine or the Machine of State JKI.

  • Change the width of digital pulse inside the loop

    Hello

    I am looking for a solution that allow you to change the width of digital pulse inside while loop.

    Thanks in advance

    Check the operation of dataflow and single pulse meter output

    First counter generates little time, then big time.

    Your AO task then is to adjust tension on IT after Dig pulse. After the AO pulse width, he needs to put down

    If the Trac software is small enough for you, you might have used USB-6008 ($250), not Xseries $ 1600 - apparently of an overdose. X series can do this work with a void microsecond resolution.

  • Is it possible to put the property inside the loop node?

    I created three nodes of separation of property (color graphics) for my 3 XY graphs.

    Is it possible to have a property node, put this tag inside the loop where I ranges from 1 to N, and say plot_color_i

    where plot_color_1 would update 1 XY graph, plot_color_2 update XY Graph 2, etc. ?

    See the attached VI.

    Yes.  Create an array of references to the XY graphs and have this auto-index in the property node in the loop For

  • Graph XY plotting the question with the data of repeting inside the loop

    Hello

    I have this problem I'm having with my plots. Maybe there is a better way to do it.

    I have a set of data that I use inside a loop. I want the loop to keep reusing the same data. The reason I do that is because I want to continuously stream that loop exactly like that of my data file and plot it and do something different with it. My problem is that the XY graph does not draw correctly. I wonder if someone can help me to get field work and alo get data through the graph XY waveform.

    The files are attached. Test.VI is the main vi

    Note attachments removed by the request of the user of the admin-


Maybe you are looking for

  • (mac) no smoothing fonts in the menu bookmarks and other panels in 34 FF

    After the update to 34.0 FF anti-aliasing (font smoothing) in for example the sidebar bookmarks menu is GONE. any chance to get it with a topic: config setting? content of the site Web is fine, in addition to text on the tabs or in the browser bar

  • Portege R930: replace card mSata with SSD

    Hello I wanted to replace the 128 GB hard drive in my laptop. I bought a 256 GB SSD and read the User Guide.I don't see anything about the replacement of disc inside.When I open the PC, I discovered that there was an mSata card.Is it possible to repl

  • C00D1199

    I get this message when I try to play a file: Windows Media Player cannot play the file. The player might not support the file type or does not support the codec used to compress the file. How do I fix this? Kind thanks.

  • Class on cards SanDisk SDxx speed

    Each fact cards SanDisk class 2 SD (read 2 MB/s)? Y at - it a table that shows the different rates of SanDisk cards and whatever sysbols identify the speed?

  • TROUBLE GETTING INSTALLED CD

    I HAVE PLACE THE IN THE C DRIVE of CD.  HOW CAN I INSTALL THE CD ON THE COMPUTER?