Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Generating multiple overlapped pulse trains

Solved!
Go to solution

I need to generate up to 8 TTL pulse train signals at up to 500 Hz with 0 to 100% duty cycles to open/close valves with a timing accuracy of 5 microseconds.  The pulse trains will be staggered with equal delays and begin with a single trigger. 

 

i.e.: If you have a period of 40ms, and 8 valves, there will be a 5ms delay between each pulse train start. Each will have the same duty cycle and period.

 

The pulse trains have to be running simultaneously and stop when certain data criteria is met (the system reaches steady state).

 

My Questions:

1.  Would these pulse trains be classified as continuous or finite?

2.  Would I need to use a counter/timer (or 2) for each pulse train or can it be coupled with digital output?

3.  Which DAQ will have sufficient resources (counter/timers, DIO, etc) to allow this to work?

 

Thanks

0 Kudos
Message 1 of 7
(6,502 Views)
Solution
Accepted by topic author spyrul

1. Continuous.  The idea of finite pulse trains is to pre-define *precisely* how many cycles to generate.  You'll be doing software-based evaluations to choose when to stop the pulse trains, but you won't be able to predict when that will happen ahead of time.

 

2. All else being equal (and it often isn't), I would definitely do this with counters.  You can easily achieve your timing precision and let the data acq hw do all the work.  DIO may be an option, but it could prove to be a pain in the neck to set up the output buffer to handle the particular delays and precision you need.

 

3. I'd go with an oldie but goodie, the PCI 6602.   It has 8 counters available, as well as a little additional DIO.

 

-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 7
(6,496 Views)

Thanks.  That helps me plan things out a lot better.

0 Kudos
Message 3 of 7
(6,490 Views)

The project has slightly changed.  I need to control up to 10 valves instead of 8, and the pulse trains need to be finite, therefore I need 2 counters per valve. I also need 4 analog outputs and at least 6 analog inputs. The DIO requirements remain the same.  I was thinking about going with:

 

2 PCI-6602 (8 counters/timers each)

1 PCIe-6323 (4 counters/timers)

 

Would this work with my timing precision needs?  Or is there a cheaper and more consolidated way to achieve 20 timers?

NI PCI-6602 Counter/Timer
0 Kudos
Message 4 of 7
(6,431 Views)

Since you're in for a multifunction board anyway to handle the AI and AO, I'd at least explore the possibility of using the 6323 for everything.  It'll depend on the particular needs of your 10 PWM channels and whether they need to be controlled independently or changed on the fly.  If not, you could generate those PWMs with the hardware-timed digital port.

 

I'm not real familiar with the X-series yet, but I *think* the DI and DO subsystems have their own internal clocks now.  If not, you could drive the DO task by using a single counter pulsetrain as the clock.

 

If you really need to stick with counters for the valves, then if I understand your app correctly you can probably get by with a total of 11 counters.  10 would be setup to do continuous pulse trains but would be configured to use the 11th counter as a shared "pause trigger."   The staggered start can be controlled with the initial delay parameter, and they would stop simultaneously at the end of the 11th counter's pulse.   Just be aware that I *think* the pause trigger essentially gates the incoming timebase clock, *not* the output pulses.  I *think* the pulse outputs may have the potential to get paused either low or high, depending on timing parameters.   You can either be extra careful with those parameters or be sure to stop the 10 pulse tasks asap at the appropriate time. 

 

-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 5 of 7
(6,422 Views)

Thanks.  It would be nice to keep it all on one board.  Is there an example where a counter/timer is coupled with DO to create multiple pulse trains or an example of a DO pulse train?  Either way at this point, I think I'll need multiple cards. The ending of the pulse train doesn't have to necessarily be spot on the last pulse.  Knowing the frequency of the pulse train, could I calculate the estimated time necessary to generate a specific number of pulses and then have LabVIEW stop the pulse train.  That would eliminate the need for 2 timers per channel to control a single pulse.  Ideally I'd like to have 2 synchronized pulses per valve.  They will be operated on a Peak/Hold/Dwell fashion. One pulse to denote the pulse period, the other for the hold.  The rest can be handled via circuitry on the actual testing apparatus.  But if 1-4 counter/timer(s) coupled with DO can handle 10-20 pulse trains, I'll be set with one card, correct?

0 Kudos
Message 6 of 7
(6,418 Views)

Hi Spyrul,

 

If you know a priori what your digital waveforms are going to be then you can just use the digital I/O lines to drive your valves. If the board cannot supply enough power to actuate the valve, then you can build a simple voltage follower circuit with an external power supply. The PCIe-6323 has 32 hardware-timed D I/O channels, 32 AI and 4 AO.

Sean Ferguson
Application Engineering Specialist | RF and Reconfigurable Test
0 Kudos
Message 7 of 7
(6,388 Views)