Hi! i'm trying to program my PCI-6220 with Ni DAQmx visual C to acquire simple data from 2 different channels.
I saw the example on acquiring one simple data from one channel. so i
tried to add another channel by adding another task and changing the
channel number and using the read function.
The program runs but gives me the following message: "DAQmx Error: the
specified resource is reserved. the operation could not be completed as
The thing is that i have already done this procedure of two channel
simple acquisitions with Ni DAQ using a PCI-6024E and it worked
by simply defining another channel, another read function and another
error handler. in DAQmx that doesn't work. If anyone could please help
You cannot have multiple tasks that access the same hardware. That means that you can only have a single task for analog in or analog out. You have to change your channel list. For example, you can specify Dev1\ai0:3 to acquire channels 0 through 3. Dev1\ai0,Dev1\ai3 will acquire channels 0 and 3 but not 1 and 2.
Thank you for your reply. I made as you told me and it works by changing the function DAQReadAnalogScalarF64 to DAQReadAnalogF64. but i am obliged to have multiple tasks because i am programming a CCD and each time the CCD takes a set of pictures, i have to call DAQReadAnalogF64 to acquire data from two channels. so i am obliged to repeat the function as long as the CCD works. I used to do it in NI-DAQ and i'm a little surprised to know that i cannot do it with NI-DAQmx.