|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Not enough resources to create a counter
Hi we encountered a problem today when we added four more counters to our command based robot. For some reason on the fourth addition the counter can not be created and throws an error from HAL saying something about insufficient resources. (I'm sorry i don't have the exact error with me right now)
If we remove one of the counters the code runs fine. We can swap around the order of allocation of the counters and it always throws the exception after creating a fixed number of them (I think on the 8th counter) Any thoughts on what may be causing this?? Tia - mp |
|
#2
|
||||||
|
||||||
|
Re: Not enough resources to create a counter
From http://wpilib.screenstepslive.com/s/...ulses-and-more
Quote:
|
|
#3
|
|||
|
|||
|
Re: Not enough resources to create a counter
We're just using them with switches (DigitalInput).
|
|
#4
|
|||
|
|||
|
Re: Not enough resources to create a counter
Hi - nevermind. We have solved this problem indirectly by moving our switches to the CANTalons. We can read them using isFwdLimitSwitchClosed () and isRevLimitSwitchClosed ().
Thanks just the same... mp |
|
#5
|
||||||
|
||||||
|
Why not use the digital input class directly?
|
|
#6
|
|||
|
|||
|
Re: Not enough resources to create a counter
Hi Joe - we are using digitalinputs but thought to be safe we would read them though counters in case we move past them too quickly (they are reed switches)
Seems surprising to me that we could run out of them. |
|
#7
|
||||||
|
||||||
|
Re: Not enough resources to create a counter
I was referring to moving the switches to the Talon SRXs. I suspect that using the Digital Inputs on the roboRIO will have less latency then reading them on the Talon SRXs.
|
|
#8
|
|||
|
|||
|
Re: Not enough resources to create a counter
Hmm - could be that the roboRIO reading a DI will be faster than roboRIO asking CAN to read the limit switch.
One interesting observation since we got this working: the CANTalon shuts off the motor auto-magically when the limits switches are reached. I expect this is reacting faster than Java could switch it off. The limit switches can be disabled, but not sure if that just disables the auto-shutoff of the motor or disables your ability to read the switch. Clearly much more to be learned with the CANTalons - and the JavaDocs are not even fully generated yet - so some things are just trial and error. |
|
#9
|
|||
|
|||
|
Re: Not enough resources to create a counter
Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|