LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx Create Task task to copy

Hi guys, I've looked through the posts but cant find exactly what im after.
 
I create a task with three analogue inputs, set the sampling and triggering and i want to copy this later on when im running a loop to sample some data. The reason im trying to do this is that at present im creating a task, defining all of this stuff each time in the loop and its running really slowly.. i want to speed this up so i thought i would try and define the task before i enter the loop and then make a copy at every itteration of the loop.
 
Ive got a 6120 sampling 3 channels simmultaneously if that helps.
 
This is the error im getting
 
Error -200485 occurred at DAQmx Create Task.vi:1
Possible reason(s):
Measurements: The specified task cannot be loaded, because it is not in Data Neighborhood.
Check Data Neighborhood in MAX.  Look for similar characters, such as the capital letter "O" and the number zero.
Invalid Task Name: _unnamedTask<D6>
Task Name: M1P1
 
Mike
0 Kudos
Message 1 of 5
(3,255 Views)

I do not think that copying a task and setting all the parameters and things like that is going to be any faster. In fact I would say that it is going to be slower. Maybe you could show us the VI. What is it that is taking so long, Is it the setting up of the parameters or is the actual acquisition, the setting up of the parameters is always rather fast for me.

How are you setting the parameters. You should do it like this:

  1. Create the task with MAX (Preferered) or with the create task VI and have this outside the loop.
  2. Then inside the loop make the changes with property nodes.
  3. Outside the loop you need to close the task and clear the task.

I have always had some trouble with the copy task. You need to make sure that the task that you are copying is not running, (ie stop it before you copy it).

Show us your code and maybe I can help more.




Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 2 of 5
(3,250 Views)

Hi Joe, thanks for replying.

I'll tell you what im ultimatley trying to do. I've got a clock signal and im using triggering to cause 2 tasks to run, one takes some measurements and after that the other one sets a voltage.

I had previously tried to get the task definition for the measurement outside the loop but when i run the loop the triggering wasnt working properly so to cheat i ended up defining a new task every time, only problem with that was its really slow but was suitable for the system at the time.

Now though im trying to get the system to run as fast as possible, ultimatley trying to get the loop to itterate about every 30us which is the time it takes my electronic load to settle. Ive stopped copying the task now but this is my code..

 

 

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

Sorry theres a couple of little mistakes in that one..

This one is working and triggers fine when my clock signal is about 100Hz.. if i try a kHz it cant keep up.

0 Kudos
Message 4 of 5
(3,210 Views)
Hi Mike,

I've read over your posts but I'm still not totally clear on what it is you're trying to do. I'd like to point out, though, that a loop rate of more than a few hundred Hz simply isn't practical on a Windows-based machine. You may need to re-think your approach to this to make the timing more hardware-reliant for speed and reliability.

If you can outline again what your overall DAQ program is doing, I may be able to make suggestions to help. Am I right in thinking that you are trying to set up a retriggerable analog input to then perform a further analog task? Any more information you can give would be great.

Regards,
Tom

Applications Engineering, NI UK
0 Kudos
Message 5 of 5
(3,152 Views)