Go to Post You earn what you work for. - Akash Rastogi [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 28-03-2011, 15:34
duffany1 duffany1 is offline
Registered User
AKA: Brandon
FRC #0195 (The Cyberknights)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2006
Location: Southington, CT
Posts: 17
duffany1 is an unknown quantity at this point
Multiple analog modules? (C++)

We are using C++ and we're having trouble figuring out how to construct AnalogChannel objects when you have two analog modules.

I know there is a constructor for AnalogChannel that takes a slot and a channel as parameters, but for some reason this did not work for us. For instance, we tried this code (whittled down):

Code:
// In global section
enum cRIO_slots {cRIO_slot_1 = 1, cRIO_slot_2, cRIO_slot_3}; // And so on
enum analog_mod_channels {gripper_pot_channel = 1}; // And so on

// In the spot where objects are declared
AnalogChannel gripper_potentiometer;

// In the spot where all the objects get constructed
gripper_potentiometer(cRIO_slot_1, gripper_pot_channel),
This code basically did not work. In fact, it caused certain things to go completely out of control.

What are we missing here? Are the modules 0, 1, 2, 3 instead of 1, 2, 3, 4, or something?

Thanks in advance!
  #2   Spotlight this post!  
Unread 28-03-2011, 17:51
gr8dragon's Avatar
gr8dragon gr8dragon is offline
Registered User
AKA: Parth Patel
no team
Team Role: Alumni
 
Join Date: Dec 2008
Rookie Year: 2006
Location: Toronto,Canada
Posts: 39
gr8dragon is a glorious beacon of lightgr8dragon is a glorious beacon of lightgr8dragon is a glorious beacon of lightgr8dragon is a glorious beacon of lightgr8dragon is a glorious beacon of light
Re: Multiple analog modules? (C++)

We are using 2 solenoid modules and we are able to simply provide numerical values for which cRIO slot we have the modules plugged into.(we do not use enumerations)

Assuming that both the analog and solenoid work in the same manner I would recommend using just numerical values to see if it is your enum that is the problem in which case you know what to fix.

Hope that helps.
Closed Thread


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 10:39.

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