To answer eedoga's question, it's actually fairly easy to power a 24V solenoid. As stated, the code is the same as a 12V solenoid, the only difference is in the wiring. To get the needed 24 volts, wire the solenoid module to the 24V power supply on the Power Distribution Board instead of one of the many 12V ones. This is in the same place as the power for the cRIO.
No additional wiring changes are necessary since the solenoids themselves get their power from the solenoid module.
USFIRST has some nice wiring diagrams illustrating how to wire the 12V, 24V, and both solenoid modules
found here