Check out this link:
http://sine.ni.com/apps/we/niepd_web_display.DISPLAY_EPD4?p_guid=B9DF85FD9CD023DEE034080020E74861&p_node=DZ52328&p_submitted=N&p_rank=&p_answer=&p_source=External
This link has an example for pulse width modulation with TIO counters. If you're using STC counters, it has instructions for modifying the VI for use with STC.