Help! LabView Independent motor Trouble

i1= these connections are not bullion’s in Lab-view (green wire is True/False) (Orange terminal on index array is 64 bit real)

I’m trying to make a motor that runs a winch move while a button is pressed.

The goal:
-whle Button 7 is held move cable in.
-while Button 8 is held move cable out.

I have read the manuals and checked online more times than i can count. yet i still can’t get this code from the manual (picture shown) to work in Lab-view.

I don’t have this year’s LabVIEW installed, but I suspect you are somehow accessing the Joystick Axes (e.g. x, y) instead of the buttons. Maybe you need a different VI to get the button values?

This is what I get when running that code, is that your intention?

Presing one button goes forward, pressing the other goes backwards, and pressing both (or none) stays still.

You may need to open the joystick and motor in Begin VI (and close them in Finish VI) and use the same reference names consistently. Can we see the code in YOUR robot project (Begin VI, TeleOp VI, Finish VI) not the documentation you are copying from?

yes i can, around 3:00 pm today

the code is built on top of the arcade drive sample.


This is inside the Begin Vi.


this is inside teleop

image
This is following the exaple, The red is the spots that causes the error.

Open context help by either clicking the yellow question mark in the upper right of the LabVIEW window next to the VI icon or pressing Ctrl + H and hover your cursor over the Joystick Get Values VI. Notice the boolean array of button values on the right side of the VI. You need that terminal instead of the one you have which is the double precision numeric array of joystick axes.

Alternatively you should be able to drag that picture from the documentation right into your LabVIEW block diagram (you may need to download the image to your computer first) because it’s a LabVIEW snippet (you won’t get the good wiring practice this way though).

the GET VALUES block has multiple outputs (e.g. places where you could connect a wire). There’s an orange connection point (that’s for axes) and a green connection point (for buttons). You need to use the green point instead of the orange point between GET VALUES and the array block.

Also, read this post about the joystick button numbering. Joystick butons

You guys are amazing, thank you so much, the code works.

1 Like