Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Isuue with Counter 3 and 4 on PCI-6601

Hi All,
   I am using counters 1-4 on the PCI 6601 card with NI-DAQmx 8.0 to generate continuous pulses in Labview  8.0. After I configure the counters, I can see the pulses going out on a scope. If I then configure other DIO lines as digital outputs, the pulses on counter 3 and 4 goes away. Counter 1 and 2 is  still okay. Has anyone seen this before. Somehow the configuration on counter 3 and 4 is changing when I try to configure other DIO lines as outputs? For configuration of continuous pulses I  am using the Pulse Train Gen.vi  from the DAQmx PWM Examples.zip folder from NI website minus the while loop and the DAQmx clear Task.vi. The Pulse Train Gen.vi include DAQmx Create Channel(CO-Pulse Generation Frequency).vi, DAQmx Timing(Implicit).vi, DAQmx Start Task.vi, and  DAQmx Is Task Done.vi. For digital outputs I am using DaQmx Write(Digital Bool 1 Line 1 Point). Any suggestions as to why counter 3 and 4 configuration changes and not counter 1 and 2. I need to have these counter going before I configure output lines.   
0 Kudos
Message 1 of 4
(3,560 Views)

plindol3,

 


There are some possibilities but it is hard to know for sure until we get a little more information about your setup.  Could you please tell us which digital output lines you are using? The PFI lines for Counter 0 and 1 are reserved exclusively for counter operations but the PFI lines for counters 2 - 7 are shared with DIO lines.  Could you also post your code so we can see how you are setting up your DAQmx tasks?  Thanks in advance for your reply.

 


Best Regards,

Jeff Tipps

Applications Engineer

National Instruments

0 Kudos
Message 2 of 4
(3,546 Views)
Hi Jeff,
   I have attached a modified version of my code that demonstrate my problem. It is a simple sequence that  1) sets up counters 1-4, then configure my Digital output lines. The whiIe loop that follows does nothing but let the program runs continuously. If I  configure any of the Digital output lines after my counters are set up, the configuration on counter 3 and 4 gets blown away. It appears there is something going on internal to the DaQmx Write(Digital Bool 1 Line 1 Point).vi. To setup my Digital output lines I used measurement and automation explorer tool. I exported the configuration file and included it in the zip folder as well.
 
 
Patrick
0 Kudos
Message 3 of 4
(3,527 Views)
Patrick,

I looked at your code and ran it with a scope to see the behavior you are describing.  I understand why the problem is ocurring.  In your program, you first start 4 counter tasks and then you start 20 digital tasks.  Every time a digital task is started, it will reconfigure the entire digital port for output.  I would combine the 20 digital tasks into one task and start it before the counter tasks.  I found a great example program that uses counter 2 with digital lines 0 through 7.  You will see that the 8 digital lines are combined into one task and started before the counter task.  This should fix your problem.

Example Code: Pulse Train Generation with Digital Output on 660x

Also on a side note, I would recommend that you put the four "DAQmx Is Task Done.vi" vis inside the while loop and use a "stop" button instead of a False constant.  This will allow you to perform error handling while the loop is running and you can stop the program with a LabVIEW button instead of the abort button.  Hope this helps Patrick.

Best Regards,

Jeff Tipps
Applications Engineer
National Instruments
0 Kudos
Message 4 of 4
(3,513 Views)