|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools |
Rating:
|
Display Modes |
|
|
|
#1
|
|||
|
|||
|
Re: 4-slot cRIO and default modules
Quote:
|
|
#2
|
||||
|
||||
|
Re: 4-slot cRIO and default modules
Quote:
thats where I get the source code I read to learn more about motor control and joysticks. |
|
#3
|
||||
|
||||
|
Re: 4-slot cRIO and default modules
Quote:
Code:
static UINT32 GetDefaultAnalogModule() { return 1; }
static UINT32 GetDefaultDigitalModule() { return 1; }
static UINT32 GetDefaultSolenoidModule() { return 1; }
|
|
#4
|
|||
|
|||
|
Re: 4-slot cRIO and default modules
That's because it's not a slot number. The whole paradigm for referencing the modules has changed to support the 4-slot cRIO. The 1st of each module (analog, digital, solenoid) in slots 1-3 is module 1 of that type. The 2nd instance (slot 4 on 4-slot, slots 5-7 on 8-slot) is module 2 of each type.
|
|
#5
|
||||
|
||||
|
Re: 4-slot cRIO and default modules
Ah I see. So in other words, all the methods involving modules (previously slots) are incompatible with previous versions. For example, for the gyro module, one of the constructors Gyro(UINT8 moduleNumber, UINT32 channel) is no longer compatible with the previous version Gyro(UINT32 slot, UINT32 channel). If I have old code that instantiate a gyro with a secondary Analog module in slot 3, for example. The code would look like Gyro(3, 1). But for this year, I have to put the secondary analog module in slot 5 (assuming a 8-slot cRIO) and initiate it with Gyro(2, 1). Does it sound about right?
Does it mean that I can no longer put the modules anywhere I want but it has to be "Analog, Digital, Solenoid, ???" in that order? Or the WPILib is smart enough so that I can put, for example, 3 analog modules anywhere, and I can address them by naming them 1 (1st instance of analog), 2 (2nd instance of analog) and 3 (3rd instance of anlog) since it can read the module ID in each slot. Last edited by mikets : 01-19-2012 at 11:42 PM. |
|
#6
|
||||||
|
||||||
|
Re: 4-slot cRIO and default modules
You've never been able to put the modules anywhere you wanted. Analog were slots 1 &2 (rules dictated you had to use slot 1), Digital were slots 4 & 6 (rules dictated you had to use slot 4), Solenoid were 7 & 8.
|
|
#7
|
||||
|
||||
|
Re: 4-slot cRIO and default modules
Quote:
![]() |
|
#8
|
|||
|
|||
|
Re: 4-slot cRIO and default modules
That all sounds about right, other than that you could never put the modules wherever you wanted as far as I know. I believe it used to be Analog in 1 and 2 (may have been 1 and 3), Digital in 4 and 6 and solenoid in 7 and 8.
And yes, backward code comparability has not been maintained. All code that specifically referenced slot numbers (other than analog slot 1 which is 1 either way) must be updated to work in order to work with the new libraries and image. EDIT: Just saw your edit. You must put Analog, Digital, Solenoid in that order in slots 1-3 on either cRIO (solenoid may be omitted). On the 4 slot, the 4th slot can be any module. On the 8 slot the pattern repeats with slots 5-7 with 4 and 8 left empty (any of the "extra" modules may be omitted, but the modules may not be shuffled around). There's a description of the new paradigm in the C++ Getting Started Guide: http://firstforge.wpi.edu/sf/go/doc1197?nav=1 Last edited by RufflesRidge : 01-19-2012 at 11:50 PM. |
|
#9
|
||||
|
||||
|
Re: 4-slot cRIO and default modules
Quote:
). I can address them by:Code:
Gyro(1, 1); //Gyro in slot 1, channel 1 Gyro(2, 1); //Gyro in slot 4, channel 1 Gyro(3, 1); //Gyro in slot 5, channel 1 Last edited by mikets : 01-19-2012 at 11:54 PM. |
|
#10
|
|||||
|
|||||
|
Re: 4-slot cRIO and default modules
Quote:
|
|
#11
|
||||
|
||||
|
Re: 4-slot cRIO and default modules
You said no modules are supported in slot 4 or 8. Is it because it's not allowed by the rules or is it because the code won't accept anything in slot 4 or 8?
|
|
#12
|
||||||
|
||||||
|
Re: 4-slot cRIO and default modules
The code doesn't support it because the hardware (FPGA) doesn't support it.
|
|
#13
|
||||
|
||||
|
Re: 4-slot cRIO and default modules
Sorry about beating the dead horse but I am just curious about why the cRIO has the extra slot and the FPGA does not support it. It seems to me the extra slot is very useful especially in the 4-slot cRIO. For example, it is quite easy to run out of digital I/O channels with encoders taking 2 channels each, teams may want to stick another digital module in slot 4, for example.
Also RufflesRidge mentioned slot 4 of the 4-slot cRIO can take any modules. |
|
#14
|
|||||
|
|||||
|
Re: 4-slot cRIO and default modules
You can stick whichever module you need in slot-4 of the cRIO FRC II.
The older cRIO FRC I, was just given the 3+0+3+0 pattern as a design choice. We are unlikely to mix the two up. The FPGA is really full with all it's been given to do. Excess capacity got sucked up to benefit us in other much more potentially useful ways. All resources are limited in one way or another. Engineering is designing and choosing between the optimal tradeoffs for our application. Last edited by Mark McLeod : 01-20-2012 at 01:44 PM. |
|
#15
|
||||
|
||||
|
Quote:
.Speaking of dead horses...this is just wrong. LOL- Bryce |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|