05-22-2009 09:29 AM
IImsmd
I am using a PCI 6221 NI-DAQ device and I want to count the total number of times a sensor is activated. The sensor is connected in on a digital line.
Solved! Go to Solution.
05-27-2009 04:55 AM
Hi Tadhg,
If all you want to do is count the number of times the sensor is activate, the easiest way to so this is to use a counter line, in the case of the 6221 try pin 37, Cnt 0 Src/PFI8. And have a look at the example code Count Digital Events.vi which you can find from the Example Finder under Hardware Input and Output > DAQmx > Counter Measurements > Count Digital Events.
Alternatively, if you must use a digital line, simply read the line and if the sample is true increment a variable held in a shift register, similar to the attached DI Count.vi
I hope this helps,
07-02-2011 04:30 AM
Hi SheelaS,
I have a similar problem as the posted, the problem is that I have a previous version of labview (8.5) so I cant open the file could you please upload a .png figure or so? Thanks!