02-15-2013 05:38 PM
I am using the USB 6218 to run 2 NI task at the same time in my vi. One task is acquiring a pressure transducer voltage and scaling it. The other task is count frequency pulses from a flow meter and scaling. Both task run fine when I run them in Max, or run them individually in my vi as a sub-vi. But when I try to run simultaneously I get erroneous reading from the counter. It seems like the counter is loosing its task after its first reading. Each task is written in its own sub-vi which takes one sample, and I am sure the task has stopped before the other task begins. I am not getting any errors, but I have to shut down and restart the computer to clear the counter task before it can start reading correctly.
Solved! Go to Solution.
02-18-2013 10:01 AM
Hello joe_n1,
It sounds like this issue is due to how you are using your tasks in subVIs. If you create a task and then clear it each time, then each time the task will start out fresh. As you put, it will lose its task after the first reading.
To avoid this, make sure you are only creating the task once (generally at the beginning of your VI) and then clearing it once (generally at the end of your VI). Really, the only thing you should be repeating is the actual DAQmx reads. Because of this, I would not recommend putting your tasks into subVIs. You should not have to stop each task before the other begins - rather you should be able to run them simultaneously.
02-19-2013 10:36 PM
Thnaks for your responce! Your solution help!