09-23-2014 10:38 PM
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.
09-23-2014 11:01 PM
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.
09-23-2014 11:33 PM
Hi, RavensFan,
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
09-24-2014 12:10 AM - edited 09-24-2014 12:11 AM
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.
09-24-2014 12:40 AM
Hi, P@Anand,
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.
09-24-2014 08:03 AM
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.
10-01-2014 04:59 AM
Hi, RavensFan,
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?
10-01-2014 05:11 AM
Hi William,
the GeneralErrorHandler description also mentions ways to use your own error numbers/descriptions. Did you read all the documentation of this feature?
10-01-2014 05:26 AM
Hi, GerW,
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:)
08-22-2023 06:21 AM
Hello,
You can use ring control, and you can use the String property node of the ring to find the item names with the help of an index array