Use analog input as sample clock

Hi,
    I have a PCI 6115 DAQ card. I currently perform an
analog acquisition on ai0, with an external clock on PFI7. But
sometimes, my clock signal is not high enough and the acquisition does
not occur. At some NI show, I heard a trick to solve this problem :
plug the clock on analog input (say ai1), the clock signal gets
amplified by the card internal amplifiers, and then route this
amplified signal to the sampling clock. This seems to be a wonderfull
solution, but I cannot find out to actually redirect the amplified ao1
to the sampling clock. Does someone know how to do it ?
Thanks a lot,
Jérôme Lodewyck

I tested the attached example on a simulated device so hopefully it will work on a real one without any kinks.  You didn't specify your programming environment, so I'm assuming you're using LabVIEW.  If not, hopefully you can translate to the appropriate ADE based on the picture of the block diagram. 
In the example, I'm using an AO task to program the analog trigger as specified.  This has two consequences.  First, you won't be able to perform hardware timed AO while the AI acquisition is running.  If this isn't acceptable, you'll need to try the second approach described in the next paragraph.  Second, you'll have to wire the signal to PFI0 instead of an AI channel.  With this configuration, the signal will be seen with a +/- 10V range and referenced to AI Gnd.  Since the trigger DAC is an 8 bit comparator circuit for this board, you'll have ~80 mV of resolution.  You didn't mention what the amplitude or DC offset (if any) of your signal is, but hopefully this resolution will suffice.  You can use the level and hysteresis properties for the analog trigger to filter out noise in the analog signal or account for DC offset. 
If the constraints listed above aren't to your liking, you can try to use a second AI channel as a trigger channel.  This has some advantages and disadvantages.  The disadvantages are that this requires you to use a trigger with your AI task and it also requires you to acquire another channel of data.  You mentioned the trigger wasn't a problem so this can probably be taken care of with simple analog start trigger.  The data can easily be thrown away, but depending on your sampling rates, it might require a lot of extra bus bandwidth or processing power when scaling the data.  On the positive side, it doesn't require you to use up your AO channels needlessly and you can apply gain to the input signal in order to effectively increase the resolution of the trigger circuit.  You can also apply a low pass filter and different terminal configuration if desired.  The gain, coupling, terminal configuration, filtering, and coupling applied to the signal is controlled by the values used in the Create Channel VI and the Channel Property node.  To create an example that does this, simply start with one of the shipping examples for an Analog Start trigger, change the trigger source to one of the AI channels instead of a PFI or APFI pin, and change the clock source to the AnalogComparisonEvent as shown in the attached example. 
That should do it.  Good luck with your application and post back if you have additional troubles.
Attachments:
AI - External Clock Using Analog Trigger Circuit.vi ‏81 KB
AI - External Clock Using Analog Trigger Circuit.JPG ‏60 KB

Similar Messages

  • PXI-7831R analog input max sampling rate?

    I'm using 5 of the analog inputs on the 7831R and seem to only be able to get a max sampling rate of 10K per channel. Looking at the specs it should do at least 10 times this per channel, also the time for the A/D loop is 228 ticks of the 40MHz clock so this would suggest a higher sampling rate than just 10K. I'm missing something here... Any ideas as to what the deal is?
    pete

    Hi Pete,
    You are right in saying that the 7831R boards should acquire data much faster than 10KHz. Infact you can take a look at the actual specs from the data sheet http://sine.ni.com/nips/cds/view/p/lang/en/nid/14757 as well as the product manual. However, I am concerned that you may be measuring the rate of acquisition on the RT VI (or any host vi) you are running as opposed measuring it in the FPGA VI.
    Your time critical loop may be running at 228 ticks of the 40 MHz clock but the data is buffered (at that rate) and has to be then transferred to the communication loop which then sends the data to the host vi (which may be your RT vi). Hence, the rate at which host VI receives the data will be much slower than the FPGA VI is acquiring data.
    Hope this helps!
    Prashanth

  • Error -200072 using analog input with 3 PXI 6120 cards on realtime mx system

    I have just upgraded to the mx drivers for the 6120 S series boards.
    I am trying to sample 12 analog inputs at once with a pretrigger. (4 channels per board)
    The error message -200072 comes up.
    One board works fine, when I add the second board's channels the error occurs.
    Each board shows up as A,B,C respectively in MAX and in the Labview browse menu for selecting channels.
    Greg Morningstar
    Takata

    Probably the best way to do this would simply be to use the Route Signal VI to make it to where each of your boards looks at a particular line for the trigger. You can do the same thing for the clock so that they are all sampling at the same time.
    You will also want to make sure that your device is defined in MAX. Once you do that, everything should be pretty easy to implement. You might also want to look at some of the examples that show how to do RTSI. It's almost the same as you would do for a PXI system.
    Otis
    Training and Certification
    Product Support Engineer
    National Instruments

  • Newbie, Would like to use analog input and graph

    I was using the "Real Time Chart.vi" example in Labview 2011 and got it all set up using the random input it comes with. I have a USB-6008 that is set up and I can see the signal in MAX. The big question is how the heck do I get the vi to work with the analog input? If someone could modify the vi and add the AI0 as the input I would really appricate it!!
    Thanks
    Attachments:
    Soil Moisture.vi ‏15 KB

    trimixdiver1 wrote:
    Aside from me adding the gage and bar graph, its the same as the example. Ive added the AI (purple) channel but I guess I need to add some Daqmx stuff to allow it to connect to the strip chart.
    Wheres the analog in channel?  Is this something you haven't posted yet?  Make your changes, then post when you are ready.
    Reese, (former CLAD, future CLD)
    Some people call me the Space Cowboy!
    Some call me the gangster of love.
    Some people call me MoReese!
    ...I'm right here baby, right here, right here, right here at home

  • Is there and easy way for Position control using analog input?

    Hi Everyone,
    I would like to set one of the axis with stepper motor using analog feedback to keep the set position which is coming from the analog input.
    In other words I would like the stepper to move when the analog input changes. I need it as a "background service" so the rest of the motion could be easily controlled from the NI-Motion Assistant.
    Is there any easy way to do this? Even complicated is ok but the control should be done by the NI Motion card not the PC processor.
    Thanks,
    Andras

    Hello Andras,
    please use the link below to get the motion example.
    http://zone.ni.com/devzone/cda/epd/p/id/353
    Kind regards,
    Elmar

  • Measuring mV using analog input

    I am using an analog input of a Ni-DAQ 6025E card. I can measure a 5V signal. If it is 5V on the voltmeter, then it is 5V on the graph of amplitude Vs time. However a 0.5V signals comes as an oscilating signal of between o and 1.5V. Do I need to calibrate the graph? If so, how do I do that?

    Hi labview1958,
    I would recommend doing what LV_Pro recommended and try using the device in Measurement and Automation Explorer (Start > All Programs > National Instruments > Measurement and Automation Explorer). 
    First test the device there (by using a test panel) and see if you are
    getting the measurements that you are expecting. 
    I would also check out some of the related pages here to see if you can get some information that might help you better develop your system.
    The program that was posted will probably work, but it's not really the best way to do what you are trying to do. 
    If you have LabVIEW 7.0 or higher then you can use DAQmx which is much
    easier to use for new users.  I recommend that you simply use the
    DAQ Assistant Express VI to configure your system.  You can access
    that by going into your Block Diagram on a New VI, right click and go
    to Functions > Input > DAQ Assistant.  You can now
    quickly configure your measurements exactly as you like, test the way
    it functions and then use those signals in your application.
    Best of luck getting this together,
    Otis
    Training and Certification
    Product Support Engineer
    National Instruments

  • How to use analog Triggering and External clock scan

    Hi, there. I want to measure the engine cylinder pressure with an PXI6070-E card and BEI encoder. I have tried using Cont Acq&Graph ExtScanClk D-Trig.vi and Cont Acq&Graph ExtScanClk Soft A-Trig.vi , but they don't work. What I did was to connect a 50HZ pulse to PFI0 (analog triggering, I changed the code from digital triggering to analog triggering), and a 100K pulse to PFI7 (startscan), and an 50 HZ analog signal to ACH0. But the code always says: timeout. If I use internal clock, it works fine. Could you please give me some help? THANKS A LOT!

    Hey Wyuan,
    I tested the Cont Acq&Graph ExtScanClk Soft A-Trig.vi and it worked fine. However, the Cont Acq&Graph ExtScanClk D-Trig.vi has a small error in its logic that will prevent the data from ever being displayed to the graph. In order to run the examples you need to connect a trigger to pin 11 and a scan clock to pin 38. A 10kHz square wave would be fine for the clock signal and just a single pulse would work for the digital trigger.
    One additional think to keep in mind is the grounding. You might need to connect you ground from your signals to a DGND pin. I am including the two programs that I used for the test.
    I hope this helps,
    Joshua
    Attachments:
    Cont_Acq&Graph_ExtScanClk_D-Trig.vi ‏121 KB
    Cont_Acq&Graph_ExtScanClk_Soft_A-Trig.vi ‏153 KB

  • Encoder edge counter using analog input

    I have using an 9215A USB (4AI).
    2 AI are logging data in to a txt-file and the other 2AI will be used for counting the edges from a quadrature encoder (A and B pulse train).
    Every edge falling or rising I will write a line in the txt-file also show a egde counter in the VI (total edges read).
    I'm a beginner so I need some help to find out how to do.
    BR
    Johan

    the 9215A do 20kSam/s  , that not too much, so .... your encoder should change state 10k/s max.
    first approach: continious read  (with max speed) with two buffers, while one buffer is filled by the DAQ, analyse the data of the other. Three independend loops : first wait for and read buffer-> send data via queue to second analyse loop -> send data via second queue to third loop that does the file handling.
    second approach: create a trigger so the second loop can be avoided. The DAQmx/Hardware does  might not support the trigger on both edges on two channels, but additional hardware like LS7084 o. HCTL2022 can help you to create the trigger signal. These little bugs are designed for incremental encoders and create a pulse for every change in the A B lines
    Greetings from Germany
    Henrik
    LV since v3.1
    “ground” is a convenient fantasy
    '˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'

  • Feedback using analog input to control digital output

    Hi all,
    I've got a program that I intended to open and close two valves (and thus actuate two pneumatic cylinders) based on the readings from load cells mounted to each cylinder. The idea was that it would send a digital out to open the valve and extend a cylinder, then close the valve when the load reaches a pre-determined value (with frequency dictated by increasing or decreasing the inlet air pressure and thus the fill time of the cylinder). It would then do so for the other cylinder in a loop. The issue I have is that the response time of the loop actuating the valves was too slow-for a desired force of 1800 N I had to set the limit to 1100 Newtons. It was nice and consistent in this regard but then I started having instances where the valve would stay open long enough to apply a force of 3600+ N. The biggest need in this program is to maintain a consistent load and ensure that the max. load is not being exceeded. I've used local variables and a queue to pass the load values to the valve actuation loop but it did not seem to make a difference. I don't know if part of my problem is the mishmash of data types I'm using in passing the load cell values or if a notifier would be a better bet.
    Attached is my code (LV 8.2). Thanks in advance if anyone can offer some guidance.
    Attachments:
    Controlled_valves.vi ‏192 KB

    Here's a version in LV 8.0 and an image of the block diagram, for those running older versions of LabView.
    I'd greatly appreciate any help anyone might provide as I'm getting killed here. Thanks!
    Attachments:
    Controlled_valves.vi ‏207 KB
    Block diagram.JPG ‏177 KB

  • Can buffered digital edge detection only be performed using an external sample clock?

    I am working on an application where I need to measure the speed (rpm) of a motor as it starts up using the output of its built in hall effect sensor.  The sensor should output 2 pulses per revolution of the motor.  My plan is to count the pulses from when the counter (counter 1) is armed to when it is up to speed. Looking at the M series manual, the CVI (v8.5.1) help, and the examples it appears that this can only be done using an external sample clock.  Is there a way to route an internal sample clock to the appropriate terminal on the counter so that I do not need to add additional hardware?
    I am currently using a PCI-6289, but the final application will use a CDaq-9188 chassis (using one of the the built in 32-bit counters).
    Thank you for your assistance.

    Thank you for your input.
    However, I did forget to mention one detail of the application.  I need to buffer the edge counts so that I can graph the speed of the motor as it starts up.  I need to be able to acquire the edge counts at reqular intervals so that I can determine how fast the motor was rotating at each point.  So far I have not been able to find an example of doing this without and external sample clock.  As I mentioned, in the final application I will be using the 32-bit counters on a CDAQ-9188 chassis.  The only thing I can think of at this point is to generate a pulse out of the second counter and use that as the sample clock.  Will this work?

  • How to use both digital and analog input modules in the same worksheet - MCC USB1208LS

    Dear all,
    Hi, I am Imran. I am using MCC USB1208LS. I have created the worksheet using digital input module as below and able to execute (run).
    But when i add another analog input module in the same worksheet and executes, An error Message pops-up as in the below image
    I have connected temperature sensor sognal to the analog input of USB1208LS. When using analog input alone in the worksheet, it indiates the actual values. 
    is any black box solve? please guide me. I am attaching in images
    We already placed a purchase order for USB1208FS. Will it sort out my issues?.
    Thanking you,
    Imran Mohamed.
    Attachments:
    present worksheet digital input only.JPG ‏67 KB
    with analog input module.JPG ‏81 KB
    error menu.JPG ‏77 KB

    Hello Imran,
    the USB-1208LS is not capable of running concurrent operations such as an analog input scan and ANY digital Ins, Outs, counter reads, or analog outs.  In Dasylab, the 1208LS is scanning, and nothing else from that particular device can be requested of it while that is happening.
    Yes, using the 1208FS will resolve some of these issues.
    Please refer to the ULHELP.CHM file installed on your computer in c:\program files\measurement computing\daq for details on this issue, et al.
    also I recommend you send your MCC/DASYLab requests for support to [email protected] as MCC staff (that includes me) does not normally monitor NI's Developer Zone.

  • MyRIO analog input express Vi (n samples) missing file

    Dear Users, 
    I am trying to read analog data with an express VI in myRIO. This works with Analog input (1 sample), but fails with Analog input (n samples) due a missing file "myRIO v1.1 FPGA Throughput.lvbitx".
    I googled it and searched it on ni.com, but nobody seems to have the same isssue (I suppose because of the myRIO is quite new right now)
    Thank you!
    Solved!
    Go to Solution.

    I would try doing a repair of your installation.  It looks like something didn't get installed properly.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • 6251 AO sample clock

    Hello All,
    I am using a M6251 board for analog output. However, I have the problem that the board only allows discrete increments in the frequency of the Analog Output sample clock. The frequency step-size varies, depending on the sample-clock frequency, and reaches around 10kSa/s when the sample clock is running at 1MSa/s. Am I doing something really stupid, or is this a limitation of the board? The digital pulse-train generation does not seem to have this limitation. If this *is* a limitation of the board, is there some way of overcoming it? I have tried to re-route one of the counters into the AO sample clock, but, when I do so, I get an error message saying that resource is already in use.
    Any help will be greatly appreciated.

    There are two things that I can think of that could be causing the behavior that you're seeing. The first is that you are using the onboard Frequency Generator to generate the AO Sample Clock. If this is the case, you will notice that the Frequency Generator has limited capabilities in the frequencies it can generate. If this is the case, use the default AO Sample Clock as the clock for your AO application. M Series devices have a dedicated timing engine for AO applicatins, hence, no onboard subsystem (i.e. counters, PFI lines, etc.) will be used up if you use the AO Sample Clock default selection for timing your AO applications.
    The second guess that I have is that you are not specifying your AO application correctly in order to get the generated waveform frequency you're expecting. Their are several parameters that you need to set in order to get an expected frequency with AO - rate and samples per channel. Have a look at How Can I Calculate the Output Frequency of my Analog Output. This knowledgebase might currently be written with Traditional NI-DAQ terminology, but it should still help. Also, remember that even though you specify a certain update rate on your analog output, the actual update rate will be slightly different because of limited resolution of the divide down.
    Jared Aho

  • ELVIS Scope and Analog input triggering

    Hi everyone,
    I'm trying to read two waveforms, one from the analog input and one from the scope. These waveforms are coming from two sides of a voltage divider and should always be in phase. But I think that there might be a triggering problem. When I change the frequency of the input waveform, my measured waveforms go out of phase.I have programmed each express VI to trigger off of the SYNC.
    I can't use analog inputs for both measurements because the sampling rate is too small. I can't use the scope for both inputs because one of the waveforms is a differential measurement.
    Any help would be appreciated, thanks.

    Hi, I looked at the ELVIS Hardware User Manual and noticed that you have 12 channels that can be used as differential, Reference single ended or non reference single ended. Unless you have them all busy I don't see why you can't use the analog inputs. About the sampling rate, it will be determine by the M Series DAQ device that you are using and the source of the signal. It is a good practice to sample, at least, 10 times faster than the frequency of the input signal. The documentation of the card should show what the maximum sampling rate is.
    Now, Open the example called "Multi-Device Synch-Analog Input-Cont Acquisition.vi" at the NI Example Finder under Hardware Input and Output»DAQmx»Synchronization»Multi-Device. If you get the same results shown in the picture then you need to analyze if the voltage divider is affecting the phase.
    For more information about synchronization check the article called "Synchronization Explained".
    Good luck!
    Alejandro | Academic Program Engineer | National Instruments

  • Counter Output as Sample Clock of Digital Signals

    I have a situation where I need to use a hardware counter as sample clock of digital output signals.
    How do you specify the "Counter Internal Output" signal as a sample clock of digital output?
    I want to do something like this:
      // Create counter task
      CNiDAQmxTask m_Task(_T("ATask"));
      m_Task.COChannels.CreatePulseChannelTicks(_T("Dev1/ctr0"), "", _T("20MHzTimebase"), DAQmxCOPulseIdleStateLow, 0, 10, 10);
      m_Task.Triggers.StartTrigger.ConfigureDigitalEdgeTrigger("PFI0", DAQmxDigitalEdgeStartTriggerEdgeRising);
      // Create digital output task                     
      CNiDAQmxTask m_Task2(_T("ATask2"));
      m_Task2.DOChannels.CreateChannel("Dev1/port0/line0", "", DAQmxOneChannelForAllLines);
      m_Task2.Timing.ConfigureSampleClock("XXXXXX", 0, DAQmxSampleClockActiveEdgeRising, DAQmxSampleQuantityModeFiniteSamples, 400);
    How do I specificy "counter 0 Internal Output signal" instead of "XXXXXX" above, i.e. the sample clock of the digital output signal. Can't find the name of the signal anywhere in the documentation and help files. I have a 6259 DAQ board. 
    /pek

    Thank you for your answers, but I can't get it to work.
    When I use "ai/SampleClock" as sample clock everything works correct. When I try to use a counter as sample clock the task completes imediately, before any digital signals has been sent/measured. The task even completes before I have started the trigger, which is very confusing. No error appears.
    I think that something is wrong about how I setup the counter. I use the code below:
    // Create counter task
    CNiDAQmxTask m_Task(_T("ATask"));
    m_Task.COChannels.CreatePulseChannelTicks(_T("Dev1/ctr0"), "", _T("20MHzTimebase"), DAQmxCOPulseIdleStateLow, 0, 100, 100);
    m_Task.Triggers.StartTrigger.ConfigureDigitalEdgeTrigger("PFI0", DAQmxDigitalEdgeStartTriggerEdgeRising);
    // Create digital output task
    // The code below works with "ai/SampleClock" as sample clock
    CNiDAQmxTask m_Task3(_T("ATask3"));
    m_Task3.DOChannels.CreateChannel("Dev1/port0/line0", "", DAQmxOneChannelForAllLines);
    m_Task3.Timing.ConfigureSampleClock("Dev1/Ctr0InternalOutput" /*"ai/SampleClock"*/, 0, DAQmxSampleClockActiveEdgeRising, DAQmxSampleQuantityModeFiniteSamples, 400);
    // Create samples
    CNiUInt32Vector ui_data;
    for(int i = 0; i < 200; i++)
      for(unsigned int j = 0; j < 2; j++)
        ui_data.Append(j);
    // Create digital writer
    CNiDAQmxDigitalSingleChannelWriter m_writer3(m_Task3.Stream);
    m_writer3.WriteMultiSamplePortAsync(true, ui_data);
    // Wait until task completes
    m_Task3.WaitUntilDone(-1);

Maybe you are looking for

  • Image in Lightroom doesn't match exported image viewed in Photoshop

    After all my hard work in Lightroom, I export the image to a folder on my hard drive. When I open this exported image in Photoshop and view it alongside the Lightroom version of its "twin" in Lightroom, there is a significant difference. Why is this?

  • Cannot Read Error

    Hi, I am trying to compile some source files, but i keep getting this Read Error I do Runtime.getRuntime().exec(javac -classpath temp\\classes -d temp\\classes @temp\\files.txt where list.txt has files names like \src\packagename\file1.java \src\pack

  • How to jump Back and Forth?

    In C, we can use the "goto" keyword in combination with a label to jump back and forth to anywhere within a method. However, how do I implement this mechanism in Java?

  • Problem in launching firefox

    I have install Solaris 10 on a sparc machine and then installed firefox on it but when i launch firefox on that machine it give *'Gtk warning'*. Can anybody tell me the solution. thank you

  • You have not defined CO account assignment for an account that is relevant

    Hi All, While psoting the billing doc to accounting it is giving error as: You have not defined CO account assignment for an account that is relevant to cost accounting. Please let us know about error and which team and where we configure that?