LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx Counter Output Clear Task.vi doesn't stop the output pulse train

Solved!
Go to solution

Hi all,

 

I'm working with a counter output task with a PXIe card and I am noticing that when i call clear task, the output pulse train doesn't stop outputting. I would like to do this in my 'close.vi' wrapper which handles the task generically at this point, and adding a 'daqmx write' call to that vi requires me to know exactly the type for the polymorphic selector.

 

Is there any way to reset this generically so it would work for any counter out task type, digital out etc.?

 

 

0 Kudos
Message 1 of 5
(2,072 Views)

I've done a lot with counters and this is not a symptom I've observed or heard of before.  What device are you using?  What version of DAQmx?

 

A generic approach you might try is to call DAQmx Stop and DAQmx Clear in sequence.  Neither are specific to task type, so your wrapper preserves its generic nature.  Note that stopping and clearing DO and AO tasks may leave the output terminal at the state/voltage you last left it.  It won't necessarily revert to its default power-up state.

 

Further note: I used to call DAQmx Clear without first calling DAQmx Stop.  Some years ago, I changed that habit for a specific reason I can't now fully recall.  I think it related to the idea that DAQmx Stop behaved synchronously -- all actions related to stopping the task were completed before the function call returned.  Whereas I believe that DAQmx Clear includes some asynchronous aspects.  The function call can return before *all* resource clearing operations have run to completion.

 

 

- Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 2 of 5
(2,055 Views)

Sorry i should clear up what i was saying - the counter output pulse train does stop on clear task, however, it still pulls the line low to ground. My UUT has bidirectional IO lines and leaving the PFI line its connected to pulling the UUT line low can affect other readings.

 

Now if i call a DAQmx reset device, this clears it all up and the PFI line returns to open, allowing my UUT line to reach its true max and min values, but i'd rather not reset the whole device if i can avoid it. Really i'd like to reset a channel instead, in DAQmx is that an option somewhere?

0 Kudos
Message 3 of 5
(2,025 Views)
Solution
Accepted by Lee_Denaro

You might be running into a side effect of a behavior known as "lazy uncommit."  I'm not personally an expert on it, but earch that term & you'll find more info, hopefully including a direct solution.

 

 

-Kevin P

 

[Edit: here's one particular useful article I just browsed.]

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 4 of 5
(2,022 Views)

Yeah i found that discussion too and the DAQmx Tristate call was exactly what i was looking for, thanks so much!

 

Lee

0 Kudos
Message 5 of 5
(2,006 Views)