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):

// 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!

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.