02-18-2012 03:04 PM
Hello,
I am working with the NI PXI 6229.
I will trigger the input sampling at 1kHz.
And I want to create an output at 200Hz, which is in synchronisation with the 1kHz.
This output at a rate of 200Hz, should exist out of 250ns long pulses.
This should be a digital output.
How should I implement this?
Thanks
02-22-2012 10:41 AM - edited 02-22-2012 10:50 AM
Hello Boris,
If the precise 250 ns duration is important then you'll have to use both counters to do this.
The first counter will be used to simply divide-down the external signal. You can change the output mode to "pulse" instead of toggle so that it will issue a pulse every N ticks of your external signal. In your case, N would be 5. If you're using LabVIEW then this example shows how to configure your first counter (except you would pulse after 5 ticks instead of 2). The pulse width would be based on the timebase used and is not configurable in pulse mode, so you can't get the 250 ns pulse from this one counter alone. You could alternatively use the default "toggle" mode and just select a number of high and low ticks that add up to 5. Neither of these choices would give the 250 ns pulse you need though.
The 2nd counter will be configured to issue a single 250 ns pulse every time it receives a trigger. The source of the trigger would be the output of the first counter (can be routed internally). This example is a good starting point, 20 ticks of the 80 MHz timebase is equal to 250 ns (you can change the instance of the create channel VI if you prefer to let the driver do this scaling for you).
Best Regards,
02-22-2012 10:54 AM - edited 02-22-2012 10:55 AM
I should probably add that there is a weird behavior with the initial delay when using a retriggerable counter output (this behavior was modified on X Series hardware to something more intuitive though). In order to make the delay consistent, you should use an initial delay equal to the low time on your 2nd counter (the retriggerable single pulse generation). I'd suggest the minimum of 2 ticks (or 25 ns if using the 80 MHz timebase).
Best Regards,