Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I generate a continuous pulse train, with a specified initial delay.

How do I generate a continuous pulse train with a specified initial delay? I am using the DAQ-STC counters on an E series board and using the NI-DAQ library. I have tried specifying the initial count parameter and counter mode with:

status=gpctr_change_parameters(board,counter,nd_initial_count,delay)
status=gpctr_set_application(board,counter,nd_pulse_train_gnr)

This does not seem to produce an intial delay. I tested this by setting the delay to 30000 which should have caused a 3 second delay.
0 Kudos
Message 1 of 5
(3,944 Views)
What I would do would be to generate a continuous pulse train in one counter "Counter 0" and then use another counter "Counter 1" to generate a single pulse and then connect the output of "Counter 1" to the gate of "Counter 0". Just make sure that you specify in the pulse generation to be gated, you can use the GPCTR_Change_Parameter to configure gating. This should get you a delayed pulse train generation. There is an example that is shipped with NI-DAQ to generate a square wave that can get you started. I hope this helps.
0 Kudos
Message 2 of 5
(3,944 Views)
Thanks for the help but I guess I should have stated that I wanted to do this with a single counter - the other counter on the board is already dedicated to a separate task.
0 Kudos
Message 3 of 5
(3,944 Views)
Dave,

I can't think of a way of doing this with 1 single counter, because according to the help file the initian_delay parameter does not seems to work with the DAQ-STC and pulse train generation. Another idea (if your setup allows) would be to use the analog output to generate the gating signal for the counter, this way we would be using the internal counter for analog output. I'll do some more thinking to see if I can find another solution with just 1 counter.
Regards,
Gazoo!
0 Kudos
Message 4 of 5
(3,944 Views)
Dave,
I don't know if you have solved the problem yet, but I have a bit of an idea. You had said that you were unable to use two counters because the other is deticated to a separate task. What is this task? If the task is outputting a pulse or a pulse train, you could route the signal using Select_Signal to either a PFI Line or an RTSI Line(if available) and set it up as a trigger/gate for the other counter. That way, you could really use this counter is two places at once.
Just a Thought
0 Kudos
Message 5 of 5
(3,944 Views)