Using 2 digital side cars

Our team is having problems trying to use two digital sidecars.

We are using JAVA, and the code compiles but says there is no second digital module,(and we have two attached) and that the channels we are trying to use are already allocated.

Any suggestions?

Thanks.

are your modules in the proper slots on the crio? When you image the rio does the imaging tool recognize all of the slots being used properly?

Yes they are in the proper slots, and yes the imaging to for the c-rio recognizes all slots as being used properly.

on the bright side that all but eliminates a mechanical connection issue, so that leaves it to the way you call the devices in your code. Unfortunately not being a java guy this is where I have to say good luck and hopefully someone with experience in the programming area can chime in… When I see these threads I know the first thing people want is to see the code where you activate and assign channels.

Thanks for trying. Hopefully someone will have more advice soon!

I know that this is going to sound odd, but have you checked the modules themselves? At the beginning of our season, we hit a snag and our programmers tore hairs out trying to fix code until it turned out to be a bad module.

when you construct your inputs and outputs do you have the code written with the module number like this:

DigitalInput input = new DigitalInput(2,1)

(for a digital input in port 1 on the module on slot 2 of the cRIO)

or

DigitalInput input = new DigitalInput(4,1)

(for a digital input in port 1 on the module on slot 4 of the cRIO)

I have to second this.

Try reversing your modules (move the one from slot 2 to 4 and viceversa) and see which ones work.

If you do have the program written like this, fix it. :stuck_out_tongue: You shouldn’t be referencing slot numbers in the code. The first digital module (in slot 2) is module 1. The second digital module (in slot 4 of a 4-slot cRIO or slot 6 of an 8-slot cRIO) is module 2.

Thanks. I will pass this on to our programmers. Just curious, where did you find this information? If there is some documentation that has this info, I would appreciate it.

The WPI Getting Started with Java Guide:
http://firstforge.wpi.edu/sf/docman/do/listDocuments/projects.wpilib/docman.root.c_and_java_documentation

Page 15: Constructors with Slots and Channels

Thank you everyone. We got it to work!