02-12-2018 07:34 PM
Hello everyone.
This isn't specific to Lab/Windows, but I don't see a thread specifically for NIDAQmx.
I'm trying to get multiple tasks to operate at the same time. We actually have 2 PWM (measure duty cycle) signals and possibly an encoder signal. The person buying the card was hoping a PCI-6351 would work as it has 4 counter channels. Although the card doesn't have built in option to measure duty cycle, I figured I could use two continuous tasks to read the on and off pulse times.
I can't get two tasks to operate at the same time. Through my trials I get an error no matter what I try:
- can't reference the same input line in two channels
- can't have two counter channels in the same task
- can't have two counter tasks active, using the same timebase resource?
There must be something (hopefully simple) that I am missing. What good is a 4 counter card if I can only use 1 at at time.
Grateful for any feedback!
Mande.
Solved! Go to Solution.
02-13-2018 02:07 AM
One possible solution could be to physically drive the same signal to two counters and start two independent tasks, one for period measurement and the other for pulse width, calculating the duty cycle based on those two measurements. I never tried such a configuration but I suppose it should work.
In similar situations I have used an analog channel to acquire the pwm signal and PulseMeas function to obtain both frequency and duty cycle.
02-13-2018 02:09 AM - edited 02-13-2018 02:13 AM
I forgot to say that such a question could be posted as well to Multifunction DAQ board. In that case, though, you should clarify explicitly that you are using CVI or you are very likely to get LabVIEW-related answers. Which are not bad -principles are the same on both environments- but provided you can actually understand LV code, you'll have to translate it to the other language afterwards.
02-13-2018 09:12 AM
Thanks for the reply!
That was my first thought as a solution as well, and maybe that itself is where I am doing something wrong. I am never able to start two counter based tasks at the same time, every task can only have a single channel and if I attempt to start a second task, I get an error that the resource is in use.
02-14-2018 04:49 PM
Hi Mande - What counters and terminals are you trying to use on your device for each task? How are you setting these in LabVIEW?
Also, are you using a program you wrote yourself or an example program in LabVIEW?
02-14-2018 05:12 PM
I'm not sure what I was doing wrong at first, but I eventually got more than 1 counter task running at a time. They have to use the same reference timebase, but at least I can get 4 counter tasks going at the same now.
Thanks for the push to keep poking.