Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   My autonomous code isn't working. (http://www.chiefdelphi.com/forums/showthread.php?t=114410)

eruiz22 26-02-2013 21:32

My autonomous code isn't working.
 
2 Attachment(s)
I want the "Motor for actuator" to go down for 10 seconds. Then the "Swing" to go foward for 5 seconds. Finally, the "Motor for actuator" to go up for 15 seconds.

I built and deloyed the code. When I pressed button 11 on joystick 2, nothing happened. Is my code correct?

Thank you.

billbo911 26-02-2013 22:04

Re: My autonomous code isn't working.
 
The first issue I see is, joysticks are not read in Autonomous mode. By placing your code in a case structure that is dependent on that input, you are preventing it from running.

Alpha Beta 26-02-2013 22:15

Re: My autonomous code isn't working.
 
Quote:

Originally Posted by billbo911 (Post 1240896)
The first issue I see is, joysticks are not read in Autonomous mode. By placing your code in a case structure that is dependent on that input, you are preventing it from running.

I thought the initial value was read when autonomous started, but it couldn't be changed during autonomous. As it stands here the false case should be running. If the button was being pressed as autonomous started it would run the true case. Since you can't touch the control as autonomous starts you'd have to tape a rock to the button or something if you wanted the true case to run.

Below is a quote from a comment within the autonomous default project.

Quote:

Note that all Driver Station inputs are automatically latched and will not change once auto begins.

Owen Makin 26-02-2013 22:39

Re: My autonomous code isn't working.
 
The code in the second picture is not needed, and the case structure and the vi's connected to it should be removed. All you need for autonomous is the while loops.

billbo911 27-02-2013 00:11

Re: My autonomous code isn't working.
 
Quote:

Originally Posted by Alpha Beta (Post 1240904)
I thought the initial value was read when autonomous started, but it couldn't be changed during autonomous. As it stands here the false case should be running. If the button was being pressed as autonomous started it would run the true case. Since you can't touch the control as autonomous starts you'd have to tape a rock to the button or something if you wanted the true case to run.

Below is a quote from a comment within the autonomous default project.

You are correct. Although, I believe the OP was stating that the button was pressed after Autonomous was started.

eruiz22 27-02-2013 21:32

Re: My autonomous code isn't working.
 
Quote:

Originally Posted by billbo911 (Post 1240958)
You are correct. Although, I believe the OP was stating that the button was pressed after Autonomous was started.

I removed the joystick, left the case structure, and enclosed everything in a while loop.
I'm sure that this is the wrong way to go about this.
Can you please explain how to fix this code in simple terms?

Thank you!

eruiz22 27-02-2013 21:36

Re: My autonomous code isn't working.
 
Quote:

Originally Posted by Owen Makin (Post 1240915)
The code in the second picture is not needed, and the case structure and the vi's connected to it should be removed. All you need for autonomous is the while loops.

So then remove the case structure and add a while loop?
Why is a case structure inappropraite for my objective?

Owen Makin 27-02-2013 22:54

Re: My autonomous code isn't working.
 
The code within the case structure is correct. The case structure is inappropriate for autonomous because it requires you to manual change the value. Sorry, i mixed up my structures, you were correcting having the sequence loop, while loops are for autonomous also, but i have no experience with them. Keep your sequence, and remove the case structures.

eruiz22 27-02-2013 23:49

Re: My autonomous code isn't working.
 
Makes sense.
Thank you for clearing that up :)


All times are GMT -5. The time now is 12:05.

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