LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

i want to create a counter that save and add each power value (energy meter ) vi attached

Solved!
Go to solution

hello guys as you can see in the VI i want to create a counter that save and add each power value (for an energy meter project )so anyone help please 

0 Kudos
Message 1 of 7
(2,686 Views)
Solution
Accepted by topic author rihhs

use shift register

shiftreg.png

0 Kudos
Message 2 of 7
(2,668 Views)

also it would be good to look into producer-consumer design-pattern,

and using the Event Structure for your GUI.


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 3 of 7
(2,665 Views)

how it can help ??

 

0 Kudos
Message 4 of 7
(2,655 Views)

producer-consumer design pattern separates data acquisition from presenting/acting-on the data. it is like a template of good software architecture for this kind of problem.

 

the event structure can be used for reacting on GUI events like clicking a button, as well as acting on self created user events (this works like a queue, where the event structure can react on messages).

this helps to make it clear where and what you do in regards to user interaction.

 

 


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 5 of 7
(2,649 Views)

The benefits of choosing an appropriate software architecture may not be evident when a project is in its early stages.

However, it helps a lot later, when (very usually) it's needed to add more functionalities and features.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
Message 6 of 7
(2,642 Views)

a very simple example:

b1.png

 

NOTE: this is a snippet. if you save the .png on your computer, you can then drag+drop it onto a block diagram (directly drag+dropping from the image in the forum does not work anymore unfortunately)


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 7 of 7
(2,636 Views)