DAQmx Timing

Dear all,
I have this following VI solution that stems from the LabVIEW example for Continuous Digital Data Output. The issue concerns the System Clock - when set to a low sampling rate value (say, 1S/s), the rate seems to be much higher. The LED indicator on my BNC2120 is dimmed throughout; indicating fast switching between the Low and High?
How shall I edit the enclosed VI to actually write one sample per second? I am using the PXI-6132 card.
Thanks in advance.
Solved!
Go to Solution.
Attachments:
Digital - Continuous Output.vi ‏58 KB

Ok, when you set the clock to use the 100kHz clock, you will be sampling at the 100kHz.  I am a little surpised that it won't let you use the onboard clock.  Maybe the DIO can only be clocked out with an external clock?
Some tweaks you should make here:
If using an external clock, the rate should be set to the maximum expected rate of that clock.  The data will be clocked out based on that clock though.
Since you are using Continuous mode, do not wire up the Samples Per Channel to the DAQmx Timing VI.  All you are doing is limiting your buffer size.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines

Similar Messages

  • DAQmx Timing (On Demand).vi

    Hi!
    I am doing a work that uses Cyclic Voltammetry technics. I am trying to use the example from this page "Measuring Cyclic Voltammetry for DAQmx" with a NI USB-6009 card and NI DAQmx drivers.
    The problem is that, when I try to run the file appears this error:
    Error -200077 occurred at Property Node DAQmx Timing (arg 1) in DAQmx Timing (Sample Clock).vi:2->cv_scan->cv.vi
    Possible reason(s):
    Requested value is not a supported value for this property.
    Property: SampTimingType
    You Have Requested: Sample Clock
    You Can Select: On Demand
    Task Name: _unnamedTask<2>
    I know that the USB-6009 only support the On Demmand but the problem is that this type of timming is not present for choose! How can I find it? I think I miss the file "DAQmx Timing (On Demand).vi", or something like that!
    Thank you for helping!

    Hello AlexandreFSilva,
        This is my first reply so bare with me.  I have used the USB-6009 and to aquire analog input  either create a global channel or task in MAX or create a Task or access a physical channel directly in Labview.  If you create a task for multi channel DAQ the timing should be set by defualt to ON Demand.  Once this is done just dropp a Task or Channel constant or control on your block diagram and an Ai Read function inside a loop.  The timing for the On Demand DAQ will be controlled by the WAIT value that you place inside the loop.  From what I get from your question it sounds like your creating everyting in Labview and using the Timing Function before you start your actual DAQ.  The Timing Function is not needed when using On Demand DAQ timing that is why it is not an option.  Block Diagram Flow listed below:
    Global Channel created in MAX:
        Channel Constant or Control  -->  Loop  --> AI Read  --> after loop  --> Stop Task  --> Clear Task
    Physical Channel Accessed in Labview:
        Physical Channel Constant or Control  --> Create Task/Channel  --> Start Task  --> Loop --> AI Read
                 --> after loop  --> Stop Task --> Clear Task
    The Stop and Clear Task are not needed for the Global Channel that you created in MAX and will not throw any errors if left out but is good code to implament.  The flow that I listed was pulled out of my head so forgive me if it is slightly off.  Simply stated though, you do not need to include the Task Timing Function in your code and if you remove it everything should work properly.  Don't forget a WAIT function in your loop, one sample will be read for every value of the WAIT statement.
    Goodluck and I hope I did not make things any more complicated or confusing.
    Steven.

  • DAQmx Timing (sample clock).vi

    do u know what is the critaria to use DAQmx Timing sample clock.vi... or in what situations this vi must b used?

    Hi Pritam,
    Thank you for posting on the National Instruments forums.
    The DAQmx Timing.VI is used when you need to perform an operation that requries sample timing whether it's Analog Input, Analog Output or Digital IO. 
    Here is a Developer Zone Article that explains how the Sample Timing VI can be used:  Learn 10 Functions in DAQmx and Handle 80% of Your Data Acquisition Applications.
    Hopefully this will tell you what you need to know.
    Thank You,
    Nick F.
    Applications Engineer

  • DAQmx Timing rate

    I am using the DAQmx Timing control in a VI that samples data from a PXI chasis. The sampling mode is set to Finite Samples. The help states that the rate input specifies the sampling rate in samples per channel per second. Increasing this number means more samples per second. It seems to me that increasing the samples per second should reduce the overal time of the process since it is performing more actions per second. However, increasing the rate decreases the loop time of my program. What am I missing here? Am I understanding this wrong, or just implementing this strangely?

    Hello,
    You are right that increasing the rate means more samples per second.
    It means the following: If you keep the finite number of samples to
    acquire fix, then increasing the rate should decrease your acquisition
    time. Suppose you are performing acquisition in a loop. If the
    acquisition time decreases, then the time for a loop iteration will
    decrease as well.
    For example, for an acquisition of 1Hz, if the number of samples to
    acquire (on the timing VI) is 1000, it means that you will acquire a
    total of 1000 Samples. Since the rate is 1Hz, it will take you 1000
    seconds to acquire all the samples. However, in a loop, you can use the
    DAQmx Read VI to read part of the total number of samples already
    available. So for example, if you specify 50 samples to read on the
    DAQmx VI, every time it is called, it will grab 50 samples from the
    buffer. If the samples are not available yet, it will wait until they
    are availble or there is timeout and return.  Now if you have a
    process in the loop that take more than 50 seconds to comple before you
    read again, then there will always be at least 50 samples in the buffer
    from the second iteration. From there on, if you increase the rate, it
    will just increase the number of samples availble to be read, but it
    will not necessary make the other process in the loop faster. So the
    DAQmx Read will always have the 50 samples it needs, but the other
    process will still take time. So in this case, changing the rate from
    1Hz to 100Hz will seem to have no effect on the entire process.
    The important thing is to understand what those numbers actually mean.
    -Sample per channel  in the timing VI represents the total number
    of samples to be acquired by the board on each channel of the task.
    -Rate represents the rate at which the samples above are acquired
    -Sample per channel in the DAQmxRead VI represents the number of
    samples you want  the VI to grab from the buffer. Those samples
    have already been acquired and stored on the computer.
    Hope this clears it all

  • In the DAQmx Timing VI, if the Cont. Sampling is on...?

    Hi!
    Can someone please explain to me what happens if:
    in the DAQmx Timing VI, when the continuous sampling is on.. but you are asing for samples per channel? This is found in the KnowledgeBase example:
    http://digital.ni.com/public.nsf/3efedde4322fef198​62567740067f3cc/3296ba2aef586b7386256d6d00528e3d?O​penDocument

    If I understand you question correctly what continous sampling means is that the program will continously make reads what samples per channel specifies the number of samples it will make per read and then put in the buffer. Quoted from the help file..
    "samples per channel specifies the number of samples to acquire or generate for each channel in the task if sample mode is Finite Samples. If sample mode is Continuous Samples, NI-DAQmx uses this value to determine the buffer size."
    Let me know if you need more explanation. Have a great day.
    Allan S.
    Applications Engineering
    National Instruments

  • Using Signal Express VI for DAQmx, timing & file size issues

    I am using a Signal Express VI with my DAQmx. Long story short, my DAQmx VI's don't work in LV 8.6 (possibly IT installation error). I have a few issues (I'm a beginner so be easy).
    First, I'm confused on how to get the timing correct. I am trying to read a 100 samples (2 channels) average them and repeat this at 30Hz and record this data.
    Second, everytime I open the Signal Express VI (in my block diagram) and change sampling for example, click OK, then save my VI before running my program. I noticed the file on disk increased in size by the megabytes! All I changed were the sampling settings.
    I appreciate any input, thanks in advance!
    -Michal
    Attachments:
    Philtec_09-22-09.vi ‏2589 KB

    To your first concern, it sounds like DAQmx was installed before LabVIEW.  Just reinstall DAQmx and it will work fine in LabVIEW.
    For you second concern.  To get 100 Samples at 30 Hz, you will need to change your channel setup in signal express.  You will need Continuous Aquisition, with 100 Samples to Read at 3000 Hz.  Then you code should work as expected.
    Chris Bakker
    National Instruments
    Applications Engineer
    Check out LabVIEW 2009 and the New X-series DAQ!

  • LV Example not working. DAQmx timing mode has no properties.

    Just gone through our 3 year computer change out and our IS department has replaced the computer used on our Sound and Vibration room.  When I load the above example, the timing property node that should write the sample clock rate simple has no properties available.  If I right click on it I get a message "No properties"  I assume that something has changed during the swap as it used to work fine.  We are using LV8.5.1.  Any help appreciated.  Thanks

    Did you reinstall DAQmx? Look for it on your Device Drivers CD/DVD. If you don't have it, you can download it from NI.

  • Daqmx timing source issue

    I have attached zip containing 2 folders. Both are doing same functionality but one using software timed 50ms loop. the other one is hardware based timing source.
    I run , quit & re-run the application. Both the applications works well. But the ISSUE folder containg application hardware timing sourced app, after quit, the EXE process keeps running in the background & needs to be stopped using Ctrl+Alt+Del invoking the task manager.
    As many times I click on to run the app, it works ok only, but holding the EXE process in background.
    Hope someone helps to resolve this. Im using LV2009 + PCI 6229.
    Thanks,
    Kousy
    Attachments:
    LV Exec Process Termination Issue.zip ‏1948 KB

    Hi,
    I found the solution to the problem: using the latest NI-DAQmx drivers v.8.0.
    It was directly related to my M-series card (PXI 6221) not correctly working in my PXI chassis due to apparently bad drivers or a bug in version 7.5.
    Christoph

  • Strange DAQmx Timing Source Timed Loop Error

    I have a digital edge counter fed into a timed loop. Everything works fine until I stop the loop, and stop the DAQ task. Once I restart the loop it fails with "resource is reserved". Attached is my code.
    Thanks
    Solved!
    Go to Solution.
    Attachments:
    daqloop.JPG ‏136 KB

    Here is a piece of code to illustrate the issue. If the timing source is created in the loop (it will be created each loop iteration) the error occurs. If it is moved outside the loop, and only created once the issue is resolved. Is there a way to RELEASE the timing source so that it can be created again? If the VI is stopped, this "resource" is released. I want to programatically release it.
    Note the error comes from the timed loop Error terminal that is Probed (50).
    Message Edited by bkb on 10-08-2008 09:52 AM
    Message Edited by bkb on 10-08-2008 09:53 AM
    Attachments:
    ts.jpg ‏57 KB

  • How do I use the onboard clock when using DAQmx timing?

    Hi,
    I'm using the example: Count Digital Events-Buffered-Finite-Ext Clock.
    I want to use the PCI-6602 onboard clock. When I leave the sample clock source unwired I get an error message :
                                                      ​                                                  ​                                                  ​        Error -200303 occurred at DAQmx Start Task.vi:1 
                                                      ​                                                  ​                                                  ​        Possible reason(s):
                                                      ​                                                  ​                                                  ​        External sample clock source must be specified for this application.
    Can someone tell me what I'm doing wrong?

    Counters do not have an internal onboard clock like the AI and AO subsystems do.  So you have to generate the sample clock for your edge counting task yourself.  This is often done with the other counter by generating a continuous pulse train.
    I hope this helps!
    gus....

  • Why can't I modify the property of a DAQmx timing node?

    I have right click the property and click "select property> browse>search property> more:reference clock:source". But the property list didn't update and I can't modify the property to "reference clock:source".
    Help me on this!
    Thanks!

    I think this article might be helpful, even if you are in a more recent version of DAQmx.  Otherwise, we might be looking at reinstalling the drivers.
    Kyle B  |  Product Support Engineer  |  ni.com/support

  • Daqmx digital timing

    In the application I need to acquire one sample from 16 channels every 5 secs.
    Currently the application works when it uses
    1. Daqmx Start
    2. Daqmx Read (Analog 1DBL N Channel)
    3. Daqmx Clear and then stop
    There is a timer loop that waits for 5 sec before acquiring the next set of samples from conigured array. I am trying to replace this timer loop by using Daqmx timing vi
    My question is if DAQmx timing vi is used are the setting correct in the attach screen shot to acquire one sample every 5 secs from 16 channels?  
    Solved!
    Go to Solution.
    Attachments:
    Daqmx timing.jpg ‏450 KB

    As a general rule of thumb, you want your "samples to read" which in continuous acquisition sets your buffer size, to be one tenth of your sample rate. Since you are reading at such a slow rate, you could theoretically set this to a relatively small number as opposed to 1000. In addition, you could entirely do away with the timing VI and just do software timed acquisition. You can do this by simply using a timed while loop with the wait(ms) function with the correct constant wired into it, in your case, 5000. Hope this helps!
    Regards,
    Daniel G.
    Applications Engineer
    National Instruments

  • Doing something the DAQmx way that doesn't fit? (Triggered counter on PXI 6608)

    Hi,
    I want to create a counter with my PXI6608 that is triggered with an external input, then counts up. I then want to be able to read the count in LabVIEW and hence determine the time since the trigger. I have achieved this before with old-style code, but it is not clear how to do it the DAQmx way. In particular, I can't create a task because what I'm looking to do doesn't seem to fit in with any of the pre-envisaged DAQmx task templates.
    Can anyone help? I'm assuming there's some way to create an 'empty' DAQmx task so I can fill in the details with property nodes?
    Cheers
    Lee
    Solved!
    Go to Solution.

    You'll want to make an edge count task and set the source to be one of the internal timebases using a DAQmx property node (set it before starting the task):
    The trigging functionality you're looking for is called an "arm start trigger" in DAQmx.  It's configured through a property node (also before starting the task):
    I'm not sure what you're getting at with regards to the "empty" DAQmx Task.  Typically you'll use the standard API to set typical properties and the property nodes for more advanced functionality so you'll end up with a combination of the two.  In many cases you could replace the DAQmx API with property nodes (for a fun example of this, open up the DAQmx Timing VI), but odds are you might be forgetting something important so I would always suggest using the VIs and then tacking on property nodes for additional functionality when necessary.
    If you're using LV 2012, this example should get you started (or if not, the picture still shows you what the task would look like).
    Best Regards,
    John Passiak

  • DAQmx: Digital - Continuous Output.vi example with PCI-6519 (error -200077)

    Bonjour everyone,
    Main goal :
    I want to use 1 digital output of the PCI-6519 harware to make  a staked light indicator blink when user is needed to operate the test station. 
    What I am trying:
    I open the labview 2013 wxample "DAQmx: Digital - Continuous Output.vi" to learn how I could use a DAQmx task to perform this blink instead of using a dynamic call of a VI changing the output in 'while loop'.
    The example states that my hardware should be able to run it but I always get an error -200077 right at the beginning with the DAQmx Timing.vi mentionning that my PORT2, line 0 does not support the 'Sample Clock' property which is hard coded in the example. I can't find a different property that this example will accept to try to change the status of my digital output on a time basis.  Does the PCI-6519 device support timing for a digital output or not?
    If anyone has a better or simplier idea to achieve such a simple goal, feel free to suggest.  I am using DAQmx for the first time and I don't know much about what my options are.
    Thanks 

    Hi Nienscecco,
    Unfortunately PCI-6519 doesn't support HW timing, I've just tried with a simulate PCI-6519 device and I confirm you that you must specify an external clock in order to use this example.
    Do you have some kind of frequency generator to provide it ? Or maybe another NI board with embedded counters in order to build it ?
    Thanks in advance for your answers.
    Mathieu_T
    Certified LabVIEW Developer
    Certified TestStand Developer
    National Instruments France
    #adMrkt{text-align: center;font-size:11px; font-weight: bold;} #adMrkt a {text-decoration: none;} #adMrkt a:hover{font-size: 9px;} #adMrkt a span{display: none;} #adMrkt a:hover span{display: block;}
    LabVIEW Tour
    Journées Techniques dans 10 villes en France, du 4 au 20 novembre 2014

  • Using cDAQ timers to repeat a hardware-timed finite-sample pulse train clock

    Hi all,
    As part of a complex project, I must implement an acquisition hardware interface for a linear motion sensor using the Synchronous Serial Interface (SSI) output common in industrial motion control. (I have a fair bit of experience in digital electronics, but I'm new to hardware timer-synchronized digital I/O in LabVIEW.)
    To do this, I need to create a hardware-timed bursted pulse train TTL clock signal. Each burst consists of 25 high-low transitions with a full-cycle period of 2.67 microseconds (375kHz). The output must then be held high until the next burst, which occur at 1ms intervals.
    Using cDAQ timers and a NI 9401 (based on the example at http://www.ni.com/example/30256/en/), I've been able to create the pulse train burst as described (see attached VI image). Next I need to configure another timer to trigger this burst to repeat at 1ms intervals.
    Does anyone have any pointers about the best way to accomplish the hardware timing for repetition of the pulse train?
    Any suggestions of alternative strategies or observations as to the ways my noobish code is stupid or inefficient are welcome as well!
    Thanks!
    Solved!
    Go to Solution.
    Attachments:
    Hardware Timed Pulse Train Clock.jpg ‏102 KB

    Hey Ryan, 
    A picture of the behavior you are seeing would be helpful. The NI 9411 should only be reading 50 bits every 1 ms.  
    It may not be possible to read 25 bits (do you mean 50 bits? 25 high 25 low) and push it to a queue without encountering an overflow error. If you take a look at the above code the digital input will receive 50 sample clocks every 1 ms. This is equivalent to acquiring 50 points every 1 ms which is an acquisition speed of 50 samples/1 ms=50 kHz. The read loop must keep up with the 50 kHz rate otherwise the buffer will overflow. In the above example I’ve set the read to pull 5000 samples (x) with the assumption that the loop will take less than or equal to .1 seconds (y). This yields a software acquisition speed of 50 kHz (5000 samples/100 ms). If the loop speed is faster than 100ms then the 10 seconds timeout on the DAQmx read will allow for the read to block so the FIFO may be filled.
    The options available for question 2 are below. They may be used separately or in conjunction.
    Move the DAQmx Read for the NI 9411 to its own independent while loop, set the DAQmx Read to acquire 50 samples, do not graph the data, and pass the data to a Queue for processing in a consumer loop. This will increase the loop speed which may allow you to keep up with the 50 kHz acquisition speed. This may not work because the loop speed will need to be 1 ms or less.
    Increase the value of the Samples per Channel control that goes into the DAQmx Timing VI. This will increase the DAQmx Software Buffer size. This buys time until you receive an overflow error because the DAQmx Software Buffer is being filled faster than samples are removed.
    Read in 5000 sample chunks (producer loop), push this to the queue, and perform the analysis in 50 bit chunks (consumer loop). The additional queue created should allow for the acquisition loop to keep up.
    Regards,
    Izzy O.
    Product Support Engineer
    ni.com/support

Maybe you are looking for