TTXn sorting

C

Thread Starter

Chris Rile

Inquiry regarding how GE Mk 4( 5, 6) sorts thermocouple inputs into ascending order by temperature and keeps track of the thermocouple numbers for determining adjacents.

I'm not asking how spread is determined and used. But I'm asking what algorithm is used to sort the array of pairs (#1,1011),(#2,1001),(#3,1005)

into

1st(#2,1001)
2nd(#3,1005)
3rd(#1,1011)

or if it happens another way, and you can help me understand it would be appreciated.

I'm trying to provide an indication of which is hottest and the three coldest on a radar map on a DCS which receives (currently) only basic data dump info: TTRXB, TTXC, TTXDn, ... and spreads.

I've looked at a lot of sorting algorithms online. I have a pretty good set of tools to use: ABB 800xa. I was trying to program it in only the graphics... anyway I say that because I'm looking to understand how GE implemented beyond something like,

"oh they just used:

GEcustomSort(array) and voilla!"

Because I checked and I don't have that function available to use in my expressions.

Thnks in advance.
 
It would be best if you looked at the block in the Speedtronic that calculates the various arrays to understand how it's done.

The individual exhaust T/Cs are sorted into an "array" TTXD1_nn, which is basically exactly the same as the individual inputs, TTXD_nn.

Then, the block creates two more arrays. The first, TTXD2_nn, is a table of the exhaust T/C values from highest to lowest, and the companion array, JXD_n is the location of each of the T/Cs, from highest to lowest. So, presuming 18 exhaust T/Cs, if the highest exhaust T/C value was 1011 deg F, and it occurred at location 12, then TTXD2_0 would be 1011 and JXD_0 would be 12. If the lowest exhaust T/C value was 956 deg F and it occurred at location 11, then TTXD2_17 would be 956 and JXD_17 would be 11.

Then, it compares the values of the JXD_n arrays to determine if the hottest and coldest T/Cs are adjacent to each other. Very simple mathematical calculations, all clearly visible for anyone willing to take the time and a little bit of effort to see in the graphical representation in the block.

(I'm always amazed at people who only have rectangles with names to represent functions in many different control programming languages and need to have a manual or help file to understand what the block does, and these same people can't read a graphical representation of the same description in a rectangle in the Speedtronic block. There's no "GEcustomSort(array) and voila!"--in this case!)

So, you need to create two "arrays"--one of the values from highest to lowest (or lowest to highest as you prefer), and another of the corresponding locations from highest to lowest (or lowest to highest as you prefer) and then do what you will with the values. And you only need to do this if your "basic data dump" doesn't include the already calculated arrays listed above.

Hope this helps!

(P.S. I wasn't looking at a TTXMVn block when writing this; so, have a look at the block in the Speedtronic panel at your site to be sure I did the array numbering correctly. It's all in the graphical representation in the block--and it's very easy to follow if you will just spend a few minutes going through the block's descriptions.)
 
Thanks again for your help!

Makes sense but TTXD1_n Array on page 36G is just a box as is the SORT: HIGHEST TO LOWEST TTXD2_n (SORT) and JXD_n (INDEXES) on the same page. Page 36H of the elementary shows tables for the arrays and explains them, but at the time, I was a little unclear on the sorting method used.

I was able to accomplish my task with a little help from wikipedia using the 'insertion sort' method (good for small arrays and for arrays the time-to-sort and complexity of the operation goes down as needed. My implementation had a twist, as I was only concerned with the indexes really. Now my radar graph shows the operators which thermocouples are associated with the highest, lowest, 2nd lowest, and 3rd lowest temperatures. :)

Here's the code ABB TCL (basically PASCAL):<pre>
FOR n := 1 TO 18 DO
BEGIN
n1sortarray[n] := n;
END

FOR i := 1 TO 18 DO
BEGIN
value := t1sortarray;
j := i - 1;
done := 0;
REPEAT
IF t1sortarray[j] > value THEN
BEGIN
t1sortarray[j + 1] := t1sortarray[j];
n1sortarray[j + 1] := n1sortarray[j];
j := j - 1;
IF j < 0 THEN
done := 1;
END
ELSE
done := 1;
UNTIL done = 1;
t1sortarray[j + 1] := value;
n1sortarray[j + 1] := i;
END</pre>
The index is basically 1->n based not 0->n-1 and it is from coldest to hottest (not like GE) but it works. I did have to declare the array as 0->18 because the first pass through subtracts from n=1 giving a 0 index which may cause an error (it did for me, so I did 0-18 even though 0 isn't used).

call it a function, and call it from within a recurring loop where prior to its execution the array is filled with values from TTXD1_n and post execution array results are passed to wherever else you want.

I am interested in the 'graphical representation' that you're talking about, I'll have to look harder, because I'm still not sure exactly where to find it. I did see TTXMV algorithm and its something I can follow, as well as the TTRXC / TTRXB page, but I can't find the specifics for what occurs inside the blocks of TTXD1V2 elsewhere. So the code above is my best guess or approximation (albeit backwards).
 
Don't make this harder than it is. It's a very simple sort and comparison, though there is some scaling. Unfortunately, I can't see the Speedtronic elementary you're looking at, but while there is a box inside the algorithm that probably just says "SORT: HIGHEST TO LOWEST", that's all it is.

And if you look at the arrays on Logic Forcing or something or a Demand Display you can see how they work; they're really simple.

Best of luck!
 
Top