If I have a ring constant, is it possible to get the context of that ring constant?
For example, I'd like to take the path capability to determine whether connect or not.
If the path is not available, I'd like to handle the error, putting the number of the ring to the code, and the text to the source.
It seemed it is difficult to work out my motivation, any suggestion will be appreciated:)
Solved! Go to Solution.
I don't know what you mean by "context of a ring constant". I don't know what you mean by "if the path is not available". I don't know what you mean by "work out my motiviation". (Bad translations to English from another language?)
So I'll try to answer the question in your message subject which is the only thing clear to me.
Ring controls or indicators let you use a property node that such as Strings to tell you the array of strings that make up the ring, or StringsandValues which is an array of clusters that match up the value to the string.
Sorry to let you confused with my poor English.
My question is "Ring Constant", not "Ring Control" or "Ring Indicator".
Have you seen my example? I think it is much clearer to look at the uploaded images, and you can ignore my poor English
For a Ring Constant directly you cannot. You can either create a control for that and use the property "Strings"to get the Item name in String format. Another way is by replacing the Ring Constant with an Enum constant and using the Format into String Primitive.
Thanks to your reply, the answer is impossible to get the text from a ring constant.
It's not happy that I can see the text of the ring explicitly on the block diagram but can not get access to the text of the ring constant directly.
You can never get the text associated with a value on a wire directly. The wire only contains a value. The text that is associated with that value is a property of the ring indicator or ring control. Those text strings are something that can easily be changed at run-time.
Thanks to your reply.
If I'd like to customize the error handling,
should I have to create an string array and fill the the texts of the ring items into the array and index the array to the error source?
Is there a better way to work it out?
the GeneralErrorHandler description also mentions ways to use your own error numbers/descriptions. Did you read all the documentation of this feature?
Thanks to your suggestion.
I originally want to use the texts of a ring to be the code source of my customized error, since the texts are meanful.
I can use the GeneralErrorHandler, even the Error Ring:)