From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Inheriting Signal Name Attribute from Single Scalar Data

I am currently trying to log data to a file. Attached is a small clip of the program where I am logging the data. Functionally the code shown works and produces the output that I want except for naming the columns in the excel sheet with the correct signal names. In the past I have used the "Set Attributes" express vi to fix this but it is cumbersome especially when making any upstream code changes. Is there a way to have it assume the signal names automagically?

0 Kudos
Message 1 of 4
(2,507 Views)

What do you mean with 'cumbersome' and what type of upstream changes are you doing that don't reflect in your Attributes management code?

In your screenshot the parameter names are easily extractable from the cluster properties, but of course if you change the cluster content, that won't work straight forward.

So please attach example VIs of what works and what is challenging you, that will help the community understanding where you get stucked.

0 Kudos
Message 2 of 4
(2,458 Views)

If I want the signal names to transfer from the cluster, i need to convert to a dynamic signal then modify signal attributes where I manually populate the name string. If i modify the name of the signal in the cluster where the cluster is built i then need to manually update the name for the log file.

 

If i can extract the name (string) from the cluster then i can make this function automatic for each item in a cluster.

0 Kudos
Message 3 of 4
(2,453 Views)

It sounds like your problem is more related to getting the right parameter name (label?) from your cluster. Please correct me if I am wrong.

I guess what you need to do is to create a TypeDef that defines the cluster and use that TypeDef Control/Indicator both where you are creating and where you are reading your cluster. You'll then only have to update that TypeDef every time you modify your cluster parameter names (or content in general).

  An alternative (and more generic) approach to your task would require you to pass both parameter name (string) and value (what-ever-it-is) as part of your cluster, eventually as an array of clusters if needed.

0 Kudos
Message 4 of 4
(2,442 Views)