LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQ event - Change detection event is not working.

I already have a task named Sen_Main_Door (which is a sensor that I already validated on NI MAX). I did this very simple VI to validate the DAQmx Event because I've never used it before. But nothing happens when I start playing with the sensor. Its just a door sensor that I just open and close. 

 

Can you help me figure it out why I have this issue?

Emilio_94_0-1634672072397.png

 

0 Kudos
Message 1 of 11
(2,229 Views)

What DAQ device are you using?  The software-side change detection event depends on a DAQ device that supports hardware-side digital change detection.   Not all of them do.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 2 of 11
(2,198 Views)

In addition to what Kevin said, you need a supported device, you also need to configure the task, like below, which includes the lines, what change of detection you want, etc

 

Snap19.png

Message 3 of 11
(2,195 Views)

I'm using a NI PCIe-6321 and the signal is a Digital Input. 

 

So, the manual should clarify if it can use hardware-side digital change detection?

0 Kudos
Message 4 of 11
(2,175 Views)

Yes, the manual will tell you if it is possible.

 

I have never used a configured MAX task for the change event; I make my own task in LabVIEW, not sure what needs to be done in MAX.

0 Kudos
Message 5 of 11
(2,172 Views)

The good news is that your device DOES support hardware-side digital change detection, so you can use the code mcduff illustrated in msg #3 as a starting point for configuring it.  (Like him, I too don't know anything about setting it up as a global task in MAX).

 

I *think* you'll find that the event structure wants to own the job of starting the change detection task, so you may need to avoid calling DAQmx Start Task yourself.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 6 of 11
(2,131 Views)

I'll try to create the task within LabVIEW.

 

By the way, if I don't add the Start Task, LabVIEW will crash with a Access Violation alert. Every time.

0 Kudos
Message 7 of 11
(2,119 Views)

Thanks for the correction.  I think mcduff has a lot more familiarity with DAQmx Events than I do - any insights?

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 8 of 11
(2,112 Views)

I have never had that issue with the access violation, but I never used a MAX Task either. What you saw in the picture is what I do. Maybe some code or details would be appropriate, but I cannot look at it till later tonight as today is crazy.

 

mcduff

0 Kudos
Message 9 of 11
(2,102 Views)

This is what I did and I had no luck.

For now I decided to continue with my project doing some polling, but it is not ideal because the computer is a little bit slow.

 

Emilio_94_0-1634763154926.png

 

0 Kudos
Message 10 of 11
(2,089 Views)