Our team has a solenoid breakout in port 8 of the cRio, and port 8 is the default port while programming the solenoids (c++). We then plugged another solenoid breakout module into port 7 of the cRio, but we can’t figure out how to program the solenoid breakout in port 7, since port 8 is the default. Can anyone give us instructions to program, so we can have both solenoid breakouts (cRio ports 7 & 8) working? Thanks!
i dont have my code right now but i belive its something like
mySolenoid = extend(1);
mySolenoid = retract(2);
What we can’t figure out is how to program through port 7 of the cRio, instead of port 8 of the cRio.
There are two constructors for the solenoid class:
Solenoid(UINT32 channel);
Solenoid(UINT32 slot, UINT32 channel);
To use a non-default cRIO port, you must use the second constructor. The slot tells the solenoid which port the breakout is in the cRIO.
example:
Solenoid *mySolenoid = new Solenoid(7, 1);