Precisely control timing of multiple acquisitions?

What is the best way to acquire repetitive sets of data at precisely spaced time intervals? I'm running LabVIEW 6i on Windows NT.
For example, I want to acquire say 500 scans at my top scan rate, process them, and then repeat this process every 10 msec. (I have to make configuration changes to my system during the dead time.) I need these data points taken at well controlled time intervals so I can make a meaningful waveform out of the data later.
Here's what I've tried:
1. Using a pulse train to trigger the AI Start function. When a triggered AI Start is included inside a While loop it uses all of the system resources watching for the trigger. No good. If I put in any kind of delay inside
the loop, then NT can take away priority and not give it back until the trigger event has passed.
2. Using a pulse train to gate the DAQ scan clock. Here I set the data acquisition for continuous acquire, but then turn the scan clock off during the dead time. So the system should only be taking data when the gate signal is high. My problem here is I don't know how to configure the AI Read function properly. Specifically, I don't know how to set the number of scans to read. If I calculate how many data points should be available and use that number, I'll often leave a data point or two in the buffer due to timing/rounding errors. If I set the number of points to read higher than the number I should have acquired, I get unpredictable behavior. Sometimes I read exactly the number of points I expect, sometimes 10 more, sometimes thousands more as it waits through multiple cycles to acquire more points.
I'm sure there is a better way. Any suggestions?
Thanks!
Craig

How about...
If you have precise control of the DAQ scan clock, then reading n points would be the way to go. You can request 0 points to read and look at the scan backlog to detect when the next n points are available without getting locked into an AIRead call.
Or...
read data all the time and just throw out the rest of the data. Set your acquisition buffer for several seconds worth of data collection and keep track of read vs skip data.
Stu

