07-21-2014 05:59 AM
I would love a discussion around this seemingly simple thing.
For passing many values into another VI, it is usual to use clusters, especially when there are many elements that go into the function. But what comes next? how do we as developers make the code most readable for ourselves and our colleagues?. Here are my two cents, Please contribute with more!.
Naming:
Names like "Input cluster" are of course bad, I like descriptive names like "Main control reference cluster"
When going into a VI:
How often haven't I done this:
This seems pretty usual, but wait. If i am in another state, I can't se anything of what data I have. I'ts just a small indicator. I can't really see what data I deal with without going to the frontpanel or scrolling.
so maybe this is better ?:
Now, without scrolling through the cases, and without jumping to the frontpanel, I can see what data goes into the state machine, I can even comment on the different names.
Or maybe I'm just overthinking stuff. what do you think?
As a P.S. the tunnel for the cluster in my opinion should be shift register if you are writing and reading from it. But I like to use normal tunneling when it is read-only data, like refnums.
-Magnus
07-21-2014 06:45 AM
@mersdal wrote:
Now, without scrolling through the cases, and without jumping to the frontpanel, I can see what data goes into the state machine, I can even comment on the different names.
Or maybe I'm just overthinking stuff. what do you think?
I think you are overthinking things here. The beauty of the Unbundle By Name is that you only see what you need to see. So each state just unbundles/bundles only what it needs. If a state doesn't need any of that data, then you don't see it. That is just fine. Showing more information often just confuses people.
Your other two points I fully agree with.
07-21-2014 08:35 AM
Durring development I see nothing wrong with the extra unbundle. The compiler is going to throw a warning about "Dead Code" ( remove it prior to code review if I'm a reviewer
) however, the compiler is going to toss out the dead code so there will be no perpormance hit at all other than a data copy in the BD space.
I would also use short captions that provide human friendly names show lables on the FP but the bundle/unbundles and terminals will pick up the captions and take up less BD space.
07-21-2014 08:56 AM
@JÞB wrote:
I would also use short captions that provide human friendly names show lables on the FP but the bundle/unbundles and terminals will pick up the captions and take up less BD space.
Dear sir, would you be so kind as to demonstrate, I understand all the words in your sentence, but not the sentence itself.
From what you said, I came to expect that a caption would shorten the name of a label if unbundle is set to hide full name.
what I did:
07-21-2014 09:02 AM