Hello shukla,
I'm not sure what your question is, but you might want to take a look at the following example program:
M Series Correlated Digital Input with Analog Input Sample Clock in ANSI CIt would be very easy to modify this example to do digital output rather than input.
I hope this helps!
Best regards,