Problem switching modes between Motion Magic and %VBus

Trying to expand upon the Labview Motion Magic example provided by CTR. (Yes the example works).

Situation: Rear Talons have encoders attached. (Quad).

Trying to create a drive with the option of pushing a button to go a set distance using MotionMagic.

If button is pressed (MotionMagic snippet), the drive will go a set distance.
Reset encoder, repeat, no problems.

If xbox joystick if pushed, talons will switch to %VBus and drive fwd, bckwd.
(I am using a Global which is set according to whether we want MM or %VBus)

(False conditions are empty on both snippets.)

So far, so good.

Problem: after driving with joystick (%VBus), if the Motion Magic button is pressed again, it will enter the MM snippet, generally bumping the talons a small amount and stay in the while loop without further change to position.
Checking the RoboRio Web server, shows the Talons are in Mode 15 when this occurs. When original MM was run, Talons are in Mode 7.

I am able to stop the while loop with a button, and drive the talons again using the joystick. HOWERVER: the rear Talon’s (with encoders) do NOT respond. They are still in Mode 15.

In begin, I have broken the Talons out individually and also by the common “Drive”.

Not sure of best practices.

Suggestions and feedback welcome.
Thanks in advance for any help.

Snippets attached:
Drive and MM are both in teleop tied to xbox buttons and joystick.









Hi, I was wondering if you ever solved this issue? I don’t have a solution, and I know this is a year late but I have a similar problem at the moment and am looking for any sort of leads on a solution.

Thanks
:] :] :] :] :]

A lot of the framework has changed since this post was made. What problems are you running into now?

The mode is now chosen on the set VI. I think this will work just fine.

I would say be careful on how/if you exit out of motion magic when the joystick is used. For example say your button drives the robot 100 inches. If at 50 inches you move the joystick what happens?