Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How to start stop and restart the counter output in frequency countinuous sampeling mode

Hi,
 
I am working on LabVIEW 7.1. with the DAQPad-6016.
For a PWM application, I need to stop the switching that performed using the counter, Setting it to its idle state (low) and then restarting it later on.
I encounter an error (-200875) stating:
"DAQmx Write is supported for counter output channels only while the task is running.
To use DAQmx Write with the given task, invoke DAQmx Start prior to DAQmx Write.  To specify the frequency and/or the duty cycle while the task is not running, set DAQmx properties instead of invoking DAQmx Write."
 
How do I set the counter output to a specific state of at least the idle state and then restart its function as a counter.
 
Thank you,
 
Ron
 
 
 
0 Kudos
Message 1 of 5
(3,822 Views)

Hello Ron,

If I understand correctly, you have continuous pulse generation.  During this generation, you need to occasionally stop the counter output and restart it later.  Please let me know if I have assumed incorrectly. 

Using the DAQmx VIs, it is possible to stop a task without clearing it, and then restart the task later on.  The error you are seeing makes it necessary to use the DAQmx Channel Property Node to set the frequency and duty cycle of the counter output when the task is stopped.  I have included a screenshot on how to use this property node to change the frequency of the output before restarting the task. 



Message Edited by BrowningG on 02-04-2008 12:46 PM
Regards,
Browning G
FlexRIO R&D
0 Kudos
Message 2 of 5
(3,804 Views)

Thank  you for your clear and helpful response BrowningG.

Your suggestion does answer my problem and I am attaching a screen shot of how I decided to applicate it to suit my needs (maybe it will help somebody encountering the same problem).

But, I have another question, Is it possible to create a task for two counters once and then to switch them on and off (the same way you explained) separately?

Thank you again,

 

Ron

0 Kudos
Message 3 of 5
(3,793 Views)

Hello Ron,

I am glad you found a solution!

One way to switch back and forth between two tasks is to use the DAQmx Control Task VI.  This VI is located in the DAQmx Advanced Task Options palette.  This VI allows you more control over the task operations than just the Start and Stop VIs.  More information about this VI can be found in the LabVIEW help by selecting the Index tab and searching for “daqmx control task.”  This section details how each of the 5 settings works.  I have included another crude screenshot of how this is possible. 



Message Edited by BrowningG on 02-05-2008 06:40 PM
Regards,
Browning G
FlexRIO R&D
0 Kudos
Message 4 of 5
(3,777 Views)

Hi 

I got this error in my LabVIEW program.

Zhangfy_0-1732523663323.png

How can I solve it? Thanks! I have uploaded my VIs.

Download All
0 Kudos
Message 5 of 5
(49 Views)