LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Detecting a Signal on PFI1 using DAQmx Event

I need to be able to detect a signal coming in on a PFI line - not to trigger Analog Input or Output, but just to Do Stuff.  So I have written a test VI using a Counter on the NI PCI-6723 and DAQmx Event structure.  I used an Example VI as a basis.  I have 2 issues.  1. when I send the desired signal (wired to PFI1), I get 2 events, I just want (and expect) one event.  2. when I send the signal to PFI0, I get 2 events as well!  Should not get any.  The VI is Not looking at PFI0.  Any ideas as to what I'm doing wrong?

 

Here is a screenshot of the Test VI  (I have also attached the file)

 

TestVIFP.PNG

TestVIBD.PNG 

0 Kudos
Message 1 of 3
(3,261 Views)

First some notes on your code:

  • You can set Events Received to zero outside the loop, right before it runs instead of setting it in a timeout event and then ignoring timeouts. The way you have it may result in the numbet incrementing before the timeout if there is already an event in the queue when the loop first starts.
  • You can use a local variable instead of property node in order to increment the count. Property nodes force the task to be performed in a user interface thread, so in general you want to avoid them.

 

This seems like an issue with your signal. Have you used a voltmeter to test your setup?

Right-click the event structure and open the Event Inspection Manager to see how close the events are triggered together. If the two events trigger essentially at the same time, maybe you have some bounce in your signal.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 2 of 3
(3,238 Views)

Thank you for your tips & advice.  I got together with our hardware guys and sure enough the wiring into the PFI terminals wasn't quite right.

So now my test VI is working as expected.

Gretchen

0 Kudos
Message 3 of 3
(3,188 Views)