Limited sampling rate with multiple timed loops

I am trying to use two timed loops.  The first timed loop is supposed to acquire some analog inputs, average the values, and then display the average values on the Front Panel at a rate of 2 Hz.  When I want to acquire data I enter a second timed loop and try to acquire data at a rate of 50 Hz.  The second timed loop is designed to acquire 1 value and then append the data to a file.  During the 50 Hz acquisition I want the first timed loop to also run so that the Front Panel continues to refresh values at 2 Hz.
The problem I'm getting is that the second timed loop doesn't acquire and write data any faster than the first timed loop.  So in this case I'm limited to 2 Hz data acquisition when I want 50 Hz.
Attachments:
SWIFT_Dive Record2.vi ‏270 KB

Hi FRLFTE,
the second loop run not faster because both loops are in the same "big" while loop, so that the second loop has to wait till the first is ready.
Mike

Similar Messages

  • Converting Units in LabView and specifying sampling rate with Universal Library functions

    Hi,
    I am having trouble converting units in LabView 7.0 and having it write to a file / output on a chart in Nm instead of in volts.  I can't seem to find any straightforward instructions, eventhough it seems like a simple task. 
    Another task that would seem rather simple is changing the sampling rate with the XAIn program from the Universal Library for LabView (this is version 5.40).
    If anyone could help me out, I would greatly appreciate it - I have tried other sources without much luck!
    Thanks
    Jenna

    Are you really needing to change units or do you need to scale the voltages read from your sensors? If it's scaling, it would be trivial to set this up in mAX or with the DAQ Assistant if you were using an NI board. Since you are not, then you could use the Scaling and Mapping Express VI. The y axis of a chart is just a label. You can use the text tool to change it to anything you want.
    I have no idea how to change sample rate for your board. Have you asked the vendor?

  • Shutting down a queued event state machine with multiple parallel loops

    I am trying to find the best way to shutdown a program that consists of a queued event state machine architecture with multiple parallel loops. Can anyone recommend the best way to accomplish this in my attached VI? (From browsing the forum, this seems to be a common question but I haven't found a solution that works for me.)
    I welcome any other feedback on my code as well, if anyone is willing to offer it.
    My Program Requirements:
    If the user presses the "Shutdown" button, the program should prompt the user with "Are you sure you want to stop the program?" and then either return to the Idle state or proceed to stop the program. Additionally if there is an error, the program should prompt the user with "Clear error and continue, or Stop program?" Then either return to the Idle State or proceed to stop the program.
    Details of architecture:
    The program consists of 3 parallel loops: (1) an Event Handling loop that enqueues various States to a State Queue, (2) a State Machine which enters the latest state that is dequeued from the State Queue, and (3) an Error/Shutdown handling loop which processes any errors in the Error queue.
    During normal Shutdown, in the Event Handling loop the "Program.Shutdown" event case executes, and the States "Shutdown" and "Idle" are added to the State Queue. In the State Machine, the "Shutdown" state is invoked. A special error code "5000" is added to the Error Queue. In the Error/Shutdown handling loop, the "5000" error triggers a prompt that asks the user if they want to stop the program. If the user chooses not to stop, a notifier StopNotif is sent to the "Shutdown" state and "Program.Shutdown" event case with the notification "Go". If the user chooses to stop, the notifier sends the notification "Stop". The Event handling loop and State Machine are terminated if they receive the notification "Stop".
    In case of error, the program behaves similarly: if the user chooses to clear the error and continue, the program returns to the "Idle" state.
    HOWEVER - if the user chooses to stop the program, the program stalls. The notifier that is sent to stop the Event Handling Loop and State Machine cannot be read because the Program.Shutdown event case and the Shutdown state (which contain the "Wait for Notifier" function) are not active.
    I have been able to activate the Shutdown state by enqueuing it in the Error/Shutdown handling loop. But I don't know how to activate the "Program.Shutdown" event programmatically, and thereby access the "Wait for Notifier" function inside it.
    I tried to place the "Wait for Notifier" function outside the event structure, but then the Event Handling loop never completes. Placing timeouts on the "Wait for Notifier" and on the Event structure makes the program work, but I want to avoid using timeouts because I don't want to turn my event-driven program into a polling-based program. I'd also like to avoid using variables or property nodes to stop the loops, because that requires creating a control/indicator for something that the user doesnt need to interact with.
    Thank you!
    Solved!
    Go to Solution.
    Attachments:
    Queued event state machine parallel loops empty.vi ‏46 KB

    Thanks for clarifying that, Ravens Fan.
    I marked crossrulz as the solution for pointing out User Events to me.
    I also adopted Ravens Fan's suggestion to keep the Shutdown procedure out of the Error Handling Loop. This has simplified the architecture by eliminating the need for Notifiers. Instead, I have used booleans in case structures to stop the Event Loop and State Machine, and Release Queue to stop the Error Handling Loop.
    For reference, I'm attaching my corrected code.
    Thank you to everyone who helped!
    Attachments:
    Queued event state machine parallel loops empty in progress.vi ‏44 KB

  • 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

  • Low sample rate with NI USB-6008

    Hello,
    We are working on a project collecting data from a hybrid rocket motor for
    University research. We are using a NI USB-6008, which has a sample rate of
    10kHz. We are using 3 channels and getting a sample rate of ~60 samples per
    second. I have attached the VI. Is this slowed by software, or physical
    computer computation speed? This sample rate needs to be much higher. Any help
    is greatly appreciated.
    - Theo
    Attachments:
    Hybrid DAQ_10.vi ‏73 KB

    Hi Rocket 154,
    You’ve already had some
    great responses, but I just wanted to add a little bit. A great starting point
    to writing good code would be the Getting Started with NI-DAQmx: Main Page,
    as well as the shipping examples (In LabVIEW, Help » Find Examples) already
    mentioned.
    If you navigate a bit
    through the links (Basic Programming with NI-DAQmx » Getting Started with NI-DAQmx
    Programming in LabVIEW) you’ll end up with some great resources. I recommend Learn
    10 Functions in NI-DAQmx and Handle 80% of your Data Acquisition Applications.
    It will detail many of the functions you can use and give you a feel for proper
    code style in LabVIEW.
    I hope that helps.
    Mark E.
    Precision DC Product Support Engineer
    National Instruments
    Digital Multimeters (DMMs) and LCR Meters
    Programmable Power Supplies and Source Measure Units

  • Need a sample cme with multiple fxo ports, hunt fashion

    hi,
    anyone kind enough to provide a sample working configuration of multiple fxo ports (each being a pstn line) and I assuming the telco is doing hunting...
    so let's say 4 lines, if line 1 is busy the call is sent by the telco on line 2 and so on...
    incoming and outgoing.
    thank you very much!!                  
    I did google it and can't find anything with multiple fxo ports.

    trunk group 1
    max-calls voice 4 (or however many POTS lines you want to use)
    hunt-scheme round-robin (or whatever method you like)
    voice-port 0/0/0
    trunk-group 1
    connection plar opx XXXX (extension)
    caller-id enable
    voice-port 0/0/1
    trunk-group 1
    connection plar opx XXXX
    caller-id enable
    voice-port 0/0/2
    trunk-group 1
    connection plar opx XXXX
    caller-id enable
    voice-port 0/0/3
    trunk-group 1
    connection plar opx XXXX
    caller-id enable
    dial-peer voice 1 pots ( I like creating this for troubleshooting, by default cisco router accept incoming calls)
    trunkgroup 1
    incoming called-number .
    direct-inward-dial
    dial-peer voice 2 pots
    trunkgroup 1
    destination-pattern 8[2-9]......           (8 for an outside line or 9 or nothing, then adjust your forward-digits to match)
    forward-digits 7
    dial-peer voice 3 pots
    trunkgroup 1
    destination-pattern 81[2-9]..[2-9]......
    forward-digits 11
    dial-peer voice 4 pots
    trunkgroup 1
    destination-pattern 8911
    forward-digits 3
    dial-peer voice 5 pots
    trunkgroup 1
    destination-pattern 911
    forward-digits 3

  • What is wrong with this (timed loop error)?

    I can't figure out why the timed loop is not starting and I receive an error -805 message. Any idea?
    Thanks,
    Ben64

    Hi Ben64,
    There's no obvious problem.
    I tried the same and it works perfect.
    So there must be a problem under the cover.
    I have 2 suggestions.
    1) There is a problem with your wiring -> the Error wire is not connected to the loops error out -> close timing source is executed before the loop is executed (Are you sure the loop doesn't even start ?)
    2) Labview often uses Names to identify items (queues, images, semaphores,..... timing sources(?) )
    I tried to open and close another timing source with the same name.
    Et voila : I'm able to get exactly the error code you mentioned.
    Is it possible you use the same name for a second timing source and this one is closed prior to executing the timed loop you've got problems with ?
    Best regards,
    Balze
    Attachments:
    timed_loop_2010.vi ‏37 KB

  • How can I continuous​ly streaming data to disk with 1MHz sampling rate with PCI 6110?

    I can only save 3 seconds data with 1MHz sampling rate using PCI 6110. Is it possible to continuously save longer time data (say 1 minute)?
    Many thanks

    if the binary file is big the ASCII file is very very very big.
    1 measurement is coded in a I16 => 2Bytes ( 4bit is not used 611X is 12bit
    card)
    if you use +/-1V range the quantum is (2 * 1V) / 4096 = 0.0004883V or 0.4883
    mV you need to use 8 digits minimum.
    And If your binary file is 1 Mo your ASCII file is 4 Mo.
    You can use this VI for inpiration you need to add the translate I16 to DBl
    to make a real value before saving.
    For Help you can mail inthe newsGroup.
    I'am a french user and my english is not good Sorry..
    Fabien Palencia
    Ingenieur d'etude ICMCB CNRS
    "StephenZhou" a ?crit dans le message de news:
    506500000005000000A5AF0000-1031838699000@exchange.​ni.com...
    > Hi, Fabien Palencia
    >
    > The program is great.
    Do you happen to know how to convert the big
    > binary file to ascii file? Thanks
    [Attachment recup data I16.vi, see below]
    Attachments:
    recup_data_I16.vi ‏57 KB

  • FMLE won't let me set the sample rate with Blackmagic Decklink Studio 2 (Windows)

    Hi,
    I am trying to set the audio device on FMLE to the Decklink Studio 2's audio inputs. However,
    the sample rate sticks to 44.1k and I can't change it to the 48kHz sample rate that
    the Decklink defaults to (standard for broadcast is 48k).
    Try as I may, it isn't changeable. I seem to remember a similar problem where the
    sample rate defaults to the system audio card (on the motherboard) which is at
    44.1.
      Any ideas on a work-around? The audio from the Decklink is *much* better than
    the built in card.....
    thanks
    jeff

    One thing you might try doing is trashing the preference file in your user directory:
    ~/Library/Preferences/com.apple.compressor.Compressor.plist
    Like repairing permissions, this is a bit of a "catch-all" fix, not something specific to this particular problem.
    Also, have you tried different file types like: TIFF or JPEG, there could be an issue with output from Fireworks. You could use QT Pro to transcode the file. Sometimes that can work to fix funky problems.
    Does the Text Overlay filter work?
    BG

  • Error Msg.: "Inconsistent Audio Sample Rate" with Flip4Mac

    If you're using Flip4Mac to produce WMV files, the latest QT updates will create a conflict with Flip4Mac, which produces the error msg. referenced in the subj. heading above.
    If you're using Flip4Mac, you may want to wait until Telestream resolves the issue before upgrading QT.
    More info is here: http://www.flip4mac.com/knowledge/kb_0070.htm
    and here: http://forum.flip4mac.com/forum/messageview.aspx?catid=10&threadid=270&enterthre ad=y
    MacPro, MBP 17in (2 GB RAM), PB G4 15in, PB G4 12in, iMac G3   Mac OS X (10.4.9)   Loyal to Apple since the Apple ][+

    Just in from flip4mac support:
    The recent release of QuickTime 7.2 created an audio compression error for Flip4Mac WMV Studio, Studio Pro and Studio Pro HD customers. Specifically, when encoding WMV files with Flip4Mac WMV v.2.1.2 using uncompressed audio sources on QuickTime 7.2 systems, customers were receiving "Inconsistent Audio Sample Rate" error and the encode will fail. This problem has been resolved with the beta release of Flip4Mac WMV v2.1.33. If you are using QuickTime 7.2, please upgrade to this release at http://www.flip4mac.com/wmv_beta.htm

  • Limited sampling rate

    Hi,
    I've got a VI that reads in analog inputs. The DAQ device I'm using is a PCI 6229. I believe that the max. sampling rate of this device is 250kS/s. So, if I were were to take inputs from 16 channels I thought I could enter a sampling rate of 15kS/s (since 250/16 > 15) . However, when I look at my output data, I can find that the sampling rate was actually 14925 S/s not 15000 S/s which I entered.
    When I enter a sampling rate of, say, 14kS/s the data shows that it's actually 14kS/s. So I'm wondering whether the maximum limit of my sampling rate is around 14.9kS/s and not 15kS/s.
    Cheers.

    It didn't produce any error messages when I ran it with 16 input channels and 15kS/s sampling rate (all my input channels were at RSE). I'm just confused as to why the sampling rate on the output file is shown to be 14.9kS/s. I just ran it with 1 channel and 250kS/s sampling rate and the output file did show that the sampling rate was in fact 250kS/s. I've attached my VI for you to have a look.
    Probably different to my original question; I've used an example shipped with NI for some analog output, and I'm not sure what a particular function of it used for. I've attached a picture of it here as well (the part which I don't understand circled). 
    Attachments:
    multichannel_daq3.vi ‏303 KB
    example.PNG ‏6 KB

  • How to sync. 50Hz sample rate with 5Hz external digital trigger signal?

    Hello there,
    I want to sample an analog input at 50Hz, where I further want to use
    the 5Hz PPS signal of a GPS receiver as an external trigger/clock
    signal for the NI DAQ USB-6008 device. However, I do not want to read
    10 samples every 200ms (= 50Hz avg. sample rate), but I want to read 1
    sample every 20ms, i.e. with "real" 50Hz.
    The "natural" way, it seems would be to use a task that waits for a
    rising edge on the ext. trigger input, then reads 10 samples, then
    waits for the next trigger edge, and so on.
    However, it seems that with this approach I cannot read the data from
    the DAQ with real 50Hz, further it seems that every 10 samples the task
    needs to be restarted, which takes longer than the 20ms (corresponding
    to the 50Hz target sample rate).
    I hope the problem description is clear enough....
    Thank you in advance for any advice.
    Regards,
    Oliver

    You have to use the counter together with the analog input to achive this. You could configure the counter to generate 10 pulses with 50 Hz whenever the counter sees a rising edge on the inpput of the counter. The output of the counter would be used as the external clock for the analog input.

  • Write to XML File crashes when multiple Timed Loops present

    Hello All,
    It took me forever to track this bug down.
    In this project we can edit operating parameters on the Host and send them down to an RT program in a cRIO-9025. The data is converted to XML and stored on the cRIO's disk.
    Occasionally, the RT program would lock up and had to be rebooted.
    It turns out that if you use Timed Loops , then a Write to XML File (or presumably any file write) will not return.
    Attached is an example. This has 5 loops to make it crash faster, but it will eventually crash with only 2.
    Paul J
    Attachments:
    XML Write test.vi ‏93 KB

    Hello Chris,
    I know that Write to XML File fails because I put in debug code in my actual program, a flat sequence which updated an indicator, and after the crash, the indicator had not updated.
    Yes, I know that it replaces the file. It's a configuration file, not data gathering. This is just an example of the bug.
    FYI,
    I increased the period for the loop with the file save to 500msecs and it still crashed.
    I then decreased it to 50 msecs, and replaced all of the other Timed loops with While loops and it does not crash, even though the file save takes much longer than 50 msecs, average ~150msecs.
    I replaced the loop with the file save with a While loop while leaving the others as Timed loops and it does not crash.
    So the bug is systemic and related to a file save in a Timed Loop when there are other Timed Loops.
    I'm not looking for a solution, I'm only reporting a bug in Labview. The solution is not to use Timed Loops, especially, as you point out, when there is file saving. It cost me several days of dicking around to figure it out. Maybe someone can save some time if they find this.
    Paul J

  • Multiple timed loop question

    I am currently in the planning stage of a medium sized labview application and I need some help figuring out the best approach as application of this size is still new territory for me.
    I have a daq device monitoring 4 channels, a couple of motor controls, and the goal is to update the GUI with the information from the 4 channels, and also calculations performed on that information, all while letting the user control the motors in real time. All actions and data will be logged and written to disc preferrably in real time.
    The plan so far is of course to beak them up into subVI's, with the motor controls in 1 subVI, and the monitoring in 1 subVI, calculation performed on the data in another subVI, and a main driver VI that controls the timing of the loops and updates the GUI.
    I initially thought about using action engines for the data acquisitions, but I realized that using action engines might "freeze" the program when data acquisition is happening, and the user will lose control of the motors. Another approach is the producer/consumer pattern, where the incoming data from the DAQ is consumed to perform calculations and the data logged onto disc. This is the approach that I think I will take, but how do I implement the real time motor controls into this pattern?
    The idea that I have is to have a main program state machine that handles all user input, and parallel loops that implement the producer/consumer model, and another parallel loop that will update the motor information when it is changing. Is this a suitable approach for an application of this type? Would a queue help the timing aspect in between the parallel loops? As calculations must be performed on each iteration and updated to the gui before the next data point is acquired, at the speed of 100hz. I am having trouble visualizing how to implement multiple loops in separate subVI's and synchronizing the data in between each other.
    Please advice if there are other better patterns/approach for something like this.
    Thank you.

    Producer consumer would fit here well. You will also need to use a state machine system for flow control. I would also look into event structures and firing events. If you put all of this together it will make a nice simple upgradable program. This is a system that I helped somone else start.
    Tim
    Johnson Controls
    Holland Michigan
    Attachments:
    Try This System.zip ‏84 KB

  • Multiple timed loops in RT interface- initialization, communication

    Problem Description :
    I am attempting to deploy an adaptive control system using cRIO. I have an NI
    9505 that controls a motor, and triggers other part of the machine to produce
    data. I get data in my control loop and perform on-line estimation (currently)
    using RLS estimator.
    I have two-fold trouble
    1> My Motor control and data acquisition is on one FPGA VIs and data filtering  
    and Estimation algorthon is on the other FPGA VI. I am supposed to call both of
    the FPGAs in my RT interface VI with necessary operations.
    Problem 1: How to simultaneously call two FPGA VIs in separate timed/while
    loops in my interface VI?
    2> Note that these two loops are supposed to talk with each other, once
    estimation VI produces new coefficients, they are to be fed back to control VI,
    I am not sure how to perform this.
    It's kind of time critical that I accomplish this , Please help.
    Thanks,
    NI Software :  LabVIEW Professional Development System  version
    NI Hardware :  CompactRIO device 

    Because of the nature of FPGA, you can’t call two FPGA VIs at the same time. When you call an FPGA VI, you load up an FPGA bit file and physically reconfigure the FPGA chip. The FPGA chip can only be configured for one bit file at a time, so simultaneously calling two files at once will not be possible. If you need to perform functions from both VIs simultaneously, you could try combining them into one master VI that contains the functionality of both VIs. You could then pass information to and from each RT loop to the appropriate section of FPGA code. Keep in mind that FPGAs are a finite resource, so you’ll need to make sure that this new larger FPGA VI still fits on your chip.
    Hope this helps answer your questions!

Maybe you are looking for

  • Want to clear images out of Aperture and start over

    Probably a dumb question, but I "played" around with Aperture-- imported some images etc and even have a couple of projects. However, after doing some study-- listening to tutorials I would like to start over. How can I clear everything out without l

  • How does one get that apple sign onto my twitter handle?

    Hi, I would like to add the Apple sign onto my twitter handle, how do I do it? Thanks

  • Tick mark in Appleworks documents

    Does anyone know how to put a tick mark into either a word processing document or a spread sheet box? I might be being dim here, but I can't find a tcik sign anywhere! (I mean like when you tick a box!) Thanks

  • Second Attempt to find 6.5.4.2

    I attempting to find a version of 6.5.4.2 Server and Client Please advise

  • Router requires resetting every few days

    If I dont reset my homehub3 ever few days my internet, tv(wired) apps (iplayer,bbc news) become painfully slow or unusable, but as soon as I press reset and the router has finished resetting all is fine for another few days to a week. Sometimes pages