Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Resetting an XBox 360 Joystick controller

Hello all;

 

I am attempting to use a wireless XBox360 controller in a long-term, intermittent use application.  This controller powers itself off after a few minutes of disuse.  Using the normal Query Devices, Initialize Joystick, Acquire, Close method works fine to collect input until the controller powers down, which of course causes errors.  After I power it on again, I can no longer reconnect and acquire unless I remove all the VIs and sub-VIs from memory.

 

I have tried using a built .exe, to no effect.  I also tried calling the "Acquire", "Initialize", etc by reference (so that they do not remain in memory).  This approach successfully removes the VIs from memory, and allows me to reconnect without closing Labview, but I still have to stop and restart the VI. Does anyone know how to programmatically reset whatever hidden bits are "remembering" the disconnection?

 

Wes

0 Kudos
Message 1 of 12
(8,450 Views)
Hi womack,

Judging from what I have heard in the past, upgrading the driver might help resolve your issue. You can download the driver from Microsoft's Software Download site. Let me know if this helps.
Joshua B.
National Instruments
0 Kudos
Message 2 of 12
(8,427 Views)

Joshua,

 

It looks like I have a fresh driver. Alas.

 

Wes

0 Kudos
Message 3 of 12
(8,339 Views)
Alternate solution: Get the Play & Charge Kit. This automatically disables the automatic shutoff and charges your batteries as a bonus.
0 Kudos
Message 4 of 12
(8,333 Views)

Is there a solution to this? I have the newest drivers and I can't find a way to write the LabVIEW code so that if the joystick looses connection then it continues to attempt a re-connect until it finally does. 

 

Thanks,

Lisa

0 Kudos
Message 5 of 12
(7,314 Views)

Lisa,

 

I never did find a reasonable solution to this, so we ended up using a wired controller for intermittent use applications.  You could probably figure out how the Play and Charge kit keeps the controller on and come up with a hack along those lines, but I did not have time to investigate that.

The XBox controller shuts down if it is not touched after a certain time - I believe it is five minutes. One thing that worked for me was to close the connection in software before that happened, and require the operator to manually turn the controller back on.  We decided a wired controller was better for our application.

 

Wes

0 Kudos
Message 6 of 12
(7,310 Views)

Wes/Lisa,

I have been working with a Logitech USB controller and have run into the same problem of not being able to reconnect to the controller once it is unplugged. In my application I need to "catch" an unplugged controller and continue running the simulation. However, If the joystick gets connected I want to re-connect. I have a simple way to check if they joystick gets re-connected but I cannot re-initialize the controller without stopping the simulation, removing the VI from memory and restarting the simulation. Are you still stumped on this? I will continue searching for a solution and post it once I find it.

 

Dan

0 Kudos
Message 7 of 12
(7,184 Views)

I still have no solution for this.

0 Kudos
Message 8 of 12
(7,163 Views)

Hi Lisa,

 

Without knowing much about the specific VIs you are working with, is it possible to capture error from these VIs?  Then you could try putting the initialization VI into a loop and capture the error until a connection is made.  Again I'm sorry I don't know more about these VIs but any more information you can provide on the problem might help.

Cole R.
National Instruments
Software Engineer
0 Kudos
Message 9 of 12
(7,144 Views)

I am still trying to figure out a work around for this. My though is to have a parent VI control a Joystick Thread, If the Joystick Read errors out, the thread will close and the parent will get notified. The parent VI will continually query the joystick and see if it it gets plugged back in. Once it does, it will re-launch the joystick thread (which will re-initialize the joystick and aquire input data).

 

The problem is that the aquire input data VI errors out if the remote is plugged back in. And wont work until LabVIEW is completely removed from memory and re-initialized. 

 

I attached a test VI that demonstrates this. 

- Input the device name and run, while running unplug the controller.

- Once the VI errors out and stops, plug the controller back in and re-run (without closing labview out).

 

You will see that everything gets initialized but the aquire input data VI errors.

 

Is there a bug report on this? This should not be normal for a USB plug-and-play device.

Thanks,

 

0 Kudos
Message 10 of 12
(6,734 Views)