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.

FIRST Robotics Competition Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing control from one VI to another for navX module

Solved!
Go to solution

We are attempting to setup a navX module to a roboRIO. In the page 8 of 8 Robot Main example from Kauailabs, it says in the text box, "Pass navX MXP Dev Ref to VI's which use it". Basically from the Begin.VI to the Teleop.VI (Magenta wire). How do you do that?

Thanks,

Fred S.

0 Kudos
Message 1 of 5
(5,238 Views)
Solution
Accepted by topic author gto70ski

It looks like they store the references in that cluster typedef for their implementation. The comment is right above a cluster wire that likely includes the typedef.  Are you trying to modify the teleop VI so you can pass that wire?  If so, add the typedef cluster to Teleop's front panel.  Next, click on the input to Teleop's connector pane (upper right corner of the front panel.  The little square).  Then, click on the typedef control.  It links this control to the input to Teleop.

0 Kudos
Message 2 of 5
(4,126 Views)

Bo,

Sorry for the delay in checking it out.

Success! Thanks!!!!

I have a few other questions if you don't mind:

1) The navX files were automatically downloaded to C:\\Users\Fred\navx-mxp\NavxLabview\NavX-MXPLibrary\Common\Typedefs while my standard Labview lvproj files are under my documents\labview data. I opened two labview projects side by side (mine and the navx example project) to drag and drop the navX.vi functions from one project to mine to insert them. Is there a better way instead of drag and drop? It would be nice if when I pull up the function palette on my lvproj those navx functions were there.

2) The robot worked fine without adding any code to the finish.vi. Should it also have closing code for the typedefs?

Again Thanks!!!!

0 Kudos
Message 3 of 5
(4,126 Views)

Hey gto70ski,

If you'd like to make the navX files a little easier to access from your other projects, you can edit the pallettes to include those VIs. Here's some instructions on doing that: http://zone.ni.com/reference/en-XX/help/371361H-01/lvhowto/creating_and_editing_a_pal/

Finally, I would recommend adding some code to Finish.VI to close the device reference. It probably isn't necessary since the robot usually powers down between code executions, but it's relatively easy to do so I would go ahead and just add it.

Feel free to let us know if you have any more questions!

-Ty P : National Instruments : Applications Engineer

Ty Prather
Technical Marketing Specialist
National Instruments
Message 4 of 5
(4,126 Views)

T,

After getting the teleop mode to work, I tried to code the autonomous independent.vi as below in the first image

Second image shows the build failure popup.

Comments?

Thanks,

Fred

Download All
0 Kudos
Message 5 of 5
(4,126 Views)