Independence of two Structures of loop time

I would like to take the data to data acquisition. However, I have little problem. I want to do those two things at the same time:

1. data hold and display these data in (almost) real-time with relative fast sampling rate around 10 KHz of a nor-DAQ => I am able to do using a while loop

2 have a different view of 1 data in a specified time interval (for example, to display the data of 1 every 10s) ==>, I am able to do this using a loop of the timer. This task is dependent on task 1

The problem is that I can't do those two things at the same time by a. put the timer loop inside while loop or timer b. loop and the loop while seperatedly. I think that the problem was because the loop of the timer number 2 with the while loop and b because the data, the while loop (taken from the DAQ) is not sent to the loop of the timer. How would I fix this?

The two fragments of your code are meaningless in terms of data flow:

Left: the outer loop acquires a set of data, it displays on the chart. Then the code is trapped in the inner loop until "stop 2" is supported, how we grap another set of data and find themselves trapped again inside the inner loop... In the inner loop will update s2 with the obsolete data every 100 seconds, no new information will get acquired during its execution.

Right: the loop on the right cannot start as long as has only the loop in the middle. It is based on the data of the loop in the middle.

Why don't design you your program with a simulator of data, then use run to highlight in order to better understand the flow of data.

In summary: you can use two independent , one for data acquisition loops and one for the event unusual display. Allow them to communicate with for example a queue waiting or similar. You can also use a simple loop. Place the second chart within a business structure and activate only every n seconds.

Tags: NI Software

