From Thursday, May 23rd (05:00 PM CDT) through Friday, April 24th (1:30 AM 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: 

Code Not Working Across Different Project Templates

Solved!
Go to solution

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
Message 1 of 10
(3,383 Views)

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
Message 2 of 10
(3,369 Views)

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
Message 3 of 10
(3,323 Views)

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
Message 4 of 10
(3,309 Views)

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
Message 5 of 10
(3,304 Views)

No.

 

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

0 Kudos
Message 6 of 10
(3,299 Views)

Thanks for the response!

 

 

0 Kudos
Message 7 of 10
(3,280 Views)

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
Message 8 of 10
(3,258 Views)

Fix:

 

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

0 Kudos
Message 9 of 10
(3,227 Views)
Solution
Accepted by topic author 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
Message 10 of 10
(3,226 Views)