LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data acquisition in defined interval

Hi,

 

I am currently building a smart meter, and I am trying to record the total cost per day throughout the week. At the end of each day, I am trying record the total cost. (Ex: Suday $400 ..etc). Any suggestions?Weekly Estimate.JPG

0 Kudos
Message 1 of 20
(3,322 Views)

Honestly, what kind of help you expect? 🙂 You only attached a jpg picture (instead of your VI), and a rather limited description...

0 Kudos
Message 2 of 20
(3,297 Views)

Hi Seacreature,

 

I am trying to record the total cost per day throughout the week. At the end of each day, I am trying record the total cost. (Ex: Suday $400 ..etc). Any suggestions?

1. Develop the needed algorithm. Draw it on a sheet of paper. Yes, using pen and paper…

2. Program that algorithm using LabVIEW.

 

Which of these two steps is a problem to you?

Where are you stuck?

Do you get wrong results? If yes: why?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 20
(3,296 Views)

I have tried wiring Sunday up to the panel, but with no luck. My end goal is to record the daily total power consumption. Attached are my programs.

0 Kudos
Message 4 of 20
(3,275 Views)

Hi Seacreature,

 

your code should be cleaned up before improving it!

 

"sumer subVI":

check.png

Why do you need a formula node to sum up the contents of a cluster made purely by DBL values?

If you would create an array in your main VI you would not even need the ClusterToArray function!

 

"price indicator subVI":

check.png

There is a InRangeAndCoerce function available!

 

"power subVI": When working with clusters you should always typedefine them! And use (Un)BundleByName to make your code more readable!

 

"House power":

- All those clusters should be kept in an array. This way you could do all the computations efficiently (and scalable!) in an autoindexing loop! (Your "sumer subVI" would become senseless then!)

- LabVIEW can handle timestamps quite well, no need to count time manually using min, h, d, and month shift registers! And you can easily get the weekday from the timestamp - LabVIEW will do the calculation for you!

- Store the daily consumption in a shift register keeping an array of 7 values, one for each day of the week…

 - Create a LabVIEW project from your code and keep it in one folder with all (sub)VIs. When attaching your code you only need to ZIP this folder!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 20
(3,270 Views)

I want to display the first element from the numeric indicator, along with the second element from the numeric indicator and so on. 

Block Diagram.JPGFront Panel.JPG

 

 

0 Kudos
Message 6 of 20
(3,332 Views)

Attach your VI (note -- this is a file that ends with the extension "vi"), not a picture that we can't edit, inspect, execute, etc.  It will remove the ambiguity that comes when a LabVIEW beginner asks a question without providing enough information to remove ambiguities.

 

Not clear what you want.  Being able to see the details of your VI (from inspecting the code, not a picture) would let us "guess" and suggest things.

 

Bob Schor

0 Kudos
Message 7 of 20
(3,312 Views)

Sure. See attached

0 Kudos
Message 8 of 20
(3,308 Views)

So here's a guess -- you are new to LabVIEW, have been "seduced" by its ability to create a nice GUI, and you are busy designing a WEEKDay SMArt home profile (your capitalization puzzles me) routine without thinking about what you really want to do.

 

You've made the Classic Beginner Mistake of placing most of your code in a single Block Diagram that is so large that it is impossible to "see the forest for the trees".  There is a lot of duplication that suggests an Array Structure and a For Loop would do wonders.  It appears that you want to do a simulation, but don't quite understand how LabVIEW handles Time (Wait functions work on a millisecond clock).

 

Are you planning on starting this "simulation" and while it is running (over several days?  What about weekends?) changing when you are using the Washer and Drier, the TV, etc.?  You may have to be pretty nimble as Time Marches On.  Do you intend for it to "keep its own time" and change the Days of the Week for you?  

 

There is a lot of "confusion" going on here.  I've found the summing loop you were asking about, but must confess I still "don't get it".

 

Here are two suggestions.  First, develop your "simulation" with only one appliance (which should vastly simplify your code, and maybe make it fit on a single screen).  Test it, and see if it "does what you want".

 

Actually, the above is not the First thing to do.  The real First Thing to do involves no computer (though you can use one, if you want) but can be done with pencil and paper.  Write down what you are trying to do.  Don't worry about the details, but describe the Big Picture.  "I'm trying to model the electrical consumption and cost over a week's time of a home, where various appliances are turned on at various times.  I want to be able to specify XXX.  I want to graph YYY, and have the model ZZZ."  [I think this is what you are trying, but I don't know XXX, YYY, or ZZZ, and your code doesn't make it clear].

 

You clearly know about sub-VIs (as some are used in your program, but not provided -- did you write them, or are they provided to you as part of your assignment?).  Do you know about LabVIEW Project?  If you have multiple VIs in the same Folder, you can compress the folder and attach the resulting ZIP file so we can see the sub-VIs, as well (if you think that would be helpful to us).

 

Bob Schor 

Message 9 of 20
(3,298 Views)

I'm building a Home Smart Meter which measures the total power consumed in a house. I built the program inside the while loop, and it works perfectly. 

 

With that being said, here's my problem.

Since the power that is consumed during the week is different than the power consumed during the weekend, I decided to go ahead and build two separate while loops. However, how do I get the weekend while loop to run while the weekday while loop to start and vice versa? 

0 Kudos
Message 10 of 20
(3,277 Views)