Go to Post Reach out to successful teams and ask them for help, rather than complain about them. I have never seen a successful team deny help to anyone. - OZ_341 [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 11-02-2013, 22:03
ILikePizza555's Avatar
ILikePizza555 ILikePizza555 is offline
Registered User
AKA: Isaac Avram
FRC #2761 (CN Ironhorse)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Fresno, CA
Posts: 63
ILikePizza555 is an unknown quantity at this point
Button Checking Code lags Teleop.vi

I have some code that I'm using to check button presses on a joystick. It looks like this:



For some reason this code keeps hanging the program, and it takes forever to send output to a motor. I verified this but wrapping it in a disabled diagram block. Any workarounds?
__________________
PONIES ARE STOOPID MAGIK -Heavy
Reply With Quote
  #2   Spotlight this post!  
Unread 11-02-2013, 23:16
propionate's Avatar
propionate propionate is offline
Team co-lead and LabVIEW programmer
AKA: Stephen
FRC #1732 (Hilltopper Robotics)
 
Join Date: Jan 2012
Rookie Year: 2009
Location: Milwaukee
Posts: 93
propionate is on a distinguished road
Re: Button Checking Code lags Teleop.vi

I'm a little confused as to why you have contained your separate motor control VI's in a flat sequence. Are you attempting to run these controls in a particular order if a certain combination of buttons is pressed? If not, there is no need for the flat sequence structure.
Reply With Quote
  #3   Spotlight this post!  
Unread 12-02-2013, 07:11
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: Button Checking Code lags Teleop.vi

I assume you placed that code into teleop. If teleop doesn't read the joysticks and update the robotDrive many times per second, it will act as you describe. Once your sequence starts, the delays prevent teleop from doing the robotDrive task.

What most teams do is to move the code you've shown into periodic tasks. That way teleop can run quickly and return to the scheduler.

Greg McKaskle
Reply With Quote
  #4   Spotlight this post!  
Unread 12-02-2013, 20:03
ILikePizza555's Avatar
ILikePizza555 ILikePizza555 is offline
Registered User
AKA: Isaac Avram
FRC #2761 (CN Ironhorse)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Fresno, CA
Posts: 63
ILikePizza555 is an unknown quantity at this point
Re: Button Checking Code lags Teleop.vi

Quote:
Originally Posted by propionate View Post
I'm a little confused as to why you have contained your separate motor control VI's in a flat sequence. Are you attempting to run these controls in a particular order if a certain combination of buttons is pressed? If not, there is no need for the flat sequence structure.
I had the idea that it was running too many things at once, and that if I put it into a flat sequence structure, it will slow down a bit. That, and I'm more used to coded languages such as python or java, the flat sequence make a little bit more "sence" to me.

Quote:
Originally Posted by Greg McKaskle View Post
I assume you placed that code into teleop. If teleop doesn't read the joysticks and update the robotDrive many times per second, it will act as you describe. Once your sequence starts, the delays prevent teleop from doing the robotDrive task.

What most teams do is to move the code you've shown into periodic tasks. That way teleop can run quickly and return to the scheduler.

Greg McKaskle
I'll try that tonight, thanks.
__________________
PONIES ARE STOOPID MAGIK -Heavy
Reply With Quote
  #5   Spotlight this post!  
Unread 13-02-2013, 01:03
ILikePizza555's Avatar
ILikePizza555 ILikePizza555 is offline
Registered User
AKA: Isaac Avram
FRC #2761 (CN Ironhorse)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Fresno, CA
Posts: 63
ILikePizza555 is an unknown quantity at this point
Re: Button Checking Code lags Teleop.vi

Found out that it wasn't the button checking code, but the fact that SetOutput causes some sort of lag for some reason when it trys to set motor output on a jag that doesn't exist. Is this normal?
__________________
PONIES ARE STOOPID MAGIK -Heavy
Reply With Quote
  #6   Spotlight this post!  
Unread 13-02-2013, 09:42
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: Button Checking Code lags Teleop.vi

Quote:
Originally Posted by ILikePizza555 View Post
Found out that it wasn't the button checking code, but the fact that SetOutput causes some sort of lag for some reason when it trys to set motor output on a jag that doesn't exist. Is this normal?
Yes, this will happen when you try and access a refnum that hasn't been previously opened. If you look on your Drive Station at the error messages, you'll see your program throwing an error of that nature. Your code will slow down noticeably when there are errors being thrown, as handling them takes processing power away from your main code.
__________________
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:55.

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