Go to Post It made me proud to know that we have corporate sponsors with genuine interest. - galewind [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-2015, 22:43
Chris_Elston's Avatar
Chris_Elston Chris_Elston is offline
Controls Engineer
AKA: chakorules
FRC #1501 (Team THRUST)
Team Role: Engineer
 
Join Date: Feb 2004
Rookie Year: 2001
Location: Huntington, Indiana
Posts: 750
Chris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond repute
Best Practice for adding custom VI to Robot Main?

This might be a simple question, but what would be the best practice in Labview 2015 in adding your own custom VI from the Team Code tree in the Robot Main.VI?

Is this acceptable?
Attached Thumbnails
Click image for larger version

Name:	customvi.jpg
Views:	43
Size:	230.2 KB
ID:	18290  
__________________
Team T.H.R.U.S.T. 1501
Download all of our past robot's source code here:Repository

Favorite CD quote:
"That can't be their 'bot. not nearly enough (if any) rivets to be a 1501 machine." ~RogerR: Team #1369
Reply With Quote
  #2   Spotlight this post!  
Unread 11-02-2015, 22: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,833
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: Best Practice for adding custom VI to Robot Main?

What is it doing?
I assume it initializes, i.e., runs once like Begin and exits immediately?
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
  #3   Spotlight this post!  
Unread 11-02-2015, 22:53
Chris_Elston's Avatar
Chris_Elston Chris_Elston is offline
Controls Engineer
AKA: chakorules
FRC #1501 (Team THRUST)
Team Role: Engineer
 
Join Date: Feb 2004
Rookie Year: 2001
Location: Huntington, Indiana
Posts: 750
Chris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond repute
Re: Best Practice for adding custom VI to Robot Main?

There is a loop inside that is running at 10 msec is how my software group decided to implement this. It sequences tele-op state logic to set preset positions to a PID controller.
__________________
Team T.H.R.U.S.T. 1501
Download all of our past robot's source code here:Repository

Favorite CD quote:
"That can't be their 'bot. not nearly enough (if any) rivets to be a 1501 machine." ~RogerR: Team #1369
Reply With Quote
  #4   Spotlight this post!  
Unread 11-02-2015, 22:57
Chris_Elston's Avatar
Chris_Elston Chris_Elston is offline
Controls Engineer
AKA: chakorules
FRC #1501 (Team THRUST)
Team Role: Engineer
 
Join Date: Feb 2004
Rookie Year: 2001
Location: Huntington, Indiana
Posts: 750
Chris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond repute
Re: Best Practice for adding custom VI to Robot Main?

Quote:
Originally Posted by Mark McLeod View Post
What is it doing?
I assume it initializes, i.e., runs once like Begin and exits immediately?
Actually it's 25 msec. But none the less, it's a loop. See a screen shot below.
Attached Thumbnails
Click image for larger version

Name:	loop.jpg
Views:	22
Size:	189.6 KB
ID:	18291  
__________________
Team T.H.R.U.S.T. 1501
Download all of our past robot's source code here:Repository

Favorite CD quote:
"That can't be their 'bot. not nearly enough (if any) rivets to be a 1501 machine." ~RogerR: Team #1369
Reply With Quote
  #5   Spotlight this post!  
Unread 11-02-2015, 23:16
RufflesRidge RufflesRidge is offline
Registered User
no team
 
Join Date: Jan 2012
Location: USA
Posts: 989
RufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant future
Re: Best Practice for adding custom VI to Robot Main?

Quote:
Originally Posted by Chris_Elston View Post
Actually it's 25 msec. But none the less, it's a loop. See a screen shot below.
Is there a reason not to stick this VI into the Periodic Tasks instead of Robot Main?
Reply With Quote
  #6   Spotlight this post!  
Unread 11-02-2015, 23:23
Chris_Elston's Avatar
Chris_Elston Chris_Elston is offline
Controls Engineer
AKA: chakorules
FRC #1501 (Team THRUST)
Team Role: Engineer
 
Join Date: Feb 2004
Rookie Year: 2001
Location: Huntington, Indiana
Posts: 750
Chris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond repute
Re: Best Practice for adding custom VI to Robot Main?

I don't think there is a reason, hence why I was asking what would be the best practice recommended, other than having it's own loop that can be adjusted. Is the recommended practice not to have a loop, and then just place the VI in the 10 msec periodic task?
__________________
Team T.H.R.U.S.T. 1501
Download all of our past robot's source code here:Repository

Favorite CD quote:
"That can't be their 'bot. not nearly enough (if any) rivets to be a 1501 machine." ~RogerR: Team #1369
Reply With Quote
  #7   Spotlight this post!  
Unread 11-02-2015, 23:28
RufflesRidge RufflesRidge is offline
Registered User
no team
 
Join Date: Jan 2012
Location: USA
Posts: 989
RufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant future
Re: Best Practice for adding custom VI to Robot Main?

Quote:
Originally Posted by Chris_Elston View Post
I don't think there is a reason, hence why I was asking what would be the best practice recommended, other than having it's own loop that can be adjusted. Is the recommended practice not to have a loop, and then just place the VI in the 10 msec periodic task?
Personally I think the VI is fine to help keep things organized. I would stick it in Periodic Tasks as is, outside the pre-populated loops in there.

If you do want to leave it in Robot Main, you need to get have it be a fork off the error chain like Periodic Tasks is, what you have now will prevent the main Scheduling Loop section from running until your subVI completes which it sounds like it may never do.
Reply With Quote
  #8   Spotlight this post!  
Unread 11-02-2015, 23:34
Chris_Elston's Avatar
Chris_Elston Chris_Elston is offline
Controls Engineer
AKA: chakorules
FRC #1501 (Team THRUST)
Team Role: Engineer
 
Join Date: Feb 2004
Rookie Year: 2001
Location: Huntington, Indiana
Posts: 750
Chris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond repute
Re: Best Practice for adding custom VI to Robot Main?

Quote:
Originally Posted by RufflesRidge View Post
Personally I think the VI is fine to help keep things organized. I would stick it in Periodic Tasks as is, outside the pre-populated loops in there.

If you do want to leave it in Robot Main, you need to get have it be a fork off the error chain like Periodic Tasks is, what you have now will prevent the main Scheduling Loop section from running until your subVI completes which it sounds like it may never do.

So something like this is best practice?
Attached Thumbnails
Click image for larger version

Name:	timed.jpg
Views:	22
Size:	130.4 KB
ID:	18293  
__________________
Team T.H.R.U.S.T. 1501
Download all of our past robot's source code here:Repository

Favorite CD quote:
"That can't be their 'bot. not nearly enough (if any) rivets to be a 1501 machine." ~RogerR: Team #1369
Reply With Quote
  #9   Spotlight this post!  
Unread 11-02-2015, 23:36
RufflesRidge RufflesRidge is offline
Registered User
no team
 
Join Date: Jan 2012
Location: USA
Posts: 989
RufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant future
Re: Best Practice for adding custom VI to Robot Main?

Quote:
Originally Posted by Chris_Elston View Post
So something like this is best practice?
That's what I would do and have done in the past.

If you're not using the error in your subVI you don't need the chaining to maintain sequencing with the subVI placed in Periodic Tasks, if you are using it then obviously leave it.
Reply With Quote
  #10   Spotlight this post!  
Unread 12-02-2015, 07:17
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,833
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: Best Practice for adding custom VI to Robot Main?

I agree, best practice is to put it in Periodic Tasks and to never modify Robot Main.
The error input is unnecessary.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
  #11   Spotlight this post!  
Unread 12-02-2015, 07:21
Chris_Elston's Avatar
Chris_Elston Chris_Elston is offline
Controls Engineer
AKA: chakorules
FRC #1501 (Team THRUST)
Team Role: Engineer
 
Join Date: Feb 2004
Rookie Year: 2001
Location: Huntington, Indiana
Posts: 750
Chris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond repute
Re: Best Practice for adding custom VI to Robot Main?

Quote:
Originally Posted by Mark McLeod View Post
I agree, best practice is to put it in Periodic Tasks and to never modify Robot Main.
The error input is unnecessary.
Thanks Mark!
__________________
Team T.H.R.U.S.T. 1501
Download all of our past robot's source code here:Repository

Favorite CD quote:
"That can't be their 'bot. not nearly enough (if any) rivets to be a 1501 machine." ~RogerR: Team #1369
Reply With Quote
  #12   Spotlight this post!  
Unread 12-02-2015, 12:37
aeastet aeastet is offline
Programming Mentor
AKA: Tim Easterling
FRC #6043 (Allegan Tigers Robotics)
Team Role: Coach
 
Join Date: Jan 2015
Rookie Year: 2011
Location: Holland, MI
Posts: 123
aeastet is an unknown quantity at this point
Re: Best Practice for adding custom VI to Robot Main?

As long as you understand order of operations and what the code is doing, how it will affect everything else and data flow. You can put it where you want. The robot main was constructed to make things easy for people that have never programmed before. Put this in this vi and this in this vi etc... It give a step by step to try and help you do the right things without having to understand everything about how to program.

If you are confident that you know what you are doing and how things work then making subvi's that run in parallel with the main loop is Okay. You will have to be careful that you are not talking to a motor drive, solenoid, relay, etc.. in multiple loops.

My programming team has loops for different functions of our robot. When that function is required we call it from the other loops when you need them to work together. Like drive and lift. The drive is in the teleop loop but the lift is in its own loop so we can automate the steps of lifting a tote or putting it down.
Reply With Quote
  #13   Spotlight this post!  
Unread 12-02-2015, 13:08
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Best Practice for adding custom VI to Robot Main?

Quote:
Originally Posted by aeastet View Post
The robot main was constructed to make things easy for people that have never programmed before.
It was also constructed in a way that makes it possible to do everything you might need to do without modifying Robot Main itself. Any parallel loops you want to add can go in Periodic Tasks.
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 21:30.

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