Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

two retriggerable pulse generations after a pulse train generation

48 views
Skip to first unread message

pchemjjang

unread,
Aug 6, 2008, 4:10:09 PM8/6/08
to
I am trying to generate 3 pulse trains (ABCABCABC...) one after another.
 
The program currently I am using generates 2 pulse trains (ABABAB.....).
 
I am using the Traditional NI-DAQ and PCI-6602.
 
I am thinking about using pulse train generation first and then retriggerable pulse generation after that.
 
I understand that the retriggerable pulse generation can generate a pulse train triggered (or gated) by other counter output.
 
I have attached a test vi.
 
It uses the pulse train generation code when the counter number is 0 and when the counter number is not 0, then it uses the retriggerable pulse generation code, which I tried to modify from the pulse train generation code.
 
First of all, I am not sure if I wrote the retriggerable pulse generation code correctly.
 
Secondly, I don't know if the whole code will generate ABCABCABC...
 
I would really appreciate your help.
 
pchemjjang

G Lo

unread,
Aug 7, 2008, 1:10:07 PM8/7/08
to
pchemjjang,
 
There is a Traditional DAQ example that should be great help in this situation.&nbsp; While in LabVIEW, select Help&gt;&gt;Find Examples and then select Browse&nbsp;according to: Directory Structure.&nbsp; Expand the following folders: daq&gt;&gt;ni-tio.llb and select Finite Pulse Train(NI-TIO).vi&nbsp; This vi should automatically output pulses from the coutner out pin with the specified amount of pulses at the frequency and duty cycle that you choose.&nbsp; You should be able to mold the # of pulses, frequency and duty cycle to meet your finite pulse train generation.&nbsp; No external connections should need to be made but two counters will be utilized behind the scenes.&nbsp; As a side note,&nbsp;the 6602 can also work with DAQmx and could make your support of this application easier in the future.&nbsp; The same example exists in DAQmx but you would need to get the DAQmx driver from the following site: <a href="http://joule.ni.com/nidu/cds/view/p/id/965/lang/en" target="_blank">http://joule.ni.com/nidu/cds/view/p/id/965/lang/en</a>.&nbsp; The example can then be found under Help&gt;&gt;Find Examples and then select Browse&nbsp;according to: Task.&nbsp; Then expand the following folders: Hardware Input and Output&gt;&gt;DAQmx&gt;&gt;Generating Digital Pulses and selecting Gen Dig Pulse Train-Finite.vi.&nbsp;
&nbsp;
&nbsp;

pchemjjang

unread,
Aug 7, 2008, 9:10:06 PM8/7/08
to
"... select Finite Pulse Train(NI-TIO).vi&nbsp; This vi should automatically output pulses from the coutner out pin with the specified amount of pulses at the frequency and duty cycle that you choose.&nbsp; You should be able to mold the # of pulses, frequency and duty cycle to meet your finite pulse train generation.&nbsp; No external connections should need to be made but two counters will be utilized behind the scenes."
&nbsp;
&nbsp;
Thanks for your help first of all.
&nbsp;
I have a couple of questions and I am hoping that you could clarify on them.
&nbsp;
Can&nbsp;the Finite Pulse Train.vi generate&nbsp;3 pulse trains that look like this?
___&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ___&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ___&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ___&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ___
|&nbsp;&nbsp;&nbsp;&nbsp; |_____|&nbsp;&nbsp;&nbsp;&nbsp; |_____|&nbsp;&nbsp;&nbsp;&nbsp; |_____|&nbsp;&nbsp;&nbsp;&nbsp; |_____|&nbsp;&nbsp;&nbsp;&nbsp; |.............................................................
&nbsp;


&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ___&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ___&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ___&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ___&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ___
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp; |_____|&nbsp;&nbsp;&nbsp;&nbsp; |_____|&nbsp;&nbsp;&nbsp;&nbsp; |_____|&nbsp;&nbsp;&nbsp;&nbsp; |_____|&nbsp;&nbsp;&nbsp;&nbsp; |......................................................
&nbsp;


&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ___&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ___&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ___&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ___&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ___
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp; |_____|&nbsp;&nbsp;&nbsp;&nbsp; |_____|&nbsp;&nbsp;&nbsp;&nbsp; |_____|&nbsp;&nbsp;&nbsp;&nbsp; |_____|&nbsp;&nbsp;&nbsp;&nbsp; |.................................................
&nbsp;
Also,&nbsp;which two counters are used for what kind of jobs?
&nbsp;
I need to send these pulses out to switch on and off three different lasers one at a time and repeatedly for about 10 minutes.
&nbsp;
Each laser should be on for say 100 microseconds and off for next 200 microseconds and on for 100 microseconds and off for 200 microseconds and so on.
&nbsp;
I appreciate your help again.
&nbsp;
pchemjjang

