From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

device index of a joystick depends on what exactly

Solved!
Go to solution

i don't understant the id depends on what, is it The sys of exploitation used( windows 7 , 8 , xp) or the port used or the computer.

when i use a joystick with windows 7 the id is 0

when i use it with windows 8 i got 5 ,but when i restart the computer it become 3 using the same port

when i use it with windows xp i got 3 with one computer and 0 with an other one.

 

so Smiley Sad

0 Kudos
Message 1 of 7
(4,661 Views)

achfire,

 

The joystick device name should be the same on every computer.

To get the ID from the device name, search through all detected joysticks until the device name matches.

 

Here is a screenshot of how to do this:

find joystick.png

 

This VI is not included with LabVIEW, so you'll have to code it yourself.

 

 

 

 

~~
Message 2 of 7
(4,643 Views)

i did it,but i get false ,i don't know why even if i see that names are the same

12.png

0 Kudos
Message 3 of 7
(4,622 Views)

What is the device name of your joystick?  Have you tried using hilight execution mode to debug your program? Alternatively, you could check the number of buttons and axes matches instead of the device name.

~~
0 Kudos
Message 4 of 7
(4,611 Views)

yes i used hilight execution mode to debug my program,but i noticed that the name is the same but i get F ,i'll try ur suggestion

0 Kudos
Message 5 of 7
(4,607 Views)

Are you abosultely sure your strings are indentical?  Your code looks like it should work.

 

I would temporarily add an indicator between the "Query Input Devices.vi" and your for loop, run the VI once, then copy and paste whatever your device name is from the array indicator to the "Joystick Name" string control just to be sure.  (Then you can get rid of the indicator.)

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 6 of 7
(4,594 Views)
Solution
Accepted by topic author achfire

thanks a lot my friends.

thanks to you i figured how to avoid this id problem with my joystick and my ruddep pedals.

here is how it works,who knows maybe someone sill need it in the futur

12.png

Message 7 of 7
(4,561 Views)