From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Timer counter for calculating amount of dispensed liquid

Solved!
Go to solution

I have simple program to control VICI pump over serial interface.

The problem for me is that I need to see amount of dispensed liquid. I have based it on "elapsed time" express vi.

But unfortunately it does not work the way I need. When I press pump start it starts to count time and as a result volume of liquid. When I press stop the volume stops but when I press Start pump again it continues the volume not from the moment I stopped but considering all the time elapsed since the first start.

I know that it is because Elapsed Time is still running. I could not find the way to Pause it.

 

Is there a way around it?

I am using LabView 8.6.

0 Kudos
Message 1 of 5
(2,405 Views)
Solution
Accepted by topic author Sergey(PSU)

Sergey,

 

When you press Stop, the VI stops running. Are your referring to setting the Run switch to False?

 

I would put the volume (Injected ml?) on a shift register and add to it the amount dispensed in each iteration.  The calculation would still be based on time, but incremental time rather than total elapsed time.  

 

I do not think there is any direct way to pause the Elapsed Time.vi. You could store the difference between Target Time and Elapsed time in a shift register when you enter the pause mode and then use that difference as the new Target Time when you restart.

 

Lynn

Message 2 of 5
(2,392 Views)

I did take a look at the shift registersounds interesting but could not find the way to insert it. It requires For or While loop. I have tried to use While loop but it stops Run button operation(as soon as I press run could not stop it(pause) or stop the program). Prbably it is something very simple but as I am programming from time to time  I have not enough experience to solve it myself.

0 Kudos
Message 3 of 5
(2,348 Views)

@Sergey(PSU) wrote:

...The problem for me is that I need to see amount of dispensed liquid....


 

Spoiler
INJECT.png

 

0 Kudos
Message 4 of 5
(2,335 Views)

Sergey,

 

What apok showed is the basic idea.

 

You really need to convert your architecture to a state machine to allow the Pause mode.  It will be tricky and complicated to do it with your present structure.

 

Lynn

0 Kudos
Message 5 of 5
(2,329 Views)