10-19-2021 02:38 PM
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?
10-19-2021 03:54 PM
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
10-19-2021 04:00 PM
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
10-19-2021 06:02 PM
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?
10-19-2021 07:07 PM
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.
10-20-2021 06:05 AM
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
10-20-2021 10:25 AM
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.
10-20-2021 11:13 AM
Thanks for the correction. I think mcduff has a lot more familiarity with DAQmx Events than I do - any insights?
-Kevin P
10-20-2021 12:20 PM
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
10-20-2021 03:53 PM
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.