Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Not enough resources to create a counter (http://www.chiefdelphi.com/forums/showthread.php?t=134546)

shindigo 13-02-2015 22:59

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

Joe Ross 13-02-2015 23:31

Re: Not enough resources to create a counter
 
From http://wpilib.screenstepslive.com/s/...ulses-and-more
Quote:

There are 8 Up/Down Counter units contained in the FPGA which can each operate in a number of modes based on the type of input signal:
If you are using any encoders in 1x or 2x mode, changing them to 4x will keep them from using counters.

shindigo 14-02-2015 08:18

Re: Not enough resources to create a counter
 
We're just using them with switches (DigitalInput).

shindigo 14-02-2015 14:40

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

Joe Ross 14-02-2015 17:44

Why not use the digital input class directly?

shindigo 15-02-2015 21:55

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.

Joe Ross 16-02-2015 10:51

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.

shindigo 17-02-2015 16:59

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.

RufflesRidge 17-02-2015 17:01

Re: Not enough resources to create a counter
 
Quote:

Originally Posted by shindigo (Post 1445920)
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.

http://www.crosstheroadelectronics.c...e%20Manual.pdf


All times are GMT -5. The time now is 22:30.

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