Use the LabView time delay in a while loop instead of using the instrument inherent time loop.

I have a zes lmg500 that I use. It has the option of continues measuring data, with a user control cycle loop (still using a while loop but the delay is coming from the instrument). The problem is that the loop time is not constant. Can I use a very short time (100ms) as the instrument cycle time but use a longer time delay in the while loop that collect the data?
I know many instrument offer the same abilities, so the question is relevant to all of them.
Thanks for any help
Solved!
Go to Solution.

Does that measurement VI have built-in wait functionality and a timeout?
If not, then you are simply polling the VI at 1 kHz, but I suspect that this is not the case or your Waveform Chart probably wouldn't look as you expect (getting 0's put in everytime measurement data is not available).
I expect that if you have the instrument set up to send data at a fixed time interval (i.e. 100 ms), all the data that it is sending you will end up residing in your serial buffer (or the instrument driver will have taken it out and put it in another internal buffer), so if you come back to read it 1 sec later, then you will have 10 data points to go through.  Whether you can read them all at once with the read VI or have to call it a whole bunch of times until empty I can't say.
What is your objective?

Similar Messages

  • Time delay separate to while loop

    How would I be able to obtain data (pressure read in by DAQmx) that happened 2 seconds previous?
    I need to obtain the pressure difference from 2 seconds ago hence need the previous pressure with a 2 second time delay. When I try and do this the whole program delays by 2 seconds, even when I try separate the time delay through use of another time loop. 
    Any suggestions?

  • How to stop execution in while loop without stopping execution of other loops in the same vi

    HI
    I am quite a novice in Labview.
    I have a problem in my project. I used a while loop inside my vi to build an array of ten values along with other loops. Then I used a stop button to stop manually the while loop. But it seems like the loop doesn't stop in the middle of the array building and so other loops in the vi doesn't work until the while loop finishes building the array and as soon as while loop execution is over, the complete vi stops. But all that I wanted was to build the array using the shift register along with the control to stop building array anytime. And not to stop execution of other structures when the while loop finishes.
    Can anyone help me?
    Rahul

    Hi Rahul,
    Modified ur Vi to work with single button.
    But the subtract case is not in any loop.
    So, once both the loops stop, the subtract case will execute only once. Depending on state of subtaract boolean at that time, corresponding case will be executed and the Vi will stop.
    so think of a logic where u can put this also in a new loop.
    Or you can also incorporate it in one of the two loops and pass the other loop's data to it.
    Let us know how you will proceed in this regard
    I am posting your VI as well a VI with my modifications VI in Labview 7.0 so that Thomas can give his suggestions too
    Plus, always keep a time delay in your while loops.
    Oh sorry, the "arrayinouttestnewfinal.vi" is the modified vi
    Regards
    Dev
    Message Edited by devchander on 01-10-2006 06:15 AM
    Message Edited by devchander on 01-10-2006 06:19 AM
    Attachments:
    arrayinouttestnewfinalnew4.vi ‏59 KB
    arrayinouttestnewfinal.vi ‏63 KB

  • Multiple DAQ Cards, Multiple While Loops

    I'm writing a code to support 3 small test stands that each have the same outputs and inputs as the others. I'm running them all off of an 8-slot DAQ. Each test stand has its own dedicated RTD Card and Analog Out card, but they all share a 32-channel Analog Input card.
    I'd like to decouple the 3 test stands as much as possible - if I have to take out an RTD card or Analog Output card, I don't want the entire LabVIEW program to stop running. I want to be able to keep running and logging data on the other two test stands if I were working on the other test stand. Is there a way to do this with only 1 cDAQ? Is it simply a matter of creating separate, independent while loops for each test stand? If so, would LabVIEW have issues with each while loop writing its own measurement file in parallel with the others?
    Thank You.

    Is it safe to assume you've been running the three tests?  Some of your post makes it sound like you've run them coupled while other parts make it sound like you haven't successfully had all three tests running simultaneously.
    If you aren't running them, are you using hardware timing (counters) for your tasks?  If you're looking to use counters, you're only using one per task, correct?  The cDAQ will only have four counters total to be shared between your loops.
    I can't remember off the top of my head if it is the task or the computer that reserves a cDAQ chassis.  I want to say it's the computer so you can run multiple tasks from the same cDAQ.  But, you'd still need to choose ctr0, ctr1, ctr2, etc in each task so that you don't share these resources between tasks.
    Are you looking to pull the shared module out frequently?  If not, are you gaining enough functionality to justify buying two redundant modules to gain decoupling?

  • Sir i am using datasocket read ,i am communicating with java but my problem is that bcz im using while loop to see if value has changed my labview consumes all the processors time ,sir i want a event like thing so that while loop is not in continuous loop

    sir i have given lot of effort but i am not able to solve my problem either with notifiers or with occurence fn,probably i do not know how to use these synchronisation tools.

    sir i am using datasocket read ,i am communicating with java but my problem is that bcz im using while loop to see if value has changed my labview consumes all the processors time ,sir i want a event like thing so that while loop is not in continuous loopHi Sam,
    I want to pass along a couple of tips that will get you more and better response on this list.
    1) There is an un-written rule that says more "stars" is better than just one star. Giving a one star rating will probably eliminate that responder from individuals that are willing to anser your question.
    2) If someone gives you an answer that meets your needs, reply to that answer and say that it worked.
    3) If someone suggests that you look at an example, DO IT! LV comes with a wonderful set of examples that demonstate almost all of the core functionality of LV. Familiarity with all of the LV examples will get you through about 80% of the Certified LabVIEW Developer exam.
    4) If you have a question first search the examples for something tha
    t may help you. If you can not find an example that is exactly what you want, find one that is close and post a question along the lines of "I want to do something similar to example X, how can I modify it to do Y".
    5) Some of the greatest LabVIEW minds offer there services and advice for free on this exchange. If you treat them good, they can get you through almost every challenge that can be encountered in LV.
    6) If English is not your native language, post your question in the language you favor. There is probably someone around that can help. "We're big, we're bad, we're international!"
    Trying to help,
    Welcome to the forum!
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Stopping a while loop using the time difference of two tick counts

    Hi Guys,
    I'm currently writing a code which test how long does it take for a formula node to perform its operation. The program uses a while loop to perform the calculation, and the program stops after calculating when tick count has reached 10 seconds. The program then displays the number of iterations it does in 10 seconds. 
    So initially I created 2 frames of sequence structure. In my first frame I have my initial tick count, and in my second frame I have my final tick count and the while loop. I used the subtract function and divide the output by 1000 to get the time difference. Then using the comparison function, I set if output > 10 then the program should stop, to do this I linked the output of the comparison function to the stop button inside the while loop. 
    However, when I tried to run the code, the program just didn't run. Hence I created a similar program which puts the last tick count in new frame sequence. When I ran this code, the program never stopped. 
    Do you guys have any idea what went wrong with my codes.
    Thank you!
    Erry
    Solved!
    Go to Solution.
    Attachments:
    1. Tick Count.vi ‏27 KB
    tickcoun2.vi ‏27 KB

    Dataflow!
    In both VI's the stop terminal of the while loop is controlled by a boolean whose source is ouside of the while loop.  So that loop will either run once, or run forever, depending on the value of the boolean that is calculated before the loop starts and shows up at the tunnel going into the loop.
    I would recommend looking at the online LabVIEW tutorials
    LabVIEW Introduction Course - Three Hours
    LabVIEW Introduction Course - Six Hours

  • Why writes LabVIEW only every 2 seconds the measured Value to a Excel (In a while loop with 100 ms tact)?

    Hi everybody,
    I use the myDAQ to measure speed, ampere, and voltage of a battery driven motor. (For Current measurement, i use a Sensor which outputs a 0-10 V signal). I placed all DAQ-Assitants in a while loop with a [Wait until next ms multiple] clock and set a value of 100 ms. I thougt, Labview will now write into my text file 10 times a second all values. In fact, as you can see in the attached text file, Labview only writes in a unsteady interval of 1-2 seconds a value, which is too less.
    The question: Did I do anything wrong, how can you create VI that writes you lets say 10 values a second into text file? Or is simply the DigitalMultimeter input of the myDAQ not able to sample a rate of 10 Hz? I couldn´t find any information in the specification handbook about the sample rate of the DMM?
    If anyone can help me would be great! Thanx a lot, Markus
    Attachments:
    Measure Speed+Current+Voltage into Excel.vi ‏175 KB
    Test7.txt ‏1 KB

    File I/O is not very efficient. I recommend that you do you file logging in a parallel task. Have one task do your data acquision. This task would then pass the data to be logged to the logging task via a queue. That way your file operations do not impact your data acquision. Also, express VIs are not very efficient. You would be better off accessing that directly using the DAQ VIs. The express VIs contain lots of steps that do not need to be done every time you call it such as initializing the device.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • How can I build a table with the time values of a timer from a while loop

    Hi:
    I have a question concerning building a table:
    Every 100ms I read a value from a sensor (while loop with a timer). I would like to build a table with the actual time and the concerning value. For example:
    0msec         1V
    100msec     2V
    200msec     3V
    300msec     4V
    etc.
    If I use the Express VI for building a table, I always get the date and time, but I don't need the date and the time is in the following format: HH:MMS, which is nonsensical for me as I can't differentiate within msec. Can I change the format anywhere?
    Can I also save the table to a file or even to an Excelsheet? How can I do that?
    Thanks for your help!

    Hi Craig:
    thank you very much. To solve the mystery : ) :
    I want to drive a stepper motor with a specific frequency. To get the current degree value of the motor I would like to measure the current time (from the beginning of the move on). (With a formula I get the degree value out of the time)
    Concurrently I would like to get data from a torque sensor and from a pressure sensor. That's why I asked you about the time and the table. The measurement should start with the movement of the motor. How can I do that? Right now I have different block diagrams (different while loops) (see attachment) and I would like to put them in one.
    I haven't done the block diagram for the pressure sensor yet, so there is only the one for the torque sensor and the one for the motor.
    I also would like to set a mark in the table when the voltage value of an analog input gets under a specific threshold value. Is that possible?
    I'm sorry, I'm a novice in LabVIEW. But maybe you can help me.
    Thank you very much!
    Steffi
    Attachments:
    motor.vi ‏238 KB
    sensor.vi ‏59 KB

  • How can I put a time delay between specific events in a while loop?

    How can I put a time delay between specific events within the same while loop? I'm already using the "wait" command to control the overall loop iteration speed. But I want to time the individual events as well.

    Hi Jesse,
    You can use a flat sequence. In each box you can put your individual events and attached wait.
    Don't forget to reduce your total loop time of the time you added in the individual sequences.
    Doc-Doc
    Doc-Doc
    http://www.machinevision.ch
    http://visionindustrielle.ch
    Please take time to rate this answer

  • How to make the exchange of data between 2 while loop in real time

    hello
    I have 2 while loop
    the 1st while loop includes the data acquisition program
    the 2nd while loop includes the control program
    my question is how to make the exchange of data between 2 while loop in real time
    I tried with the local variable and direct wiring between the 2 while loop
    it does not work (there is a delay)
    Solved!
    Go to Solution.

    Bilalus,
    Queues are only good to transfer data if your application isn't deterministic. Since you are using Real Time, I am assuming that your application requires determinism. If you are using Timed Loops and you use queues to transfer data between your loops, you are losing determinism. In this case, you need to use the RT FIFO functions. 
    Warm Regards,
    William Fernandez
    Applications Engineering
    National Instruments

  • How to stop a while loop after certain time using Elapsed time vi

    how to stop a while loop after certain time using Elapsed time vi.

    Hi Frankie,
    Just place the Elapsed Time VI inside the WHILE loop, and wire the 'Time Has Elapsed' output to the conditional terminal in the lower right corner (which should be set to 'stop if true' by default).
    In the future, please post your LabVIEW questions to the LabVIEW Forum.  You have a much better chance of getting your questions answered sooner, and those answers can then help others who are searching the LabVIEW forums.  Thanks!
    Justin M
    National Instruments

  • Using the Wait function in while loops?

    Hi,
    I have a rather complicated top level VI with about 20 subVIs and the main VI has on big while loop around it and another smaller one inside, basically it runs rather slow and I have no idea how to set the wait function. I mean what factors should I consider..what would be the difference between setting it to 10 and 100 (besides the obvious 10ms vs 100ms)? I just want to increase the performance of the executable, so it is not that slow. Can you offer some hints as to what I need to take into consideration when determining my delay? And also, are while loops the only place that I should use the delay or are there other instances too?

    Adding waits is not a fix-all for slow running applications. Its just one thing that can be done to improve things. If you determine that a sub-vi is causing your problems then you need to find out exactly what that vi is doing to slow you down. If its because there is a loop inside it that is running constantly as fast as it can, then a delay in that loop may help. If that is not your problem then you need to look at other ways to boost performance. It sounds like you have alot of locals variables, each instance of a local variable makes a copy of the data that's in the control. If the controls/indicators that you have local variables of contain large amounts of data then you may be filling up memor
    y with copies of it.
    I suggest that you study the "Performance and Memory Management" chapter of the LabVIEW manual. This can found in the printed manual of the older versions, in the online manuals that install with 6i, or on NI's web site here: http://zone.ni.com/devzone/conceptd.nsf/2d17d611efb58b22862567a9006ffe76/732cec772aa4fbe586256a37005541d3?OpenDocument , which is Application Note 168. This should give you some good ideas of what to look for to improve your performance.
    Hope this helps.
    Brian

  • Wait time in while loop: wait before all other code in the loop runs

    My vi is attached. 
    In the 'Check for Equilib' case, there is a while loop that takes data from a pressure gauge and compares it against data taken equilibTime seconds previous.  equilibTime is hooked up to a wait(ms) function inside the while loop.  Currently it appears that the code in the loop runs, and then the loop waits so many seconds before the next iteration.  I would like to reverse this process, i.e. in each iteration, the loop will wait so many seconds and then run the rest of the code in the loop.  I want to do this because I don't want there to be any delay between then time the 'check for equilib' code finishes and the start of the 'add shot' case.
    Can anybody suggest an elegant way of implementing this?
    Thank you
    Attachments:
    Take Isotherm.vi ‏294 KB

    No.  Use Flat sequences they are far preferable to stacked sequences.  Functionally they are the same.  But a flat sequence is easier to read, doesn't hide code, and you don't have to worry about backwards wiring caused by sequence locals in stacked sequence.
    Note, you have two oddities in your lower while loop.
    1.  Write a value to an indicator's terminal node and to a local variable of the same indicator is pointless.  They do the same thing.
    2.  Reading from a local variable of an indicator and writing to its terminal node is just as pointless, as you aren't doing anything.
    In your middle loop "Add shot" case, you have the local variable of DC estimate righting to a right hand side shift register, but you never use the left hand shift register.  So you are saving that value for future loop iterations, but never use it.

  • Labview as the active window disables 1 or 2 concurrent while loops

    I am trying to get familiar with new mutltifunction DAQ hardware from IOtech - a DAQborad/2000.
    I have a simple vi consisting of two while loops which should be running in parallel. One acquires analog input data, the other handles DAC outputs.
    When I run the vi, the analog acquisition while loop runs fine, but the DAC while loop will not run if labview is the active window on the pc (frontpanel or diagram). If I make another window active, both loops will update as they should.
    I can resize a windows explorer window to make it small, run my vi, make windows explorer the active window and see the vi running both loops and updating as it should in the background. If I use the "Highlight Executi
    on" tool on the diagram screen, both loops run as they should.
    Any ideas?
    Thanks,
    Mike

    > I am trying to get familiar with new mutltifunction DAQ hardware from
    > IOtech - a DAQborad/2000.
    >
    Many third party drivers default to running in LV's UI thread, and if
    they put the thread to sleep, other LV threads can run, but not the UI.
    It is also possible that one of the loops is hogging while the other
    is being starved.
    So, I've got two suggestions to try. First try putting a delay of a few
    ms in the busy loop. This might help with the starvation. The second
    thing to try is to open up the IOTech VI and try setting the DLL node to
    be reentrant. This will allow the node to run in any thread and not
    force it into the UI thread. Beware that if the DLL isn't threadsafe,
    this could lead to data corruption or crashes, and before leaving it s
    et
    this way, you should probably contact IOTech to see if their DLL is
    threadsafe. If it is not, contact NI tech support and they can help you
    determine if it is safe in this case to leave it running in other threads.
    Greg McKaskle

  • How to calculate the ratio between the maximum and minimum peaks of the two waves using two while loops?

    hello everyone,
    i'm rai from indonesia
    I have a final project about pulse oximetriy, I have some problems,
    how to calculate the ratio between the maximum and minimum peaks of the two waves using two while loops to calculate SpO2 ?
    My program image can be seen below predicament ?
    Attachments:
    spo2 akusisi data with filter lpf hpf smoot nilai max min ir merah.vi ‏249 KB

    Hi Rai,
    You should post this into the LabVIEW forum rather than Real-Time since this isn't a Real-Time application. Your post will see more replies in the LabVIEW forum. 
    As far as your question is concerned, you can write the max and min from the respective loops to a local variable to send the data out of the loops to a third loop or just do the calculation in one of the loops. This would be ideal if you're trying to do this while the loop is running. 
    -Jayk
    Applications Engineering
    National Instruments

Maybe you are looking for

  • Error While Generating AWR reports

    Hi All, I am new to Oracle 10g. Whenever I try to run the AWR report using awrrpt.sql script I am getting below error messages. I am running this script as SYS user. Please help to generate the AWR reports. Thanks for the help in advance. Specify the

  • Web pages are not saving and loading correctly

    I recently designed my website, www.gregknightrolfing.com. When I first put it together I gave it a certain look, then changed it and made the changes on every page. But when I publish the website and upload it to the web, two of my pages (http://www

  • Today smart folder showing old email attachments

    Hi, The "today" smart folder is very useful. But IMAP mail periodically decides to revisit every message it has ever seen, which apparently gives them all "today" tags according to the finder. So, just now my "today" folder contains 1,482 items (most

  • I can't import my video from panasonic g3 into aperture

    I can't see my video appearing in Aperture from my importing window. I tried importing from a memory card.

  • Authentication Keys

    Hi expert, somebody know how i can put Authentication Keys in receiver soap adapter? thanks for all.