Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   Digital Module 2 Error Message (http://www.chiefdelphi.com/forums/showthread.php?t=125230)

peronis 25-01-2014 15:41

Digital Module 2 Error Message
 
Hi all,

We are trying to get our drive running...I know it is a little late. We keep getting the following error on the driverstation.


ERROR: Allocating module that is out of range or not found: Digital Module 2 ...in InitPWM() in C:/WindRiver/workspace/WPILib/PWM.cpp at line 36

We checked the code over and over, and all electrical connections. We opened up the imaging utility and the module status does say ok and the module is green. The digital module is plugged into module 2 on the 4 slot crio. The code uploads fine, and the status light is blinking normally until we run the code. Then the 5V indicator on the digital sidecar and the status light both go out when we enable the robot.

Our robot code is written in C++ using the Command Based model. We've debugged and checked that the default DriveCommand is executing and calling the correct tank drive method with values from the joysticks. Here's the initialization code for the DriveTrain please let us know if you spot anything that could be wrong. It was generated with RobotBuilder.

Code:

void RobotMap::init() {
        // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
        LiveWindow* lw = LiveWindow::GetInstance();
        driveSubsystemSpeedController1 = new Victor(2, 1);
        lw->AddActuator("DriveSubsystem", "Speed Controller 1", (Victor*) driveSubsystemSpeedController1);
       
        driveSubsystemSpeedController2 = new Victor(2, 2);
        lw->AddActuator("DriveSubsystem", "Speed Controller 2", (Victor*) driveSubsystemSpeedController2);
       
        driveSubsystemSpeedController3 = new Victor(2, 3);
        lw->AddActuator("DriveSubsystem", "Speed Controller 3", (Victor*) driveSubsystemSpeedController3);
       
        driveSubsystemSpeedController4 = new Victor(2, 4);
        lw->AddActuator("DriveSubsystem", "Speed Controller 4", (Victor*) driveSubsystemSpeedController4);
       
        driveSubsystemRobotDriveMecanum = new RobotDrive(driveSubsystemSpeedController1, driveSubsystemSpeedController2,
              driveSubsystemSpeedController3, driveSubsystemSpeedController4);
       
// RobotBuilder generated        driveSubsystemRobotDriveMecanum->SetSafetyEnabled(true);
        driveSubsystemRobotDriveMecanum->SetSafetyEnabled(false);
        driveSubsystemRobotDriveMecanum->SetExpiration(0.1);
        driveSubsystemRobotDriveMecanum->SetSensitivity(0.5);
        driveSubsystemRobotDriveMecanum->SetMaxOutput(1.0);
    // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
}

Here's the code in the Drive Subsystem that calls tank drive:

Code:

void DriveSubsystem::TankDrive(float left, float right)
{
        printf("DriveSubSystem::TankDrive->left = %f, right = %f\n", left, right);
        robotDriveMecanum->TankDrive(left, right);
       
}

Thanks,

Team 3950

Joe Ross 25-01-2014 16:24

Re: Digital Module 2 Error Message
 
Quote:

Originally Posted by peronis (Post 1332182)
The digital module is plugged into module 2 on the 4 slot crio. The code uploads fine, and the status light is blinking normally until we run the code.

As described at the site below, the digital module in slot 2 is the first digital module and should be referenced as module 1.

http://wpilib.screenstepslive.com/s/...-and-variables

Quote:

Originally Posted by peronis (Post 1332182)
Then the 5V indicator on the digital sidecar and the status light both go out when we enable the robot.

This indicates a problem with the power to the digital sidecar. Make sure it is connected to a 20 amp breaker in the PDB.


All times are GMT -5. The time now is 12:38.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi