![]() |
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? |
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. |
Re: Relay AllocationException
I'll try that today.
Thanks. |
Re: Relay AllocationException
That fixed it. Works perfectly now.
|
| All times are GMT -5. The time now is 09:10. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi