Dear Community,
at the moment I am working on the data acquisition using a PXIe-4461.
I have managed to read out one channel, also both channels simultaniously is no problem.
When I do so I am creating a task by:
tOsc = new NationalInstruments.DAQmx.Task(sTaskName); tOsc.AIChannels.CreateVoltageChannel("PXI1Slot4/ai0:1", "AnalogIn", AITerminalConfiguration.Pseudodifferential, -10, 10, AIVoltageUnits.Volts);
Which gives me a task from which I can read waveform data of both channels.
What I have tried but did not get to work (I guess I have some kind of missunderstanding, I just startet working with this Hard/Software) is to create a task (array) for each analog channel like:
NationalInstruments.DAQmx.Task[] tOsc; int nChannel = 2; tOsc = new NationalInstruments.DAQmx.Task[nChannel]; for (int iChannel = 0; iChannel < nChannel; iChannel++) { tOsc[iChannel] = new NationalInstruments.DAQmx.Task(sTaskName); string sViChannelName = "AnalogIn_" + Convert.ToString(iChannel); string sResource = "PXI1Slot4/ai" + Convert.ToString(iChannel); tOsc[iChannel].AIChannels.CreateVoltageChannel(sResource, sViChannelName, AITerminalConfiguration.Pseudodifferential, -oSD.OscRange[iChannel], oSD.OscRange[iChannel] , AIVoltageUnits.Volts); }
which would give me the possibility to manage my settings and tasks convinient in arrays.
However, using this for task creation and configuration works fine, also
tOsc[iChannel].Control(TaskAction.Verify);
in the for loop give no error.
When I try to start the task I get the error message that the resource is occupied.
My gues would be that I block the resource already by starting one task for the module.
But how I could manage and use both channels independent?
Thanks for reading and I am looking forward to your replies.
Best wishes
Johannes