01-10-2009 02:34 PM
Hi
I have been programming alot with LabVIEW and I have connected one switch to the digital I/O input and used that switch. The same problem occurs when I use a button on the joystick.
When LabVIEW is communicaing with the robot. Their is a lag and then the switch works with my simple program to make the robot drive forward. When the switch is press a 10-15 sec lag occurs then the robot can not be controled and drives by itself. BUT when LabVIEW is not active and the driver station is on and so is tha bot and they are "talking". It does not work even if you hold the switch for 5 minutes. The ONLY things that works instantaneously are the JOYSTICKS.
Does anyone know what the problem is?? Is it a run-time error or is it something else??
The camera is not even connected (Got that to work already). Is there a bandwidth issue?
Any advice will help.
Thanks in advance
01-10-2009 07:24 PM
You talk about A) when LabVIEW is running, or B) when it's Not Running....
I assume you are talking about when A) you hit the "Run" button, or when 2) you just reset the robot and let it run the program in flash.
FYI, you never change the program in FLASH unless you "Build" your program and set it to "Run on startup".
So Maybe you aren't actually running the "new" program at all, and that's why it does not respond to the switch.
If you are re-building each time, then it could be another problem.
How are you connecting the switch to the digital input on the Driver Station?
You should be installing a pullup resistor and the switch should short the input to ground.
If you don't have a pullup, the input will be unpredictable. a 1K to 4.7K resistor should be used.
Using switches or buttons do NOT use any additional bandwidth, so that should not be the problem, unless your program is doing something bas when the switch/button changes.
Phil.
01-10-2009 08:57 PM
Thanks for the response.
(1) I will try the pull up resistor as you suggest.
(2) I get inconsistent and delayed behavior when I try to control code with a joystick push button too. I am trying to send motor speed commands. They are delayed and the commands create a choppy motor motion like ABS in a car.
(3) When I change Labview code and hit the run arrow, the deploy screen shows compile, delete old code and flash new code. Then I could use the FINISH button to stop the PC part of the code. When I hit the run button again without edits, the deploy screen shows a fast progress bar (suggesting just a checksum test) and all the code runs.
(4) It seems like the NI base code always runs and any edits I put in are executed only with delay and erratic behavior exhibited. Although sometimes I get no response from my code at all.
Is their another way to compile, like in the pull-down menu's ?
Thanks for the advice.
01-10-2009 09:29 PM
Hi
When you just press the RUN button, it sends the code to the cRIO RAM. I doesn't save it in FLASH, so it will not run when you do a reset.
To make your changes permanent, you need to "build" the realtime node at the bottom of your project, and then set it to "Run At Statup" (an option if you rightclick the Build node..
See "Creating a Stand-alone application" in Chapter 5 of the Labview Robotics Programming guide for FRC
http://www.usfirst.org/community/frc/content.aspx?id=10934
If you are getting choppy motor control, it sounds like you are setting the motor speed in two different locations.....
Are you accidentally trying to drive with the joystick AND the pushbutton at the same time.
Or perhaps you are switching between "drive" and "off" quickly.
Make sure when you make changes, that you click the "Run" button on the "Robot Main".vi and not on any other VI.
Run the program and open the VI where you are setting the drive output. Click on the wire and open a "Probe" window. It will show you the value being sent to the drive in real-time.
Perhaps you could attach just the VI where you do your edits so we could see the code.
Phil.
01-14-2009 07:10 PM
ok did the chapter BUT when i did another download it did not work.
do i have to make a new real-time application everytime to download or am i downloading wrong?
I get the warning of saying that it found two files with the same name "Conflicting files".
Then after i say ok it then says that it has lost connection then after about 12 seconds the message disappers and then it continues download and asks for reboot.
Then the code does not work.
Also, some code that I created long ago and ran via the run button still appears when I try to build. I completely removed and re-installed Labview, and its still there ! ! !
COULD ANYONE EXPLAIN WhAT IS GOING ON!!?!?!?!?!
Thanks in advance.
01-19-2009 08:25 AM
Sounds like you would benefit from troubleshooting this issue over the phone. Please call us at 866) 511-6285 from 1 p.m. to 7 p.m. CST.