The attached program calculates the commutation offset for an absolute encoder.

Automation1: AbsoluteEncoderOffset.ascript

The current process outlined in the Automation1 help file requires the user to rotate or move the axis to the absolute feedback position of zero using TuningSetMotorAngle commands. This process can take a long time to complete. The attached program applies an TuningSetMotorAngle angle of 0 electrical degrees and uses the current position in counts, the PrimaryFeedbackResolution and MotorPolePitch to determine the distance from the zero absolute position to the current 0 mset angle. 

A modulo of the electrical cycle is applied and the remainder is the distance (in electrical cycles) from absolute zero to the first instance of zero electrical angle. Since the commutation offset is the electrical angle at the absolute zero position, this distance is subtracted from 360 degrees to arrive at the commutation offset angle.