Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

How to generate digital pulse which has 200 microsecond pulse width using PXIe-6624?

Solved!
Go to solution

Hello all,

 

I need to generate digital pulse which has 200 microsecond pulse width. When I arrange channel settings with CO Pulse Time and give a microsecond value in high and low time controls, my chart is not seeing properly. Pulse structure is going wrong. But when I increase my high time and low time to milliseconds for example 100 milliseconds pulses are seeing normal. How can I decrease pulse with properly? You can see my block diagram and front panel below.

 

Thanks in advice.

 

Kemal USANMAZ

0 Kudos
Message 1 of 4
(2,645 Views)
Solution
Accepted by topic author KemalUsanmaz

The pulse outputs are almost certainly fine, whatever you're doing to measure and chart them is where your problem is.  (The code you posted shows nothing about how those charts are being made.)

 

A better way to verify your counter output timing is with a counter measurement task.  I'm attaching a very slight mod of one of the shipping examples for counters.  All I did was add the option for "semi-period" measurement, which will give you an array of semi-periods, alternating between high times and low times.

 

Start your continuous pulse output task first, then start this measurement task.  Note that if you generate a low frequency with your output, you should request fewer samples per iteration from your measurement task.  A typical rule of thumb for DAQmx tasks is to request ~1/10 sec worth of data per iteration.  So when you generate pulses with 200 microsec low & high times, have your measurement task request 250 samples.  If you generate with 100 msec low & high times, this advice would normally say to read just 1 sample, but that won't show you both parts of the semi-period.  I'd make an exception and read 2 or 4.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 2 of 4
(2,616 Views)

Hello Mr. Price

 

Thank you so much for your answer. With your Counter Input VI, I acquire my Counter Output VI work properly with 204us pulse width. I was using Anolog Input channel to my pulse output, you can see attachment below.  

I have one more question about this topic, if you available to answer.

How can I show amplitude of my pulse which has 204us pulse like an oscilloscope display using Counter Input or Analog input boards?
When I using Analog Input (PXIe-4304) for 204us pulse width, chart is going wrong.

If you have a advice this issue, I appreciate.


Thank you in advice.

 

Kemal Usanmaz  

 

0 Kudos
Message 3 of 4
(2,604 Views)

To display a *measured* amplitude, you'll need an analog input task.  Counters don't attempt to characterize amplitude -- they just have specs for what voltage levels are considered high, low, and indeterminate. 

    I would recommend that you set up an analog sample rate that lets you capture at least 5 samples per digital level.  With high time = low time = 204 microsec, I'd aim for <= 40 microsec sample intervals which corresponds to 25 kHz sampling.

    This should give you good amplitude info at the expense of relatively poor timing resolution.

 

Another approach would take semi-period timing data you measure with a counter, *assume* an amplitude, and do a little processing to make an XY graph.  This would give you excellent timing resolution, but purely assumed amplitude.

 

It depends what's most important to convey accurately to the user.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 4 of 4
(2,583 Views)