Hi!
Question:
I have implemented a Text Library like this,
Group 1 = XY e.g(XY = 10014)
Group 2 = X e.g(X = 100)
Group 3 = Y e.g(Y = 14)
On the other hand, in order to display my text I select my text object and click under dynamics; then I select TEXT, select MY TAG, and choose group 1 to retrieve the text I want to display (IT IS WORKING).
My question is how can I choose group2 and group 3 under the dynamics options to get the same results as just choosing group 1?
e.g. If the number is 10014, it has to display in a single line the text from value 100 and the text from value 14 using a sinlge text object.
hopefully I explaned myself correctly,
Thanks for your help.
Text Library
Re: Text Library
I don't think I understand the question. The text library will let you change values based off of a tags value. You can change values within a group dynamically, but you cannot change the groups dynamically.
- Attachments
-
- Snap 2012-08-31 at 09.01.48.png (41.28 KiB) Viewed 21002 times
-
- Snap 2012-08-31 at 09.01.17.png (33.38 KiB) Viewed 21002 times
Best Regards,
Beijer Electronics, Inc.
Ron Lloyd | Applications Engineer
Beijer Electronics, Inc.
Ron Lloyd | Applications Engineer
Re: Text Library
Sorry, let me try one more time,
Group1
--------
text-----------------start value----------------------end value
this is not ok------10014-------------------------------10014
Group2
---------
text-----------------start value----------------------end value
this is--------------100-------------------------------100
Group3
---------
text-----------------start value----------------------end value
not ok--------------14---------------------------------14
1. on the dynamics I click on TEXT, select TAG2, and specified GROUP1.
If the value is 10014, then is going to display the text THIS IS NOT OK
2. on the dynamics I click on TEXT, select TAG2, and specified GROUP1 and GROUP2. If the value is 10014, then is going to do 2 things:
a. grab the text (THIS IS) from GROUP2 because the first part of the value match 100
b. grab the text (NOT OK) from GROUP3 because the last part of the value match 14
I am doing this to avoid to create a long list(maybe 1000 options) which it could be the case of group1, but if I have group2 with 100 options and group3 with 10 options, I can make the same 1000 combinations with a short list on each group.
Group1
--------
text-----------------start value----------------------end value
this is not ok------10014-------------------------------10014
Group2
---------
text-----------------start value----------------------end value
this is--------------100-------------------------------100
Group3
---------
text-----------------start value----------------------end value
not ok--------------14---------------------------------14
1. on the dynamics I click on TEXT, select TAG2, and specified GROUP1.
If the value is 10014, then is going to display the text THIS IS NOT OK
2. on the dynamics I click on TEXT, select TAG2, and specified GROUP1 and GROUP2. If the value is 10014, then is going to do 2 things:
a. grab the text (THIS IS) from GROUP2 because the first part of the value match 100
b. grab the text (NOT OK) from GROUP3 because the last part of the value match 14
I am doing this to avoid to create a long list(maybe 1000 options) which it could be the case of group1, but if I have group2 with 100 options and group3 with 10 options, I can make the same 1000 combinations with a short list on each group.
Re: Text Library
Can we access the Text Library in the same way we access tags?
e.g. Globals.Tags.SPN.value...
e.g. Globals.Tags.SPN.value...
Re: Text Library
I don't know of a way to access a text library in script.
You may have some luck doing string manipulation between tags in script like this:
You may have some luck doing string manipulation between tags in script like this:
Code: Select all
void Tag1_ValueChange(System.Object sender, Neo.ApplicationFramework.Interfaces.Events.ValueChangedEventArgs e)
{
Globals.Tags.Tag3.SetAnalog(
Globals.Tags.Tag1.Value.String + Globals.Tags.Tag2.Value.String
);
}
Best Regards,
Beijer Electronics, Inc.
Ron Lloyd | Applications Engineer
Beijer Electronics, Inc.
Ron Lloyd | Applications Engineer
Re: Text Library
I've received an example project that might help.
- Attachments
-
- TextLibraryViaScripts.zip
- (19.32 KiB) Downloaded 1193 times
Best Regards,
Beijer Electronics, Inc.
Ron Lloyd | Applications Engineer
Beijer Electronics, Inc.
Ron Lloyd | Applications Engineer
Re: Text Library
Hi Ron,
Thanks for file; the example is helping me to understand better how the text library can be accesed by using scripts. Altough I have another question:
According to the example, we are adding to a textbox messages depending based on the index of a particular message, but what happend if an index is not given or the case where you want to get the text but based on the value?
suppose we have
text start value end value
message1 0 0
meesage2 1 1
message3 2 2
Thanks again
Thanks for file; the example is helping me to understand better how the text library can be accesed by using scripts. Altough I have another question:
According to the example, we are adding to a textbox messages depending based on the index of a particular message, but what happend if an index is not given or the case where you want to get the text but based on the value?
suppose we have
text start value end value
message1 0 0
meesage2 1 1
message3 2 2
Thanks again
Re: Text Library
You can use the "StartValue" or "EndValue" properties.
Code: Select all
int sVal = Globals.TextLibrary.Group1.Messages[i].StartValue;
int eVal = Globals.TextLibrary.Group1.Messages[i].EndValue;
Best Regards,
Beijer Electronics, Inc.
Ron Lloyd | Applications Engineer
Beijer Electronics, Inc.
Ron Lloyd | Applications Engineer
-
- Posts: 824
- Joined: Tue Mar 13, 2012 9:53 am
Re: Text Library
If you are only given the start and stop values, you need to search through all the messages and look for the message that has a start and stop value that matches your requirements.
pseudo code like this:
pseudo code like this:
Code: Select all
foreach (IMessageItem messageItem in Messages)
{
if (intValue >= messageItem.StartValue && intValue <= messageItem.EndValue)
return messageItem;
}
Best Regards,
Mark Monroe
Beijer Electronics, Inc. | Applications Engineer
Mark Monroe
Beijer Electronics, Inc. | Applications Engineer
Re: Text Library
In the text library I have 2 groups, X_Group and Y_Group.
X_Group Text X_Group Start Value X_Group End Value
--------------- --------------------- --------------------
sometext 500 500
Y_Group Text Y_Group Start Value Y_Group End Value
--------------- --------------------- --------------------
moretext 100 100
I need a button that dynamically sets the text of the button accordingly to the value sgiven.
exe. if value is 500 for the X_Group and 100 for the Y_Group, the text of the button will display sometextmoretext
In the past I did it using the Dynamics-General-Text property of the button:
-Text Library Group Converter
-Select the Tag
-Select the group
The issue is that I can get only 1 group, how can I do it with 2 groups?
Thanks.
X_Group Text X_Group Start Value X_Group End Value
--------------- --------------------- --------------------
sometext 500 500
Y_Group Text Y_Group Start Value Y_Group End Value
--------------- --------------------- --------------------
moretext 100 100
I need a button that dynamically sets the text of the button accordingly to the value sgiven.
exe. if value is 500 for the X_Group and 100 for the Y_Group, the text of the button will display sometextmoretext
In the past I did it using the Dynamics-General-Text property of the button:
-Text Library Group Converter
-Select the Tag
-Select the group
The issue is that I can get only 1 group, how can I do it with 2 groups?
Thanks.