My turn for a Crimson question - embedding tag in string.

TConnolly

Lifetime Supporting Member
Join Date
Apr 2005
Location
Salt Lake City
Posts
6,152
I have a multi state tag PumpStatus. When PumpStatus is 1 I want it to display RUNNING AT ???? RPM with the speed embedded as a part of the same data primitive. Crimson doesn't seem to want to take a tag reference here. I tried PumpRPM.Text and it took the text literally instead of giving me the tag value. Is there a way to do this as a part of the multi-state tag or will I end up having to use two primitives?

TC05061301.png
 
I have a multi state tag PumpStatus. When PumpStatus is 1 I want it to display RUNNING AT ???? RPM with the speed embedded as a part of the same data primitive. Crimson doesn't seem to want to take a tag reference here. I tried PumpRPM.Text and it took the text literally instead of giving me the tag value. Is there a way to do this as a part of the multi-state tag or will I end up having to use two primitives?


Easy...

= "RUNNING AT " + RPM_TAG + " RPM"

Actually not that simple. You need to convert RPM_TAG to Text. Use IntToText(RPM_TAG,10,4).

So it is:

= "RUNNING AT " + IntToText(RPM_TAG,10,4) + " RPM"

If you don't have an Integer, use DecToText with a little different format.
 
The leading = was what was tripping me up. Without it Crimson was taking the entire thing as a literal string. When I tried RUNNING AT PumpRPM.AsText RPM I got the literal string instead of the RPM value.

I used ="RUNNING AT" + PumpRPM.AsText and then formatted the PumpRPM tag with units of RPM I got what I wanted.
 
Last edited:
The leading = was what was tripping me up. Without it Crimson was taking the entire thing as a literal string. When I tried RUNNING AT PumpRPM.AsText RPM I got the literal string instead of the RPM value.

I used ="RUNNING AT" + PumpRPM.AsText and then formatted the PumpRPM tag with units of RPM I got what I wanted.

I normally think of using .AsText when using the Multi-States. That's why I gave the complicated solution.

Glad you got it worked out.
 

Similar Topics

I have this complex code tag that returns as a string variable. For some reason it returns the two strings with a ?? between them -- not the...
Replies
2
Views
3,498
Hi, I have a 1500 that controls a station with diferents warehouses, but i also have a 1200 that controls one of those warehouses, i have been...
Replies
9
Views
274
I have a Type C to RS485 adapter connect to my Siemens RWF55. I use modscan to scan it to get a value from the Siemens controller. In the...
Replies
4
Views
96
I'm new to the TotalFLow XIO and it has an attached TFIO DI/DO combo module. All I'm trying to do is close an output on the TFIO module. I'm...
Replies
3
Views
611
Hi everyone. I am in need of help on turning text in Factory Talk View ME. I know this has been asked before and I found the old thread/post. I...
Replies
0
Views
518
Back
Top Bottom