How to turn 2 motors on in that aren't drive, to a joystick

Alright so we have our original 2 drive motors in, and that runs through the rest of our program. Now we have 2 motors, not drive motors put into I wanna know how you turn those motors on in, and through the rest of the program (LabVIEW), and connect them to a joystick - Logitech EXTREME 3D PRO (should be connected & working)

If you want them paired, you can treat them as “Drive Motors”, or you can use the Open Motor to open a single one.

See for examples

Once you have the motors set up in begin the next step is to connect them to a joystick in Teleop VI.

Can you post a screenshot of what you have so far so we can have a better understanding of your question?

What does HLM and CLM mean? What is in the false case of the case structure in TeleOp? In English or a flow chart how do you want to control HLM and CLM?

Begin is usually used to set up your devices (instantiate is what other languages call it).

If you want to control them with a seperate joystick, add that in begin as well. You do that exactly the same as the first one, just change the port # and the name.

Then, in teleop (or auto for this year) use the get joystick reference vi to connect the joystick to the motors you want to run. You can have a direct relation between the joystick and motor or do math in between the stick value and the motor value.

I do not have labview right now as we have moved on to python, but you can check out our code from last season. We used two joysticks.
Good luck.
Mr. R^2

HLM = Hatch Life Motor, CLM = Cargo Lift Motor… The Case Structure in teleop, is for when a button is pushed, it shuts off our drive motors, and lets us control one of our Lift Motors… Basically we want to control the HLM & CLM, to work for our lifts on our robot. Basically turns that motor on, and lets it be operational.

So basically you wany 4 buttons. 2 for the HLM and 2 for the CLM. 2 make the mechanism go down/extend and the other 2 make the mechanism go up/retract right? What should happen if you continually press a button? Should the mechanism stop at some point? What sensors do you have available/need for these limits?

Once we get things moving, does either mechanism need to stop at a pre-set position at any time?

The code you’ve posted should accomplish what you’ve layed out here, as far as I can tell. Are you having any issues with it? Do you need any help with the build/deploy process?

EDIT: With the code in your screenshot, the button would need to be held to control your lifts. Based on your description, it appears you may want a toggle (press once to switch to lifts, press again to switch to driving). I could show you how to do this if you like.

However, I would recommend programming your robot to have simultaneous control over your mechanisms and drive train. You could accomplish this by mapping your lifts to buttons instead, or more preferably (at least in my opinion, as a former driver) a second controller (a drive train and two lifts is a lot for one driver to handle at once).

I would appreciate if you could show me what you have in mind, an the thing about the second joystick is being worked on, and should be ordered shortly!

This should be what you want.

Since you seem new to LabVIEW, I’ll explain how this works. The boxes with green arrows are called feedback nodes; they take the input and delay it one iteration of the loop (remember, teleop is running in a loop dozens of times per second). So, in a given iteration of teleop, the output of a feeback node is what its input was on the previous iteration. (As an aside, feedback nodes can be found in the ‘structures’ palette if you want to use them elsewhere in your code.)

The left half of the code is a rising edge detector; if Button is true on the current iteration but was false on the previous iteration, the ‘greater’ block outputs true. In all other cases, it outputs false. (When used with booleans, ‘greater’ functions as an AND gate with the second input inverted.)

The right half of the code is the actual toggle. If the input to the selector is true, which occurs on the rising edge of a button press, it takes the output of the selector from the previous iteration and inverts it. If the input is false (ie the button being held down, is on a falling edge (is being let go), or is being left alone), it simply takes the output of the selector from the previous iteration and uses it for the current iteration, meaning there’s no change.

The first half of the code is necessary because otherwise, if the button was held for more than a few milliseconds, the toggle would keep flipping until the button was depressed. Only outputting true on a rising edge (the actual act of the button going from depressed to pressed) ensures the toggle flips once per press.

I’ve saved this as a VI Snippet, so you can simply drag the image into your and it’ll import the code. Just replace my ‘Button’ control with the desired button, and get rid of my ‘Result’ indicator and wire the output of the selector to the input of your case structure.

I realize that wasn’t very concise; I tend to get rather wordy when explaining things, so if something was unclear and you need me to elaborate I’ll gladly do so. Also, regarding the second joystick, do keep in mind you can use either the gamepad that came in your grey tote in the kit of parts, or any USB controller/joystick (Xbox controllers are popular). It doesn’t have to be another Logitech joystick unless you want it to be; you may find it’s easier to control two lifts when they’re split between two different sticks on one controller instead of two axes on one joystick.

Yep you got me confused, so this all goes into, but where in my would i but this at?

It all goes between your button and your case selector. So:

-Get rid of the wire going from your joystick button to your case structure
-Add my code
-Get rid of my blocks labelled ‘button’ and ‘result’
-Wire your joystick button to the start of my code
-Wire the end of my code to your case structure

Actually, I’ll just make another snippet showing you. Give me a sec.

So on your code you have a green switch w/ a t\f. Where would i find that?

That’s a selector. It’s in the comparison palette (with greater than, less than, equal to, etc.)

Not seeing that

Oh, wait

Do you mean the very first thing in my code, or the triangle thing? If it’s the first thing, that’s not necessary; that’s simply a button I hooked up to test my code. That’s what you should be replacing with one of the button reads from your joystick (one of the values of the boolean array).

If you do mean the selector, that’s here:

Alternatively, you can press ctrl+spacebar and type ‘select’ and hit enter.

It should look something like this when you’re done:

I also noticed when making this that snippets don’t seem to function properly in browsers, so dragging and dropping may not have worked as I said it would. If you download the first image I made a few posts ago, you can drag it from file explorer into the teleop block diagram directly. (I wouldn’t directly copy this one, as I’m not positive I got all your desired axes/buttons correct. Just use this as a guide on how to integrate the first image.)

About the feedback node, you have one pointing right. How do you do that?

Oops, forgot to mention that. Right click it, hit switch direction.