Go to Post "You know, if we shoot the flame thrower out of the back of the car while driving down Main Street at 2:00am, we are probably going to get in a lot of trouble..." - dlavery [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 18-02-2012, 04:37
Luiz12 Luiz12 is offline
Registered User
FRC #4210
 
Join Date: Jan 2012
Location: South Gate
Posts: 45
Luiz12 is an unknown quantity at this point
How many flat sequences in periodic Tasks.vi

Hi I'm trying to run two while loops each with a flat sequence. Will it create any trouble if these two loops run at the same time or can I put both flat sequences into a single while loop.
  #2   Spotlight this post!  
Unread 18-02-2012, 08:24
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,756
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: How many flat sequences in periodic Tasks.vi

There isn't much difference, but they aren't identical either. Let me describe, and you select the one most appropriate.

Two loops are not necessarily synchronized. One could start and finish before the other even begins, and due to drift or jitter, after a larger amount of time, two loops running at the same rate could even have run different numbers of times.

A single loop synchronizes to its contents. It will not start again until everything inside of it has run once -- switch structures don't have to run all cases, but they have to run one. This means that the contents are guaranteed to be run the same number of times. If one is slow, they are both slowed, etc.

Sequence structures do nothing but guarantee execution order when there is no data passing from between the nodes. They aren't really needed that often, but generally don't do any harm unless you force the code to go in the wrong order. They are most useful for introducing delays between commands.

Greg McKaskle

Last edited by Greg McKaskle : 18-02-2012 at 08:25. Reason: Finish my thought.
  #3   Spotlight this post!  
Unread 18-02-2012, 08:36
Luiz12 Luiz12 is offline
Registered User
FRC #4210
 
Join Date: Jan 2012
Location: South Gate
Posts: 45
Luiz12 is an unknown quantity at this point
Re: How many flat sequences in periodic Tasks.vi

Well that's exactly what I wanted to do, create a delay while the robot arm engages until the next motor started. The problem that I faced was that I put two different sequence structures in the same loop but every thing went out of control. When I test each sequence individually it works, so does it that I should split both sequences into individual while loops instead of putting them in the the same loop?
  #4   Spotlight this post!  
Unread 18-02-2012, 08:41
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,756
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: How many flat sequences in periodic Tasks.vi

If you don't want them to be synchronized, yes, split them out. Does the unwanted synchronization explain the symptom you see?

Greg McKaskle
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 01:36.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi