Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to use changedetection without timingconfiguration

Hi
I have been trying to use my PCI 6221 with (DAQmx 8.01) with  the changedetect feature on my digital IO.  I have 2 questions.
1. Is it required to configure change detection timing in order to use the changedetect ?
2. I have tried to use som examples provided by National. But either I am doing something wrong or simply expecting something else than
intended. Sometimes lines not toggled is detected as toggled and sometimes the program simply didn't detect a line that changed
 
For my first question. I all the examples I have seen the method is the same
 
1. Create channel
2. Configure change detection timing
3. Add digital change detection event handler

Is it really required to configure change detection timing too or can I skip it. I only need to detect the change?

myTask.Timing.ConfigureChangeDetection(risingEdgeLinesComboBox.Text,fallingEdgeLinesComboBox.Text,SampleQuantityMode.ContinuousSamples, 1000);

And for my second question:

Random detection was observed.

My method was:

I used these to examples:

C:\Program Files\National Instruments\MeasurementStudioVS2003\DotNET\Examples\DAQmx\Digital\Read\Values\ReadDigChan_ChangeDetection_Events

C:\Program Files\National Instruments\MeasurementStudioVS2003\DotNET\Examples\DAQmx\Digital\Generate Values\WriteDigChan

I wired Port0/line0:5 to Port2/line0:5. And used Port0 as an input and port2 as an outputport. The readport was first configured to react on both  rising and falling edge and later line0:5 rising and line6:7as falling.  Then I tried to count binaray from 000 to 111 using only line 0:2. At around line0:2="100" the reciever UI started to react. But suddently also line4 that I hadn't been touching this line.  I was able to do this many times with the same strange result. Sometimes data was not latch and sometimes it were. Then I applied only rising on the lines0:5. and falling on line6:7 But it just goteven worse and finally I got a - 200088 error. Please can anyone tell me what I am doing wrong?

0 Kudos
Message 1 of 3
(2,826 Views)

Hi,

Regarding your first question:
The method that you mention is the correct one. Configuring the change detection timing in step 2 is required, as the drivers need to know how to read data on the port.

Regarding your second question:
There is a better way to see digital changes at port0/line0:7.
Use the same setup as you described in the thread.
Run the example from "C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Events\Signal\Change Detection\Read Dig Chan-Change Detection Event" and using MAX to control your digital outputs at port2/line0:7.
Try to control only one line at the time in MAX, then you will be able to see the line changes at port0. At the same time you can see the where the changes have been made(Changed Lines), and the digital values of port0(Data read).
The example reacts every 4. input at port2/line0:7.

Regards

-----------------------------------------------------
Dennis Morini
District Sales Manager
National Instruments Denmark
http://www.ni.com/ask
0 Kudos
Message 2 of 3
(2,791 Views)
Hi
Thank you for your response. I didn't quite understand this quote: "The example reacts every 4. input at port2/line0:7.". In the C file nothing imply that it only respond every 4. input and in your screenshoot it seem to be every time.
 
We also tried to use the C# example as a read and max as an output. But didn't have much success with that either. The only test that seemed ok was when we applied a 0V manually to one line and used MAX to detect the input. I thought maybe the edge was too fast to be detected at the input in loopback but this doesn't seem to be the case since you are able to detect it.
 
Could you try with the C# examples too. Since this is the language we are writting in.
 
BR
 
 
 
0 Kudos
Message 3 of 3
(2,760 Views)