Go to Post Along with having good manners, having good judgement goes a long way in life. - ebarker [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-02-2017, 17:13
orangeandblack5 orangeandblack5 is offline
Hates LabView - Uses It Anyway
AKA: Ian Stewart
FRC #5498 (Wired Devils)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2015
Location: Grosse Ile, MI
Posts: 36
orangeandblack5 will become famous soon enough
So apparently flat sequence structures don't work well in Teleop.

I'm trying to make a button press open and close a motor. Should I make a SubVI to handle the flat sequence structure, move the flat sequence structure to Periodic Tasks, or use some other method to do this? I figured I'd ask here since I'm done wasting time on something that should be a simple task (thanks LabView ).
Reply With Quote
  #2   Spotlight this post!  
Unread 08-02-2017, 17:19
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
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,945
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: So apparently flat sequence structures don't work well in Teleop.

Best describe the steps you want to take, e.g., what's the sequence you want to have happen when that button is pressed.
Periodic Tasks is usually for sequences, because they often require delays-like push a button, run a motor for 5 seconds, then stop.
You can't have any Delay in Teleop.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 08-02-2017 at 17:22.
Reply With Quote
  #3   Spotlight this post!  
Unread Yesterday, 12:53
orangeandblack5 orangeandblack5 is offline
Hates LabView - Uses It Anyway
AKA: Ian Stewart
FRC #5498 (Wired Devils)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2015
Location: Grosse Ile, MI
Posts: 36
orangeandblack5 will become famous soon enough
Re: So apparently flat sequence structures don't work well in Teleop.

-Push a button
-Run motor for x ms (TBD)
-Hold motor for x ms and until button is released
-Run motor until a limit switch is activated
Reply With Quote
  #4   Spotlight this post!  
Unread Yesterday, 13:11
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
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,945
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: So apparently flat sequence structures don't work well in Teleop.

Here's a similar example that runs in Periodic Tasks: http://www.team358.org/files/program...tofTimedAction

The tie-in of waiting on a button release for the 3rd action step would require another While Loop inside the 3rd sequence frame that keeps checking for button=False, before completing.
Something like this, where it waits 1000ms and for button 2 to be False (either one finishes first it waits for the other to complete):
Attached Thumbnails
Click image for larger version

Name:	button-check.jpg
Views:	12
Size:	15.8 KB
ID:	21768  
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : Yesterday at 13:30.
Reply With Quote
  #5   Spotlight this post!  
Unread Yesterday, 13:12
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,141
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: So apparently flat sequence structures don't work well in Teleop.

Quote:
Originally Posted by orangeandblack5 View Post
Hold motor for x ms and until button is released
What do you mean by "hold motor"


Reply With Quote
  #6   Spotlight this post!  
Unread Yesterday, 13:49
Kevin Sevcik's Avatar
Kevin Sevcik Kevin Sevcik is offline
(Insert witty comment here)
FRC #0057 (The Leopards)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Houston, Texas
Posts: 3,764
Kevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond repute
Send a message via AIM to Kevin Sevcik Send a message via Yahoo to Kevin Sevcik
Re: So apparently flat sequence structures don't work well in Teleop.

Quote:
Originally Posted by Mark McLeod View Post
Here's a similar example that runs in Periodic Tasks: http://www.team358.org/files/program...tofTimedAction

The tie-in of waiting on a button release for the 3rd action step would require another While Loop inside the 3rd sequence frame that keeps checking for button=False, before completing.
Something like this, where it waits 1000ms and for button 2 to be False (either one finishes first it waits for the other to complete):
Doesn't that block all other execution in PeriodicTasks until the Sequence completes? I mean, yay not killing teleop, but that doesn't seem like that much better of an option since you can only do one of these things at a time.
__________________
The difficult we do today; the impossible we do tomorrow. Miracles by appointment only.

Lone Star Regional Troubleshooter
Reply With Quote
  #7   Spotlight this post!  
Unread Yesterday, 14:03
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
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,945
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: So apparently flat sequence structures don't work well in Teleop.

Quote:
Originally Posted by Kevin Sevcik View Post
Doesn't that block all other execution in PeriodicTasks until the Sequence completes? I mean, yay not killing teleop, but that doesn't seem like that much better of an option since you can only do one of these things at a time.
No, it doesn't block any other loops or code in Periodic Tasks.

Everything in LabVIEW is executed in parallel unless explicitly tied together.
You could make a dozen copies of this same code and they'd all be running independently.
This is exactly what Periodic Tasks is for.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : Yesterday at 14:35.
Reply With Quote
  #8   Spotlight this post!  
Unread Yesterday, 14:23
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,766
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: So apparently flat sequence structures don't work well in Teleop.

I hope that you were able to follow Mark's example code and get it working. If not, please ask a more specific question, perhaps showing your code and/or including what you tried, how it failed to work, etc.

I'm also curious to understand what you expected the flat sequence to do versus what you discovered it to do?

Greg McKaskle
Reply With Quote
  #9   Spotlight this post!  
Unread Yesterday, 15:09
orangeandblack5 orangeandblack5 is offline
Hates LabView - Uses It Anyway
AKA: Ian Stewart
FRC #5498 (Wired Devils)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2015
Location: Grosse Ile, MI
Posts: 36
orangeandblack5 will become famous soon enough
Re: So apparently flat sequence structures don't work well in Teleop.

I just didn't expect the flat sequence structure to kill Teleop
Reply With Quote
  #10   Spotlight this post!  
Unread Yesterday, 15:49
orangeandblack5 orangeandblack5 is offline
Hates LabView - Uses It Anyway
AKA: Ian Stewart
FRC #5498 (Wired Devils)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2015
Location: Grosse Ile, MI
Posts: 36
orangeandblack5 will become famous soon enough
Re: So apparently flat sequence structures don't work well in Teleop.

In the example given above (http://www.team358.org/files/program...ofTimedAction), what is the point of the Feedback Node? I have no clue what that does, and it seems unnecessary.
Reply With Quote
  #11   Spotlight this post!  
Unread Yesterday, 16:49
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,141
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: So apparently flat sequence structures don't work well in Teleop.

Quote:
Originally Posted by orangeandblack5 View Post
I have no clue what that does
Can't you click on the node (in LabVIEW of course) and get pop-up help which explains what it does?


Reply With Quote
  #12   Spotlight this post!  
Unread Yesterday, 17:01
orangeandblack5 orangeandblack5 is offline
Hates LabView - Uses It Anyway
AKA: Ian Stewart
FRC #5498 (Wired Devils)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2015
Location: Grosse Ile, MI
Posts: 36
orangeandblack5 will become famous soon enough
Re: So apparently flat sequence structures don't work well in Teleop.

I have before, but I still haven't figured out how that would be useful in that particular situation. Which is where I don't understand its use. The program I made works fine for ours, with the caveat that hitting A at any time the robot isn't enabled requires the limit switch also be hit again to "reset" the cycle by ending the frame diagram. This is likely a non-issue, as the limit switch will always be pressed when our motor-driven gate is closed, although if anybody has some way to avoid this (not activating when not in Teleop, maybe?) we'll take it.
Reply With Quote
  #13   Spotlight this post!  
Unread Yesterday, 17:18
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,141
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: So apparently flat sequence structures don't work well in Teleop.


Here are some examples showing the usefulness of feedback node in various situations


Reply With Quote
  #14   Spotlight this post!  
Unread Yesterday, 18:15
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
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,945
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: So apparently flat sequence structures don't work well in Teleop.

The feedback node in that use prevents the sequence from running again immediately if the driver continues to hold down the button.
The button must be released and pressed again after the sequence ends to get the sequence to run a second (or nth) time.

It's particularly useful with short sequences or forgetful drivers.

You can add in a Disabled check as well to prevent the sequence from being pre-triggered.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
  #15   Spotlight this post!  
Unread Yesterday, 21:30
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,766
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: So apparently flat sequence structures don't work well in Teleop.

Quote:
I just didn't expect the flat sequence structure to kill Teleop
That was what I thought. It really isn't the flat sequence, but what is in it.

The tele function is effectively a callback. It is called eery 20 milliseconds/fifty times per second. Your teleOp code therefore needs to respond to the joystick inputs and finish in about 20ms or it will be too busy to process the next one. The events aren't queued or you would have the robot running delayed joystick info - acting laggy and generally very difficult to control.

So if you put code into tele that doesn't return, that doesn't work very well. If it takes seconds to return, then tele is delayed for that time. It is the code inside the sequence that delays, not the sequence itself.

The sequence simply runs one frame after the other. When if finishes, the other code downstream runs. When tele is finished, it waits for the next joystick input.

Greg McKaskle
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 19:50.

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