LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Finite pulse train with variable pulse widths

Greetings LabVIEW developers,

Does anyone have code that can show me how to use E-series counters to generate a finite pulse train where the individual pulse widths vary? I need to generate a series of 20 pulses with the high time for each pulse randomly varying between 50 and 1000 microseconds. The low time for each pulse needs to be constant (around 50 microseconds).

Thanks,
Ryan Wright
0 Kudos
Message 1 of 5
(2,887 Views)
Ryan,

Sorry, but this isn't possible with the counter/timers. I've been wanting this capability myself for about 6 years now.

Personally, I think it's an unfortunate "hole" in product capability. The other major data acq hw allows you to capture and later replicate a signal of interest. You can capture an analog waveform with AI and later play it back with AO. You can capture a digital pattern and later play it back with timed DIO. You can capture buffered semi-periods with a counter -- but you can't play play them back later. So for your app, you'll need to generate the variable freq using timed DIO. The new M-series boards ought to work for this, or a dedicated high-speed digital board.

There's another product that I think is even better for timed DIO though and it's put out by one of NI's "Alliance partners" -- Viewpoint systems. Here's an example of why I like it. Let's say you need to generate 20 pulses within 60 seconds. The times of the pulses need to be precise to within 1 usec, and they have no common divisors. The NI method will require you to use an update rate of 1 MHz and you'll create a buffer of 60 MB to represent the digital pattern at every usec. The Viewpoint method needs a buffer of 40 entries. Each entry is a combination of a timestamp and a pattern to generate at that timestamp. That pattern will just stay there until the next defined timestamp. So all you do is define the digital pattern at the instants when one or more bits will change. It works analogously for digital input - if you capture with 1 usec resolution for 1 minute but there are only 20 pulses (40 digital transitions), you only capture the 40 relevant timestamps & patterns instead of a full 60 MB.

If interested, look for the PCI-DIO64 at Viewpoint's website.

-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).
0 Kudos
Message 2 of 5
(2,881 Views)
Instead of using a counter, I would do that using an analog out channel, using buffered output, non-regeneration mode.
I would generate the wave (with levels of(0 or 5 volt), many pulses/ pulse's width, in a single buffer, and start generating the the wave. See the Daqmx examples for doing buffered output.
0 Kudos
Message 3 of 5
(2,878 Views)
Thank you, Dr. Imad, for your assistance.
0 Kudos
Message 4 of 5
(2,860 Views)
Thank you, Kevin, for your assistance.
0 Kudos
Message 5 of 5
(2,859 Views)