annulla
Visualizzazione dei risultati per 
Cerca invece 
Intendevi dire: 

Code Not Working Across Different Project Templates

Risolto!
Vai alla soluzione

On a traditional blank project, the code below works... I am able to get readings from my joystick. However, when I try to run the same code on a myRIO template, the code never gets to run because of error -363031 (from Highlight Execution).

 

How can I fix this?

0 Kudos
Messaggio 1 di 10
4.535Visualizzazioni

Well, according to the Error Message, the myRIO didn't "see" the Joystick.  What makes you think that it can?  [I actually have a myRIO, but my Joystick device has a Device Number > 7, and NI's implementation of the DirectInput "hooks" don't go high enough -- I've filed a suggestion to fix this on the Idea Exchange, which you can find and Kudo if you want NI to look into fixing this].

Bob Schor

0 Kudos
Messaggio 2 di 10
4.521Visualizzazioni

I think that my problem might have to do with the myRIO not being able to see the joystick. In the image attached, the Computer Joystick.vi under My Computer works. The same code, saved as Joystick RIO.vi under NI-myRIO does not run. The joystick is connected to the computer and not the myRIO.

 

 

0 Kudos
Messaggio 3 di 10
4.475Visualizzazioni

Are you saying you still have the joystick connected to the PC, and you are wondering why the cRIO's VI won't run because it can't see the joystick on the PC?  A completely different target?

0 Kudos
Messaggio 4 di 10
4.461Visualizzazioni

No, the idea is to keep the joystick connected to the computer (later to be used to control the myRIO which will be mounted to a rover over wifi). Can a My Computer vi be imported over to a myRIO vi?

 

(The code works when I plug the joystick into the myRIO but this does nothing to help me.)

0 Kudos
Messaggio 5 di 10
4.456Visualizzazioni

No.

 

A cRIO can't see hardware that is connected to the PC.

0 Kudos
Messaggio 6 di 10
4.451Visualizzazioni

Thanks for the response!

 

 

0 Kudos
Messaggio 7 di 10
4.432Visualizzazioni

Background: I want to mount a myRIO to a RC Robot and control it with a joystick connected to my computer.

Is this possible?

 

I'm unable to use the joystick VIs on the myRIO project since the joystick is connected to my computer and not the myRIO.

I've tried creating a shared variable that contains the joystick information, but it will only work for VIs that are on My Computer and not on myRIO.

 

In the picture attached, Computer Joystick is the vi with all of the code. Variable 3 contains the output of Computer Joystick. Shared Var Test reads Variable 3.

"Shared Var Test" only works on My Computer and not myRIO.

 

0 Kudos
Messaggio 8 di 10
4.410Visualizzazioni

Fix:

 

Create the shared variables under the myRIO target rather than under My Computer.

0 Kudos
Messaggio 9 di 10
4.379Visualizzazioni
Soluzione
Accettato da richardj1701

In order to keep the required hardware set up (joystick into computer & myRIO controlled via wifi), shared variables must be created under the myRIO target which is written into by VIs under the My Computer target. This allows data to be passed between different targets.

0 Kudos
Messaggio 10 di 10
4.378Visualizzazioni