Showing results for 
Search instead for 
Did you mean: 




I would like to use the Digital I/O USB 6501 as a pulse counter. I know that there is an input (2.7) that can be used for that purpose. However, I don’t know how to use it. I downloaded an example that it’s working fine, the USB-6501 Interactive Control. With that example I can configure all the lines as high/low outputs/inputs, but how can I use the counter? Is there an existing VI for that purpose?

I would appreciate any help.

Thank in advance



Message 1 of 20


The details of the counter on the NI-USB-6501 are as follows:

Number of counters               -         1 (P2.7 can be configured as a counter)
Resolution                              -          32 bits
Counter measurements        -          Falling edge counting
Maximum input frequency     -         5 MHz

Minimum high pulse width    -         100 ns

Minimum low pulse width     -          100 ns

I have attached 2 example VIs explaining how to utilise this counter. One file is made using LabVIEW Express VIs and the other file is made using lower level VIs. Both of these methods work, but note that there is more programmatic control of the process using the lower level approach. If you have any questions regarding how the VIs work or anything else, just ask.

Both should open in LabVIEW 8.0 onwards but please let me know if you cannot open the VIs.

Many Thanks,


Applications Engineer

National Instruments UK

0 Kudos
Message 2 of 20

Hi Ian,


Many thanks for your examples; they seem to be exactly what I am looking for. I can open both examples but I can’t run them. I get the following error when I open the Low-Level:


Error -200099 occurred at DAQmx Create Channel (CI-Count Edges).vi:4

Possible reason(s):


Physical channel not specified.


Task Name: _unnamedTask<13>


My device is connected and I guess I have the right drivers because the USB-6501 Interactive Control is working fine, so I don’t know what it might fail. I’m not very familiar with tasks; do I need to configure something else?


Thanks for your help



0 Kudos
Message 3 of 20

Hi Vicente,

That error just means that you need to specify which counter to use in the programs I’ve sent you (rather than a hardware problem):

  • For the lower level VI, on the front panel, select the counter from the drop down list before you run the program. This tells the program which counter to use if you have multiple counters available. Since you have 1 counter on your USB device, only one option should be available on the drop down list (it will probably look something like ‘Dev1/ctr0’).
  • In the express VI example you will need to switch to the block diagram view <ctrl+e>, then double click on the DAQ Assistant express VI to configure your counting task. In the window that pops up click ‘remove channels’ at the top, then click ‘add channels’ and select your device. You can confirm that all is well by clicking ‘Run’ at the top of the DAQ Assistant configuration window and checking that the ‘measured value’ increases as you count a pulse. Press OK and exit the configuration window when you're finished.

Let me know how you get on,


Message Edited by Ian Colman on 10-23-2007 07:22 AM

Message Edited by Ian Colman on 10-23-2007 07:22 AM

0 Kudos
Message 4 of 20


Hi Ian,


If I click counter I can only see ‘Browse’ and if I select this I can read ‘Select item/s’ but there is a blank list. If I type the name you sent me I receive a new error:


Error -200220 occurred at DAQmx Create Channel (CI-Count Edges).vi:1

Possible reason(s):


Device identifier is invalid.


Device Specified: Dev1


Task Name: _unnamedTask<7>


Any suggestion?  


Thanks for your help



0 Kudos
Message 5 of 20
Hi Vicente,

In that case I'd like you to go into Measurement & Automation Explorer (MAX, a blue icon with a yellow arrow on it) and check that your USB-6501 shows up under 'Devices and Interfaces > DAQmx Devices' on the left. Does it show up?


0 Kudos
Message 6 of 20

Hi Ian,


Yes, it appears under devices and interfaces. There is a field that says USB devices and if we click there we can read this name:







0 Kudos
Message 7 of 20
If the device is showing up in MAX then, we should just verify that everything is working okay. Click 'Self-Test' at the top of MAX when your device is selected and verify that it passes this. Click 'Test Panels...' at the top and confirm in there that your counter is working by doing the following:
  • select the 'Counter' Tab
  • selecting 'Edge counting' from the mode drop-down list
  • select a suitable source to count during the test
  • click start

Let me know if these steps are successfull and as many details as you can if they are not.



Message Edited by Ian Colman on 10-23-2007 09:23 AM

0 Kudos
Message 8 of 20

Hi Ian,


I can’t follow your steps. I print you exactly what I can see in MAX:

On the left side it appears my device but I can’t find the ‘self-test’ that you mention. Instead of having ‘Test panels’ I have ‘Open Visa Test Panel’, maybe it’s the same. But, definitely I can’t select your last options.

Thanks for your help




0 Kudos
Message 9 of 20

Oh right I see, that screenshot is a great help. It shows me that your device is setup using a driver called 'DAQmx Base', where as you should normally have the device set up with 'DAQmx'. Its easy to change this. In MAX, with the device selected and window open as in your screenshot:

Go to Tools >> NI-DAQmx Configuration >> NI-DAQmx USB Driver Selector
Select the NI-DAQmx option rather than NI-DAQmx Base option

You should then have more options avaliable to you, such as test panels etc. More importantly, that should mean the VIs work.

If you still cant select your device in the low level VI (eg. Dev1/Ctr0) then do the following:

  • Right click the drop down menu on the front panel (where you should select your counter)
  • Select 'I/O name filtering...'
  • Select 'Digital Input' instead of 'Counter Input' in the I/O Type field
This should allow you to select Port2/Bit7 or PFI0 as your input.

Hope this helps,


Message Edited by Ian Colman on 10-23-2007 10:39 AM

0 Kudos
Message 10 of 20