Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Duplicate TaskHandle

Solved!
Go to solution

Hello,

 

I am wondering if there is a way to duplicate a TaskHandle variable, for example

 

TaskHandle Task1, Task2;

DAQmxCreateTask ("", &Task1);
Task2 = Task1;

 

//configure and start Task1

 

DAQmxWriteAnalogF64 (Task2, ...);

 

 

I would expect this to work because since TaskHandle is defined as void*, any modifications to Task1 after the Task2=Task1 assignment should equally affect Task2. However, I receive a "Task specified is invalid or does not exist" error when writing to Task2, though Task1 works fine.

I would be glad to hear any suggestions.

Regards

 

0 Kudos
Message 1 of 2
(5,629 Views)
Solution
Accepted by topic author wawrzeniec

Sorry, it turns out this was an error on my part and it actually works as expected.

 

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