10-19-2009 10:40 PM
Have 2Kw home wind turbine. Have a labview U3 interface so that I can have my PC monitor voltage and current entering 48 volt battery bank.
I have two scaler values in this Labview VI I'm making. ONe for current and one for voltage from sensors on my battery and regulator. To get power (Watts)
I run them through a Labview multiplier function (as volts X amps = power in watts). That's all well and good but I'd like to make a long term power meter and not just have instantanious
power. So what I'd like to know is does anyone know a VI function or subcircuit (for lack of a better word) that could take as an input a scaler value which in this case is watts
and add it second by second by time over time to yield a final result of Kilowatt-Hours? It to me, a fairly novice Labview user, this need screams for an integration function (area under the graph thing).
I've tinkered with the Labview integration function but as of yet no luck possibly because I don't know how to feed a meaningful signal into the upper and lower limits input.
Many thanks in advance! This is an awsome forum. Greg.
Solved! Go to Solution.
10-19-2009 11:04 PM - edited 10-19-2009 11:05 PM
10-19-2009 11:06 PM
10-20-2009 05:13 AM
There us a power usage (generation) VI in this LabVIEW example library:
http://zone.ni.com/devzone/cda/tut/p/id/8652
10-20-2009 09:26 AM
Thanks Parthabe! With your verbal description and a labview example I muddled together a working power meter based on the "do while" loop with shift register.
Only problem now is nothing else outside the loop is getting done during execution.(which should come as no surprise) I have other calculations and function calls that need to be done in my main program. Do you think maybe another control structure might also work with the shift register idea? Like "Timed structure", or "Event structure". I used to program Visual Basic back in the day and I recall a function loop called "on time" (or something like that) where all the code within that module will execute based on a specific amount of time passing then return control to the main program. Has anyone ever used the integration function in the mathematics palette? It sure seems like this is an application that fits the Integral perfectly. Adding tiny amounts of a rate changing input over time. Attached is a screen cap of my working meter. Just using scaler values from a Voltage and Amperage knob for now before configuring it to take in real world data from my LabJack U3.
10-20-2009 11:14 AM
10-20-2009 01:22 PM
You have a wait in the power loop which only runs once per second so any parallel loop should run with almost no interference from the power loop. Is your other code in a loop (with a wait)?
Lynn
10-20-2009 01:41 PM
The screen cap above did not include any of my other VI circuitry because I haven't merged this power meter application with it yet. (my main app is attached) All I had put together this morning was the power meter. Wanted to test it independently first. The primary VI was NOT in any kind of structure so that's probably an issue right there. I'm right now reading up on data flow and structures so I expect to change that. This is only my second attempt to do something in Labview so I apologize in advance for sounding like I don't really know what I'm doing. 🙂 Everyones input is appreciated. I'm reading up on shift registers now. 🙂 Greg.
10-21-2009 01:09 AM
bratvold wrote:
The primary VI was NOT in any kind of structure so that's probably an issue right there.
Hi Greg,
I assume that you mean the Main VI by this term...
Yes, without one more while loop (structure), it ll execute whatever code is there just once, and enter this power calc while loop & execute it forever, till the time you stop the loop manually using a button or or thro' some programmatical approach.
In your code picture earlier, what you need to do is to move the Numeric indicator outside of the while loop to get the sinal summed up value of power obtained after all the iterations are over.
10-21-2009 07:32 AM
Yes Partha, I meant the main VI wasn't in a loop. Up till this project whenever I experimented with a circuit I clicked on the "run continuously" so I wasn't aware that things not in a control loop of some kind only ran once. Makes sense to me now. BTW I did put the total power created readout INSIDE the loop because I want that info displayed all the time and not just when the loop was closed. In fact the power summation circuit in my application is going to be on all the time and only closed with the closure of the entire program. I studied a bunch of examples of the shift register and control loops and have a better feel for things.
I cut N pasted some VI examples provided with my card and now also have incorporated a frequency counter into the mix. I'll be using this with some zero crossing detector circuitry to have the RPM of the turbine displayed. Up till this point I didn't know you could just drag and drop working examples or parts of examples onto your project. That is Soooo awesome! Next challenge now is to put some kind of file read/write to have the power summation VI record the cumulated power value so you can restart the computer or application and have the program always have the lifetime power produced. Be thrilled to hear any suggestions on where I should look for the simplest solution to that. Attached is a screen cap of everything in my project right now.
Thanks again for the help. If you ever need anything from a machine shop, email me. 🙂 Greg.