PXI

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx: 2 Counter Outputs in 1 Task?

Is it possible to have two counter outputs with different timings in one task?

One counter will be used to generate a PWM pulse train and the other one will be used to re-arm the trigger for analog data acquisition.

Thanks for your help.
0 Kudos
Message 1 of 6
(3,639 Views)

Hi,

 

Thank you for posting to the NI forums.  You should be able to output on two counters with separate timing sources.  I’ve done just this using an M Series DAQ device and the DAQ Assistant’s auto-generated LabVIEW code.  The screenshot to this VI is attached below.

 

I hope this helps.  Please post back if you have further questions.

 

Ed W.

Applications Engineer

National Instruments

Message Edited by Ed W on 01-26-2007 01:50 PM

Message Edited by Ed W on 01-26-2007 01:50 PM

Message Edited by Ed W on 01-26-2007 01:51 PM

Message 2 of 6
(3,631 Views)
Thanks for the reply.  Actually I'd like to see if it is possible to assign separate DAQmx Timing (Implicit).vi to the two counters because I want one to generate continuous samples and the other one finite samples.  I need these two counters running at the same time so I think I cannot setup the two counters in two tasks.
0 Kudos
Message 3 of 6
(3,621 Views)

Hi,

 

Which DAQ device are you using?  If your device only has two counters, then you’ll have to use continuous generation on both of the counters – finite generation requires two counters.  This information can be found in the DAQmx Help under Key Concepts >> Counters >> Paired Counters.

 

Ed W.

Applications Engineer

National Instruments

0 Kudos
Message 4 of 6
(3,606 Views)
I am using a PXI-6221.  I think I have 2 counters only and I think I will think of a way to use one counter only. 

I am trying to update the duty cycle of a counter output while the task is running.  This page:
http://digital.ni.com/public.nsf/websearch/82C9F3C15F62974E86256EBA0058CAF5?OpenDocument
indicates that to do that I have to update both the duty cycle and the frequency at the same time. 

I am using the channel node to update both the frequency and the duty cycle at the same time.  However, LabVIEW still gives me the error 200557 "Specified property cannot be set while the task is running."

I am wondering if M-series supports this feature.  If not, what's the workaround? 

Thanks.
0 Kudos
Message 5 of 6
(3,603 Views)

Hi,

 

Your M Series device will work for this type of application.  There is an excellent tutorial online with screenshots of sample code that demonstrates just this.  Check out the following Developer Zone document, and post back if you still have problems generating a PWM after using the example LabVIEW code shown in the tutorial.

 

Pulse Width Modulation (PWM) Using NI-DAQmx and LabVIEW

 

I hope this helps!

 

Ed W.

Applications Engineer

National Instruments

0 Kudos
Message 6 of 6
(3,592 Views)