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

Similar Messages

  • How to read data from analog input and export it to a file using Components Works

    I've made a simple application (Delphi 5 using the activeX) that read data from analog input channel 0. After I read the data, I want to export it to a file using the Components Works on a 6035E NIDAQ. (I'm not using labview and don't want to use it)
    How can I do that???
    Regards,
    Francis

    Here's a sample code to do this...
    P.S.: If you read only one channel this code won't work.
    function MyFunction: Integer;
    var
    Low, High, i, j, ChannelCount, RowCount: Integer;
    Po: P;
    begin
    //you are reading multiple channel
    ChannelCount := VarArrayHighBound(Buffer, 1);
    RowCount := VarArrayHighBound(Buffer, 2);
    for i := 0 to ChannelCount do begin
    for j := 0 to RowCount do begin
    WriteToDisk(Buffer[i, j]));
    end;
    end;
    end;

  • How to get signal from analog input and send it to analog output (real-time​)

    Hi everyone,
    I am doing simple task in Visual C++ and I am using PCI-6221(37 pin).
    Basically, I want to send same signal from 'analog input' to 'analog output'
    at the same time (almost), to make it real-time application.
    Can someone please provide me sample program. 
    I would appreciate if you could provide me with the good tutorial which explains
    step by step everything about programing NI-DAQmx for C/C++.
    Best Regards,
    Khassan
    Solved!
    Go to Solution.

    This is my code in C++, you can optimize it if it looks too messy. This code reads signal from analog input and outputs it through analog output. 
    To make this code work additional  include directories and library directories must be added from NI.
    I hope it helps someone.
    #include <stdio.h>
    #include <conio.h>
    #include "NIDAQmx.h"
    #include <math.h>
    #define DAQmxErrChk(functionCall) { if( DAQmxFailed(error=(functionCall)) ) { goto Error; } }
    int main(int argc, char *argv[])
    int32 error=0;
    TaskHandle taskHandleRead=0,taskHandleWrite=0;
    int32 read=0;
    float64 dataRead[1000];
    char errBuffRead[2048]={'\0'};
    char errBuffWrite[2048]={'\0'};
    bool32 done=0;
    int32 written;
    DAQmxErrChk (DAQmxCreateTask("",&taskHandleRead));
    DAQmxErrChk (DAQmxCreateAIVoltageChan(taskHandleRead,"Dev1/ai0​","",DAQmx_Val_Cfg_Default,-10.0,10.0,DAQmx_Val_Vo​lts,NULL));
    DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandleRead,"",100.0,DAQ​mx_Val_Rising,DAQmx_Val_ContSamps,0));
    DAQmxErrChk (DAQmxCreateTask("",&taskHandleWrite));
    DAQmxErrChk (DAQmxCreateAOVoltageChan(taskHandleWrite,"Dev1/ao​0","",-10.0,10.0,DAQmx_Val_Volts,NULL));
    DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandleWrite,"ai/SampleC​lock",100.0,DAQmx_Val_Rising,DAQmx_Val_ContSamps,1​000));
    DAQmxErrChk (DAQmxStartTask(taskHandleRead));
    DAQmxErrChk (DAQmxStartTask(taskHandleWrite));
    while( !done && !_kbhit() )
    DAQmxErrChk (DAQmxReadAnalogF64(taskHandleRead,1,10,DAQmx_Val_​GroupByScanNumber,dataRead,1000,&read,NULL));
    DAQmxErrChk (DAQmxWriteAnalogF64(taskHandleWrite,read,0,10.0,D​AQmx_Val_GroupByChannel,dataRead,&written,NULL));
    _getch();
    Error:
    if( DAQmxFailed(error) )
    DAQmxGetExtendedErrorInfo(errBuffRead,2048);
    DAQmxGetExtendedErrorInfo(errBuffWrite,2048);
    if( taskHandleRead!=0 )
    DAQmxStopTask(taskHandleRead);
    DAQmxClearTask(taskHandleRead);
    if( taskHandleWrite!=0 )
    DAQmxStopTask(taskHandleWrite);
    DAQmxClearTask(taskHandleWrite);
    if( DAQmxFailed(error) ){
    printf("DAQmx Error: %s\n",errBuffRead);
    printf("DAQmx Error: %s\n",errBuffWrite);
    printf("End of program, press Enter key to quit\n");
    getchar();
    return 0;

  • How to link an analog input to a controller implemented in PC(Labview) then feedback to the external system?

    Atten : Jeff or anyone =)
    I had discretized my controller onto labview. And would like to feed the analog input from external into the PC(that the controller is implemented in). I do hv a DAQ card. The problem is I do not know how to link the analog input -> ADC -> controller -> DAC -> system. And i really believe labview hv functions to do it. But really confuse how should i do it. Could anyone pls advise me. Thanks

    Darren,
    You have answered my question. I was wondering whether you were doing single point (non-buffered) analog input, or multipoint (buffered) acquisition. Seems you are doing the latter.
    I'll offer answers to both, however, and I'll start with single point. If you have a single point of data that you'd like to output on a DAC, use the Functions->Data Acquisition->Analog Output->AO Update Channel. You can wire your data right into this VI, and it will update the channel.
    If you have an array of data that you'd like to send out on the DAC, you can use the Functions->Data Acquisition->Analog Output->AO Generate Waveform. This VI is similar to the former, but you tell it the DAC you want to update, the update rate (samples per sec
    ond), and the array of samples you want it to update with.
    In LV5.X, the input is an array of samples; in LV6i, it's an array of waveforms. Therefore, you'll have to change your array to a waveform. Do this by selecting the Functions->Waveform->Build Waveform VI. Stretch the output down, and another input will show up (dt). Wire your array to the squiggly line input. Wire a 0 to the t0, and 1/scan rate into dt. Then wire this output to the AO Generate Waveform VI.
    Hope this helps.
    Mark

  • Acquiring a waveform from the input channel

    Hi, while I am trying to acquire teh waveform from the input channel,
    it is not showing up in Labview "waveform graph", but the same
    waveform is seen on the oscilloscope. I am using NI PCI 6052-E DAQ
    board.

    Greetings Amu,
    How have you configured the PCI-6025E? Is it configured for
    differential readings or single-ended readings?
    By default, the configuration of the device will be differential,
    which means that two input channels are used for every input signal.
    When configured in differential mode, you need to connect the positive
    terminal of the signal to channel X and the negative terminal of the
    signal to channel X+8. For reading a differential signal from channel
    0, you will connect the positive terminal of the signal to channel 0
    (pin 68) and the negative terminal of the signal to channel 8 (pin
    34).
    I would suggest to use the Measurement and Automation Explorer (MAX)
    software to test the signal before going to LabVIEW. Open MAX and go
    to the devices and i
    nterfaces folder. The PCI-6052E should be located
    in this folder. Right-click on the PCI-6052E and select test panels
    and you will be able to test the input signal here. You can change
    the mode to continuous and set an sampling rate in the test panels as
    well.
    Once you can view the signal in the test panel of MAX then I would
    suggest to move to LabVIEW. Search for the shipping example entitled
    'Cont Acq&Chart (buffered) VI' which is a continuous analog input
    example. Select the device number, channel number, and scan rate and
    run the VI.
    For more information on connecting your signals to the PCI-6052E I
    would suggest to refer to chapter 4 of the user manual. I've linked
    it below for your reference.
    NI 6052E User Manual
    http://digital.ni.com/manuals.nsf/webAdvsearch/552436964E347DAF86256BDE00670E9B?OpenDocument&vid=niwc&node=132100_US
    I hope this helps.
    Let me know if you have any additional questions regarding this issue.
    Regards,
    Todd D.
    NI Applications Engineer

  • Writing more than 16 analog input channels into a single file

    In DasyLAb 10.0, how can I WRITE more than 16 analog input channels (using WRITE DATA block) in one single file? I do not want to use 2 WRITE blocks, as I want all my data samples in one single file.

    Another few questions:
    In the merge block, what is the difference between Blockwise mode and Sample mode?
    Also, now that I am using the Merge blocks (2 inputs to 1 output) to combine my analog inputs; how would I have to modify my WRITE block so that I can ultimately obtain both my inputs to be written in the same file in seperate columns. Could you please explain the settings I need to make on the WRITE block.
    Thanks!

  • [newbie] Video import from analog input

    Hi all,
    Is there some device where we can import at higher resolution from analog input?
    http://www.elgato.com/video/video-capture
    Video Capture | elgato.com
    Info: Video resolution: 640×480 (4:3) or 640×360 (16:9)
    Video format Mac Software: H.264 at 1.4 MBit/sec or MPEG-4 at 2.4 MBit/se
    and this is old firewire and s-video.... what about usb 3.0?
    http://www.grassvalley.com/products/advc110

    What higher resolution analogue format are you referring to?
    Russ

  • How to Read from Standard Input?

    Hi,
    I am new to Java. Been reading the tutorial, but still unable to find How to read from standard Input.
    Can anyone help? Thanks.
    Here is my simple & error code:
    public class test
    public static void main(String[] args)
    char filename[];
    int i=0;
    System.out.print("Type in a filename to read: ");
    while ( System.in(filename) != -1 )
    i++;
    System.out.print(filename);
    RP

    import java.io.*;
    public class forum{
         public static void main(String args[]) throws IOException
    InputStreamReader is = new InputStreamReader(System.in);
    BufferedReader br = new BufferedReader(is);
    String input = "";
    do
    try
    System.out.println("Enter command: ");
    input = br.readLine();
    catch ( IOException io ) {}
    } while (!input.equals("exit"));
    [code\]
    package to import is java.io.*;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Connector block 16 analog input channel for 6036E

    sugesst me connector block of 16 analog input channels compatible with 6036E daq card

    Thanks for contacting National Instruments.
    You really have two choices in connector blocks: the SCB-68 and the CB-68LP. The CB-68LP is inexpensive, but unshielded. If you are concerned about introducing noise into your signal, or if you are talking small measurements (mV range), then the shielded option, the SCB-68, will be better for you.
    Regards,
    Mike G.
    National Instruments Support

  • How to acquire from various AI channels simultaneously with a different range for each one?

    How to acquire from various AI channels simultaneously with a different range for each one?
    In LabView I have found some examples but in C there isn't seem to be any.
    Solved!
    Go to Solution.

    Or you can add channels one by one with individual instructions: the follwing code compile and runs with no errors on a vitual daq device:
    err = DAQmxCreateTask ("", &taskH);
    err = DAQmxCreateAIVoltageChan (taskH, "Dev1/ai0", "AI0", DAQmx_Val_Cfg_Default, -5.0, 5.0, DAQmx_Val_Volts, "");
    err = DAQmxCreateAIVoltageChan (taskH, "Dev1/ai1", "AI1", DAQmx_Val_Cfg_Default, -10.0, 10.0, DAQmx_Val_Volts, "");
    DAQmxStartTask (taskH);
    err = DAQmxReadAnalogF64 (taskH, 5, 10.0, DAQmx_Val_GroupByChannel, val, 10, &read, 0);
    DAQmxClearTask (taskH);
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • Multiple Analog input channels affecting each other (DAQ_mx)

    Hi, I use NI BNC-2110 / PCIe-6363 + Labview 2012 for my DAQ.
    In out task, we acquire two analog samples(these two samples are timed by on board clock, 1000000 rate) from each analog input (AI_0 and AI_4) whenever DAQ receives a digital trigger from PFI0 (rising edge and retriggerable). We will receive 200 triggers and our program will finish until we receive 400 samples on each channel.
    The interesting thing is that different analog inputs seem to affect each other. As shown in the figure below, the white curve is analog input AI_0 and the red curve is analog input AI_4.  AI_0 is connected to a triangle input and the curve
    below seems right. AI_4 is actually shorted (some result if open) but the acquired data is affected by AI_0.
    However, this problem does not occur when only one channel is used in vi (Only the "create channel" and the "read" vi's are changed to be multiple sample and we repeat the experiment with everything else unchanged). So I believe it is not an actual voltage problem before the BNC-2110 board receives the analog input.
    Any idea about how to solve this? Thanks in advance! Happy new Year.
    Yang
    Attachments:
    Two Analog Inputs.vi ‏23 KB

    I used a wire to connect the BNC core and BNC shell on AI_4 when I shorted it(it is set on floating source mode).
    The effect happens even if I have some other kind of input in AI_4(the input is like a stair case but it is always modulated by AI_1). AI_4 always appears modulated by AI_0.
    Actually it will not bother me at all if this only happens when AI_0 is open.
    I guess the sample clock (1000000) is too high to cause this(Yep, probably it is Ghosting...). When this rate is 1000, it does not happen as I have just tried.

  • Labviewcode wanted to count pulses from analog input

    Can somebody help me with the following problem?
    I don't have a Data Aquisition board so I use my steppermotor controller, the MID-7604, and it's analog input to read from a
    sensor (photointerrupter) which outputs 0 or +5 Volts. I want to count how many times an output of 5 Volts appears.
    The problem is that the signal is not a Waveform, so  the Daq functions in Labview won't work. I've tried to generate a waveform
    from the signal but also no results.
    What I have created now is a counter which counts every signal above an adjusted value. The problem is that it counts on and on
    when the signal is above the value, I want it to count one time. (like a trigger which detect a low to high level signal)
    In the attachment you see that program and an other I've found (event counter) doing what I want, but I haven't been able to transform it in to
    my own problem. Please help me on this because I'm stuck right now.
    Thanks in advance
    Message Edited by Trabuca on 07-04-2005 02:56 AM
    Attachments:
    monitor ain pulses with display.vi ‏31 KB
    Event_Counter.vi ‏39 KB

    Hi,
    there are some ways - one is using a shift-register.
    Attached is a flank detector - each time "Boolean" changes from 0 to 1 or 1 to 0 the count is increased by one.
    I hope that helps
    Greez
    Stefan
    Message Edited by mycroft on 07-05-2005 06:41 AM
    Message Edited by mycroft on 07-05-2005 06:41 AM
    Attachments:
    Change detector_LV.GIF ‏9 KB

  • How to set audio hardware input channels for narration & to what?

    Searched forum - hope I didn't miss solution for the following:
    Using PE3 in Windows XPSP3
    Tried for the first time to add narration to a project. Was using a stereo/microphone headset. Got nothing but noise. Could record in Windows recorder and Audacity. However, the microphone as part of the set would not work in Windows Audio Hardware Test Wizard. The set was using a sound chip on the motherboard.
    A friend of mine has the same OS, motherboard and is using PE3. He too had never tried adding narration - but tried with a USP connected set, and was successful.
    I removed my stereo set, and connected a USB set. To make sure all settings were reset, I did a cold reboot. The USB set worked in Windows Audio Test Wizard. I opened my project again, and in Edit/Preferences/Audio Hardware, clicked AIIO Settings. Unchecked the old set (Realtek) in both the Output and Input Ports area, checked the USB Audio Device, moved to the top of both lists.
    Then tried to add narration and got the error message "Your current audio hardware selection does not have any input channels. Please use Preferences>Audio Hardware to correct this problem.
    Thinking that maybe this was a preset for the project and couldn't be changed, I started a new project, no video, just tried to add narration, and got the same message.
    The entries in the columns in the ASIO Direct Sound for Full Duplex Setup menu for the USB Audio Device in the Input section are: 2048, 0, 1, 16, Yes
    The only one of these that seems to be able to be adjusted is the second number - the Offset (Samples). The Audio Channels number is set to 1 and doesn't seem to be changeable. Suggestions?

    When working with Audio in most NLE's, i.e. Premiere Elements, or Pro, there are basically three areas that can affect how the Audio is handled on one's system. First, there is the Sound settings in Windows (from Control Panel). Next, the Audio card/chip probably/possibly has a console to make settings at the card/chip level. Last, and these are really two locations, but I'm only counting them as one since they are both in the NLE - Edit>Preferences>Audio & Audio Hardware. This is where Steve is referring to. Check all settings, and I'd suggest doing so in the order that I listed them above: OS, Audio card, then Premiere. A Mute, or by-pass in the first two, can override the settings in Premiere, and you may have its setting correct, but still not be able to effectively use your hardware.
    The exact settings chosen will depend on the exact hardware that is properly installed. Without knowing all of your hardware and other settings elsewhere, one cannot give you a definitive answer. Ideally, in the settings drop-downs, you *should* see your hardware listed. Look closely, as these can be a bit cryptic.
    If you are still unable to get your hardware working properly, a fourth place to look would be Control Panel>System>Hardware>Device Manager for your Audio hardware. Check that Device Manager sees your hardware, and that it is working properly.
    If all is set up properly, but still not working, report back with exact specs on your system, including all of your Audio hardware. There are possibly some more steps that can be taken. I will not mention them now, as they *should not* be needed. If you do need further assistance, please list every option in all of the drop-down lists from Premiere, so we can know what your choices are.
    Good luck,
    Hunt

  • How to read 2 analog inputs with VISA

    Hello everyone! I want to read two analog inputs using VISA serial communication from the arduino.  I'm currently able to read one of the input but how do I read two analog inputs on labview?

    Hi lamela,
    again I have to ask: HOW does the string look like? Is it so hard to provide an exact example of your received string???
    I think the string is showing one value from the two inputs
    Are you sure or are you guessing? How can we tell what you might "think" when you aren't able to provide examples?
    You wrote you send values from the Arduino using the command "println(value1, value2)", but now you "think" you only receive ""value1" in LabVIEW?
    Get your data communications clear! (And learn to provide meaningful examples!)
    Edit after your edit:
    my code to serial print two inputs: Serial.println(Voltage, Current);
    Even if I print separately: Serial.println(Voltage);
                                                 Serial.println(Current);
    The first command is completely different then the second part! In the first you should receive two values in one line, in the 2nd one you receive one value per line: You need to adapt your string parsing to these strings!
    Again: send both values in one line. Use the LF as termchar. Separate the values by some separator char like comma. Check the received string for validity. Use some error checking in your VI.

  • How to combine the analog input and analog output vi's

    Hi !
    I have a perfectly running triggered analog input acquisition vi. I have a seperate vi for analog output that's running perfectly too. Can someone tell me how to combine these two operations so that I could get a vi that does simulataneous AI and AO without missing triggers. I have tried all the different kinds of configurations suggested by NI support but nothing seems to work. Can someone help ?
    thanks,
    Shiva
    Attachments:
    dac_good.vi ‏77 KB
    adc_good_fw.vi ‏124 KB

    Shiva;
    I'm attaching a good Application Notes that shows how to synchronize multiple DAQ tasks, in Labview.
    Hope this helps.
    Filipe
    Attachments:
    Advanced_Sync_Techniques_for_DAQ.zip ‏166 KB

Maybe you are looking for