Discussion:
how to use internal clock for reading or writing of digital signal for NI -6229 PCI Cards
(too old to reply)
Ganga
2006-02-17 11:40:38 UTC
Permalink
i am using NI 6229 PCI cards for reading digital signal from MicroController .
how can i use internal sample  Clock for this purpose?  i am using M-series one and using DAQmxReadDigitalU32 function to read.Message Edited by Ganga on 02-17-2006 05:23 AM
Ganga
2006-02-21 08:10:38 UTC
Permalink
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?
 
Tom W [DE]
2006-02-22 00:40:41 UTC
Permalink
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-
vinoth002
2007-06-15 06:40:09 UTC
Permalink
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

Loading...