Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

generating a pattern of pulse train on pci-6602

can any one help me please. the example on the help menu " Gen Dig Pulse.vi" genertaes a pulse train in the order of 101010(high low high low ...) but if I want to change the order of the pulse like 100101..(high low low high ...) how I can I modify the vi. I am using pci-6602 DAQ card and labview 7.0. or anyother method
thanks
casu
0 Kudos
Message 1 of 19
(5,067 Views)
casu,

Are you asking how to generate a single pulse train where the high and low times are not equal? If so, you can do this right from the front panel of the "Gen Digital Pulse Train-Continuous.vi" example with the 'Frequency' and 'Duty Cycle' inputs. If that's not what you're trying to do, can you ask again with some more details about your needs?

-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 19
(5,050 Views)
Hello Casu,

Did the example program that I posted on the other thread work? Were you able to download the NI-DAQ 7.3 so that you can use your board with DAQmx? IF you are still having problems, tell me exactly what pattern you want to generate and I'll make the code for you.

- LA
0 Kudos
Message 3 of 19
(5,049 Views)
hi LA yes I download the NI-DAQ 7.3 and the example works fine. when the program runs the output is a series of 1 and 0 with a pulse width set in the front panel. but the program I need is a pulse signal with a series as shown below. this pattern of 1 and 0 with a changing pulse width close and open an inverter switch and create a sine wave at the output of the inverter. I tried to built this program with digital generation before since the duty cycle is fixed on digital generation I have to find another way.

channel 1 = 1 1 0 0 0 1
channel 2 = 0 0 1 1 1 0
channel 3 = 0 1 1 1 0 0
channel 4 = 1 0 0 0 1 1
channel 5 = 0 0 0 1 1 1
channel 6 = 1 1 1 0 0 0

thanks
casu
0 Kudos
Message 4 of 19
(5,040 Views)
Hello casu-

I'm not sure I completely understand, but if the desired pattern you described here is a continuous pattern that you wish to generate and you can live with the following startup condition, then you should be able to program six counters to generate the following output:

channel 1 = 000001 110001 110001
channel 2 = 001110 001110 001110
channel 3 = 000000 011100 011100
channel 4 = 000011 100011 100011
channel 5 = 000111 000111 000111
channel 6 = 000000 111000 111000

You could achieve this output by using triggered pulse train generations with different initial delays. I'm not sure that this is what you are looking for though. Let me know if this makes sense.

gus.....
0 Kudos
Message 5 of 19
(5,030 Views)
hello gus
I dont understand why you add more 0 and 1. I only need to generate those six bit on each channel in a loop. the series need to be like as I mentioned. the example on the help menu give me a pulse train of HIGH LOW HIGH LOW... . but instead of that how can I generate a sequence of HIGH HIGH LOW LOW LOW LOW HIGH on one channel and the same thing to other channels but different pattern. the sequence for each channel is listed on my earlier question.
thanks
casu
0 Kudos
Message 6 of 19
(5,018 Views)
I've reviewed this thread and another similar one you're on and I realize my prior answer isn't relevant. Hopefully this one will be.

I understand you need to generate 6 channels of digital or counter output. Each one of these channels needs to be high for 3 time intervals and low for 3 intervals, but their phasing is to be staggered by 1 interval (or 1/6 of the full pattern). This pattern should then keep repeating many times. Do I understand correctly?

gus suggested a method using 6 counters on the 6602. This will allow you to have very precise timing control over the time intervals in the pattern you generate. The potential problem is that the very first set of 6 cycles are used to get the pattern started and synchronized on the 6 counters. I think that the extra 0's and 1's you mentioned are those seen in the first 6 cycles. Thereafter, the pattern you originally desired will repeat indefinitely, as his table showed.

If it turns out that you don't need precise timing control over the intervals, you could also do this with 6 bits of regular digital output. You would then need to time your intervals in software. At the end of each interval, you'd simply write data to the digital output task that contains the correct states for the 6 bits you're controlling. Depending on how you define the DAQmx task, the data may be a single U8 integer or it may be an array of booleans.

I'd post an example but I'm not near a LabVIEW computer to generate one. Post back if still interested and I'll try to get to it later.

-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 7 of 19
(4,995 Views)
hello kevin thanks for the response . It is easier to generate those sequence numbers using digital output. I tried before. the problem is on digital generation you get a fixed pulse width but I want to vary the duration of each bit either when it is high or low. that's why I was suggested to use counters instead of digital output and you mentioned about software timing let me see that one if it works send me one example when you get time.
thanks
casu
0 Kudos
Message 8 of 19
(4,992 Views)
Hello Casu,

Please correct me if I am wrong...in summary you want to create a program that generates a pulse train with a specific order of bits AND where you can change the pulse width.

Let's see the implications involved in here:

For the first channel you want a patter bit of 110001. This means that there is going to be two highs, three lows and one high again. I think you already understand that this pattern can be easily created using digital, but since you want to change the pulse width on the fly we have to use counters (because if you would want to change the pulse width before the program starts, you can just change the bits to lets say 1111110000000111 and avoid further complications.) If we use counters, we HAVE to work with pulses that have some sort of pattern. Let me explain myself:

You can create a pulse that looks like this: 111000111000 (it follows a patter or same frequency)
OR you can also have something like this: 111000111000110011001100101010 (as you can see, we still have some sort of pattern, but we can still change the frequency. This can be done by applying a pulse through the gate input of the counter.)

Gus suggested a pattern that you can use to write to your channels. The pattern that he suggested will have the pulses from all your six channels starting at the same time, the only thing is that you will have some bits (that you can ignore) before your actual pattern, but are necessary so that each pulse can follow some sort of pattern.

Pay attention for instance at what he wrote for channel 2: 001110 001110 001110
I'm going to break down this pattern for you so that you can understand it.
1. The first two zeros (00)are going to be the 'initial delay' for your pulse (this is a parameter that you can specify using counters)
2. The actual pulse generation starts afterwards: 111 000 111 000 111 0 (notice the pattern here.... there are there 1's and three 0's). If we put together the last six bits, it's the pattern that you want 00 111 0
The same applies to the other channels, so now you understand why we have those extra 1's and 0's.

Also, as Guz suggested, you can achieve this pattern by looking at the LabVIEW example program triggered pulse train generations with different initial delays. I think now you understand everything pretty well to do the program yourself.

If something is unclear, please let me know.

Thanks

Luis N.
0 Kudos
Message 9 of 19
(4,964 Views)
hi LA
you expalined everything in detail but I still have hard time to understand how to specify the INITIAL DELAY to get the desired pulse signal. you mentioned the first two zero's are initial delay's. does it need to be specified on DAQmx create channel vi?. do other channels will have the same initial delay or different? thanks for your continious help.
casu
0 Kudos
Message 10 of 19
(4,954 Views)