Redlion Crimson 3 command help.

TConnolly

Lifetime Supporting Member
Join Date
Apr 2005
Location
Salt Lake City
Posts
6,152
Redlion G306

I'm trying to set the minimum value data limit of a tag named CT01_HighAlarmSet where the minimum value is CT01_Setpoint+(2*CT01PropBand)+1 using the complex statement

return (CT01_Setpoint+(2*CT01_PropBand)+1);

The problem is CT01_PropBand is a floating point number and I get the error message that returned value must be an integer. There is no error message if I omit the floating point tag. What function do I use to cast CT01_PropBand as an integer?

edit:
I tried making an internal integer tag itag1 and using

itag1
:= 2*CT01_PropBand
return (CT01_Setpoint+itag1+1);

still no joy.
 
Last edited:
What function do I use to cast CT01_PropBand as an integer?

How about the handy dandy int() function?

It should not bark at you until it reaches the point where an assignment is made, so the tag or field containing this expression may be an integer and if so, you can wrap the whole expression like so:
return int(CT01_Setpoint+(2*CT01PropBand)+1)
I have found that int() and float() do exactly what you would expect to resolve these data type issues in expressions and scripts.
 
Thanks Paul.

Int() isn't listed in the function reference manual, found it buried on page 229 of the user manual. Just what I needed.
 

Similar Topics

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
126
Hi, I have a complex database in Crimson 3.0 and in one of the display pages I am trying to get a tag to show the sum of several other tags. The...
Replies
3
Views
173
It states WinPcap must be installed for the Emulator to function. WinPcap.org states that the technology is mature with no updates planned. Am I...
Replies
3
Views
864
Following on from another thread, I just downloaded Crimson 3.2 and it now supports CR and Graphite HMIs. Time for a 'play' :-) It seems to have...
Replies
14
Views
2,030
Action On Release command Set(ConveyorPopup,ConveyorPop_1) rejected w/ string tags. SetStringTag(index, data) wants an index. How does one pass...
Replies
8
Views
966
Back
Top Bottom