Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
1 ratings:
 5 out of 5     Rate this Document

Configuring Multiple Ports for Digital I/O Gives "badChanError" with PCI-6601

Hardware: Counter/Timers (TIO)>>Devices>>PXI-6601, Counter/Timers (TIO)>>Devices>>PCI-6601

Problem: When I try to configure multiple ports on my PCI (or PXI) 6601 board for Digital I/O, I receive the following error in LabWindows/CVI:
Function DIG_Prt_Config return value == -10007
badChanError: A channel, port, or counter is out of range for the device or configuration;
or the combination of channels is not allowed, or the scan order must be reversed.
This is the code I used to attempt to initialize the 6601 to have two ports ready for digital output:
DIG_Prt_Config (2, 0, 0, 1);
DIG_Prt_Config (2, 1, 0, 1);
The afore-mentioned error occurs on the second line of code.

Solution: When you configure the first port as above, NI-DAQ configures all 32 digital lines on the 6601. Attempting to write to line 30, for instance, after configuring the first port will work fine. There is no need to initialize port 3 beforehand. Instead, the software treats the board as if it has one 32-line port.

The attachment below shows this behavior, along with the correct and incorrect methods of port access.

Related Links:

Attachments:


6601.zip


Report Date: 02/08/2001
Last Updated: 06/17/2004
Document ID: 267G39EZ

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit