Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

DigitalChangeDetection event is not always raised.

I have written a application using C#, DAQmx 8.9 and a PCI-6509 digital I/O card that runs on a PC with Windows Vista. The PC controls a couple of stepper motors over serial ports and has a couple of digital inputs that that change state when the system moves.  The digital inputs change state (pulse) for about 20 milliseconds every half a second.I am having occasional problems (about once every 10,000 to 100,000 movements) with the digital inputs where the DigitalChangeDetection event is not raised.It seems to be more frequent if I run my application on a multi-core processor and also when serial port communications are taking place.Does anyone have any ideas what might cause this problem?

 

 

0 Kudos
Message 1 of 4
(3,902 Views)

Thanks for posting on the NI forums.  If you see a change in voltage that occurs before the turn on time of the input circuitry for the PCI-6509, then would miss that change in voltage.  I am not sure if this is exactly the case though because you are receiving changes every half second.  However, this may be something to pay attention to.  Could you try slowing stepper motor to see if this behavior occurs?  This is a tough problem because of the rarity of the missed change. 

 

Why Does Change Detection Miss Changes, or Time Out?
http://digital.ni.com/public.nsf/allkb/ECA804A687C8D65D86256E7B005EA3D5?OpenDocument

 

I have a few additional questions about your application.  How are you measuring that the change did not occur and what are you using the DigitalChangeEvent for in the application? Could it be possible that the stepper motor is missing the control signal to move therefore causing there to be no DigitalChangeEvent?    

Regards,
Jordan F
National Instruments
0 Kudos
Message 2 of 4
(3,883 Views)

Hi Jordan F

The photo-sensors are hooked to 74HC14 inverting Schmitt triggers which drive the digital inputs.  The photo sensors are interrupted by a simple mechanical system that is attached to the stepper motors. I check to make sure the DigitalChangeDetection event was raised after the stepper motor has finished moving to its new position to make sure the mechanical system is functioning correctly.  I have set the channels DigitalFilterEnable to true and DigitalFilterMinimumPulseWidth to 2 milliseconds.  The task SampleQuantityMode is  set to ContinuousSamples.  This problem does not appear to be affected by the state of the task SychronizeCallbacks property.

Would it be a problem if 2 inputs (from different stepper motors) change state at about the same time?

Dave

0 Kudos
Message 3 of 4
(3,881 Views)

When the 6509 (or any other Static DIO device that supports change detection) sees a change on one of the input lines, an interupt is generated and the DAQ driver notifies the software that a change occured.  The manual states (page 9) that an overflow bit will occur if you see multiple changes before the software has processed the previous change. However, there is a chance that you could miss changes if the input circuitry is not ready and if the pulses are coming in too quickly.  If this was the case, you would not see any errors and it would be a limitation of the hardware.  If a change is detected, there is no information as to where the change occured (which channel) so I do not think it would make a difference if the change was occuring on other lines.   

 

Why Do I See Two Different Errors When using Change Detection with a Static DIO Board?

http://digital.ni.com/public.nsf/allkb/3C945830C285A5C186256E7B005FCB3B?OpenDocument 

 

6509 User Specifications (Page 9)

http://www.ni.com/pdf/manuals/372117b.pdf

Regards,
Jordan F
National Instruments
0 Kudos
Message 4 of 4
(3,860 Views)