|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
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! |
|
#2
|
|||||
|
|||||
|
Re: Request for Screenshots of Code for Time Delay
|
|
#3
|
|||
|
|||
|
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...
|
|
#4
|
|||||
|
|||||
|
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. Last edited by Mark McLeod : 08-12-2016 at 18:15. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|