Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   "Allocating channel or module that is out of range" (http://www.chiefdelphi.com/forums/showthread.php?t=74205)

Parthenon 11-02-2009 21:04

"Allocating channel or module that is out of range"
 
I recently attempted to code pnuematics and I get this strange error in the console when i run C++ code in WindRiver



What i think is the problem is that my solenoid module is inserted in module 6. However, the default is 8. If it is in module 6, then the lights turn on. Otherwise, they do not turn on.

I have tried basically everything I can think of, yet it has not solved the problem.

I have also commented out the solenoid code in an effort to get Joystick input, but that does not work either.

Any help is appreciated.

MattD 11-02-2009 22:23

Re: "Allocating channel or module that is out of range"
 
The WPI Library expects that the solenoid module is in slot 8, and only slot 8. You might be able to make it work by changing the modulePopulation constant in SensorBase.cpp to have a 9472 module selected at the desired index.

I don't see any specific rules against doing this, but I also don't quite understand why you'd need to move it to slot 6.

Greg McKaskle 11-02-2009 22:25

Re: "Allocating channel or module that is out of range"
 
Not only does the WPILib code assume slot eight, but more importantly so does the FPGA.

Greg McKaskle

Parthenon 11-02-2009 22:25

Re: "Allocating channel or module that is out of range"
 
specifically how can i do that?

it just happened to be in slot 6 at the time and it turned on ....

MattD 11-02-2009 22:30

Re: "Allocating channel or module that is out of range"
 
Quote:

Originally Posted by Greg McKaskle (Post 819003)
Not only does the WPILib code assume slot eight, but more importantly so does the FPGA.

Greg McKaskle

I was actually just wondering that after looking into the source code further. Thanks for verifying it.

Quote:

Originally Posted by Parthenon (Post 819005)
specifically how can i do that?

it just happened to be in slot 6 at the time and it turned on ....

It looks like you'll have no choice but to use slot 8.

Parthenon 11-02-2009 22:32

Re: "Allocating channel or module that is out of range"
 
Quote:

Originally Posted by MattD (Post 819009)
It looks like you'll have no choice but to use slot 8.

I still get this error when plugged into slot 8 and no lights turn on on the module

MattD 11-02-2009 22:46

Re: "Allocating channel or module that is out of range"
 
If you still see that error on slot 8, it's probably because you may have forgot to make this change in the code when allocating a Solenoid object. If this isn't it, posting your code may help us help you.

Unfortunately, I don't think I can help very much with the lights not turning on.

Parthenon 11-02-2009 22:49

Re: "Allocating channel or module that is out of range"
 
Quote:

Originally Posted by MattD (Post 819022)
If you still see that error on slot 8, it's probably because you may have forgot to make this change in the code when allocating a Solenoid object. If this isn't it, posting your code may help us help you.

Unfortunately, I don't think I can help very much with the lights not turning on.


make what change?

MattD 11-02-2009 22:54

Re: "Allocating channel or module that is out of range"
 
I'm assuming that when you were trying to use slot 6, you had code that may have looked something like this:

Code:

Solenoid *s = new Solenoid(6, 1);
However, when you tried out module 8 again, you didn't change that. If you try to use a slot other than 8 in the software, it will generate that fatal error. Since by default module 8 is selected, the simplest thing to do is only provide one parameter: the channel number.

Code:

Solenoid *s = new Solenoid(1);

Parthenon 11-02-2009 22:58

Re: "Allocating channel or module that is out of range"
 
I tried that and I still got the error. I also unplugged the slot and commented out all solenoid code and still got the error =(

Parthenon 16-02-2009 12:31

Re: "Allocating channel or module that is out of range"
 
We've found a solution

We discovered the code wasn't compiling properly, so after we deleted the PPC603gnu folder, it began compiling again. This removed the error.

Secondly we plugged in the solenoid module into module 8. Initially I didn't think it needed power, but it actually did, so we hooked up a wago connector to it in 12v input on the power dist. board and everything was working

Bongle 10-01-2012 18:10

Re: "Allocating channel or module that is out of range"
 
2012-version thread resurrection

We are getting this from our cRio when running the SimpleTemplate sample code:
Quote:

>>>>>ERROR: Allocating module that is out of range or not found: Digital Module 1 ...in InitPWM() in C:/WindRiver/workspace/WPILib/PWM.cpp at line 33
We tried the RobotDrive(SpeedController&, SpeedController&, SpeedController&, SpeedController&) constructor with our own Jaguar classes and we got the error for each SpeedController that we constructed. We got it with just the basic RobotDrive(int,int) constructor (it chooses slot 1 as a default, and errors out).

RufflesRidge 10-01-2012 18:37

Re: "Allocating channel or module that is out of range"
 
Quote:

Originally Posted by Bongle (Post 1101863)
2012-version thread resurrection

We are getting this from our cRio when running the SimpleTemplate sample code:


We tried the RobotDrive(SpeedController&, SpeedController&, SpeedController&, SpeedController&) constructor with our own Jaguar classes and we got the error for each SpeedController that we constructed. We got it with just the basic RobotDrive(int,int) constructor (it chooses slot 1 as a default, and errors out).

Do you have a Digital Module in slot 2 of your cRIO?

Alan Anderson 10-01-2012 22:43

Re: "Allocating channel or module that is out of range"
 
Quote:

Originally Posted by Bongle (Post 1101863)
...with just the basic RobotDrive(int,int) constructor (it chooses slot 1 as a default, and errors out).

Watch out for a difference in numbering systems this year. It's not the cRIO "slot" that's important to the code. The "module number" is going to be 1 for the first Analog module (in slot 1), the first Digital module (in slot 2), and the [optional] first Solenoid module (in slot 3). On a 4-slot cRIO-II, the [optional] module in slot 4 is number 2; on an 8-slot cRIO, the [optional] modules in slots 5-7 are number 2.

Bongle 11-01-2012 07:23

Re: "Allocating channel or module that is out of range"
 
Quote:

Originally Posted by Alan Anderson (Post 1102146)
Watch out for a difference in numbering systems this year. It's not the cRIO "slot" that's important to the code. The "module number" is going to be 1 for the first Analog module (in slot 1), the first Digital module (in slot 2), and the [optional] first Solenoid module (in slot 3). On a 4-slot cRIO-II, the [optional] module in slot 4 is number 2; on an 8-slot cRIO, the [optional] modules in slots 5-7 are number 2.

Excellent, we will try that at our next opportunity. Do you know where the documentation is for that change?

Edit: Found it. We had glossed over the "setting up the control system" section because it said veteran teams were probably good to go with an old robot.


All times are GMT -5. The time now is 02:27.

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