Log in

View Full Version : pic: Programming is as easy as you make it.


nxtmonkeys
19-02-2014, 11:58
[cdm-description=photo]39643[/cdm-description]



Anyone need help with their programming?

Whippet
19-02-2014, 11:59
I had been told that it wan't possible to use while loops in Teleop. I guess I was wrong. This is cool!

cjl2625
19-02-2014, 12:01
I'm pretty sure that wouldn't be good for use in teleop

notmattlythgoe
19-02-2014, 12:01
I had been told that it wan't possible to use while loops in Teleop. I guess I was wrong. This is cool!

As long as it is in a separate thread its fine.

cjl2625
19-02-2014, 12:02
As long as it is in a separate thread its fine.


Oh, well I guess you could do that then

nxtmonkeys
19-02-2014, 12:02
Just wire something to the Loop Condition terminal so that it can end. While loops are useful for Autonomous too.

geomapguy
19-02-2014, 12:42
Timed actions are best processed in Periodic Tasks

They will slow down your TeleOp code if placed there

Mark McLeod
19-02-2014, 13:14
This example is good for use in Autonomous and Periodic Tasks.
As shown, this example cannot be placed in Teleop.

nxtmonkeys
19-02-2014, 13:24
I made this program up to help out someone who wanted to know if he did it right. based on all of your posts, I was able to help him a lot more. Thanks a ton!:)

Jay1986
19-02-2014, 13:44
That is not the safest way to accomplish that task nor should it ever be in teleop. You should write the inputs from the joysticks to global variables and read them in period tasks in their appropriate loops.

nxtmonkeys
19-02-2014, 13:50
Yeah, I told him that. I haven't gotten a reply yet, though.

geomapguy
19-02-2014, 13:56
That is not the safest way to accomplish that task nor should it ever be in teleop. You should write the inputs from the joysticks to global variables and read them in period tasks in their appropriate loops.

Do you ever have to write them as global variables?

You can just reference the joystick in Periodic Tasks

nxtmonkeys
19-02-2014, 14:01
Well, I'M not using the program. I recently uploaded a few pictures of my teleop program.

http://www.chiefdelphi.com/media/img/7e3/7e32eceda65b905beb57dd9bf80667b6_l.jpg

http://www.chiefdelphi.com/media/img/7e3/7e32eceda65b905beb57dd9bf80667b6_l.jpg

http://www.chiefdelphi.com/media/img/7e3/7e32eceda65b905beb57dd9bf80667b6_l.jpg

Alpha Beta
19-02-2014, 14:03
Do you ever have to write them as global variables?

You can just reference the joystick in Periodic Tasks

You don't have to...
...But if you do you can manipulate those variables in autonomous.

nxtmonkeys
19-02-2014, 14:13
I'm just happy that the code WORKS.

Conor Ryan
19-02-2014, 14:14
I have found that when using Labview, Stacked Sequences are insanely helpful for programming autonomous. I haven't seen too many people use them.

nxtmonkeys
19-02-2014, 14:16
Without the sequence structures, my autonomous would make my robot die in agony.

geomapguy
19-02-2014, 14:17
You don't have to...
...But if you do you can manipulate those variables in autonomous.

But you can still manipulate the variables in auto mode..

I must be missing something

nxtmonkeys
19-02-2014, 14:18
I also, must be missing something. Help! :confused:

Pault
19-02-2014, 14:46
I have found that when using Labview, Stacked Sequences are insanely helpful for programming autonomous. I haven't seen too many people use them.

Stack sequences are definitely easy, but ideally your gonna want to use a state machine. Even if at first it seems as though using a stacked sequence would have been the better way, you will come to appreciate the ability to control what state comes next as you start to modify your auton and make it more complex.

nxtmonkeys
19-02-2014, 14:47
Stack sequences are definitely easy, but ideally your gonna want to use a state machine. Even if at first it seems as though using a stacked sequence would have been the better way, you will come to appreciate the ability to control what state comes next as you start to modify your auton and make it more complex.


What is a state machine?

markmcgary
19-02-2014, 14:57
What is a state machine?

LabVIEW Wiki State Machine (http://labviewwiki.org/State_Machine)

Wikipedia Finite State Machine (http://en.wikipedia.org/wiki/Finite-state_machine)

nxtmonkeys
19-02-2014, 14:59
Oooooh. Now I understand! Thanks!