LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

is there any way of getting the label of any variable as a string ?

Solved!
Go to solution
I don't think so... but somebody may have a way.
-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




0 Kudos
Message 11 of 18
(1,305 Views)

Ok...let me be more specific.

 

Let's say that I get some data from a frequency counter and a temperature controller. Those are double precision. What I want to do is label them with let's say "temp" and "freq". I want to create a subvi that I can use to write those values in a file but also create a header ( so I will basicly have 2 columns, one for temp and one for freq and at the top of each column i have the words temp and freq).  That subvi should create a header and write the values for any set (number and type) of data I input.

 

I know that I don't have to do it like that, but I just want to know if it's possible.  

0 Kudos
Message 12 of 18
(1,304 Views)

OK, that we can do.

 

As you can see, one of the properties is Label.txt.  If you make the property node box bigger by dragging down the bottom (below label.txt), you can get another property output.  You can set this one to "value" and you're ready to roll.  If you don't like that, you can use my VI just to get the label and then use the write to spreadsheet vi's to write the file.

 

Sound better?

-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




0 Kudos
Message 13 of 18
(1,301 Views)

🙂 Yes, I know how to get the value also, but I will still have to create the reference to that variable to use your vi.

 

When I get data from any instrument they go into an indicator (that I can choose to label or not). I do label it for obvious reasons. I could also create a string constant for each indicator containing the same string as the label and use that to write the header in the spreadsheet. I don't want to write the same text twice( i.e. write the label and the value of that string). 

 

I want to keep the looks of my vi as simple as posible. The instrument has its on subvi that outputs a value. that value goes to my indicator (labeled). I want to use that indicator (value and label) without creating refercence to it (it would take some time to do that if I have lets say 10 instrumets and instead of creating that reference I could just create a string for each data value given by each instrument containing the name of the data i.e. freq, temp, voltage, etc  ...the same as I would write on the label).

 

I know it may sound weird what I want to do, but if there is a way to do it, I would like to know (cause that is how I learn :D).

 

Thanks ! 

0 Kudos
Message 14 of 18
(1,296 Views)
I don't know of any way of getting both the value and the label text without a property node (and if you are doing it in a subVI -- that would require a reference).  If you are doing it from the same VI as the indicator, you could create a property node for the indicator and get the label.txt that way.
-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




Message 15 of 18
(1,293 Views)

Ok!

 

Is there a way of just writing the string constant conatining the name of the data and the use it to edit the label (so I wont have to write the label as well) ?

 

Does change to write option of the property node work in this case ?

0 Kudos
Message 16 of 18
(1,291 Views)
Also, is there a problem if i dont use the direct value of the indicator and use the property node instead to get the value ?
0 Kudos
Message 17 of 18
(1,289 Views)

Changing the property node to write should work fine for that.

-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




0 Kudos
Message 18 of 18
(1,289 Views)