Hi,Roberto Bozzolo
Thanks for your reply.
Since I'm new to CVI ,until you mention what is in task0 I found i didn't start a task before the AIClearAcquisition function ,now I delete the AIClearAcquisition function and the program runs with no error popup
but there are new problems :
I want to acquire analog voltage in 2 channels simultaneously
part of my C code is :
:
<<<<<<<<<<<
AIStartAcquisition (board, channel0, 2*points0, samprate0, 10, -10, &rate0, &task0);
SetCtrlAttribute (multipnl, multipnl_TIMER_CHAN0, ATTR_ENABLED, 1);
>>>>>>>>>>>
(the cmd button 0 enables the timer_chan0 and the timer_tick event begins)
the TIMER_CHAN0 callback is:
<<<<<<<<<<<<<<<
AIReadAcquisition (task0, points0, LATEST_MODE, &backlog0, GROUP_BY_CHANNEL, waveform0);
DeleteGraphPlot (panelHandle, multipnl_GRAPH_CHAN0, -1, VAL_DELAYED_DRAW);
PlotY (multipnl, multipnl_GRAPH_CHAN0, waveform0, points0, VAL_DOUBLE, VAL_THIN_LINE, VAL_EMPTY_SQUARE, VAL_SOLID, 1, VAL_RED);
>>>>>>>>>>>>>>>
:
<<<<<<<<<<<
AIStartAcquisition (board, channel1, 2*points1, samprate1, 10, -10, &rate1, &task1);
SetCtrlAttribute (multipnl, multipnl_TIMER_CHAN1, ATTR_ENABLED, 1);
>>>>>>>>>>>
(the cmd button 1 enables the timer_chan1 and the timer_tick event begins)
the TIMER_CHAN1 callback is:
<<<<<<<<<<<<<<<
AIReadAcquisition (task1, points1, LATEST_MODE, &backlog1, GROUP_BY_CHANNEL, waveform1);
DeleteGraphPlot (panelHandle, multipnl_GRAPH_CHAN1, -1, VAL_DELAYED_DRAW);
PlotY (multipnl, multipnl_GRAPH_CHAN1, waveform1, points1, VAL_DOUBLE, VAL_THIN_LINE, VAL_EMPTY_SQUARE, VAL_SOLID, 1, VAL_RED);
>>>>>>>>>>>>>>>
Problems are:
1.When the program runs it returns no error
BUT I FIND : two graph controls display the same waveform which the two graph should display different waveform according to the different channel number
(in my program :channel0 is "0" channel1 is "1" borad is 1)
2.I look up the Standard Libraries Reference Manual and find a Function named "void SetEasyIOMultitaskingMode (int multitaskingMode);" so I insert it to the program and set the multitaskingmode to MULTITASKING_AWARE but when I run the program again it generates error:Missing Prototype, I see the easyio.h ,there is no such a function
If I want to acquire 2 or more channels analog input is there any other way to realize (with the Easy I/O for DAQ library)??
thanks really a lot again!!