Similar Messages

  • Controlling transition timing in multiple multistate objects

    How can you control the timing of multiple multistate transitions in DPS? If you have two slideshows with a single button telling each to go to a particular state, the transitions go in sequence rather than simultaneously. Can you adjust the timing so each transitions at the same time and for the same duration?

    At this time, you can't run two button actions simultaneously.

  • How do I associate timing with multiple AI loops that is independan​t of loop execution speed

    I am using Labview 7.1 and I am performing AI of
    voltage on different channels of the same multifunction DAQ.  I am
    using while loops to aquire the data.  I am writing the data to
    spreadsheet file with an associated time as a 2D array.  Currently I am
    using the 'elapsed time' interactive subVI to get the time in seconds
    (attempting to use the 'Get Date/Time in seconds' and converting it to
    DBL results in time values that do not change. My thoughts are that
    maybe the number of seconds is too large to display single second
    precision with a DBL floating point number). When I run AI on two
    multiple loops they execute at different rates and thus the time values
    from "elapsed time" are accumulated at different rates. I have tried
    using timed loops to control timing, but if one loop executes at a rate
    slower than the timing of the loop the 'elapsed time' still accumulates
    at different rates.  I need to be able to associate both analog inputs
    to the same time
    value in the spreadsheet value and I would like to find a way to
    associate a time with each data point that is independant of loop
    execution speed (although I would still like to control execution speed
    of the loops. I am pretty new to Labview and programming in general,
    any help would be greatly appreciated.

    If you want to read more than one AI at the same time, you should use a trigger.  You would need to set up the AI Trigger to an external source.  Then you would have to use a function generator or digital out to create a clock.  The clock would be wired to the AI external trigger.  When the clock goes high (or low depending on configuration), both AIs would read.  That is the method I use when needing to sync multiple AI inputs.
    - tbob
    Inventor of the WORM Global

  • Best way to control audio over multiple slides-iMovie or QT Pro?

    I have a 30-slide presentation, and due to the horrendous handling of audio files by Keynote I need figure out the least painful way of controlling audio spanning multiple slides.
    My end goal is to have a Quicktime file to put on the web, and to burn to a CD or DVD for viewing on individual computers. There is audio spanning 3 slides (a Garageband mix with voiceover narration built in,)and different audio for background for different groups of slides.
    Least painful method to attempt this and get ACCURATE TIMING for the end product?

    Make a series of Keynote presentations, one for each complete audio track. Export each as a QuickTime DV (digital video) clip. Launch iMovie and import the clips into a single iMovie project; tweak each clip's audio, as necessary. Finally, export the assembled iMovie to your intended QuickTime format.

  • Using timer/counter with PCI-6221/USB-6210 to control timed-loop VI

    Dear all,
    I need to ask about two devices and one of their functionalities, PCI-6221 and USB-6210. For our NI-based system, we need to control some timings in a Timed-Loop vi, for that currently we are using PCI-6221 and we give external TTL signal (at 1 kHz) to it,
    recenntly we need to make some changes and for that we found USB 6210 DAQ to be more suitable, but we need to clear ourselves on some specific things.
    Can the counter/timers functions available in the either PCI 6221 or USB 6210 can be used to control the Timed-loop VI by giving external clock or by using their own internal clock source?
    Although we are using external clock with the PCI 6221 but we want to know about the usage of their internal clock, also are controlling timed-loop also possible for USB-6210
    Also... What if we use the RTOS, are they still able to control the timed-loop VI  without giving any 'EXTERNAL CLOCK' and using the internal clock sources of the DAQs
    Waiting for reply,
    Bests,
    RaJaf
    Solved!
    Go to Solution.

    Ben,
    I having read previous email which I send earlier with general overview, we discussed in more detail within our team and I am giviing the specific answers.
    Please check in RED the most recent answers. Blue are the questions/suggestions by your side.
    1.    Using Internal hardware clock of PCI-6221 would enable us get rid of external clock, but how to divert the internal hardware clock to the current settings. Any idea  (can you provide us with some reference manul for otherwise). I mean is there some flag-bit etc. or VI
    2.       Is it also meant that with the installation of RTOS the timed-loop can directly get the timing source from the internal hardware clock PCI-6221? --- How???
    3.       In order to make desktop to work as RT system, what is the hardware (motherboard, processor, etc..) requirement? What are the LabVIEW modules (specific name) that needed to be installed? Our platform is LabVIEW 8.6. (Currently we have windows-7 with i7 core processor)
    What kind of application are you intending for this system? ---- high-speed laser scanning system.
    Are you most concerned about accuracy, speed, or responsiveness? To control the laser mirror scanner to move at 1 kHz or 2 kHz speed. On the other hands, using PCI-5105 (128 MB memory) as a DAQ for real-time/on-the-fly data processing.
    Bests,
    RAJAF

  • Re:Bursting control file with multiple sub templates

    Hi
    Can any one let me know how to create a bursting control file for multiple sub templates. I.e I have one main template which will invoke other templates. the normal bursting control file which i have created is sending
    an output with no data , but i can see an output in the concurrent program.
    Thanks in advance.

    Add it as parameter in your xml file.

  • Best way to control and run multiple (up to 20) processes independantly in LV

    Hi all, 
    I'm trying to build an application in LV to independantly control and run multiple (up to 20) processes, ie, it should be able to start and stop any of the processes at any given time. What would the best way to code for this? Off the top of my head would be to use a unique notifier to control each of the process, but I'm thinking that the code upkeep may be a handful with this number of notifiers being defined. Are there better ways of doing this?
    Appreciate any help and insight on this.Thanks a bunch in advance!
    Solved!
    Go to Solution.

    I forgot some more important questions:
    How large is your development group?
    How much "discipline" do you want to program into the Process Commands framework? For instance, is it OK for any VI to command a process into a certain state, or should your program generate a broken wire or run-time error if a command is sent from a non-authorized source?
    Where do your needs fall on this spectrum: simplicity that gets the job done and the product out the door and will probably not need much maintenance or upgrading, or flexible framework that will likely undergo multiple upgrades or fall into the hands of multiple developers?
    a.lia-user-name-link[href="/t5/user/viewprofilepage/user-id/88938"] {color: black;} a.lia-user-name-link[href="/t5/user/viewprofilepage/user-id/88938"]:after {content: '';} .jrd-sig {height: 80px; overflow: visible;} .jrd-sig-deploy {float:left; opacity:0.2;} .jrd-sig-img {float:right; opacity:0.2;} .jrd-sig-img:hover {opacity:0.8;} .jrd-sig-deploy:hover {opacity:0.8;}

  • After time capsule 7.6 Firmware upgrade I can't set up Access Control / Timed Access using mac adresses.

    After time capsule 7.6 Firmware upgrade I can't set up Access Control / Timed Access using mac adresses.
    I have a Time Capsule and an Airport express and when I change access control parameters on whatever one of those
    two devices through Airport Utility its duplicating the same setup on the other device !
    What a mess !
    I had to choose "Not Enabled" in the Access Control stup window.
    Has anyone experienced same problem ?
    Jean.

    I did downgraded firmware to 7.5.2 ...
    and the Acess Control Setting from Airport Utility is back to normal behaviour.
    Jean.

  • How to achieve precise control of frames flv?

    How to achieve precise control of frames flv?

    Thanks for that suggestion, but still it did not work. I am working on a theory that certain adjustments to the embedded text pane didn't get properly propagated up the component hierarchy. I wouldn't be surprised if something broke the component communication.
    The curious thing is that the scrollpane seems to know how big the viewport is, but the scrollbar finds the wrong "0" point.
    I am making a little progress. I will post my solution here, if and when I find it.

  • Timing control signal and data acquisition

    I have a series of relays which when activated will close different elements of a circuit and I also have a sourcemeter(Keithley) sending a constant source current and reaing the voltage back.(But when no relays are closed the circuit is open and no source current flows )
    I have a microcontroller(pgmmed for 9600 baud rate) based hardware circuit which closes different relays sequentially based on the input it recieves from labview pgm passed on through a Rs232 cable(9600/8 bit/no flow control)
    So i made a sequence structure of sending signal to microcontroller signal then wait for the signal transmission and realy activation and then read the voltage value form keithley sourcemeter back to labview thro a GPIB cable.
    These three events are reapeated sequentially in a while loop. 
    A schematic picture is attached.
    BUt the problem I ma facing is the maximum speed of reading is limited to 200msec/reading even thought the relay activation time is as low as 30 msec.
    I tried with many different delay times (140-60 msec...but more or less each reading takes up 200msec irrespective of the delay time..) 
    What could be the bottle neck is it the Rs232 setting at 9600 baud rate..can changing that to higher baud rate/including flow control solve this problem?
    Attachments:
    daq_printscreen.GIF ‏45 KB

    siva0182 wrote:
    Find attached the picture of the vi where I tried to put in timers.one in each of the frame and at the end added one more frame just to measure the time elapsed .
    The last frame and the frame with sourcemeter measurment show adifference of about 140 msec.
    Is there any way to improve the speed of this portion?
    Probably not.  It sounds like the Keithly VI is taking 140 msec.  You can try opening that up to see if there is anything in there that could be causing an unnecessary slowdown.  But trying to tighten it up too much may cause occasional errors (such as timeouts) in trying to get a response back. 
    But surprisingly I tried displaying the actual timer value at the start and at the start of sourcemeter read function ..but the display of both indicators is almost equal with little difference of only 10 msec.?????  I'm not sure which of the several timers you are referring to here.  What is the value going into the wait function between the VISA write and the Keithly VI?
    When you do benchmarking, the timer functions should be in a frame all by themselves.  Having it mixed with another function or VI causes a bit of uncertainty as to when the time was taken.  For instance, you dont' really know if the Keithly VI was started before the time was taken or after.  (The time was probably taken first, but without a data flow or sequence structure dependency, you can't be sure.)

  • Real-time PID control and continuous buffered acquisition. Does it work together?

    I use the "real-time PID control.vi" that acquires single AI point and generate single AO point in every "while loop" iteration to control a piezo actuator motion. Simultaneously I need to do (in another loop) a continuous buffered acquisition of another two AI channels (in the same rate as first AI channel).
    It does not work together.
    Does anybody know how to fix it?
    Platform: LabVIEW 6.1
    Board: PCI-6024E

    Hi,
    I would try to avoid the idea of using a separate loop since the PID
    loop is a continuous acquisition and will require un-interrupted access
    to the Analog DAQ system of the board. The last thing it needs is for
    you to attempt to start other AI functions at the same time.
    Configure your AI in the PID loop to read in multiple channels (Just add
    some more channels to the Input Channels Control. Separate the data as
    it comes out of the AI single Scan function using Index Array or other
    Array functions into that needed for the PID and that needed for your
    other data (the example is already doing this to make sure it only gets
    1 channel of data into the PID). If you don't need to sample all your
    channels of data all the time you can throw some data away as
    required.
    Obviously your other channels are now arriving one sample at a time so
    if you might need to build an array, insert into an array or use Auto
    Index on the loop if you are data logging.
    Regards,
    Dave R.
    varmih wrote:
    > I use the "real-time PID control.vi" that acquires single AI point and
    > generate single AO point in every "while loop" iteration to control a
    > piezo actuator motion. Simultaneously I need to do (in another loop) a
    > continuous buffered acquisition of another two AI channels (in the
    > same rate as first AI channel).
    > It does not work together.
    > Does anybody know how to fix it?
    >
    > Platform: LabVIEW 6.1
    > Board: PCI-6024E

  • SPI bus timing, 1ms repeat acquisition

    I plan to use digital I/O to create a SPI bus to read the output from a sensor.   I need to repeat a 2 byte read at a 1ms interval.  I was hoping to use a USB-8451 for this but I am unaware how I can control the 1ms repeat timing using LabVIEW.  If I only need 100ms of data perhaps I can use the NI845x SPI Write Read.vi to read an array of 200 bytes and then divide the array up into 100 2-byte pieces.  Depending on my sensor, I may need to deselect the Chip Select between the 100 reads to permit the DUT to update its data.
    Alternatively, I have considered the USB-6221,6225,6229,6251,6259,6281 or 6289.  These seem to have better hardware timing features but may be limited to 2047 samples.  I assume that this means 256 bytes which could give me 128 samples from the sensor.
    Thanks for any suggestions you can provide.

    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

  • Timing for Data Acquisition Using Notifiers

    I'm trying to use notifiers to transfer data from an acquisition (master) loop to the slave loop. I want data to be transferred for analysis only when the VI is in a certain state - not in all states. That's why I'm preferring to use notifiers instead of queues (I want all data collected during the other states to be disregarded). I have attached a simplified version of what I'm trying.
    The master loop generates a data point every second. The slave loop is in a "delay" state for 5 seconds and then in "acquire" state for 3 seconds. Given this architecture I would expect no data for 5 seconds and then 3 data points to be plotted during "acquire" state because only one data point is generated per second. But for some reason I get 5 or 6 data points during every acquire cycle. I haven't figured out why I get 5-6 data points instead of 3. It probably has to do with the timing functions I'm using.  
    Thanks!
    -Arnie 
    Attachments:
    Notifier Data Transfer Template.vi ‏62 KB

    Here is an example of a race condition without the use of local or global variables.  What is happening is that the notifier is already queued up with a value even before the Elapsed Timer has even started.  So one extra value will be in the output array.  Also, depending on how the parallel loops perform (which goes first), there may be an extra value queued up before the Time Elapsed event could fire.  Typically, when I ran it, I got an array size of 6 at first, and then it went down to 5.  Clearly the architecture is not right for what you want to do.  Instead of depending on timers and parallel loop timing, you could receive all the values queued and just discard the ones you don't want.
    - tbob
    Inventor of the WORM Global

  • Timing of DAQmx Acquisition Vi and data write

    I am acquiring data from a DAQ rack, using a 6251 PCI card. after acquiring a data set, i write it to a binary file. afterwards, i do a small calculation on one channel value and apply a condition on this value. the outcome of which is connected to the while loop surrounding the acquisition. So i (1.)grab 100 points, (2.) write, calc. and cond., and (3.) start over again. I stuck millisecond timers in between steps 1, 2, and 3 to determine if i was incurring much delay. So, if i have no delay, and i'm sampling at 100 Hz, the differences between the millisecond timing values (stuck into an array) should be
    1000
    0
    0
    1000
    0
    0
    1000
    0
    0
    etc.
    This is usually the case. However, sometimes i get something like this
    900
    100
    0
    900
    100
    0
    or
    980
    20
    0
    980
    20
    0
    So if i measure a delay as a result of the writing/calculations/conditing, this time is subtracted from the acquisition time interval. I don't really understand this at all. Why a delay after the acquisition would speed up the acquisition, i have no idea. My only guess is that i start writing/calculating/conditioning before acquision has finished, but why would it do that? I've attached basically the setup. Any help would be great.
    Attachments:
    Concept.vi ‏61 KB

    ...what is the "hw?"
    That's short for "hardware." Specificially, in a buffered acquisition the data is sent into your memory buffer at regular times regulated by a hardware clock found in your data acq board. Your software interacts with this memory buffer via 'Read' calls.
    ...worry about delay?
    That'll depend on your app. As you've described it, you Read 1 second worth of data all at once then do some processing and storage. As long as you can do that processing and get back around the loop in less than one second, then the processing is not a bottleneck. The speed is being regulated by the amount of data you request and the time it takes to acquire it.
    If this behavior is sufficient for you, then no, you don't have to worry about the delay.
    Other apps may need to read smaller amounts of data and make decisions more quickly than once per second. Or they may need to instantly read the most recent data without waiting for any and then quickly make a decision. These sorts of apps might cause you to worry about the processing time.
    -Kevin P.

  • Manually controlling music across multiple computers

    I've seen a lot of similar posts about this and I find it quite frustrating that I was able to manually control my music with my 30GB ipod across multiple computers but my iphone locks me down to just one computer.
    Even if I decide to use the 'manual' option it just doesn't let me add music to my iphone from multiple computers. I am constantly directed to erase and re-sync with the new computer. It's not a solution I like considering what I can do with my older ipod.
    The only solution I found so far was to jailbreak the iphone but I refuse to go that path. I read a few reasons Apple released as to why it was limited and find it very silly for lack of a better word.
    Anyone experience the same frustration and have a solution? Or know if there is an update to resolve this any time soon?
    Thanks!

    One thing that might help.
    The iphone will only sync music and video content from one computer at a time.
    If you want to sync music or video content from a second computer, itunes will remove what the first computer put on the iphone.
    One thing you can do though, is combine our itunes library onto one computer.
    This article might help out.
    http://support.apple.com/kb/HT1329?viewlocale=en_US

Maybe you are looking for

  • How to set Current User in moss 2007 for Authentication....

    Hi Team, We have current running website where we have user id to login but now requirement is that user will login with his Email address. Email is stored in active directory, I'm able to login with fba authentication.   I'm able to retrieve the use

  • Wk 8 - Video of the week: Improving speed with a B...

    Hi Everyone This weeks video shows you how to fit a BT Accelerator.  Extension wiring around your home can affect your broadband speed. Fitting a BT Accelerator (which you may also have heard called an iPlate) can really help improve it. To view our

  • Japanese Input on a Blackberry in Germany

    We got a 8707v working with Romaji input in the UK.  But the same package did not work in Germany or France on devices there. We are with Vodafone.  We deleted the vendor.xml  before install but still not able to get this working.   Chinese and Korea

  • Yellow warning signs with ! in it

    I am working in imovie-- do not know what I did-- but in my project libary one of my movies have the yellow warning sign with ! in it--- when I try to watch the movie all that comes is --sourse clip is missing, sign. Please help me as I want to keep

  • How is the using iphone 5 in iran

    hy i have some question when the person in travaling to country iran how is the use iphone 5 in the country? what is the nano sim card?maybe use this country? are the working this country ? is the unlocked factory iphone 5  for iran?