Go to Post It is a difficult balancing act - we're engineers because we like to solve problems, and to take a step back and let someone else solve it, with what may be a poorer solution, is darn hard. - DonRotolo [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 09-01-2013, 21:57
Ganondalf Ganondalf is offline
Registered User
FRC #4665
 
Join Date: Jan 2013
Location: Minnesota
Posts: 48
Ganondalf is an unknown quantity at this point
Question Do my Vi's look alright so far?

Does everything look alright so far? We are using tankdrive (which worked when I used the FRC Simulator). On Joystick 1, button 1 will spin the motor in one direction as opposed to Joystick 2 which will spin in the opposite direction when pressed. Avoid the camera stuff. I mainly want my Victor motor configuration double-checked. Thanks in advance!
Attached Thumbnails
Click image for larger version

Name:	finishvi.png
Views:	72
Size:	56.2 KB
ID:	13444  Click image for larger version

Name:	beginvi.png
Views:	69
Size:	56.9 KB
ID:	13445  Click image for larger version

Name:	teleopvi.png
Views:	72
Size:	57.6 KB
ID:	13446  
Reply With Quote
  #2   Spotlight this post!  
Unread 09-01-2013, 22:02
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,748
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: Do my Vi's look alright so far?

One point to think about is, in teleop you are retrieving the joystick refnum and reading the joystick values a second time. A somewhat better way to do this is to branch the wire from the leftmost joystick button code rather than reread it.

Greg McKaskle
Reply With Quote
  #3   Spotlight this post!  
Unread 10-01-2013, 21:29
EvanA's Avatar
EvanA EvanA is offline
Programming Nut
FRC #1208 (MeTool Brigade)
Team Role: Alumni
 
Join Date: Jan 2012
Rookie Year: 2009
Location: O'Fallon IL
Posts: 8
EvanA is an unknown quantity at this point
Greg is correct, you shouldn't have two joystick gets in teleop.

Another thing to note is that your constants going into the select node should both be doubles, not 32 bit integers. You can create a double constant easily by right clicking on the terminal of the select node and clicking create -> constant.
__________________
FRC Team 1208 MeTool Brigade - 2009-2013
ROBOTS!
Reply With Quote
  #4   Spotlight this post!  
Unread 11-01-2013, 07:05
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,748
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: Do my Vi's look alright so far?

As for the constants. That is a good thing to notice, but the node immediately coerces it to a double. In fact, the compiler will generate it as a double and will not do the coercion at runtime.

Greg McKaskle
Reply With Quote
  #5   Spotlight this post!  
Unread 11-01-2013, 12:35
RyanN's Avatar
RyanN RyanN is offline
RyanN
AKA: Ryan Nazaretian
FRC #4901 (Garnet Squadron)
Team Role: Mentor
 
Join Date: Jun 2006
Rookie Year: 2005
Location: Columbia, SC
Posts: 1,126
RyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond repute
Re: Do my Vi's look alright so far?

Everything said above sounds like good recommendations. Greg is correct (of course... he works for NI!) about the blue numbers (non-floating point number). LabVIEW will automatically coerce the number to the correct value. That's what the little red dot means... it's a coercion dot. It's bad practice to do this though, especially with a constant. Just make it a Double to begin with!

Here's one other thing, and maybe you did it to fit everything on the screen.

Generally, G-code should be read from left-to-right to make analyzing the data flow easier.

The output of the select node goes from right to left. Does it hurt the code? No. It just doesn't look as good, and it makes it look like you're outputting something from the Set Motor VI.
__________________
Garnet Squadron
FRC 4901
Controls Mentor
@rnazaretian

Previous mentor and student from Team Fusion, FRC 364
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 04:12.

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