Go to Post Kyle from team 45 said "Dude, I still have 2 years left in FIRST ahahaha.." My response to that was... "Kyle, I have till the day I die." - Arefin Bari [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 15-03-2012, 15:08
Quellek2 Quellek2 is offline
Registered User
FRC #4121
 
Join Date: Jan 2012
Location: North Canton, OH
Posts: 10
Quellek2 is an unknown quantity at this point
Desperately need help optimizing

We are a rookie team, we started with no knowledge of how to do labview (but figured most of it out eventually). We rushed through the six weeks frantically trying to get it to work, without regards for optimization due to time constraints. When we tested it, everything worked individually, except it was VERY laggy. It would work, then cut out, then work again and so on.

We need help optimizing this. We heard things about letting some of the operation happen on the laptop, but we have absolutely no idea how.

I'm willing to send the project to someone who is willing to help... We need it.
Reply With Quote
  #2   Spotlight this post!  
Unread 15-03-2012, 17:17
tilky's Avatar
tilky tilky is offline
Registered User
AKA: Ryan Thielke
FRC #3137
Team Role: Programmer
 
Join Date: Nov 2011
Rookie Year: 2011
Location: Connetquot
Posts: 188
tilky is an unknown quantity at this point
Re: Desperately need help optimizing

did you set waits in any while loops in periodic tasks? There are no loops in teleop I hope, right?
Reply With Quote
  #3   Spotlight this post!  
Unread 15-03-2012, 17:23
dsherw00d dsherw00d is offline
Registered User
FRC #0378
 
Join Date: Jan 2012
Location: Newfane NY
Posts: 44
dsherw00d is a jewel in the roughdsherw00d is a jewel in the roughdsherw00d is a jewel in the rough
Re: Desperately need help optimizing

Have you been to your first competition yet? During practice/qualifying rounds, the staff at the event will let you know if you are having any packet loss. This would be caused most likely by the camera. The camera default frame rate is 30 fps and the may recommend changing it to 10 fps. Does it happen when you are tethered? If it does not, it's probably packet loss across the WiFi.


The other option is what is running in periodictasks.vi. There are different times loops. If you are running something in a fast loop that doesn't give enough control to other parts, maybe it could tie up the CPU.

In the driver station, there is a tab where you can view CPU and network utilization stats. Do you know if your CPU is running at close to 100%? I've read that lots of teams are running near 100% at time.
Reply With Quote
  #4   Spotlight this post!  
Unread 15-03-2012, 19:08
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,752
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: Desperately need help optimizing

If you want to post your code, or pictures of the major code you edited, people will give feedback. You can also ask questions you may have had while writing the code related to performance.

Optimizing code mostly involves measuring it, finding the slowest stuff, or the stuff which is farthest from the time it should execute in, and fixing issues until the performance is what you want. There isn't one problem or one solution.

Greg McKaskle
Reply With Quote
  #5   Spotlight this post!  
Unread 15-03-2012, 22:10
plnyyanks's Avatar
plnyyanks plnyyanks is offline
Data wins arguments.
AKA: Phil Lopreiato
FRC #1124 (The ÜberBots), FRC #2900 (The Mighty Penguins)
Team Role: College Student
 
Join Date: Apr 2010
Rookie Year: 2010
Location: NYC/Washington, DC
Posts: 1,114
plnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond repute
Re: Desperately need help optimizing

Quote:
Originally Posted by Greg McKaskle View Post
Optimizing code mostly involves measuring it, finding the slowest stuff, or the stuff which is farthest from the time it should execute in, and fixing issues until the performance is what you want. There isn't one problem or one solution.
This. There's a saying that 80% of execution time is spent on 20% of your code. The hard part is finding the 20%. To do that, you'll have to go through your code with a fine toothed comb (metaphorically, that is) and try and make is as efficient as possible. Just make sure that all your loops are appropriately throttled, your code is error-free (handling errors in resource intensive), and that you generally have good coding styles. I also like In Place Element Structures, since they provide a good way to write to memory without wasting too much of it. There was also a really good post detailing some ways to reduce some CPU usage, which a lot of teams are struggling with this year.

If you look around the internet, you'll find that NI is awesome (what else is new?) and has a few really helpful documents on optimizing your code.
http://zone.ni.com/devzone/cda/tut/p/id/3747
http://zone.ni.com/reference/en-XX/h..._memory_usage/
https://decibel.ni.com/content/docs/DOC-15337
http://digital.ni.com/public.nsf/all...256CAB00079F57
http://zone.ni.com/devzone/cda/tut/p/id/11472

Just take some time to go through your code, watch memory/CPU usage closely (it's displayed on the Driver Station 'Charts' tab), and do what you can to bring them down as much as possible.
__________________
Phil Lopreiato - "It's a hardware problem"
Team 1124 (2010 - 2013), Team 1418 (2014), Team 2900 (2016)
FRC Notebook The Blue Alliance for Android
Reply With Quote
Reply


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 22:05.

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