Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Do my Vi's look alright so far? (http://www.chiefdelphi.com/forums/showthread.php?t=110879)

Ganondalf 09-01-2013 21:57

Do my Vi's look alright so far?
 
3 Attachment(s)
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! :D

Greg McKaskle 09-01-2013 22:02

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

EvanA 10-01-2013 21:29

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.

Greg McKaskle 11-01-2013 07:05

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

RyanN 11-01-2013 12:35

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.


All times are GMT -5. The time now is 10:47.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi