LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Return a string's label as part of the string

I have a string which is an error as output from a Mathscript module. Because the string is an output of the Mathscript module, it is labeled as the name of the variable in the Mathscript module.

 

What I want to do is concatenate the string's label so that it precedes the string. In essence, when my error is returned (which is a generic error from a Matlab function), I want to know what variable (i.e. which sensor) is causing the error. So it will say something like "Label - Error Text".

 

I've seen examples on the forum of finding the label of a numeric indicator, but using that method doesn't seem to work for non-numeric datatypes. 

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

 

Use the label:text property of the string control (or indicator) that you are getting the error string from.

 

 

Then just concactenate the label text from that property along with maybe a  '-'   and then the error text itself to another string indicator in labVIEW.

 

 

 

 

 

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

It's not really a control or indicator. It's an output from the Mathscript node. 

 

I've attached a picture with the context help while hovering over the wire itself to explain a little better. I want to return the text "Rh_error" for this specific example. I see what you mean, but I don't see that option available for my case (it's available for that indicator titled "output" though).

 

Error Label.png

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

@twolfe13 wrote:

It's not really a control or indicator. It's an output from the Mathscript node. 

 

I've attached a picture with the context help while hovering over the wire itself to explain a little better. I want to return the text "Rh_error" for this specific example. I see what you mean, but I don't see that option available for my case (it's available for that indicator titled "output" though).

 

Error Label.png


I know it's not necessarily the most elegant solution, but you can rename the indicator to whatever you want and then use the property discussed above.  But hmmm, I would've expected that if you right-clicked on the output to make the indicator, it would've taken on the name of the array.

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 4 of 4
(2,687 Views)