Go to Post "The only constant is change" is a hint that probably applies to every season of FIRST. - Chris is me [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 29-03-2011, 00:10
ptan ptan is offline
Paul C. Tan., P.Eng.
AKA: Paul Tan
no team (Bolt Action)
Team Role: Mentor
 
Join Date: Dec 2005
Rookie Year: 2000
Location: Toronto
Posts: 61
ptan is a splendid one to beholdptan is a splendid one to beholdptan is a splendid one to beholdptan is a splendid one to beholdptan is a splendid one to beholdptan is a splendid one to behold
Max number of analog ports

Hi,

Is anyone out there using two 9201 analog breakouts with more than 8 ports total? We've come across a bug.

Steps to reproduce the bug:

Create a new Simple Robot project

Declare the following in the class (typing from memory, so please feel free to correct me):

AnalogChannel a1 = new AnalogChannel(1,1);
AnalogChannel a2 = new AnalogChannel(1,2);
AnalogChannel a3 = new AnalogChannel(1,3);
AnalogChannel a4 = new AnalogChannel(1,4);
AnalogChannel a5 = new AnalogChannel(1,5);
AnalogChannel a6 = new AnalogChannel(1,6);
AnalogChannel a7 = new AnalogChannel(1,7);


Now compile it, download it, and run it.
You will find that it compiles and runs ok.

Now add in the following declaration:

AnalogChannel b1 = new AnalogChannel(2,1);
AnalogChannel b2 = new AnalogChannel(2,2);

Compile, download, and run.
It will now fail (at runtime) saying Slot 2 Channel 1 is already allocated (or something like that).

Now comment out the following lines:

// AnalogChannel a5 = new AnalogChannel(1,5);
// AnalogChannel a6 = new AnalogChannel(1,6);
// AnalogChannel a7 = new AnalogChannel(1,7);

Compile, download, and run.

It will now work.

As far as I can tell (by trying different combinations), there seems to be a limitation on the TOTAL number of Analog Channels you can use!!!

If someone can try this code and let me know, I would really appreciate knowing if it is just something with our system, or if this is something everyone is facing.

Thanks!!
__________________
Paul C. Tan., P.Eng.
Coach - FTC Team 27 (now retired)
Coach - VRC Team 2027 (now retired)
Past Mentor - FRC Teams 188, 610, 1009, 2634
Reply With Quote
  #2   Spotlight this post!  
Unread 30-03-2011, 10:10
derekwhite's Avatar
derekwhite derekwhite is offline
Java Virtual Machine Hacker
no team (FIRST@Oracle)
Team Role: Programmer
 
Join Date: May 2009
Rookie Year: 2009
Location: Burlington, MA
Posts: 127
derekwhite is on a distinguished road
Re: Max number of analog ports

Yes, this is a bug in Java and C++ (artf1344 and artf1345) Thanks for finding it.

The result is that some channels for slot 2 conflict with channels in slot 1:

2,1 X 1,3
2,2 X 1,4
2,3 X 1,5
2,4 X 1,6
2,5 X 1,7
2,6 X 1,8

If you can deal with 10 or less channels then you can work around these conflicts.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


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

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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