Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Use of the same counter in a new task within the same VI?

HI everyone,

I have a simple question regarding a test that I am doing.  I have a test board with a single input pin that requires 2 different counter tasks.  One to generate a frequency scale and the other to output a specific number of pulses.  My question is can I create a task for the frequecy test, close and clear that task and generate another task that does the pulses on the same counter?  I've tried this but it appears that the first task doesn't release the counter resource.  I'm using a 6363 board and only have 4 counters so I'm trying to recycle counters for different tasks.  Any tips or suggestions would be most apprieciated.

 

Thanks,

K2

0 Kudos
Message 1 of 4
(4,171 Views)

Generally speaking, that should be able to work.  Are you by chance using the "DAQmx Connect Terminals" vi to route your counter output to the test pin?  As a rule, I almost always do my routing with task-based methods so the routes will be cleared when I clear my task.  The routes set up by "DAQmx Connect Terminals" are independent of tasks, and some connection routes may depend on having control over resources that are already reserved by tasks.

 

If that's not it, can you post your code (LV 2013 or earlier please)?  This sounds plenty do-able.

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 2 of 4
(4,160 Views)

Thanks for the reply.  I have not tried using the "DAQmx Connect Terninals" but I think I will give them a try in the future.  I was able to solve my problem.  As it turns out my conflict was not in reconfiguring the counter.  I realized that I was trying to output a frequency on the counter as well as trying to count the pulses on the same counter - that does not work.  Needless to say I switched the pulse counter to another counter and everything now appears to work correctly.  Thanks again for your input!

0 Kudos
Message 3 of 4
(4,155 Views)

Glad you got things going.  Just to be clear, I wasn't trying to suggest that you specifically *should* use "DAQmx Connect Terminals", in fact I myself generally *avoid* it.  Feel free to experiment and stuff though, maybe it'll be a better fit for your situation(s) than I've found it be for mine.

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 4 of 4
(4,142 Views)