Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Generating a digital pulse train for muscle stimulator

Hello,

 

I am brand new to LabView, and am trying to decide if it or MatLab (which I am somewhat familiar with) would be best for my application.

 

I need to generate a digital pulse train, to run through a USB 6229 BNC NI AD board, to drive a Digitimer DS7AH muscle stimulator. 

 

The parameters of the stimulation train need to be: 300 ms on, 1200 ms off.  While "on" the output train needs to be at 20 Hz (so it will deliver a train of 7 pulses per time it is "on").  I need to run this for 3 minutes (so 120 trains). 

 

I found the "gen dig pulse train.vi".  Seemingly, I'd just have to enter the frequency at 20 Hz, duty cycle at 0.2, and number of pulses to 120.  But I think this would give the train once a second, not once every 1.5 seconds.  How would I account for this?

 

I could do the train every 1 second if required, for a total of 180 trains, if necessary.  But would rather do the 1.5 seconds.

 

The stimulator will control the pulse width and intensity.  Those are set on the stimulator.  The stimulator is triggered by a pulse of +3 (up to 15) volts.  I'm guessing the AD board sends out a 5 volt output?

 

I'd also like to be able to deliver to the stimulator single and double pulses at given, discrete time points (so for example, a single at 1 minute, 4 minutes, 7 minutes, 12 minutes; and a double at 2 minutes, 5 minutes, 9 minutes).  I'm not sure if LabView can do this, since they are irregular intervals?

 

Thanks for any help.

 

 

0 Kudos
Message 1 of 3
(6,040 Views)

Hi BW67,

 

The duty cycle refers to each individual pulse, so a 20Hz waveform with a .2 duty cycle will generate a pulse train that is on for .01 seconds and then off for .04 seconds . What you will want to do is have a 20Hz signal that can be paused every 1.5seconds for 1.2seconds.

 

Here is an example that may help you get started with that:

 

Generate Retriggerable Finite Digital Pulse Train from Counter Output:

https://decibel.ni.com/content/docs/DOC-12104

 

As to your second question, you will only be able to output a digital pulse train up to 5 volts with this device.

 

Regards,

Kaitlin N.
National Instruments
Applications Engineer
0 Kudos
Message 2 of 3
(6,016 Views)

Here's an idea for the first part.  Ctr0 generates at 20 Hz, 50% duty cycle.  But it is set up to be "pause-triggered" by the output of Ctr1.  So it'll only generate a 20 Hz pulsetrain while Ctr1's output is in the High state.

 

Meanwhile, Ctr1 is set up to generate a pulsetrain with 0.3 second High time and 1.2 second Low time.  Put them together, and once every 1.5 seconds, you'll generate 0.3 seconds worth of a 20 hz pulsetrain.

 

As to the second part, you could do that with software timing and very likely hit those time targets within a small fraction of a second.  Sorry, I'm out of time now, but hope this helps a bit to get you started.

 

-Kevin P

 

 

pause-triggered continuous pulsetrain.png

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 3 of 3
(6,007 Views)