Determine analog input task trigger status

I am writing a basic analog input function, which will be triggered via a start trigger sent by another instrument. Is there a way to programmatically deteremine if the Analog Input task has been triggered? I would like to have a Boolean indicator that shows "True" after the Analog Input task is triggered, but I couldn't find out how. Does anyone have a suggestion? Thanks!

Is this a continuous acquisition?
I am not aware of a function querying the trigger state of a task. Nevertheless, i don't think this is necessary as you usually start reading right after starting the input task.
So in case a trigger is late, you will/should run in a time out error. Otherwise, you will get some data which is a clear indication that the task is running....
Norbert
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.

Similar Messages

  • Two analog input tasks

    Hi,
    I have a VI with two analog input tasks. One outputs a waveform, from which I determine the frequency of that waveform. Another one just samples the signal once, because all I need is to one value from the signal.
    Is there any way to synchronize these tasks? Right now I perform one task then the other because from what I know, you cannot perform two analog input tasks at the same time.
    I've attached a VI. Thanks for the help.
    Attachments:
    Master_v2.vi ‏98 KB

    duplicate post. Try to to keep the same question in one thread. What is wrong with adding all of you channels to the single task as recomended?

  • Analog input generating trigger on the counter gate to measure frequency

    Hello,
    I want to measure a frequency on the analog input but it doesn't seem to work.
    I'm trying to get it working using DAQmx with the use of ansi c.
    The
    first step I made was acquiring the information on the analog input.
    With the use of a simulated device this shows a sine wave on the input.
    My next step was to generate a trigger signal for the counter, but this doesn't seem to work.
    I don't see how it is possible to connect the trigger on the analog input to the counter.
    For the creation of the analog input and trigger 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 counter I am using the following code:   
    DAQmxErrChk(DAQmxCreateCIFreqChan(taskHandle1,"Dev1/ctr1",
    "",1,2000,DAQmx_Val_Hz ,DAQmx_Val_Rising ,DAQmx_Val_LowFreq1Ctr ,1,4,"");
    I hope some one could give me a hint.
    I have also tried the examples that come with DAQmx but far as I know this are only counter examples using digital inputs.
    Thanks in advance.
    Solved!
    Go to Solution.

    Hi,
    You have to use the comparison event output to the counter input. Change this property after the configure channel function.
    DAQmxSetChanAttribute (taskHandle1, "", DAQmx_CI_Freq_Term, Dev1/AnalogComparisonEvent);
    Regards,
    Bas

  • NI DAQmx Digital Output Trigger To Start Analog Input Task

    Hi everyone.  I am using the NI DAQmx VIs to set a digital output line low (boolean '0').  I want to begin reading an Analog Input voltage (Start Analog Input Voltage reading task) right after the digital output line is set low.  I am using the DAQmx Start Trigger (Digital Edge).vi to try and do this.  I have the digital edge to trigger off a falling edge since the digital output line is being set low.  I am using "do/SampleClock" as the source into the DAQmx Start Trigger (Digital Edge).vi.  
    I don't have the DAQ card (PXI 6229) since someone else is using it but I wanted to write up the SW so that when it becomes available I can have SW to try out.
    I have attached the VI.  Am I setting up this VI correctly?
    Thanks!
    Attachments:
    Trigger AI Task Off DO Edge.vi ‏32 KB

    I think you are going to have to wire that Digital Output to a PFI line on the card with the Analog Input(s).  You then trigger on that PFI line.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How to use counter output pulses to trigger analog input?

    Hello all,
    I hope the kind people using this forum can help me, a lowly beginner LV programmer! I have been attempting to create a VI that produces a user defined number of TTL pulses, separated by every n seconds. Each TTL would be outputted to a stimulator, which in turn generates its own TTL. Using the stimulator-generated TTL, I would like to trigger finite analog data acquisition (e.g. for every TTL, trigger the collection of a data sweep that contains 4000 samples (collected at 4000 Hz), with 1000 samples collected pre-trigger. I would like to also be able to see each data sweep as it is triggered on a chart. As I understand things (lots of online/book/forum reading), I should be using the counter output to generate my TTL pulses, and syncing each counter produced TTL with analog input, as well as using a reference trigger. Also, the AI part should be started first, so that I don' t miss any counter outputs. If it matters, I also need to use one of the AI channels to acquire the TTL, so I can see my stimulator-induced responses to the stimulator in time.
    I am able to generate the TTL pulses from the counter output, but I am having a problem with the AI part. I am unsure how to sync the counter output with AI. Also, since I need to acquire pre-trigger samples, I would be needing to acquire samples continuously, but when I set 'continuous samples' on daqmx timing, the VI doesn't work (hence why's its set to 'finite samples').
     I hope someone out there can help, as I have been at this for what seems ages, with limited success. I am using a USB-6259 and LabView v8.2. Thanks!
    Attachments:
    RC001 v_1.vi ‏49 KB

    Hello,
    Due to the fact that analog tasks themselves are not retriggerable, a
    pulse train produced by a counter is always used as the sample clock
    for the analog input task in order to recreate a retriggerable effect
    for analog input. This can be done by creating a finite pulse train set
    to retriggerable using the DAQmx Trigger Property Node, or the pulse
    train could be continuous and just be gated by another signal. Neither
    of these methods can be properly applied in hardware to create a
    retriggerable reference trigger. You can however implement something
    similar in software by just stopping and restarting your reference
    triggered analog input task within a loop. There will be some delay
    between when the task is stopped and restarted, as these events require
    software intervention, but if there is enough time between when each
    trigger signal is generated, there should not be any noticeable delay
    or missed samples.
    I have attached an example of this!
    Mark B
    ===If this fixes your problem, mark as solution!===
    Attachments:
    RC001 v_1mod.vi ‏25 KB

  • Please help with C code to synchronize counter output to analog input

    Hi All,
    I am using NI DAQ USB-6353 with text-based C code to control it. I would like to send a continuous pulse train from the DAQ to pulse a power supply, which then activates an electron beam producing current to be read by the analog input port of the same DAQ. I would like to keep only the analog samples during the pulse peak and samples of a couple pulse widths right after. I am successfully to generate a pulse train using the sampled clock from a counter output channel, but fail to use the same clock to synchronize the pulse train with the analog input. DAQmxReadAnalogF64 is not called by the static function EveryNCallback set for the analog input task. Am I doing something wrong with the following codes? It would be great if it turns out only I am using the wrong sampled clock name of the counter ("dev1/PFI8") for the analog input. Or is something more fundamental that a counter cannot be sync. with an analog input?
    Would someone be able to send me a link to an example in C or C++ or visual basic showing how to synchronize a buffered sample clocked digital pulse train from a counter output channel to an analog input? To simplify the post, the below codes do not include the static functions EveryNCallback and DoneCallBack, but I can send them if needed.
    Many thanks in advance for your help,
    Thuc Bui
    //setting operation parameters
    double initDelay = 0.0, freq = 10;
    double dutyCycle = 0.0001;           //thus pulse width is 10 microsec
    unsigned highTicks = 4;   //per period
    unsigned numSamplesPerPeriod = highTicks / dutyCycle;   //40000 samples/period
    unsigned lowTicks = numSamplesPerPeriod - highTicks;      //per period
    unsigned sampleRate = 2*numSamplesPerPeriod*freq;       //800000 samples/s
    //create counter
    TaskHandle counterTask;
    int errCode = DAQmxCreateTask("", & counterTask);
    errCode = DAQmxCreateCOPulseChanFreq(counterTask, "dev1/ctr0", "",
                                     DAQmx_Val_Hz, DAQmx_Val_Low,
                                     initDelay, freq, dutyCycle);
    errCode = DAQmxCfgSampClkTiming(counterTask, "dev1/PFI8", sampleRate, DAQmx_Val_Rising,
                               DAQmx_Val_ContSamp, numSamplesPerPeriod);
    //create analog input
    TaskHandle aiTask;
    double minVolt = 0.0, maxVolt = 1.0;
    errCode = DAQmxCreateAIVoltageChan(aiTask, "dev1/ai0", "", DAQmx_Val_Diff,
                                     minVolt, maxVolt, DAQmx_Val_Volts, "");
    unsigned bufferSize = 10* numSamplesPerPeriod;
    errCode = DAQmxSetBufInputBufSize(aiTask, bufferSize);
    errCode = DAQmxCfgSampClkTiming(aiTask, "dev1/PFI8", sampleRate, DAQmx_Val_Rising, DAQmx_Val_ContSamp, numSamplesPerPeriod);
    errCode = DAQmxRegisterEveryNSamplesEvent(aiTask, DAQmx_Val_Acquired_Into_Buffer,
                                            numSamplesPerPeriod, 0, EveryNCallback, 0);
    errCode = DAQmxRegisterDoneEvent(aiTask, 0, DoneCallBack, 0)
    //start aiTask first
    errCode = DAQmxStartTask(aiTask);
    //then counterTask
    errCode = DAQmxStartTask(counterTask);

    Hi Xavier,
    Thank you very much for getting back to me. I really appreciate it. I followed your advice with the option 2 and simplified my code by using one of the NI C example templates to generate the below codes (also attached). I was able to see the pulses generated with an oscilloscope, and on the same oscilloscope I could see the ouput pulses of the electron beam probe. Unfortunately, the below code via DAQmxReadAnalogF64 reports of no data read from the probe and finally times out. Below is the error message given by this function. I did check the connection of the analog input wires to make sure they were connected to pin 1 (A0+) and 2 (A0-) because I was using the terminal configuration DAQmx_Val_Diff. Do you see any obvious errors I have made in my codes?
    Thanks a lot for your help,
    Thuc Bui
    Task started, waiting for trigger...
    Acquired 0 analog samples DAQmx Error: Some or all of the samples requested have not yet been acquired.
    To wait for the samples to become available use a longer read timeout or read later in your program. To make the samples available sooner, increase the sample rate. If your task uses a start trigger,  make sure that your start trigger is configured correctly. It is also possible that you configured the task for external timing, and no clock was supplied. If this is the case, supply an external clock.
    Property: DAQmx_Read_RelativeTo
    Corresponding Value: DAQmx_Val_CurrReadPos
    Property: DAQmx_Read_Offset
    Corresponding Value: 0
    Task Name: _unnamedTask<1>
    Status Code: -200284
    End of program, press Enter key to quit
    ********************** C Code **************************************************
    #include <stdio.h>
    #include "NIDAQmx.h"
    #include <math.h>
    #define DAQmxErrChk(functionCall) { if( DAQmxFailed(error=(functionCall)) ) { goto Error; } }
    int main(void) {  
    int32 error = 0;  
    char errBuff[2048]={'\0'};
    TaskHandle  taskHandleDig=0;  
    TaskHandle taskHandleAna=0;    
    double  timeout=10;  
    double minVol = -1.0, maxVol = 1.0;
    double initDelay = 0.0;  
    double freq = 10.0;  
    double pulseWidth = 1.0e-5; //10us  
    double dutyCycle = pulseWidth * freq;
    unsigned hiTicks = 4;  
    double sampleRate = hiTicks/pulseWidth; //samples/s  
    unsigned lowTicks = ceil(sampleRate/freq) - hiTicks;  
    unsigned nSpPeriod = hiTicks + lowTicks;
    unsigned numPulses = 1;  
    unsigned nSpCh = numPulses*nSpPeriod;    
    double sampleRate2 = ceil(2.0*sampleRate);  
    unsigned sampleMode = DAQmx_Val_FiniteSamps;
     /*********************************************/  /*/ DAQmx Configure Code  /*********************************************/  
    DAQmxErrChk(DAQmxCreateTask("", &taskHandleDig));  DAQmxErrChk(DAQmxCreateTask("", &taskHandleAna));    
    DAQmxErrChk(DAQmxCreateAIVoltageChan(taskHandleAna, "Dev2/ai0", "", DAQmx_Val_Diff, minVol, maxVol, DAQmx_Val_Volts, ""));  
    DAQmxErrChk(DAQmxCfgSampClkTiming(taskHandleAna, "/Dev2/Ctr0InternalOutput", sampleRate2, DAQmx_Val_Rising, sampleMode, nSpCh));
    DAQmxErrChk(DAQmxCreateCOPulseChanFreq(taskHandleDig, "Dev2/ctr0", "", DAQmx_Val_Hz, DAQmx_Val_Low, initDelay, freq, dutyCycle));  
    DAQmxErrChk(DAQmxCfgSampClkTiming(taskHandleDig, "/Dev2/PFI12", sampleRate2, DAQmx_Val_Rising, sampleMode, nSpCh));    
    unsigned bufferSize = nSpCh;  
    DAQmxErrChk(DAQmxSetBufInputBufSize(taskHandleAna, bufferSize));  
    DAQmxErrChk(DAQmxSetBufOutputBufSize(taskHandleDig, bufferSize));
    /*********************************************/  /*/ DAQmx Write Code  /*********************************************/  
    DAQmxErrChk(DAQmxWriteCtrTicksScalar(taskHandleDig, 0, timeout, hiTicks, lowTicks, NULL));
    /*********************************************/  /*/ DAQmx Start Code  /*********************************************/  
    DAQmxErrChk(DAQmxStartTask(taskHandleAna));  DAQmxErrChk(DAQmxStartTask(taskHandleDig));
    printf("Task started, waiting for trigger...\n");
    /*********************************************/  /*/ DAQmx Read Code  /*********************************************/  
    double* dataAna = new double[nSpCh];  
    int32 numReadAna = 0;  
    int errCode = DAQmxReadAnalogF64(taskHandleAna, -1, timeout, DAQmx_Val_GroupByChannel, dataAna, nSpCh, &numReadAna, NULL);  
    printf("Acquired %d analog samples\n",numReadAna);  
    if (numReadAna) {   
        unsigned nPts = (numReadAna < hiTicks)? numReadAna : hiTicks;  
        for (unsigned n = 0; n < nPts; ++n) {    
             printf("%6.3f ", dataAna[n]);   
        printf("\n");  
    delete [] dataAna;
    DAQmxErrChk(errCode);
    Error:  
    if( DAQmxFailed(error) )   DAQmxGetExtendedErrorInfo(errBuff,2048);  
    if( taskHandleDig!=0 && taskHandleAna!=0 ) {   
    /*********************************************/   /*/ DAQmx Stop Code   /*********************************************/   
        DAQmxStopTask(taskHandleDig);   
        DAQmxClearTask(taskHandleDig);   
        DAQmxStopTask(taskHandleAna);   
        DAQmxClearTask(taskHandleAna);  
    if( DAQmxFailed(error) )   printf("DAQmx Error: %s\n",errBuff);  
    printf("End of program, press Enter key to quit\n");  
    getchar();  
    return 0;
    Attachments:
    Correlated DIO AI_Sample_Clock Dig Start.c ‏6 KB

  • 2 analog input and 1 digital

    hi,
    i attach the vi..
    in the following vi i have a problem with the analogs..
    when i'm running the vi.. At the results.. olly one of the analog will show me the measuerements..
    at the one time maybe the clock analog will give me the results..
    and the other analog nothing.. and opposites..
    why they don't work together? and and the 2 analog give measurements at the same time..
    andrikos
    Attachments:
    2_analog_and_digital_inputs.vi ‏190 KB

    Hello Andrikoscy,
    For most multi-function DAQ boards what you're trying to do is not possible.  If you want each analog input to run on a different sample clock then you'll need to look into a NI R Series Intelligent Data Acquisition Device.  These DAQ boards have a built in FPGA and allow for more customization than M Series boards, including independent sample clocks.
    To address your questions:
    1.  On a non-intelligent DAQ board all analog input channels must share the same sample clock--if you need two different rates I would suggest sampling both channels at the faster of the two frequencies and then just ignore some of the data points on the slower channel.
    2.  In order to find out the exact time between samples from an external trigger (instead of the constant dt inserted by the waveform acquisition), you will need to take a period or frequency measurement of your signal using a counter on your card.  By taking a buffered period measurement you will get an array of the times between samples and with that you can graph your samples on a precise x-axis.  Normal analog input tasks that use an external clock do not associate any exact timing information with when a trigger was received.
    I hope this helps, and if you'd like more information on the R Series Intelligent Data Acquisition Devices please feel free to contact National Instruments directly at www.ni.com/contact.
    Have a great day!
    Brooks

  • Time measurement between counter output my device and analog input

    Hello!
    I'm trying to measure the time to generate a digital pulse train on the counter output, that goes to a frequency converter that controls a motor.  So I think it'd be the best way to wire the output of the frequency converter with an analogue input and make a timestamp before I generate the pulse and a timestamp when I recognize the singal, but I think that wouldn't be a serious measurement ?
    What's the best way to measure the time?
    kind regards peter

    hi there
    well, there a several ways to do this. the problem with the software - timestamps is the minimal resolution of 1ms. i'd suggest:
    - wire a copy of the digital pulse train to an analog input channel
    - wire a copy of the frequency converter to another analog input channel
    - create an analog input task with the two channels (the sampling rate defines the timing resolution,make sure to acquire enough samples to see the response signal) 
    - start this task
    - send the digital pulse train
    to optimize your acquisition you can use another copy of the digital pulse train as a start trigger for your analog acquisition.
    -> then you'll see the digital pulse train on one of the analog channels and the frequency output on the other one. both channels have the same time axis with a resolution defined by your sampling rate (~us depending on your hardware). then you can analyze the data.
    search the example finder for examples of how to create tasks and triggers.
    Best regards
    chris
    CL(A)Dly bending G-Force with LabVIEW
    famous last words: "oh my god, it is full of stars!"

  • Analog comparison/start trigger

    Is it possible to use the analog comparison (typ under start trigger) with a continous task that I want to start immediately?  I want to take samples from the get go, but then generate the analogcomparisonevent pulse when the values leave an analog window.  The way it seems so far is that it will only work if I use that as the start trigger, but then I don't recieve samples until that trigger is reached.
    Any help is appreciated.

    Hi again Michael,
    Here's what I'd do in your case:
    1.  Set up the analog input task to be continuous.
    2.  Set up the quadrature position encoder to be hardware timed as well, but use the AI Sample Clock for the clock source.  This way, you will still have one counter left and your AI and CI tasks will be synchronized.
    3.  Set up a "dummy" Counter Output task to generate a single pulse that will be retriggerable.  You should be able to use the analog trigger from the AI channel or you can route the signal externally to the APFI line and use that to do the triggering.  You can use either the analog comparison event or the pulse generated on the Ctr1InternalOutput terminal as you are generating a retriggerable pulse anyway.  Either one should work.
    Let me know if you have questions about this.
    Regards,
    John Bongaarts
    AE Specialist - Test Products

  • How do I acquire multiple signals in the NI cDAQ 9172 using 2 analog input modules?

    Hi everyone,
    Is anyone familiar with using the NI cDAQ 9172?  This is my first time using it and I am not sure what exactly I am doing wrong... Alone with a NI 9233 analog input module, it works great.  I can grab my 4 signals from each channel and go.  However, when I add another analog input module to the mix, it gets an error.  It looks like it is reading only one and not the other.  It bombs at one of the DAQ start task and read task.
    Basically, the block diagram is just a double of the one 9233 working alone.  Is there something needed for input to make the 9172 working?  Any ideas?
    Any help is much appreciated.  Thanks!!

    Hi Jud,
    Both threads are correct.  The cDAQ-9172 has a single analog input timing engine, so both of your analog input modules will need to be in a single task.  The other VI you referenced shows one analog input task (with channels added from two modules) as well as an analog output task.  Analog output has a separate timing engine from analog input, so both of those can run in parallel independent tasks.
    The beginning of this thread is a good example; a single DAQmx Create Task followed by a DAQmx Create Virtual Channel for channels from each module.  Also, Getting Started with NI-DAQmx will give you the fundamentals for data acquisition, though I don't know how many of their examples use CompactDAQ.
    Regards,
    Kyle

  • Synchroniz​ing two counter frequency inputs with multiple analog inputs

    Hello all,
    I'm fairly new to LabVIEW and I'm trying to collec​t data from multiple sources with synchronized tim​ing on the acquisition but I'm having trouble figu​ring it out. My problem is that I've got two count​er frequency inputs, one optical tachometer readin​g one pulse per revolution, and a max machinery fl​ow meter with a k factor of 12000. I can't seem to​ figure out how to sync the timing with my multiple analog inputs. I've be​en attempting to get the tachometer  to sync with ​the analog inputs first by following the example l​inked here. (https://decibel.ni.com/content/docs/DOC-10785) So far each time I run it I either get a timeout e​rror on the DAQmx read or a "Multiple sample clock​ pulses were detected" error (see attached image).  It seems if I slow the sampling rate way down to ​say 10 hz and ensure that the tachometer signal is​ over 800-1000 RPM (13-17 Hz) before starting the VI then the program will run without errors until ​the RPM drops below that threshold then the "Multi​ple sample clock pulses" error occurs.  The code is attached below.
    Does anyone know of a more effective way of syncin​g counter frequency inputs with analog inputs?  I'd like to have a VI that can show 0 RPM (and ev​entually 0 flow as well, but I think I need to fig​ure out the timing of one counter before I add ano​ther as it seems I can't have two counters in the ​same task). Any help on this would be greatly appr​eciated.
    LabVIEW version 13.0
    cDAQ-9178 Chassis with NI 9401 for the two counter inputs and NI 9205 for the analog inputs.
    Thanks!
    Richard
    Solved!
    Go to Solution.
    Attachments:
    SimpleDAQ.vi ‏44 KB
    LV_Error.JPG ‏31 KB

    Maybe third times the charm? 
    So I've finally got a good handle on why the VI is having problems at low RPM though I'm somewhat embarassed how long it took me to do that
    Because I have the counter time synced to my Analog input task if it doesn't see at least two pulses between the two clock pulses set by the analog input task I get the -201314 "Multiple sample clock pulses" error. This seems fine at first as it just sets a minimum RPM that I can measure and it's well below the area I'm interested in so no problems there.  I tried a simple error handler that would clear the error when it happend assuming the loop would keep iterating until the RPM went above that minimum at which point I would get a signal again. This is not the case, the read function just continues to spit out the -201314 error even after the RPM is back in the readable range. So then I tried adding two case structures so that when the error occured it would stop the task, clear the error, and then start the task again on the next loop iteration (Code Attached). This also doesn't work as the error shows up again on the stop task and then AGAIN on the start task on the next loop iteration. It seems this error is not actually being cleared and once it happens it stays with the task regardless of what the error cluster is carrying. 
    Anyone have any ideas?  The only solution I can think of is to just clear all tasks and recreate them each loop iteration until the RPM is readable again but that strikes me as a horribly clunky solution.
    Richard 
    Attachments:
    SimpleDAQ_1_Start Stop.vi ‏48 KB

  • Error when starting an analog read task with DAQmx 8.5 while 8.0 works

    I am programing a measurement application with Borland C++ Builder 6.
    Problem: Every time when I try to start an analog input task with the DAQmxStartTask() command of DAQmx 8.5 the program execution is interrupted and the error message "Invalid floating point operation" is given out. This problem does not occur with DAQmx 8.0 !

    Hello Johannes,
    the error occurs every time, when I try to start an analog voltage input task either with a simulated or a real device (PXI-4472). Changing any of the measurement parameters did not have any effect. I also tried one of the C-source code examples, which came with the original NI-documentation of the DAQmx 8.5 driver, resulting also in the same error.
    However, starting a counter task with a simulated PXI-6601 device worked without any problems !
    Do you have any ideas ?
    Regards,
    Thomas

  • Synchronizing analog input and output

    I am in the middle of converting some Traditional NI-DAQ code to the
    DAQmx API (I am using C++).  Most of it is going quite well: my
    code complexity has been greatly reduced and (since upgrading to 7.4)
    my CPU usage has plummeted.  However, in one particular case I
    need my input and output buffers to be synchronized.  I.e. sample
    0 of my input buffer should be read at the same instant sample 0 of my
    output buffer went out on the line.  In Traditional NI-DAQ, I
    synchronized my input and output start triggers using the following
    method (which I believe I found in an example somewhere):
    error = Select_Signal(addr, ND_PFI_6, ND_OUT_START_TRIGGER, ND_LOW_TO_HIGH);
    error = Select_Signal(addr, ND_IN_START_TRIGGER, ND_PFI_6, ND_LOW_TO_HIGH);
    This then allowed me to setup my input thread, then initialize
    everything in my output thread and when my output got the start
    command, so did my input.  The result was that I could perfectly
    match buffers of output data to buffers of input data (after taking all
    the appropriate buffering into account).
    When I try the same method with the DAQmxConnectTerms function, my
    buffers don't line up.  They are off by 15-20 ms out of a 400ms
    buffer (sampling at 10kHz).  I tried cutting out the middle man of
    PFI6 with similar results.  So my current "synchronize" block
    looks like this:
    error = m_fnConnectTerms("/Dev1/ao/StartTrigger", "/Dev1/ai/StartTrigger", 0);
    I get no error.  This also seems to cause my output loop to hang
    after a few seconds, although that could be a side effect of something
    else that I haven't tracked down yet.  Is there a better way to do
    what I'm trying to do here?  Perhaps it is a misunderstanding of
    the way buffering works on the M series cards (I am currently using a
    6221).

    Don't use Connect Terminals. Use the technique shown in this example program
    C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Synchronization\Multi-Function\ContAI-Read Dig Chan
    which is the sharing of sample clocks via the DAQmxCfqSampClkTiming function where the sample clock source of one task is set to the clock of the other task.  This example slaves a digital input task to an analog input task but the idea is the same for your application.

  • PXI-6230 analog input trigger setup

    Hi,
    Can anyone point me in the right direction of how to configure the PXI-6230 card to implement 3 of the analog input channels as a digital input trigger? The input to each channel is TTL pulses. I want to have a trigger event on every pulse from any of the three inputs. I'm using LabVIEW 8.5. Any help is appreciated. Thanks.

    Hey HarveryL,
    I'm not sure it is possible to do this. Can you give me some more details on your application, and why you want to use the analog inputs as a digital trigger? Here is an article on how to use PXI triggers with the analog input and output, perhaps you can adapt that code to your purposes. I'll continue to look into this for you, but any more information you can provide would be appreciated. Have a great week! 
    John B.
    Embedded Networks R&D
    National Instruments
    Certified LabVIEW Developer

  • How to trigger from analog input channel

    I am using a BNC-2110 into a 6062E card. And I am sure this question has been posted several times but I was unable to find a clear answer. I am trying to use the devices ai0 channel as my trigger source. I tried using a voltage source in the trigger reference, and that almost works but it only works for several loops before coming up with an error. If someone knows what I may be possiblely doing wrong or where to find this information, any assistance would be great.
    - there is always an easy way, but it is always the hardest to find

    Hey Henry,
    The BNC-2110 is just the connector block. What card do you have the is interfacing this block with your computer? (should be a PCI or PCI-express card). Are the GPS receivers outputting digital signals that conform to TTL compatible logic levels (are the signals 5V or 0V with no more than 1.6mA of current)? If they are outputting a digital signal, then you can send these signals into any of the PFI lines to act as a trigger (or to the trigger lines). 
    For example, if you would like to perform an analog acquisition each time the trigger hits and have an X series card, you can open up example finder (help»find examples...) and then open Hardware Input and Output»DAQmx»Analog Measurements»Voltage»Cont Acq&Graph Voltage-Int Clk-Retriggerable.vi. Then make sure your Trigger Source parameter is set to the same PFI line that you are sending your GPS signal to (on the BNC-2110, the trigger connections are really just PFI0 and PFI12, but these are common lines to use for triggers, but any PFI line will work). If you have an M series card, and cannot do retriggerable analog input, you can reference this example for how to use counters to workaround this limitation of our M series cards: https://decibel.ni.com/content/docs/DOC-6801
    If your GPS signal isn't digital, and is some arbitrary analog square wave, you can use an example like this: https://decibel.ni.com/content/docs/DOC-4657 to use the analog value to trigger you're reading (you just need to set the appropriate window for your analog signal in the VI).  I hope this helps!
    -Nathan H
    Software Developer
    National Instruments

Maybe you are looking for

  • IOS 7.1 Battery Life Fix

    I updated my iPhone 4S to iOS 7.1 and after a couple of weeks decided that the battery was draining faster than it used to.  Not some of the super fast 50% in an hour kind of drain, but I was not getting a full day out of it. I did everything I could

  • How to save the value from JTextFormattedField using TAB key in lostFocus

    Can you, please help me with this problem: I want to have saved new value in JTextFormattedField after I use TAB kye. I tried with focusLost, then setting setFocusTraversalKeys etc. It looks simple, but !? Thanks

  • Where to put the Fan

    I think my MBP is running fine, but I have normally run a small fan around my PCs just to stir the air. In looking at my MBP I see the big opening at the back under the display. I have a small desk fan that I would like to use, just don't know the be

  • Archiving and document viewers

    I'd will like to display my archived workitem and do no use any third party archiving system but SAP could you tell me how to use SAP AS interface to display archived document and workitem ?

  • I am using outlook and got EXC_BAD_ACCESS

    I am using outlook and everytime I tried to open it teh following message is displayed Error Signature: Exception: EXC_BAD_ACCESS Date/Time: 2013-05-20 23:49:03 +0000 Application Name: Microsoft Outlook Application Bundle ID: com.microsoft.Outlook Ap