OR USB6008 + NiDaqMxBase + Linux input analog simultaneous

Hello!

My configuration:

OR USB6008

NiDaqMxBase

Linux OpenSUSE 11.0 on Toshiba NB200 netbook

I need to measure 4-channel AI 5 times per second.

Yes:

create AI0... AI3 = DAQmxBaseCreateAIVoltageChan (taskHandle, chan, "", DAQmx_Val_RSE, min, max, DAQmx_Val_Volts, NULL)

do

Start AI0 - read AI0 - stop AI0 = DAQmxBaseStartTask (thAI0) - DAQmxBaseReadAnalogF64 (thAI0-DAQmxBaseStopTask (thAI0);)

...

start stop AI3 - read AI3 - AI3

While true

A - while loop takes ~ 1 second

The question: is there a way to expedite the process?

Vadim.

Thank you! I got the idea.

Best regards, Vadim.

Tags: NI Hardware

Similar Questions

  • Strange problem with analog simultaneous output / input

    I use a card PCI-6221. I have an application which generates 2 waveforms (finished samples) and simultaneously records 4 channels of analog input. I am using the sample clock AO as the sample for the analog clock.

    As a test, I plugged in the first AO (AO0) all 4 channel inputs. What happens when I run the vi, it's that the first sample on the first string (AI0) has the value of the last sample that was out on AO0, of the previous generation.

    Example:

    AI0 AI1 AI2 AI3

    -0.369-0,001-0,001-0,001

    -0.001 0.062 0.062 0.062

    0.062 0,124 0,124 0,124

    etc.

    I understand that it is a problem with the relative time of update of the AO and sampling of IT.

    He has to go: AI0 read / write AO0 / read AI1 / read AI2 / read AI3.

    I use DAQmx Timing (sample clock) to specify the clock AO as the sample for the AI clock. I noticed that this has an advantage of input terminal called assets. Ah, I thought - if I put the active side to neutralize the AI always begins sampling half a clock cycle after the OD has updated. Evil. It makes absolutely no difference. Maybe the AO clock signal is a very short pulse?

    Is there a way to specify the order in which updated inputs and outputs analog / sample?

    Hi CDancer,

    Change analog output voltage is not instantaneous. It depends on the speed of scanning of the Council with the difference the tension of the previous.

    You're right that the AO sample clock is a very short pulse. As far as I remember, it is the order of 50 ns.

    Here are two ways to insert a break between the tasks of HAVE and AO:

    • Delay the first conversion of IA (AI0) regarding the sample clock HAVE: use DAQmx calendar > more > converted > sample clock delay > Delay and DelayUnits properties.
    • Delay the sample clock HAVE first with regard to the relaxation of beginning of AI: use the DAQmx > start > more > Delay and DelayUnits properties.

    Brad

  • To input analog shutdown when the analog output is completed and synchronization

    Hello

    I'm trying to get my LabVIEW program to send analog output to a computer and read acceleration using the cDAQ-9184. Chassis output that I use is the NI 9263 and the chassis of entry is the NI 9234. I generate a signal of white noise using LabVIEW Express signal generator.

    The first problem I have is the synchronization. I had an old VI that has begun to measure the acceleration just about a second after the entry has been given to the machine. I used the LabVIEW tutorial on how to sync the analog input and output, only to discover that it does not work with two different hunts. Then I found another tutorial that shows how to synchronize different frames between them.

    The second problem is the cessation of the LabVIEW program. What I want to do is to generate the signal and then simultaneously send and read the input and output analog, respectively. It is because I don't want a phase difference or any shorter signal for a direct comparison. But as soon as the signal is sent to the machine, I want the entry to stop analog playback and then then the LabVIEW program must stop. I want to be able to choose any length of signal to be generated and stop as soon as the entire duration of the signal has been sent to the machine.

    I tried 'DAQmx stop', "DAQmx Timer" and 'DAQmx's task made?' and none of them have worked for me. It is also my first time on a forum posting, so I hope I gave enough information. I enclose my VI as well. The VI shows I read an entry for the analog input voltage, but I am only using this to try to get to the work programme.

    I'd appreciate any help I could get.

    Thanks in advance

    Peter

    Hi Peter,.

    I have some recommendations for you that I think you will get closer to your solution. First of all, I assumed you meant that you had 1 chassis (cDAQ-9184) who had two modules in it (NOR-9263 and NOR-9234). My next steps are based on this assumption, so if it's wrong, please let me know.

    For your first question about the synchronization, the code you provided is very close to what you need. You need to do, however, implement architecture master/slave for startup tasks DAQmx functions. To do this, you can add another frame to the flat sequence structure and put the master start task (input voltage) after the start slave (output voltage) task.

    To manage your second question and that the program ends at the point where you, the first step is to get rid of all the logic that you use with the local variable of length of time. Rather than use this logic, just wire the node "task performed?" of "is task performed?" operate to stop the loop. This will cause your loop to stop as soon as the signal is sent to the machine.

    I have some other recommendations for you that will increase the performance of your program:

    (1) rather than writing on file inside the last loop, you can use the DAQmx Configure Logging (PDM) .vi. You will place this VI between DAQmx Timing.vi and DAQmx Start Task.vi to the task of the analog input voltage.

    (2) after the last while loop, you want to stop the task and analog outputs as well with another DAQmx stop Task.vi.

    (3) rather than using a local variable for the entrance of displacement and wiring it in the DAQmx Write.vi, you can wire directly from the output waveform of the wave to build function node.

    That should help you get started in the synchronization of these tasks.

    -Alex C.

    Technical sales engineer

    National Instruments

  • Digital and analog simultaneous inter channel delay

    I need to a simultaneous analog input 1 channel and 1 entered digital who intend to make possible acquisition of maximum speed. Of course I expect no delay channel inter if the two entries on the edge of clock sample even sampling. But this example shows unexpected behavior. Restart acquisition regularly shows different delays inter channel. I hope there is someone there to help out me. See the included example.

    I asked the support of National Instruments and they came with an adequate solution.

    Time t (0) stamp in the waveform is NOT the start time of the acquisition but it is the time the buffer is read.

    To demonstrate this applies the same "pulse train" to the two channels and t (0) all forms of wave at the same time of departure. Observe that the edges of both signals match exactly. Because a single channel is a digital input, we make the logic of levels of tension into account.

    Thanks to Henk Talsma
    National Instruments
    Engineering applications

  • input analog sbRIO to-1V

    Hey guys,.

    I have a question about the SBRIO9636 with the eval Board. Analog is configured + 1V single ended. Now, if I read the analog input and it is not inserted into the port of signal, it me gives-1V, why he doesn't give me 0V? As a constant value, I can't imagine problems EMV.

    If there is a signal inserted it works fine.

    Kind regards

    Slev1n

    If the signal is physically disconnected, it will float.

    Look here for an explanation: http://digital.ni.com/public.nsf/websearch/4E9B8B3F8FD3A31B862562B5004EA1D9?OpenDocument

  • NIDAQmxBase Linux RHEL 6 x86_x64 USB...

    Trying to get NIDAQmxBase 3.6 w / USB support for installed on LINUX RHEL 6.3 x86_x64 WS

    USB 6501 OEM,

    USB-6009 OEM

    running as root:

    [root@NIX1 /] # mount

    usbfs seems to be mounted... etc/fstab to mount it as indicated

    / dev/map/vg_nix1-lv_root on / type ext4 (rw)
    proc on/proc type proc (rw)
    Sysfs on/sys type sysfs (rw)
    type devpts on/dev/pts devpts (rw, gid = 5, mode = 620)
    tmpfs on/dev/shm type tmpfs (rw, rootcontext = "" system_ubject_r:tmpfs_t:s0 "")
    usbfs/proc/bus/USB type usbfs (rw, devmode = 0666)
    / dev/sdb1 on / boot type ext4 (rw)
    / dev/map/vg_nix1-lv_home market/House type ext4 (rw)
    None on/proc/sys/fs/binfmt_misc type binfmt_misc (rw)
    sunrpc on/var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
    / dev/sr0 on/media/NIDAQmxBase360 type iso9660 (ro, nosuid, nodev, uhelper = udisks, uid = 500, gid = 500, iocharset = utf8, mode = 0400, dmode = 0500)

    lsdaq runs and complains about the firmware:

    [root@NIX1 /] # / usr/local/natinst/nidaqmxbase/bin/lsdaq
    --------------------------------
    Detect of National Instruments DAQ devices
    Find the following materials:

    Device error: incompatible firmware.  Serial number: 01646C 23

    Run /bin/FWUpdate update.

    green light on USB 6501 flashes constantly

    running FWUpdate compains as follows:

    --------------------------------
    [root@NIX1 /] # / usr/local/natinst/nidaqmxbase/bin/FWUpdate
    Could not load library /usr/local/lib/liblvrt.so.12.0
    libXinerama.so.1: cannot open shared object file: no such file or directory
    To download the engine Runtime of LabVIEW, go to http://www.ni.com/rteFinder?dest=lvrte&version=12.0&platform=Linux&lang=en

    location of /usr/local/lib/liblvrt.sa.12.0 reports:

    [root@NIX1 /] # locate liblvrt.so.12.0
    /usr/local/lib/liblvrt.so.12.0
    /usr/local/lib/LabVIEW-2012/liblvrt.so.12.0.0

    STAT to file reports:

    [root@NIX1 /] # stat /usr/local/lib/liblvrt.so.12.0
    File: ' / usr/local/lib/liblvrt.so.12.0'-> 'LabVIEW-2012/liblvrt.so.12.0.0 '.
    Size: 30 blocks: 0 IO block: 4096 symlink
    Feature: fd00h / 64768d Inode: 131699 links: 1
    Access: (0777/lrwxrwxrwx) Uid: (0 / root) Gid: (0 / root)
    Access: 2012-10-22 14:27:59.858557301-0400
    Change: 2012-10-22 14:27:59.813443661-0400
    Change: 2012-10-22 14:27:59.813443661-0400

    NIDAQmxBase 3.6 installs VISA and 'C' interface via. \INSTALL, reports success, seems normal.

    cannot run lsdaq, FWUpdate or anything like that on the Menu of Applications National Instruments (NI-VISA submenu, OR Trace of IO.)

    My guess is that the permissions are always watered.

    Solved and was able to update the firmware.

    Well explained here...  http://digital.NI.com/public.nsf/allkb/93C92D41B25341B286257A4D007BACB8

    and here's how-useful.  http://h10025.www1.HP.com/ewfrf/wc/document?CC=CA&DLC=en&docName=c01769573&LC=en

  • Input analog continuous USB DAQ find amplitude peak to peak

    I need to know if there is a way to use the crest detector when you do an analog voltage input. I use c# VS2005 and 8.6.

    Hi jsheridan,

    Have you looked at the Ridge detector example that comes with Measurement Studio?  The c# example can be found here: C:\Documents and Settings\All Users\Documents\National Instruments\MStudioVS2005\DotNET\Examples\Analysis\PeakDetector\cs (assuming that you have installed on your C drive :).

    The example generates a waveform and uses the PeakDetector class to detect the peaks.  You can take this example and modify it to support what you are doing, or just put some functions in your code.  The detector function takes an array and outputs tables of places, the amplitudes and the second derivatives of the peaks and valleys in the array passed to it.  If you prefer to use all the time, you could just do a ridge detection after each reading some or all few seconds so that you make a lot of unnecessary calculations.

  • How to distinguish the samples from 6 different inputs analog

    Hello everyone, I'm still new to NOR-DAQmx. I write a C++ program that reads 6 analog inputs of the card PCI-6220.

    Basically, I created 6 virtual channels in a single task, looks like I'm acquisition of required inputs.

    However, the problem is that I don't know which sample comes from what analog input channel. I put the fill mode "DAQmx_Val_GroupByChannel".

    Please help me, how can I distinguish between samples of different analog inputs.

    Best regards from Kazakhstan,

    Khassan

    Khassan,

    Channel order would be decided in the order in which you added your channels to the task.  So let's say I create a task and adds three channels and add them in the order ai0 ai1 and ai2.  If I set the fill to "DAQmx_Val_GroupByChannel" mode, DAQmxRead will copy data in "readArray' such that ai0 data all together, followed by the data of ai1, which is followed by the data of ai2.  The size of each of these sections of the buffer must be returned through the 'sampsPerChanRead' argument to read.  So if were to call read and DAQmx returned 5 for "sampsPerChanRead", then my data buffer would look like this:

    AI0, ai0, ai0, ai0, ai0, ai1, ai1, ai1, ai1, ai1, ai2, ai2, ai2, ai2, ai2

    Hope that helps,

    Dan

  • Helps with 7852R input analog voltage measurement

    Hello

    I'm trying to measure three signals of tension off a QPD, the three signals are connected to the IA the SCB - 68 and then I used the example of vi to acquire analog inputs with FPGA R in the finder of the example. However, I make a range of very large numbers. I don't know how to convert these volts or what are these numbers, units... etc.

    Any help with this, please?

    Thank you

    Hi Biochemist_MU

    Please take a look at the forum post FPGA of analog input and output scale.  It deals with the scaling of the R-series cards.

    Hope this helps and let us know if you have any other questions.

  • How to use 1-channel analog input for start/stop aquire sample second channel input analog?

    I have a little problem. I've just been programming in labview for 2 weeks.

    I'm trying to figure out how to use my channel of analog input on the USB-6009 case for start/stop (reference trigger and start) presented to the second analog input channel samples.

    I need the first analog input string to operate continuously and control sampling on the second.  When the second channel will start sampling program brings a new graph each time and saves it (I have all this that figure out).

    How can I configure the trigger so the lance program presented in for the second channel when the 1 channel reached above 2V (e.g.) and stop when it falls below 2V.

    I use a pressure force sensor on the first channel that gives me straight (up to) 5 V when it is pressed and nothing when it is not...

    Thank you.

    Grand... Thanks for the information!

    But can't I then make a 1 channel instead and wait until that meat of the max element value?

  • Input analog FPGA and scale of output

    Hello world

    I'm looking at the code of the analog and exit entry in the example file. Why the signal at the analogue output is first divided by 10 and multiplied by 32768 and the signal at the entrance is first divided by 32768 and then multiplied by 10. Are there specific reasons for it? This is due to the internal structure of 7831R I use?

    shuishen1983,

    Who is scaling to HAVE it / AO on map R series FPGA. With these FPGA cards actually face GOT it / AO on a level of material such as you are reading/writing the actual values of the ADC. I mean, it's that your HAVE is 16-bit resolution over a +/-10V range. To get the voltage in your program, you will need to convert the readings of the ADC in significant values.

    2 ^ 16 = 65536 (16-bit resolution = 65536 values, represents this 65536 - 10 v to 10 v)

    Example entry:

    Input to the FPGA card voltage is 5V, which will appear as 49152 on the ADC. To get significant value, follow the calculation below.

    49152 (reading the raw ADC) - 32768 (account for negative numbers) = 16384 (I think the subtraction of 32768 is done in your FPGA to account for negative numbers, that the code is not attached, so I'm not sure)

    16384 (value at the level of the ADC) / 32768 (input range) * 10 = 5V

    Example of output:

    You want to generate - 5V

    -5 / 10 * = 16384 32768

    -16384 + 32768 = 16384 (once again, i belive this negative conversion of the addition of 32768 is made directly in your FPGA code)

    16384/65536 =.25

    .25 * (10 - (-10)) = - 5 v (located between-10 v to 10 v, then convert it to a "full range" of the 20V)

    I would like to know if this helps or not!

  • input analog trigger on the door of the meter to measure the frequency of generation

    Hello

    I want to measure a frequency on the analog input, but it doesn't seem to work.

    I'm trying to work with DAQmx with the use of the ansi c standard.

    The first step, I've done was acquiring information on the analog input. With the use of a simulated device, it shows a sine wave on the entry.

    My next step is to generate a trigger for the meter signal, but this doesn't seem to work.

    I don't see how it is possible to connect the trigger on the entrance to the analog meter.

    For the creation of the analog input and relaxation, I use the following code:

    DAQmxErrChk (DAQmxCreateTask("",&taskHandle));
    DAQmxErrChk (DAQmxCreateAIVoltageChan(taskHandle,"Dev1/ai0","",DAQmx_Val_Cfg_Default,-3.0,3.0,DAQmx_Val_Volts,NULL));
    DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandle,"",10000.0,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,1000));

    DAQmxErrChk (DAQmxCfgAnlgEdgeStartTrig (taskHandle, "Dev1/ai0 ', DAQmx_Val_RisingSlope, 0 '"));

    For the creation of the meter, I use the following code:

    DAQmxErrChk (DAQmxCreateCIFreqChan (taskHandle1, "Dev1/ctr1", "", 1 January 2000, DAQmx_Val_Hz, DAQmx_Val_Rising, DAQmx_Val_LowFreq1Ctr, 1, 4, "");)

    I hope someone could give me a hint.

    I also tried the examples that come with DAQmx but well I know this are only examples to counter with the help of the digital inputs.

    Thanks in advance.

    Hello

    You must use the exit event of comparison at the entrance of the meter. Change this property after the configuration string function.

    DAQmxSetChanAttribute (taskHandle1, "", DAQmx_CI_Freq_Term, Dev1/AnalogComparisonEvent);

    Kind regards

    Bottom

  • Input analog does not

    Recently, I was unable to read an analog signal. I use a TBX-68 block attached to a card PCI-MIO-16XE-50.  The signal will be max to everything I put the maximum voltage reading when I hang anything to her.  It will read zero volts with noise when the wires are not connected to anything and it will read somewhere around 6 + / 2 volts when two wires are connected to each other, far away from the 0 volt I expect.  I tried to replace the Board with another PCI-MIO-16XE-50 without success.  I connected the wires to the different analog inputs too.  I know that its reading of the entries that I hung up because it will react to what I do only for the entries that I've specified (is it is connected to AI 1 and I connect a battery to 2, playback is not affected).  Digital and analog outputs are working properly.

    Recently I am gone in DAQ Express changed some things for me to specify my front channels, but it does not work when I create a new too.  Could I have definitely changed the DAQ Express?  He was working before I messed up with this stuff, but it can also work after.  I don't me remember the last time it worked however when I opened first the front of an Express DAQ.

    I have attached a VI just that I expect to read the voltage input (even with nothing plugged, it's the reading-10 volts).

    Hey, pagoda.

    Looks like you may be in differential configuration and cannot be biasing the input rows. Differential configuration, the two lines of entry of a channel must receive ground somehow bias; It may be through enormous resistance, but something to attach the tension to keep them from floating away. Connect the + and - lines together is not enough, because that does not provide a path to Earth.

    Try to connect both + and - directly to the analog ground and see if you read a quiet 0 V. If it works, then connect the inputs to everything you want to measure. As long as both + and - has a way of DC grounded, however diverted, everything should work fine.

    Normally, if your source is floating, you'll want to link the - entry to your device and the mass also directly to analog. If your source is connected, you should not connect - ground, since it is probably already connected.

    Hope this helps,

    EBL

  • From the start I get message "Auto Detect (input analog)

    I have a HP Pavillion T560A connected to a Dell monitor.  When I turn on the PC I get a message: auto detect (analog input). In energy saving mode.  Press the computer's power button or any key on the keyboard or move the mouse.  When I do that nothing happens.  How can I start up?  Jim cordially

    It has not been used for four months but was only servcied a week pprior to that and worked well.  The fan turns on and the hard drive seems to be working.  I tried to presisng the F8 key as I turn on but to no avail

    Sorry but no.  I took it for an exoert which he cleaned up and said it was contacts simply dirty - works perfectly now

  • input analog/sync problem

    Hi all

    I use USB - 6363 CVI 2013 with patches and trying to solve this problem for days. But just does not know what the problem is.

    Basically I have a finite periods display analog sine wave (which works fine), then I would like to receive (or other stuff) to an analog pathway for the objective test.

    The thing is that I can't get anything this either port HAVE, straight zeros in this table. I tried to put some DAQmxCfgAnlgEdgeStartTrig on the port of AI0 but still no result. and right now

    I don't have the ability to test if APFI0 method will work or not. So now I'm on an internal trigger.

    Here's what I did to get so far, no error. But all I see on the result of the sinearrayfin table is zeros. sinearrayf matches the entry and tested to have the data in it.

    sinearrayf = (float64 *) malloc (800 * arraysize4 * sizeof (float64));
    for (int f = 0; f)<>
    {
    sinearrayf [f] = sinearray (float64) [f];
    }
    sinearrayfin = (float64 *) malloc (800 * arraysize4 * sizeof (float64));
    for (int f = 0; f)<>
    {
    sinearrayfin [f] = 0;
    }

    error int = 0;
    char errBuff [2048] = {'\0'};
    trigName char [256];
    Written Int32 = 0;

     DAQmxErrChk (DAQmxCreateTask("",&AItaskHandle));
    DAQmxErrChk (DAQmxCreateAIVoltageChan(AItaskHandle,"/Dev1/ai0","",DAQmx_Val_Cfg_Default,-10.0,10.0,DAQmx_Val_Volts,NULL));
    DAQmxErrChk (DAQmxCfgSampClkTiming(AItaskHandle,"",800000.0,DAQmx_Val_Rising,DAQmx_Val_ContSamps,800*arraysize4));
    DAQmxErrChk (GetTerminalNameWithDevPrefix(AItaskHandle,"ai/StartTrigger",trigName));

    DAQmxErrChk (DAQmxCreateTask("",&AOtaskHandle));
    DAQmxErrChk (DAQmxCreateAOVoltageChan(AOtaskHandle,"Dev1/ao0","",-10.0,10.0,DAQmx_Val_Volts,NULL));
    DAQmxErrChk (DAQmxCfgSampClkTiming(AOtaskHandle,"",800000.0,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,800*arraysize4));
    DAQmxErrChk (DAQmxCfgDigEdgeStartTrig (AOtaskHandle, trigName, DAQmx_Val_Rising));

    DAQmxErrChk (DAQmxWriteAnalogF64 (AOtaskHandle, 800 * arraysize4, 0, 10.0, DAQmx_Val_GroupByChannel,sinearrayf, & writing, NULL));
    DAQmxErrChk (DAQmxRegisterDoneEvent(AOtaskHandle,0,DoneCallback,));

    DAQmxErrChk (DAQmxRegisterEveryNSamplesEvent (AItaskHandle, DAQmx_Val_Acquired_Into_Buffer, 10000, 0, EveryNCallback, NULL));

    /*********************************************/
    Starting code DAQmx
    /*********************************************/

    DAQmxErrChk (DAQmxStartTask (AOtaskHandle));
    DAQmxErrChk (DAQmxStartTask (AItaskHandle));
          
    Error:
    If (DAQmxFailed (error))
    DAQmxGetExtendedErrorInfo (errBuff, 2048);
    If (AItaskHandle! = 0) {}
    /*********************************************/
    Stop DAQmx code
    /*********************************************/
    DAQmxStopTask (AItaskHandle);
    DAQmxClearTask (AItaskHandle);
            
    }
    If (AOtaskHandle! = 0) {}
    /*********************************************/
    Stop DAQmx code
    /*********************************************/
    DAQmxStopTask (AOtaskHandle);
    DAQmxClearTask (AOtaskHandle);
            
    }
        
        
    If (DAQmxFailed (error))
    printf ("error DAQmx: %s\n",errBuff); ")

    .......

    Int32 CVICALLBACK EveryNCallback(TaskHandle taskHandle, int32 everyNsamplesEventType, uInt32 nSamples, void *callbackData)
    {
    Int32 error = 0;
    char errBuff [2048] = {'\0'};
    public static int totalAI = 0;
    readAI of Int32;

    DAQmxErrChk (DAQmxReadAnalogF64 (AItaskHandle,-1, 10.0, DAQmx_Val_GroupByChannel,sinearrayfin, 800 * arraysize4 & readAI, NULL));

    fflush (stdout);

    return 0;
    }

    What I see from a quick look at the code that you understood, looks that you stop tasks without giving a sample of 10,000 time to accumulate in the buffer.  This section of code here: does the following:

        /*********************************************/
    Starting code DAQmx

    /*********************************************/
    DAQmxErrChk (DAQmxStartTask (AOtaskHandle)); Start the task of AO
    DAQmxErrChk (DAQmxStartTask (AItaskHandle)); Start the task of HAVE

    There is no waiting or anything here which would be
    stop the section error to be executed immediately
    Error:
    If (DAQmxFailed (error)) / / there is no error if this section does not
    DAQmxGetExtendedErrorInfo (errBuff, 2048);
    If (AItaskHandle! = 0) {/ / there is a task of so HAVE this section not}
    /*********************************************/
    Stop DAQmx code
    /*********************************************/
    DAQmxStopTask (AItaskHandle); Task of is stopped and deleted
    DAQmxClearTask (AItaskHandle);

    }
    If (AOtaskHandle! = 0) {/ / there is a task AO so this section runs as well}
    /*********************************************/
    Stop DAQmx code
    /*********************************************/
    DAQmxStopTask (AOtaskHandle); Task of the AO is arrested and cleared
    DAQmxClearTask (AOtaskHandle);

    } / / The two tasks are arrested and cleared samples before
    are allowed to accumulate in the buffer and call
    the callback to perform playback DAQmx.

    If you look at the example of ' ContAck - IntClk.c ", he has a GetChar(); function between startup tasks and the block of the error.  This actually awaits as you press a button before stopping and compensation tasks.

Maybe you are looking for