LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to bundle value, unit, name?

i read out several instruments and want to mark the signal with a unit and its name. So i will not get into trouble if i change my program a few months later.

 

i try to show what i wnat to do with an ASCII sketch

 

Instrument (Ta, 274, K)  ---> [ some magic with the values ] -----> .csv [Ta, K -> head of file ; 274 -> data row]

 

What would you suggest me to use? Should i bundle name, value and unit where Ta, and K are string constants.

Should i use a cluster, or an array or...?

================================
system: Win7 and debian stable
0 Kudos
Message 1 of 2
(2,110 Views)

If these items are related to each other (which they seem to be) I would recommend using a typedefed cluster. The benefit of the typedef is that if you need to modify the cluster definition all uses of it will pick up the update. The cluster is a good representation since you can have items of different types stored in it. An array all elements have to be the same type. BTW, you can have arrays of cluster if you will be dealing with multiple like items using the same cluster definition.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 2 of 2
(2,104 Views)