Motor Control RefNum Registry Error

I’m having trouble getting two joysticks to initialize, and one of the errors I’m getting at the driver station (not sure if it’s related, but it seems like it is) is that the data type of the variant that feeds into the Generic Set Get Refnum is not compatible with the data type wired into the input. Take a look:

Does anyone know what’s causing this?

It looks like you’re using a Talon SRX via PWM?
That code doesn’t look like it’s from 2017.

Are you reusing code from last year?
Have you tried creating a new project for 2017 and starting with that?

I’m not sure why it doesn’t look like this year’s code, but this was a fresh 2017 project… Where is it set to PWM? How do we change that?

You’d have to post your code for me to have any hope of commenting on it.
Begin and Teleop

That library routine snaphot you posted is a Motor Get, but Motor Get only handles Talon PWMs, not Talon CAN.


The weird thing is that the code does work (even with the error), but only one joystick is working…

Thanks for the help!

You’re mixing mismatched vi’s and they’re sort of partially doing something accidentally.
Take a look at the other code I posted for how to setup a 4-motor drive.

There’s an undefined motor in Teleop.

Are your joysticks in positions 3 and 4 on the Driver Station USB tab?

Ok, I set it up the same way as you did in your example (see teleop and begin block diagrams in the third picture). I still get the error with the registry get icon (first picture). But the real issue is that both joystick get values are reading the same joystick (see indicators on the Teleop Front Panel in the second picture)… It really doesn’t make any sense to me. I think that it’s referencing the device at the same usb port. Another weird thing is that when I reorder the joysticks on the driver station, the other joystick works, but the one that was working before no longer works. Could it be a problem with the driver station???

Thanks for the help.



Try changing your joysticks to USB0 and USB1 in Begin and on the Driver Station USB tab just to see it it’s position related.
Which of the two different Teleop pictures you posted is the one I should look at?
The joystick axes in one conflict with each other, so if you swapped them they would respond differently if at all. That could make it seem like one is working and the other not working.
What kind of joysticks are they?

I replicated your code and don’t get the error on the Drive Refnum Get, so it’s something you’ve typed, probably by accident.
If you want to zip the entire project (Documents->LabVIEW Data->2017 Robot Project) and post it here I can tell you where the typo is.

Changing to USB0 and USB1 to match the driver station didn’t help. I also tried changing the driver station positions to 3 and 4 to match teleport, but that didn’t work either…

Both Teleop pictures are the same, but on this one I made indicators to see what values the joysticks were reading, and they show the same value… I think it is referencing the same device for both joystick 1 and joystick 0.

They’re both Logitech 3D extreme joysticks. I’ve tried a changing the axes up with no avail. However, I can get everything to work if I use one joystick axis for the left side and the other joystick axis for the right side. The real problem is that I can’t get different values from the different joysticks to feed into the tank drive tile.

I will post the vi later when I get back to our robotics lab.

Thanks for the help!

Here is our code. Let me know what you find.

Thanks for the help!

Do you have two or four Talon SRXs controlling your drive motors?


**We have four Talon SRX’s controlling our 4 motors over CAN.

Do you have the code you posted a picture of in the 3rd link in post number 7?

If you do, just change the USB ports in the from 3 and 4 to 0 and 1 respectively. And in the use the value coming from the other output of the Index Array function for “Joystick 0”.

Then post that code.

I can’t access Imgur from school because firewall, but make sure that:
Your joysticks are opened on separate USB channels
Your joystick refnum names are different
Your joystick refnum names are correct in Teleop
If all this is the case, it should work as intended.
This is probably not the problem, but it’s worth a check.