Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   Another DoubleSolenoid question (http://www.chiefdelphi.com/forums/showthread.php?t=133437)

jfitz0807 24-01-2015 12:12

Another DoubleSolenoid question
 
We're constructing our DoubleSolenoid as follows in RobotMap.cpp

pneumaticSubsystemSolenoid = new DoubleSolenoid(11, 0, 1);

The '11' is the CAN ID of the PCM. With these parameters, our compressor starts automatically as expected. However, we're getting the following error:

Error on line 87 of Resource.cpp: Allocating channel that is out of range: Solenoid 0 (Module: 11)

When we change the '11' to a '1', this error goes away, but our compressor doesn't start.

Any thoughts?

ozrien 24-01-2015 14:51

Re: Another DoubleSolenoid question
 
Hmm it looks like that assert will trip on anything >= PCM Device ID 8....
Quote:

const uint32_t solenoid_kNumDO7_0Elements = 8;
...HAL.cpp in wpilib. This gets passed into a Resource object which trips on line 87 of Resource.cpp.

Not sure if that's the intent of the code's author, but I would keep the device ID less than '8' just to be safe. Hopefully you have less than 8 PCMs!

The reason changing the param in your c'tor to '1' from '11' breaks the compressor is likely because you didn't change the PCM ID to '1' in the RIO web-page config.

Setting the device ID...
http://wpilib.screenstepslive.com/s/...ribution-panel

Alan Anderson 24-01-2015 20:14

Re: Another DoubleSolenoid question
 
Why have you changed your PCM from the default ID of 0?


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

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