LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PCI-6515 edge detection DAQmx 19.1

Solved!
Go to solution

I'm having trouble obtaining the correct behavior when sampling Digital Input lines following an edge detection event.  VI attached.  DAQmx19.1, LabVIEW 2018, Win7 Pro, PCI-6515.

 

NI knowledge base articles suggest you need to read the port and mask for the bits your interest in.  If I select "1D U8" in the DAQmxRead.vi it always returns zero.  I'm running out of ideas of changes to make.

0 Kudos
Message 1 of 4
(1,957 Views)

Hi bmann2000,

 

When our code doesn't produce the output that we expect, generally a good troubleshooting method is to compare the code with a known working example if possible.

 

I would recommend copying the code in this tutorial, knowing that it's an NI approved example for change detection. Using this as a base, it can help to decipher what exactly might be going wrong in the code that you attached.

 

Ellin A.
NI Technical Support Engineer
0 Kudos
Message 2 of 4
(1,872 Views)

I've added a circuit to clean up the edge of the Digital Signal.  Now I'm seeing Events on P1.0 but not on P1.1.  Should the PCI-6515 detect change on any pin on Port0, or only the pin denoted by the Task?

The question is more about what behavior I should expect. It would appear that I'm now not missing any edges but occasionally seeing an extra edge.

I've looked but failed to find a manual that explains the internal hardware components used for edge detection and how these are configured by the software.

0 Kudos
Message 3 of 4
(1,869 Views)
Solution
Accepted by topic author bmann2000

Each line is monitored for a change individually. When a change is detected, a sample is take on all the channels defined by the task. This is explained here.

 

Page 1-4 of the NI 651x User Manual shows a high level block diagram of the hardware that is responsible for Change Detection. 

 

Furthermore, page 2-3 goes into a bit more detail about how the Change Detection works. Specifically, an input change generates an interrupt and the device's driver notifies the software.

 

Ellin A.

NI Technical Support Engineer

Message 4 of 4
(1,862 Views)