Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

generating a pattern of pulse train on pci-6602

Hello,

1. 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?.

Yes, you can specify the initial delay in the DAQmx create channel vi.

2. Do other channels will have the same initial delay or different?

They will have different initial delay. As long as you have a pattern of three 0's and three 1's everything should be fine.

Regards,

LA
0 Kudos
Message 11 of 19
(2,035 Views)
casu,

Here's a simple example based on DIO and software timing. There's room for improvement (use
Timed loop instead of For loop, terminate early on DAQ error or user request) and you may also
want to write some particular pattern such as all high or all low at the end of the loop. But
hopefully, this'll get you started.

Bear in mind that with software-based timing, the actual delays will sometimes be different than
what you specify. This is the downside of doing this with DIO and software timing. If timing
precision matters, you ought to learn about "initial delay" and use the counter method.

-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 12 of 19
(2,029 Views)
Casu,
The initial delay is an input to the DAQmx Create Channel VI when it is set for pulse generation. The initial delays of each of your counters will be different, so you can get the desired patterns to 'line up'. So to use Gus' example:

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

channel 1 would have initial delay of 5 (five 0s, then repeating pattern of 111000111000....)
channel 2 = initial delay of 2
channel 3 = initial delay of 7
channel 4 = initial delay of 4
channel 5 = initial delay of 3
channel 6 = initial delay of 6

Hope this makes sense.
-Alan A.
0 Kudos
Message 13 of 19
(2,016 Views)
hello LA
I still need your help . I couldnt find the example you mentioned last time on the help menu "triggered pulse train generation with different initial delays" . I tried to work on "generating continious pulse train" by making an array for the initial delay but that still give me the same kind of pulse. would you please.
thanks
casu
0 Kudos
Message 14 of 19
(1,991 Views)
hi kevin
thanks for the example you post. I think am going to use digital instead of counter because it gave me a lot of confusion despite a lot of help from you guys . I got some question on what you write.
what is the purpose of writing some particular pattern (all high or low) at the end of the loop ?
how do I modify the example so that each bit will have different delay instead of the whole channel?
thanks
casu
0 Kudos
Message 15 of 19
(1,964 Views)
hi kevin
what do you suggest if I use state machine for my project. unfortunately I have no clue how to make state machine on LABVIEW. the reason I am asking you is the example you send to me DIO pattern vi there is a signal distortion in between when the vi checks the while loop before it starts writing again. instead of the vi checks the while loop everytime when it finishes writing I want to write the data continiously until as you said the user press the stop button or some error occured. do you have some idea or example that can help me.I appreciate for your help.

thanks
casu
0 Kudos
Message 16 of 19
(1,954 Views)
casu,

I'll reply to both your recent messages at once. I think this time I have more questions than answers b/c your recent postings made me realize that I don't understand your overall needs well enough.

I think am going to use digital instead of counter...
Maybe you should, maybe not. I'm not sure I really understand your timing needs, both absolute precision and channel-to-channel synchronization. I personally am kinda fond of counters, but they are a bit of a learning curve when you first start using them. An app that needs to synchronize 6 of them seemed like a tough 1st project, so I suggested DIO b/c it would be easier to discuss conceptually and might actually work if you can live with imperfect timing.
Can you describe more exactly what each of these 6 pulsetrain bits needs to do? What is the typical timing for low and high times? Do you need the 6 pulsetrains to operate entirely independently, or should their timing be synchronized somehow?

what is the purpose of writing some particular pattern (all high or low) at the end of the loop ?
I remembered you mentioned driving an inverter switch and just figured you'd want to turn everything off at the end of the program. I was guessing that an all high or all low pattern would accomplish that.

how do I modify the example so that each bit will have different delay instead of the whole channel?
Do you mean that the 6 pulsetrain bits do not need to be in sync with each other? If they are independent, you may be better off reverting to counters again.

in the example you send to me (DIO pattern.vi) there is a signal distortion in between when the vi checks the while loop before it starts writing again
What kind of distortion do you see?

instead of the vi checks the while loop everytime when it finishes writing I want to write the data continiously until the user press the stop button or some error occured
That example should keep looping around and writing "continuously" -- the DAQmx Write call is made at regular intervals to change the output pattern. If you want the hw to do all the work of writing continuously, then we're back to using the counters again.

Please provide details about the pulsetrains you need, what you are accomplishing with this changing pattern, what the timing needs are, etc. More details will help us help you better.

-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 17 of 19
(1,956 Views)
kevin

kevin
my project is to design three phase AC motor controller using LABVIEW. these digital signals in this specific order turn on and off a switch inside an inverter to create a sign wave at the output which will be input to the motor. if the time delay for the whole channel is same instead of individual bit the output became a square like sign wave instead of a pure sign wave thats why individual bit in a channel need to have different time delay to get at least a signal which is close to a pure sign wave. your program works and give me a square like sine wave but if there is a way to control each bit there might be a chance to smmoth the signal.I built some program using the example on the help menu "write Dig Channel" and put many of this vi in a sequence structure which I got same output. using counters I found it very difficult to do this project .I tried a lot but it is not like digital generation. I start working on LABVIEW for the last four or five months. I learn a lot through this discussion forum.
thanks for the help
casu
0 Kudos
Message 18 of 19
(1,937 Views)
kevin
I built this program on digital generation. It is the same like you built before but I tried it in a different way. my problem is how can each bit inside a channel have different on and off time. I put wait(ms) timer inside some of the case structure on the signals I want to stay long but it didnt work. I try to attach the program so you can look at it and add some correction or give me some idea.
thanks
casu
0 Kudos
Message 19 of 19
(1,897 Views)