running solenoids with C++ code

Can we run the solenoids only using a digital I/O port? This would have to run through a spike to work (I think). Or can we also use a relay I/O port directly? The manual is kinda fuzzy on this point.

What is the best approach? Which class works best? And do I need a spike to run a pneumatic solenoid?

Never mind - the solenoid class controls the NI 9472. The manual refers to digital I/O and it confused me.