Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

how to use "DAQmx Write: Counter Freq 1Chan NSamp"

Solved!
Go to solution

Hi,

 

I wrote the following program trying to output a series of 100 samples of pulses whose frequency is ramping up from 10 to 100. Device: PCI-6229.

 

I got error: -201291: Pulse specifications cannot be written to a finite counter output task on this device.

 

I do not know what was wrong.

 

Basically I have no idea how to use the vi, DAQmx Write: Counter Freq NSamp 1Chan or NChan

 

I do know how to use property node to change frequency and duty cycle on the fly. However, In this particular post I would like to know how to use this NSamp VI.

 

Thanks.

 

couter-write-nsamp.JPG

0 Kudos
Message 1 of 4
(7,865 Views)

This error is occurring because it's not possible to change the pulse frequency 'on the fly' like this during a finite task for your M-series card.  If you switch to Continuous Samples for your timing, this code will run smoothly. Take a look at the following example for reconfiguring pulse frequency during a finite task:

 

https://decibel.ni.com/content/docs/DOC-6109

 

Best Regards,

 

James M.

Applications Engineer

National Instruments

James M. | Applications Engineer | National Instruments
Message 2 of 4
(7,843 Views)
Solution
Accepted by deepsilence

Buffered counter operations are only supported on STC3-based devices (i.e. X Series and CompactDAQ).

 

Your M Series is an STC2-based device and so does not have support for buffered counter outputs.  Any updates to the counter output characteristics on this board have to be software-timed.  I wrote the example that James linked, and it would be useful if you want an exact number of pulses but don't need the updates to occur deterministically.

 

If you do need deterministic counter updates, you could either switch hardware or implement a workaround using the digital output with a pre-defined digital waveform.

 

 

Best Regards,

John Passiak
Message 3 of 4
(7,838 Views)

James, John,

 

Thanks a lot!

0 Kudos
Message 4 of 4
(7,827 Views)