LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Digging into an express vi... use of loacal variables

while digging into a an express vi I found this construction:

question01.png

 

I learned to use a shift register for such a task ...  mmh.

Is that a good  use of a local variable??? 

Does the compiler handle it like a shift register ?

Any pro and cons?

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


Message 1 of 5
(2,910 Views)

I think I commented on this year's ago. Also prepending the new data seems less efficient.

Nobody should be using this in production code. A better implementation would also allow the definition of a finite history size (xy chart).

Message 2 of 5
(2,903 Views)

Well Express VIs are not really meant to be used in anything more than those half day LabVIEW sales pitches "seminars" to show how fast you can just throw something together. 

 

So I would avoid using them to begin with and least of all using them as programming examples.

========================
=== Engineer Ambiguously ===
========================
Message 3 of 5
(2,895 Views)

Ok, so I haven't missed something on locals 😄

I thougth there is something like a code review for the vi.lib Smiley Surprised

Does express vi mean they where express coded?? Smiley Tongue

 

I'm afraid that to much ranting migth end in more and more closed source vis. A tendency I see more and more over the decades . One example: phase unwrap , was realized in LV, now it's a DLL call, and there are more. I understand that if you (NI) have a (C?) routine that works you can use it in LV LW ...   but it makes it harder to tweak a solution for your needs or simply answer questions the documentation (or should I say the input/output documentation?) doesn't answer.

 

 

 

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 4 of 5
(2,831 Views)

Most express VIs were created at a time when NI internally didn't enforce using VI Analyzer before distribution of LV components. Hence, quality of code was simply a result of the discipline and knowledge of the developer.

Sadly, not all ('inherited') code is nowadays reviewed to meet the current style rules so maybe it will be around like this for some time before getting cought by quality measures and corrected accordingly.

However, my personal thinking on express VIs is similar to altenbachs remark: If i implement for performance, i do not use 'comfort functions' like express VIs as i don't have the potential (and responsibility) to optimize for performance.....

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 5 of 5
(2,817 Views)