03-10-2008 09:12 AM
Hi.
If it isn't right place for my question,
then could you please point me to the proper one.
I have PCI 6602
board, NIDAQmx and ANSI C
I would like to generate pulse series for
every external pulse.
Frequency of external signal varies about 5-100 Hz
Delay from external signal and length of pulses in pulse series
are defined interactively and should be
settable smoothly without missing any external pulse
Then continuous loop:
while(1)
{
if (DAQmxWaitUntilTaskDone()) {
DAQmxStopTask();
if ( there are any interactive changes) {
DAQmxCreateCOPulseChanTime()
// set new delay and length
...
DAQmxCreateCOPulseChanTime()
// set new delay and length
}
DAQmxStartTask();
}
respond to User Interface
}
Any suggestion is welcome.
Thanks
Andrew
03-11-2008 06:26 PM
Hi Andrew, thank you for using our discussion forums. The reason you are not able to go faster than 5Hz without missing a trigger pulse is because you are stopping and starting the task, and there is a certain amount of time needed for these steps to occur. Also there are only a limited set of properties that can be set while counter tasks are running and setting the initial delay is not among them. Therefore it is not possible to vary the initial delay while the task is running. Have a look at the following Knowledge Base article. I realize that the final solution is coded in LabVIEW, but the description is in terms of counters and what is described can be replicated in ANSI C. This solution is similar to what you are looking.
Chris_K
03-13-2008 12:32 PM
03-14-2008 06:23 PM
The example I pointed you to uses a retriggerable pulse task where the pulse cycle is specified by low time and high time. By setting the low time and high time independently you can have it gate your continuous pulse train via the pause trigger. You can then change this high time and low time to create a variable delay, and length of pulse. I think if you use your sample clock to trigger the single pulse you should be able to achieve your application.