Jump to content

jimiweber

Members
  • Posts

    2
  • Joined

  • Last visited

Posts posted by jimiweber

  1. 1 hour ago, LogMAN said:

    Welcome to LAVA! :beer_mug:

    Thank you :thumbup1:

    1 hour ago, LogMAN said:

    The short answer to this is: You cannot do time constrained operations (within the millisecond area) using a regular PC. Other processes will "steal" CPU time which can put your program on halt for several milliseconds (up to several hundreds), so the timing is not predictable within your constraint. However do you really need to calculate a value every millisecond?

    Yes, as a matter of fact, it is important to add numbers exactly every one seconds.

    Your solution actually worked. It's consuming exactly the amount of time that is expected. I attached the edited file for future references.

    1 hour ago, LogMAN said:

    One recommendation after reading your VIs: Please make use of controls / indicators before using local variables. It makes your code much more readable and removes unnecessary complexity.

    These files were just temporary files to test the idea, but thanks again for noticing :D

    Volume Dispense.vi

  2. Hi everyone,

    I couldn't phrase my question with proper search keywords to make sure whether this has been asked before or not, sorry if this is something which was discussed before.

    What I try to do is add a constant number to a value, exactly every 1 milliseconds. The target is simple. It should be a dispense counter, that calculates how much is dispensed in loop iterations. So, for example, if the dispensed rate is 0.001 mL for every 1 ms, it should take 1 second to dispense 1mL.

    I tried using a while loop with "wait until next ms multiple" delay to do this. Two different approaches I tried are 1. simple method, two variables, one for rate and one for dispensed. They are accumulated in every while loop iteration, and 2. using a shift register to avoid using numeric constants and local variables.

    The elapsed time for both ways are calculated using flat sequence and "tick count". Both files are attached.

    However, none of the two are working as I expect. They both take more than 1 second to do the job. Plus, they are dependent on computer processing power, which I don't want. What is a better way to do this? I am fairly new to labview programming, and maybe some insight might help a lot.

    My laptop has Core-i5, 8gbs of ram, Windows 10 64bits, and Labview 2014.

    Thanks

    Volume Dispense-SR.vi

    Volume Dispense.vi

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.