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

Similar Messages

  • How to make a pulse train on DO line useing E-series in LV7

    Im trying to make a finite TTL pulse train that I would like to put on DO-0. Ive gone over some of the VIs that have came with the program but none of them seem to do this. I dont need a starting trigger or anyhting like that. All i really need to get going is to make about a finite 1-3Khz TTL pulse width on my Digital out. Thanks a lot!

    LV7 has several example VI's on how to produce a pulse train. If you are using an E series card, then you should use the GPCTR output for your application.
    I am using an E-Series Card to generate finite pulses and it works fine on the CTR output.
    Have a look at "Finite Pulse Train (DAQ-STC).vi" in your Example Finder.

  • Unable to measure frequency below 20 Hz on a NIDAQ 9178 chassis with NI 9402 even while using a hardware timed delay

    Hello,
    I am trying to measure frequency using NI 9402 in NI cDAQ9178 chassis. I am setting the clock for my counter channel to be my chassis ai Sample Clock.
    I am able to measure frequency above 20 Hz. For frequencies less than 20Hz, I get the following error:
    DAQmx Error: Multiple Sample Clock pulses were detected within one period of the input signal. Use a Sample Clock rate that is slower than the input signal. Ifyou are using an external Sample Clock, ensure that clock signal is within the jitter and voltage level specifications and without glitches.Task Name: _unnamedTask<0>
    Status Code: -201314
    Setting the Rate to 1 also not does resolve the issue.
    OTHER DETAILS:
    * Running on 64 bit, Win7 platform.
    * NIDAQmx Driver Version: 14.5
    I had posted regarding this earlier and I was told that this might be because the counter is armed immediately before the first sample is taken. The recommendation was to add a hardware-timed delay using the DAQmxSetStartTrigDelay method to the AI task. I have added this delay but I still receive the same error message. The previous post I had mentioned can be found below:
    http://forums.ni.com/t5/Multifunction-DAQ/Cannot-measure-frequency-below-20-Hz-on-a-NIDAQ-9178-chassis/td-p/1537274
    I have also attached my current code which has the delay. Is this a bug in the driver? If yes, can we have a CAR# to track this?
    Thanks.
    Regards,
    Varun Hariharan
    The MathWorks

    Alright so I got everything working correctly in both C and LabVIEW code.
    The problems is in fact with the first sample, as John_P1 suggested. You simply need to delay that first sample from being requested. It is simple to do this in software instead of hardware.
    If you are using CVI, just add #include <utility.h> to the top of your .c file and then add a delay before your DAQmxErrChk (DAQmxStartTask(AItaskHandle)); line.
    Comment out / remove the DAQmxSetStartTrigDelay(AItaskHandle,10); line, as it wasn't doing what we thought it would. (Hardware delay).
    I added Delay (.05); to delay long enough for the full period of the input signal at 20 Hz.
    Depending on your frequency, this value may need to be adjusted. 100ms wouldn't be a bad idea.
    This is expected behavior, and I don't think we need a CAR.
    Let me know what you think!
    -CB

  • Scan rate using hardware timing.

    How can I set the scan rate accurately to 1000 Hz using hardware timing.

    Wire 1000.00 to the Scan Rate input of the AI Start VI. That will set up the scan clock on the DAQ board to run at 1000 Hz. Note that it will only work on NI DAQ boards.
    Daniel L. Press
    PrimeTest Corp.
    www.primetest.com

  • Need urgent help with HSDIO hardware timing

    Hi everyone,
    I need urgent help regarding HSDIO hardware timing. I've been working in a project which generating serial ramp using HSDIO pxie device. 
    I'm using clock rate 40MHz and generating 14 bit of boolean for each step of ramp. And I have to generate simply 256 steps ramp.
    Which means, 256 (steps) x 14 (boolean array) x 25 ns (period of 1 boolean value) = 89,6 ns.
    What I'm doing right now is with using index of FOR loop as my input data (converting the index into 14bit boolean), then write into pxie device in every iteration,
    which means, my data is getting into output in every 1ms time, right? (I'm using windows)
    And I want to be able to generate faster than that. 
    How can I prewrite my 256 steps ramp, then write them all at once into pxie device. I'm really stuck here.
    In the picture can you see how I do the write into device in every iteration of FOR Loop.
    Regards,
    Yan.

    hi, thanks for responding.
    with using example of dynamic generation with script, I can manage to generate the ramp with controllable delay (generate the whole waveform, including delay with script command, then write to the card).
    But I still have 1 question, I can test the output of the generation using oscilloscope and cant see the start delay (I'm writing delay at the start, before generating the ramp). My signal generated at 0 sec.
    How can I check this start delay? is there any good example delivered with Labview to check this generation? Somehow I cant use the "dynamic generation and acquisition" example to see my generation (cant figure out how to capture the generated signal).
    regards,
    Yan.

  • DAQmx Error: Non-buffered hardware-timed operations are not supported for this d evice and Channel Type.

    Hello,
    I am new to NI and to data acuasition cards in general. I am trying to put an application togather that would play large audio file using NI9263.
    And i am getting the following error.
    DAQmx Error: Non-buffered hardware-timed operations are not supported for this device and Channel Type.
    Status Code: -201025
    Does my hardware support buffering ?
    can i use the EveryNSamplesCallbackAO function ?
    Any sample code, will be helpful at this time. Thanks.

    Hi yma200,
    Are you using a USB 9263?  If so, this might be of help:
    http://digital.ni.com/public.nsf/allkb/EC1968728E660B288625780700570D06?OpenDocument
    If it doesn't help, can you please post the code that you have that is causing your error?
    Regards,
    Bogdan Buricea
    Applications Engineer
    National Instruments

  • How to setup a hardware timed triggered acquisition ?

    hi,
    I want to do a hardware-timed Simultaneous AI-AO based on an external trigger.I am using a PCI-6052E card. I have tried software timed setup but it misses trigger pulses.I am using a PCI6052E card.
    thanks,
    Shiv
    Attachments:
    DAQ_DOCUMENT.doc ‏23 KB
    basic_loop3.vi ‏169 KB
    The_Data_Generator.vi ‏30 KB

    Hi Shiv,
    Take a look at
    Search Examples >>> Hardware input and output >>>Simultaneous analog I/o >> Simul AIAo BefTrg(E-series).vi
    This should cover most of what you need.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • PXIe-4141 hardware timed 4- channel sweep

    In the attached example of FET/BJT characterisation using hardware timed two channel sweep, for each gate voltage the drain values are sweeped.
    If I understand the trigger settings correctly :-
    For each drain value, V is applied and I is measured. So if there are 2 Vg values and 3 Vd values, the PXI fetches 6 Vd & Id and 2 Vg, Ig values.
    To put it more bluntly,
    seq start
     Vg = 3V Ig = .....
    seq start
    Vd = 0.5,Id = ....(Ig = ?)
    Vd = 1,Id = ....(Ig = ?)
    Vd = 1.5 Id = ....(Ig = ?)
    seq complete
    Vg = 4V, Ig = ......
    seq start
    seq complete
    What if we wish to measure Ig for all iterations of Vd as well ? Can guess to configure 'MeasureWhen' trigger of Gate to 'SourceComplete' of Drain. Is that doable/feasible in sequence-source-mode ? Or one should apply each value in single-point-source-mode. Wish to iterate 5 values in each 4 cascaded channels at the end.

    Hello,
    Last time I asked for your code but I think that you need more information about the hardware configuration for your PXI. That is why I found some material in the help file of the PXIe-4141 which is given below.
    I hope this helps!
    •Once the sequence runs Sequence Loop Count times, the operation is complete, and NI-DCPower generates the Sequence Engine Done event, as shown in the following figures.
    The following figure illustrates a sequence with the niDCPower Measure When property is set to Automatically After Source Complete or the NIDCPOWER_ATTR_MEASURE_WHEN attribute is set to NIDCPOWER_VAL_AUTOMATICALLY_AFTER_SOURCE_COMPLETE.
    The figure could you find in the screenshot. 
    You can find a screecshot in the attachment.
    Regards,
    Hossein
    Attachments:
    Help PXIe-4141.png ‏250 KB

  • Music spontaneously starts, stops, stutters at random and I'm not even using that app. Repeated attempts to pause the song and close the app have no affect. Just keeps popping on and off randomly no matter what I'm doing at the time.

    How do I eliminate this glitch?  Music spontaneously starts, stops, stutters at random and I'm not even using that app. Repeated attempts to pause the song and close the app have no affect. Just keeps popping on and off randomly no matter what I'm doing at the time. I tried double-clicking the Home button which brings up all of the active apps, touched and held the Music icon until all the icons started wiggling, tapped the Close icon in the upper left corner of the Music app to close the app completely, but the app is still open and still randomly stuttering. I did notice that the play button icon flashes in the upper right corner of the screen when this happens and it appears and disappears in concurrence with the Music app stuttering. When the music starts, the icon appears and when it stops, the icon disappears again. When the music stutters on and off, the icon appears and disappears rapidly and in sync with that random glitch. This just started today for no apparent reason. I turned the iPad off, waited 30 seconds and turned it back on. As soon as it was finished starting up, the same music glitch began again immediately. I'm using iOS 6.1.3.

    Well, no one seems to have any answers or ideas for me, I'll update what I've been able to accomplish.
    I reloaded all 14 disks in the time frame of watching Lord of the Rings on Fri. nite.
    Funny thing is, the first disk pulled the info from the online store! Hooray!
    Wait-then all the next 13 could find no information online...what the heck is up with that? So I MANUALLY assign each disk a new track # to co-inside with each disk, spent about 2 hours doing that.
    But still, itunes tells me my playlist is too large, there's not enough space on the ipod. so I unchecked 1 1/2 disks (I'd listen to 1/2 of disk 1 previously) and voila! there's my ipod full of my book. Finally. But what a lot of bother just to keep things in order!

  • HT201401 my i phone 4s camera is not working... tried everything but of no use...may be the hardware issues.Then how to resolve it? warranty is void..suggest please!!!!!!!

    my i phone 4s camera is not working... tried everything but of no use...may be the hardware issues.Then how to resolve it? warranty is void..suggest please!!!!!!!

    Basic troubleshooting from the User's Guide is reset, restart, restore (first from backup then as new).  If each of these has been tried and the issue still occurs, the only option left is to take to Apple for evaluation and possible replacement.
    Out of Warranty replacement is $199US.

  • Is there a way to use a DAQ VI without DAQ hardware?

    Hello,
    Is there a way to use a DAQ VI without having DAQ hardware?
    Thanks,
    Steve

    Steve,
    Yes, you can use the DAQ VIs without the hardware. With the DAQmx 7.5 and 7.4 version of the driver, you can simulate DAQmx devices. This will save you some time, as you can program and test your application without the actual HW present. However, you will not have the full functionality with simulated devices.
    Regards,
    Somendra

  • How do you create a stand alone application using DAQmx when your application SCXI hardware isn't on the computer I am using to create the application?

    How do you create a stand alone application using DAQmx when your application SCXI hardware isn't on the computer I am using to create the application? The DAQmx assitant won't allow me to create a task with hardware that isn't in my system.

    You will need to have at least the DAQ device in your computer to add the chassis. When you add the chassis, don't auto detect the modules. You will have to add the terminal blocks and tell MAX which SCXI module will be connected to the DAQ device. Just make sure you don't test the chassis, when its not there.
    I hope this helps.
    Joshua

  • Unable to read 5th channel using cDAQ 9178 with NI 9219 modules

    Dear LabView user,
    I've made a VI for reading the measurements of a couple of LVDT sensors, a load cell and a couple of strain gauges. When I connect 4 of these sensors to my cDAQ 9178 with using 1 slot of NI 9219, then there is no problem for my VI. But if I use 2 modules, and connect the 2 LVDT sensors and the load cell to the first module, and the 2 strain gauges to the 2nd module, then my program only will show the readings of the first module and the readings of only 1 strain gauge on the 2nd module. I've found that there occurs an error for the 5th channel in the 'zero' state. It says my buffer size is too small... How can I solve this problem? I can't work with finite samples because it is a continious measurement. 
    I also have the cDAQ 9171 USB module, if I only connect 4 sensors to this module, the sample rate is high (100 Samples/sec), when I use the same configuration, but connect this with the cDAQ 9178, the sample rate is much lower however I use the same NI 9219 module to fill the slots. Is there some kind of setting I need to make when switching over to the cDAQ 9178?
    I've attached my VI.
    With kind regards,
    Pete

    Dear RavensFan, 
    Thank you for your answer.
    "Have you tried swapping the modules between the slots and see if you still have the same problem or if it moves?"  When I use the cDAQ 9178, I always use the first 2 slots next to the power suply and the usb connection, you mean that I should try for example the 4th and the 5th slot or other slots? I will try this on Monday, and I will let you know.
    About the states machines inside a state: How is it possible then to use several buttons, like start and stop measurement and the 'home' button inside the state "measurement"? Should I make another simple state machine inside this state? 
    What about that 5th channel that I'm unable to read? The problem happens in my "zero" state: to acquire my "zero elements", the loop does the job for the 5 channels for the first 8 samples, after that, it doesn't want to sample the 5 channels anymore, it only does for 4 channels... It's something about the buffer size, but I don't know how to fix that.
    With kind regards,
    Peter

  • Generate/R​ead Digital Pulse - What clock to use?

    Hi,
    I am using the NI cDAQ-9172 (with output module NI 9472 and input module (9421).   I am trying to generate a pulse, run it through a system (just a resistor at this point) and then read it back into labview.  I am able to generate the pulse with no problem, but anytime I try to read it I get an error regarding the clock.  Any suggestions?
    Thanks,
    Solved!
    Go to Solution.
    Attachments:
    Generate and Read Pulse.vi ‏30 KB

    Looks like i figured it out.  I had the clock said as hardware timed, but my hardware was wired wrong.  After I corrected the wiring it worked, so that must have been the problem.

  • Using a SCC counter pulse train to control a SCC digital out signal

    I am trying to send a digital high signal on a SCC-Digital ouput module for a certain number of pulses generated by a SCC-Counter/timer pulse train. I have found examples of how to route such signals through PFI12 etc on an M-series board but I am trying to achieve this without referring to the card, just the SCC modules themselves.
    I cannot find a way to use the sample clock from the counter generated pulse train to synchronise the digital output.
    Is there any way I can do this without referring to the connected M-series DAQ card channels?
    Thanks in advance for your assistance.
    Cheers.

    Hi Phil,
    The SCC carrier is only conditioning your signals (i.e. if your signals are not in optimal ranges, bandwidth or need external excitation). The actual counters and all digital lines are controlled directly by the M-series board. This means you will never be able to refer to a counter in the SCC module.
    If you route the signals of the M-Series board, is as if you had done so externally from the SCC. Look at this example and might give you more insight to how to implement it (This is software timing). The hardware timing would be doing correlation DIO. Here is an example that needs to be modified to adapt to your timing: http://zone.ni.com/devzone/cda/epd/p/id/4414
    Hope this helps,
    Yardov
    Gerardo O.
    RF Systems Engineering
    National Instruments
    Attachments:
    Finite Dig Output High.vi ‏31 KB

Maybe you are looking for