LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Should I make cluster into a Typedef

This is a very important point. What does the cluster represent?

You cluster data that represents some logical unit, where the clustered elements are related, and belong together.

Don't cluster a phone number, with a file reference and a float that holds the sine of an angle just to pass these 3 elements on one wire.

Labview classes start with a control/cluster definition that represents the attributes of a logically cohesive object. Then the supporting VI's are the allowed actions and behaviors of the things in that object.

Think of your cluster this way. A "thing" that has parts that can be represented by various data types, but they go together naturally.

Test ID, data channel for that test, output file for that test, start and end time for that test, technician that ran the test. That all goes together.

Height of a frog, a license plate number, array of strings containing names of musicians, date of the senior prom. These things could be combined into a cluster, but why? A cluster/typedef isn't a bucket to carry miscellaneous junk.

 

0 Kudos
Message 31 of 32
(329 Views)

@Dirtboy wrote:

This is a very important point. What does the cluster represent?

You cluster data that represents some logical unit, where the clustered elements are related, and belong together.

Don't cluster a phone number, with a file reference and a float that holds the sine of an angle just to pass these 3 elements on one wire.

Labview classes start with a control/cluster definition that represents the attributes of a logically cohesive object. Then the supporting VI's are the allowed actions and behaviors of the things in that object.

Think of your cluster this way. A "thing" that has parts that can be represented by various data types, but they go together naturally.

Test ID, data channel for that test, output file for that test, start and end time for that test, technician that ran the test. That all goes together.

Height of a frog, a license plate number, array of strings containing names of musicians, date of the senior prom. These things could be combined into a cluster, but why? A cluster/typedef isn't a bucket to carry miscellaneous junk.

 


But sometimes the only relationship they have is that they all visit the same places.  To me, that's a valid reason to put stuff into a cluster.  (Probably I'd clusterize the related data in separate clusters before putting them in the bigger one.)

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 32 of 32
(312 Views)