Go to Post Health. Family. School. FIRST. Any other order is a mistake. - pfreivald [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 08-12-2016, 14:45
kelsey.m kelsey.m is offline
FRC 4928
FRC #3562 (Arabian Knights)
Team Role: Coach
 
Join Date: Sep 2013
Rookie Year: 2007
Location: Buhl, Idaho
Posts: 25
kelsey.m is an unknown quantity at this point
Request for Screenshots of Code for Time Delay

We would love screen shots of code that uses a time delay.
Background: We are rookies making use of another team's retired robot. we've been able to write drive code but to effectively use the shooter we want code that with one button runs the shooter motors for 2 seconds before another motor pushes the ball forward. We can do all of these steps with separate pieces of code but combining them on one button with the time delay doesn't work.
Anything is helpful but screenshots are preferable, we're new to this so go easy on LabVIEW vocabulary... thanks!
__________________
3456 LiveWire
4928 Arabian Knights
3562 4H LiveWire Robotics
TooNewForANumber Buhl High School
Reply With Quote
  #2   Spotlight this post!  
Unread 08-12-2016, 14:49
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,683
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Request for Screenshots of Code for Time Delay

Something like this?
This does NOT go in Teleop.vi - it goes in Periodic Tasks.vi
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
  #3   Spotlight this post!  
Unread 08-12-2016, 16:52
kelsey.m kelsey.m is offline
FRC 4928
FRC #3562 (Arabian Knights)
Team Role: Coach
 
Join Date: Sep 2013
Rookie Year: 2007
Location: Buhl, Idaho
Posts: 25
kelsey.m is an unknown quantity at this point
Re: Request for Screenshots of Code for Time Delay

Thanks! We'll have students here in the next half hour to try it out so if it doesn't work I can add our screenshots too. So do ALL time related tasks go in the Periodic VI? It seemed since it was a teleoperated feature it belonged in that vi...
__________________
3456 LiveWire
4928 Arabian Knights
3562 4H LiveWire Robotics
TooNewForANumber Buhl High School
Reply With Quote
  #4   Spotlight this post!  
Unread 08-12-2016, 17:47
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,683
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Request for Screenshots of Code for Time Delay

Periodic Tasks is designed to handle any background tasks that can operate independently regardless of embedded time delays.
This code gets dropped in there as-is. Put it in white space completely separate from anything else already in there.
If you haven't seen these before, this image is more than just an image, it's what's called a vi snippet that can be dragged and dropped onto a block diagram whitespace to generate all the code seen. Just right-click and use Save Image As... to get the image to drag and drop on your desktop.

Everything in Teleop.vi must complete in less than 20ms, so timed delays cannot be used in there.
If Teleop code takes longer than 20ms it will stop responding to drive controls for as long as it is tied up.
To do the processing of a sequence of events in Teleop, you would need to use a state machine that simply checked what it should be doing during each 20ms pass through Teleop.vi.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 08-12-2016 at 18:15.
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 02:32.

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