Quantcast
Channel: LabVIEW topics
Viewing all articles
Browse latest Browse all 69758

Cluster controls best practices discussion

$
0
0

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:

normal 1.PNG

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 ?: 

norm2.PNG

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


Viewing all articles
Browse latest Browse all 69758

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>