Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a continuous train of square pulses with a low duty cycle and a controllable voltage and frequency

Hello,
 
I'm new to LabView and I'm trying to work out the best method of generating a continuous train of square pulses (between zero Volts and a controllable high Voltage) with a duty cycle of less than 1% (which seems to be the lowest most counters offer).  A square pulse of 5-30ms (high) every 1-30 seconds (low) is the sort of cycle I require.
 
I also want this output to be as accurate and stable as possible.  I found an example in which an internal counter output is used as the timing source for an analogue output but my low cost M-series 6221 PCI card and BNC 2110 connector block don't seem to offer this internal connection.
 
Does anyone have any suggestions?
 
Cheers,
Bob
Smiley Sad
0 Kudos
Message 1 of 7
(4,104 Views)

Hello Bob:

The PCI-6221 has a 16-bit analog output that can sample up to (833 kS/s). I would suggest that you configure your DAQ card to be an analog output, with sample rate from (200 S/s for 5ms pulses) up to (33.3 S/s for 30ms pulses). Then, set your "DAQmx Write.vi" function to output multiple samples as an array of 1D DBL. The input data is an array of 100 DBL (for 1% duty cycle). The first element is your controllable high voltage; and the remaining elements of the array is equal to zero.

I hope this helps. Please advice if you still have questions. 🙂

0 Kudos
Message 2 of 7
(4,089 Views)
Try the attached VI.  The only thing you would need to do is loop a cable from CTR 0 Out to PFI1 on your BNC-2110.

The vi works by changing the frequency of the counter during execution to get your repetition frequency.  The analog output is set up to trigger on the counter output and put out 3 data points (1,1,0).  The pulse width is controlled by changing the data rate of the analog output.  Since your repetition frequency is so slow there is plenty of time to reprogram the analog output before each pulse as shown in the vi.


Randall Pursley
0 Kudos
Message 3 of 7
(4,084 Views)
Thanks for the two suggestions.
I'm going to start by learning how to build an array and I'll attempt that method as it avoids the use of cabling on the BNC block (I don't have any wires!)
 
I'll post any progress or further questions.  Thanks again.
 
Cheers,
Bob
0 Kudos
Message 4 of 7
(4,066 Views)

What a I forgot to add/ask in that last post is why does my mseries card not have the ability to have an internal connection between the counter output and a sample clock for inputting/outputting?  The Eseries cards seem to and I thought the mseries were supposed to be better (or at least that's the impression the NI salesman gave my boss).

0 Kudos
Message 5 of 7
(4,064 Views)
Did you remember to Include Advanced Terminals in the I/O Name Filtering option by right clicking on your terminal I/O Name control? When I do that, I am able to delcare CTR0InternalOutput as the source for the AO Start Trigger for example.
0 Kudos
Message 6 of 7
(4,059 Views)

Thanks Thayles,

That was an extremely useful bit of information! 

I am now able to use a counter pulse time setup to generate my desired high and low times.  All I have to do now is work out how to use that to control a constant voltage analogue output. And then how to acquire a small number of samples triggered by the same counter int output (with a short delay after triggering on the rising edge each time).  Then I just average those samples to make a single piece of data per triggering!

Does everyone have a baptism of fire with Labview like this?!

Bob   

0 Kudos
Message 7 of 7
(4,032 Views)