LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

simplying my code

Thanks Altenbach..  Very well put.

I guess my similar questions were not as clear in post # 16 above 😉

LOL!

😄

Message 21 of 27
(2,839 Views)
this is part of a bigger code.
i cant take out the local variables yet because i dont want to break anything..
i am trying to get rid of the stack sequences so that when i do take out the local variables. its easier to work with
Best regards,
Krispiekream
0 Kudos
Message 22 of 27
(2,832 Views)
Sometimes you have to take a deep breath and take the plunge to remove all the locals...  😉
 
Try to flatten the Stacked structure by changing it to a sequence frame.  It will be messy, but maybe simpler.  😮
0 Kudos
Message 23 of 27
(2,829 Views)
"Your code is full of coercion dots"

its it okay to leave it? it works fine?

the code i am working with is not made by me. i am "not that good"

what can i do to find all coercion dots?
do i manually search for them. or there is a search i can used to find all coercion dots?

thanks everyone for helping me out!
Best regards,
Krispiekream
0 Kudos
Message 24 of 27
(2,827 Views)


krispiekream wrote:
its it okay to leave it? it works fine?

Coercion dots should ALWAYS be carefully inspected. "Works fine" are often "famous last words", right before it crashes hard. 😮
 
Every coercion can cause trouble further down the line. For every coercion dot, you need to check what is coerced to what datatype and then you need to make an informed decision what you actually want.
Different datatypes have different valid numerical ranges, try e.g. to multiply an U32 value of 1 with an I32 diagram constant of -1.
I am pretty sure you would not expect a U32 result of 4294967295 (well, I would! ;)).
 
Basically, a coercion dot is always a big warning sign. It is much safer to eliminate them whenever possible to make things clear.
 
There is also a performance issue, which comes into play whenever you are coercing large data structures (e.g. arrays). Every coercion forces a datacopy in memory, so coercions can easily double the memory use of your program.

You can easily avoid coercions. For example for the Q&R case, wire the upper input first and then right-click on the lower input and "create constant" it will have a matching type without coercion. To create a diagram constant of the right type, you can also right-click a wire, control, or indicator and "create constant". Now just wire it up where needed.
Message 25 of 27
(2,813 Views)

You realize you have bottom to top, right to left programming style.
This is generally a bad idea (unless you are tst).

Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 26 of 27
(2,785 Views)
can someone convert this 8.0 version to
lavbivew 7.0?
I only have 7.0 on my notebook right now
thanks

Best regards,
Krispiekream
0 Kudos
Message 27 of 27
(2,757 Views)