The PCI 6040E has 8 Digital I/O channels DIO 0,... DIO 7.
You can configure them for output.
Youcan use a DC SSR (solid state relay). The output of one digital channel (ex DIO 0) can be connected to the gate input of the SSR, switching a DC power supply on or off to the solenoid valve.
Then you can use LabView to turn on/off the solenoid
Note: connecting the DIO directly to the solenoid valve may burn the channel because the maximum current capability of the DIO may be exceeded.