Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

about physical channel names ?

Hi,
 
I would like to ask about reading from more than one channel using PXI 4472, when I read from two successive channels the program works swithout any problem, but when I try to acquire data from two inconsecutive channels (example 2 and 6) the system crashes. I am not sure about the physical name I use.
 
For example to read from channels 3 and 4 I use:        Physical name="PXI1Slot2/ai3:4";
And to read from channels 2 and 6 I use:        Physical name="PXI1Slot2/ai2,PXI1Slot2/ai6";  two names are separated by comma.
 
Is that correct?
 
Thanks in advance.
 
Amna
0 Kudos
Message 1 of 5
(4,281 Views)

Hello Amna,

Just one question to help you. What are your programming language?

Regards,

Julien Roland - District Sales Manager
NI Belgium - Technical Support

Don't forget to rate a good answer
0 Kudos
Message 2 of 5
(4,248 Views)
Sorry,
 
I see the title (programming language is VC++).
 
Could you say to me which is the error code? And could you give me a little bit more of your code....
 
Thanks in advance,
Julien Roland - District Sales Manager
NI Belgium - Technical Support

Don't forget to rate a good answer
0 Kudos
Message 3 of 5
(4,244 Views)

Hello,

First of all, thank you for your replying, second I am using VC++, the error in my code was memory allocation error, I had allocated space less than the actually needed space.

Now my program works , sometimes I get an error when I stop the task and recreate it again for starting another acquisition with different parameters (sample rate, number of read samples,..).  I get the error message "the task is already used". I read the TaskName and the taskHandle, and thier values don't change after stopping and clearing th task.

Is that normal, Could you explain to me?

Best regards,

Amna

0 Kudos
Message 4 of 5
(4,234 Views)
Amna,
 
Happy to hear you solve the first problem.
 
You will have to load the task using the DAQmxLoadTask function and then start the task with the DAQmxStartTask function. After that, you will perform the read or write operation and clear the task (Is it an function to clear the task?)or place a destructor of the task ( ~CNiDAQmxTask() ).
 
I hope I can help you,
 
Regards,
Julien Roland - District Sales Manager
NI Belgium - Technical Support

Don't forget to rate a good answer
0 Kudos
Message 5 of 5
(4,220 Views)