Hello Casu,
This is actually an example program that was written in LabVIEW 7.1, but I converted it to LabVIEW 7.0. The best way to generate pulse trains with accurate control over the frequency and duty cycle is to use a counter on the 660x or E Series multifunction DAQ device. The E Series devices have two counter/timers while the 660x devices typically have eight.
The NI-DAQmx driver allows you to reprogram the counters on the fly during continuous pulse train generation. This means that you can change both the number of pulses per second and the pulse-width while pulse train generation is in progress without glitching.
The attached example program demonstrates this capability. It can be used with E Series or 660x devices. The accuracy of the pulse train frequency and duty cycle is limited only by the resolution of the internal timebase. You may choose any timebase supported by your device. The timebase you choose determines the range of frequencies you may produce.
A Note on Accuracy:
For E Series devices, there are two timebases available, yielding a counter resolution of 50 nanoseconds or 10 microseconds. For 660x devices, there are three timebases available, yielding a resolution of 12.5 nanoseconds, 50 nanoseconds, or 10 microseconds. If the pulse train specification you desire is evenly divisible by the timebase, then you can achieve within about 0.01 percent of the timebase on E Series devices or within about 0.005 percent of the timebase on a 660x device.