f



loops in loops

In the attached vi, the one second loop runs at one second and can't be touched.  In the ten second loop, the ten second clock is a stand in for a process that generates a finished signal. The problem is once the process is complete, to start it again, leave the one second loop running, and start an additional process that will take less time than 10 seconds. thanks


internal loops.vi:
http://forums.ni.com/attachments/ni/170/319512/1/internal loops.vi
0
x9561 (148467)
4/28/2008 3:10:06 PM
comp.lang.labview 35213 articles. 1 followers. vasusachin24 (1) is leader. Post Follow

6 Replies
1921 Views

Similar Articles

[PageSpeed] 14

Hi exo,
what do you try there? If you start your vi, the value from your stop button will be read and after that, both loops "one" second and "ten" second won�t notice the state change of the stop button. Can you please explain, what you try to do??
Mike
0
x9561 (148467)
4/28/2008 3:10:08 PM
Okay, let me try again.  I need three loops. Two loops start at the same time one runs fast one runs slow. The slow one is probably independent to the problem. When the second loop is done, it needs to restart and start a third loop that takes less than the second.
0
x9561 (148467)
4/28/2008 3:40:08 PM
You have a very basic dataflow problems. Unfortunately, I don't understand your description.
 
I would recommend starting with some basic LabVIEW tutorials.
 
Here are some obvious mistakes:

- Your loop cannot read changes in the stop button, because the terminal is outside the loop.

- You reset "internal loop" to zero in parallel to the loops. You cannot guarantee that this will happen before the locals are read so you might have a race condition.

- The 10second wait runs in parallel to the event structure so the wait times will interact possibly in an unpredictable way.

- Your "internal loop" indicator has the sole purpose to act as a local variable. A shift register is more appropriate, eliminating all the locals. Just hook the indicator to the inner shift wire to see the progress.

- Event structures don't react to programmatic value changes, so your even will never fire!

- Your event structure is completely meaningless, because the "ten second loop" changes with each iteration automatically and since you seem to want to trigger it in this case, NO even structure is needed!
0
x9561 (148467)
4/28/2008 3:40:09 PM
exo wrote:Okay, let me try again. I need three loops. Two loops start at the same time one runs fast one runs slow. The slow one is probably independent to the problem. When the second loop is done, it needs to restart and start a third loop that takes less than the second.


This is all still very vague. You are omitting crucial information.

- Which one is the "second loop". Slow or fast?

- What is the meaning or "probably" in this context?

- Should the first loop continue forever?

- What determines if the second loop is done?

- What does the third loop do during that one second? Is it actually looping many times or is it just executing some code once?

- What should happen after the third loop is done?

It might be much easier if you could describe your problem from a real-world perspective instead of programming terms.
What is it suppused to do? What is is controlling? What behavior should the user see?Message Edited by altenbach on 04-28-2008  08:32 AM
0
x9561 (148467)
4/28/2008 3:40:09 PM
I'm acquiring data for a fixed length of time.  During that time, I have to monitor, at a faster rate, my position. Once the data has been acquired I have to start acquiring more data. At the same time so as not to interrupt the data collection, I have to down load the previously acquired data to a file and update the file's header.
0
x9561 (148467)
4/28/2008 4:10:04 PM
How time critical is the acquisition?  Is it 1000 samples/sec? 100's? 10's? 
Multiple loops is not always the solution.  You need to define the sampling rate, intervals between samples (first set stops / second begins).
Also how is the data acquired?  Is it a DAQ board?  is it buffered?  What is the target PC / OS?  Single / multicore (additional tricks ;) )...
It is important to understall all constraints in order to suggest a better architecture.
RayR
0
x9561 (148467)
4/28/2008 5:10:10 PM
Reply:

Web resources about - loops in loops - comp.lang.labview

iPhone, iPad, Mac, Apple opinion and news - The Loop
The Loop provides comprehensive and insightful news, editorial, and commentary on iPhone, iPod, Macintosh, associated third-party software and ...

Eschborn-Frankfurt City Loop - Wikipedia, the free encyclopedia
The Eschborn-Frankfurt City Loop (until 2008 Rund um den Henninger-Turm , sometimes called the Frankfurt Grand Prix in English; in 2010 Rund ...

Apple’s March 21st ‘Let us loop you in’ event is official: 4-inch iPhone SE + 9.7-inch iPad Pro & much ...
Apple has officially announced its upcoming spring event ( via @tim ) scheduled for March 21st in Cupertino at Apple’s 1 Infinite Loop campus ...

Big rig rollover backs up East Loop SB before Port of Houston
An accident involving a jackknifed 18-wheeler has backed up traffic on the 610 East Loop southbound before the Port of Houston.

Apple plans to 'loop you in' at March 21 event with expected new 4" iPhone, 9.7" iPad
Apple Insider Apple plans to 'loop you in' at March 21 event with expected new 4" iPhone, 9.7" iPad Apple Insider Apple on Thursday officially ...

Let us loop you in: What to expect from Apple’s March 21 event
Apple CEO Tim Cook takes the stage at the company's September 2015 product event. (credit: Andrew Cunningham) Apple's having an event next Monday. ...

David Beckham has spent his retirement watching ‘Frozen’ on a loop with Harper
While David Beckham has never made my Top-Ten Crushes, I’ve always sort of liked him. I like him even more these days, as we get to see him more ...

Apple sends invites for March 21 event with clue 'let us loop you in'
A 4-inch iPhone and an updated iPad are among the new products expected to be announced.

Apple’s March 21 event promises to ‘loop you in’
Apple has confirmed the date of its next keynote event, which will take place on March 21 in Cupertino, California. Invitations to the event ...

Loop.pH's colour-changing BMX installation reflects air quality
Conceived as a pair of "lungs" connected by two looping cycle tracks, Loop.pH's VeL02 lighting installation changes colour according to air quality. ...

Resources last updated: 3/19/2016 10:51:09 AM