Sorting a list in InTouch

C

Thread Starter

Corne, Chris

Hello,

I have an Intouch application that on one of the operator display windows, they have a display of 40 pin temperatures. I would also like for them to display the top 5 pins as well as the temperature of the pin, the sorting being done from a QuickFunction inside of Intouch. The tagnames of the pins are I/O integer and are formatted like this for pins 1-9...BOTTOMELTEMP1OW64, BOTTOMELTEMP2OW66..etc. For pins 10-40, the format
is BOTTOMELTEMP10OW82, BOTTOMELTEMP11OW84..etc.

What I have written gives an error that shuts down InTouch with this error message:
"Unknown type in OP_COMP(): 28 w/ 79".

Here is an example of what I've done that is not working... pinXX being memory integer and nameXX being memory messages.

DIM SwapTemp AS INTEGER;
DIM SwapName AS MESSAGE;
DIM Swap AS DISCRETE;
DIM num_pin AS INTEGER;

pin01=BOTTOMELTEMP1OW64;
pin02=BOTTOMELTEMP2OW66;
{this continues on for the rest of the pins}

name01="pin01";
name02="pin02";
{this continues on for the rest of the pins}

{In the following section, loop_counter tagname has been defined as memory integer, INDPIN1 and INDPIN2 as indirect analog and INDNAME1 and INDNAME2 as indirect message}

Swap=1;
FOR loop_counter = 1 TO 39 {iterations}
IF swap==1 THEN
FOR num_pin = 1 TO 39 {number of pins -1}
INDPIN1.Name= "pin" + Text(num_pin,"00");
INDPIN2.Name= "pin" + Text(num_pin +1,"00");
INDNAME1.Name="name" +Text(num_pin,"00");
INDNAME2.Name="name" +Text(num_pin + 1,"00");
IF INDPIN2.Value>INDPIN1.Value THEN {Check if pin+1 is greater that
pin}
SwapTemp=INDPIN1.Value; {Swap values}
INDPIN1.Value=INDPIN2.Value;
INDPIN2.Value=SwapTemp;
SwapName=INDNAME1.Value; {Swap names}
INDNAME1.Value=INDNAME2.Value;
INDNAME2.Value=SwapName;
swap=1;
ELSE
swap=0;
ENDIF;
NEXT;
ELSE
EXIT FOR;
ENDIF;
NEXT;

BottomElHotTemp1=pin01;
BottomElHotTemp2=pin02;
BottomElHotTemp3=pin03;
BottomElHotTemp4=pin04;
BottomElHotTemp5=pin05;
BottomElHotPin1_String=name01;
BottomElHotPin2_String=name02;
BottomElHotPin3_String=name03;
BottomElHotPin4_String=name04;
BottomElHotPin5_String=name05;

Any help would be appreciated.

Chris Corne
 
C

Corne, Chris

<p>Hello,

<p>I found the problem that was giving the "Unknown type in OP_COMP(): 28 w/ 79" error. It was from the following section of code:
<pre>
Swap=1;
FOR loop_counter = 1 TO 39 {iterations}
IF swap==1 THEN
FOR num_pin = 1 TO 39 {number of pins -1}
INDPIN1.Name= "pin" + Text(num_pin,"00");
INDPIN2.Name= "pin" + Text(num_pin +1,"00");
INDNAME1.Name="name" +Text(num_pin,"00");
INDNAME2.Name="name" +Text(num_pin + 1,"00");
IF INDPIN2.Value>INDPIN1.Value THEN {Check if pin+1 is greater that
pin}
SwapTemp=INDPIN1.Value; {Swap values}
INDPIN1.Value=INDPIN2.Value;
INDPIN2.Value=SwapTemp;
SwapName=INDNAME1.Value; {Swap names}
INDNAME1.Value=INDNAME2.Value;
INDNAME2.Value=SwapName;
swap=1;
ELSE
swap=0;
ENDIF;
NEXT;
ELSE
EXIT FOR;
ENDIF;
NEXT;
</pre>
<p>What I had to do was not to use Swap as a "dim'd" variable. I had to make Swap a memory discrete. I do not know why this variable has to be in the tagname dictionary, it appears an ideal place for a tempory variable. That cleared up the error. Also, I had my Swap=1 line too high, that's a logic error!

<p>Chris Corne
 
A

Anthony Kerstens

I assume OP_COMP() is the name of the Quickscript.

Is "loop_counter" a defined tag. If not, there should be a DIM statement for it.

Also, there is no need for the indirect tags in a script. You should only need to DIM another two integer and message variables and just copy values.

However, given that InTouch gets shutdown, I would suggest that you call WW tech support. At a minimum they should be able to tell you what "28 w/ 79" means.

Anthony Kerstens P.Eng.
 
A

Anthony Kerstens

That doesn't sound right. I suggest calling WW tech support. I'd be curious to hear what they say about it.

Anthony Kerstens P.Eng.
 
C

Corne, Chris

Anthony,

Thanks for the help you have sent my way! I talked to my tech support about the issue. What they told me is that there is a known bug for using dimensioned discreet variables. The error will pop up when changing the state of the discrete, as I was doing in the script. Had I dimm'd the variable as an integer, there would have been no error. I am using InTouch 7.1 with patch 8a applied. A pretty cool thing is that my vendor actually read my post and called me that day to get the issue resolved. Pretty good service!

Chris Corne
 
Top