Crimson 3.0 Primitive for List indicator

gbradley

Lifetime Supporting Member
Join Date
Apr 2002
Location
Corona, Ca.
Posts
1,637
How can I make a text box where the Text will change based on the value in a tag?
Value of Integer Text
1 ......"ST0-Red"
2 ......"ST1-Orange"
4 ......"ST2-Yellow"
8 ......"ST3-Green"
16 ....."ST4-Blue"
32 ....."ST5-Violet"
64 ....."ST6-Grey"
...
I know how to make Flag bits, and then pile a bunch of Text boxes on top of each other, but that seems clumsy.

In PanelBuilder 32 it is called a list indicator.
 
One method is double click on the text on screen, on the properties box click on colours and then in there insert custom code. Below is an example of one I have done in the past...

the return value is simply the colour.

if (displayValues.tensionFinal < alarms.sp1Value)
{
return 0x03FF;
}
if ((displayValues.tensionFinal > alarms.sp1Value) && (displayValues.tensionFinal< alarms.sp2Value))
{
return 0x7FFF;
}
if (displayValues.tensionFinal > alarms.sp2Value)
{
return 0x001F;
}
 
How can I make a text box where the Text will change based on the value in a tag?
Value of Integer Text
1 ......"ST0-Red"
2 ......"ST1-Orange"
4 ......"ST2-Yellow"
8 ......"ST3-Green"
16 ....."ST4-Blue"
32 ....."ST5-Violet"
64 ....."ST6-Grey"
...
I know how to make Flag bits, and then pile a bunch of Text boxes on top of each other, but that seems clumsy.

In PanelBuilder 32 it is called a list indicator.

Simply configure the Integer Tag's Colors based on the State Values, and then go to the Text Color on the Primitive and choose Tag Fore and choose the Integer Tag.

Woops - I thought you said change the Color.

Here is what you should do.

The Integer Tag should use a Format Type "Multi-State" and then you can set the Data under Format States and the Text to what you want to display. Then on the Colors Tag choose Multi-State, Sync States and set the Colors to the Colors you want to use.
 
Last edited:
Got it.
I changed the tag Format Type to "Multi-State"

Text =Tagname.AsText
Works great.
Thank-you

You could have also used a data primitive rather than a text primitive and set the data to the Tagname. This gives you a little more flexibility.
 

Similar Topics

Is there a way to programatacially toggle a data primitive between display only mode and data entry mode? Before a cycle is started the operator...
Replies
2
Views
1,321
Is there a way to programmatically change the color of the clock primitive? Thanks,
Replies
1
Views
1,475
Hey guys, hoping someone here could give me a little advice. I'm working with a CR1000-04000 in Crimson 3.1 and I was interested in adding the...
Replies
4
Views
148
Hi, I'm having an issue in crimson 3.0 when I create a programme using a case statement referencing a fault word that each bit needs to change the...
Replies
5
Views
295
How do you install update on Red Lion Crimson ver 3.1. Do I just need to run the exe file on the host server?
Replies
1
Views
127
Back
Top Bottom