LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to find pump operating cost using control and simulation loop

Hi everyone need little help plz... 

I want to find operating cost of pump from the below formula

Operating cost = (power, kW) × (Hours of operation, h)

× (Price of electricity, Rs/kWh)

 

I have done the simulation in control & simulation loop. I am unable to find hours/minutes/sec of operation of my pump. I have attached the simple VI (LabVIEW) and also screen shot.pump enrgy fing.png

I just manually on off the pump by Boolean control. I want to find the on time of pump so that i will able to find power and accordingly operating cost.

 

0 Kudos
Message 1 of 6
(2,658 Views)

I don't know how the control and simulation loop fits into this.

 

But if you want to keep track of total run time, you need to have a shift register that adds the time every loop iteration that the pump is on, and does nothing when the pump is off.  That will accumulate total run time, (and with math, total cost.)

0 Kudos
Message 2 of 6
(2,648 Views)

Sometimes it helps to forget LabVIEW, forget Programming, and think Logic.  Let's say the Program Starts, and there is a button that, when you push it, stops the Program.  Let's say there is a button that when pushed, turns the pump On (if off) or Off (if On).

 

What do you need to know before you start?  Pump Running Time = 0, Stop Button = Off, Pump Button = Off.

What can happen during the Run?  You can push Run Pump (turning it On or Off) or push Stop.

  • Push Run to turn On:  Record the time the Pump starts.
  • Push Run to turn Off:  Record the time the Pump stops, subtract Start Time to get Run Time, add to Pump Running Time.
  • Push Stop:
    • If Pump is running, pretend you are turning it off, and do a final calculation of Run Time, adding it to Pump Running Time.
    • Exit the Program, returning the Pump Running Time and doing any final calculations to get cost.

Do you know anything about LabVIEW Events, and how an Event Loop runs?  For a problem like this, when absolutely nothing happens when buttons aren't being pushed, you don't need to waste CPU cycles doing any "Wait" or other timing, you just need to sleep until someone pushes one of the two Buttons.  An Event Loop is ideal for a simple task such as this.

 

Use Shift Registers to save "variables" (like when the Pump is turned on, and the evolving Pump Running Time) that get modified when particular "Events" happen.

 

Bob Schor

 

@RavensFan -- check your Private Messages, please.

0 Kudos
Message 3 of 6
(2,582 Views)

thanks for kind reply ... i just write dummy code...i have done much more complicated simulation that is not possible in simple 'for' or 'while' etc loop as that have integraters and MPC controller and much more. all the simulations are complete and pumping model and control is also done.

Now simply i just need its cost calculation. if I am able to find time of this dummy VI than i will feed it in my final VI.  

I JUST NEED  SOMEONE WHO DO AMENDMENT IN MY ATTACHED VI AND GIVE ME THE ON TIME OF MY PUMP 

0 Kudos
Message 4 of 6
(2,566 Views)

thanks for kind reply ... i just write dummy code...i have done much more complicated simulation that is not possible using events etc. in control and simulation loop adding variables /shift registers etc are not easily handle as in case structure you even cant add indicators, also cant add 'for' loop in control and simulation loop, so simple if possible for you plz, DO AMENDMENT IN MY ATTACHED VI AND GIVE ME THE ON TIME OF MY PUMP 

0 Kudos
Message 5 of 6
(2,561 Views)

@shami_jadoon wrote:

DO AMENDMENT IN MY ATTACHED VI AND GIVE ME THE ON TIME OF MY PUMP 


I regret to tell you that you have posted on the wrong Forum.  There is a Forum here called "LabVIEW Developers Seeking Employment" where you can probably hire someone to do your work for you, but if you want to learn to do it yourself, then put in a little effort, take some (free) tutorials, develop some code, and if you get stuck, we will certainly help.

 

Bob Schor

0 Kudos
Message 6 of 6
(2,550 Views)