Similar Questions

  • FPGA: Vs timed loop Timer?

    Hello

    I would like to create a FPGA loop that runs at a fixed rate. Whatever if I use a timed loop structure or a timer loop express VI into a regular while loop? Under what circumstances should I choose one over the other?

    I understand that the timer loop approach can cause the code in the loop run twice before calendar is established (but this isn't a problem for me here). Are there other differences in the two approaches?

    Thanks in advance.

    JKSH wrote:

    But my question was about the differences between the use of "multi-cycle" Timed loops and VI express loop timer.

    In a targeted FPGA VI, all call loops are single cycle timed loops (SCTL).  This means that all the code in a SCTL must run in a clock cycle, so there are a few types of nodes cannot be used in such a loop.  In a used while loop with a timer, you can use a wider range of features, but the loop will generally run much more slowly.

    These documents may be useful to learn how to use loops clocked on FPGA:

    Using loops of Cycle time unique to optimize the FPGA VIs

    Optimization of your screws of LabVIEW FPGA: running in parallel and Pipelining

  • loop time / frequency

    I have attached a simple with the 2 program and 2 the AO.  The acquisition rate is set at 1000 Hz, but the time loop is 2ms, when I expect it to be 1 ms.  When I change the rate to 500, loop time goes up to 4ms, instead of 2 ms.  What Miss me?

    Maciek

    (Sorry, I've got DAQmx installed, so I can't really look at the details of your code).

    In the top spot, you read interation of loop twice, once for the post and once for the force. Once is not enough?

    Read once and just two values on the same table indices both 2D. See if that makes a difference.

  • Why two structures parallel event influence each other

    I have a puzzle on the execution of two parallel event structures. See instant attachment and vi.

    The two structures parallel event sit in two different while loops. During the event "mouse down" arrives on numeric1, it will take 10 s waiting in this case. Meawhile, if the "mouse down" event that happens on numeric2, does not respond before the end of the first case of event structure "mouse down".

    This mechanism seems against the parallet operate the mechanism because the two same-while loops has no relationship.

    Thank you.

    WT

    weitong wrote:

    I have a puzzle on the execution of two parallel event structures. See instant attachment and vi.

    The two structures parallel event sit in two different while loops. During the event "mouse down" arrives on numeric1, it will take 10 s waiting in this case. Meawhile, if the "mouse down" event that happens on numeric2, does not respond before the end of the first case of event structure "mouse down".

    This mechanism seems against the parallet operate the mechanism because the two same-while loops has no relationship.

    Thank you.

    WT

    What is happening is very correct depending on the configuration. If you want to get what you want, go to the structure of the event 1 "edit the tΓche" and uncheck the option "Cover Lock".

  • Then as the loop timer Timing vannes_ouvertes. Elements

    I would like this while loop to iterate through every second. But it seems that he doesen't recognize the loop timer. What's wrong?

    Just found the article to help talking about it: Debugging of FPGA screws using Mode Simulation (FPGA Module)

    At the bottom, it says:

    Understanding simulated time on the host computer

    If you use some FPGA resources and you run the FPGA VI in simulated using I/O simulation mode, the resource uses simulated time rather than real time. Simulated time could be faster than real time according to the number of events that occur during the simulation. For example, if you add a waiting VI (simulated time) for the schema and set the timeout to 1000 ms, LabVIEW does not attempt to delay a second of real time. Instead, LabVIEW delays as long as necessary before performing the next action scheduled in the simulation.

    The following resources are using the simulated time on the host:

    • Then the loops

    • Single-Cycle timed loops

    • VI of waiting (simulated time)

    • Loop timer Express VI

    • Number of cycles Express VI

    • FIFO, except DMA FIFO

    • Wait on Occurrence with Timeout based on ticks

    • Interrupt the VI, during her wait until this that clear is TRUE

  • Two different running loops one after another with different time intervals

    Hello

    I am currently using LabVIEW 2013. I'm new to LabVIEW.

    I take 10 values to data acquisition during the 9-10 sec time interval within a period of 10 seconds.

    I thought runs two loops. 1st loop will run for 9seconds out giving zero and the second loop will launch with 1 second left taking all the required 10 values. can someone help me in this way to do it. If you can suggest me any other idea.

    Thank you.

    Your task of data acquisition is to take 10 samples in 1 second (I assume that you also spaced).  10 samples/s = sampling frequency of 10 Hz (Hz = events/second).  To configure DAQmx tasks, MAX is your friend.  Open MAX, find your device (plugged in), open a panel of Test and find a way to let him taste at 10 Hz and collect 10 samples.  Test to see if it works.  Get it now to save as task.

    Now, when you configure your block diagram, drop a DAQmx Start Task (or even read DAQ) and wire an empty constant to the task in.  See the little arrow for menu drop-down?  If you click on it, one of the choices should be the task DAQ, you just saved.  Select that and it will work.

    Now, all you have to do is wait 9 seconds before acquiriing your 10 points.  There are functions of synchronization that can allow you to do this.

    Bob Schor

  • How to start two events different loops depending on tab selection

    Hello

    I have a tab control with two tabs and various controls and indicators on the subject.

    In the background is a while loop that contains a structure of the event which reacts on the different button-"change value" - events.

    There is one "end"-button on the Panel that stops the loop. "."

    Now the question:

    How can I add a while loop second with a second structure of the event and depending on the selection tab that the corresponding loop should run.

    Because I would like the events of two separate tabs.

    I think that it s possible to wire the stop at the value tab loop but how do to restart the loop?

    Thx for the help

    Iliale wrote:

    Why is the event in the attachment execution?

    If I have the wiring on the right side of the DI_1:ValueSignaling property, then it still runs and can only be stopped by the Task Manager...

    THX

    Because every time you write for the value property and event signage is queued up.  This occurs even if the value has not changed.  You probably want to add a registry node or shift of feedback to ensure the follow-up of the State of the LED.  XOR the current value with the previous.  If the XOR is true, it means that the value has changed.  Only write in the property node when the value changes.

  • Case of Structure / while loop problems

    Hello

    I am trying to write a code that draws a random number whenever a key is pressed.  The chart must be a random number on the y axis and the number of times that the button is pressed on the x-axis.  I want to draw the last twenty random numbers.  I use a while loop and a box structure.  If the button is pressed, the case structure incruments the number of times where the button is pressed and generates a random number.  I'm using shift registers to track the last twenty numbers generated.  When the key not, registers to shift to day values incorrectly.  My code is associated with this issue.

    I know that the last value of the shift registers of wiring to the structure of the case will change the table across the last value when the button is not pressed.  I know what causes the problem, but I don't know how to fix it.  I would appreciate it if you have a look and give me some tips.

    Thanks in advance.

    Your problem is that the loop runs continuously and your values in the shift register are replaced when you do nothing.

    There are a few ways around this.  It would be simpler to use a Structure of the event.  Another option is to simply store your table in the shiftregister.  Use Rotate 1-d Array and replace a subset of table to update your chart.  It is a little more robust and easier to use than using the history of the shift register.

    But the absolute simplest, based only on what you told us, just use a graphic instead of a graph.  A graph keeps a history.  The length of the default history is 1024 samples, then you want to reduce that to 20.  Then you just wire your random number right in the chart, and everything is done for you.

  • Stopping at two simultaneously while loops in a sequence

    I'm under two loops while at the same time. A while loop is used to produce a square using the acquisition of data USB of NOR-6343 wave. The another while loop contains my main code. I make sure that my square wave while loop stops after the hand while the loop is over. I used the function "To highlight the Excution" to see if my code is excuting in order and the way I expected to and it seems to do, but when I hit the button stop the square wave while loop stops so that the main while loop always ends excuation. The main while loop takes a series of measures using the data acquisition Toolbox, so I need to make sure that the square wave is being emitted during the execution of the loop of mian.

    Currently to work around this problem, I wired a constant numberic (101) inside the large loop for a numberic out indicator. And I used a cheque codition "Equal" in the square wave while loop and set it so that this loop stops when he sees the value. This seems to work and made sure my square wave still series, while the main loop is excuting finishing. Even if it works, I want to know if there is a better way. Attached are a couple of screenshot of the loops.

    I vote for using a notification utility.  You must order the loop at the end.  Do a front panel indicator to stop a loop is not a good practice.

  • Two express AirPort and time capsule connectivity challenge

    Dear readers,

    I have a Time Capsule 802.11 ac connected to my ISP router and this is the router that provides DHCP addresses, etc. In our living room, I have an airport express (2nd generation) connected via radio and it works very well also. Now I got as a second AE (2nd generation) and want to put it on the floor of the attic to get a stronger signal via Ethernet to my TC. When I connect to a LAN of the TC port to the EI LAN port, the AE salon disconnects. When I add the Ethernet of AE cable in the WAN port both t he AE to the attic and TC disconnected. Currently, it is also connected via radio and it works, but will of course loose flow because it must still go through the different floors through the air compared to a stronger signal via Ethernet.

    Question I have, can I connect an AE with an Ethernet cable (and how to set up the AE or TC as a result) and an adverse event via wireless (IE editing exsisting which works, but let me know if you have to configure changes too)?

    Your help is very appreciated.

    Can question I have, I connect an adverse event with an Ethernet cable (and how to set up the AE or TC as a result)

    Yes, but you will need to restart and reset back to default settings AE. Then connect the Ethernet cable between a LAN <>- on the TC port to the "O" of EI before WAN port you are trying to configure EI.

    The problem that you are experiencing now is probably caused by connecting an Ethernet cable to an adverse event that has already been configured to "extend a wireless network. When EI is configured this way, is expected to Wireless ... not Ethernet. Ethernet is applied, it creates a feedback loop huge on the network which can cause all sorts of issues.

    Wizard Installation from Apple because most of the work for you. Just click the WiFi icon at the top of the screen of the Mac and then click on AirPort Express under the title of the new AirPort base station.

    When you click on AirPort Express, which will start the configuration "Wizard". It will take a few seconds to analyze the network, and then present a screen that looks like this:

    Type a device name you want to call the AE, and then click Next.  Monitor the screen following very closely... See the illustration below to confirm that the AE is set up "extend using Ethernet.  Who will confirm that the wizard picked the Ethernet between the TC and AE and apply the correct settings to EI.

    When you see the message Setup is complete, click done and you're done.

    If the 'other' AE is already set up to extend, then no further changes will be necessary on this device.

  • all structure of loop and sequence

    Hello world.
    I'm posting here cause I have not found an answer yet on this forum.
    I would like to know if there is anyway to trigger a while loop with a sequence structure.
    I made an example for better understanding.

    My program is harder, but it sums up what I have to do.
    Thanks for reading


  • Writing file case structure while loop?

    I would like to have a button on the front panel which indicates to start streaming data recording or not.  If the user does not press a button, no data is saved, and the façade works only as a display of data.

    I have now does not correctly.  The button is a while loop that is attached to a matter outside the loop structure.  I would like to a false statement to not save data to any file, but I needed to wire my knots of structure dealing with something, so the T and F are currently the same action (sort of).  How do I wire this configuration correctly please?

    Thank you!


  • Problem running two parallel while loops

    Hello world

    I'm new to Labview and is actually my first attempt. I intend to acquire data from two rockers simultaneously through two different ports. When I run my program attached with execution has highlighted, the second loop gets higher priority. How to prevent this? Also, I'm getting error codes when running arrives at the stage where Visa read data are passed to sweep of string function. Please suggest corrections to correct these problems.

    PS: I have not yet plugged on devices, that's why the properties of connection for the two Ports are the same at the moment.

    Kind regards

    Avi0111


  • Output signal analog two at the same time with the SCC-68. Is this possible?

    Hello!

    I plug in my SCC-68 two things. You're driving in the ao0 (22 screw terminals) and aoGND (55 terminal screw) and a speaker in ao1 (terminal screws 21) and aoGND (55 terminal screw).

    I'm trying to generate a sugnal ao1 sine and a DC ao0 signal. Separately, they work, but at the same time they do not have...

    I had try in Labview SignalExpress and also...

    Any help?

    Thanks: Koli

    Hi Koli,

    already use you it in your code. The vi s Express that you marked with ao0 ao1. :-)

    Mike

  • Do nothing in the case structure with loop For

    Hello

    I am trying to extract data from my signal (0.3 0.4 0.6...). I want to extract values greater than 0.5 and put it in a table. If I use a loop For which I can determine each index of my data to be compared and it happened in the structure of the case. In the 'Real' box, I wanted the value to extract outside the loop For. And I want to "do nothing" if my value falls within the box 'False. ' However, it displays error, saying "' Tunnel: lack of assignment to the tunnel '."

    I tried to select 'Default', but it does not work since I use a Boolean comparison. I tried to use the registry to shift, but in vain too.

    Someone could guide me on this to extract only a value greater than 0.5 and index them?

    For example "0.6 0.7 0.8; 3 4 7 index.

    Satisfaction will be given.

    Here you have

Maybe you are looking for