03-16-2006 12:25 AM
03-16-2006 03:27 PM
Hello Sindhu,
The best way to output pulses at a defined frequency would be to use pulse train generation from one of your counters. There is a great example of continuous pulse train generation installed at C:\Program Files\National Instruments\MeasurementStudioVS2003\VCNET\Examples\DAQmx\Counter\Generate Pulse\GenDigPulseTrain_Continuous. Please take a look at this and let us know if you have other questions.
Regards,
Laura
03-22-2006 10:49 PM
Hi Laura,
Thanks for your reply.Is there any event to fire when we write a digital signal for every 0.25 seconds.Because I need to read an analog signal when I send digital signal for every 0.25 sec.How do I know whether the signal has reached the device or not??
Regards,
Sindhu
03-23-2006 04:51 PM
Hi Sindhu,
Am I correct in thinking that you do not want to use your 6221 to output a digital pulse, but that you are getting a digital pulse from somewhere else that you want to use as a trigger for the analog input? And you will have more than one trigger? If this is the case, then it can be accomplished by doing a retriggerable operation. The way that this works is you use the counter on your board to generate the sample clock for your analog input because analog input cannot do retriggerable operations with its own sample clock. You can modify the example GenDigPulseTrainContinuous_DigStart that is in the same location as the example I referenced before to be retriggerable by using the property DAQmxSetStartTrigRetriggerable.
After doing that and testing to make sure that it works, you can setup an analog input task like the example ContAcqVoltageSamples_IntClk but specify the source of the sample clock to be the internal output of the counter you used in the counter portion of your program. If you need help with the terminal names (You will need to use Ctr0InternalOutput for example), you can reference the NI-DAQmx C Reference Help at Start >> Programs >> National Instruments >> NI-DAQ. After doing this, you will acquire the same number of samples as the number of pulses you choose to generate in the counter portion of your code every time a trigger is received.
Also, I have come across an example that does retriggerable analog input using the counter as a sample clock in C++. Either by using this example or modifying the shipping examples as I stated above you should be able to achieve what you are trying to do.
Let us know if you have any questions.
Thanks,
Laura