There are many examples on the forums, at NI.com, and shipped with LabVIEW to demonstrate this being done multiple ways. If you go to Help >> Find Examples and search PWM several examples come up, some for dedicated cRIO hardware, but also for FPGAs, and modify your search a bit and you'll get examples for DAQmx hardware.