Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

how to generate two finite digital pulse trains using 6221

Hi,
I have a NI6221 PCI board, and am trying generate two finite digital pulse trains in my project to control a stepping motor: one pulse train is a single pulse for the motor direction, the other is a finite pulse train for the motor movement.
I looked into the example  "gen dig pulse train-finite dig start.vi", and was able to generate the finite pulse train using counter 0. My question is how should I generate the single pulse? can I use counter 1? or should I use a digital line? I am totally new to labview.
 
Thank you,
hma01
 
 
0 Kudos
Message 1 of 5
(3,483 Views)

Hi hma01,

A finite pulse train generation that generates N pulses will use both counters on your PCI-6221.. If the pulses do not have to happen at the same time then you can use a finite pulse generation task that is set to only generate one pulse to create your one pulse signal. Then you could stop the single pulse task and create the multiple pulse task. Since the multi-pulse task uses 2 counters and the single pulse task uses one you cannot have them both started at the same time. You could have two single pulse tasks running at the same time since they only require one counter each. If you need the two signals to pulse at the same time then you will need to use a digital output to generate one of the pulses. Let me know if you have any questions. Take care.

Thanks,

Nathan
NI Chief Hardware Engineer
0 Kudos
Message 2 of 5
(3,465 Views)
Thank you very much, Nathan!
I'll try to see which one works best for me.
0 Kudos
Message 3 of 5
(3,450 Views)
Hello Nathan,
 
I will use one digital output and one counter to generate the two finite pulse trains, because they need to be generated simutanously.  Could you please tell me how to generate a single pulse with external trigger using a digital output line with adjustable pulse width?
 
I attached the vi I wrote, which gives buffer errors when I run it, and I still don't know how to control the pulse width. Could you please tell me how to change this vi, or are there better ways to do this?
 
Thanks a lot!
hma01
0 Kudos
Message 4 of 5
(3,404 Views)

Hi hma01,

I did not realize that you needed to be able to vary the pulse width of the single pulse. The only good way to do this is going to be to use a counter output task. You may be able to use pause triggering so that the multiple pulse task only takes one counter. You can set up a continuous pulse generation task and use pause triggering with it. When the trigger is activated the output will be idle. When it is deactivated it will output the pulse train. I’m not sure what signals you have available that tell you when to output the multiple pulse train so I’m not sure if this would work for you. An example of pause triggering can be found in the NI Example Finder. This can be found by going to the Help menu and selecting Find Examples.... Once the NI Example Finder is open select Hardware Input and Output » DAQmx » Generating Digital Pulses » Gen Dig Pulse Train-Continuous-Pause Trigger.vi. Let me know if you have any questions. Take care.

Thanks,

Nathan
NI Chief Hardware Engineer
0 Kudos
Message 5 of 5
(3,381 Views)