FIRST Robotics Competition Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

WPI_MotorControlGetOutput.vi Always Returns -1

We made some last minute changes to our robot program and now, in simulation mode, WPI_MotorControlGetOutput.vi always returns -1 and the error

"Error -63195 occurred at Read/Write Control in

FPGA_DIOReadPWMValue.vi->WPI_DigitalModuleGetPWM.vi-

>WPI_PWMGetValue.vi->WPI_MotorControlGetOutput.vi:1-

>Teleop.vi->Robot Main.vi

Possible reason(s):

NI-RIO:  (Hex 0xFFFF0925) The handle for device

communication is invalid or has been closed. Restart

the application."

I created a new robot project and used the most basic code in begin.vi and teleop.vi to check the code and I get the same results.

When I drill down through the sub-vis to FPGA_DIOReadPWMValue.vi I find "FRC FPGA Ref" global variable. The variable has a value of 0 and I can't find where this variable is ever written to.

Should WPI_MotorControlGetOutput.vi work in simulation mode?

Is there a way to correct it?

I'm in panic mode because our program uses WPI_MotorControlGetOutput.vi and if it always returns -1 our robot will run uncontrollably.... in reverse, or spin. Might get a laugh, but not many points.

0 Kudos
Message 1 of 5
(4,306 Views)

Are you using the exact same device reference that works for setting a motor? Could you post your code?

0 Kudos
Message 2 of 5
(3,350 Views)

I've created a basic robot project to reproduce my problem. I create the motor reference in Begin.vi and then call that reference in teleop.vi. I get the result and error I mentioned earlier when it runs. Thanks.

Download All
0 Kudos
Message 3 of 5
(3,350 Views)

rdtech wrote:

We made some last minute changes to our robot program and now, in simulation mode, WPI_MotorControlGetOutput.vi always returns -1 and the error

The reason for this is that WPI_MotorControlGetOutput.vi is not supported in simulation.  Simulation currently only supports what is minimally needed for the three available simulated robots.  But it would make sense to be able to get the output that was previously set.  I will make a note to add this for next year.  Also, I tested your code on a cRIO and it works without that error.

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

Doug,

Thanks. All I needed was a confirmation. I can start to breath a little.

0 Kudos
Message 5 of 5
(3,350 Views)