09-16-2019 12:08 PM
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.
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.
09-16-2019 12:17 PM
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.)
09-17-2019 08:54 AM
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.
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.
09-18-2019 08:19 AM
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
09-18-2019 08:24 AM
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
09-18-2019 10:51 AM
@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