Discussion:
Change Detection Event Callback
(too old to reply)
angelmcdoggie
2008-05-21 04:10:08 UTC
Permalink
Dear All,
 
I have several questions about the change detection event callback based from the VC++ shipping example, ReadDigChan_ChangeDetection_Events.
 
1.  What is the rate of the configure change detection timing?  It's not defined in the argument.
 


m_task->Timing. ConfigureChangeDetection(
risingEdgeLines,
fallingEdgeLines,
DAQmxSampleQuantityModeContinuousSamples, sampleSize);
 
2.  Is the callback single-threaded or multi-threaded?
3.  Is there anyway to differentiate which signal pin/s generated the change detection?  Is there an API for this operation or is it simply depends on the user how to figure this out?
     Is there any data passed in the userData to achieve this?
           void CReadDigChan_ChangeDetection_EventsDlg::OnDigitalChangeDetection( void* userData)

{


int value;
CNiComInitialize com( CNiComInitialize::Apartment);
if ( m_taskRunning) {
      try  {
             //read sample
             m_reader->ReadSingleSampleMultiLine( m_data);
             ..........
 
 
Thanks a bunch, A =)

 Message Edited by angelmcdoggie on 05-21-2008 12:05 PM
angelmcdoggie
2008-05-21 04:40:10 UTC
Permalink
Hello again,
To add #3, what kind of data is being passed to the callback ()? 
Thanks,
A
 
Mark E
2008-05-21 20:40:13 UTC
Permalink
Hi angelmcdoggie,




1.      
Change detection timing ?Configures the task to
acquire samples on the rising and/or falling edges of the specified lines or
ports?, therefore the rate is completely dependent on how quickly your
lines/ports change.


2.      
It would probably be better to ask you what your
concern is so that it can be fully addressed.


3.      
Because change detection uses logic that only
tells you that there was a change, it is impossible to know from hardware which
line changed. However, the values of all lines/ports should be captured and you
can compare the before/after cases to determine which line changed. See this <a href="http://digital.ni.com/public.nsf/allkb/4B9452520950566A86256F31006C9AEF?OpenDocument" target="_blank"> KnowledgeBase</a>
for a description of how changes are registered.




I hope that helps.
angelmcdoggie
2008-05-22 10:10:08 UTC
Permalink
Hello Mark,
&nbsp;
Thanks for the pointers.
Regarding #3,
&nbsp;
Based from&nbsp;the same shipping example, I&nbsp;compared a timestamp between a signal running at&nbsp;1Hz and 100 Hz generated by t0, CH1 &amp; t1, CH2.&nbsp; In my program, I placed the 1st marker before the start task, while the 2nd marker is at the start of the callback function.&nbsp; Based from the attachment, there is a great discrepancy with the program reading and scope measurement.&nbsp; I don't have an idea why and how to fix it.&nbsp;
&nbsp;
I am using a cDAQ-9172, NI 9401&nbsp;module &nbsp;&amp; VC++.&nbsp;
&nbsp;
Cheers,
A
&nbsp;
&nbsp;
&nbsp;
&nbsp;


timestampChangeDetection.ppt:
http://forums.ni.com/attachments/ni/70/8896/1/timestampChangeDetection.ppt
Mark E
2008-05-22 21:10:08 UTC
Permalink
Hi angelmcdoggie,





Change detection is supported by the devices listed <a href="http://digital.ni.com/public.nsf/allkb/8914FA5E30971E0C86256FEF005760FF?OpenDocument" target="_blank"> here</a>.
As new products come out, this page should be updated. Just to make sure it
wasn?t missing anything, I checked the 9401 and it does not support change
detection. You have the option of purchasing one of these devices if you need
hardware change detection, or possibly implement some logic in software that
monitors every line and notifies you of any changes you specify. A software
solution doesn?t appear to be trivial.





If you would like more information about purchasing our
products, please visit <a href="http://sine.ni.com/apps/utf8/nicc.call_me?p_lang_id=us" target="_blank">ni.com/contact.</a>
angelmcdoggie
2008-05-23 01:40:08 UTC
Permalink
Hello Mark,
Thanks again for the info.&nbsp; I would like to know the difference between digital change detection and hardware change detection.
Best regards,
A
Mark E
2008-05-23 16:40:07 UTC
Permalink
Hi angelmcdoggie,








Digital change detection is something that happens in
hardware, as described <a href="http://zone.ni.com/devzone/cda/tut/p/id/4102" target="_blank">here</a>. Feel free to read this DevZone article or check out the
links on the left to learn more.
nantek
2008-06-25 20:40:12 UTC
Permalink
Hi Mark,
Could you please tell me if any of the C Series digital input modules (for NI CompactDAQ) supported the Change Detection feature?
thanks
Mark E
2008-06-26 18:40:08 UTC
Permalink
Hi
nantek,


I used
a couple of resources to find an answer for you, so let me share those with you,
and the community.:smileywink:


The <a href="http://digital.ni.com/manuals.nsf/websearch/D524AE8FCF619EDB86257387006524E0" target="_blank"> NI
cDAQ-9172 User Guide and Specifications</a> has a section on ?Change Detection?,
currently on page 37. You need a module that supports correlated measurements,
and they have to be placed in slots 1 through 4.


<a href="http://digital.ni.com/public.nsf/allkb/C663EAD906B2B349862572E50065E1A6?OpenDocument" target="_blank"> This
awesome KnowledgeBase (KB)</a> is a
great summary of our cDAQ modules. I?ll let you go through and pick the module
that meets your channel count, rate, and other needs, but pay attention to
whether the module?s type is ?correlated? or ?static??stick to ?correlated? for
your needs.


I hope
that helps.Message Edited by Mark E on 06-26-2008 01:11 PM

Continue reading on narkive:
Loading...