|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Relay AllocationException
When attempting to initialize relays on a additional Sidecar, connected to slot 6, I receive an AllocationException with a message to the effect of: "Channel X on slot Y has already been initalized."
Adding the code "Relay r = new Relay(6, 1);" to RobotInit() in an empty project reproduces this error. Is there a solution to this? |
|
#2
|
||||
|
||||
|
Re: Relay AllocationException
It looks like you've found a bug in WPILibJ. I've looked at the source for the Relay class, and it appears that it only allocates a Resource object large enough track relay channels on the first DIO module.
Java version: Code:
private static Resource relayChannels = new Resource(tDIO.kNumSystems * kRelayChannels); C++ version: Code:
Resource::CreateResourceObject(&relayChannels, tDIO::kNumSystems * kRelayChannels * 2); If this fixes the issue a bug report should be submitted on FIRSTForge. Last edited by MattD : 13-02-2010 at 03:31. |
|
#3
|
||||
|
||||
|
Re: Relay AllocationException
I'll try that today.
Thanks. |
|
#4
|
||||
|
||||
|
Re: Relay AllocationException
That fixed it. Works perfectly now.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Relay | Robopanda6 | Java | 5 | 07-02-2010 01:08 |
| Relay (Spike) | elbuo | Electrical | 2 | 09-02-2009 20:36 |
| Relay Help | JCODER | Programming | 2 | 06-02-2008 16:49 |
| Relay Commands | Matt Krass | Programming | 6 | 18-02-2006 23:03 |
| Relay Assignments | MulletFish | Programming | 9 | 27-01-2005 14:15 |