Miguel,
First, delays in the order of 1-2 msec will
not be due to your cable length.
Second, it is not clear to me how you are trying to synchronize to the function generator. It sounds like you are using a 10 MHz reference clock as a source for your 50 Hz output from Counter 0, but I don't see what would synchronize it to your function generator.
The reason that the delay changes with duration is that you aren't generating the
exact same frequency with the two devices. Perhaps your function generator isn't truly creating 50.000000000 Hz cycles. Or perhaps your 10 MHz reference clock isn't truly 10.0000000 MHz. Or (most likely) both.
To synchronize Counter 0 to the function generator, you should:
1) generate a TTL square wave with the function generator and use it as a source signal for your Counter 0.
2) ideally generate a square wave with the function generator that is even integer multiple of 50 Hz, such as 200, 300, 400, etc.
3) configure your Counter 0 pulse train units to be "Ticks". If the function generator is at 200 Hz, you'd configure for 2 low ticks and 2 high ticks.
-Kevin P.
CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).