02-17-2006 05:19 AM - edited 02-17-2006 05:19 AM
Message Edited by Ganga on 02-17-2006 05:23 AM
02-20-2006 10:54 AM
02-21-2006 02:00 AM
Hi Tom,
Thank u for your suggestions.i am having problem what to use input for DAQmxCfgDigEdgeStartTrig function.
there we are indicating that /Dev1/PFI0. what type of signal should be given at this port?and how can we obtain continous samples?
Actually i am trying to measure ON-time & Period of a digital signal.so i am giving Digital Input at Dev1/port0/line0.here i am making use of only one line. and i am using sample clock generated by Counter0 to sample digital input at continous interval.
is there any better method to acheive this?
02-21-2006 06:14 PM
Hi Ganga-
The /Dev1/PFI0 line is configured for a digital start trigger in this case. If you do not need triggering then you can simply comment this line out.
In order to switch to continuous operation, you only need to change the "DAQmxErrChk (DAQmxCfgSampClkTiming (taskHandleDig,"/Dev1/Ctr0InternalOutput",rate,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,sampsPerChanToAcquire));" to indicate continuous sampling by "DAQmx_Val_ContSamps" . More information is available in the NI-DAQmx C Reference Help (Start>>Programs>>National Instruments>>NI-DAQ). A similar change is necessary to configure the counter for continuous generation in the "DAQmxErrChk (DAQmxCfgImplicitTiming (taskHandleCtr,DAQmx_Val_FiniteSamps,sampsPerChanToAcquire));" function.You would then also need to update the example to call the DAQmxRead function multiple times in a loop to ensure that you do not overflow your input buffer.
If you are trying to measure pulse characteristics you would be better advised to use one of the counters on your device. "On time" measurements are more commonly referred to as pulse width measurements and are demonstrated by the example "C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Counter\Measure Period or Pulse Width\Pulse Width". Period measurements can be performed as in "C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Counter\Measure Period or Pulse Width\Dig Periods-Buff-Cont-High Freq 2 Ctr".
The first example shows a "single shot" measurement while the second shows a buffered measurement that requires a clock to repeatedly sample data at specified intervals. Both schemes will work well for either measurement type. As before, the clock can be generated by the second counter on your device. If you are making the measurement with counters, you will need to be careful to perform continuous pulse train generation because a finite pulse train requires the use of both counters and would preclude the period and/or pulse width measurement from being taken.
Hopefully this helps-
06-15-2007 01:22 AM
Hey, can you give me an example for correlated digital o/p using counter as clock in LV 8.2? I am also using USB 6229..
Vinoth
06-15-2007 04:26 PM
06-18-2007 12:26 AM
Hi Abhinav,
That example code was helpful.Thanks a lot.
Vinoth