Which style of connector are you using? Typically, the black wire goes to "ground" and the red wire goes to the pin you're using to control the solenoid. For a 24 volt solenoid, you will be using the Solenoid Breakout board on the NI 9472 digital sourcing module in slot 3 of the cRIO. Follow the
Robot Power Distribution Diagram (24V Solenoid).