If you have the **axis angles** for the robot joints, S&T should be nearly trivial to determine. If all you have is **Cartesian** coordinates, you will pretty much have to do the full DH kinematic model -- I ended up running into this exact problem about a year ago.

S&T are both Integer variables, representing a binary pattern where each bit reflects the position of a given axis. The Least Significant Bit (Bit 0) is always A1, and Bit 5 is always A6.

The T values simply indicate if an axis is above or below 0. The T bit is False if the associated axis is >=0, and True if the associated axis is <0. So for example, if $AXIS_ACT={91,-45,37,1,-1,0}, the T value would be 'b010010', which works out to an integer Base-10 value of 18.

S disambiguates axis positions when a given Cartesian position can be reached with multiple different axis configurations. S only has 3 bits. Bit 0 indicates if the robot is working in the Basic Area (False) or Overhead Area (True). Bit 1 indicates if A3 is higher or lower than Phi, but Phi is dependent on particular robot models. Bit 2 indicates A5, and is False if ((($AXIS_ACT.A5 >=0) AND ($AXIS_ACT.A5 < 180)) OR ($AXIS_ACT.A5 < -180)), and True if (($AXIS_ACT.A5 >=-180) AND ($AXIS_ACT.A5 < 0)) OR ($AXIS_ACT.A5 >= 180)).

The granular details are explained in the KUKA manual -- search for "status and turn".

One thing I notice that doesn't appear to be documented is where one might find the value of Phi in the MADA for a particular robot.