View Single Post
  #3   Spotlight this post!  
Unread 09-10-2014, 11:13
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,751
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: Parallel loops vs. One loop?

Are you asking because you have CPU issues? LabVIEW is quite efficient at doing parallel loops, so ideally you make the decision based on what makes sense.

Let's compare having one 20ms loop where we place all subsystems that run at that rate into the single loop, to having multiple loops all running at 20ms. The biggest difference is that the parallel loops are not synchronized. You don't know which starts first, which finishes first, etc. Additionally, if something happens in one loop that would delay it, it will not have much impact on the other loops.

If the code is in one loop, the data connections can directly synchronize things. You may need this, you may not. Additionally, if one operation starts to take longer, it directly affects all things in that loop.

If you have CPU issues or want to gain understanding of how often a loop is running, please follow what is in Mike's post. If you have other questions, please post them in more detail, perhaps even including your code.

Greg McKaskle
Reply With Quote