LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Re: how to reset Mean.vi

Hi friends

 

With help of my friend it makes this example.

 

Opinions are well come.

 

cpalka

0 Kudos
Message 11 of 15
(444 Views)

Hi cpalka,

 

did your friend tell you to hide ALL LABELS in the block diagram? NEVER EVER do so!

 

Why do you use shift registers in the way you do? Most of them could be replaced by direct wires:

check.png

I also replaced the FALSE constant at the while loop stop condition by a button: much easier to stop the VI.

I replaced the Mean ExpressVI by a simple Mean from the math palette: now you get a scalar value in a nice orange wire…

The feedback node after "Boolean" and the AND can be replace by PtByPt-BooleanCrossing function: much better documentation due to its help!

Your "booleans" should get better labels describing their purpose!

The two ExpressVIs in the snippet can easily be replaced by functions from SignalGeneration and array palette: see how far you get.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 12 of 15
(435 Views)

Try to find better friends. This program is just plain silly.

  • There is absolutely no need for a value property node.
  • Never ever hide the labels of terminals on the diagram.
  • You VI cannot be stopped, just aborted.
  • There is no reason in the world to maximize the front panel and diagram to the screen. Typically we want to look at both, even at the help page at the same time. Don't fill our gigantic monitors with 95% whitespace!
  • To keep a running mean, you don't need to accumulate arrays. There are scalar solutions. (e.g. continuously sum the values then divide by N). Still, we have "mean ptbypt".

Here's a very simple example that fits the earlier description to some extend, but modify as needed.

 

0 Kudos
Message 13 of 15
(428 Views)

Hi altenbach and GerdW

 

Thanks for your suggest and advises, many thanks.

In my data file I will need a first column with time.

Normally I use the blue wire, my friend prefer orange wire, but it needs to have a Tick count time.

I normally use the blue wire.

With the example of altenbach I will make my project then I will post here the final example.

Thanks

Cpalka

 

0 Kudos
Message 14 of 15
(420 Views)

@cpalka wrote:

 

In my data file I will need a first column with time. 


This is the first time you mention a data file. Is this now a different problem?

 


@cpalka wrote:

 

Normally I use the blue wire, my friend prefer orange wire, but it needs to have a Tick count time.

 


A blue wire is typically an integer. You have dynamic data wires, so call it that to avoid confusion. Dynamic data is very opaque because there is no way to tell what's in it from just looking at it. Could be single or multiple channels, numeric or boolean, etc. etc. You won't get errors if you connect them in a completely meaningless way. Most more advanced users stay far away from dynamic data)

 

Tick count outputs a blue U32 wire and represent a milliseconds counter that is completely random and useless. Only the difference between two tick counts has any useful meaning as long as it has not rolled over multiple times and the correct difference is still within the valid range.

 


@cpalka wrote:

 

With the example of altenbach I will make my project then I will post here the final example. 


Nothing is ever final. 😄

0 Kudos
Message 15 of 15
(415 Views)