G Lo

unread,
Aug 8, 2008, 3:40:07 PM8/8/08
to
pchemjjang,
&nbsp;
I believe I may have misunderstood your original concern.&nbsp; It sounds like you&nbsp;want to output this finite pulse train on three different counters.&nbsp; You will output these pulse trains for 10 minutes and cease your program.&nbsp; The Finite Pulse Train.vi will output a pulse train from only one counter.&nbsp; With this Traditional DAQ example you would need to have three of these Finite Pulse Train.vi programs running simultaneously in parallel to output from 3 counters.&nbsp; I would&nbsp;strongly recommend using DAQmx for this application because you will only need to&nbsp;utilize 4 VIs.&nbsp; The rest of the work is done behind the scenes.&nbsp; There is an example in DAQmx which should accomplish exactly what you are looking for in one program.&nbsp; You must make sure to make the number of pulses 2000000, the duty cycle as 1/3 and the frequency as 1/(300us).&nbsp; The DAQmx driver can found <a href="http://joule.ni.com/nidu/cds/view/p/id/1087/lang/en" target="_blank">here</a>.&nbsp; In terms of the counters, I believe that&nbsp;each task requiring two counters will use the counter adjacent to it.&nbsp; If you would like to output on counter 0 using finite generation then counter 1&nbsp;will be used as the gating counter.&nbsp; When you have the DAQmx driver then you can find this example by selecting Help&gt;&gt;Find Examples and then expanding Hardware Input and Output&gt;&gt;DAQmx&gt;&gt;Generating Digital Pulses&gt;&gt;Gen Dig Pulse Train-Finite.vi.&nbsp; I have included&nbsp;an image to show how the front panel of this example should be configured to work.&nbsp; The major note to make is that you will need to configure all of the counters in the channel names list.&nbsp; In Traditional DAQ this did not seem possible.&nbsp; In Traditional DAQ&nbsp;you would need to create a subvi out of the Finite Pulse Train.vi run three copies of it, in parallel, in a larger program.&nbsp; Please let&nbsp;me know if you will be able to utilize DAQmx in this application.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;


Counteroutput.jpg:
http://forums.ni.com/attachments/ni/40/6645/1/Counteroutput.jpg

pchemjjang

unread,
Aug 8, 2008, 7:10:05 PM8/8/08
to
Thanks again for&nbsp;your quick reply.
I, however, want to use 1) Traditional DAQ, 2) a continuous pulse train generation, 3) two retriggerable pulse generations for two more delayed pulse trains (gated by the first pulse train generated), and 4) one counter for each pulse train.
If you could provide me some help&nbsp;under this restriction, I would really appreciate it.
pchemjjang

G Lo

unread,
Aug 11, 2008, 6:10:05 PM8/11/08
to
pchemjjang,
There is a Traditional DAQ example in the same location that I have specified in my earlier e-mails called Generate Pulse Train - Start Trig (NI-TIO).vi.&nbsp; This will output a continuous pulse train from one counter.&nbsp; In order to output the next pulse trains in the order that you specified in a previous post (i.e. second pulse train begins at first falling edge of first pulse train, third pulse traing begins at first falling edge of second pulse traing) you could utilize the previous counter output as the trigger for the next counter.&nbsp; For example, lets call the three counters used Counter 0, Counter 1, and Counter 2.&nbsp; Since this is a continuous counter output operation you should only need one counter for each task.&nbsp; You will then setup a start trigger on Counter 1 so that it starts on the falling edge of the Counter 0 output.&nbsp; You will then setup a start trigger for Counter 2 so that it starts on the falling edge of the Counter 1 Output.&nbsp; In the example there is a VI called Counter Start Trigger (NI-TIO).vi which sets up the start trigger.&nbsp; This VI will be removed for the Counter 0 task and replaced for the Counter 1 and 2 tasks.&nbsp; Recall that you will have to essentially have three tasks running in parallel.&nbsp; I have included a vi which should accomplish the task that you were looking for.&nbsp; You will obviously need to make changes but this should provide a great framework for you.&nbsp; The VI will&nbsp;continuously output&nbsp;pulse trains from counters 0, 1, and 2 all triggering as I had stated above.&nbsp;


TDAQ Counter.vi:
http://forums.ni.com/attachments/ni/40/6652/1/TDAQ Counter.vi

0 new messages